ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/GenParticle.hh
Revision: 1.1
Committed: Thu Sep 17 19:39:50 2009 UTC (15 years, 7 months ago) by amagnan
Content type: text/plain
Branch: MAIN
CVS Tags: HbbAnaFor35X, v00-04-02, v00-04-01, v00-04-00, v00-03-00
Log Message:
add Tree

File Contents

# Content
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 part_.phi = 0;
51 part_.pdgId = 0;
52 part_.status = 0;
53
54 parentIndex_.clear();
55 };
56
57 inline void print() const{
58
59 std::cout << "=======================================================" << std::endl
60 << "================== Print GenParticle ==================" << std::endl
61 << "=======================================================" << std::endl
62 << " ---- index : " << part_.index << std::endl
63 << " ---- pdgId : " << part_.pdgId << std::endl
64 << " ---- status: " << part_.status << std::endl
65 << " ---- pt,eta,phi: " << part_.pT << " " << part_.eta << " " << part_.phi << std::endl
66 << " ---- parents: " ;
67 for (unsigned int i(0); i<parentIndex_.size(); i++){
68 std::cout << parentIndex_.at(i) << " " ;
69 }
70 std::cout << std::endl
71 << "=======================================================" << std::endl;
72
73 };
74
75 private:
76
77 HbbAnalysis::MCVars part_;
78 std::vector<unsigned int> parentIndex_;
79
80 };
81
82 }//namespace
83 #endif