20 vector<double> defptmin ;
21 defptmin.push_back(0.);
23 vector<double> defrapmin ;
24 defrapmin.push_back(-10.);
26 vector<double> defrapmax ;
27 defrapmax.push_back(10.);
38 edm::LogWarning(
"MCSingleParticleYPt") <<
"WARNING: MCSingleParticleYPt : size of vector cuts do not match!!" << endl;
43 vector<double> defptmin2 ;
44 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defptmin2.push_back(0.);}
49 vector<double> defrapmin2 ;
50 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defrapmin2.push_back(-10.);}
55 vector<double> defrapmax2 ;
56 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defrapmax2.push_back(10.);}
61 vector<int> defstat2 ;
62 for (
unsigned int i = 0;
i <
particleID.size();
i++){ defstat2.push_back(0);}
67 edm::LogInfo(
"MCSingleParticleYPt") <<
"----------------------------------------------------------------------" << std::endl;
68 edm::LogInfo(
"MCSingleParticleYPt") <<
"----- MCSingleParticleYPt" << std::endl;
73 edm::LogInfo(
"MCSingleParticleYPt") <<
"----------------------------------------------------------------------" << std::endl;
89 bool accepted =
false;
94 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
95 p != myGenEvent->particles_end(); ++
p ) {
96 if (
fVerbose > 3)
edm::LogInfo(
"MCSingleParticleYPt") <<
"Looking at particle : " << (*p)->pdg_id() <<
" status : " << (*p)->status() << std::endl;
101 rapidity = ((*p)->momentum().e()-(*p)->momentum().pz()) > 0. ? 0.5*
log( ((*p)->momentum().e()+(*p)->momentum().pz()) / ((*p)->momentum().e()-(*p)->momentum().pz()) ) :
rapMax[
i]+.1;
102 if (
fVerbose > 2)
edm::LogInfo(
"MCSingleParticleYPt") <<
"Testing particle : " << (*p)->pdg_id() <<
" pT: " << (*p)->momentum().perp() <<
" y: " <<
rapidity <<
" status : " << (*p)->status() << endl;
103 if ( (*p)->momentum().perp() >
ptMin[
i]
109 edm::LogInfo(
"MCSingleParticleYPt") <<
"Accepted particle : " << (*p)->pdg_id() <<
" pT: " << (*p)->momentum().perp() <<
" y: " <<
rapidity <<
" status : " << (*p)->status() << endl;
118 if (accepted) {
return true; }
119 else {
return false; }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > particleID
std::vector< int > status
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > rapMax
bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< double > ptMin
~MCSingleParticleYPt() override
const HepMC::GenEvent * GetEvent() const
MCSingleParticleYPt(const edm::ParameterSet &)
edm::EDGetTokenT< edm::HepMCProduct > token_
std::vector< double > rapMin