CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFRecoTauProducer Class Reference
Inheritance diagram for PFRecoTauProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFRecoTauProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFRecoTauProducer () 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

std::string Algorithm_
 
edm::InputTag ElectronPreIDProducer_
 
double JetMinPt_
 
PFRecoTauAlgorithmBasePFRecoTauAlgo_
 
edm::EDGetTokenT< PFTauTagInfoCollectionPFTauTagInfoProducer_
 
edm::EDGetTokenT< VertexCollectionPVProducer_
 
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 PFRecoTauProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 55 of file PFRecoTauProducer.cc.

References Exception, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

55  {
56  PFTauTagInfoProducer_ = consumes<PFTauTagInfoCollection>(iConfig.getParameter<edm::InputTag>("PFTauTagInfoProducer") );
57  ElectronPreIDProducer_ = iConfig.getParameter<edm::InputTag>("ElectronPreIDProducer");
58  PVProducer_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("PVProducer") );
59  Algorithm_ = iConfig.getParameter<std::string>("Algorithm");
60  smearedPVsigmaX_ = iConfig.getParameter<double>("smearedPVsigmaX");
61  smearedPVsigmaY_ = iConfig.getParameter<double>("smearedPVsigmaY");
62  smearedPVsigmaZ_ = iConfig.getParameter<double>("smearedPVsigmaZ");
63  JetMinPt_ = iConfig.getParameter<double>("JetPtMin");
64 
65  if(Algorithm_ =="ConeBased") {
67  }
68  else if(Algorithm_ =="HPS") {
70  }
71  else { //Add inside out Algorithm here
72 
73  //If no Algorithm found throw exception
74  throw cms::Exception("") << "Unknown Algorithkm" << std::endl;
75  }
76 
77 
78  produces<PFTauCollection>();
79 }
T getParameter(std::string const &) const
edm::InputTag ElectronPreIDProducer_
PFRecoTauAlgorithmBase * PFRecoTauAlgo_
edm::EDGetTokenT< PFTauTagInfoCollection > PFTauTagInfoProducer_
edm::EDGetTokenT< VertexCollection > PVProducer_
PFRecoTauProducer::~PFRecoTauProducer ( )
override

Definition at line 80 of file PFRecoTauProducer.cc.

80  {
81  delete PFRecoTauAlgo_;
82 }
PFRecoTauAlgorithmBase * PFRecoTauAlgo_

Member Function Documentation

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

Definition at line 133 of file PFRecoTauProducer.cc.

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

133  {
134  // pfRecoTauProducer
136  desc.add<double>("Rphi", 2.0);
137  desc.add<double>("LeadTrack_minPt", 0.0);
138  desc.add<edm::InputTag>("PVProducer", edm::InputTag("offlinePrimaryVertices"));
139  desc.add<std::string>("ECALSignalConeSizeFormula", "0.15");
140  desc.add<std::string>("TrackerIsolConeMetric", "DR");
141  desc.add<std::string>("TrackerSignalConeMetric", "DR");
142  desc.add<double>("EcalStripSumE_deltaPhiOverQ_minValue", -0.1);
143  desc.add<double>("smearedPVsigmaX", 0.0015);
144  desc.add<double>("smearedPVsigmaY", 0.0015);
145  desc.add<std::string>("MatchingConeMetric", "DR");
146  desc.add<std::string>("TrackerSignalConeSizeFormula", "0.07");
147  desc.add<std::string>("MatchingConeSizeFormula", "0.1");
148  desc.add<double>("TrackerIsolConeSize_min", 0.0);
149  desc.add<double>("MatchingConeSize_min", 0.0);
150  desc.add<edm::InputTag>("ElectronPreIDProducer", edm::InputTag("elecpreid"));
151  desc.add<double>("ChargedHadrCandLeadChargedHadrCand_tksmaxDZ", 1.0);
152  desc.add<double>("TrackerIsolConeSize_max", 0.6);
153  desc.add<double>("TrackerSignalConeSize_max", 0.07);
154  desc.add<std::string>("HCALIsolConeMetric", "DR");
155  desc.add<bool>("AddEllipseGammas", false);
156  desc.add<double>("maximumForElectrionPreIDOutput", -0.1);
157  desc.add<double>("TrackerSignalConeSize_min", 0.0);
158  desc.add<double>("JetPtMin", 0.0);
159  desc.add<std::string>("HCALIsolConeSizeFormula", "0.50");
160  desc.add<double>("AreaMetric_recoElements_maxabsEta", 2.5);
161  desc.add<double>("HCALIsolConeSize_max", 0.6);
162  desc.add<unsigned int>("Track_IsolAnnulus_minNhits", 3);
163  desc.add<std::string>("HCALSignalConeMetric", "DR");
164  desc.add<double>("ElecPreIDLeadTkMatch_maxDR", 0.01);
165  desc.add<edm::InputTag>("PFTauTagInfoProducer", edm::InputTag("pfRecoTauTagInfoProducer"));
166  desc.add<std::string>("ECALIsolConeMetric", "DR");
167  desc.add<std::string>("ECALIsolConeSizeFormula", "0.50");
168  desc.add<bool>("UseChargedHadrCandLeadChargedHadrCand_tksDZconstraint", true);
169  desc.add<std::string>("Algorithm", "ConeBased");
170  desc.add<double>("ECALIsolConeSize_max", 0.6);
171  desc.add<std::string>("ECALSignalConeMetric", "DR");
172  desc.add<double>("EcalStripSumE_deltaPhiOverQ_maxValue", 0.5);
173  desc.add<double>("HCALSignalConeSize_max", 0.6);
174  desc.add<double>("ECALSignalConeSize_min", 0.0);
175  desc.add<double>("EcalStripSumE_minClusEnergy", 0.1);
176  desc.add<double>("EcalStripSumE_deltaEta", 0.03);
177  desc.add<std::string>("TrackerIsolConeSizeFormula", "0.50");
178  desc.add<double>("LeadPFCand_minPt", 5.0);
179  desc.add<double>("HCALSignalConeSize_min", 0.0);
180  desc.add<double>("ECALSignalConeSize_max", 0.6);
181  desc.add<std::string>("HCALSignalConeSizeFormula", "0.10");
182  desc.add<bool>("putNeutralHadronsInP4", false);
183  desc.add<double>("TrackLeadTrack_maxDZ", 1.0);
184  desc.add<unsigned int>("ChargedHadrCand_IsolAnnulus_minNhits", 0);
185  desc.add<double>("ECALIsolConeSize_min", 0.0);
186  desc.add<bool>("UseTrackLeadTrackDZconstraint", true);
187  desc.add<double>("MaxEtInEllipse", 2.0);
188  desc.add<std::string>("DataType", "AOD");
189  desc.add<double>("smearedPVsigmaZ", 0.005);
190  desc.add<double>("MatchingConeSize_max", 0.6);
191  desc.add<double>("HCALIsolConeSize_min", 0.0);
192  descriptions.add("pfRecoTauProducerDef", desc);
193 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void PFRecoTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 84 of file PFRecoTauProducer.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), eostools::move(), edm::Handle< T >::product(), and edm::Event::put().

