1 #ifndef CommonTools_ParticleFlow_ElectronIDPFCandidateSelectorDefinition 2 #define CommonTools_ParticleFlow_ElectronIDPFCandidateSelectorDefinition 29 if (
cfg.exists(
"bitsToCheck")) {
32 if (
cfg.existsAs<std::vector<std::string> >(
"bitsToCheck")) {
33 std::vector<std::string> strbits =
cfg.getParameter<std::vector<std::string> >(
"bitsToCheck");
34 for (std::vector<std::string>::const_iterator istrbit = strbits.begin(), estrbit = strbits.end();
37 if (*istrbit ==
"id") {
39 }
else if (*istrbit ==
"iso") {
41 }
else if (*istrbit ==
"conv") {
43 }
else if (*istrbit ==
"ip") {
47 <<
"ElectronIDPFCandidateSelector: " 48 <<
"bitsToCheck allowed string values are only id(0), iso(1), conv(2), ip(3).\n" 49 <<
"Otherwise, use uint32_t bitmask).\n";
51 }
else if (
cfg.existsAs<uint32_t>(
"bitsToCheck")) {
52 mask_ =
cfg.getParameter<uint32_t>(
"bitsToCheck");
55 <<
"ElectronIDPFCandidateSelector: " 56 <<
"bitsToCheck must be either a vector of strings, or a uint32 bitmask.\n";
60 value_ =
cfg.getParameter<
double>(
"electronIdCut");
74 for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++
key) {
85 if (
it->gsfTrack() == PfTk) {
93 if (
std::count(
it->ambiguousGsfTracks().begin(),
it->ambiguousGsfTracks().end(), PfTk) > 0) {
102 float eleId = (*electronId)[ref];
105 uint32_t thisval = eleId;
113 selected_.back().setSourceCandidatePtr(ptrToMother);
Selects PFCandidates basing on cuts provided with string cut parser.
ElectronIDPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
electronId
when omitted electron plots will be filled w/o cut on electronId
edm::EDGetTokenT< edm::ValueMap< float > > electronIdToken_
key
prepare the HTCondor submission files and eventually submit them
bool isNull() const
Checks for null.
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
edm::EDGetTokenT< reco::GsfElectronCollection > electronsToken_
Particle reconstructed by the particle flow algorithm.