#include <RecoParticleFlow/PFTracking/interface/PFNuclearProducer.h>
Public Member Functions | |
PFNuclearProducer (const edm::ParameterSet &) | |
Constructor. | |
~PFNuclearProducer () | |
Destructor. | |
Private Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Produce the PFRecTrack collection. | |
Private Attributes | |
double | likelihoodCut_ |
std::vector< edm::InputTag > | nuclearContainers_ |
PFTrackTransformer * | pfTransformer_ |
PFTrackTransformer. |
Definition at line 11 of file PFNuclearProducer.h.
PFNuclearProducer::PFNuclearProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Constructor.
Definition at line 11 of file PFNuclearProducer.cc.
References edm::ParameterSet::getParameter(), likelihoodCut_, and nuclearContainers_.
00011 : 00012 pfTransformer_(0) 00013 { 00014 produces<reco::PFRecTrackCollection>(); 00015 produces<reco::PFNuclearInteractionCollection>(); 00016 00017 nuclearContainers_ = 00018 iConfig.getParameter< vector < InputTag > >("nuclearColList"); 00019 likelihoodCut_ 00020 = iConfig.getParameter<double>("likelihoodCut"); 00021 }
PFNuclearProducer::~PFNuclearProducer | ( | ) |
Destructor.
Definition at line 23 of file PFNuclearProducer.cc.
References pfTransformer_.
00024 { 00025 delete pfTransformer_; 00026 }
void PFNuclearProducer::beginJob | ( | const edm::EventSetup & | iSetup | ) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 78 of file PFNuclearProducer.cc.
References edm::EventSetup::get(), PFTrackTransformer::OnlyProp(), and pfTransformer_.
00079 { 00080 ESHandle<MagneticField> magneticField; 00081 iSetup.get<IdealMagneticFieldRecord>().get(magneticField); 00082 pfTransformer_= new PFTrackTransformer(math::XYZVector(magneticField->inTesla(GlobalPoint(0,0,0)))); 00083 pfTransformer_->OnlyProp(); 00084 }
void PFNuclearProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Produce the PFRecTrack collection.
Implements edm::EDProducer.
Definition at line 29 of file PFNuclearProducer.cc.
References PFTrackTransformer::addPoints(), edm::Event::getByLabel(), edm::Event::getRefBeforePut(), it, reco::PFRecTrack::KF, likelihoodCut_, nuclearContainers_, pfTransformer_, edm::Handle< T >::product(), edm::RefVector< C, T, F >::push_back(), edm::Event::put(), and TrackValidation_HighPurity_cff::valid.
00030 { 00031 typedef reco::NuclearInteraction::trackRef_iterator trackRef_iterator; 00032 00033 //create the empty collections 00034 auto_ptr< reco::PFNuclearInteractionCollection > 00035 pfNuclearColl (new reco::PFNuclearInteractionCollection); 00036 auto_ptr< reco::PFRecTrackCollection > 00037 pfNuclearRecTrackColl (new reco::PFRecTrackCollection); 00038 00039 reco::PFRecTrackRefProd pfTrackRefProd = iEvent.getRefBeforePut<reco::PFRecTrackCollection>(); 00040 int hid=0; 00041 00042 // loop on the nuclear interaction collections 00043 for (uint istr=0; istr<nuclearContainers_.size();istr++){ 00044 00045 Handle<reco::NuclearInteractionCollection> nuclCollH; 00046 iEvent.getByLabel(nuclearContainers_[istr], nuclCollH); 00047 const reco::NuclearInteractionCollection& nuclColl = *(nuclCollH.product()); 00048 00049 // loop on all NuclearInteraction 00050 for( uint icoll=0; icoll < nuclColl.size(); icoll++) { 00051 00052 if( nuclColl[icoll].likelihood() < likelihoodCut_) continue; 00053 00054 reco::PFRecTrackRefVector pfRecTkcoll; 00055 00056 // convert the secondary tracks 00057 for(trackRef_iterator it = nuclColl[icoll].secondaryTracks_begin(); it!=nuclColl[icoll].secondaryTracks_end(); it++){ 00058 reco::PFRecTrack pftrack( (*it)->charge(), 00059 reco::PFRecTrack::KF, 00060 it->key(), (reco::TrackRef)((*it).castTo<reco::TrackRef>()) ); 00061 Trajectory FakeTraj; 00062 bool valid = pfTransformer_->addPoints( pftrack, **it, FakeTraj); 00063 if(valid) { 00064 pfRecTkcoll.push_back(reco::PFRecTrackRef( pfTrackRefProd, hid++ )); 00065 pfNuclearRecTrackColl->push_back(pftrack); 00066 } 00067 } 00068 reco::NuclearInteractionRef niRef(nuclCollH, icoll); 00069 pfNuclearColl->push_back( reco::PFNuclearInteraction( niRef, pfRecTkcoll )); 00070 } 00071 } 00072 iEvent.put(pfNuclearRecTrackColl); 00073 iEvent.put(pfNuclearColl); 00074 }
double PFNuclearProducer::likelihoodCut_ [private] |
Definition at line 29 of file PFNuclearProducer.h.
Referenced by PFNuclearProducer(), and produce().
std::vector<edm::InputTag> PFNuclearProducer::nuclearContainers_ [private] |
Definition at line 30 of file PFNuclearProducer.h.
Referenced by PFNuclearProducer(), and produce().
Definition at line 28 of file PFNuclearProducer.h.
Referenced by beginJob(), produce(), and ~PFNuclearProducer().