6 #include "TParticlePDG.h"
32 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": \n";
33 std::cout <<
"You are trying to set min and max counts for the events more than once! \n";
34 std::cout <<
"I take the first setting of min = " <<
fCountsMinMax.first <<
" max = " <<
fCountsMinMax.second <<
" and ignore the later ones! \n\n\n";
35 std::cout <<
"Your current input of min = " << min <<
" max = " << max <<
" is ignored! \n\n\n";
41 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. You are trying to request that your events should have at least a number <= 0 of some particles. That makes no sense. \n\n\n";
45 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. You are trying to request that your events should have at most a number of some particles which is less than the minimum number that you request. That makes no sense. \n\n\n";
62 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": \n";
63 std::cout <<
"You are trying to set the limits for the invariant mass selection set more than once! \n";
64 std::cout <<
"I take the first setting and ignore the later ones! \n\n\n";
70 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. Min inv. mass too low. \n\n\n";
74 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. Max inv. mass lower than min inv. mass. \n\n\n";
94 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": \n";
95 std::cout <<
"You are trying to set the limits for the invariant mass selection set more than once! \n";
96 std::cout <<
"I take the first setting and ignore the later ones! \n\n\n";
102 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. cv has to be positive. \n\n\n";
106 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": Filter could not be added. w has to be non-negative. \n\n\n";
121 std::cout <<
"\n\n\n -WARNING from PndEvtFilterOnInvMassCounts of " << this->GetTitle() <<
": " << this->GetName() <<
": \n";
122 std::cout <<
"You are trying to set the pdgCodes to combine into invariant mass combinations more than once! \n";
123 std::cout <<
"I take the first setting and ignore the later ones! \n\n\n";
129 std::vector< Int_t > pdgCodes, apdgCodes;
130 pdgCodes.push_back(pdgCode1);
131 pdgCodes.push_back(pdgCode2);
132 pdgCodes.push_back(pdgCode3);
133 pdgCodes.push_back(pdgCode4);
134 pdgCodes.push_back(pdgCode5);
140 for (UInt_t iPdgCodes = 0; iPdgCodes < pdgCodes.size(); ++iPdgCodes){
145 if ( kFALSE ==
GetCharge( pdgCodes[iPdgCodes], &pdgCodeCharge ) ) {
146 std::cout <<
"\n\n\nFATAL ERROR FROM PndEvtFilterOnInvMassCounts::SetPdgCodesToCombine of " << this->GetTitle() <<
": " << this->GetName() <<
" Charge for pdg code " << pdgCodes[iPdgCodes] <<
" was not found. \n";
147 std::cout <<
"Filter was not set. \n\n\n”";
152 fPdgCodesCharges.push_back(std::pair<Int_t, Double_t> (pdgCodes[iPdgCodes], pdgCodeCharge));
160 std::cout <<
"\n\n\nFATAL ERROR FROM PndEvtFilterOnInvMassCounts::SetPdgCodesToCombine of " << this->GetTitle() <<
": " << this->GetName() <<
" You have to specify at least 2 valid pdg codes. \n";
161 std::cout <<
"Filter was not set. \n\n\n”";
173 std::cout <<
"Internal eventNr:" << evtNr <<
"\n";
174 std::cout <<
"Nr. of simulated particles:" <<
fParticleList->GetEntries()<<
"\n";
176 std::cout <<
"PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": Beginning of EventMatches\n";
181 std::cout <<
"\n\n\n PndEvtFilterOnInvMassCounts " << this->GetTitle() <<
": " << this->GetName() <<
": FATAL ERROR: No particle list! Discard this event.\n\n\n";
188 if (0<
fVerbose) std::cout <<
"\n\n\n PndEvtFilterOnInvMassCounts: Event contains less than " <<
fPdgCodesCharges.size() <<
" particles. " << this->GetTitle() <<
": " << this->GetName() <<
" will not accept this event.\n\n\n";
197 std::vector<int> pdg, apdg;
205 if (
fdbPdg->GetParticle(cpdg)!=0x0 &&
fdbPdg->GetParticle(cpdg)->AntiParticle()!=0x0)
206 apdg.push_back(
fdbPdg->GetParticle(cpdg)->AntiParticle()->PdgCode());
208 apdg.push_back(cpdg);
212 bool isperm = is_permutation(pdg.begin(), pdg.end(), apdg.begin());
230 if (!isperm) combinedAntiList.
Combine(ap0, ap1);
234 combinedList.
Combine(p0, p1, p2);
238 combinedAntiList.
Combine(ap0, ap1, ap2);
244 combinedList.
Combine(p0, p1, p2, p3);
249 combinedAntiList.
Combine(ap0, ap1, ap2, ap3);
256 combinedList.
Combine(p0, p1, p2, p3, p4);
262 combinedAntiList.
Combine(ap0, ap1, ap2, ap3, ap4);
266 std::cout <<
"FATAL ERROR in PndEvtFilterOnInvMassCounts::EventMatches of " << this->GetTitle() <<
": " << this->GetName() <<
". The number of pdg codes is not supported. \n";
273 std::cout <<
"Looking for inv. masses of " <<
fPdgCodesCharges.size() <<
" particles.\n";
275 std::cout <<
" particles in initial lists\n";
276 std::cout << combinedList.
GetLength() <<
" particles in combined list before mass selection\n";
286 std::cout << combinedList.
GetLength()<<
" + "<< combinedAntiList.
GetLength()<<
" particles in combined list after mass selection\n";
292 std::cout <<
"Event is not accepted by " << this->GetTitle() <<
": " << this->GetName() <<
" because there are too few matching inv. mass combinations in the event. \n";
298 std::cout <<
"Event is not accepted by " << this->GetTitle() <<
": " << this->GetName() <<
" because there are too many matching inv. mass combinations in the event. \n";
307 std::cout <<
"\n Event matches " << this->GetTitle() <<
": " << this->GetName() <<
"\n\n";
Bool_t SetMinMaxCounts(Int_t min, Int_t max)
void PrintAllTParticleInEvent()
Bool_t FillList(RhoCandList &rhoOutList, Int_t inPdgCode, Double_t pdgCodeCharge=kNoChargeSpecified)
Bool_t GetCharge(Int_t inPdgCode, Double_t *pdgCodeCharge)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
PndEvtFilterOnInvMassCounts()
virtual ~PndEvtFilterOnInvMassCounts()
Bool_t SetMinMaxInvMass(Double_t min, Double_t max)
void Combine(RhoCandList &l1, RhoCandList &l2)
RhoMassParticleSelector * fInvMassSel
std::set< Int_t > fAcceptedEventNumbers
TClonesArray * fParticleList
void Select(RhoParticleSelectorBase *pidmgr)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
static const Double_t kNoChargeSpecified
static const Int_t kInvalidPdgCode
std::pair< Int_t, Int_t > fCountsMinMax
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)
std::vector< std::pair< Int_t, Double_t > > fPdgCodesCharges
Bool_t EventMatches(Int_t evtNr)