FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndSmpCand Class Reference

Simple particle candidate to perform simple combinatorics and particle counting for event filtering. More...

#include <PndSmpCand.h>

Public Member Functions

 PndSmpCand ()
 Default constructor. More...
 
 PndSmpCand (TLorentzVector lv, Float_t chrg, Int_t pdg=0, Int_t uid=-1)
 Constructor from Lorentz vector reference. More...
 
 PndSmpCand (TLorentzVector *lv, Float_t chrg, Int_t pdg=0, Int_t uid=-1)
 Constructor from pointer to Lorentz vector . More...
 
 PndSmpCand (Int_t pdg, PndSmpCand &c0, PndSmpCand &c1)
 Constructor from 2 daughters. Calls CombCand. More...
 
 PndSmpCand (Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2)
 Constructor from 3 daughters. Calls CombCand. More...
 
 PndSmpCand (Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3)
 Constructor from 4 daughters. Calls CombCand. More...
 
 PndSmpCand (Int_t pdg, PndSmpCand &c0, PndSmpCand &c1, PndSmpCand &c2, PndSmpCand &c3, PndSmpCand &c4)
 Constructor from 5 daughters. Calls CombCand. More...
 
 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. More...
 
void SetP4 (TLorentzVector p4)
 Sets LorentzVector. More...
 
void SetM (Double_t m)
 Sets mass (used for different mass hypotheses in filter. More...
 
void SetCharge (Float_t ch)
 Sets charge. More...
 
Bool_t operator== (const PndSmpCand &c1) const
 Overload of == operator needed to compare std::vectors of candidates. More...
 
Bool_t operator!= (const PndSmpCand &c1) const
 Overload of == operator needed to compare std::vectors of candidates. More...
 
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). More...
 
TLorentzVector P4 ()
 
Float_t Charge ()
 
Int_t Pdg ()
 
Int_t NDau ()
 
ULong_t Marker ()
 
PndSmpCandDau (Int_t idx)
 
Bool_t Overlap (PndSmpCand *c)
 
Bool_t Overlap (PndSmpCand &c)
 
void Print ()
 

Private Member Functions

void PrintBinary (ULong_t x)
 Prints a unsigned int as bit string. More...
 

Private Attributes

TLorentzVector fLV
 
Float_t fCharge
 
Int_t fPdgCode
 
Int_t fUniqueID
 
ULong_t fMarker
 
Int_t fNDau
 
PndSmpCandfDaughter [5]
 

Detailed Description

Simple particle candidate to perform simple combinatorics and particle counting for event filtering.

Author
Klaus Goetzen <k [dot] goetzen (at) gsi [dot] de>

This class defines a simple particle candidate, which allows simple combinatoric with overlap check and provides access to its internal 4-vector.

Definition at line 23 of file PndSmpCand.h.

Constructor & Destructor Documentation

PndSmpCand::PndSmpCand ( )
inline

Default constructor.

Definition at line 27 of file PndSmpCand.h.

27 {};
PndSmpCand::PndSmpCand ( TLorentzVector  lv,
Float_t  chrg,
Int_t  pdg = 0,
Int_t  uid = -1 
)

Constructor from Lorentz vector reference.

Definition at line 17 of file PndSmpCand.cxx.

References fDaughter, fMarker, fUniqueID, and i.

17  :
18  fLV(lv), fCharge(chrg), fPdgCode(pdg), fUniqueID(uid), fMarker(0), fNDau(0)
19 {
20  for (int i=0;i<5;++i) fDaughter[i] = 0;
21  if (uid>=0) fMarker = 1<<fUniqueID;
22 }
PndSmpCand * fDaughter[5]
Definition: PndSmpCand.h:90
Int_t i
Definition: run_full.C:25
Int_t fNDau
Definition: PndSmpCand.h:89
Float_t fCharge
Definition: PndSmpCand.h:85
ULong_t fMarker
Definition: PndSmpCand.h:88
int uid(int lev, int lrun, int lmode)
Definition: autocutx.C:122
Int_t fUniqueID
Definition: PndSmpCand.h:87
TLorentzVector fLV
Definition: PndSmpCand.h:84
Int_t fPdgCode
Definition: PndSmpCand.h:86
PndSmpCand::PndSmpCand ( TLorentzVector *  lv,
Float_t  chrg,
Int_t  pdg = 0,
Int_t  uid = -1 
)

