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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 79 of file InterestingTrackEcalDetIdProducer.cc.

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

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 }
T getParameter(std::string const &) const
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
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

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

Definition at line 139 of file InterestingTrackEcalDetIdProducer.cc.

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

139  {
140  edm::ESHandle<CaloTopology> theCaloTopology;
141  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
142  caloTopology_ = &(*theCaloTopology);
143 }
T get() const
Definition: EventSetup.h:73
void InterestingTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 104 of file InterestingTrackEcalDetIdProducer.cc.

References TrackDetectorAssociator::associate(), caloTopology_, DetId::Ecal, TrackDetMatchInfo::EcalRecHits, spr::find(), TrackDetMatchInfo::findMaxDeposition(), edm::Event::getByToken(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), photons_cff::ids, info(), interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, minTrackPt_, eostools::move(), edm::Event::put(), DetId::rawId(), DetId::subdetId(), ecaldqm::topology(), trackAssociator_, trackAssociatorParameters_, trackCollectionToken_, and PDWG_EXOHSCP_cff::tracks.

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 
119  iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *tkItr), trackAssociatorParameters_);
120 
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 }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
HLT enums.
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const CaloTopology* InterestingTrackEcalDetIdProducer::caloTopology_
private

Definition at line 63 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

double InterestingTrackEcalDetIdProducer::minTrackPt_
private

Definition at line 61 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by produce().

TrackDetectorAssociator InterestingTrackEcalDetIdProducer::trackAssociator_
private
TrackAssociatorParameters InterestingTrackEcalDetIdProducer::trackAssociatorParameters_
private
edm::ParameterSet InterestingTrackEcalDetIdProducer::trackAssociatorPS_
private
edm::InputTag InterestingTrackEcalDetIdProducer::trackCollection_
private

Definition at line 58 of file InterestingTrackEcalDetIdProducer.cc.

edm::EDGetTokenT<reco::TrackCollection> InterestingTrackEcalDetIdProducer::trackCollectionToken_
private