Public Member Functions | |
void | beginRun (edm::Run &, const edm::EventSetup &) |
HighPtTrackEcalDetIdProducer (const edm::ParameterSet &) | |
void | produce (edm::Event &, const edm::EventSetup &) |
~HighPtTrackEcalDetIdProducer () | |
Private Attributes | |
const CaloTopology * | caloTopology_ |
edm::InputTag | inputCollection_ |
TrackAssociatorParameters | parameters_ |
double | ptcut_ |
TrackDetectorAssociator | trackAssociator_ |
Definition at line 58 of file HighPtTrackEcalDetIdProducer.cc.
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().
{ inputCollection_ = iConfig.getParameter< edm::InputTag >("inputCollection"); ptcut_= iConfig.getParameter< double >("TrackPt"); produces< DetIdCollection >() ; // TrackAssociator parameters edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters"); parameters_.loadParameters( parameters ); trackAssociator_.useDefaultPropagator(); }
HighPtTrackEcalDetIdProducer::~HighPtTrackEcalDetIdProducer | ( | ) |
Definition at line 99 of file HighPtTrackEcalDetIdProducer.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
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().
{ edm::ESHandle<CaloTopology> theCaloTopology; iSetup.get<CaloTopologyRecord>().get(theCaloTopology); caloTopology_ = &(*theCaloTopology); }
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_.
{ using namespace edm; using reco::TrackCollection; // if(!iSetup) continue; Handle<TrackCollection> tkTracks; iEvent.getByLabel(inputCollection_,tkTracks); std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; for(TrackCollection::const_iterator itTrack = tkTracks->begin(); itTrack != tkTracks->end(); ++itTrack) { if(itTrack->pt()>ptcut_){ TrackDetMatchInfo info = trackAssociator_.associate(iEvent, iSetup, *itTrack, parameters_, TrackDetectorAssociator::InsideOut); if(info.crossedEcalIds.size()==0) break; if(info.crossedEcalIds.size()>0){ DetId centerId = info.crossedEcalIds.front(); const CaloSubdetectorTopology* topology = caloTopology_->getSubdetectorTopology(DetId::Ecal,centerId.subdetId()); const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5); for ( std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id ) if(std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *id) == interestingDetIdCollection->end()) interestingDetIdCollection->push_back(*id); } } } iEvent.put(interestingDetIdCollection); }
const CaloTopology* HighPtTrackEcalDetIdProducer::caloTopology_ [private] |
Definition at line 67 of file HighPtTrackEcalDetIdProducer.cc.
Referenced by beginRun(), and produce().
Definition at line 66 of file HighPtTrackEcalDetIdProducer.cc.
Referenced by HighPtTrackEcalDetIdProducer(), and produce().
Definition at line 69 of file HighPtTrackEcalDetIdProducer.cc.
Referenced by HighPtTrackEcalDetIdProducer(), and produce().
double HighPtTrackEcalDetIdProducer::ptcut_ [private] |
Definition at line 70 of file HighPtTrackEcalDetIdProducer.cc.
Referenced by HighPtTrackEcalDetIdProducer(), and produce().
Definition at line 68 of file HighPtTrackEcalDetIdProducer.cc.
Referenced by HighPtTrackEcalDetIdProducer(), and produce().