CMS 3D CMS Logo

List of all members | Public Member Functions | Static 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)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~CaloRecoTauProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 37 of file CaloRecoTauProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 53 of file CaloRecoTauProducer.cc.

References edm::ParameterSet::getParameter().

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

Definition at line 64 of file CaloRecoTauProducer.cc.

64  {
65  delete CaloRecoTauAlgo_;
66 }
CaloRecoTauAlgorithm * CaloRecoTauAlgo_

Member Function Documentation

void CaloRecoTauProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 117 of file CaloRecoTauProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

117  {
118  // caloRecoTauProducer
120  desc.add<double>("LeadTrack_minPt", 0.5);
121  desc.add<double>("MatchingConeSize_min", 0.0);
122  desc.add<std::string>("ECALSignalConeSizeFormula", "0.15");
123  desc.add<std::string>("TrackerIsolConeMetric", "DR");
124  desc.add<std::string>("TrackerSignalConeMetric", "DR");
125  desc.add<edm::InputTag>("EBRecHitsSource", edm::InputTag("ecalRecHit","EcalRecHitsEB"));
126  desc.add<double>("IsolationTrack_minPt", 1.0);
127  desc.add<double>("ECALSignalConeSize_min", 0.0);
128  desc.add<double>("ECALRecHit_minEt", 0.5);
129  desc.add<std::string>("MatchingConeMetric", "DR");
130  desc.add<std::string>("TrackerSignalConeSizeFormula", "0.07");
131  desc.add<std::string>("MatchingConeSizeFormula", "0.10");
132  desc.add<double>("TrackerIsolConeSize_min", 0.0);
133  desc.add<double>("TrackerIsolConeSize_max", 0.6);
134  desc.add<double>("TrackerSignalConeSize_max", 0.6);
135  desc.add<edm::InputTag>("PVProducer", edm::InputTag("offlinePrimaryVertices"));
136  desc.add<edm::InputTag>("ESRecHitsSource", edm::InputTag("ecalPreshowerRecHit","EcalRecHitsES"));
137  desc.add<double>("TrackerSignalConeSize_min", 0.0);
138  desc.add<double>("ECALIsolConeSize_max", 0.6);
139  desc.add<double>("AreaMetric_recoElements_maxabsEta", 2.5);
140  desc.add<std::string>("ECALIsolConeMetric", "DR");
141  desc.add<std::string>("ECALIsolConeSizeFormula", "0.50");
142  desc.add<double>("JetPtMin", 0.0);
143  desc.add<edm::InputTag>("EERecHitsSource", edm::InputTag("ecalRecHit","EcalRecHitsEE"));
144  desc.add<unsigned int>("IsolationTrack_minHits", 0);
145  desc.add<std::string>("ECALSignalConeMetric", "DR");
146  desc.add<double>("TrackLeadTrack_maxDZ", 1.0);
147  desc.add<double>("Track_minPt", 0.5);
148  desc.add<std::string>("TrackerIsolConeSizeFormula", "0.50");
149  desc.add<double>("ECALSignalConeSize_max", 0.6);
150  desc.add<double>("ECALIsolConeSize_min", 0.0);
151  desc.add<bool>("UseTrackLeadTrackDZconstraint", true);
152  desc.add<double>("smearedPVsigmaY", 0.0015);
153  desc.add<double>("smearedPVsigmaX", 0.0015);
154  desc.add<double>("smearedPVsigmaZ", 0.005);
155  desc.add<edm::InputTag>("CaloRecoTauTagInfoProducer", edm::InputTag("caloRecoTauTagInfoProducer"));
156  desc.add<double>("MatchingConeSize_max", 0.6);
157  descriptions.add("caloRecoTauProducer", desc);
158 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CaloRecoTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 68 of file CaloRecoTauProducer.cc.

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

68  {
69 
70  auto resultCaloTau = std::make_unique<CaloTauCollection>();
71  auto selectedDetIds = std::make_unique<DetIdCollection>();
72 
73  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
74  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder);
75  CaloRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product());
76 
78  iSetup.get<IdealMagneticFieldRecord>().get(myMF);
80 
81  // query a rec/sim PV
83  iEvent.getByLabel(PVProducer_,thePVs);
84  const VertexCollection vertCollection=*(thePVs.product());
85  Vertex thePV;
86  if(!vertCollection.empty()) thePV=*(vertCollection.begin());
87  else{
88  Vertex::Error SimPVError;
89  SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_;
90  SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_;
91  SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_;
92  Vertex::Point SimPVPoint(CLHEP::RandGauss::shoot(0.,smearedPVsigmaX_),
93  CLHEP::RandGauss::shoot(0.,smearedPVsigmaY_),
94  CLHEP::RandGauss::shoot(0.,smearedPVsigmaZ_));
95  thePV=Vertex(SimPVPoint,SimPVError,1,1,1);
96  }
97 
98  edm::Handle<CaloTauTagInfoCollection> theCaloTauTagInfoCollection;
99  iEvent.getByLabel(CaloRecoTauTagInfoProducer_,theCaloTauTagInfoCollection);
100  int iinfo=0;
101  for(CaloTauTagInfoCollection::const_iterator i_info=theCaloTauTagInfoCollection->begin();i_info!=theCaloTauTagInfoCollection->end();i_info++) {
102  if(i_info->jetRef()->pt()>JetMinPt_){
103  CaloTau myCaloTau=CaloRecoTauAlgo_->buildCaloTau(iEvent,iSetup,Ref<CaloTauTagInfoCollection>(theCaloTauTagInfoCollection,iinfo),thePV);
104  resultCaloTau->push_back(myCaloTau);
105  }
106  ++iinfo;
107  }
108  for(unsigned int i =0;i<CaloRecoTauAlgo_->mySelectedDetId_.size();i++)
109  selectedDetIds->push_back(CaloRecoTauAlgo_->mySelectedDetId_[i]);
110 
111 
112  iEvent.put(std::move(resultCaloTau));
113  iEvent.put(std::move(selectedDetIds));
114 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
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:480
void setMagneticField(const MagneticField *)
T const * product() const
Definition: Handle.h:74
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void setTransientTrackBuilder(const TransientTrackBuilder *)

Member Data Documentation

CaloRecoTauAlgorithm* CaloRecoTauProducer::CaloRecoTauAlgo_
private

Definition at line 50 of file CaloRecoTauProducer.cc.

edm::InputTag CaloRecoTauProducer::CaloRecoTauTagInfoProducer_
private

Definition at line 44 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::JetMinPt_
private

Definition at line 49 of file CaloRecoTauProducer.cc.

edm::InputTag CaloRecoTauProducer::PVProducer_
private

Definition at line 45 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaX_
private

Definition at line 46 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaY_
private

Definition at line 47 of file CaloRecoTauProducer.cc.

double CaloRecoTauProducer::smearedPVsigmaZ_
private

Definition at line 48 of file CaloRecoTauProducer.cc.