CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SoftLeptonTagInfo.cc
Go to the documentation of this file.
1 #include <vector>
2 #include <cstring>
3 
5 
9 
10 namespace reco {
11 
12 using namespace btau;
13 
14 const float SoftLeptonProperties::quality::undef = -999.0;
15 
17 {
18  if (std::strcmp(name, "") == 0)
19  return 0;
20 
21  if (std::strcmp(name, "leptonId") == 0)
22  return leptonId;
23  else if (std::strcmp(name, "btagLeptonCands") == 0)
24  return btagLeptonCands;
25 
26  if (std::strcmp(name, "pfElectronId") == 0)
27  return pfElectronId;
28  else if (std::strcmp(name, "btagElectronCands") == 0)
29  return btagElectronCands;
30 
31  if (std::strcmp(name, "muonId") == 0)
32  return muonId;
33  else if (std::strcmp(name, "btagMuonCands") == 0)
34  return btagMuonCands;
35 
37  << "Requested lepton quality \"" << name
38  << "\" not found in SoftLeptonProperties::quality:byName"
39  << std::endl;
40 }
41 
42 float SoftLeptonProperties::quality(unsigned int index, bool throwIfUndefined) const
43 {
44  float qual = quality::undef;
45  if (index < qualities_.size())
46  qual = qualities_[index];
47 
48  if (qual == quality::undef && throwIfUndefined)
50  << "Requested lepton quality not found in SoftLeptonProperties::quality"
51  << std::endl;
52 
53  return qual;
54 }
55 
56 void SoftLeptonProperties::setQuality(unsigned int index, float qual)
57 {
58  if (qualities_.size() <= index)
59  qualities_.resize(index + 1, quality::undef);
60 
61  qualities_[index] = qual;
62 }
63 
66 
67  const Jet & jet = *( this->jet() );
68  list.insert( TaggingVariable(jetEnergy, jet.energy()), true );
69  list.insert( TaggingVariable(jetPt, jet.et()), true );
70  list.insert( TaggingVariable(jetEta, jet.eta()), true );
71  list.insert( TaggingVariable(jetPhi, jet.phi()), true );
72 
73  for (unsigned int i = 0; i < m_leptons.size(); ++i) {
74  const Track & track = *(m_leptons[i].first);
75  list.insert( TaggingVariable(trackMomentum, track.p()), true );
76  list.insert( TaggingVariable(trackEta, track.eta()), true );
77  list.insert( TaggingVariable(trackPhi, track.phi()), true );
78  list.insert( TaggingVariable(trackChi2, track.normalizedChi2()), true );
79  const SoftLeptonProperties & data = m_leptons[i].second;
82  list.insert( TaggingVariable(trackSip2dSig, data.sip2d), true );
83  list.insert( TaggingVariable(trackSip3dSig, data.sip3d), true );
84  list.insert( TaggingVariable(trackPtRel, data.ptRel), true );
85  list.insert( TaggingVariable(trackP0Par, data.ptRel), true );
86  list.insert( TaggingVariable(trackEtaRel, data.etaRel), true );
87  list.insert( TaggingVariable(trackDeltaR, data.deltaR), true );
88  list.insert( TaggingVariable(trackPParRatio, data.ratioRel), true );
89  }
90 
91  list.finalize();
92  return list;
93 }
94 
95 }
96 
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
int i
Definition: DBlmapReader.cc:9
virtual double et() const
transverse energy
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
Base class for all types of Jets.
Definition: Jet.h:21
static unsigned int internalByName(const char *name)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
float quality(quality::Generic qual, bool throwIfUndefined=true) const
virtual double eta() const
momentum pseudorapidity
virtual double energy() const
energy
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
std::pair< TaggingVariableName, TaggingValue > TaggingVariable
virtual TaggingVariableList taggingVariables(void) const
returns a description of the extended informations in a TaggingVariableList
void setQuality(quality::Generic qual, float value)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual double phi() const
momentum azimuthal angle
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void insert(const TaggingVariable &variable, bool delayed=false)