CMS 3D CMS Logo

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

#include <Calibration/HcalIsolatedTrackReco/src/IsolatedEcalPixelTrackCandidateProducer.cc>

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

Public Member Functions

 IsolatedEcalPixelTrackCandidateProducer (const edm::ParameterSet &)
 
 ~IsolatedEcalPixelTrackCandidateProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~ProducerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

const double coneSizeEta0_
 
const double coneSizeEta1_
 
const double fachitCountEE_
 
const double hitCountEthrEB_
 
const double hitEthrEB_
 
const double hitEthrEE0_
 
const double hitEthrEE1_
 
const double hitEthrEE2_
 
const double hitEthrEE3_
 
const edm::EDGetTokenT< EcalRecHitCollectiontok_eb
 
const edm::EDGetTokenT< EcalRecHitCollectiontok_ee
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_trigcand
 

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
 
- 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

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

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

Definition at line 20 of file IsolatedEcalPixelTrackCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file IsolatedEcalPixelTrackCandidateProducer.cc.

37  :
38  tok_ee( consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EERecHitSource")) ),
39  tok_eb( consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBRecHitSource")) ),
40  tok_trigcand( consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("filterLabel")) ),
41  coneSizeEta0_( conf.getParameter<double>("EcalConeSizeEta0") ),
42  coneSizeEta1_( conf.getParameter<double>("EcalConeSizeEta1") ),
43  hitCountEthrEB_( conf.getParameter<double>("EBHitCountEnergyThreshold") ),
44  hitEthrEB_( conf.getParameter<double>("EBHitEnergyThreshold") ),
45  fachitCountEE_( conf.getParameter<double>("EEFacHitCountEnergyThreshold") ),
46  hitEthrEE0_( conf.getParameter<double>("EEHitEnergyThreshold0") ),
47  hitEthrEE1_( conf.getParameter<double>("EEHitEnergyThreshold1") ),
48  hitEthrEE2_( conf.getParameter<double>("EEHitEnergyThreshold2") ),
49  hitEthrEE3_( conf.getParameter<double>("EEHitEnergyThreshold3") )
50 {
51  // register the products
52  produces< reco::IsolatedPixelTrackCandidateCollection >();
53 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
IsolatedEcalPixelTrackCandidateProducer::~IsolatedEcalPixelTrackCandidateProducer ( )
override

Definition at line 55 of file IsolatedEcalPixelTrackCandidateProducer.cc.

55 { }

Member Function Documentation

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

Definition at line 57 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

57  {
59  desc.add<edm::InputTag>("filterLabel",edm::InputTag("hltIsolPixelTrackL2Filter"));
60  desc.add<edm::InputTag>("EBRecHitSource",edm::InputTag("hltEcalRecHit", "EcalRecHitsEB"));
61  desc.add<edm::InputTag>("EERecHitSource",edm::InputTag("hltEcalRecHit", "EcalRecHitsEE"));
62  desc.add<double>("EBHitEnergyThreshold",0.10);
63  desc.add<double>("EBHitCountEnergyThreshold",0.5);
64  desc.add<double>("EEHitEnergyThreshold0",-41.0664);
65  desc.add<double>("EEHitEnergyThreshold1",68.7950);
66  desc.add<double>("EEHitEnergyThreshold2",-38.1483);
67  desc.add<double>("EEHitEnergyThreshold3",7.04303);
68  desc.add<double>("EEFacHitCountEnergyThreshold",10.0);
69  desc.add<double>("EcalConeSizeEta0",0.09);
70  desc.add<double>("EcalConeSizeEta1",0.14);
71  descriptions.add("isolEcalPixelTrackProd",desc);
72 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void IsolatedEcalPixelTrackCandidateProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 75 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References funct::abs(), coneSizeEta0_, coneSizeEta1_, reco::deltaR(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), fachitCountEE_, edm::EventSetup::get(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), CaloGeometry::getPosition(), hitCountEthrEB_, hitEthrEB_, hitEthrEE0_, hitEthrEE1_, hitEthrEE2_, hitEthrEE3_, edm::HandleBase::isValid(), eostools::move(), nin, nout, AlCaHLTBitMon_ParallelJobs::p, phi, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::Event::put(), dttmaxenums::R, reco::IsolatedPixelTrackCandidate::setEnergyIn(), reco::IsolatedPixelTrackCandidate::setEnergyOut(), reco::IsolatedPixelTrackCandidate::setNHitIn(), reco::IsolatedPixelTrackCandidate::setNHitOut(), edm::SortedCollection< T, SORT >::size(), tok_eb, tok_ee, tok_trigcand, HiIsolationCommonParameters_cff::track, and trigger::TriggerTrack.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

75  {
76 #ifdef EDM_ML_DEBUG
77  edm::LogInfo("HcalIsoTrack") << "==============Inside IsolatedEcalPixelTrackCandidateProducer";
78 #endif
80  iSetup.get<CaloGeometryRecord>().get(pG);
81  const CaloGeometry* geo = pG.product();
82 
84  iEvent.getByToken(tok_eb,ecalEB);
85 
87  iEvent.getByToken(tok_ee,ecalEE);
88 #ifdef EDM_ML_DEBUG
89  edm::LogInfo("HcalIsoTrack") << "ecal Collections isValid: "
90  << ecalEB.isValid() << "/" << ecalEE.isValid();
91 #endif
92 
94  iEvent.getByToken(tok_trigcand,trigCand);
95 
96  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
97  trigCand->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
98  int nCand=isoPixTrackRefs.size();
99 
100  auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
101 #ifdef EDM_ML_DEBUG
102  edm::LogInfo("HcalIsoTrack") << "coneSize_ " << coneSizeEta0_ << "/"
103  << coneSizeEta1_ << " hitCountEthrEB_ "
104  << hitCountEthrEB_ << " hitEthrEB_ "
105  << hitEthrEB_ << " fachitCountEE_ "
106  << fachitCountEE_ << " hitEthrEE "
107  << hitEthrEE0_ << ":" << hitEthrEE1_ << ":"
108  << hitEthrEE2_ << ":" << hitEthrEE3_;
109 #endif
110  for (int p=0; p<nCand; p++) {
111  int nhitIn(0), nhitOut(0);
112  double inEnergy(0), outEnergy(0);
113  std::pair<double,double> etaPhi(isoPixTrackRefs[p]->track()->eta(), isoPixTrackRefs[p]->track()->phi());
114  if (isoPixTrackRefs[p]->etaPhiEcalValid()) etaPhi = isoPixTrackRefs[p]->etaPhiEcal();
115  double etaAbs = std::abs(etaPhi.first);
116  double coneSize_ = (etaAbs > 1.5) ? coneSizeEta1_ : (coneSizeEta0_*(1.5-etaAbs)+coneSizeEta1_*etaAbs)/1.5;
117 #ifdef EDM_ML_DEBUG
118  edm::LogInfo("HcalIsoTrack") << "Track: eta/phi " << etaPhi.first << "/"
119  << etaPhi.second << " pt:"
120  << isoPixTrackRefs[p]->track()->pt()
121  << " cone " << coneSize_ << "\n"
122  << "rechit size EB/EE : " << ecalEB->size()
123  << "/" << ecalEE->size() << " coneSize_: "
124  << coneSize_;
125 #endif
126  if (etaAbs<1.7) {
127  int nin(0), nout(0);
128  for (auto eItr : *(ecalEB.product())) {
129  const GlobalPoint& pos = geo->getPosition(eItr.detid());
130  double R = reco::deltaR(pos.eta(),pos.phi(),etaPhi.first,etaPhi.second);
131  if (R < coneSize_) {
132  nhitIn++;
133  inEnergy += (eItr.energy());
134  ++nin;
135  if (eItr.energy() > hitCountEthrEB_) nhitOut++;
136  if (eItr.energy() > hitEthrEB_) {
137  outEnergy += (eItr.energy());
138  ++nout;
139  }
140 #ifdef EDM_ML_DEBUG
141  edm::LogInfo("HcalIsoTrack") << "EBRechit close to the track has E "
142  << eItr.energy() << " eta/phi: "
143  << pos.eta() << "/" << pos.phi()
144  << " deltaR: " << R;
145 #endif
146  }
147  }
148  }
149  if (etaAbs>1.25) {
150  int nin(0), nout(0);
151  for (auto eItr : *(ecalEE.product())) {
152  const GlobalPoint& pos = geo->getPosition(eItr.detid());
153  double R = reco::deltaR(pos.eta(),pos.phi(),etaPhi.first,etaPhi.second);
154  if (R < coneSize_) {
155  double eta = std::abs(pos.eta());
156  double hitEthr = (((eta*hitEthrEE3_+hitEthrEE2_)*eta+hitEthrEE1_)*eta+
157  hitEthrEE0_);
158  if (hitEthr < hitEthrEB_) hitEthr = hitEthrEB_;
159  nhitIn++;
160  inEnergy += (eItr.energy());
161  ++nin;
162  if (eItr.energy() > fachitCountEE_*hitEthr) nhitOut++;
163  if (eItr.energy() > hitEthr) {
164  outEnergy += (eItr.energy());
165  ++nout;
166  }
167 #ifdef EDM_ML_DEBUG
168  edm::LogInfo("HcalIsoTrack") << "EERechit close to the track has E "
169  << eItr.energy() << " eta/phi: "
170  << pos.eta() << "/" << pos.phi()
171  << " deltaR: " << R;
172 #endif
173  }
174  }
175  }
176 #ifdef EDM_ML_DEBUG
177  edm::LogInfo("HcalIsoTrack") << "nhitIn:" << nhitIn << " inEnergy:"
178  << inEnergy << " nhitOut:" << nhitOut
179  << " outEnergy:" << outEnergy;
180 #endif
181  reco::IsolatedPixelTrackCandidate newca(*isoPixTrackRefs[p]);
182  newca.setEnergyIn(inEnergy);
183  newca.setEnergyOut(outEnergy);
184  newca.setNHitIn(nhitIn);
185  newca.setNHitOut(nhitOut);
186  iptcCollection->push_back(newca);
187  }
188 #ifdef EDM_ML_DEBUG
189  edm::LogInfo("HcalIsoTrack") << "ncand:" << nCand << " outcollction size:"
190  << iptcCollection->size();
191 #endif
192  iEvent.put(std::move(iptcCollection));
193 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
int nin
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:69
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
bool isValid() const
Definition: HandleBase.h:74
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:59
T eta() const
Definition: PV3DBase.h:76
int nout
size_type size() const
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta0_
private

Definition at line 34 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta1_
private

Definition at line 35 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::fachitCountEE_
private

Definition at line 38 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitCountEthrEB_
private

Definition at line 36 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEB_
private

Definition at line 37 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE0_
private

Definition at line 39 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE1_
private

Definition at line 40 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE2_
private

Definition at line 41 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE3_
private

Definition at line 42 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const edm::EDGetTokenT<EcalRecHitCollection> IsolatedEcalPixelTrackCandidateProducer::tok_eb
private

Definition at line 32 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const edm::EDGetTokenT<EcalRecHitCollection> IsolatedEcalPixelTrackCandidateProducer::tok_ee
private

Definition at line 31 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> IsolatedEcalPixelTrackCandidateProducer::tok_trigcand
private

Definition at line 33 of file IsolatedEcalPixelTrackCandidateProducer.h.

Referenced by produce().