CMS 3D CMS Logo

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

#include <Producers/InterestingTrackEcalDetIdProducer/src/InterestingTrackEcalDetIdProducer.cc>

Inheritance diagram for InterestingTrackEcalDetIdProducer:
edm::stream::EDProducer<>

Public Member Functions

 InterestingTrackEcalDetIdProducer (const edm::ParameterSet &)
 
 ~InterestingTrackEcalDetIdProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

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

Private Attributes

const CaloTopologycaloTopology_
 
double minTrackPt_
 
TrackDetectorAssociator trackAssociator_
 
TrackAssociatorParameters trackAssociatorParameters_
 
edm::ParameterSet trackAssociatorPS_
 
edm::InputTag trackCollection_
 
edm::EDGetTokenT< reco::TrackCollectiontrackCollectionToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 47 of file InterestingTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

◆ InterestingTrackEcalDetIdProducer()

InterestingTrackEcalDetIdProducer::InterestingTrackEcalDetIdProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 79 of file InterestingTrackEcalDetIdProducer.cc.

80  :
81 
82  trackAssociatorPS_(iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters")),
83  minTrackPt_(iConfig.getParameter<double>("MinTrackPt"))
84 
85 {
86  trackCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("TrackCollection"));
88  edm::ConsumesCollector iC = consumesCollector();
90 
91  produces<DetIdCollection>();
92 }

References edm::ParameterSet::getParameter(), TrackAssociatorParameters::loadParameters(), trackAssociator_, trackAssociatorParameters_, trackAssociatorPS_, trackCollectionToken_, and TrackDetectorAssociator::useDefaultPropagator().

◆ ~InterestingTrackEcalDetIdProducer()

InterestingTrackEcalDetIdProducer::~InterestingTrackEcalDetIdProducer ( )
override

Definition at line 94 of file InterestingTrackEcalDetIdProducer.cc.

94  {
95  // do anything here that needs to be done at desctruction time
96  // (e.g. close files, deallocate resources etc.)
97 }

Member Function Documentation

◆ beginRun()

void InterestingTrackEcalDetIdProducer::beginRun ( edm::Run const &  run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 139 of file InterestingTrackEcalDetIdProducer.cc.

139  {
140  edm::ESHandle<CaloTopology> theCaloTopology;
141  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
142  caloTopology_ = &(*theCaloTopology);
143 }

References caloTopology_, edm::EventSetup::get(), and get.

◆ produce()

void InterestingTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 104 of file InterestingTrackEcalDetIdProducer.cc.

104  {
105  using namespace edm;
106 
107  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
108 
109  // Get tracks from event
111  iEvent.getByToken(trackCollectionToken_, tracks);
112 
113  // Loop over tracks
114  for (reco::TrackCollection::const_iterator tkItr = tracks->begin(); tkItr != tracks->end(); ++tkItr) {
115  if (tkItr->pt() < minTrackPt_)
116  continue;
117 
120 
121  DetId centerId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits);
122 
123  if (centerId.rawId() == 0)
124  continue;
125 
126  // Find 5x5 around max
128  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
129  for (std::vector<DetId>::const_iterator idItr = ids.begin(); idItr != ids.end(); ++idItr) {
130  if (std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *idItr) ==
132  interestingDetIdCollection->push_back(*idItr);
133  }
134  }
135 
137 }

References TrackDetectorAssociator::associate(), caloTopology_, DetId::Ecal, TrackDetMatchInfo::EcalRecHits, spr::find(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloTopology::getSubdetectorTopology(), CaloTopology::getWindow(), iEvent, info(), interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, minTrackPt_, eostools::move(), DetId::rawId(), DetId::subdetId(), ecaldqm::topology(), trackAssociator_, trackAssociatorParameters_, trackCollectionToken_, and PDWG_EXOHSCP_cff::tracks.

Member Data Documentation

◆ caloTopology_

const CaloTopology* InterestingTrackEcalDetIdProducer::caloTopology_
private

Definition at line 63 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

◆ minTrackPt_

double InterestingTrackEcalDetIdProducer::minTrackPt_
private

Definition at line 61 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by produce().

◆ trackAssociator_

TrackDetectorAssociator InterestingTrackEcalDetIdProducer::trackAssociator_
private

◆ trackAssociatorParameters_

TrackAssociatorParameters InterestingTrackEcalDetIdProducer::trackAssociatorParameters_
private

◆ trackAssociatorPS_

edm::ParameterSet InterestingTrackEcalDetIdProducer::trackAssociatorPS_
private

◆ trackCollection_

edm::InputTag InterestingTrackEcalDetIdProducer::trackCollection_
private

Definition at line 58 of file InterestingTrackEcalDetIdProducer.cc.

◆ trackCollectionToken_

edm::EDGetTokenT<reco::TrackCollection> InterestingTrackEcalDetIdProducer::trackCollectionToken_
private
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
InterestingTrackEcalDetIdProducer::trackCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
Definition: InterestingTrackEcalDetIdProducer.cc:57
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackDetectorAssociator::useDefaultPropagator
void useDefaultPropagator()
use the default propagator
Definition: TrackDetectorAssociator.cc:120
CaloTopology::getWindow
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
Definition: CaloTopology.cc:64
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle< reco::TrackCollection >
TrackDetectorAssociator::getFreeTrajectoryState
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Definition: TrackDetectorAssociator.cc:600
TrackDetMatchInfo::EcalRecHits
Definition: TrackDetMatchInfo.h:16
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ecaldqm::topology
const CaloTopology * topology(nullptr)
edm::ESHandle< CaloTopology >
TrackAssociatorParameters::loadParameters
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
Definition: TrackAssociatorParameters.cc:18
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
edm::ParameterSet
Definition: ParameterSet.h:36
InterestingTrackEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: InterestingTrackEcalDetIdProducer.cc:63
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
InterestingTrackEcalDetIdProducer::minTrackPt_
double minTrackPt_
Definition: InterestingTrackEcalDetIdProducer.cc:61
iEvent
int iEvent
Definition: GenABIO.cc:224
InterestingTrackEcalDetIdProducer::trackAssociatorPS_
edm::ParameterSet trackAssociatorPS_
Definition: InterestingTrackEcalDetIdProducer.cc:59
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
get
#define get
InterestingTrackEcalDetIdProducer::trackAssociator_
TrackDetectorAssociator trackAssociator_
Definition: InterestingTrackEcalDetIdProducer.cc:64
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:14
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
InterestingTrackEcalDetIdProducer::trackAssociatorParameters_
TrackAssociatorParameters trackAssociatorParameters_
Definition: InterestingTrackEcalDetIdProducer.cc:65
TrackDetectorAssociator::associate
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:154
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39