CMS 3D CMS Logo

List of all members | 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)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFRecoTauProducer ()
 
- 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

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
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 PFRecoTauProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 51 of file PFRecoTauProducer.cc.

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

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

Definition at line 76 of file PFRecoTauProducer.cc.

76  {
77  delete PFRecoTauAlgo_;
78 }
PFRecoTauAlgorithmBase * PFRecoTauAlgo_

Member Function Documentation

void PFRecoTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 80 of file PFRecoTauProducer.cc.

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

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

Member Data Documentation

std::string PFRecoTauProducer::Algorithm_
private

Definition at line 43 of file PFRecoTauProducer.cc.

edm::InputTag PFRecoTauProducer::ElectronPreIDProducer_
private

Definition at line 41 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::JetMinPt_
private

Definition at line 47 of file PFRecoTauProducer.cc.

PFRecoTauAlgorithmBase* PFRecoTauProducer::PFRecoTauAlgo_
private

Definition at line 48 of file PFRecoTauProducer.cc.

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

Definition at line 40 of file PFRecoTauProducer.cc.

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

Definition at line 42 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaX_
private

Definition at line 44 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaY_
private

Definition at line 45 of file PFRecoTauProducer.cc.

double PFRecoTauProducer::smearedPVsigmaZ_
private

Definition at line 46 of file PFRecoTauProducer.cc.