PandaRoot
PndEvtFilterOnInvMassCounts.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndEvtFilterOnInvMassCounts header file -----
15 // -------------------------------------------------------------------------
16 
38 #ifndef PndEvtFilterOnInvMassCounts_H_
39 #define PndEvtFilterOnInvMassCounts_H_
40 
41 #include "PndEvtFilter.h"
42 #include "TMath.h"
43 #include <map>
44 #include <vector>
45 #include <iostream>
46 #include "RhoCandidate.h"
47 #include "RhoCandList.h"
49 #include "TLorentzVector.h"
51 
53 
54  public:
55  // Default constructor
57 
58  // Constructor with name and title
59  PndEvtFilterOnInvMassCounts(const char *name, const char *title = "PndEvtFilterOnInvMassCounts");
60 
61  // Destructor
63 
65  // User interfaces
67  // returns kTRUE if setting was added, otherwise returns kFALSE
68  Bool_t SetPdgCodesToCombine(Int_t pdgCode1, Int_t pdgCode2, Int_t pdgCode3 = kInvalidPdgCode, Int_t pdgCode4 = kInvalidPdgCode, Int_t pdgCode5 = kInvalidPdgCode);
69 
70  Bool_t SetMinMaxInvMass(Double_t min, Double_t max);
71  Bool_t SetRhoMassParticleSelector(const char *name, Double_t cv, Double_t w, const char *type); // same arguments as constructor of RhoMassParticleSelector
72 
73  Bool_t SetMinMaxCounts(Int_t min, Int_t max);
74  Bool_t SetMinCounts(Int_t min) { return SetMinMaxCounts(min, 9999); };
75  Bool_t SetMaxCounts(Int_t max) { return SetMinMaxCounts(0, max); };
76 
77  // checks if the particles in the event (fParticleList) suit the filter settings
78  // kTRUE if event matches, kFALSE otherwise
79  Bool_t EventMatches(Int_t evtNr);
80 
81  // returns kTRUE if any filter is turned on
82  Bool_t FilterActive() { return (fInvMassRangeSet && fPgdCodesSet && fCountRangeSet); };
83 
84  private:
85  // minimum and maximum acceptable multiplicities for the particle combinations
86  std::pair<Int_t, Int_t> fCountsMinMax;
87  // inv. mass selector which implements the minimum and maximum acceptable invariant mass range for the particle combinations
88  RhoMassParticleSelector *fInvMassSel;
89  // vector containing the pdg codes which should be combined along with its corresponding charges
90  std::vector<std::pair<Int_t, Double_t>> fPdgCodesCharges;
91 
92  Bool_t fInvMassRangeSet; // is kTRUE if invariant mass is set
93  Bool_t fPgdCodesSet; // is kTRUE if pdg codes are set
94  Bool_t fCountRangeSet; // is kTRUE if min and max counts are set
95 
96  // constant holding an integer number which is not used as a pdg code
97  // this serves as a place holder when constructing a vector from integers given by the user
98  static const Int_t kInvalidPdgCode = 0;
99 
100  ClassDef(PndEvtFilterOnInvMassCounts, 1);
101 };
102 
103 #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:37
virtual ~PndEvtFilterOnInvMassCounts()
Bool_t SetMinMaxInvMass(Double_t min, Double_t max)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:36
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)