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.9 by lethuill, Mon Jan 12 16:00:37 2009 UTC vs.
Revision 1.10 by lethuill, Thu Apr 16 14:49:13 2009 UTC

# Line 10 | Line 10
10   #include "Rtypes.h"
11   #include "TObject.h"
12   #include "TVector3.h"
13 + #include "TRef.h"
14 +
15 + #include "../interface/TRootVertex.h"
16  
17   using namespace std;
18  
# Line 30 | Line 33 | public:
33                  ,csa07process_()
34                  ,nBasicClusters_()
35                  ,nSuperClusters_()
36 +                ,primaryVertexIndex_(-1)
37                  ,primaryVertex_(0)
38                  ,idParton1_(-1)
39                  ,xParton1_(-1.)
# Line 68 | Line 72 | public:
72          Float_t csa07weight() const { return csa07weight_; }
73          TString csa07process() const { return csa07process_; }
74          
71        // Nb of primary vertices
72        unsigned nPrimaryVertices() const { return primaryVertex_.size(); }
73        
75          // Nb of BasicClusters of a given type
76          Int_t nBasicClusters(Int_t type)
77          {
# Line 86 | Line 87 | public:
87          }
88          
89          
90 <        // Primary Vertex as 3-vector
91 <        TVector3 primaryVertex() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0) : TVector3(0.,0.,0.) ); }
92 <        TVector3 primaryVertex(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i) : TVector3(0.,0.,0.) ); }
93 <        // x, y, z of Primary Vertex
94 <        Double_t primaryVertex_x() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).x() : 0. ); }
95 <        Double_t primaryVertex_y() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).y() : 0. ); }
96 <        Double_t primaryVertex_z() const { return (primaryVertex_.size()>0 ?  primaryVertex_.at(0).z() : 0. ); }
97 <        Double_t primaryVertex_x(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
98 <        Double_t primaryVertex_y(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
99 <        Double_t primaryVertex_z(unsigned i) const { return (primaryVertex_.size()>i ?  primaryVertex_.at(i).x() : 0. ); }
100 <        
90 >        // Selected Primary Vertex
91 >        Int_t primaryVertexIndex() const { return primaryVertexIndex_; }
92 >        TRootVertex* primaryVertex() const
93 >        {
94 >                if ( primaryVertex_==0)
95 >                {
96 >                        cout << "   ********** Error in TRootEvent::primaryVertex() - No primary vertex selected **********" << endl;
97 >                        return 0;
98 >                }
99 >                else
100 >                {
101 >                        return (TRootVertex*) primaryVertex_.GetObject();
102 >                }
103 >        }
104 >
105 >
106          // PDF infos
107          // flavour first incoming parton
108          Int_t idParton1() const { return idParton1_; }
# Line 129 | Line 135 | public:
135          
136          void setNBasicClusters(Int_t type,Int_t nBC) { nBasicClusters_[type]=nBC; }
137          void setNSuperClusters(Int_t type,Int_t nSC) { nSuperClusters_[type]=nSC; }
138 <                
139 <        void addPrimaryVertex(TVector3 vertex) {  primaryVertex_.push_back(vertex); }
140 <        void clearPrimaryVertex(TVector3 vertex) {  primaryVertex_.clear(); }
138 >
139 >        void setPrimaryVertexIndex(Int_t primaryVertexIndex) { primaryVertexIndex_=primaryVertexIndex; }
140 >        void setPrimaryVertex(TRootVertex* primaryVertex) { primaryVertex_ = primaryVertex; }
141  
142          void setIdParton1(Int_t idParton1) { idParton1_=idParton1; }
143          void setXParton1(Float_t xParton1) { xParton1_=xParton1; }
# Line 166 | Line 172 | private:
172          
173          map<Int_t,Int_t> nBasicClusters_;
174          map<Int_t,Int_t> nSuperClusters_;
175 <        std::vector<TVector3> primaryVertex_;
175 >
176 >        // Selected Primary vertex (by VertexAnalyzer::SelectPrimary)
177 >        Int_t primaryVertexIndex_; // Index in vertices TClonesArray of the selected primary vertex
178 >        TRef primaryVertex_; // Reference to the TRootVertex of the selected primary vertex
179  
180          // PDF infos
181          Int_t idParton1_;
# Line 175 | Line 184 | private:
184          Float_t xParton2_;
185          Float_t factorizationScale_;
186  
187 <        ClassDef (TRootEvent,1);
187 >        ClassDef (TRootEvent,2);
188   };
189  
190   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines