#include <ConversionTrackCandidateProducer.h>
Definition at line 40 of file ConversionTrackCandidateProducer.h.
ConversionTrackCandidateProducer::ConversionTrackCandidateProducer | ( | const edm::ParameterSet & | ps | ) |
Definition at line 37 of file ConversionTrackCandidateProducer.cc.
References bcBarrelCollection_, bcEndcapCollection_, conf_, edm::ParameterSet::getParameter(), hcalTowers_, hOverEConeSize_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, maxHOverE_, minSCEt_, nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, scHybridBarrelProducer_, and scIslandEndcapProducer_.
: conf_(config), theNavigationSchool_(0), theOutInSeedFinder_(0), theOutInTrackFinder_(0), theInOutSeedFinder_(0), theInOutTrackFinder_(0) { //std::cout << "ConversionTrackCandidateProducer CTOR " << "\n"; nEvt_=0; // use onfiguration file to setup input/output collection names bcBarrelCollection_ = conf_.getParameter<edm::InputTag>("bcBarrelCollection"); bcEndcapCollection_ = conf_.getParameter<edm::InputTag>("bcEndcapCollection"); scHybridBarrelProducer_ = conf_.getParameter<edm::InputTag>("scHybridBarrelProducer"); scIslandEndcapProducer_ = conf_.getParameter<edm::InputTag>("scIslandEndcapProducer"); OutInTrackCandidateCollection_ = conf_.getParameter<std::string>("outInTrackCandidateCollection"); InOutTrackCandidateCollection_ = conf_.getParameter<std::string>("inOutTrackCandidateCollection"); OutInTrackSuperClusterAssociationCollection_ = conf_.getParameter<std::string>("outInTrackCandidateSCAssociationCollection"); InOutTrackSuperClusterAssociationCollection_ = conf_.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection"); hcalTowers_ = conf_.getParameter<edm::InputTag>("hcalTowers"); hOverEConeSize_ = conf_.getParameter<double>("hOverEConeSize"); maxHOverE_ = conf_.getParameter<double>("maxHOverE"); minSCEt_ = conf_.getParameter<double>("minSCEt"); // Register the product produces< TrackCandidateCollection > (OutInTrackCandidateCollection_); produces< TrackCandidateCollection > (InOutTrackCandidateCollection_); produces< reco::TrackCandidateCaloClusterPtrAssociation > ( OutInTrackSuperClusterAssociationCollection_); produces< reco::TrackCandidateCaloClusterPtrAssociation > ( InOutTrackSuperClusterAssociationCollection_); }
ConversionTrackCandidateProducer::~ConversionTrackCandidateProducer | ( | ) |
Definition at line 83 of file ConversionTrackCandidateProducer.cc.
{}
void ConversionTrackCandidateProducer::beginRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 96 of file ConversionTrackCandidateProducer.cc.
References conf_, edm::EventSetup::get(), edm::ESHandle< T >::product(), theInOutSeedFinder_, theInOutTrackFinder_, theNavigationSchool_, theOutInSeedFinder_, and theOutInTrackFinder_.
{ edm::ESHandle<NavigationSchool> nav; theEventSetup.get<NavigationSchoolRecord>().get("SimpleNavigationSchool", nav); theNavigationSchool_ = nav.product(); // get the Out In Seed Finder theOutInSeedFinder_ = new OutInConversionSeedFinder ( conf_ ); // get the Out In Track Finder theOutInTrackFinder_ = new OutInConversionTrackFinder ( theEventSetup, conf_ ); // get the In Out Seed Finder theInOutSeedFinder_ = new InOutConversionSeedFinder ( conf_ ); // get the In Out Track Finder theInOutTrackFinder_ = new InOutConversionTrackFinder ( theEventSetup, conf_ ); }
void ConversionTrackCandidateProducer::buildCollections | ( | const edm::Handle< edm::View< reco::CaloCluster > > & | scHandle, |
const edm::Handle< edm::View< reco::CaloCluster > > & | bcHandle, | ||
const edm::Handle< CaloTowerCollection > & | hcalTowersHandle, | ||
TrackCandidateCollection & | outInTracks, | ||
TrackCandidateCollection & | inOutTracks, | ||
std::vector< edm::Ptr< reco::CaloCluster > > & | vecRecOI, | ||
std::vector< edm::Ptr< reco::CaloCluster > > & | vecRecIO | ||
) | [private] |
Definition at line 256 of file ConversionTrackCandidateProducer.cc.
References caloPtrVecInOut_, caloPtrVecOutIn_, reco::CaloCluster::energy(), EgammaTowerIsolation::getTowerESum(), hOverEConeSize_, i, InOutConversionSeedFinder::makeSeeds(), OutInConversionSeedFinder::makeSeeds(), maxHOverE_, minSCEt_, reco::CaloCluster::position(), edm::Handle< T >::product(), ConversionSeedFinder::seeds(), ConversionSeedFinder::setCandidate(), InOutConversionSeedFinder::setTracks(), theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, theOutInTrackFinder_, InOutConversionTrackFinder::tracks(), and OutInConversionTrackFinder::tracks().
Referenced by produce().
{ // std::cout << "ConversionTrackCandidateProducer builcollections bc size " << bcHandle->size() << "\n"; //const CaloGeometry* geometry = theCaloGeom_.product(); // Loop over SC in the barrel and reconstruct converted photons for (unsigned i = 0; i < scHandle->size(); ++i ) { reco::CaloClusterPtr aClus= scHandle->ptrAt(i); // preselection based in Et and H/E cut. if (aClus->energy()/cosh(aClus->eta()) <= minSCEt_) continue; const reco::CaloCluster* pClus=&(*aClus); const reco::SuperCluster* sc=dynamic_cast<const reco::SuperCluster*>(pClus); const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product(); EgammaTowerIsolation towerIso(hOverEConeSize_,0.,0.,-1,hcalTowersColl) ; double HoE=towerIso.getTowerESum(sc)/sc->energy(); if (HoE>=maxHOverE_) continue; theOutInSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) ); theOutInSeedFinder_->makeSeeds( bcHandle ); std::vector<Trajectory> theOutInTracks= theOutInTrackFinder_->tracks(theOutInSeedFinder_->seeds(), outInTrackCandidates); theInOutSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) ); theInOutSeedFinder_->setTracks( theOutInTracks ); theInOutSeedFinder_->makeSeeds( bcHandle); std::vector<Trajectory> theInOutTracks= theInOutTrackFinder_->tracks(theInOutSeedFinder_->seeds(), inOutTrackCandidates); // Debug // std::cout << "ConversionTrackCandidateProducer theOutInTracks.size() " << theOutInTracks.size() << " theInOutTracks.size() " << theInOutTracks.size() << " Event pointer to out in track size barrel " << outInTrackCandidates.size() << " in out track size " << inOutTrackCandidates.size() << "\n"; for (std::vector<Trajectory>::const_iterator it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) { caloPtrVecOutIn_.push_back(aClus); // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n"; } for (std::vector<Trajectory>::const_iterator it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) { caloPtrVecInOut_.push_back(aClus); // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n"; } } }
void ConversionTrackCandidateProducer::endRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 120 of file ConversionTrackCandidateProducer.cc.
References theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.
{ delete theOutInSeedFinder_; delete theOutInTrackFinder_; delete theInOutSeedFinder_; delete theInOutTrackFinder_; }
void ConversionTrackCandidateProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 130 of file ConversionTrackCandidateProducer.cc.
References bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, ConversionSeedFinder::clear(), edm::helper::Filler< Map >::fill(), edm::EventSetup::get(), edm::Event::getByLabel(), hcalTowers_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, edm::helper::Filler< Map >::insert(), edm::InputTag::label(), nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, edm::Event::put(), scHybridBarrelProducer_, scIslandEndcapProducer_, ConversionTrackFinder::setEvent(), ConversionSeedFinder::setEvent(), setEventSetup(), theCaloGeom_, theInOutSeedFinder_, theInOutTrackFinder_, theNavigationSchool_, theOutInSeedFinder_, and theOutInTrackFinder_.
{ using namespace edm; nEvt_++; // std::cout << "ConversionTrackCandidateProducer Analyzing event number " << theEvent.id() << " Global Counter " << nEvt_ << "\n"; setEventSetup( theEventSetup ); theOutInSeedFinder_->setEvent(theEvent); theInOutSeedFinder_->setEvent(theEvent); theOutInTrackFinder_->setEvent(theEvent); theInOutTrackFinder_->setEvent(theEvent); // Set the navigation school NavigationSetter setter(*theNavigationSchool_); // // create empty output collections // // Out In Track Candidates std::auto_ptr<TrackCandidateCollection> outInTrackCandidate_p(new TrackCandidateCollection); // In Out Track Candidates std::auto_ptr<TrackCandidateCollection> inOutTrackCandidate_p(new TrackCandidateCollection); // Track Candidate calo Cluster Association std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> outInAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation); std::auto_ptr<reco::TrackCandidateCaloClusterPtrAssociation> inOutAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation); // Get the basic cluster collection in the Barrel bool validBarrelBCHandle=true; edm::Handle<edm::View<reco::CaloCluster> > bcBarrelHandle; theEvent.getByLabel(bcBarrelCollection_, bcBarrelHandle); if (!bcBarrelHandle.isValid()) { edm::LogError("ConversionTrackCandidateProducer") << "Error! Can't get the product "<<bcBarrelCollection_.label(); validBarrelBCHandle=false; } // Get the basic cluster collection in the Endcap bool validEndcapBCHandle=true; edm::Handle<edm::View<reco::CaloCluster> > bcEndcapHandle; theEvent.getByLabel(bcEndcapCollection_, bcEndcapHandle); if (!bcEndcapHandle.isValid()) { edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<bcEndcapCollection_.label(); validEndcapBCHandle=false; } // Get the Super Cluster collection in the Barrel bool validBarrelSCHandle=true; edm::Handle<edm::View<reco::CaloCluster> > scBarrelHandle; theEvent.getByLabel(scHybridBarrelProducer_,scBarrelHandle); if (!scBarrelHandle.isValid()) { edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<scHybridBarrelProducer_.label(); validBarrelSCHandle=false; } // Get the Super Cluster collection in the Endcap bool validEndcapSCHandle=true; edm::Handle<edm::View<reco::CaloCluster> > scEndcapHandle; theEvent.getByLabel(scIslandEndcapProducer_,scEndcapHandle); if (!scEndcapHandle.isValid()) { edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the product "<<scIslandEndcapProducer_.label(); validEndcapSCHandle=false; } // get the geometry from the event setup: theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_); // get Hcal towers collection Handle<CaloTowerCollection> hcalTowersHandle; theEvent.getByLabel(hcalTowers_, hcalTowersHandle); caloPtrVecOutIn_.clear(); caloPtrVecInOut_.clear(); if ( validBarrelBCHandle && validBarrelSCHandle ) buildCollections(scBarrelHandle, bcBarrelHandle, hcalTowersHandle, *outInTrackCandidate_p,*inOutTrackCandidate_p,caloPtrVecOutIn_,caloPtrVecInOut_ ); if ( validEndcapBCHandle && validEndcapSCHandle ) buildCollections(scEndcapHandle, bcEndcapHandle, hcalTowersHandle, *outInTrackCandidate_p,*inOutTrackCandidate_p,caloPtrVecOutIn_,caloPtrVecInOut_ ); // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n"; // put all products in the event // Barrel //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n"; const edm::OrphanHandle<TrackCandidateCollection> refprodOutInTrackC = theEvent.put( outInTrackCandidate_p, OutInTrackCandidateCollection_ ); //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n"; // //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n"; const edm::OrphanHandle<TrackCandidateCollection> refprodInOutTrackC = theEvent.put( inOutTrackCandidate_p, InOutTrackCandidateCollection_ ); //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n"; edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p); fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end()); fillerOI.fill(); edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p); fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end()); fillerIO.fill(); // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n"; theEvent.put( outInAssoc_p, OutInTrackSuperClusterAssociationCollection_); // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n"; theEvent.put( inOutAssoc_p, InOutTrackSuperClusterAssociationCollection_); theOutInSeedFinder_->clear(); theInOutSeedFinder_->clear(); }
void ConversionTrackCandidateProducer::setEventSetup | ( | const edm::EventSetup & | es | ) | [private] |
Initialize EventSetup objects at each event.
Definition at line 85 of file ConversionTrackCandidateProducer.cc.
References ConversionSeedFinder::setEventSetup(), ConversionTrackFinder::setEventSetup(), theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.
Referenced by produce().
{ theOutInSeedFinder_->setEventSetup(theEventSetup); theInOutSeedFinder_->setEventSetup(theEventSetup); theOutInTrackFinder_->setEventSetup(theEventSetup); theInOutTrackFinder_->setEventSetup(theEventSetup); }
Definition at line 67 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
Definition at line 68 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecInOut_ [private] |
Definition at line 88 of file ConversionTrackCandidateProducer.h.
Referenced by buildCollections(), and produce().
std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecOutIn_ [private] |
Definition at line 87 of file ConversionTrackCandidateProducer.h.
Referenced by buildCollections(), and produce().
Definition at line 71 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), and ConversionTrackCandidateProducer().
Definition at line 72 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
double ConversionTrackCandidateProducer::hOverEConeSize_ [private] |
Definition at line 74 of file ConversionTrackCandidateProducer.h.
Referenced by buildCollections(), and ConversionTrackCandidateProducer().
std::string ConversionTrackCandidateProducer::InOutTrackCandidateCollection_ [private] |
Definition at line 61 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
std::string ConversionTrackCandidateProducer::InOutTrackSuperClusterAssociationCollection_ [private] |
Definition at line 65 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
double ConversionTrackCandidateProducer::maxHOverE_ [private] |
Definition at line 75 of file ConversionTrackCandidateProducer.h.
Referenced by buildCollections(), and ConversionTrackCandidateProducer().
double ConversionTrackCandidateProducer::minSCEt_ [private] |
Definition at line 76 of file ConversionTrackCandidateProducer.h.
Referenced by buildCollections(), and ConversionTrackCandidateProducer().
int ConversionTrackCandidateProducer::nEvt_ [private] |
Definition at line 55 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_ [private] |
Definition at line 60 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
std::string ConversionTrackCandidateProducer::OutInTrackSuperClusterAssociationCollection_ [private] |
Definition at line 64 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
Definition at line 69 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
Definition at line 70 of file ConversionTrackCandidateProducer.h.
Referenced by ConversionTrackCandidateProducer(), and produce().
Definition at line 78 of file ConversionTrackCandidateProducer.h.
Referenced by produce().
Definition at line 83 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), buildCollections(), endRun(), produce(), and setEventSetup().
Definition at line 84 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), buildCollections(), endRun(), produce(), and setEventSetup().
const NavigationSchool* ConversionTrackCandidateProducer::theNavigationSchool_ [private] |
Definition at line 80 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), and produce().
Definition at line 81 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), buildCollections(), endRun(), produce(), and setEventSetup().
Definition at line 82 of file ConversionTrackCandidateProducer.h.
Referenced by beginRun(), buildCollections(), endRun(), produce(), and setEventSetup().
std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForInOut [private] |
Definition at line 91 of file ConversionTrackCandidateProducer.h.
std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForOutIn [private] |
Definition at line 90 of file ConversionTrackCandidateProducer.h.