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 |
#include "UserCode/HbbAnalysis/interface/Candidate.hh"
|
10 |
|
11 |
namespace HbbAnalysis {
|
12 |
|
13 |
class GenParticle : public Candidate {
|
14 |
public:
|
15 |
//Constructors
|
16 |
GenParticle();
|
17 |
GenParticle(const HbbAnalysis::FourMomentum & aFourVec,
|
18 |
const HbbAnalysis::GenVars & aGenVars
|
19 |
) : Candidate(aFourVec){
|
20 |
genVars(aGenVars);
|
21 |
};
|
22 |
|
23 |
//Getters
|
24 |
inline const HbbAnalysis::GenVars & genVars() const {
|
25 |
return genVars_;
|
26 |
};
|
27 |
|
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 std::vector<unsigned int> getParents(){
|
41 |
return parentIndex_;
|
42 |
};
|
43 |
|
44 |
inline std::vector<unsigned int> getChildren(){
|
45 |
return childIndex_;
|
46 |
};
|
47 |
|
48 |
void Clear();
|
49 |
|
50 |
void Print() const;
|
51 |
/*
|
52 |
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 |
<< " ---- daughters: " ;
|
67 |
for (unsigned int i(0); i<childIndex_.size(); i++){
|
68 |
std::cout << childIndex_.at(i) << " " ;
|
69 |
}
|
70 |
std::cout << std::endl
|
71 |
<< "=======================================================" << std::endl;
|
72 |
|
73 |
};
|
74 |
*/
|
75 |
|
76 |
/*
|
77 |
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 |
*/
|
90 |
|
91 |
private:
|
92 |
HbbAnalysis::GenVars genVars_;
|
93 |
std::vector<unsigned int> parentIndex_;
|
94 |
std::vector<unsigned int> childIndex_;
|
95 |
};
|
96 |
|
97 |
|
98 |
inline bool operator < (const GenParticle & one, const GenParticle & two)
|
99 |
{
|
100 |
return one.GetTLorentzVector().Pt() > two.GetTLorentzVector().Pt();
|
101 |
}
|
102 |
|
103 |
|
104 |
}//namespace
|
105 |
#endif
|