ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dhidas/OSUAnalysis/Tools/interface/RecoCandidateBase.h
Revision: 1.1.1.1 (vendor branch)
Committed: Thu Dec 1 16:28:48 2011 UTC (13 years, 5 months ago) by dhidas
Content type: text/plain
Branch: dhidas, MAIN
CVS Tags: START, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
osu copy modified

File Contents

# User Rev Content
1 dhidas 1.1 /*
2     * RecoCandidateBase.h
3     *
4     * Base class for reconstructed candidates
5     *
6     * To create a new reconstructed candidate, called "mycandidate", for example,
7     * do the following in a new header file:
8    
9     #include "RecoCandidateBase.h"
10    
11    
12     namespace OAT {
13    
14     class mycandidate: public RecoCandidateBase {
15    
16     public:
17     mycandidate()
18     {}
19    
20     mycandidate(const Event& event) :
21     RecoCandidateBase(event)
22     {}
23    
24     virtual bool passesFullSelection() const;
25     virtual void reconstructCandidate(const ElectronPointer &electron);
26    
27     // The following is an example member function that would return the mass
28     // of the candidate. You could create other functions instead.
29     virtual double getMass() const;
30    
31    
32     // Add other functions here that return the values you want to plot.
33    
34     protected:
35    
36     // Your data members,if any, should be declared here.
37    
38     };
39     }
40    
41     Then you have to code the last three functions in a new file you create in the
42     "src" directory. Make sure to add the following lines to the top of your
43     source code file:
44    
45     #include "../interface/RecoCandidateBase.h"
46    
47     using namespace OAT;
48    
49     After completing the code for "mycandidate", you can put calls to your class
50     in IntroAnalysis.h and IntroAnalysis.cpp. Add the declaration of your
51     candidate to the "private" section of the IntroAnalysis class where other
52     candidates are declared. Then, in IntroAnalysis.cpp, instantiate your
53     candidate in the initiateEvent member function where the other candidates
54     are instantiated.
55    
56     Then you should write your own analysis function that will
57     check if the current event should be selected by calling passesFullSelection,
58     and, if so, reconstruct it with reconstructCandidate and then add its mass to
59     a histogram with getMass. See doTTBarAnalysis in IntroAnalysis.cpp for an
60     example of an analysis function. You need to add a call to your analysis
61     function in the main event loop of the "analyze" function.
62    
63     */
64    
65    
66     #ifndef RECOCANDIDATEBASE_H_
67     #define RECOCANDIDATEBASE_H_
68    
69     #include <boost/shared_ptr.hpp>
70    
71     #include "Event.h"
72     #include "RecoObjects/Particle.h"
73     #include "RecoObjects/Electron.h"
74     #include "RecoObjects/Jet.h"
75    
76    
77     using namespace BAT;
78    
79     namespace OAT {
80    
81     class RecoCandidateBase: public Event {
82    
83     public:
84    
85     RecoCandidateBase()
86     {}
87    
88     RecoCandidateBase(const Event& event) :
89     Event(event)
90     {}
91    
92     virtual ~RecoCandidateBase()
93     {}
94    
95     virtual bool passesFullSelection() const = 0;
96    
97     /*
98     Sample reconstruction function:
99    
100     virtual void reconstructCandidate(const ElectronPointer &electron);
101    
102     Note your reconstruction function may not take a parameter or may
103     take different parameters from this example.
104     */
105    
106     };
107    
108     }
109    
110     #endif /* RECOCANDIDATEBASE_H_ */