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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 InterestingTrackEcalDetIdProducer (const edm::ParameterSet &)
 
 ~InterestingTrackEcalDetIdProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob ()
 
void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

const CaloTopologycaloTopology_
 
double minTrackPt_
 
TrackDetectorAssociator trackAssociator_
 
TrackAssociatorParameters trackAssociatorParameters_
 
edm::ParameterSet trackAssociatorPS_
 
edm::InputTag trackCollection_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 50 of file InterestingTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 87 of file InterestingTrackEcalDetIdProducer.cc.

References TrackAssociatorParameters::loadParameters(), trackAssociator_, trackAssociatorParameters_, trackAssociatorPS_, and TrackDetectorAssociator::useDefaultPropagator().

87  :
88  trackCollection_ (iConfig.getParameter<edm::InputTag>("TrackCollection")),
89  trackAssociatorPS_ (iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters")),
90  minTrackPt_ (iConfig.getParameter<double>("MinTrackPt"))
91 
92 {
95 
96  produces<DetIdCollection>();
97 }
T getParameter(std::string const &) const
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &)
InterestingTrackEcalDetIdProducer::~InterestingTrackEcalDetIdProducer ( )

Definition at line 100 of file InterestingTrackEcalDetIdProducer.cc.

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

Member Function Documentation

void InterestingTrackEcalDetIdProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 165 of file InterestingTrackEcalDetIdProducer.cc.

166 {
167 }
void InterestingTrackEcalDetIdProducer::beginRun ( edm::Run run,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 156 of file InterestingTrackEcalDetIdProducer.cc.

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

157 {
158  edm::ESHandle<CaloTopology> theCaloTopology;
159  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
160  caloTopology_ = &(*theCaloTopology);
161 }
const T & get() const
Definition: EventSetup.h:55
void InterestingTrackEcalDetIdProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 171 of file InterestingTrackEcalDetIdProducer.cc.

171  {
172 }
void InterestingTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 115 of file InterestingTrackEcalDetIdProducer.cc.

References TrackDetectorAssociator::associate(), caloTopology_, DetId::Ecal, TrackDetMatchInfo::EcalRecHits, spr::find(), TrackDetMatchInfo::findMaxDeposition(), edm::Event::getByLabel(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), info, minTrackPt_, edm::Event::put(), DetId::rawId(), DetId::subdetId(), trackAssociator_, trackAssociatorParameters_, trackCollection_, and testEve_cfg::tracks.

116 {
117  using namespace edm;
118 
119  std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ;
120 
121  // Get tracks from event
124 
125  // Loop over tracks
126  for(reco::TrackCollection::const_iterator tkItr = tracks->begin(); tkItr != tracks->end(); ++tkItr)
127  {
128  if(tkItr->pt() < minTrackPt_)
129  continue;
130 
134 
136 
137  if(centerId.rawId()==0)
138  continue;
139 
140  // Find 5x5 around max
142  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
143  for(std::vector<DetId>::const_iterator idItr = ids.begin(); idItr != ids.end(); ++idItr)
144  {
145  if(std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *idItr)
146  == interestingDetIdCollection->end())
147  interestingDetIdCollection->push_back(*idItr);
148  }
149 
150  }
151 
152  iEvent.put(interestingDetIdCollection);
153 
154 }
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.
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:45
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
Definition: DetId.h:20
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 68 of file InterestingTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

double InterestingTrackEcalDetIdProducer::minTrackPt_
private

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

Referenced by produce().