CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 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
 
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 () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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
< EcalRecHitCollection
tok_eb
 
const edm::EDGetTokenT
< EcalRecHitCollection
tok_ee
 
const edm::ESGetToken
< CaloGeometry,
CaloGeometryRecord
tok_geom_
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_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::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

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

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

Definition at line 49 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 74 of file IsolatedEcalPixelTrackCandidateProducer.cc.

75  : tok_ee(consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EERecHitSource"))),
76  tok_eb(consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBRecHitSource"))),
77  tok_trigcand(consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("filterLabel"))),
78  tok_geom_(esConsumes<CaloGeometry, CaloGeometryRecord>()),
79  coneSizeEta0_(conf.getParameter<double>("EcalConeSizeEta0")),
80  coneSizeEta1_(conf.getParameter<double>("EcalConeSizeEta1")),
81  hitCountEthrEB_(conf.getParameter<double>("EBHitCountEnergyThreshold")),
82  hitEthrEB_(conf.getParameter<double>("EBHitEnergyThreshold")),
83  fachitCountEE_(conf.getParameter<double>("EEFacHitCountEnergyThreshold")),
84  hitEthrEE0_(conf.getParameter<double>("EEHitEnergyThreshold0")),
85  hitEthrEE1_(conf.getParameter<double>("EEHitEnergyThreshold1")),
86  hitEthrEE2_(conf.getParameter<double>("EEHitEnergyThreshold2")),
87  hitEthrEE3_(conf.getParameter<double>("EEHitEnergyThreshold3")) {
88  // register the products
89  produces<reco::IsolatedPixelTrackCandidateCollection>();
90 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
IsolatedEcalPixelTrackCandidateProducer::~IsolatedEcalPixelTrackCandidateProducer ( )
override

Definition at line 92 of file IsolatedEcalPixelTrackCandidateProducer.cc.

92 {}

Member Function Documentation

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

Definition at line 94 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

94  {
96  desc.add<edm::InputTag>("filterLabel", edm::InputTag("hltIsolPixelTrackL2Filter"));
97  desc.add<edm::InputTag>("EBRecHitSource", edm::InputTag("hltEcalRecHit", "EcalRecHitsEB"));
98  desc.add<edm::InputTag>("EERecHitSource", edm::InputTag("hltEcalRecHit", "EcalRecHitsEE"));
99  desc.add<double>("EBHitEnergyThreshold", 0.10);
100  desc.add<double>("EBHitCountEnergyThreshold", 0.5);
101  desc.add<double>("EEHitEnergyThreshold0", -41.0664);
102  desc.add<double>("EEHitEnergyThreshold1", 68.7950);
103  desc.add<double>("EEHitEnergyThreshold2", -38.1483);
104  desc.add<double>("EEHitEnergyThreshold3", 7.04303);
105  desc.add<double>("EEFacHitCountEnergyThreshold", 10.0);
106  desc.add<double>("EcalConeSizeEta0", 0.09);
107  desc.add<double>("EcalConeSizeEta1", 0.14);
108  descriptions.add("isolEcalPixelTrackProd", desc);
109 }
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
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 112 of file IsolatedEcalPixelTrackCandidateProducer.cc.

References funct::abs(), coneSizeEta0_, coneSizeEta1_, reco::deltaR(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), fachitCountEE_, edm::EventSetup::getData(), edm::Event::getHandle(), 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::Event::put(), dttmaxenums::R, reco::IsolatedPixelTrackCandidate::setEnergyIn(), reco::IsolatedPixelTrackCandidate::setEnergyOut(), reco::IsolatedPixelTrackCandidate::setNHitIn(), reco::IsolatedPixelTrackCandidate::setNHitOut(), tok_eb, tok_ee, tok_geom_, tok_trigcand, HLT_FULL_cff::track, and trigger::TriggerTrack.

114  {
115 #ifdef EDM_ML_DEBUG
116  edm::LogVerbatim("HcalIsoTrack") << "==============Inside IsolatedEcalPixelTrackCandidateProducer";
117 #endif
118  const CaloGeometry* geo = &iSetup.getData(tok_geom_);
119 
120  const edm::Handle<EcalRecHitCollection>& ecalEB = iEvent.getHandle(tok_eb);
121  const edm::Handle<EcalRecHitCollection>& ecalEE = iEvent.getHandle(tok_ee);
122 #ifdef EDM_ML_DEBUG
123  edm::LogVerbatim("HcalIsoTrack") << "ecal Collections isValid: " << ecalEB.isValid() << "/" << ecalEE.isValid();
124 #endif
125 
127 
128  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
129  trigCand->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
130  int nCand = isoPixTrackRefs.size();
131 
132  auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
133 #ifdef EDM_ML_DEBUG
134  edm::LogVerbatim("HcalIsoTrack") << "coneSize_ " << coneSizeEta0_ << "/" << coneSizeEta1_ << " hitCountEthrEB_ "
135  << hitCountEthrEB_ << " hitEthrEB_ " << hitEthrEB_ << " fachitCountEE_ "
136  << fachitCountEE_ << " hitEthrEE " << hitEthrEE0_ << ":" << hitEthrEE1_ << ":"
137  << hitEthrEE2_ << ":" << hitEthrEE3_;
138 #endif
139  for (int p = 0; p < nCand; p++) {
140  int nhitIn(0), nhitOut(0);
141  double inEnergy(0), outEnergy(0);
142  std::pair<double, double> etaPhi(isoPixTrackRefs[p]->track()->eta(), isoPixTrackRefs[p]->track()->phi());
143  if (isoPixTrackRefs[p]->etaPhiEcalValid())
144  etaPhi = isoPixTrackRefs[p]->etaPhiEcal();
145  double etaAbs = std::abs(etaPhi.first);
146  double coneSize_ = (etaAbs > 1.5) ? coneSizeEta1_ : (coneSizeEta0_ * (1.5 - etaAbs) + coneSizeEta1_ * etaAbs) / 1.5;
147 #ifdef EDM_ML_DEBUG
148  edm::LogVerbatim("HcalIsoTrack") << "Track: eta/phi " << etaPhi.first << "/" << etaPhi.second
149  << " pt:" << isoPixTrackRefs[p]->track()->pt() << " cone " << coneSize_ << "\n"
150  << "rechit size EB/EE : " << ecalEB->size() << "/" << ecalEE->size()
151  << " coneSize_: " << coneSize_;
152 #endif
153  if (etaAbs < 1.7) {
154  int nin(0), nout(0);
155  for (auto eItr : *(ecalEB.product())) {
156  const GlobalPoint& pos = geo->getPosition(eItr.detid());
157  double R = reco::deltaR(pos.eta(), pos.phi(), etaPhi.first, etaPhi.second);
158  if (R < coneSize_) {
159  nhitIn++;
160  inEnergy += (eItr.energy());
161  ++nin;
162  if (eItr.energy() > hitCountEthrEB_)
163  nhitOut++;
164  if (eItr.energy() > hitEthrEB_) {
165  outEnergy += (eItr.energy());
166  ++nout;
167  }
168 #ifdef EDM_ML_DEBUG
169  edm::LogVerbatim("HcalIsoTrack") << "EBRechit close to the track has E " << eItr.energy()
170  << " eta/phi: " << pos.eta() << "/" << pos.phi() << " deltaR: " << R;
171 #endif
172  }
173  }
174  }
175  if (etaAbs > 1.25) {
176  int nin(0), nout(0);
177  for (auto eItr : *(ecalEE.product())) {
178  const GlobalPoint& pos = geo->getPosition(eItr.detid());
179  double R = reco::deltaR(pos.eta(), pos.phi(), etaPhi.first, etaPhi.second);
180  if (R < coneSize_) {
181  double eta = std::abs(pos.eta());
182  double hitEthr = (((eta * hitEthrEE3_ + hitEthrEE2_) * eta + hitEthrEE1_) * eta + hitEthrEE0_);
183  if (hitEthr < hitEthrEB_)
184  hitEthr = hitEthrEB_;
185  nhitIn++;
186  inEnergy += (eItr.energy());
187  ++nin;
188  if (eItr.energy() > fachitCountEE_ * hitEthr)
189  nhitOut++;
190  if (eItr.energy() > hitEthr) {
191  outEnergy += (eItr.energy());
192  ++nout;
193  }
194 #ifdef EDM_ML_DEBUG
195  edm::LogVerbatim("HcalIsoTrack") << "EERechit close to the track has E " << eItr.energy()
196  << " eta/phi: " << pos.eta() << "/" << pos.phi() << " deltaR: " << R;
197 #endif
198  }
199  }
200  }
201 #ifdef EDM_ML_DEBUG
202  edm::LogVerbatim("HcalIsoTrack") << "nhitIn:" << nhitIn << " inEnergy:" << inEnergy << " nhitOut:" << nhitOut
203  << " outEnergy:" << outEnergy;
204 #endif
205  reco::IsolatedPixelTrackCandidate newca(*isoPixTrackRefs[p]);
206  newca.setEnergyIn(inEnergy);
207  newca.setEnergyOut(outEnergy);
208  newca.setNHitIn(nhitIn);
209  newca.setNHitOut(nhitOut);
210  iptcCollection->push_back(newca);
211  }
212 #ifdef EDM_ML_DEBUG
213  edm::LogVerbatim("HcalIsoTrack") << "ncand:" << nCand << " outcollction size:" << iptcCollection->size();
214 #endif
215  iEvent.put(std::move(iptcCollection));
216 }
Log< level::Info, true > LogVerbatim
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
int nin
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
def move
Definition: eostools.py:511
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:70
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
T const * product() const
Definition: Handle.h:70
T eta() const
Definition: PV3DBase.h:73
int nout

Member Data Documentation

const double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta0_
private

Definition at line 63 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::coneSizeEta1_
private

Definition at line 64 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::fachitCountEE_
private

Definition at line 67 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitCountEthrEB_
private

Definition at line 65 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEB_
private

Definition at line 66 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE0_
private

Definition at line 68 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE1_
private

Definition at line 69 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE2_
private

Definition at line 70 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const double IsolatedEcalPixelTrackCandidateProducer::hitEthrEE3_
private

Definition at line 71 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

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

Definition at line 60 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

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

Definition at line 59 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> IsolatedEcalPixelTrackCandidateProducer::tok_geom_
private

Definition at line 62 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().

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

Definition at line 61 of file IsolatedEcalPixelTrackCandidateProducer.cc.

Referenced by produce().