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 &)
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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

Private Attributes

edm::ESGetToken< CaloTopology, CaloTopologyRecordcaloTopologyToken_
 
double minTrackPt_
 
TrackDetectorAssociator trackAssociator_
 
TrackAssociatorParameters trackAssociatorParameters_
 
edm::ParameterSet trackAssociatorPS_
 
edm::EDGetTokenT< reco::TrackCollectiontrackCollectionToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 76 of file InterestingTrackEcalDetIdProducer.cc.

77  : minTrackPt_(iConfig.getParameter<double>("MinTrackPt")),
79 
80 {
81  trackCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("TrackCollection"));
83  edm::ConsumesCollector iC = consumesCollector();
84  trackAssociatorParameters_.loadParameters(iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
85 
86  produces<DetIdCollection>();
87 }

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

Member Function Documentation

◆ produce()

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

Definition at line 94 of file InterestingTrackEcalDetIdProducer.cc.

94  {
95  using namespace edm;
96 
97  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
98 
99  // Get tracks from event
101  iEvent.getByToken(trackCollectionToken_, tracks);
102 
103  const auto& caloTopology = iSetup.getData(caloTopologyToken_);
104 
105  // Loop over tracks
106  for (reco::TrackCollection::const_iterator tkItr = tracks->begin(); tkItr != tracks->end(); ++tkItr) {
107  if (tkItr->pt() < minTrackPt_)
108  continue;
109 
111  iEvent,
112  iSetup,
115 
116  DetId centerId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits);
117 
118  if (centerId.rawId() == 0)
119  continue;
120 
121  // Find 5x5 around max
122  const CaloSubdetectorTopology* topology = caloTopology.getSubdetectorTopology(DetId::Ecal, centerId.subdetId());
123  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
124  for (std::vector<DetId>::const_iterator idItr = ids.begin(); idItr != ids.end(); ++idItr) {
125  if (std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *idItr) ==
127  interestingDetIdCollection->push_back(*idItr);
128  }
129  }
130 
132 }

References TrackDetectorAssociator::associate(), TrackAssociatorParameters::bFieldToken, caloTopologyToken_, DetId::Ecal, TrackDetMatchInfo::EcalRecHits, spr::find(), edm::EventSetup::getData(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloSubdetectorTopology::getWindow(), iEvent, info(), interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, minTrackPt_, eostools::move(), DetId::rawId(), DetId::subdetId(), trackAssociator_, trackAssociatorParameters_, trackCollectionToken_, and tracks.

Member Data Documentation

◆ caloTopologyToken_

edm::ESGetToken<CaloTopology, CaloTopologyRecord> InterestingTrackEcalDetIdProducer::caloTopologyToken_
private

Definition at line 60 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by produce().

◆ minTrackPt_

double InterestingTrackEcalDetIdProducer::minTrackPt_
private

Definition at line 58 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by produce().

◆ trackAssociator_

TrackDetectorAssociator InterestingTrackEcalDetIdProducer::trackAssociator_
private

◆ trackAssociatorParameters_

TrackAssociatorParameters InterestingTrackEcalDetIdProducer::trackAssociatorParameters_
private

◆ trackAssociatorPS_

edm::ParameterSet InterestingTrackEcalDetIdProducer::trackAssociatorPS_
private

Definition at line 56 of file InterestingTrackEcalDetIdProducer.cc.

◆ trackCollectionToken_

edm::EDGetTokenT<reco::TrackCollection> InterestingTrackEcalDetIdProducer::trackCollectionToken_
private
InterestingTrackEcalDetIdProducer::caloTopologyToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
Definition: InterestingTrackEcalDetIdProducer.cc:60
InterestingTrackEcalDetIdProducer::trackCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
Definition: InterestingTrackEcalDetIdProducer.cc:55
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackDetectorAssociator::useDefaultPropagator
void useDefaultPropagator()
use the default propagator
Definition: TrackDetectorAssociator.cc:81
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
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 >
TrackDetMatchInfo::EcalRecHits
Definition: TrackDetMatchInfo.h:15
DetId
Definition: DetId.h:17
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:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
TrackDetectorAssociator::getFreeTrajectoryState
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
Definition: TrackDetectorAssociator.cc:553
InterestingTrackEcalDetIdProducer::minTrackPt_
double minTrackPt_
Definition: InterestingTrackEcalDetIdProducer.cc:58
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
InterestingTrackEcalDetIdProducer::trackAssociator_
TrackDetectorAssociator trackAssociator_
Definition: InterestingTrackEcalDetIdProducer.cc:61
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
CaloSubdetectorTopology::getWindow
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Definition: CaloSubdetectorTopology.cc:4
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:13
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:62
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackAssociatorParameters::bFieldToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
Definition: TrackAssociatorParameters.h:130
TrackDetectorAssociator::associate
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:110
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45