CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloRecoTauProducer Class Reference
Inheritance diagram for CaloRecoTauProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 CaloRecoTauProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~CaloRecoTauProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

CaloRecoTauAlgorithmCaloRecoTauAlgo_
 
edm::InputTag CaloRecoTauTagInfoProducer_
 
double JetMinPt_
 
edm::InputTag PVProducer_
 
double smearedPVsigmaX_
 
double smearedPVsigmaY_
 
double smearedPVsigmaZ_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 34 of file CaloRecoTauProducer.cc.

Constructor & Destructor Documentation

CaloRecoTauProducer::CaloRecoTauProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 49 of file CaloRecoTauProducer.cc.

References edm::ParameterSet::getParameter().

49  {
50  CaloRecoTauTagInfoProducer_ = iConfig.getParameter<edm::InputTag>("CaloRecoTauTagInfoProducer");
51  PVProducer_ = iConfig.getParameter<edm::InputTag>("PVProducer");
52  smearedPVsigmaX_ = iConfig.getParameter<double>("smearedPVsigmaX");
53  smearedPVsigmaY_ = iConfig.getParameter<double>("smearedPVsigmaY");
54  smearedPVsigmaZ_ = iConfig.getParameter<double>("smearedPVsigmaZ");
55  JetMinPt_ = iConfig.getParameter<double>("JetPtMin");
57  produces<CaloTauCollection>();
58  produces<DetIdCollection>();
59 }
T getParameter(std::string const &) const
CaloRecoTauAlgorithm * CaloRecoTauAlgo_
edm::InputTag CaloRecoTauTagInfoProducer_
CaloRecoTauProducer::~CaloRecoTauProducer ( )

Definition at line 60 of file CaloRecoTauProducer.cc.

60  {
61  delete CaloRecoTauAlgo_;
62 }
CaloRecoTauAlgorithm * CaloRecoTauAlgo_

Member Function Documentation

void CaloRecoTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 64 of file CaloRecoTauProducer.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::Handle< T >::product(), edm::ESHandle< class >::product(), and edm::Event::put().

64  {
65 
66  auto_ptr<CaloTauCollection> resultCaloTau(new CaloTauCollection);
67  auto_ptr<DetIdCollection> selectedDetIds(new DetIdCollection);
68 
69  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
70  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder);
71  CaloRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product());
72 
74  iSetup.get<IdealMagneticFieldRecord>().get(myMF);
76 
77  // query a rec/sim PV
79  iEvent.getByLabel(PVProducer_,thePVs);
80  const VertexCollection vertCollection=*(thePVs.product());
81  Vertex thePV;
82  if(vertCollection.size()) thePV=*(vertCollection.begin());
83  else{
84  Vertex::Error SimPVError;
85  SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_;
86  SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_;
87  SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_;
88  Vertex::Point SimPVPoint(CLHEP::RandGauss::shoot(0.,smearedPVsigmaX_),
89  CLHEP::RandGauss::shoot(0.,smearedPVsigmaY_),
90  CLHEP::RandGauss::shoot(0.,smearedPVsigmaZ_));
91  thePV=Vertex(SimPVPoint,SimPVError,1,1,1);
92  }
93 
94  edm::Handle<CaloTauTagInfoCollection> theCaloTauTagInfoCollection;
95  iEvent.getByLabel(CaloRecoTauTagInfoProducer_,theCaloTauTagInfoCollection);
96  int iinfo=0;
97  for(CaloTauTagInfoCollection::const_iterator i_info=theCaloTauTagInfoCollection->begin();i_info!=theCaloTauTagInfoCollection->end();i_info++) {
98  if(i_info->jetRef()->pt()>JetMinPt_){
99  CaloTau myCaloTau=CaloRecoTauAlgo_->buildCaloTau(iEvent,iSetup,Ref<CaloTauTagInfoCollection>(theCaloTauTagInfoCollection,iinfo),thePV);
100  resultCaloTau->push_back(myCaloTau);
101  }
102  ++iinfo;
103  }
104  for(unsigned int i =0;i<CaloRecoTauAlgo_->mySelectedDetId_.size();i++)
105  selectedDetIds->push_back(CaloRecoTauAlgo_->mySelectedDetId_[i]);
106 
107 
108  iEvent.put(resultCaloTau);
109  iEvent.put(selectedDetIds);
110 }
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > mySelectedDetId_
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
CaloRecoTauAlgorithm * CaloRecoTauAlgo_
std::vector< CaloTau > CaloTauCollection
collection of CaloTau objects
Definition: CaloTauFwd.h:9
reco::CaloTau buildCaloTau(edm::Event &, const edm::EventSetup &, const reco::CaloTauTagInfoRef &, const reco::Vertex &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
edm::InputTag CaloRecoTauTagInfoProducer_
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void setMagneticField(const MagneticField *)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
void setTransientTrackBuilder(const TransientTrackBuilder *)

Member Data Documentation

CaloRecoTauAlgorithm* CaloRecoTauProducer::CaloRecoTauAlgo_
private

Definition at line 46 of file CaloRecoTauProducer.cc.

edm::InputTag CaloRecoTauProducer::CaloRecoTauTagInfoProducer_
private

Definition at line 40 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::JetMinPt_
private

Definition at line 45 of file CaloRecoTauProducer.cc.

edm::InputTag CaloRecoTauProducer::PVProducer_
private

Definition at line 41 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaX_
private

Definition at line 42 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaY_
private

Definition at line 43 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaZ_
private

Definition at line 44 of file CaloRecoTauProducer.cc.