test
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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CaloRecoTauProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~CaloRecoTauProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 
)
overridevirtual

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:43
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:121
edm::InputTag CaloRecoTauTagInfoProducer_
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
void setMagneticField(const MagneticField *)
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
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.