#include <RecoTauTag/RecoTau/interface/PFRecoTauProducer.h>
Public Member Functions | |
PFRecoTauProducer (const ParameterSet &iConfig) | |
virtual void | produce (Event &, const EventSetup &) |
~PFRecoTauProducer () | |
Private Attributes | |
InputTag | ElectronPreIDProducer_ |
double | JetMinPt_ |
PFRecoTauAlgorithm * | PFRecoTauAlgo_ |
InputTag | PFTauTagInfoProducer_ |
string | PVProducer_ |
double | smearedPVsigmaX_ |
double | smearedPVsigmaY_ |
double | smearedPVsigmaZ_ |
Definition at line 35 of file PFRecoTauProducer.h.
PFRecoTauProducer::PFRecoTauProducer | ( | const ParameterSet & | iConfig | ) | [explicit] |
Definition at line 3 of file PFRecoTauProducer.cc.
References ElectronPreIDProducer_, edm::ParameterSet::getParameter(), JetMinPt_, PFRecoTauAlgo_, PFTauTagInfoProducer_, PVProducer_, smearedPVsigmaX_, smearedPVsigmaY_, and smearedPVsigmaZ_.
00003 { 00004 PFTauTagInfoProducer_ = iConfig.getParameter<InputTag>("PFTauTagInfoProducer"); 00005 ElectronPreIDProducer_ = iConfig.getParameter<InputTag>("ElectronPreIDProducer"); 00006 PVProducer_ = iConfig.getParameter<string>("PVProducer"); 00007 smearedPVsigmaX_ = iConfig.getParameter<double>("smearedPVsigmaX"); 00008 smearedPVsigmaY_ = iConfig.getParameter<double>("smearedPVsigmaY"); 00009 smearedPVsigmaZ_ = iConfig.getParameter<double>("smearedPVsigmaZ"); 00010 JetMinPt_ = iConfig.getParameter<double>("JetPtMin"); 00011 PFRecoTauAlgo_=new PFRecoTauAlgorithm(iConfig); 00012 produces<PFTauCollection>(); 00013 }
PFRecoTauProducer::~PFRecoTauProducer | ( | ) |
Definition at line 14 of file PFRecoTauProducer.cc.
References PFRecoTauAlgo_.
00014 { 00015 delete PFRecoTauAlgo_; 00016 }
void PFRecoTauProducer::produce | ( | Event & | iEvent, | |
const EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 18 of file PFRecoTauProducer.cc.
References PFRecoTauAlgorithm::buildPFTau(), cond::Error, edm::EventSetup::get(), edm::Event::getByLabel(), JetMinPt_, PFRecoTauAlgo_, PFTauTagInfoProducer_, edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), PVProducer_, PFRecoTauAlgorithm::setTransientTrackBuilder(), smearedPVsigmaX_, smearedPVsigmaY_, and smearedPVsigmaZ_.
00018 { 00019 auto_ptr<PFTauCollection> resultPFTau(new PFTauCollection); 00020 00021 ESHandle<TransientTrackBuilder> myTransientTrackBuilder; 00022 iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder); 00023 PFRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product()); 00024 00025 //ESHandle<MagneticField> myMF; 00026 //iSetup.get<IdealMagneticFieldRecord>().get(myMF); 00027 //PFRecoTauAlgo_->setMagneticField(myMF.product()); 00028 00029 // Electron PreID tracks: Temporary until integrated to PFCandidate 00030 /* 00031 edm::Handle<PFRecTrackCollection> myPFelecTk; 00032 iEvent.getByLabel(ElectronPreIDProducer_,myPFelecTk); 00033 const PFRecTrackCollection theElecTkCollection=*(myPFelecTk.product()); 00034 */ 00035 // query a rec/sim PV 00036 Handle<VertexCollection> thePVs; 00037 iEvent.getByLabel(PVProducer_,thePVs); 00038 const VertexCollection vertCollection=*(thePVs.product()); 00039 Vertex thePV; 00040 if(vertCollection.size()) thePV=*(vertCollection.begin()); 00041 else{ 00042 Vertex::Error SimPVError; 00043 SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_; 00044 SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_; 00045 SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_; 00046 Vertex::Point SimPVPoint(RandGauss::shoot(0.,smearedPVsigmaX_), 00047 RandGauss::shoot(0.,smearedPVsigmaY_), 00048 RandGauss::shoot(0.,smearedPVsigmaZ_)); 00049 thePV=Vertex(SimPVPoint,SimPVError,1,1,1); 00050 } 00051 00052 Handle<PFTauTagInfoCollection> thePFTauTagInfoCollection; 00053 iEvent.getByLabel(PFTauTagInfoProducer_,thePFTauTagInfoCollection); 00054 int iinfo=0; 00055 for(PFTauTagInfoCollection::const_iterator i_info=thePFTauTagInfoCollection->begin();i_info!=thePFTauTagInfoCollection->end();i_info++) { 00056 if((*i_info).pfjetRef()->pt()>JetMinPt_){ 00057 // PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV,theElecTkCollection); 00058 PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV); 00059 resultPFTau->push_back(myPFTau); 00060 } 00061 ++iinfo; 00062 } 00063 iEvent.put(resultPFTau); 00064 }
double PFRecoTauProducer::JetMinPt_ [private] |
Definition at line 47 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().
Definition at line 48 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), produce(), and ~PFRecoTauProducer().
Definition at line 41 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().
string PFRecoTauProducer::PVProducer_ [private] |
Definition at line 43 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().
double PFRecoTauProducer::smearedPVsigmaX_ [private] |
Definition at line 44 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().
double PFRecoTauProducer::smearedPVsigmaY_ [private] |
Definition at line 45 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().
double PFRecoTauProducer::smearedPVsigmaZ_ [private] |
Definition at line 46 of file PFRecoTauProducer.h.
Referenced by PFRecoTauProducer(), and produce().