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
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
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string Algorithm_
 
edm::InputTag ElectronPreIDProducer_
 
double JetMinPt_
 
PFRecoTauAlgorithmBasePFRecoTauAlgo_
 
edm::EDGetTokenT
< PFTauTagInfoCollection
PFTauTagInfoProducer_
 
edm::EDGetTokenT
< VertexCollection
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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 edm::hlt::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

Implements edm::EDProducer.

Definition at line 80 of file PFRecoTauProducer.cc.

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

80  {
81  auto_ptr<PFTauCollection> resultPFTau(new 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(resultPFTau);
126 }
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
PFRecoTauAlgorithmBase * PFRecoTauAlgo_
edm::EDGetTokenT< PFTauTagInfoCollection > PFTauTagInfoProducer_
edm::EDGetTokenT< VertexCollection > PVProducer_

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.