Constructor from pointer to Lorentz vector .

Definition at line 26 of file PndSmpCand.cxx.

References fDaughter, fMarker, fUniqueID, and i.

26  :
27  fLV(*lv), fCharge(chrg), fPdgCode(pdg), fUniqueID(uid), fMarker(0), fNDau(0)
28 {
29  for (int i=0;i<5;++i) fDaughter[i] = 0;
30  if (uid>=0) fMarker = 1<<fUniqueID;
31 }
PndSmpCand * fDaughter[5]
Definition: PndSmpCand.h:90
Int_t i
Definition: run_full.C:25
Int_t fNDau
Definition: PndSmpCand.h:89
Float_t fCharge
Definition: PndSmpCand.h:85
ULong_t fMarker
Definition: PndSmpCand.h:88
int uid(int lev, int lrun, int lmode)
Definition: autocutx.C:122
Int_t fUniqueID
Definition: PndSmpCand.h:87
TLorentzVector fLV
Definition: PndSmpCand.h:84
Int_t fPdgCode
Definition: PndSmpCand.h:86
PndSmpCand::PndSmpCand ( Int_t  pdg,
PndSmpCand c0,
PndSmpCand c1 
)
inline

Constructor from 2 daughters. Calls CombCand.

Definition at line 36 of file PndSmpCand.h.

References CombCand().

36 { CombCand(pdg, &c0, &c1); }
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::PndSmpCand ( Int_t  pdg,
PndSmpCand c0,
PndSmpCand c1,
PndSmpCand c2 
)
inline

Constructor from 3 daughters. Calls CombCand.

Definition at line 38 of file PndSmpCand.h.

References CombCand().

38 { CombCand(pdg, &c0, &c1, &c2); }
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::PndSmpCand ( Int_t  pdg,
PndSmpCand c0,
PndSmpCand c1,
PndSmpCand c2,
PndSmpCand c3 
)
inline

Constructor from 4 daughters. Calls CombCand.

Definition at line 40 of file PndSmpCand.h.

References CombCand().

40 { CombCand(pdg, &c0, &c1, &c2, &c3); }
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::PndSmpCand ( Int_t  pdg,
PndSmpCand c0,
PndSmpCand c1,
PndSmpCand c2,
PndSmpCand c3,
PndSmpCand c4 
)
inline

Constructor from 5 daughters. Calls CombCand.

Definition at line 42 of file PndSmpCand.h.

References CombCand().

42 { CombCand(pdg, &c0, &c1, &c2, &c3, &c4); }
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::PndSmpCand ( Int_t  pdg,
PndSmpCand c0,
PndSmpCand c1,
PndSmpCand c2 = 0,
PndSmpCand c3 = 0,
PndSmpCand c4 = 0 
)
inline

Constructor from up to 5 daughter pointers. Calls CombCand.

Definition at line 45 of file PndSmpCand.h.

References c2, c3, c4, and CombCand().

45 { CombCand(pdg, c0, c1, c2, c3, c4); }
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

Member Function Documentation

Float_t PndSmpCand::Charge ( )
inline

Definition at line 65 of file PndSmpCand.h.

References fCharge.

65 { return fCharge; }
Float_t fCharge
Definition: PndSmpCand.h:85
void PndSmpCand::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 at line 45 of file PndSmpCand.cxx.

References c1, c2, c3, c4, fCharge, fDaughter, fLV, fMarker, fNDau, fPdgCode, and fUniqueID.

Referenced by PndSmpCand().

