ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/GenParticle.hh
Revision: 1.5
Committed: Tue Oct 25 13:26:50 2011 UTC (13 years, 6 months ago) by agilbert
Content type: text/plain
Branch: MAIN
CVS Tags: v01-00-00
Changes since 1.4: +34 -34 lines
Log Message:
Significant code re-write.  Compiles under 4_2_4 but may not work as expected.  Files marked as broken may need to be fixed in the future.

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     /*
50 amagnan 1.1 inline void print() const{
51    
52     std::cout << "=======================================================" << std::endl
53     << "================== Print GenParticle ==================" << std::endl
54     << "=======================================================" << std::endl
55     << " ---- index : " << part_.index << std::endl
56     << " ---- pdgId : " << part_.pdgId << std::endl
57     << " ---- status: " << part_.status << std::endl
58     << " ---- pt,eta,phi: " << part_.pT << " " << part_.eta << " " << part_.phi << std::endl
59     << " ---- parents: " ;
60     for (unsigned int i(0); i<parentIndex_.size(); i++){
61     std::cout << parentIndex_.at(i) << " " ;
62     }
63     std::cout << std::endl
64 agilbert 1.5 << " ---- daughters: " ;
65     for (unsigned int i(0); i<childIndex_.size(); i++){
66     std::cout << childIndex_.at(i) << " " ;
67     }
68     std::cout << std::endl
69 amagnan 1.1 << "=======================================================" << std::endl;
70    
71     };
72 agilbert 1.5 */
73 amagnan 1.1
74 agilbert 1.5 /*
75 amagnan 1.4 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 agilbert 1.5 */
88 amagnan 1.4
89 amagnan 1.1 private:
90 agilbert 1.5 HbbAnalysis::GenVars genVars_;
91 amagnan 1.1 std::vector<unsigned int> parentIndex_;
92 agilbert 1.5 std::vector<unsigned int> childIndex_;
93 amagnan 1.1 };
94    
95 agilbert 1.5
96 amagnan 1.3 inline bool operator < (const GenParticle & one, const GenParticle & two)
97     {
98 agilbert 1.5 return one.GetTLorentzVector().Pt() > two.GetTLorentzVector().Pt();
99 amagnan 1.3 }
100    
101    
102 amagnan 1.1 }//namespace
103     #endif