ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/GenParticle.hh
Revision: 1.2
Committed: Mon May 10 18:45:09 2010 UTC (14 years, 11 months ago) by amagnan
Content type: text/plain
Branch: MAIN
CVS Tags: v00-05-01, v00-05-00
Changes since 1.1: +1 -0 lines
Log Message:
add etaDet calculation, rapidity, adapt to new reco::JPTJet format

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    
10     namespace HbbAnalysis {
11    
12     class GenParticle {
13    
14     public:
15    
16    
17     /** Constructors */
18    
19     GenParticle(){
20     Clear();
21     };
22    
23     ~GenParticle(){};
24    
25     GenParticle(const HbbAnalysis::MCVars & aPart){
26     Clear();
27     partVars(aPart);
28     };
29    
30     inline const HbbAnalysis::MCVars & partVars() const {
31     return part_;
32     };
33    
34     inline void partVars(const HbbAnalysis::MCVars & aPart) {
35     part_ = aPart;
36     };
37    
38     inline void setParent(const unsigned int aPar){
39     parentIndex_.push_back(aPar);
40     };
41    
42     inline const std::vector<unsigned int> getParents(){
43     return parentIndex_;
44     };
45    
46     inline void Clear(){
47     part_.index = 0;
48     part_.pT = 0;
49     part_.eta = 0;
50 amagnan 1.2 part_.y = 0;
51 amagnan 1.1 part_.phi = 0;
52     part_.pdgId = 0;
53     part_.status = 0;
54    
55     parentIndex_.clear();
56     };
57    
58     inline void print() const{
59    
60     std::cout << "=======================================================" << std::endl
61     << "================== Print GenParticle ==================" << std::endl
62     << "=======================================================" << std::endl
63     << " ---- index : " << part_.index << std::endl
64     << " ---- pdgId : " << part_.pdgId << std::endl
65     << " ---- status: " << part_.status << std::endl
66     << " ---- pt,eta,phi: " << part_.pT << " " << part_.eta << " " << part_.phi << std::endl
67     << " ---- parents: " ;
68     for (unsigned int i(0); i<parentIndex_.size(); i++){
69     std::cout << parentIndex_.at(i) << " " ;
70     }
71     std::cout << std::endl
72     << "=======================================================" << std::endl;
73    
74     };
75    
76     private:
77    
78     HbbAnalysis::MCVars part_;
79     std::vector<unsigned int> parentIndex_;
80    
81     };
82    
83     }//namespace
84     #endif