46 {
47  fPdgCode = pdg;
48  fNDau = 2;
49 
50  fDaughter[0] = c0;
51  fDaughter[1] = c1;
52 
53  fMarker = c0->fMarker | c1->fMarker;
54  fLV = c0->fLV + c1->fLV;
55  fCharge = c0->fCharge + c1->fCharge;
56  fUniqueID = -1;
57 
58  if (0!=c2) { fDaughter[fNDau++] = c2; fLV += c2->fLV; fCharge += c2->fCharge; fMarker |= c2->fMarker; }
59  if (0!=c3) { fDaughter[fNDau++] = c3; fLV += c3->fLV; fCharge += c3->fCharge; fMarker |= c3->fMarker; }
60  if (0!=c4) { fDaughter[fNDau++] = c4; fLV += c4->fLV; fCharge += c4->fCharge; fMarker |= c4->fMarker; }
61 }
PndSmpCand * fDaughter[5]
Definition: PndSmpCand.h:90
c4
Definition: plot_dirc.C:71
Int_t fNDau
Definition: PndSmpCand.h:89
c2
Definition: plot_dirc.C:39
Float_t fCharge
Definition: PndSmpCand.h:85
ULong_t fMarker
Definition: PndSmpCand.h:88
Int_t fUniqueID
Definition: PndSmpCand.h:87
TLorentzVector fLV
Definition: PndSmpCand.h:84
c1
Definition: plot_dirc.C:35
c3
Definition: plot_dirc.C:50
Int_t fPdgCode
Definition: PndSmpCand.h:86
PndSmpCand* PndSmpCand::Dau ( Int_t  idx)
inline

Definition at line 69 of file PndSmpCand.h.

References fDaughter, fNDau, and idx.

69 { if (idx>=0 && idx<fNDau) return fDaughter[idx]; else return 0; }
PndSmpCand * fDaughter[5]
Definition: PndSmpCand.h:90
Int_t fNDau
Definition: PndSmpCand.h:89
int idx[MAX]
Definition: autocutx.C:38
ULong_t PndSmpCand::Marker ( )
inline

Definition at line 68 of file PndSmpCand.h.

References fMarker.

68 { return fMarker; }
ULong_t fMarker
Definition: PndSmpCand.h:88
Int_t PndSmpCand::NDau ( )
inline

Definition at line 67 of file PndSmpCand.h.

References fNDau.

67 { return fNDau; }
Int_t fNDau
Definition: PndSmpCand.h:89
Bool_t PndSmpCand::operator!= ( const PndSmpCand c1) const
inline

Overload of == operator needed to compare std::vectors of candidates.

Definition at line 59 of file PndSmpCand.h.

References c1.

59 { return !(*this==c1); }
c1
Definition: plot_dirc.C:35
Bool_t PndSmpCand::operator== ( const PndSmpCand c1) const
inline

Overload of == operator needed to compare std::vectors of candidates.

Definition at line 57 of file PndSmpCand.h.

References fMarker, and fPdgCode.

57 { return (c1.fMarker == fMarker ) && ( c1.fPdgCode == fPdgCode) ;}
ULong_t fMarker
Definition: PndSmpCand.h:88
Int_t fPdgCode
Definition: PndSmpCand.h:86
Bool_t PndSmpCand::Overlap ( PndSmpCand c)
inline

Definition at line 70 of file PndSmpCand.h.

References fMarker.

Referenced by PndFilteredPrimaryGenerator::CombineList().

70 { return fMarker & c->fMarker; }
ULong_t fMarker
Definition: PndSmpCand.h:88
Bool_t PndSmpCand::Overlap ( PndSmpCand c)
inline

Definition at line 71 of file PndSmpCand.h.

References fMarker.

71 { return fMarker & c.fMarker; }
ULong_t fMarker
Definition: PndSmpCand.h:88
TLorentzVector PndSmpCand::P4 ( )
inline

Definition at line 64 of file PndSmpCand.h.

References fLV.

64 { return fLV; }
TLorentzVector fLV
Definition: PndSmpCand.h:84
Int_t PndSmpCand::Pdg ( )
inline

Definition at line 66 of file PndSmpCand.h.

References fPdgCode.