84  {
85  auto resultPFTau = std::make_unique<PFTauCollection>();
86 
87  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
88  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder);
89  PFRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product());
90 
91  //edm::ESHandle<MagneticField> myMF;
92  //iSetup.get<IdealMagneticFieldRecord>().get(myMF);
93  //PFRecoTauAlgo_->setMagneticField(myMF.product());
94 
95  // Electron PreID tracks: Temporary until integrated to PFCandidate
96  /*
97  edm::Handle<PFRecTrackCollection> myPFelecTk;
98  iEvent.getByLabel(ElectronPreIDProducer_,myPFelecTk);
99  const PFRecTrackCollection theElecTkCollection=*(myPFelecTk.product());
100  */
101  // query a rec/sim PV
103  iEvent.getByToken(PVProducer_,thePVs);
104  const VertexCollection vertCollection=*(thePVs.product());
105  Vertex thePV;
106  if(!vertCollection.empty()) thePV=*(vertCollection.begin());
107  else{
108  Vertex::Error SimPVError;
109  SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_;
110  SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_;
111  SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_;
112  Vertex::Point SimPVPoint(CLHEP::RandGauss::shoot(0.,smearedPVsigmaX_),
113  CLHEP::RandGauss::shoot(0.,smearedPVsigmaY_),
114  CLHEP::RandGauss::shoot(0.,smearedPVsigmaZ_));
115  thePV=Vertex(SimPVPoint,SimPVError,1,1,1);
116  }
117 
118  edm::Handle<PFTauTagInfoCollection> thePFTauTagInfoCollection;
119  iEvent.getByToken(PFTauTagInfoProducer_,thePFTauTagInfoCollection);
120  int iinfo=0;
121  for(PFTauTagInfoCollection::const_iterator i_info=thePFTauTagInfoCollection->begin();i_info!=thePFTauTagInfoCollection->end();i_info++) {
122  if((*i_info).pfjetRef()->pt()>JetMinPt_){
123  // PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV,theElecTkCollection);
124  PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV);
125  resultPFTau->push_back(myPFTau);
126  }
127  ++iinfo;
128  }
129  iEvent.put(std::move(resultPFTau));
130 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void setTransientTrackBuilder(const TransientTrackBuilder *)
virtual reco::PFTau buildPFTau(const reco::PFTauTagInfoRef &, const reco::Vertex &)=0
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
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
T const * product() const
Definition: Handle.h:74
PFRecoTauAlgorithmBase * PFRecoTauAlgo_
T get() const
Definition: EventSetup.h:71
edm::EDGetTokenT< PFTauTagInfoCollection > PFTauTagInfoProducer_
edm::EDGetTokenT< VertexCollection > PVProducer_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::string PFRecoTauProducer::Algorithm_
private

Definition at line 47 of file PFRecoTauProducer.cc.

edm::InputTag PFRecoTauProducer::ElectronPreIDProducer_
private

Definition at line 45 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::JetMinPt_
private

Definition at line 51 of file PFRecoTauProducer.cc.

PFRecoTauAlgorithmBase* PFRecoTauProducer::PFRecoTauAlgo_
private

Definition at line 52 of file PFRecoTauProducer.cc.

edm::EDGetTokenT<PFTauTagInfoCollection> PFRecoTauProducer::PFTauTagInfoProducer_
private

Definition at line 44 of file PFRecoTauProducer.cc.

edm::EDGetTokenT<VertexCollection> PFRecoTauProducer::PVProducer_
private

Definition at line 46 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaX_
private

Definition at line 48 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaY_
private

Definition at line 49 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaZ_
private

Definition at line 50 of file PFRecoTauProducer.cc.