Main Page
Namespaces
Classes
Package Documentation
GeneratorInterface
HiGenCommon
src
MultiCandGenEvtSelector.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include "
GeneratorInterface/HiGenCommon/interface/MultiCandGenEvtSelector.h
"
3
4
MultiCandGenEvtSelector::MultiCandGenEvtSelector
(
const
edm::ParameterSet
& iConfig)
5
:
BaseHiGenEvtSelector
(iConfig)
6
{
7
ptMin_
= iConfig.
getParameter
<
double
>(
"ptMin"
);
8
etaMax_
= iConfig.
getParameter
<
double
>(
"etaMax"
);
9
pdg_
= iConfig.
getParameter
<
int
>(
"pdg"
);
10
st_
= iConfig.
getParameter
<
int
>(
"status"
);
11
nTrig_
= iConfig.
getParameter
<
int
>(
"minimumCandidates"
);
12
}
13
14
bool
MultiCandGenEvtSelector::filter
(HepMC::GenEvent * evt){
15
std::cout
<<
"Di Muon Fired"
<<std::endl;
16
17
int
found
= 0;
18
HepMC::GenEvent::particle_const_iterator
begin
= evt->particles_begin();
19
HepMC::GenEvent::particle_const_iterator
end
= evt->particles_end();
20
for
(HepMC::GenEvent::particle_const_iterator it = begin; it !=
end
; ++it){
21
if
(
selectParticle
(*it,
st_
,
pdg_
,
ptMin_
,
etaMax_
)) found++;
22
if
(found ==
nTrig_
)
return
true
;
23
}
24
25
return
false
;
26
}
MultiCandGenEvtSelector.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
MultiCandGenEvtSelector::MultiCandGenEvtSelector
MultiCandGenEvtSelector(const edm::ParameterSet &)
Definition:
MultiCandGenEvtSelector.cc:4
MultiCandGenEvtSelector::pdg_
int pdg_
Definition:
MultiCandGenEvtSelector.h:15
MultiCandGenEvtSelector::st_
int st_
Definition:
MultiCandGenEvtSelector.h:14
BaseHiGenEvtSelector::selectParticle
bool selectParticle(HepMC::GenParticle *par, int status, int pdg, double ptMin, double etaMax)
Definition:
BaseHiGenEvtSelector.h:13
runEdmFileComparison.found
found
Definition:
runEdmFileComparison.py:164
end
#define end
Definition:
vmac.h:39
MultiCandGenEvtSelector::etaMax_
double etaMax_
Definition:
MultiCandGenEvtSelector.h:13
begin
#define begin
Definition:
vmac.h:32
MultiCandGenEvtSelector::filter
bool filter(HepMC::GenEvent *) override
Definition:
MultiCandGenEvtSelector.cc:14
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
cout
Definition:
gather_cfg.py:143
BaseHiGenEvtSelector
Definition:
BaseHiGenEvtSelector.h:8
MultiCandGenEvtSelector::ptMin_
double ptMin_
Definition:
MultiCandGenEvtSelector.h:12
MultiCandGenEvtSelector::nTrig_
int nTrig_
Definition:
MultiCandGenEvtSelector.h:16
Generated for CMSSW Reference Manual by
1.8.11