27 #include "StHbtMaker/Infrastructure/StHbtCheckPdgIdList.h"
38 inline double min(
double a,
double b) {
return (a<b) ? a : b; }
39 inline double max(
double a,
double b) {
return (a<b) ? b : a; }
42 StHbtCheckPdgIdList::StHbtCheckPdgIdList(){
43 mAcceptedParticles =
new pdgIdList;
44 mAcceptedMothers =
new pdgIdList;
45 mAcceptedDaughters =
new pdgIdList;
48 StHbtCheckPdgIdList::~StHbtCheckPdgIdList(){
49 delete mAcceptedParticles;
50 delete mAcceptedMothers;
51 delete mAcceptedDaughters;
54 StHbtString StHbtCheckPdgIdList::Report(){
55 StHbtString temp =
"\n This is the StHbtCheckPdgIdList\n"; temp +=
"---> EventCuts in Reader: ";
57 temp +=
"\n Accepted Particles (pdgId): ";
58 pdgIdListIterator iter;
59 for (iter=mAcceptedParticles->begin(); iter!=mAcceptedParticles->end(); iter++) {
60 sprintf(Ctemp,
" %i",*iter);
63 temp +=
"\n Accepted Mothers (pdgId): ";
64 for (iter=mAcceptedMothers->begin(); iter!=mAcceptedMothers->end(); iter++) {
65 sprintf(Ctemp,
" %i",*iter);
68 temp +=
"\n Accepted Daughters (pdgId): ";
69 for (iter=mAcceptedDaughters->begin(); iter!=mAcceptedDaughters->end(); iter++) {
70 sprintf(Ctemp,
" %i",*iter);
77 void StHbtCheckPdgIdList::AddAcceptedParticle(
int pdgCode ){
78 mAcceptedParticles->push_back( pdgCode );
81 void StHbtCheckPdgIdList::AddAcceptedMother(
int pdgCode ){
82 mAcceptedMothers->push_back( pdgCode );
85 void StHbtCheckPdgIdList::AddAcceptedDaughter(
int pdgCode ){
86 mAcceptedDaughters->push_back( pdgCode );
89 int StHbtCheckPdgIdList::CheckPdgIdLists(){
90 return mAcceptedParticles->size()+mAcceptedMothers->size()+mAcceptedDaughters->size();
93 int StHbtCheckPdgIdList::CheckPdgIdList( pdgIdList* list){
94 if (list->size()==0)
return 1;
98 int StHbtCheckPdgIdList::CheckPdgIdList( pdgIdList* list,
int pdgCode ){
99 if (list->size()==0)
return 1;
100 for (pdgIdListIterator iter=list->begin(); iter!=list->end(); iter++)
101 if ( (*iter)==pdgCode)
return 1;
105 int StHbtCheckPdgIdList::CheckPdgIdList(
int pdgCode,
int motherPdgCode,
int daughterPdgCode ){
106 return CheckPdgIdList(mAcceptedParticles,pdgCode)
107 * CheckPdgIdList(mAcceptedMothers,motherPdgCode)
108 * CheckPdgIdList(mAcceptedDaughters,daughterPdgCode);