17 vector<double> defptmin ;
18 defptmin.push_back(0.);
21 vector<double> defetamin ;
22 defetamin.push_back(-10.);
24 vector<double> defetamax ;
25 defetamax.push_back(10.);
28 vector<double> defDecayRadiusmin ;
29 defDecayRadiusmin.push_back(-10.);
32 vector<double> defDecayRadiusmax ;
33 defDecayRadiusmax.push_back(1.e5);
36 vector<double> defDecayZmin ;
37 defDecayZmin.push_back(-1.e5);
40 vector<double> defDecayZmax ;
41 defDecayZmax.push_back(1.e5);
53 cout <<
"WARNING: MCPROCESSFILTER : size of MinPthat and/or MaxPthat not matching with ProcessID size!!" << endl;
58 vector<double> defptmin2 ;
59 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defptmin2.push_back(0.);}
64 vector<double> defetamin2 ;
65 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defetamin2.push_back(-10.);}
70 vector<double> defetamax2 ;
71 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defetamax2.push_back(10.);}
77 vector<double> decayRadiusmin2 ;
78 for (
unsigned int i = 0;
i <
particleID.size();
i++){ decayRadiusmin2.push_back(-10.);}
83 vector<double> decayRadiusmax2 ;
84 for (
unsigned int i = 0;
i <
particleID.size();
i++){ decayRadiusmax2.push_back(1.e5);}
90 vector<double> decayZmin2 ;
91 for (
unsigned int i = 0;
i <
particleID.size();
i++){ decayZmin2.push_back(-1.e5);}
96 vector<double> decayZmax2 ;
97 for (
unsigned int i = 0;
i <
particleID.size();
i++){ decayZmax2.push_back(1.e5);}
124 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
125 p != myGenEvent->particles_end(); ++
p ) {
129 if (!((*p)->end_vertex()))
continue;
132 if ( (*p)->momentum().perp() <
ptMin[
i] )
continue;
134 if ( (*p)->momentum().eta() <
etaMin[
i] )
continue;
135 if ( (*p)->momentum().eta() >
etaMax[
i] )
continue;
137 double decx = (*p)->end_vertex()->position().x();
138 double decy = (*p)->end_vertex()->position().y();
139 double decrad =
sqrt(decx*decx+decy*decy);
143 double decz = (*p)->end_vertex()->position().z();
148 if ((*p)->status()==2) {
149 for (HepMC::GenVertex::particle_iterator
153 if (
abs((*vpdec)->pdg_id())!=13)
continue;
154 if (fabs((*vpdec)->momentum().perp())>
ptMuMin) {
159 }
else if ((*p)->status()==1) {
171 if (accepted){
return true; }
else {
return false;}
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > etaMin
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > decayZMax
edm::EDGetTokenT< edm::HepMCProduct > token_
std::vector< int > particleID
std::vector< double > decayRadiusMin
MCDecayingPionKaonFilter(const edm::ParameterSet &)
std::vector< double > decayRadiusMax
~MCDecayingPionKaonFilter() override
Abs< T >::type abs(const T &t)
std::vector< double > ptMin
std::vector< double > decayZMin
const HepMC::GenEvent * GetEvent() const
bool accepted(std::vector< std::string_view > const &, std::string_view)
bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< double > etaMax