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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 InterestingTrackEcalDetIdProducer (const edm::ParameterSet &)
 
 ~InterestingTrackEcalDetIdProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginRun (edm::Run const &, const edm::EventSetup &) override
 
virtual 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 49 of file InterestingTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 85 of file InterestingTrackEcalDetIdProducer.cc.

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

85  :
86 
87  trackAssociatorPS_ (iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters")),
88  minTrackPt_ (iConfig.getParameter<double>("MinTrackPt"))
89 
90 {
92  consumes<reco::TrackCollection> (iConfig.getParameter<edm::InputTag>("TrackCollection"));
96 
97  produces<DetIdCollection>();
98 }
T getParameter(std::string const &) const
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
InterestingTrackEcalDetIdProducer::~InterestingTrackEcalDetIdProducer ( )

Definition at line 101 of file InterestingTrackEcalDetIdProducer.cc.

102 {
103 
104  // do anything here that needs to be done at desctruction time
105  // (e.g. close files, deallocate resources etc.)
106 
107 }

Member Function Documentation

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

Definition at line 157 of file InterestingTrackEcalDetIdProducer.cc.

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

158 {
159  edm::ESHandle<CaloTopology> theCaloTopology;
160  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
161  caloTopology_ = &(*theCaloTopology);
162 }
const T & get() const
Definition: EventSetup.h:55
void InterestingTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Definition at line 116 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(), info(), interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, minTrackPt_, eostools::move(), edm::Event::put(), DetId::rawId(), DetId::subdetId(), ecaldqm::topology(), trackAssociator_, trackAssociatorParameters_, trackCollectionToken_, and l1t::tracks.

117 {
118  using namespace edm;
119 
120  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
121 
122  // Get tracks from event
124  iEvent.getByToken(trackCollectionToken_,tracks);
125 
126  // Loop over tracks
127  for(reco::TrackCollection::const_iterator tkItr = tracks->begin(); tkItr != tracks->end(); ++tkItr)
128  {
129  if(tkItr->pt() < minTrackPt_)
130  continue;
131 
135 
137 
138  if(centerId.rawId()==0)
139  continue;
140 
141  // Find 5x5 around max
143  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
144  for(std::vector<DetId>::const_iterator idItr = ids.begin(); idItr != ids.end(); ++idItr)
145  {
147  == interestingDetIdCollection->end())
148  interestingDetIdCollection->push_back(*idItr);
149  }
150 
151  }
152 
154 
155 }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
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:20
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
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:25
HLT enums.
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const CaloTopology* InterestingTrackEcalDetIdProducer::caloTopology_
private

Definition at line 66 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

double InterestingTrackEcalDetIdProducer::minTrackPt_
private

Definition at line 64 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 61 of file InterestingTrackEcalDetIdProducer.cc.

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