CMS 3D CMS Logo

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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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

Definition at line 64 of file CaloRecoTauProducer.cc.

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

64  {
65 
66  auto resultCaloTau = std::make_unique<CaloTauCollection>();
67  auto selectedDetIds = std::make_unique<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(std::move(resultCaloTau));
109  iEvent.put(std::move(selectedDetIds));
110 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
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_
reco::CaloTau buildCaloTau(edm::Event &, const edm::EventSetup &, const reco::CaloTauTagInfoRef &, const reco::Vertex &)
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:413
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
def move(src, dest)
Definition: eostools.py:510
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.