44 edm::LogInfo(
"HLTriggerOfflineSUSYBSM") <<
"UserAnalysis parameters, MC for " <<
name <<
" selection:" ;
71 this->handleObjects(iEvent);
74 bool TotalCutPassed =
false;
77 bool ElectronCutPassed =
false;
78 bool MuonCutPassed =
false;
79 bool TauCutPassed =
false;
80 bool PhotonCutPassed =
false;
81 bool JetCutPassed =
false;
82 bool MetCutPassed =
false;
83 bool HtCutPassed =
false;
93 for(
unsigned int i=0;
i<theGenParticleCollection->size();
i++) {
94 const GenParticle* genParticle = (&(*theGenParticleCollection)[
i]);
95 if(genParticle->
status() == 2) {
97 if(fabs(genParticle->
pdgId()) == 15) {
105 if(genParticle->
status() == 1) {
116 if(fabs(motherCode) == fabs(genParticle->
pdgId()) || fabs(motherCode) == 15) {
118 if(fabs(motherCode) == fabs(genParticle->
pdgId()) || fabs(motherCode) == 15) motherCode = genParticle->
mother()->
mother()->
mother()->
pdgId();
120 if(fabs(motherCode) == 23 || fabs(motherCode) == 24 || fabs(motherCode) > 999999) {
136 if(fabs(motherCode) == fabs(genParticle->
pdgId()) || fabs(motherCode) == 15) {
138 if(fabs(motherCode) == fabs(genParticle->
pdgId()) || fabs(motherCode) == 15) motherCode = genParticle->
mother()->
mother()->
mother()->
pdgId();
140 if(fabs(motherCode) == 23 || fabs(motherCode) == 24 || fabs(motherCode) > 999999) {
148 if(fabs(genParticle->
pdgId()) == 22 && fabs(genParticle->
eta())<2.5) {
160 for(
unsigned int i=0;
i<theGenJetCollection->size();
i++) {
161 GenJet genjet = (*theGenJetCollection)[
i];
172 const GenMET theGenMET = theGenMETCollection->front();
174 if(theGenMET.
pt() >
mc_metMin) MetCutPassed =
true;
186 if(nMcElectrons ==
mc_nElec) ElectronCutPassed =
true;
189 if(nMcElectrons >=
mc_nElec) ElectronCutPassed =
true;
191 else cout <<
"WARNING: not a correct definition of cuts at gen level for electrons! " << endl;
195 if(nMcMuons ==
mc_nMuon) MuonCutPassed =
true;
198 if(nMcMuons >=
mc_nMuon) MuonCutPassed =
true;
200 else cout <<
"WARNING: not a correct definition of cuts at gen level for muons! " << endl;
201 if(nMcTaus >=
mc_nTau) TauCutPassed =
true;
202 if(nMcPhotons >=
mc_nPhot) PhotonCutPassed =
true;
203 if(nMcJets >=
mc_nJet ) JetCutPassed =
true;
227 HtCutPassed ) TotalCutPassed =
true;
246 return TotalCutPassed;
254 iEvent.
getByToken(m_genSrc, theCandidateCollectionHandle);
255 theGenParticleCollection = theCandidateCollectionHandle.
product();
260 iEvent.
getByToken( m_genJetSrc, theGenJetCollectionHandle);
261 theGenJetCollection = theGenJetCollectionHandle.
product();
266 iEvent.
getByToken( m_genMetSrc, theGenMETCollectionHandle);
267 theGenMETCollection = theGenMETCollectionHandle.
product();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
virtual int pdgId() const
PDG identifier.
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< reco::GenMET > GenMETCollection
collection of GenMET objects
virtual int status() const
status word
std::vector< GenJet > GenJetCollection
collection of GenJet objects
void handleObjects(const edm::Event &)
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
bool isSelected(const edm::Event &)
virtual size_t numberOfMothers() const
number of mothers
McSelector(const edm::ParameterSet &userCut_params, edm::ConsumesCollector &&iC)
Jets made from MC generator particles.
virtual int pdgId() const =0
PDG identifier.
T const * product() const
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...