ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/GenParticle.hh
Revision: 1.6
Committed: Wed Jan 25 18:45:49 2012 UTC (13 years, 3 months ago) by agilbert
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -0 lines
Log Message:
Lots of updates

File Contents

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