CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
photonIsolationHIProducer Class Reference
Inheritance diagram for photonIsolationHIProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 photonIsolationHIProducer (const edm::ParameterSet &ps)
 
 ~photonIsolationHIProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void produce (edm::Event &evt, const edm::EventSetup &es) override
 

Private Attributes

edm::EDGetTokenT
< reco::BasicClusterCollection
barrelClusters_
 
edm::EDGetTokenT
< EcalRecHitCollection
barrelEcalHits_
 
edm::EDGetTokenT
< reco::BasicClusterCollection
endcapClusters_
 
edm::EDGetTokenT
< EcalRecHitCollection
endcapEcalHits_
 
edm::EDGetTokenT
< HBHERecHitCollection
hbhe_
 
edm::EDGetTokenT
< HFRecHitCollection
hf_
 
edm::EDGetTokenT
< HORecHitCollection
ho_
 
edm::EDGetTokenT
< reco::PhotonCollection
photonProducer_
 
std::string trackQuality_
 
edm::EDGetTokenT
< reco::TrackCollection
tracks_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 22 of file photonIsolationHIProducer.cc.

Constructor & Destructor Documentation

photonIsolationHIProducer::photonIsolationHIProducer ( const edm::ParameterSet ps)
explicit

Definition at line 49 of file photonIsolationHIProducer.cc.

50  :
52  consumes<reco::PhotonCollection>(config.getParameter<edm::InputTag>("photonProducer"))),
54  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ebRecHitCollection"))),
56  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("eeRecHitCollection"))),
57  hbhe_ ( consumes<HBHERecHitCollection>(config.getParameter<edm::InputTag>("hbhe"))),
58  hf_ ( consumes<HFRecHitCollection>(config.getParameter<edm::InputTag>("hf"))),
59  ho_ ( consumes<HORecHitCollection>(config.getParameter<edm::InputTag>("ho"))),
60  barrelClusters_ ( consumes<reco::BasicClusterCollection>(config.getParameter<edm::InputTag>("basicClusterBarrel"))),
61  endcapClusters_ ( consumes<reco::BasicClusterCollection>(config.getParameter<edm::InputTag>("basicClusterEndcap"))),
62  tracks_ ( consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackCollection"))),
63  trackQuality_ ( config.getParameter<std::string>("trackQuality"))
64 {
65  produces< reco::HIPhotonIsolationMap >();
66 }
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
edm::EDGetTokenT< HFRecHitCollection > hf_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
edm::EDGetTokenT< reco::BasicClusterCollection > barrelClusters_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
edm::EDGetTokenT< reco::PhotonCollection > photonProducer_
edm::EDGetTokenT< reco::TrackCollection > tracks_
photonIsolationHIProducer::~photonIsolationHIProducer ( )

Definition at line 68 of file photonIsolationHIProducer.cc.

68 {}

Member Function Documentation

void photonIsolationHIProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 150 of file photonIsolationHIProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns14e33_v1_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

150  {
152 
153  desc.add<edm::InputTag>("photonProducer",edm::InputTag("photons"));
154  desc.add<edm::InputTag>("ebRecHitCollection",edm::InputTag("ecalRecHit:EcalRecHitsEB"));
155  desc.add<edm::InputTag>("eeRecHitCollection",edm::InputTag("ecalRecHit:EcalRecHitsEE"));
156  desc.add<edm::InputTag>("hbhe",edm::InputTag("hbhereco"));
157  desc.add<edm::InputTag>("hf",edm::InputTag("hfreco"));
158  desc.add<edm::InputTag>("ho",edm::InputTag("horeco"));
159  desc.add<edm::InputTag>("basicClusterBarrel",edm::InputTag("islandBasicClusters:islandBarrelBasicClusters"));
160  desc.add<edm::InputTag>("basicClusterEndcap",edm::InputTag("islandBasicClusters:islandEndcapBasicClusters"));
161  desc.add<edm::InputTag>("trackCollection",edm::InputTag("hiGeneralTracks"));
162  desc.add<std::string>("trackQuality","highPurity");
163 
164  descriptions.add("photonIsolationHIProducer", desc);
165 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void photonIsolationHIProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 71 of file photonIsolationHIProducer.cc.

References HLT_25ns14e33_v3_cff::barrelClusters, barrelClusters_, barrelEcalHits_, reco::HIPhotonIsolation::ecalClusterIsoR1(), reco::HIPhotonIsolation::ecalClusterIsoR2(), reco::HIPhotonIsolation::ecalClusterIsoR3(), reco::HIPhotonIsolation::ecalClusterIsoR4(), reco::HIPhotonIsolation::ecalClusterIsoR5(), HLT_25ns14e33_v3_cff::endcapClusters, endcapClusters_, endcapEcalHits_, edm::helper::Filler< Map >::fill(), EcalClusterIsoCalculator::getBkgSubEcalClusterIso(), HcalRechitIsoCalculator::getBkgSubHcalRechitIso(), TrackIsoCalculator::getBkgSubTrackIso(), edm::Event::getByToken(), hbhe_, reco::HIPhotonIsolation::hcalRechitIsoR1(), reco::HIPhotonIsolation::hcalRechitIsoR2(), reco::HIPhotonIsolation::hcalRechitIsoR3(), reco::HIPhotonIsolation::hcalRechitIsoR4(), reco::HIPhotonIsolation::hcalRechitIsoR5(), hf_, ho_, edm::helper::Filler< Map >::insert(), photonProducer_, interactiveExample::photons, edm::Event::put(), HI_PhotonSkim_cff::rechits, fileCollector::seed, reco::HIPhotonIsolation::seedTime(), reco::HIPhotonIsolation::swissCrx(), cond::rpcobgas::time, HLT_25ns14e33_v3_cff::trackCollection, reco::HIPhotonIsolation::trackIsoR1PtCut20(), reco::HIPhotonIsolation::trackIsoR2PtCut20(), reco::HIPhotonIsolation::trackIsoR3PtCut20(), reco::HIPhotonIsolation::trackIsoR4PtCut20(), reco::HIPhotonIsolation::trackIsoR5PtCut20(), trackQuality_, and tracks_.

72 {
74  evt.getByToken(photonProducer_, photons);
75  edm::Handle<EcalRecHitCollection> barrelEcalHits;
76  evt.getByToken(barrelEcalHits_, barrelEcalHits);
77  edm::Handle<EcalRecHitCollection> endcapEcalHits;
78  evt.getByToken(endcapEcalHits_, endcapEcalHits);
80  evt.getByToken(hbhe_, hbhe);
82  evt.getByToken(hf_, hf);
84  evt.getByToken(ho_, ho);
86  evt.getByToken(barrelClusters_, barrelClusters);
88  evt.getByToken(endcapClusters_, endcapClusters);
90  evt.getByToken(tracks_, trackCollection);
91 
92  std::auto_ptr<reco::HIPhotonIsolationMap> outputMap (new reco::HIPhotonIsolationMap);
93  reco::HIPhotonIsolationMap::Filler filler(*outputMap);
94  std::vector<reco::HIPhotonIsolation> isoVector;
95 
96  EcalClusterIsoCalculator CxC(evt,es, barrelClusters, endcapClusters);
97  HcalRechitIsoCalculator RxC(evt,es, hbhe, hf, ho);
98  TrackIsoCalculator TxC(evt, es, trackCollection, trackQuality_);
100 
101  for (reco::PhotonCollection::const_iterator phoItr = photons->begin(); phoItr != photons->end(); ++phoItr)
102  {
104  // HI-style isolation info
105  iso.ecalClusterIsoR1(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(),1,0));
106  iso.ecalClusterIsoR2(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(),2,0));
107  iso.ecalClusterIsoR3(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(),3,0));
108  iso.ecalClusterIsoR4(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(),4,0));
109  iso.ecalClusterIsoR5(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(),5,0));
110 
111  iso.hcalRechitIsoR1(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(),1,0));
112  iso.hcalRechitIsoR2(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(),2,0));
113  iso.hcalRechitIsoR3(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(),3,0));
114  iso.hcalRechitIsoR4(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(),4,0));
115  iso.hcalRechitIsoR5(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(),5,0));
116 
117  iso.trackIsoR1PtCut20(TxC.getBkgSubTrackIso(*phoItr,1,2));
118  iso.trackIsoR2PtCut20(TxC.getBkgSubTrackIso(*phoItr,2,2));
119  iso.trackIsoR3PtCut20(TxC.getBkgSubTrackIso(*phoItr,3,2));
120  iso.trackIsoR4PtCut20(TxC.getBkgSubTrackIso(*phoItr,4,2));
121  iso.trackIsoR5PtCut20(TxC.getBkgSubTrackIso(*phoItr,5,2));
122 
123  // ecal spike rejection info (seed timing)
124  const reco::CaloClusterPtr seed = phoItr->superCluster()->seed();
125  const DetId &id = lazyTool.getMaximum(*seed).first;
126  float time = -999.;
127  const EcalRecHitCollection & rechits = ( phoItr->isEB() ? *barrelEcalHits : *endcapEcalHits);
129  if( it != rechits.end() ) {
130  time = it->time();
131  }
132  iso.seedTime(time);
133 
134  // ecal spike rejectino info (swiss cross)
135  float eMax = lazyTool.eMax(*seed);
136  float eRight = lazyTool.eRight(*seed);
137  float eLeft = lazyTool.eLeft(*seed);
138  float eTop = lazyTool.eTop(*seed);
139  float eBottom = lazyTool.eBottom(*seed);
140  iso.swissCrx( 1 - (eRight + eLeft + eTop + eBottom)/eMax );
141 
142  isoVector.push_back(iso);
143  }
144  filler.insert(photons, isoVector.begin(), isoVector.end() );
145  filler.fill();
146  evt.put(outputMap);
147 }
float hcalRechitIsoR1() const
Rechit-based isolation (HCAL) R = 0.1.
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
float ecalClusterIsoR1() const
Cluster-based isolation (ECAL) R = 0.1.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
float seedTime() const
Ecal rechit seed time.
float hcalRechitIsoR3() const
Rechit-based isolation (HCAL) R = 0.3.
float ecalClusterIsoR4() const
Cluster-based isolation (ECAL) R = 0.4.
float hcalRechitIsoR4() const
Rechit-based isolation (HCAL) R = 0.4.
edm::EDGetTokenT< HFRecHitCollection > hf_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
float trackIsoR5PtCut20() const
Track-based isolation, pt&gt;2.0GeV, R = 0.5.
float ecalClusterIsoR5() const
Cluster-based isolation (ECAL) R = 0.5.
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: DetId.h:18
float ecalClusterIsoR2() const
Cluster-based isolation (ECAL) R = 0.2.
edm::EDGetTokenT< reco::BasicClusterCollection > barrelClusters_
float hcalRechitIsoR5() const
Rechit-based isolation (HCAL) R = 0.5.
float hcalRechitIsoR2() const
Rechit-based isolation (HCAL) R = 0.2.
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
float trackIsoR1PtCut20() const
Track-based isolation, pt&gt;2.0GeV, R = 0.1.
float swissCrx() const
SwissCross crystal ratio.
float trackIsoR4PtCut20() const
Track-based isolation, pt&gt;2.0GeV, R = 0.4.
edm::EDGetTokenT< reco::PhotonCollection > photonProducer_
float trackIsoR2PtCut20() const
Track-based isolation, pt&gt;2.0GeV, R = 0.2.
float trackIsoR3PtCut20() const
Track-based isolation, pt&gt;2.0GeV, R = 0.3.
float ecalClusterIsoR3() const
Cluster-based isolation (ECAL) R = 0.3.
edm::EDGetTokenT< reco::TrackCollection > tracks_

Member Data Documentation

edm::EDGetTokenT<reco::BasicClusterCollection> photonIsolationHIProducer::barrelClusters_
private

Definition at line 41 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<EcalRecHitCollection> photonIsolationHIProducer::barrelEcalHits_
private

Definition at line 36 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<reco::BasicClusterCollection> photonIsolationHIProducer::endcapClusters_
private

Definition at line 42 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<EcalRecHitCollection> photonIsolationHIProducer::endcapEcalHits_
private

Definition at line 37 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<HBHERecHitCollection> photonIsolationHIProducer::hbhe_
private

Definition at line 38 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<HFRecHitCollection> photonIsolationHIProducer::hf_
private

Definition at line 39 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<HORecHitCollection> photonIsolationHIProducer::ho_
private

Definition at line 40 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<reco::PhotonCollection> photonIsolationHIProducer::photonProducer_
private

Definition at line 35 of file photonIsolationHIProducer.cc.

Referenced by produce().

std::string photonIsolationHIProducer::trackQuality_
private

Definition at line 45 of file photonIsolationHIProducer.cc.

Referenced by produce().

edm::EDGetTokenT<reco::TrackCollection> photonIsolationHIProducer::tracks_
private

Definition at line 43 of file photonIsolationHIProducer.cc.

Referenced by produce().