Skip to content

Commit cc9bb11

Browse files
Egamma HGC to contain HGCal electrons/photons only (exclude the barrel).
1 parent c0fd69f commit cc9bb11

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class GsfElectronCoreEcalDrivenProducer : public edm::global::EDProducer<> {
2121

2222
private:
2323
const bool useGsfPfRecTracks_;
24+
const bool hgcalOnly_;
2425

2526
const edm::EDGetTokenT<reco::GsfPFRecTrackCollection> gsfPfRecTracksToken_;
2627
const edm::EDGetTokenT<reco::GsfTrackCollection> gsfTracksToken_;
@@ -41,11 +42,13 @@ void GsfElectronCoreEcalDrivenProducer::fillDescriptions(edm::ConfigurationDescr
4142
desc.add<edm::InputTag>("gsfTracks", {"electronGsfTracks"});
4243
desc.add<edm::InputTag>("ctfTracks", {"generalTracks"});
4344
desc.add<bool>("useGsfPfRecTracks", true);
45+
desc.add<bool>("hgcalOnly", false);
4446
descriptions.add("ecalDrivenGsfElectronCores", desc);
4547
}
4648

4749
GsfElectronCoreEcalDrivenProducer::GsfElectronCoreEcalDrivenProducer(const edm::ParameterSet& config)
4850
: useGsfPfRecTracks_(config.getParameter<bool>("useGsfPfRecTracks")),
51+
hgcalOnly_(config.getParameter<bool>("hgcalOnly")),
4952
gsfPfRecTracksToken_(mayConsume<GsfPFRecTrackCollection>(config.getParameter<edm::InputTag>("gsfPfRecTracks"))),
5053
gsfTracksToken_(consumes<reco::GsfTrackCollection>(config.getParameter<edm::InputTag>("gsfTracks"))),
5154
ctfTracksToken_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("ctfTracks"))),
@@ -74,7 +77,11 @@ void GsfElectronCoreEcalDrivenProducer::produce(edm::StreamID, edm::Event& event
7477

7578
auto scRef = gsfTrackRef->extra()->seedRef().castTo<ElectronSeedRef>()->caloCluster().castTo<SuperClusterRef>();
7679
if (!scRef.isNull()) {
77-
eleCore.setSuperCluster(scRef);
80+
// if hgcalOnly flag is true but this seed is not from HGCAL, skip it.
81+
if (hgcalOnly_ && !scRef->seed()->caloID().detector(reco::CaloID::DET_HGCAL_ENDCAP))
82+
electrons.pop_back();
83+
else
84+
eleCore.setSuperCluster(scRef);
7885
} else {
7986
electrons.pop_back();
8087
edm::LogWarning("GsfElectronCoreEcalDrivenProducer") << "Seed CaloCluster is not a SuperCluster, unexpected...";

RecoEgamma/EgammaElectronProducers/python/ecalDrivenGsfElectronCoresHGC_cff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
ecalDrivenGsfElectronCoresHGC = ecalDrivenGsfElectronCores.clone(
44
gsfTracks = 'electronGsfTracks',
5-
useGsfPfRecTracks = False
5+
useGsfPfRecTracks = False,
6+
hgcalOnly = True,
67
)

RecoEgamma/EgammaPhotonProducers/python/photonCore_cfi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
)
1818

1919
photonCoreHGC = photonCore.clone(
20+
scHybridBarrelProducer = "",
2021
scIslandEndcapProducer = 'particleFlowSuperClusterHGCal',
2122
pixelSeedProducer = 'electronMergedSeeds'
2223
)

0 commit comments

Comments
 (0)