#include <LightPFTrackProducer.h>
Public Member Functions | |
LightPFTrackProducer (const edm::ParameterSet &) | |
Constructor. | |
~LightPFTrackProducer () | |
Destructor. | |
Private Member Functions | |
virtual void | beginRun (edm::Run &, const edm::EventSetup &) |
virtual void | endRun () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Produce the PFRecTrack collection. | |
Private Attributes | |
PFTrackTransformer * | pfTransformer_ |
PFTrackTransformer. | |
reco::TrackBase::TrackQuality | trackQuality_ |
std::vector< edm::InputTag > | tracksContainers_ |
bool | useQuality_ |
TRACK QUALITY. |
Definition at line 11 of file LightPFTrackProducer.h.
LightPFTrackProducer::LightPFTrackProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Constructor.
Definition at line 15 of file LightPFTrackProducer.cc.
References edm::ParameterSet::getParameter(), reco::TrackBase::qualityByName(), trackQuality_, tracksContainers_, and useQuality_.
: pfTransformer_(0) { produces<reco::PFRecTrackCollection>(); tracksContainers_ = iConfig.getParameter< vector < InputTag > >("TkColList"); useQuality_ = iConfig.getParameter<bool>("UseQuality"); trackQuality_=reco::TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality")); }
LightPFTrackProducer::~LightPFTrackProducer | ( | ) |
Destructor.
Definition at line 29 of file LightPFTrackProducer.cc.
References pfTransformer_.
{ delete pfTransformer_; }
void LightPFTrackProducer::beginRun | ( | edm::Run & | run, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 67 of file LightPFTrackProducer.cc.
References edm::EventSetup::get(), PFTrackTransformer::OnlyProp(), and pfTransformer_.
{ ESHandle<MagneticField> magneticField; iSetup.get<IdealMagneticFieldRecord>().get(magneticField); pfTransformer_= new PFTrackTransformer(math::XYZVector(magneticField->inTesla(GlobalPoint(0,0,0)))); pfTransformer_->OnlyProp(); }
void LightPFTrackProducer::endRun | ( | void | ) | [private, virtual] |
Definition at line 78 of file LightPFTrackProducer.cc.
References pfTransformer_.
{ delete pfTransformer_; }
void LightPFTrackProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Produce the PFRecTrack collection.
Implements edm::EDProducer.
Definition at line 35 of file LightPFTrackProducer.cc.
References PFTrackTransformer::addPoints(), edm::Event::getByLabel(), i, reco::PFRecTrack::KF, pfTransformer_, edm::Handle< T >::product(), edm::Event::put(), trackQuality_, tracksContainers_, useQuality_, and TrackValidation_HighPurity_cff::valid.
{ //create the empty collections auto_ptr< reco::PFRecTrackCollection > PfTrColl (new reco::PFRecTrackCollection); for (unsigned int istr=0; istr<tracksContainers_.size();istr++){ //Track collection Handle<reco::TrackCollection> tkRefCollection; iEvent.getByLabel(tracksContainers_[istr], tkRefCollection); reco::TrackCollection Tk=*(tkRefCollection.product()); for(unsigned int i=0;i<Tk.size();i++){ if (useQuality_ && (!(Tk[i].quality(trackQuality_)))) continue; reco::TrackRef trackRef(tkRefCollection, i); reco::PFRecTrack pftrack( trackRef->charge(), reco::PFRecTrack::KF, i, trackRef ); Trajectory FakeTraj; bool valid = pfTransformer_->addPoints( pftrack, *trackRef, FakeTraj); if(valid) PfTrColl->push_back(pftrack); } } iEvent.put(PfTrColl); }
Definition at line 28 of file LightPFTrackProducer.h.
Referenced by beginRun(), endRun(), produce(), and ~LightPFTrackProducer().
Definition at line 32 of file LightPFTrackProducer.h.
Referenced by LightPFTrackProducer(), and produce().
std::vector<edm::InputTag> LightPFTrackProducer::tracksContainers_ [private] |
Definition at line 29 of file LightPFTrackProducer.h.
Referenced by LightPFTrackProducer(), and produce().
bool LightPFTrackProducer::useQuality_ [private] |
TRACK QUALITY.
Definition at line 31 of file LightPFTrackProducer.h.
Referenced by LightPFTrackProducer(), and produce().