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::vector< ModuleDescription const * > &modules, 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::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 19 of file EcalIsolatedParticleCandidateProducer.h.

Constructor & Destructor Documentation

◆ EcalIsolatedParticleCandidateProducer()

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

Definition at line 35 of file EcalIsolatedParticleCandidateProducer.cc.

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

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

◆ ~EcalIsolatedParticleCandidateProducer()

EcalIsolatedParticleCandidateProducer::~EcalIsolatedParticleCandidateProducer ( )
override

Definition at line 49 of file EcalIsolatedParticleCandidateProducer.cc.

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

Member Function Documentation

◆ beginJob()

void EcalIsolatedParticleCandidateProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 189 of file EcalIsolatedParticleCandidateProducer.cc.

189 {}

◆ endJob()

void EcalIsolatedParticleCandidateProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 192 of file EcalIsolatedParticleCandidateProducer.cc.

192 {}

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 59 of file EcalIsolatedParticleCandidateProducer.cc.

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

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, edm::EventSetup::get(), get, trigger::TriggerRefsCollections::getObjects(), CaloGeometry::getPosition(), hitCountEthr_, hitEthr_, iEvent, InConeSize_, M_PI, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, funct::pow(), edm::ESHandle< T >::product(), DiDispStaMuonMonitor_cfi::pt, dttmaxenums::R, mathSSE::sqrt(), tok_EB_, tok_EE_, 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_hlt_

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

◆ tok_l1tau_

edm::EDGetTokenT<l1extra::L1JetParticleCollection> EcalIsolatedParticleCandidateProducer::tok_l1tau_
private
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
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:36
CaloGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EcalIsolatedParticleCandidateProducer::hitEthr_
double hitEthr_
Definition: EcalIsolatedParticleCandidateProducer.h:32
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:452
edm::Ref< L1JetParticleCollection >
EcalIsolatedParticleCandidateProducer::hitCountEthr_
double hitCountEthr_
Definition: EcalIsolatedParticleCandidateProducer.h:31
CaloGeometry
Definition: CaloGeometry.h:21
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
EcalIsolatedParticleCandidateProducer::tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: EcalIsolatedParticleCandidateProducer.h:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< CaloGeometry >
EcalIsolatedParticleCandidateProducer::tok_hlt_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
Definition: EcalIsolatedParticleCandidateProducer.h:35
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:29
iEvent
int iEvent
Definition: GenABIO.cc:224
trigger::TriggerL1Jet
Definition: TriggerTypeDefs.h:48
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
get
#define get
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:34
EcalIsolatedParticleCandidateProducer::OutConeSize_
double OutConeSize_
Definition: EcalIsolatedParticleCandidateProducer.h:30
dttmaxenums::R
Definition: DTTMax.h:29
edm::InputTag
Definition: InputTag.h:15