#include <RecoTauTag/RecoTau/interface/CaloRecoTauProducer.h>
Public Member Functions | |
CaloRecoTauProducer (const ParameterSet &iConfig) | |
virtual void | produce (Event &, const EventSetup &) |
~CaloRecoTauProducer () | |
Private Attributes | |
CaloRecoTauAlgorithm * | CaloRecoTauAlgo_ |
InputTag | CaloRecoTauTagInfoProducer_ |
double | JetMinPt_ |
string | PVProducer_ |
double | smearedPVsigmaX_ |
double | smearedPVsigmaY_ |
double | smearedPVsigmaZ_ |
Definition at line 35 of file CaloRecoTauProducer.h.
CaloRecoTauProducer::CaloRecoTauProducer | ( | const ParameterSet & | iConfig | ) | [explicit] |
Definition at line 3 of file CaloRecoTauProducer.cc.
References CaloRecoTauAlgo_, CaloRecoTauTagInfoProducer_, edm::ParameterSet::getParameter(), JetMinPt_, PVProducer_, smearedPVsigmaX_, smearedPVsigmaY_, and smearedPVsigmaZ_.
00003 { 00004 CaloRecoTauTagInfoProducer_ = iConfig.getParameter<InputTag>("CaloRecoTauTagInfoProducer"); 00005 PVProducer_ = iConfig.getParameter<string>("PVProducer"); 00006 smearedPVsigmaX_ = iConfig.getParameter<double>("smearedPVsigmaX"); 00007 smearedPVsigmaY_ = iConfig.getParameter<double>("smearedPVsigmaY"); 00008 smearedPVsigmaZ_ = iConfig.getParameter<double>("smearedPVsigmaZ"); 00009 JetMinPt_ = iConfig.getParameter<double>("JetPtMin"); 00010 CaloRecoTauAlgo_=new CaloRecoTauAlgorithm(iConfig); 00011 produces<CaloTauCollection>(); 00012 }
CaloRecoTauProducer::~CaloRecoTauProducer | ( | ) |
Definition at line 13 of file CaloRecoTauProducer.cc.
References CaloRecoTauAlgo_.
00013 { 00014 delete CaloRecoTauAlgo_; 00015 }
void CaloRecoTauProducer::produce | ( | Event & | iEvent, | |
const EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 17 of file CaloRecoTauProducer.cc.
References CaloRecoTauAlgorithm::buildCaloTau(), CaloRecoTauAlgo_, CaloRecoTauTagInfoProducer_, cond::Error, edm::EventSetup::get(), edm::Event::getByLabel(), JetMinPt_, edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), PVProducer_, CaloRecoTauAlgorithm::setMagneticField(), CaloRecoTauAlgorithm::setTransientTrackBuilder(), smearedPVsigmaX_, smearedPVsigmaY_, and smearedPVsigmaZ_.
00017 { 00018 00019 auto_ptr<CaloTauCollection> resultCaloTau(new CaloTauCollection); 00020 00021 ESHandle<TransientTrackBuilder> myTransientTrackBuilder; 00022 iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder); 00023 CaloRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product()); 00024 00025 ESHandle<MagneticField> myMF; 00026 iSetup.get<IdealMagneticFieldRecord>().get(myMF); 00027 CaloRecoTauAlgo_->setMagneticField(myMF.product()); 00028 00029 // query a rec/sim PV 00030 Handle<VertexCollection> thePVs; 00031 iEvent.getByLabel(PVProducer_,thePVs); 00032 const VertexCollection vertCollection=*(thePVs.product()); 00033 Vertex thePV; 00034 if(vertCollection.size()) thePV=*(vertCollection.begin()); 00035 else{ 00036 Vertex::Error SimPVError; 00037 SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_; 00038 SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_; 00039 SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_; 00040 Vertex::Point SimPVPoint(RandGauss::shoot(0.,smearedPVsigmaX_), 00041 RandGauss::shoot(0.,smearedPVsigmaY_), 00042 RandGauss::shoot(0.,smearedPVsigmaZ_)); 00043 thePV=Vertex(SimPVPoint,SimPVError,1,1,1); 00044 } 00045 00046 Handle<CaloTauTagInfoCollection> theCaloTauTagInfoCollection; 00047 iEvent.getByLabel(CaloRecoTauTagInfoProducer_,theCaloTauTagInfoCollection); 00048 int iinfo=0; 00049 for(CaloTauTagInfoCollection::const_iterator i_info=theCaloTauTagInfoCollection->begin();i_info!=theCaloTauTagInfoCollection->end();i_info++) { 00050 if(i_info->calojetRef()->pt()>JetMinPt_){ 00051 CaloTau myCaloTau=CaloRecoTauAlgo_->buildCaloTau(iEvent,iSetup,Ref<CaloTauTagInfoCollection>(theCaloTauTagInfoCollection,iinfo),thePV); 00052 resultCaloTau->push_back(myCaloTau); 00053 } 00054 ++iinfo; 00055 } 00056 00057 iEvent.put(resultCaloTau); 00058 }
Definition at line 47 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), produce(), and ~CaloRecoTauProducer().
Definition at line 41 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().
double CaloRecoTauProducer::JetMinPt_ [private] |
Definition at line 46 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().
string CaloRecoTauProducer::PVProducer_ [private] |
Definition at line 42 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().
double CaloRecoTauProducer::smearedPVsigmaX_ [private] |
Definition at line 43 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().
double CaloRecoTauProducer::smearedPVsigmaY_ [private] |
Definition at line 44 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().
double CaloRecoTauProducer::smearedPVsigmaZ_ [private] |
Definition at line 45 of file CaloRecoTauProducer.h.
Referenced by CaloRecoTauProducer(), and produce().