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 &)
 
 ~PFRecoTauProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string Algorithm_
 
edm::InputTag ElectronPreIDProducer_
 
double JetMinPt_
 
PFRecoTauAlgorithmBasePFRecoTauAlgo_
 
edm::InputTag PFTauTagInfoProducer_
 
edm::InputTag PVProducer_
 
double smearedPVsigmaX_
 
double smearedPVsigmaY_
 
double smearedPVsigmaZ_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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 52 of file PFRecoTauProducer.cc.

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

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

Definition at line 77 of file PFRecoTauProducer.cc.

77  {
78  delete PFRecoTauAlgo_;
79 }
PFRecoTauAlgorithmBase * PFRecoTauAlgo_

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 81 of file PFRecoTauProducer.cc.

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

81  {
82  auto_ptr<PFTauCollection> resultPFTau(new PFTauCollection);
83 
84  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
85  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",myTransientTrackBuilder);
86  PFRecoTauAlgo_->setTransientTrackBuilder(myTransientTrackBuilder.product());
87 
88  //edm::ESHandle<MagneticField> myMF;
89  //iSetup.get<IdealMagneticFieldRecord>().get(myMF);
90  //PFRecoTauAlgo_->setMagneticField(myMF.product());
91 
92  // Electron PreID tracks: Temporary until integrated to PFCandidate
93  /*
94  edm::Handle<PFRecTrackCollection> myPFelecTk;
95  iEvent.getByLabel(ElectronPreIDProducer_,myPFelecTk);
96  const PFRecTrackCollection theElecTkCollection=*(myPFelecTk.product());
97  */
98  // query a rec/sim PV
100  iEvent.getByLabel(PVProducer_,thePVs);
101  const VertexCollection vertCollection=*(thePVs.product());
102  Vertex thePV;
103  if(vertCollection.size()) thePV=*(vertCollection.begin());
104  else{
105  Vertex::Error SimPVError;
106  SimPVError(0,0)=smearedPVsigmaX_*smearedPVsigmaX_;
107  SimPVError(1,1)=smearedPVsigmaY_*smearedPVsigmaY_;
108  SimPVError(2,2)=smearedPVsigmaZ_*smearedPVsigmaZ_;
109  Vertex::Point SimPVPoint(CLHEP::RandGauss::shoot(0.,smearedPVsigmaX_),
110  CLHEP::RandGauss::shoot(0.,smearedPVsigmaY_),
111  CLHEP::RandGauss::shoot(0.,smearedPVsigmaZ_));
112  thePV=Vertex(SimPVPoint,SimPVError,1,1,1);
113  }
114 
115  edm::Handle<PFTauTagInfoCollection> thePFTauTagInfoCollection;
116  iEvent.getByLabel(PFTauTagInfoProducer_,thePFTauTagInfoCollection);
117  int iinfo=0;
118  for(PFTauTagInfoCollection::const_iterator i_info=thePFTauTagInfoCollection->begin();i_info!=thePFTauTagInfoCollection->end();i_info++) {
119  if((*i_info).pfjetRef()->pt()>JetMinPt_){
120  // PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV,theElecTkCollection);
121  PFTau myPFTau=PFRecoTauAlgo_->buildPFTau(Ref<PFTauTagInfoCollection>(thePFTauTagInfoCollection,iinfo),thePV);
122  resultPFTau->push_back(myPFTau);
123  }
124  ++iinfo;
125  }
126  iEvent.put(resultPFTau);
127 }
edm::InputTag PFTauTagInfoProducer_
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
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:44
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:94
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
PFRecoTauAlgorithmBase * PFRecoTauAlgo_
edm::InputTag 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::InputTag PFRecoTauProducer::PFTauTagInfoProducer_
private

Definition at line 40 of file PFRecoTauProducer.cc.

edm::InputTag 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.