100 typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>>
GenAssociations;
102 std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>>
genMatchTokens_;
161 bool primaryVertexIsValid,
163 bool beamspotIsValid);
170 template <
typename T>
177 typedef std::pair<std::string, edm::InputTag>
NameTag;
217 template <
typename T>
227 if (depconf.
exists(
"tracker"))
229 if (depconf.
exists(
"ecal"))
231 if (depconf.
exists(
"hcal"))
233 if (depconf.
exists(
"pfAllParticles")) {
236 if (depconf.
exists(
"pfChargedHadrons")) {
240 if (depconf.
exists(
"pfChargedAll")) {
243 if (depconf.
exists(
"pfPUChargedHadrons")) {
247 if (depconf.
exists(
"pfNeutralHadrons")) {
251 if (depconf.
exists(
"pfPhotons")) {
254 if (depconf.
exists(
"user")) {
255 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag>>(
"user");
256 std::vector<edm::InputTag>::const_iterator
it = userdeps.begin(), ed = userdeps.end();
258 for (;
it != ed; ++
it, ++
key) {
272 electronToken_(consumes<
edm::
View<
reco::GsfElectron>>(iConfig.getParameter<
edm::
InputTag>(
"electronSource"))),
274 embedGsfElectronCore_(iConfig.getParameter<
bool>(
"embedGsfElectronCore")),
275 embedGsfTrack_(iConfig.getParameter<
bool>(
"embedGsfTrack")),
276 embedSuperCluster_(iConfig.getParameter<
bool>(
"embedSuperCluster")),
277 embedPflowSuperCluster_(iConfig.getParameter<
bool>(
"embedPflowSuperCluster")),
278 embedSeedCluster_(iConfig.getParameter<
bool>(
"embedSeedCluster")),
279 embedBasicClusters_(iConfig.getParameter<
bool>(
"embedBasicClusters")),
280 embedPreshowerClusters_(iConfig.getParameter<
bool>(
"embedPreshowerClusters")),
281 embedPflowBasicClusters_(iConfig.getParameter<
bool>(
"embedPflowBasicClusters")),
282 embedPflowPreshowerClusters_(iConfig.getParameter<
bool>(
"embedPflowPreshowerClusters")),
283 embedTrack_(iConfig.getParameter<
bool>(
"embedTrack")),
284 addGenMatch_(iConfig.getParameter<
bool>(
"addGenMatch")),
285 embedGenMatch_(addGenMatch_ ? iConfig.getParameter<
bool>(
"embedGenMatch") :
false),
286 embedRecHits_(iConfig.getParameter<
bool>(
"embedRecHits")),
288 useParticleFlow_(iConfig.getParameter<
bool>(
"useParticleFlow")),
289 usePfCandidateMultiMap_(iConfig.getParameter<
bool>(
"usePfCandidateMultiMap")),
290 pfElecToken_(!usePfCandidateMultiMap_
294 iConfig.getParameter<
edm::
InputTag>(
"pfCandidateMap"))
296 pfCandidateMultiMapToken_(usePfCandidateMultiMap_
298 iConfig.getParameter<
edm::
InputTag>(
"pfCandidateMultiMap"))
300 embedPFCandidate_(iConfig.getParameter<
bool>(
"embedPFCandidate")),
302 addMVAVariables_(iConfig.getParameter<
bool>(
"addMVAVariables")),
303 reducedBarrelRecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"reducedBarrelRecHitCollection")),
304 reducedBarrelRecHitCollectionToken_(mayConsume<
EcalRecHitCollection>(reducedBarrelRecHitCollection_)),
305 reducedEndcapRecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"reducedEndcapRecHitCollection")),
306 reducedEndcapRecHitCollectionToken_(mayConsume<
EcalRecHitCollection>(reducedEndcapRecHitCollection_)),
307 ecalClusterToolsESGetTokens_{consumesCollector()},
309 addPFClusterIso_(iConfig.getParameter<
bool>(
"addPFClusterIso")),
310 addPuppiIsolation_(iConfig.getParameter<
bool>(
"addPuppiIsolation")),
314 embedHighLevelSelection_(iConfig.getParameter<
bool>(
"embedHighLevelSelection")),
315 beamLineToken_(consumes<reco::BeamSpot>(iConfig.getParameter<
edm::InputTag>(
"beamLineSrc"))),
316 pvToken_(mayConsume<std::vector<reco::Vertex>>(iConfig.getParameter<
edm::InputTag>(
"pvSrc"))),
317 addElecID_(iConfig.getParameter<
bool>(
"addElectronID")),
319 isolator_(iConfig.getParameter<
edm::ParameterSet>(
"userIsolation"), consumesCollector(),
false),
320 addEfficiencies_(iConfig.getParameter<
bool>(
"addEfficiencies")),
321 addResolutions_(iConfig.getParameter<
bool>(
"addResolutions")),
322 useUserData_(iConfig.exists(
"userData")),
332 if (addResolutions_) {
336 if (addPuppiIsolation_) {
338 PUPPIIsolation_charged_hadrons_ =
339 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationChargedHadrons"));
340 PUPPIIsolation_neutral_hadrons_ =
341 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationNeutralHadrons"));
342 PUPPIIsolation_photons_ =
343 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiIsolationPhotons"));
345 PUPPINoLeptonsIsolation_charged_hadrons_ =
346 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationChargedHadrons"));
347 PUPPINoLeptonsIsolation_neutral_hadrons_ =
348 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationNeutralHadrons"));
349 PUPPINoLeptonsIsolation_photons_ =
350 consumes<edm::ValueMap<float>>(iConfig.getParameter<
edm::InputTag>(
"puppiNoLeptonsIsolationPhotons"));
356 elecIDSrcs_.push_back(NameTag(
"", iConfig.getParameter<
edm::InputTag>(
"electronIDSource")));
361 if (!elecIDSrcs_.empty()) {
363 <<
"PATElectronProducer: you can't specify both 'electronIDSource' and 'electronIDSources'\n";
368 for (std::vector<std::string>::const_iterator
it =
names.begin(), ed =
names.end();
it != ed; ++
it) {
373 if (elecIDSrcs_.empty()) {
375 <<
"PATElectronProducer: id addElectronID is true, you must specify either:\n" 376 <<
"\tInputTag electronIDSource = <someTag>\n" 378 <<
"\tPSet electronIDSources = { \n" 379 <<
"\t\tInputTag <someName> = <someTag> // as many as you want \n " 384 elecIDSrcs_, [
this](NameTag
const&
tag) {
return mayConsume<edm::ValueMap<float>>(
tag.second); });
406 computeMiniIso_ = iConfig.getParameter<
bool>(
"computeMiniIso");
407 miniIsoParamsE_ = iConfig.getParameter<std::vector<double>>(
"miniIsoParamsE");
408 miniIsoParamsB_ = iConfig.getParameter<std::vector<double>>(
"miniIsoParamsB");
409 if (computeMiniIso_ && (miniIsoParamsE_.size() != 9 || miniIsoParamsB_.size() != 9)) {
410 throw cms::Exception(
"ParameterError") <<
"miniIsoParams must have exactly 9 elements.\n";
413 pcToken_ = consumes<pat::PackedCandidateCollection>(iConfig.getParameter<
edm::InputTag>(
"pfCandsForMiniIso"));
416 readIsolationLabels(iConfig,
"isoDeposits", isoDepositLabels_, isoDepositTokens_);
418 readIsolationLabels(iConfig,
"isolationValues", isolationValueLabels_, isolationValueTokens_);
420 readIsolationLabels(iConfig,
"isolationValuesNoPFId", isolationValueLabelsNoPFId_, isolationValueNoPFIdTokens_);
422 if (addEfficiencies_) {
433 if (useParticleFlow_ && usePfCandidateMultiMap_)
434 throw cms::Exception(
"Configuration",
"usePfCandidateMultiMap not supported when useParticleFlow is set to true");
437 produces<std::vector<Electron>>();
444 if (
iEvent.isRealData()) {
508 std::vector<edm::Handle<edm::ValueMap<float>>> idhandles;
509 std::vector<pat::Electron::IdPair> ids;
524 bool beamSpotIsValid =
false;
525 bool primaryVertexIsValid =
false;
539 if (beamSpotHandle.
isValid()) {
541 beamSpotIsValid =
true;
543 edm::LogError(
"DataNotAvailable") <<
"No beam spot available from EventSetup, not adding high level selection \n";
546 if (pvHandle.
isValid() && !pvHandle->empty()) {
548 primaryVertexIsValid =
true;
551 <<
"No primary vertex available from EventSetup, not adding high level selection \n";
573 std::vector<Electron>*
patElectrons =
new std::vector<Electron>();
588 bool MatchedToAmbiguousGsfTrack =
false;
593 if (
Matched || MatchedToAmbiguousGsfTrack)
598 if (itElectron->gsfTrack() ==
i->gsfTrackRef()) {
601 for (
auto const&
it : itElectron->ambiguousGsfTracks()) {
602 MatchedToAmbiguousGsfTrack |= (
bool)(
i->gsfTrackRef() ==
it);
606 if (
Matched || MatchedToAmbiguousGsfTrack) {
616 (*PUPPIIsolation_neutral_hadrons)[elePtr],
617 (*PUPPIIsolation_photons)[elePtr]);
619 (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr],
620 (*PUPPINoLeptonsIsolation_photons)[elePtr]);
644 if (
track.isNonnull() &&
track.isAvailable()) {
649 ip3d = ip3dpv.second.value();
658 ids[
i].second = (*idhandles[
i])[elecsRef];
661 ids.push_back(std::make_pair(
"pf_evspi", pfRef->mva_e_pi()));
662 ids.push_back(std::make_pair(
"pf_evsmu", pfRef->mva_e_mu()));
668 const auto& vCov = lazyTools.localCovariances(*(itElectron->superCluster()->seed()));
684 std::vector<DetId> selectedCells;
685 bool barrel = itElectron->isEB();
689 clusIt != itElectron->superCluster()->clustersEnd();
692 DetId seed = lazyTools.getMaximum(**clusIt).first;
694 std::vector<DetId> dets5x5 =
697 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
700 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
701 selectedCells.push_back(
hit.first);
708 clusIt != itElectron->parentSuperCluster()->clustersEnd();
711 DetId seed = lazyTools.getMaximum(**clusIt).first;
713 std::vector<DetId> dets5x5 =
716 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
719 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
720 selectedCells.push_back(
hit.first);
726 std::sort(selectedCells.begin(), selectedCells.end());
727 std::unique(selectedCells.begin(), selectedCells.end());
740 unsigned nSelectedCells = selectedCells.size();
741 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
747 selectedRecHits.
sort();
752 bool passconversionveto =
false;
753 if (hConversions.isValid()) {
795 bool pfCandsPresent =
false, valMapPresent =
false;
824 }
else if (pfCandsPresent) {
832 if (trkRef == pfTrkRef) {
839 }
else if (valMapPresent) {
864 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
871 ids[
i].second = (*idhandles[
i])[elecsRef];
888 if (
track.isNonnull() &&
track.isAvailable()) {
893 ip3d = ip3dpv.second.value();
899 const auto& vCov = lazyTools.localCovariances(*(itElectron->superCluster()->seed()));
918 (*PUPPIIsolation_neutral_hadrons)[elePtr],
919 (*PUPPIIsolation_photons)[elePtr]);
921 (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr],
922 (*PUPPINoLeptonsIsolation_photons)[elePtr]);
928 std::vector<DetId> selectedCells;
929 bool barrel = itElectron->isEB();
933 clusIt != itElectron->superCluster()->clustersEnd();
936 DetId seed = lazyTools.getMaximum(**clusIt).first;
938 std::vector<DetId> dets5x5 =
941 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
944 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
945 selectedCells.push_back(
hit.first);
952 clusIt != itElectron->parentSuperCluster()->clustersEnd();
955 DetId seed = lazyTools.getMaximum(**clusIt).first;
957 std::vector<DetId> dets5x5 =
960 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
963 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
964 selectedCells.push_back(
hit.first);
970 std::sort(selectedCells.begin(), selectedCells.end());
971 std::unique(selectedCells.begin(), selectedCells.end());
984 unsigned nSelectedCells = selectedCells.size();
985 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
991 selectedRecHits.
sort();
996 bool passconversionveto =
false;
997 if (hConversions.isValid()) {
1003 passconversionveto =
1023 std::unique_ptr<std::vector<Electron>> ptr(
patElectrons);
1079 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
1100 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
1165 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
1182 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
1208 if (anElectron.
isEE())
1238 iDesc.
setComment(
"PAT electron producer module");
1247 "ecalPFClusterIsoMap",
edm::InputTag(
"electronEcalPFClusterIsolationProducer"),
true) and
1249 "hcalPFClusterIsoMap",
edm::InputTag(
"electronHcalPFClusterIsolationProducer"),
true))
or 1255 "puppiIsolationChargedHadrons",
1256 edm::InputTag(
"egmElectronPUPPIIsolation",
"h+-DR030-BarVeto000-EndVeto001"),
1259 "puppiIsolationNeutralHadrons",
1260 edm::InputTag(
"egmElectronPUPPIIsolation",
"h0-DR030-BarVeto000-EndVeto000"),
1263 "puppiIsolationPhotons",
1264 edm::InputTag(
"egmElectronPUPPIIsolation",
"gamma-DR030-BarVeto000-EndVeto008"),
1267 "puppiNoLeptonsIsolationChargedHadrons",
1268 edm::InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008"),
1271 "puppiNoLeptonsIsolationNeutralHadrons",
1272 edm::InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008"),
1275 "puppiNoLeptonsIsolationPhotons",
1276 edm::InputTag(
"egmElectronPUPPINoLeptonsIsolation",
"gamma-DR030-BarVeto000-EndVeto008"),
1281 iDesc.
add<
bool>(
"embedGsfElectronCore",
true)->setComment(
"embed external gsf electron core");
1282 iDesc.
add<
bool>(
"embedGsfTrack",
true)->setComment(
"embed external gsf track");
1283 iDesc.
add<
bool>(
"embedSuperCluster",
true)->setComment(
"embed external super cluster");
1284 iDesc.
add<
bool>(
"embedPflowSuperCluster",
true)->setComment(
"embed external super cluster");
1285 iDesc.
add<
bool>(
"embedSeedCluster",
true)->setComment(
"embed external seed cluster");
1286 iDesc.
add<
bool>(
"embedBasicClusters",
true)->setComment(
"embed external basic clusters");
1287 iDesc.
add<
bool>(
"embedPreshowerClusters",
true)->setComment(
"embed external preshower clusters");
1288 iDesc.
add<
bool>(
"embedPflowBasicClusters",
true)->setComment(
"embed external pflow basic clusters");
1289 iDesc.
add<
bool>(
"embedPflowPreshowerClusters",
true)->setComment(
"embed external pflow preshower clusters");
1290 iDesc.
add<
bool>(
"embedTrack",
false)->setComment(
"embed external track");
1291 iDesc.
add<
bool>(
"embedRecHits",
true)->setComment(
"embed external RecHits");
1295 ->setComment(
"particle flow input collection");
1298 "take ParticleFlow candidates from pfCandidateMultiMap instead of matching to pfElectrons by Gsf track " 1300 iDesc.
ifValue(usePfCandidateMultiMap,
1303 iDesc.
add<
bool>(
"useParticleFlow",
false)->setComment(
"whether to use particle flow or not");
1304 iDesc.
add<
bool>(
"embedPFCandidate",
false)->setComment(
"embed external particle flow object");
1307 iDesc.
add<
bool>(
"addGenMatch",
true)->setComment(
"add MC matching");
1308 iDesc.
add<
bool>(
"embedGenMatch",
false)->setComment(
"embed MC matched MC information");
1309 std::vector<edm::InputTag> emptySourceVector;
1313 ->
setComment(
"input with MC match information");
1316 iDesc.
add<
bool>(
"addElectronID",
true)->setComment(
"add electron ID variables");
1323 ->
setComment(
"input with electron ID variables");
1326 iDesc.
add<
bool>(
"computeMiniIso",
false)->setComment(
"whether or not to compute and store electron mini-isolation");
1328 ->setComment(
"collection to use to compute mini-iso");
1329 iDesc.
add<std::vector<double>>(
"miniIsoParamsE", std::vector<double>())
1330 ->
setComment(
"mini-iso parameters to use for endcap electrons");
1331 iDesc.
add<std::vector<double>>(
"miniIsoParamsB", std::vector<double>())
1332 ->
setComment(
"mini-iso parameters to use for barrel electrons");
1345 isoDepositsPSet.
addOptional<std::vector<edm::InputTag>>(
"user");
1346 iDesc.
addOptional(
"isoDeposits", isoDepositsPSet);
1359 isolationValuesPSet.
addOptional<std::vector<edm::InputTag>>(
"user");
1360 iDesc.
addOptional(
"isolationValues", isolationValuesPSet);
1373 isolationValuesNoPFIdPSet.
addOptional<std::vector<edm::InputTag>>(
"user");
1374 iDesc.
addOptional(
"isolationValuesNoPFId", isolationValuesNoPFIdPSet);
1379 iDesc.
add(
"efficiencies", efficienciesPSet);
1380 iDesc.
add<
bool>(
"addEfficiencies",
false);
1388 iDesc.
add<
bool>(
"addMVAVariables",
true)->setComment(
"embed extra variables in pat::Electron : sip3d, sigmaIEtaIPhi");
1394 iDesc.
add(
"userIsolation", isolationPSet);
1399 iDesc.
add<
bool>(
"embedHighLevelSelection",
true)->setComment(
"embed high level selection");
1403 ->
setComment(
"input with high level selection");
1405 ->
setComment(
"input with high level selection");
1407 descriptions.
add(
"PATElectronProducer", iDesc);
1416 bool primaryVertexIsValid,
1418 bool beamspotIsValid) {
1426 std::pair<bool, Measurement1D>
result =
1428 double d0_corr =
result.second.value();
1429 double d0_err = primaryVertexIsValid ?
result.second.error() : -1.0;
1441 d0_corr =
result.second.value();
1442 d0_err = beamspotIsValid ?
result.second.error() : -1.0;
void setMvaVariables(double sigmaIetaIphi, double ip3d)
set missing mva input variables
bool enabled() const
'true' if this there is at least one efficiency configured
void setComment(std::string const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
void embedRecHits(const EcalRecHitCollection *rechits)
method to store the RecHits internally - can be called from the PATElectronProducer ...
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
T getParameter(std::string const &) const
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
void setIsolation(IsolationKeys key, float value)
const GreaterByPt< Electron > pTComparator_
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
bool contains(EventRange const &lh, EventID const &rh)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
bool enabled() const
True if it has a non null configuration.
const bool useParticleFlow_
pflow specific
~PATElectronProducer() override
void setElectronIDs(const std::vector< IdPair > &ids)
Store multiple electron ID values, discarding existing ones. The first one in the list becomes the 'd...
ProductID id() const
Accessor for product ID.
const edm::EDGetTokenT< reco::PFCandidateCollection > pfElecToken_
const Point & position() const
position
std::vector< double > miniIsoParamsE_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void setAllowAnything()
allow any parameter label/value pairs
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
IsolationLabels isoDepositLabels_
std::vector< l1t::PFCandidate > PFCandidateCollection
const bool embedPFCandidate_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void embedSuperCluster()
method to store the electron's SuperCluster internally
T const * product() const
std::vector< pat::PackedCandidate > PackedCandidateCollection
void embedHighLevel(pat::Electron &anElectron, reco::GsfTrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
std::vector< EcalRecHit >::const_iterator const_iterator
void setPFCandidateRef(const reco::PFCandidateRef &ref)
add a reference to the source IsolatedPFCandidate
const edm::InputTag reducedBarrelRecHitCollection_
void push_back(T const &t)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
void embedGsfElectronCore()
method to store the electron's core internally
void setPassConversionVeto(bool flag)
edm::RefToBase< reco::GsfElectron > ElectronBaseRef
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
IsolationKeys
Enum defining isolation keys.
Log< level::Error, false > LogError
const bool embedBasicClusters_
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
void setEcalDrivenMomentum(const Candidate::LorentzVector &mom)
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > elecIDTokens_
void setPfIsolationVariables(const PflowIsolationVariables &iso)
const std::string names[nVars_]
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopologyToken_
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
const bool addMVAVariables_
mva input variables
std::vector< double > miniIsoParamsB_
void embedPflowSuperCluster()
method to store the electron's PflowSuperCluster internally
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates; null if this has been built from a standard electron ...
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
static void fillDescription(edm::ParameterSetDescription &iDesc)
reco::TransientTrack build(const reco::Track *p) const
const bool addEfficiencies_
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
const bool usePfCandidateMultiMap_
void setComment(std::string const &value)
const PflowIsolationVariables & pfIsolationVariables() const
pat::helper::MultiIsolator isolator_
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
Produces pat::Electron's.
const bool addPuppiIsolation_
void embedSeedCluster()
method to store the electron's seedcluster internally
PATElectronProducer(const edm::ParameterSet &iConfig)
const bool embedHighLevelSelection_
embed high level selection variables?
const bool addResolutions_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
bool isNonnull() const
Checks for non-null.
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
def unique(seq, keepstr=True)
bool enabled() const
'true' if this there is at least one efficiency configured
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
void setIsolationPUPPINoLeptons(float chargedhadrons_, float neutralhadrons_, float photons_)
sets PUPPINoLeptons isolations
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
const bool embedSeedCluster_
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
const edm::InputTag reducedEndcapRecHitCollection_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const bool addPFClusterIso_
math::XYZPoint Point
point in the space
void embedPflowBasicClusters()
method to store the electron's pflow basic clusters
const LorentzVector & p4(P4Kind kind) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void embedBasicClusters()
method to store the electron's basic clusters
bool isNull() const
Checks for null.
std::pair< std::string, edm::InputTag > NameTag
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
reducedEERecHitCollection
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
void embedGsfTrack()
method to store the electron's GsfTrack internally
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
std::vector< Conversion > ConversionCollection
const bool embedGsfTrack_
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
const edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
void addGenParticleRef(const reco::GenParticleRef &ref)
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueNoPFIdTokens_
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
pat::helper::EfficiencyLoader efficiencyLoader_
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > trackBuilderToken_
void setIsPF(bool hasPFCandidate)
const bool embedGsfElectronCore_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > pfCandidateMultiMapToken_
pat::PATUserDataHelper< pat::Electron > userDataHelper_
void fillElectron2(Electron &anElectron, const reco::CandidatePtr &candPtrForIsolation, const reco::CandidatePtr &candPtrForGenMatch, const reco::CandidatePtr &candPtrForLoader, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
Analysis-level electron class.
const CaloTopology * ecalTopology_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void setMiniPFIsolation(PFIsolation const &iso)
IsolationLabels isolationValueLabelsNoPFId_
void setElectronMiniIso(pat::Electron &anElectron, const pat::PackedCandidateCollection *pc)
void embedPreshowerClusters()
method to store the electron's preshower clusters
std::vector< IsolationLabel > IsolationLabels
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
IsolationLabels isolationValueLabels_
const bool embedPflowSuperCluster_
Calculates a lepton's calorimetric isolation energy.
const bool embedPflowPreshowerClusters_
reducedEBRecHitCollection
pat::helper::KinResolutionsLoader resolutionLoader_
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const reco::Candidate::PolarLorentzVector &p4, float mindr=0.05, float maxdr=0.2, float kt_scale=10.0, float ptthresh=0.5, float deadcone_ch=0.0001, float deadcone_pu=0.01, float deadcone_ph=0.01, float deadcone_nh=0.01, float dZ_cut=0.0)
const bool embedPflowBasicClusters_
void embedPflowPreshowerClusters()
method to store the electron's pflow preshower clusters
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
void embedTrack()
method to store the electron's Track internally
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
primaryVertex
hltOfflineBeamSpot for HLTMON
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
const bool embedPreshowerClusters_
void setIsolationPUPPI(float chargedhadrons_, float neutralhadrons_, float photons_)
sets PUPPI isolations
static std::string const source
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
void embedPFCandidate()
embed the PFCandidate pointed to by pfCandidateRef_
void fillElectron(Electron &aElectron, const ElectronBaseRef &electronRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const bool pfId, const IsolationValueMaps &isolationValues, const IsolationValueMaps &isolationValuesNoPFId) const
common electron filling, for both the standard and PF2PAT case
Global3DVector GlobalVector
Calculates a lepton's tracker isolation pt.
std::vector< NameTag > elecIDSrcs_
const bool embedSuperCluster_