CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecoTauDiscriminationByDeltaE.cc
Go to the documentation of this file.
3 
4 /* class PFRecoTauDiscriminationByDeltaE
5  * created : August 30 2010,
6  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
7  * based on H+ tau ID by Lauri Wendland
8  */
9 
10 #include "TLorentzVector.h"
11 
12 using namespace reco;
13 using namespace std;
14 using namespace edm;
15 
17  public:
19  deltaEmin = iConfig.getParameter<double>("deltaEmin");
20  deltaEmax = iConfig.getParameter<double>("deltaEmax");
21  chargedPionMass = 0.139;
22  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
23  }
24 
26 
27  void beginEvent(const edm::Event&, const edm::EventSetup&) override;
28  double discriminate(const reco::PFTauRef&) override;
29 
30  private:
31  double DeltaE(const PFTauRef&);
32 
34 
35  double deltaEmin,deltaEmax;
37 };
38 
40 }
41 
43 
44  double dE = DeltaE(tau);
45  if(booleanOutput) return ( dE > deltaEmin && dE < deltaEmax ? 1. : 0. );
46  return dE;
47 }
48 
50  double tracksE = 0;
51  const std::vector<PFCandidatePtr>& signalTracks = tau->signalPFChargedHadrCands();
52  for(size_t i = 0; i < signalTracks.size(); ++i){
53  TLorentzVector p4;
54  p4.SetXYZM(signalTracks[i]->px(),
55  signalTracks[i]->py(),
56  signalTracks[i]->pz(),
57  chargedPionMass);
58  tracksE += p4.E();
59  }
60 
61  double hadrTauP = tau->momentum().r() * (1.0 - tau->emFraction());
62  if (tau->emFraction() >= 1.0) {
63  return -1.0; // electron
64  } else {
65  return tracksE / hadrTauP - 1.0;
66  }
67 }
68 
70 
T getParameter(std::string const &) const
PFRecoTauDiscriminationByDeltaE(const ParameterSet &iConfig)
int i
Definition: DBlmapReader.cc:9
int iEvent
Definition: GenABIO.cc:230
double p4[4]
Definition: TauolaWrapper.h:92
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
void beginEvent(const edm::Event &, const edm::EventSetup &) override
double discriminate(const reco::PFTauRef &) override