ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootEvent.h
(Generate patch)

Comparing UserCode/Morgan/interface/TRootEvent.h (file contents):
Revision 1.1 by mlethuil, Mon May 19 16:12:13 2008 UTC vs.
Revision 1.3 by mlethuil, Mon Jun 23 13:31:11 2008 UTC

# Line 14 | Line 14 | class TRootEvent : public TObject
14   {
15          
16   public:
17 <        //TRootEvent() : nb_(0), trigL1_(-999), trigHLT_(-999), primaryVertex_(), metCalo_() {;}
18 <        TRootEvent() : nb_(0), trigL1_(-999), trigHLT_(-999), nBasicClusters_(), nSuperClusters_(), primaryVertex_(), metCalo_() {;}
17 >        
18 >        TRootEvent() :
19 >                        nb_(0)
20 >                        ,passGlobalL1_(false)
21 >                        ,passGlobalHLT_(false)
22 >                        ,trigHLT_(0)
23 >                        ,csa07id_(0)
24 >                        ,csa07weight_(0.)
25 >                        ,csa07process_()
26 >                        ,nBasicClusters_()
27 >                        ,nSuperClusters_()
28 >                        ,primaryVertex_(0)
29 >                        ,metCalo_()
30 >                        {;}
31 >
32          ~TRootEvent() {;}
33                  
34          // Event number
35 <        Int_t nb() { return nb_; }
35 >        Int_t nb() const { return nb_; }
36          
37          // Trigger decision
38 <        Int_t trigL1() { return trigL1_; }
39 <        Int_t trigHLT() { return trigHLT_; }
38 >        Int_t passGlobalL1() const { return passGlobalL1_; }
39 >        Bool_t passGlobalHLT() const { return passGlobalHLT_; }
40 >        unsigned int nHLTPaths() const { return trigHLT_.size(); }
41 >        std::vector<Bool_t> trigHLT() const { return trigHLT_; }
42 >        Bool_t trigHLT(unsigned int i) const
43 >        {
44 >                 if (trigHLT_.size()>i)
45 >                 {
46 >                        return trigHLT_.at(i);
47 >                 }
48 >                 else
49 >                 {
50 >                         cout << "HLT path " << i << " not found" << endl;
51 >                         return false;
52 >                 }
53 >        }
54  
55 +        // CSA07 Process Id and Event Weight
56 +        Int_t csa07id() const { return csa07id_; }
57 +        Float_t csa07weight() const { return csa07weight_; }
58 +        TString csa07process() const { return csa07process_; }
59 +        
60          // Nb of primary vertices
61 <        unsigned nPrimaryVertices() { return primaryVertex_.size(); }
61 >        unsigned nPrimaryVertices() const { return primaryVertex_.size(); }
62          
63          // Nb of BasicClusters of a given type
64          Int_t nBasicClusters(Int_t type)
# Line 44 | Line 76 | public:
76          
77          
78          // Primary Vertex as 3-vector
79 <        TVector3 primaryVertex() { return (primaryVertex_.size()>=0 ?  primaryVertex_[0] : TVector3(0.,0.,0.) ); }
80 <        TVector3 primaryVertex(unsigned i) { return (primaryVertex_.size()>=i ?  primaryVertex_[i] : TVector3(0.,0.,0.) ); }
79 >        TVector3 primaryVertex() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0) : TVector3(0.,0.,0.) ); }
80 >        TVector3 primaryVertex(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i) : TVector3(0.,0.,0.) ); }
81          // x, y, z of Primary Vertex
82 <        Double_t primaryVertex_x() { return (primaryVertex_.size()>=0 ?  primaryVertex_[0].x() : 0. ); }
83 <        Double_t primaryVertex_y() { return (primaryVertex_.size()>=0 ?  primaryVertex_[0].y() : 0. ); }
84 <        Double_t primaryVertex_z() { return (primaryVertex_.size()>=0 ?  primaryVertex_[0].z() : 0. ); }
85 <        Double_t primaryVertex_x(unsigned i) { return (primaryVertex_.size()>=i ?  primaryVertex_[i].x() : 0. ); }
86 <        Double_t primaryVertex_y(unsigned i) { return (primaryVertex_.size()>=i ?  primaryVertex_[i].x() : 0. ); }
87 <        Double_t primaryVertex_z(unsigned i) { return (primaryVertex_.size()>=i ?  primaryVertex_[i].x() : 0. ); }
82 >        Double_t primaryVertex_x() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).x() : 0. ); }
83 >        Double_t primaryVertex_y() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).y() : 0. ); }
84 >        Double_t primaryVertex_z() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).z() : 0. ); }
85 >        Double_t primaryVertex_x(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
86 >        Double_t primaryVertex_y(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
87 >        Double_t primaryVertex_z(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
88          
89          // Missing Et as 3-vector
90 <        TVector3 metCaloVect() { return metCalo_; }
90 >        TVector3 metCaloVect() const { return metCalo_; }
91          // Missing Et magnitude
92 <        Double_t metCalo() { return sqrt(metCalo_.Perp2()); }
92 >        Double_t metCalo() const { return sqrt(metCalo_.Perp2()); }
93          
94          
95          void setNb(Int_t nb) { nb_ = nb; }
96 <        void setTrigL1(Int_t trigL1) { trigL1_ = trigL1; }
97 <        void setTrigHLT(Int_t trigHLT) { trigHLT_ = trigHLT; }
96 >        void setGlobalL1(Int_t passGlobalL1) { passGlobalL1_ = passGlobalL1; }
97 >        void setGlobalHLT(Bool_t passGlobalHLT) { passGlobalHLT_ = passGlobalHLT_; }
98 >        void setTrigHLT(std::vector<Bool_t> trigHLT)
99 >        {
100 >                trigHLT_.resize(trigHLT.size());
101 >                for (unsigned int i=0; i!=trigHLT.size(); ++i) trigHLT_[i]=trigHLT[i];
102 >        }
103 >
104 >        void setCsa07id(Int_t csa07id) { csa07id_=csa07id; }
105 >        void setCsa07weight(Float_t csa07weight)  { csa07weight_=csa07weight; }
106 >        void setCsa07process(TString csa07process)  { csa07process_=csa07process; }
107 >        void setCsa07process(char* csa07process)  { csa07process_=csa07process; }
108          
109          void setNBasicClusters(Int_t type,Int_t nBC) { nBasicClusters_[type]=nBC; }
110          void setNSuperClusters(Int_t type,Int_t nSC) { nSuperClusters_[type]=nSC; }
111                  
112          void addPrimaryVertex(TVector3 vertex) {  primaryVertex_.push_back(vertex); }
113          void clearPrimaryVertex(TVector3 vertex) {  primaryVertex_.clear(); }
72        //void setPrimaryVertexVect(TVector3 primaryVertex) { primaryVertex_ = primaryVertex; }
114          void setMetCaloVect(TVector3 metCaloVect) { metCalo_ = metCaloVect; }
115          
116          /*
# Line 82 | Line 123 | public:
123          */
124          
125   private:
126 <
126 >        
127          Int_t nb_;
128 <        Int_t trigL1_;
129 <        Int_t trigHLT_;
128 >        Bool_t passGlobalL1_;
129 >        Bool_t passGlobalHLT_;
130 >        std::vector<Bool_t> trigHLT_;
131 >        
132 >        Int_t csa07id_;
133 >        Float_t csa07weight_;
134 >        TString csa07process_;
135          
136          map<Int_t,Int_t> nBasicClusters_;
137          map<Int_t,Int_t> nSuperClusters_;
138          std::vector<TVector3> primaryVertex_;
93        //TVector3 primaryVertex_;
139  
95        
140          TVector3 metCalo_;
97        // TODO - Add Global variables: Sphericity, F-W momenta....    
141                  
142 <        ClassDef (TRootEvent,1);
142 >        ClassDef (TRootEvent,2);
143   };
144  
145   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines