CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalIsolatedParticleCandidateProducer Class Reference

#include <Calibration/EcalIsolatedParticleCandidateProducer/src/EcalIsolatedParticleCandidateProducer.cc>

Inheritance diagram for EcalIsolatedParticleCandidateProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalIsolatedParticleCandidateProducer (const edm::ParameterSet &)
 
 ~EcalIsolatedParticleCandidateProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

double hitCountEthr_
 
double hitEthr_
 
double InConeSize_
 
double OutConeSize_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EB_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EE_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordtok_geom_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_hlt_
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectiontok_l1tau_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 22 of file EcalIsolatedParticleCandidateProducer.h.

Constructor & Destructor Documentation

◆ EcalIsolatedParticleCandidateProducer()

EcalIsolatedParticleCandidateProducer::EcalIsolatedParticleCandidateProducer ( const edm::ParameterSet conf)
explicit

Definition at line 36 of file EcalIsolatedParticleCandidateProducer.cc.

36  {
37  InConeSize_ = conf.getParameter<double>("EcalInnerConeSize");
38  OutConeSize_ = conf.getParameter<double>("EcalOuterConeSize");
39  hitCountEthr_ = conf.getParameter<double>("ECHitCountEnergyThreshold");
40  hitEthr_ = conf.getParameter<double>("ECHitEnergyThreshold");
41  tok_l1tau_ = consumes<l1extra::L1JetParticleCollection>(conf.getParameter<edm::InputTag>("L1eTauJetsSource"));
42  tok_hlt_ = consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("L1GTSeedLabel"));
43  tok_EB_ = consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBrecHitCollectionLabel"));
44  tok_EE_ = consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EErecHitCollectionLabel"));
45 
46  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
47 
48  //register your products
49  produces<reco::IsolatedPixelTrackCandidateCollection>();
50 }

References edm::ParameterSet::getParameter(), hitCountEthr_, hitEthr_, InConeSize_, OutConeSize_, tok_EB_, tok_EE_, tok_geom_, tok_hlt_, and tok_l1tau_.

◆ ~EcalIsolatedParticleCandidateProducer()

EcalIsolatedParticleCandidateProducer::~EcalIsolatedParticleCandidateProducer ( )
override

Definition at line 52 of file EcalIsolatedParticleCandidateProducer.cc.

52  {
53  // do anything here that needs to be done at desctruction time
54  // (e.g. close files, deallocate resources etc.)
55 }

Member Function Documentation

◆ beginJob()

void EcalIsolatedParticleCandidateProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 203 of file EcalIsolatedParticleCandidateProducer.cc.

203 {}

◆ endJob()

void EcalIsolatedParticleCandidateProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 206 of file EcalIsolatedParticleCandidateProducer.cc.

206 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

void EcalIsolatedParticleCandidateProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 62 of file EcalIsolatedParticleCandidateProducer.cc.

