ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/GenParticle.hh
(Generate patch)

Comparing UserCode/HbbAnalysis/interface/GenParticle.hh (file contents):
Revision 1.1 by amagnan, Thu Sep 17 19:39:50 2009 UTC vs.
Revision 1.5 by agilbert, Tue Oct 25 13:26:50 2011 UTC

# Line 6 | Line 6
6   #include <iostream>
7  
8   #include "UserCode/HbbAnalysis/interface/Objects.hh"
9 + #include "UserCode/HbbAnalysis/interface/Candidate.hh"
10  
11   namespace HbbAnalysis {
12  
13 <  class GenParticle {
13 <
13 >  class GenParticle : public Candidate {
14    public:
15 <
16 <
17 <    /** Constructors */
18 <
19 <    GenParticle(){
20 <      Clear();
15 >    //Constructors
16 >    GenParticle();
17 >    GenParticle(const HbbAnalysis::FourMomentum & aFourVec,
18 >        const HbbAnalysis::GenVars & aGenVars
19 >        ) : Candidate(aFourVec){
20 >      genVars(aGenVars);
21      };
22  
23 <    ~GenParticle(){};
24 <
25 <    GenParticle(const HbbAnalysis::MCVars & aPart){
26 <      Clear();
27 <      partVars(aPart);
23 >    //Getters
24 >    inline const HbbAnalysis::GenVars  & genVars() const {
25 >      return genVars_;
26      };
27  
28 <    inline const HbbAnalysis::MCVars  & partVars() const {
29 <      return part_;
32 <    };
33 <
34 <    inline void partVars(const HbbAnalysis::MCVars & aPart) {
35 <      part_ = aPart;
28 >    inline void genVars(const HbbAnalysis::GenVars & aGenVars) {
29 >      genVars_ = aGenVars;
30      };
31  
32      inline void setParent(const unsigned int aPar){
33        parentIndex_.push_back(aPar);
34      };
35 +    
36 +    inline void setChild(const unsigned int aPar){
37 +      childIndex_.push_back(aPar);
38 +    };
39  
40 <    inline const std::vector<unsigned int> getParents(){
40 >    inline std::vector<unsigned int> getParents(){
41        return parentIndex_;
42      };
43  
44 <    inline void Clear(){
45 <      part_.index = 0;
48 <      part_.pT = 0;
49 <      part_.eta = 0;
50 <      part_.phi = 0;
51 <      part_.pdgId = 0;
52 <      part_.status = 0;
53 <
54 <      parentIndex_.clear();
44 >    inline std::vector<unsigned int> getChildren(){
45 >      return childIndex_;
46      };
47  
48 +    void Clear();
49 +    /*
50      inline void print() const{
51  
52        std::cout << "=======================================================" << std::endl
# Line 68 | Line 61 | namespace HbbAnalysis {
61          std::cout << parentIndex_.at(i) << " " ;
62        }
63        std::cout << std::endl
64 +                << " ---- daughters: " ;
65 +      for (unsigned int i(0); i<childIndex_.size(); i++){
66 +        std::cout << childIndex_.at(i) << " " ;
67 +      }
68 +      std::cout << std::endl
69                  << "=======================================================" << std::endl;
70  
71      };
72 +    */
73  
74 <  private:
74 >    /*
75 >    inline TLorentzVector fourMomentum()
76 >    {
77 >      double lpx = part_.pT*cos(part_.phi);
78 >      double lpy = part_.pT*sin(part_.phi);
79 >      //double lp = part_.pT/sin(2*atan(exp(-part_.eta)));
80 >      //double lpz = sqrt(lp*lp - part_.pT*part_.pT);
81 >      double lpz = part_.pT*sinh(part_.eta);
82 >      double lE = part_.E;
83 >      
84 >      return TLorentzVector(lpx,lpy,lpz,lE);
85 >      
86 >    };
87 >    */
88  
89 <    HbbAnalysis::MCVars part_;
89 >  private:
90 >    HbbAnalysis::GenVars genVars_;
91      std::vector<unsigned int> parentIndex_;
92 <
92 >    std::vector<unsigned int> childIndex_;
93    };
94    
95 +  
96 +  inline bool operator < (const GenParticle & one, const GenParticle & two)
97 +  {
98 +    return one.GetTLorentzVector().Pt() > two.GetTLorentzVector().Pt();
99 +  }
100 +  
101 +
102   }//namespace
103   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines