test
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 Member Functions | Private Attributes
PFRecoTauDiscriminationByFlightPathSignificance Class Reference
Inheritance diagram for PFRecoTauDiscriminationByFlightPathSignificance:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const reco::PFTauRef &) override
 
 PFRecoTauDiscriminationByFlightPathSignificance (const ParameterSet &iConfig)
 
 ~PFRecoTauDiscriminationByFlightPathSignificance ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau)=0
 
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 ()
 
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 Member Functions

double threeProngFlightPathSig (const PFTauRef &)
 
double vertexSignificance (reco::Vertex &, reco::Vertex &, GlobalVector &)
 

Private Attributes

bool booleanOutput
 
double flightPathSig
 
const TransientTrackBuildertransientTrackBuilder
 
reco::tau::RecoTauVertexAssociatorvertexAssociator_
 
bool withPVError
 

Additional Inherited Members

- 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
 
- 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)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 24 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByFlightPathSignificance::PFRecoTauDiscriminationByFlightPathSignificance ( const ParameterSet iConfig)
inlineexplicit

Definition at line 27 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::ParameterSet::getParameter().

29  flightPathSig = iConfig.getParameter<double>("flightPathSig");
30  withPVError = iConfig.getParameter<bool>("UsePVerror");
31  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
32  // edm::ConsumesCollector iC(consumesCollector());
34  }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationByFlightPathSignificance::~PFRecoTauDiscriminationByFlightPathSignificance ( )
inline

Definition at line 36 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

36 {}

Member Function Documentation

void PFRecoTauDiscriminationByFlightPathSignificance::beginEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 54 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::EventSetup::get(), and edm::ESHandle< class >::product().

55  {
56 
57  vertexAssociator_->setEvent(iEvent);
58 
59  // Transient Tracks
61  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
62  transientTrackBuilder = builder.product();
63 
64 }
void setEvent(const edm::Event &evt)
Load the vertices from the event.
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
double PFRecoTauDiscriminationByFlightPathSignificance::discriminate ( const reco::PFTauRef tau)
override
double PFRecoTauDiscriminationByFlightPathSignificance::threeProngFlightPathSig ( const PFTauRef tau)
private

Definition at line 72 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), TransientVertex::isValid(), HWWFunctions::primaryVertex(), reco::PFCandidate::trackRef(), and KalmanVertexFitter::vertex().

73  {
74  double flightPathSignificance = 0;
75 
77 
78  if (primaryVertex.isNull()) {
79  edm::LogError("FlightPathSignficance") << "Could not get vertex associated"
80  << " to tau, returning -999!" << std::endl;
81  return -999;
82  }
83 
84  //Secondary vertex
85  const vector<PFCandidatePtr>& pfSignalCandidates = tau->signalPFChargedHadrCands();
86  vector<TransientTrack> transientTracks;
87  vector<PFCandidatePtr>::const_iterator iTrack;
88  for(iTrack = pfSignalCandidates.begin(); iTrack!= pfSignalCandidates.end(); iTrack++){
89  const PFCandidate& pfCand = *(iTrack->get());
90  if(pfCand.trackRef().isNonnull()){
91  const TransientTrack transientTrack = transientTrackBuilder->build(pfCand.trackRef());
92  transientTracks.push_back(transientTrack);
93  }
94  }
95  if(transientTracks.size() > 1){
96  KalmanVertexFitter kvf(true);
97  TransientVertex tv = kvf.vertex(transientTracks);
98 
99  if(tv.isValid()){
100  GlobalVector tauDir(tau->px(),
101  tau->py(),
102  tau->pz());
103  Vertex secVer = tv;
104  // We have to un-const the PV for some reason
105  reco::Vertex primaryVertexNonConst = *primaryVertex;
106  flightPathSignificance = vertexSignificance(primaryVertexNonConst,secVer,tauDir);
107  }
108  }
109  return flightPathSignificance;
110 }
double vertexSignificance(reco::Vertex &, reco::Vertex &, GlobalVector &)
reco::VertexRef associatedVertex(const PFJet &jet) const
reco::TransientTrack build(const reco::Track *p) const
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:429
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
bool isNull() const
Checks for null.
Definition: Ref.h:247
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:38
bool isValid() const
double PFRecoTauDiscriminationByFlightPathSignificance::vertexSignificance ( reco::Vertex pv,
reco::Vertex sv,
GlobalVector direction 
)
private

Definition at line 112 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References reco::SecondaryVertex::computeDist3d(), and Measurement1D::significance().

113  {
114  return SecondaryVertex::computeDist3d(pv,sv,direction,withPVError).significance();
115 }

Member Data Documentation

bool PFRecoTauDiscriminationByFlightPathSignificance::booleanOutput
private
double PFRecoTauDiscriminationByFlightPathSignificance::flightPathSig
private
const TransientTrackBuilder* PFRecoTauDiscriminationByFlightPathSignificance::transientTrackBuilder
private
reco::tau::RecoTauVertexAssociator* PFRecoTauDiscriminationByFlightPathSignificance::vertexAssociator_
private
bool PFRecoTauDiscriminationByFlightPathSignificance::withPVError
private