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 Attributes
HighPtTrackEcalDetIdProducer Class Reference
Inheritance diagram for HighPtTrackEcalDetIdProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run &, const edm::EventSetup &)
 
 HighPtTrackEcalDetIdProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 ~HighPtTrackEcalDetIdProducer ()
 
- 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 Attributes

const CaloTopologycaloTopology_
 
edm::InputTag inputCollection_
 
TrackAssociatorParameters parameters_
 
double ptcut_
 
TrackDetectorAssociator trackAssociator_
 

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)
 
static void prevalidate (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

Definition at line 58 of file HighPtTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 86 of file HighPtTrackEcalDetIdProducer.cc.

References edm::ParameterSet::getParameter(), inputCollection_, TrackAssociatorParameters::loadParameters(), Parameters::parameters, parameters_, ptcut_, trackAssociator_, and TrackDetectorAssociator::useDefaultPropagator().

87 {
88  inputCollection_ = iConfig.getParameter< edm::InputTag >("inputCollection"); ptcut_= iConfig.getParameter< double >("TrackPt");
89 
90  produces< DetIdCollection >() ;
91  // TrackAssociator parameters
92  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
93  parameters_.loadParameters( parameters );
95 
96 }
T getParameter(std::string const &) const
dictionary parameters
Definition: Parameters.py:2
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &)
HighPtTrackEcalDetIdProducer::~HighPtTrackEcalDetIdProducer ( )

Definition at line 99 of file HighPtTrackEcalDetIdProducer.cc.

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

Member Function Documentation

void HighPtTrackEcalDetIdProducer::beginRun ( edm::Run run,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 113 of file HighPtTrackEcalDetIdProducer.cc.

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

114 {
115  edm::ESHandle<CaloTopology> theCaloTopology;
116  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
117  caloTopology_ = &(*theCaloTopology);
118 }
const T & get() const
Definition: EventSetup.h:55
void HighPtTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 122 of file HighPtTrackEcalDetIdProducer.cc.

References TrackDetectorAssociator::associate(), caloTopology_, TrackDetMatchInfo::crossedEcalIds, DetId::Ecal, spr::find(), edm::Event::getByLabel(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), errorMatrix2Lands_multiChannel::id, info, inputCollection_, TrackDetectorAssociator::InsideOut, parameters_, ptcut_, edm::Event::put(), DetId::subdetId(), and trackAssociator_.

123 {
124  using namespace edm;
125  using reco::TrackCollection;
126 // if(!iSetup) continue;
127  Handle<TrackCollection> tkTracks;
128  iEvent.getByLabel(inputCollection_,tkTracks);
129  std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ;
130  for(TrackCollection::const_iterator itTrack = tkTracks->begin();
131  itTrack != tkTracks->end();
132  ++itTrack) {
133  if(itTrack->pt()>ptcut_){
135  if(info.crossedEcalIds.size()==0) break;
136 
137  if(info.crossedEcalIds.size()>0){
138  DetId centerId = info.crossedEcalIds.front();
139 
141  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
142  for ( std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id )
143  if(std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *id)
144  == interestingDetIdCollection->end())
145  interestingDetIdCollection->push_back(*id);
146  }
147  }
148 
149  }
150  iEvent.put(interestingDetIdCollection);
151 
152 }
std::vector< DetId > crossedEcalIds
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
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:356
Definition: DetId.h:20
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:26
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDCollection< DetId > DetIdCollection

Member Data Documentation

const CaloTopology* HighPtTrackEcalDetIdProducer::caloTopology_
private

Definition at line 67 of file HighPtTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

edm::InputTag HighPtTrackEcalDetIdProducer::inputCollection_
private

Definition at line 66 of file HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

TrackAssociatorParameters HighPtTrackEcalDetIdProducer::parameters_
private
double HighPtTrackEcalDetIdProducer::ptcut_
private

Definition at line 70 of file HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

TrackDetectorAssociator HighPtTrackEcalDetIdProducer::trackAssociator_
private

Definition at line 68 of file HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().