64  {
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HcalIsoTrack") << "get tau";
67 #endif
69  iEvent.getByToken(tok_l1tau_, l1Taus);
70 
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("HcalIsoTrack") << "get geom";
73 #endif
74  const CaloGeometry* geo = &iSetup.getData(tok_geom_);
75 
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HcalIsoTrack") << "get ec rechit";
78 #endif
80  iEvent.getByToken(tok_EB_, ecalEB);
81 
83  iEvent.getByToken(tok_EE_, ecalEE);
84 
85 #ifdef EDM_ML_DEBUG
86  edm::LogVerbatim("HcalIsoTrack") << "get l1 trig obj";
87 #endif
88 
90  iEvent.getByToken(tok_hlt_, l1trigobj);
91 
92  std::vector<edm::Ref<l1t::TauBxCollection> > l1tauobjref;
93  std::vector<edm::Ref<l1t::JetBxCollection> > l1jetobjref;
94 
95  l1trigobj->getObjects(trigger::TriggerL1Tau, l1tauobjref);
96  l1trigobj->getObjects(trigger::TriggerL1Jet, l1jetobjref);
97 
98  double ptTriggered = -10;
99  double etaTriggered = -100;
100  double phiTriggered = -100;
101 
102 #ifdef EDM_ML_DEBUG
103  edm::LogVerbatim("HcalIsoTrack") << "find highest pT triggered obj";
104 #endif
105  for (unsigned int p = 0; p < l1tauobjref.size(); p++) {
106  if (l1tauobjref[p]->pt() > ptTriggered) {
107  ptTriggered = l1tauobjref[p]->pt();
108  phiTriggered = l1tauobjref[p]->phi();
109  etaTriggered = l1tauobjref[p]->eta();
110  }
111  }
112  for (unsigned int p = 0; p < l1jetobjref.size(); p++) {
113  if (l1jetobjref[p]->pt() > ptTriggered) {
114  ptTriggered = l1jetobjref[p]->pt();
115  phiTriggered = l1jetobjref[p]->phi();
116  etaTriggered = l1jetobjref[p]->eta();
117  }
118  }
119 
120  auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
121 
122 #ifdef EDM_ML_DEBUG
123  edm::LogVerbatim("HcalIsoTrack") << "loop over l1taus";
124 #endif
125  for (l1extra::L1JetParticleCollection::const_iterator tit = l1Taus->begin(); tit != l1Taus->end(); tit++) {
126  double dphi = fabs(tit->phi() - phiTriggered);
127  if (dphi > M_PI)
128  dphi = 2 * M_PI - dphi;
129  double Rseed = sqrt(pow(etaTriggered - tit->eta(), 2) + dphi * dphi);
130  if (Rseed < 1.2)
131  continue;
132  int nhitOut = 0;
133  int nhitIn = 0;
134  double OutEnergy = 0;
135  double InEnergy = 0;
136 #ifdef EDM_ML_DEBUG
137  edm::LogVerbatim("HcalIsoTrack") << "loops over rechits";
138 #endif
139  for (EcalRecHitCollection::const_iterator eItr = ecalEB->begin(); eItr != ecalEB->end(); eItr++) {
140  double phiD, R;
141  const GlobalPoint& pos = geo->getPosition(eItr->detid());
142  double phihit = pos.phi();
143  double etahit = pos.eta();
144  phiD = fabs(phihit - tit->phi());
145  if (phiD > M_PI)
146  phiD = 2 * M_PI - phiD;
147  R = sqrt(pow(etahit - tit->eta(), 2) + phiD * phiD);
148 
149  if (R < OutConeSize_ && R > InConeSize_ && eItr->energy() > hitCountEthr_) {
150  nhitOut++;
151  }
152  if (R < InConeSize_ && eItr->energy() > hitCountEthr_) {
153  nhitIn++;
154  }
155 
156  if (R < OutConeSize_ && R > InConeSize_ && eItr->energy() > hitEthr_) {
157  OutEnergy += eItr->energy();
158  }
159  if (R < InConeSize_ && eItr->energy() > hitEthr_) {
160  InEnergy += eItr->energy();
161  }
162  }
163 
164  for (EcalRecHitCollection::const_iterator eItr = ecalEE->begin(); eItr != ecalEE->end(); eItr++) {
165  double phiD, R;
166  const GlobalPoint& pos = geo->getPosition(eItr->detid());
167  double phihit = pos.phi();
168  double etahit = pos.eta();
169  phiD = fabs(phihit - tit->phi());
170  if (phiD > M_PI)
171  phiD = 2 * M_PI - phiD;
172  R = sqrt(pow(etahit - tit->eta(), 2) + phiD * phiD);
173  if (R < OutConeSize_ && R > InConeSize_ && eItr->energy() > hitCountEthr_) {
174  nhitOut++;
175  }
176  if (R < InConeSize_ && eItr->energy() > hitCountEthr_) {
177  nhitIn++;
178  }
179  if (R < OutConeSize_ && R > InConeSize_ && eItr->energy() > hitEthr_) {
180  OutEnergy += eItr->energy();
181  }
182  if (R < InConeSize_ && eItr->energy() > hitEthr_) {
183  InEnergy += eItr->energy();
184  }
185  }
186 #ifdef EDM_ML_DEBUG
187  edm::LogVerbatim("HcalIsoTrack") << "create and push_back candidate";
188 #endif
190  l1extra::L1JetParticleRef(l1Taus, tit - l1Taus->begin()), InEnergy, OutEnergy, nhitIn, nhitOut);
191  iptcCollection->push_back(newca);
192  }
193 
194  //Use the ExampleData to create an ExampleData2 which
195  // is put into the Event
196 
197 #ifdef EDM_ML_DEBUG
198  edm::LogVerbatim("HcalIsoTrack") << "put cand into event";
199 #endif
200  iEvent.put(std::move(iptcCollection));
201 }

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, edm::EventSetup::getData(), trigger::TriggerRefsCollections::getObjects(), CaloGeometry::getPosition(), hitCountEthr_, hitEthr_, iEvent, InConeSize_, M_PI, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, funct::pow(), DiDispStaMuonMonitor_cfi::pt, dttmaxenums::R, mathSSE::sqrt(), tok_EB_, tok_EE_, tok_geom_, tok_hlt_, tok_l1tau_, trigger::TriggerL1Jet, and trigger::TriggerL1Tau.

