FairRoot/PandaRoot
PndSmpCand.h
Go to the documentation of this file.
1 
12 #ifndef PndSmpCand_H
13 #define PndSmpCand_H
14 
15 #include "TLorentzVector.h"
16 #include <iostream>
17 
18 using std::cout;
19 using std::endl;
20 
21 // -------------------------------------------------------------------------
22 
23 class PndSmpCand {
24 public:
25  // Constructors
27  PndSmpCand() {};
28 
30  PndSmpCand(TLorentzVector lv, Float_t chrg, Int_t pdg = 0, Int_t uid = -1);
31 
33  PndSmpCand(TLorentzVector *lv, Float_t chrg, Int_t pdg = 0, Int_t uid = -1);
34 
36  PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1) { CombCand(pdg, &c0, &c1); }
38  PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2) { CombCand(pdg, &c0, &c1, &c2); }
40  PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3) { CombCand(pdg, &c0, &c1, &c2, &c3); }
42  PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3, PndSmpCand &c4) { CombCand(pdg, &c0, &c1, &c2, &c3, &c4); }
43 
45  PndSmpCand(Int_t pdg, PndSmpCand *c0, PndSmpCand *c1, PndSmpCand *c2=0, PndSmpCand *c3=0, PndSmpCand *c4=0) { CombCand(pdg, c0, c1, c2, c3, c4); }
46 
47  // Modifiers
49  void SetP4(TLorentzVector p4) { fLV = p4; }
51  void SetM(Double_t m) { fLV.SetVectM(fLV.Vect(), m); }
53  void SetCharge(Float_t ch) { fCharge = ch; }
54 
55  // Methods
57  Bool_t operator== ( const PndSmpCand &c1) const { return (c1.fMarker == fMarker ) && ( c1.fPdgCode == fPdgCode) ;}
59  Bool_t operator!= ( const PndSmpCand &c1) const { return !(*this==c1); }
60 
62  void CombCand(Int_t pdg, PndSmpCand *c0, PndSmpCand *c1, PndSmpCand *c2=0, PndSmpCand *c3=0, PndSmpCand *c4=0);
63 
64  TLorentzVector P4() { return fLV; }
65  Float_t Charge() { return fCharge; }
66  Int_t Pdg() { return fPdgCode; }
67  Int_t NDau() { return fNDau; }
68  ULong_t Marker() { return fMarker; }
69  PndSmpCand* Dau(Int_t idx) { if (idx>=0 && idx<fNDau) return fDaughter[idx]; else return 0; }
72  void Print();
73 
74 private:
75  // Private methods
77  void PrintBinary(ULong_t x)
78  {
79  ULong_t bit=ULong_t(1)<<63;
80  while (bit) {cout << ((x&bit)?1:0); bit>>=1; if (bit & 0x8080808080808080) cout <<" ";}
81  }
82 
83  // Member variables
84  TLorentzVector fLV; // the Lorentz vector
85  Float_t fCharge; // charge
86  Int_t fPdgCode; // pdg code
87  Int_t fUniqueID; // unique id, only applied for initial (non-composite) candidates
88  ULong_t fMarker; // a bit marker used for overlap check; limits number of initial candidate to 64 (long = 64 bits)
89  Int_t fNDau; // number of daughters of composites (up to 5)
90  PndSmpCand *fDaughter[5]; // pointers to daughters
91 
92 };
93 
94 
95 // -------------------------------------------------------------------------
96 
97 #endif
void PrintBinary(ULong_t x)
Prints a unsigned int as bit string.
Definition: PndSmpCand.h:77
void SetM(Double_t m)
Sets mass (used for different mass hypotheses in filter.
Definition: PndSmpCand.h:51
PndSmpCand * fDaughter[5]
Definition: PndSmpCand.h:90
c4
Definition: plot_dirc.C:71
Float_t Charge()
Definition: PndSmpCand.h:65
__m128 m
Definition: P4_F32vec4.h:28
Int_t fNDau
Definition: PndSmpCand.h:89
void SetCharge(Float_t ch)
Sets charge.
Definition: PndSmpCand.h:53
c2
Definition: plot_dirc.C:39
void CombCand(Int_t pdg, PndSmpCand *c0, PndSmpCand *c1, PndSmpCand *c2=0, PndSmpCand *c3=0, PndSmpCand *c4=0)
Combines this candidate from several daughters (adds P4 and charges).
Definition: PndSmpCand.cxx:45
PndSmpCand(Int_t pdg, PndSmpCand *c0, PndSmpCand *c1, PndSmpCand *c2=0, PndSmpCand *c3=0, PndSmpCand *c4=0)
Constructor from up to 5 daughter pointers. Calls CombCand.
Definition: PndSmpCand.h:45
Int_t Pdg()
Definition: PndSmpCand.h:66
Float_t fCharge
Definition: PndSmpCand.h:85
Bool_t operator==(const PndSmpCand &c1) const
Overload of == operator needed to compare std::vectors of candidates.
Definition: PndSmpCand.h:57
ULong_t fMarker
Definition: PndSmpCand.h:88
PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1)
Constructor from 2 daughters. Calls CombCand.
Definition: PndSmpCand.h:36
int idx[MAX]
Definition: autocutx.C:38
int uid(int lev, int lrun, int lmode)
Definition: autocutx.C:122
TLorentzVector P4()
Definition: PndSmpCand.h:64
PndSmpCand()
Default constructor.
Definition: PndSmpCand.h:27
Double_t
Bool_t Overlap(PndSmpCand &c)
Definition: PndSmpCand.h:71
Int_t fUniqueID
Definition: PndSmpCand.h:87
TLorentzVector fLV
Definition: PndSmpCand.h:84
void SetP4(TLorentzVector p4)
Sets LorentzVector.
Definition: PndSmpCand.h:49
Bool_t operator!=(const PndSmpCand &c1) const
Overload of == operator needed to compare std::vectors of candidates.
Definition: PndSmpCand.h:59
c1
Definition: plot_dirc.C:35
c3
Definition: plot_dirc.C:50
void Print()
Definition: PndSmpCand.cxx:35
Bool_t Overlap(PndSmpCand *c)
Definition: PndSmpCand.h:70
Double_t x
ULong_t Marker()
Definition: PndSmpCand.h:68
PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3)
Constructor from 4 daughters. Calls CombCand.
Definition: PndSmpCand.h:40
PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2)
Constructor from 3 daughters. Calls CombCand.
Definition: PndSmpCand.h:38
Int_t fPdgCode
Definition: PndSmpCand.h:86
PndSmpCand * Dau(Int_t idx)
Definition: PndSmpCand.h:69
PndSmpCand(Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3, PndSmpCand &c4)
Constructor from 5 daughters. Calls CombCand.
Definition: PndSmpCand.h:42
Int_t NDau()
Definition: PndSmpCand.h:67
Simple particle candidate to perform simple combinatorics and particle counting for event filtering...
Definition: PndSmpCand.h:23