PandaRoot
PndEvtFilterOnInvMassCounts.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndEvtFilterOnInvMassCounts header file -----
3 // -------------------------------------------------------------------------
4 
26 #ifndef PndEvtFilterOnInvMassCounts_H_
27 #define PndEvtFilterOnInvMassCounts_H_
28 
29 #include "PndEvtFilter.h"
30 #include "TMath.h"
31 #include <map>
32 #include <vector>
33 #include <iostream>
34 #include "RhoCandidate.h"
35 #include "RhoCandList.h"
37 #include "TLorentzVector.h"
39 
41 
42  public:
43  // Default constructor
45 
46  // Constructor with name and title
47  PndEvtFilterOnInvMassCounts(const char *name, const char *title = "PndEvtFilterOnInvMassCounts");
48 
49  // Destructor
51 
53  // User interfaces
55  // returns kTRUE if setting was added, otherwise returns kFALSE
56  Bool_t SetPdgCodesToCombine(Int_t pdgCode1, Int_t pdgCode2, Int_t pdgCode3 = kInvalidPdgCode, Int_t pdgCode4 = kInvalidPdgCode, Int_t pdgCode5 = kInvalidPdgCode);
57 
58  Bool_t SetMinMaxInvMass(Double_t min, Double_t max);
59  Bool_t SetRhoMassParticleSelector(const char *name, Double_t cv, Double_t w, const char *type); // same arguments as constructor of RhoMassParticleSelector
60 
61  Bool_t SetMinMaxCounts(Int_t min, Int_t max);
62  Bool_t SetMinCounts(Int_t min) { return SetMinMaxCounts(min, 9999); };
63  Bool_t SetMaxCounts(Int_t max) { return SetMinMaxCounts(0, max); };
64 
65  // checks if the particles in the event (fParticleList) suit the filter settings
66  // kTRUE if event matches, kFALSE otherwise
67  Bool_t EventMatches(Int_t evtNr);
68 
69  // returns kTRUE if any filter is turned on
70  Bool_t FilterActive() { return (fInvMassRangeSet && fPgdCodesSet && fCountRangeSet); };
71 
72  private:
73  // minimum and maximum acceptable multiplicities for the particle combinations
74  std::pair<Int_t, Int_t> fCountsMinMax;
75  // inv. mass selector which implements the minimum and maximum acceptable invariant mass range for the particle combinations
76  RhoMassParticleSelector *fInvMassSel;
77  // vector containing the pdg codes which should be combined along with its corresponding charges
78  std::vector<std::pair<Int_t, Double_t>> fPdgCodesCharges;
79 
80  Bool_t fInvMassRangeSet; // is kTRUE if invariant mass is set
81  Bool_t fPgdCodesSet; // is kTRUE if pdg codes are set
82  Bool_t fCountRangeSet; // is kTRUE if min and max counts are set
83 
84  // constant holding an integer number which is not used as a pdg code
85  // this serves as a place holder when constructing a vector from integers given by the user
86  static const Int_t kInvalidPdgCode = 0;
87 
88  ClassDef(PndEvtFilterOnInvMassCounts, 1);
89 };
90 
91 #endif /* PndEvtFilterOnInvMassCounts_H_ */
Bool_t SetMinMaxCounts(Int_t min, Int_t max)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
virtual ~PndEvtFilterOnInvMassCounts()
Bool_t SetMinMaxInvMass(Double_t min, Double_t max)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:24
Bool_t SetPdgCodesToCombine(Int_t pdgCode1, Int_t pdgCode2, Int_t pdgCode3=kInvalidPdgCode, Int_t pdgCode4=kInvalidPdgCode, Int_t pdgCode5=kInvalidPdgCode)
Bool_t SetRhoMassParticleSelector(const char *name, Double_t cv, Double_t w, const char *type)
Bool_t EventMatches(Int_t evtNr)