Member Data Documentation

◆ hitCountEthr_

double EcalIsolatedParticleCandidateProducer::hitCountEthr_
private

◆ hitEthr_

double EcalIsolatedParticleCandidateProducer::hitEthr_
private

◆ InConeSize_

double EcalIsolatedParticleCandidateProducer::InConeSize_
private

◆ OutConeSize_

double EcalIsolatedParticleCandidateProducer::OutConeSize_
private

◆ tok_EB_

edm::EDGetTokenT<EcalRecHitCollection> EcalIsolatedParticleCandidateProducer::tok_EB_
private

◆ tok_EE_

edm::EDGetTokenT<EcalRecHitCollection> EcalIsolatedParticleCandidateProducer::tok_EE_
private

◆ tok_geom_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalIsolatedParticleCandidateProducer::tok_geom_
private

◆ tok_hlt_

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> EcalIsolatedParticleCandidateProducer::tok_hlt_
private

◆ tok_l1tau_

edm::EDGetTokenT<l1extra::L1JetParticleCollection> EcalIsolatedParticleCandidateProducer::tok_l1tau_
private
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
EcalIsolatedParticleCandidateProducer::tok_EB_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: EcalIsolatedParticleCandidateProducer.h:39
CaloGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
EcalIsolatedParticleCandidateProducer::hitEthr_
double hitEthr_
Definition: EcalIsolatedParticleCandidateProducer.h:35
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
reco::IsolatedPixelTrackCandidate
Definition: IsolatedPixelTrackCandidate.h:23
edm::Handle
Definition: AssociativeIterator.h:50
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:590
edm::Ref< L1JetParticleCollection >
EcalIsolatedParticleCandidateProducer::hitCountEthr_
double hitCountEthr_
Definition: EcalIsolatedParticleCandidateProducer.h:34
CaloGeometry
Definition: CaloGeometry.h:21
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
EcalIsolatedParticleCandidateProducer::tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: EcalIsolatedParticleCandidateProducer.h:40
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalIsolatedParticleCandidateProducer::tok_hlt_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
Definition: EcalIsolatedParticleCandidateProducer.h:38
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
Point3DBase< float, GlobalTag >
trigger::TriggerL1Tau
Definition: TriggerTypeDefs.h:49
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
EcalIsolatedParticleCandidateProducer::InConeSize_
double InConeSize_
Definition: EcalIsolatedParticleCandidateProducer.h:32
iEvent
int iEvent
Definition: GenABIO.cc:224
trigger::TriggerL1Jet
Definition: TriggerTypeDefs.h:48
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalIsolatedParticleCandidateProducer::tok_geom_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Definition: EcalIsolatedParticleCandidateProducer.h:42
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
EcalIsolatedParticleCandidateProducer::tok_l1tau_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_l1tau_
Definition: EcalIsolatedParticleCandidateProducer.h:37
EcalIsolatedParticleCandidateProducer::OutConeSize_
double OutConeSize_
Definition: EcalIsolatedParticleCandidateProducer.h:33
dttmaxenums::R
Definition: DTTMax.h:29
edm::InputTag
Definition: InputTag.h:15