66 { return fPdgCode; }
Int_t fPdgCode
Definition: PndSmpCand.h:86
void PndSmpCand::Print ( )

Definition at line 35 of file PndSmpCand.cxx.

References fCharge, fLV, fMarker, fPdgCode, fUniqueID, PrintBinary(), and printf().

36 {
37  printf("uid:%3d lv:(%7.3f,%7.3f,%7.3f,%7.3f ; m:%7.3f, p:%7.3f, pt:%7.3f, tht:%6.1f, phi:%7.1f) ch:%2.0f pdg:%6d marker:%8lu (",
38  fUniqueID, fLV.Px(), fLV.Py(), fLV.Pz(), fLV.E(), fLV.M(), fLV.P(), fLV.Pt(), fLV.Theta()*57.296, fLV.Phi()*57.296, fCharge, fPdgCode, fMarker);
40  printf(")\n");
41 }
void PrintBinary(ULong_t x)
Prints a unsigned int as bit string.
Definition: PndSmpCand.h:77
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Float_t fCharge
Definition: PndSmpCand.h:85
ULong_t fMarker
Definition: PndSmpCand.h:88
Int_t fUniqueID
Definition: PndSmpCand.h:87
TLorentzVector fLV
Definition: PndSmpCand.h:84
Int_t fPdgCode
Definition: PndSmpCand.h:86
void PndSmpCand::PrintBinary ( ULong_t  x)
inlineprivate

Prints a unsigned int as bit string.

Definition at line 77 of file PndSmpCand.h.

Referenced by Print().

78  {
79  ULong_t bit=ULong_t(1)<<63;
80  while (bit) {cout << ((x&bit)?1:0); bit>>=1; if (bit & 0x8080808080808080) cout <<" ";}
81  }
void PndSmpCand::SetCharge ( Float_t  ch)
inline

Sets charge.

Definition at line 53 of file PndSmpCand.h.

References fCharge.

53 { fCharge = ch; }
Float_t fCharge
Definition: PndSmpCand.h:85
void PndSmpCand::SetM ( Double_t  m)
inline

Sets mass (used for different mass hypotheses in filter.

Definition at line 51 of file PndSmpCand.h.

References fLV, and m.

51 { fLV.SetVectM(fLV.Vect(), m); }
__m128 m
Definition: P4_F32vec4.h:28
TLorentzVector fLV
Definition: PndSmpCand.h:84
void PndSmpCand::SetP4 ( TLorentzVector  p4)
inline

Sets LorentzVector.

Definition at line 49 of file PndSmpCand.h.

References fLV.

Referenced by PndFilteredPrimaryGenerator::GenerateEvent().

49 { fLV = p4; }
TLorentzVector fLV
Definition: PndSmpCand.h:84

Member Data Documentation

Float_t PndSmpCand::fCharge
private

Definition at line 85 of file PndSmpCand.h.

Referenced by Charge(), CombCand(), Print(), and SetCharge().

PndSmpCand* PndSmpCand::fDaughter[5]
private

Definition at line 90 of file PndSmpCand.h.

Referenced by CombCand(), Dau(), and PndSmpCand().

TLorentzVector PndSmpCand::fLV
private

Definition at line 84 of file PndSmpCand.h.

Referenced by CombCand(), P4(), Print(), SetM(), and SetP4().

ULong_t PndSmpCand::fMarker
private

Definition at line 88 of file PndSmpCand.h.

Referenced by CombCand(), Marker(), operator==(), Overlap(), PndSmpCand(), and Print().

Int_t PndSmpCand::fNDau
private

Definition at line 89 of file PndSmpCand.h.

Referenced by CombCand(), Dau(), and NDau().

Int_t PndSmpCand::fPdgCode
private

Definition at line 86 of file PndSmpCand.h.

Referenced by CombCand(), operator==(), Pdg(), and Print().

Int_t PndSmpCand::fUniqueID
private

Definition at line 87 of file PndSmpCand.h.

Referenced by CombCand(), PndSmpCand(), and Print().


The documentation for this class was generated from the following files: