CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator > Class Template Reference
Inheritance diagram for TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &)
 
double discriminate (const TauRef &)
 
 TauDiscriminationAgainstCaloMuon (const edm::ParameterSet &)
 
 ~TauDiscriminationAgainstCaloMuon ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual void endEvent (edm::Event &evt)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
virtual ~TauDiscriminationProducerBase ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

const CaloGeometrycaloGeometry_
 
double drEcal_
 
double drHcal_
 
edm::Handle< EcalRecHitCollectionebRecHits_
 
edm::Handle< EcalRecHitCollectioneeRecHits_
 
GlobalPoint eventVertexPosition_
 
edm::Handle< HBHERecHitCollectionhbheRecHits_
 
TauLeadTrackExtractor< TauType > leadTrackExtractor_
 
double maxEnEcal_
 
double maxEnHcal_
 
double maxEnToTrackRatio_
 
double minLeadTrackPt_
 
double minLeadTrackPtFraction_
 
edm::InputTag srcEcalRecHitsBarrel_
 
edm::InputTag srcEcalRecHitsEndcap_
 
edm::InputTag srcHcalRecHits_
 
edm::InputTag srcVertex_
 
const TransientTrackBuildertrackBuilder_
 

Additional Inherited Members

- 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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
double prediscriminantFailValue_
 
edm::InputTag TauProducer_
 

Detailed Description

template<class TauType, class TauDiscriminator>
class TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >

Definition at line 88 of file TauDiscriminationAgainstCaloMuon.cc.

Member Typedef Documentation

template<class TauType , class TauDiscriminator >
typedef std::vector<TauType> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::TauCollection

Definition at line 92 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
typedef edm::Ref<TauCollection> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::TauRef

Definition at line 93 of file TauDiscriminationAgainstCaloMuon.cc.

Constructor & Destructor Documentation

template<class TauType , class TauDiscriminator >
TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::TauDiscriminationAgainstCaloMuon ( const edm::ParameterSet cfg)
explicit

Definition at line 132 of file TauDiscriminationAgainstCaloMuon.cc.

References TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::drEcal_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::drHcal_, edm::ParameterSet::getParameter(), TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnEcal_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnHcal_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnToTrackRatio_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::minLeadTrackPt_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::minLeadTrackPtFraction_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcEcalRecHitsBarrel_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcEcalRecHitsEndcap_, TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcHcalRecHits_, and TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcVertex_.

134 {
135  srcEcalRecHitsBarrel_ = cfg.getParameter<edm::InputTag>("srcEcalRecHitsBarrel");
136  srcEcalRecHitsEndcap_ = cfg.getParameter<edm::InputTag>("srcEcalRecHitsEndcap");
137  srcHcalRecHits_ = cfg.getParameter<edm::InputTag>("srcHcalRecHits");
138 
139  srcVertex_ = cfg.getParameter<edm::InputTag>("srcVertex");
140 
141  minLeadTrackPt_ = cfg.getParameter<double>("minLeadTrackPt");
142  minLeadTrackPtFraction_ = cfg.getParameter<double>("minLeadTrackPtFraction");
143 
144  drEcal_ = cfg.getParameter<double>("dRecal");
145  drHcal_ = cfg.getParameter<double>("dRhcal");
146 
147  maxEnEcal_ = cfg.getParameter<double>("maxEnEcal");
148  maxEnHcal_ = cfg.getParameter<double>("maxEnHcal");
149 
150  maxEnToTrackRatio_ = cfg.getParameter<double>("maxEnToTrackRatio");
151 }
T getParameter(std::string const &) const
template<class TauType , class TauDiscriminator >
TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::~TauDiscriminationAgainstCaloMuon ( )
inline

Definition at line 96 of file TauDiscriminationAgainstCaloMuon.cc.

96 {}

Member Function Documentation

template<class TauType , class TauDiscriminator >
void TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::beginEvent ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
virtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 154 of file TauDiscriminationAgainstCaloMuon.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), edm::ESHandle< class >::product(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

155 {
159 
160  edm::ESHandle<TransientTrackBuilder> trackBuilderHandle;
161  evtSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilderHandle);
162  trackBuilder_ = trackBuilderHandle.product();
163  if ( !trackBuilder_ ) {
164  edm::LogError ("TauDiscriminationAgainstCaloMuon::discriminate")
165  << " Failed to access TransientTrackBuilder !!";
166  }
167 
168  edm::ESHandle<CaloGeometry> caloGeometryHandle;
169  evtSetup.get<CaloGeometryRecord>().get(caloGeometryHandle);
170  caloGeometry_ = caloGeometryHandle.product();
171  if ( !caloGeometry_ ) {
172  edm::LogError ("TauDiscriminationAgainstCaloMuon::discriminate")
173  << " Failed to access CaloGeometry !!";
174  }
175 
177  evt.getByLabel(srcVertex_, vertices);
178  eventVertexPosition_ = GlobalPoint(0., 0., 0.);
179  if ( vertices->size() >= 1 ) {
180  const reco::Vertex& thePrimaryEventVertex = (*vertices->begin());
181  eventVertexPosition_ = GlobalPoint(thePrimaryEventVertex.x(), thePrimaryEventVertex.y(), thePrimaryEventVertex.z());
182  }
183 }
edm::Handle< HBHERecHitCollection > hbheRecHits_
double y() const
y coordinate
Definition: Vertex.h:97
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double z() const
y coordinate
Definition: Vertex.h:99
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double x() const
x coordinate
Definition: Vertex.h:95
edm::Handle< EcalRecHitCollection > eeRecHits_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::Handle< EcalRecHitCollection > ebRecHits_
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::discriminate ( const TauRef tau)
virtual

Implements TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 275 of file TauDiscriminationAgainstCaloMuon.cc.

References compEcalEnergySum(), compHcalEnergySum(), DetId::Ecal, EcalBarrel, EcalEndcap, DetId::Hcal, HcalBarrel, HcalEndcap, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), and edm::Ref< C, T, F >::isTransient().

276 {
277  if ( !(trackBuilder_ && caloGeometry_) ) return 0.;
278 
283 
284  TrackRef leadTrackRef = leadTrackExtractor_.getLeadTrack(*tau);
285 
286  if ( (leadTrackRef.isAvailable() || leadTrackRef.isTransient()) && leadTrackRef.isNonnull() ) {
287  double leadTrackPt = leadTrackRef->pt();
288  double trackPtSum = leadTrackExtractor_.getTrackPtSum(*tau);
289 
290  double leadTrackPtFraction = ( trackPtSum > 0. ) ? (leadTrackPt/trackPtSum) : -1.;
291 
292  if ( leadTrackPt > minLeadTrackPt_ && leadTrackPtFraction > minLeadTrackPtFraction_ ) {
293  reco::TransientTrack transientTrack = trackBuilder_->build(leadTrackRef);
294 
295  double ebEnergySum = compEcalEnergySum(*ebRecHits_, ebGeometry, transientTrack, drEcal_, eventVertexPosition_);
296  double eeEnergySum = compEcalEnergySum(*eeRecHits_, eeGeometry, transientTrack, drEcal_, eventVertexPosition_);
297  double ecalEnergySum = ebEnergySum + eeEnergySum;
298 
299  double hbheEnergySum = compHcalEnergySum(*hbheRecHits_, hbGeometry, heGeometry, transientTrack, drHcal_, eventVertexPosition_);
300 
301  double caloEnergySum = ecalEnergySum + hbheEnergySum;
302 
303  if ( ecalEnergySum < maxEnEcal_ &&
304  hbheEnergySum < maxEnHcal_ &&
305  caloEnergySum < (maxEnToTrackRatio_*leadTrackPt) ) return 0.;
306  }
307  }
308 
309  return 1.;
310 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
TauLeadTrackExtractor< TauType > leadTrackExtractor_
edm::Handle< HBHERecHitCollection > hbheRecHits_
reco::TransientTrack build(const reco::Track *p) const
bool isAvailable() const
Definition: Ref.h:276
double compHcalEnergySum(const HBHERecHitCollection &hcalRecHits, const CaloSubdetectorGeometry *hbGeometry, const CaloSubdetectorGeometry *heGeometry, const reco::TransientTrack &transientTrack, double dR, const GlobalPoint &eventVertexPosition)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
double compEcalEnergySum(const EcalRecHitCollection &ecalRecHits, const CaloSubdetectorGeometry *detGeometry, const reco::TransientTrack &transientTrack, double dR, const GlobalPoint &eventVertexPosition)
edm::Handle< EcalRecHitCollection > eeRecHits_
double getTrackPtSum(const T &tau) const
reco::TrackRef getLeadTrack(const T &tau) const
edm::Handle< EcalRecHitCollection > ebRecHits_
bool isTransient() const
Checks if this ref is transient (i.e. not persistable).
Definition: Ref.h:279

Member Data Documentation

template<class TauType , class TauDiscriminator >
const CaloGeometry* TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::caloGeometry_
private

Definition at line 115 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::drEcal_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::drHcal_
private
template<class TauType , class TauDiscriminator >
edm::Handle<EcalRecHitCollection> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::ebRecHits_
private

Definition at line 105 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
edm::Handle<EcalRecHitCollection> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::eeRecHits_
private

Definition at line 107 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
GlobalPoint TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::eventVertexPosition_
private

Definition at line 112 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
edm::Handle<HBHERecHitCollection> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::hbheRecHits_
private

Definition at line 109 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
TauLeadTrackExtractor<TauType> TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::leadTrackExtractor_
private

Definition at line 117 of file TauDiscriminationAgainstCaloMuon.cc.

template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnEcal_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnHcal_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::maxEnToTrackRatio_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::minLeadTrackPt_
private
template<class TauType , class TauDiscriminator >
double TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::minLeadTrackPtFraction_
private
template<class TauType , class TauDiscriminator >
edm::InputTag TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcEcalRecHitsBarrel_
private
template<class TauType , class TauDiscriminator >
edm::InputTag TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcEcalRecHitsEndcap_
private
template<class TauType , class TauDiscriminator >
edm::InputTag TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcHcalRecHits_
private
template<class TauType , class TauDiscriminator >
edm::InputTag TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::srcVertex_
private
template<class TauType , class TauDiscriminator >
const TransientTrackBuilder* TauDiscriminationAgainstCaloMuon< TauType, TauDiscriminator >::trackBuilder_
private

Definition at line 114 of file TauDiscriminationAgainstCaloMuon.cc.