CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::TrackCollection
trackCollectionToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 157 of file InterestingTrackEcalDetIdProducer.cc.

References caloTopology_, 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

Implements edm::stream::EDProducerBase.

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(), minTrackPt_, edm::Event::put(), DetId::rawId(), DetId::subdetId(), ecaldqm::topology(), trackAssociator_, trackAssociatorParameters_, trackCollectionToken_, and testEve_cfg::tracks.

117 {
118  using namespace edm;
119 
120  std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ;
121 
122  // Get tracks from event
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  {
146  if(std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *idItr)
147  == interestingDetIdCollection->end())
148  interestingDetIdCollection->push_back(*idItr);
149  }
150 
151  }
152 
153  iEvent.put(interestingDetIdCollection);
154 
155 }
static const TGPicture * info(bool iBackgroundIsBlack)
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
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:7
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
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
tuple tracks
Definition: testEve_cfg.py:39
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDCollection< DetId > DetIdCollection

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