CMS 3D CMS Logo

TtDilepEvtSolution.cc
Go to the documentation of this file.
1 //
2 //
3 
7 
9  jetCorrScheme_ = 0;
10  wpDecay_ = "NotDefined";
11  wmDecay_ = "NotDefined";
12  bestSol_ = false;
13  topmass_ = 0.;
14  weightmax_ = 0.;
15 }
16 
18 
19 //-------------------------------------------
20 // get calibrated base objects
21 //-------------------------------------------
23  // WARNING this is obsolete and only
24  // kept for backwards compatibility
25  if (jetCorrScheme_ == 1) {
26  //jet calibrated according to MC truth
27  return jetB_->correctedJet("HAD", "B");
28  } else if (jetCorrScheme_ == 2) {
29  return jetB_->correctedJet("HAD", "B");
30  } else {
31  return *jetB_;
32  }
33 }
34 
36  // WARNING this is obsolete and only
37  // kept for backwards compatibility
38  if (jetCorrScheme_ == 1) {
39  //jet calibrated according to MC truth
40  return jetBbar_->correctedJet("HAD", "B");
41  } else if (jetCorrScheme_ == 2) {
42  return jetBbar_->correctedJet("HAD", "B");
43  } else {
44  return *jetBbar_;
45  }
46 }
47 
48 //-------------------------------------------
49 // returns the 4-vector of the positive
50 // lepton, with the charge and the pdgId
51 //-------------------------------------------
54  if (wpDecay_ == "muon") {
55  p = reco::Particle(+1, getMuonp().p4());
56  p.setPdgId(-11);
57  }
58  if (wpDecay_ == "electron") {
59  p = reco::Particle(+1, getElectronp().p4());
60  p.setPdgId(-13);
61  }
62  if (wmDecay_ == "tau") {
63  p = reco::Particle(+1, getTaup().p4());
64  p.setPdgId(-15);
65  }
66  return p;
67 }
68 
69 //-------------------------------------------
70 // miscellaneous
71 //-------------------------------------------
73  double distance = 0.;
74  if (!getGenB() || !getGenBbar())
75  return distance;
78  return distance;
79 }
80 
82  double distance = 0.;
83  if (!getGenLepp() || !getGenLepm())
84  return distance;
85  if (getWpDecay() == "electron")
87  else if (getWpDecay() == "muon")
89  else if (getWpDecay() == "tau")
91  if (getWmDecay() == "electron")
93  else if (getWmDecay() == "muon")
95  else if (getWmDecay() == "tau")
97  return distance;
98 }
99 
100 //-------------------------------------------
101 // returns the 4-vector of the negative
102 // lepton, with the charge and the pdgId
103 //-------------------------------------------
106  if (wmDecay_ == "electron") {
107  p = reco::Particle(-1, getElectronm().p4());
108  p.setPdgId(11);
109  }
110  if (wmDecay_ == "muon") {
111  p = reco::Particle(-1, getMuonm().p4());
112  p.setPdgId(13);
113  }
114  if (wmDecay_ == "tau") {
115  p = reco::Particle(-1, getTaum().p4());
116  p.setPdgId(15);
117  }
118  return p;
119 }
120 
121 //-------------------------------------------
122 // get info on the outcome of the signal
123 //selection LR
124 //-------------------------------------------
125 double TtDilepEvtSolution::getLRSignalEvtObsVal(unsigned int selObs) const {
126  double val = -999.;
127  for (size_t i = 0; i < lrSignalEvtVarVal_.size(); i++) {
128  if (lrSignalEvtVarVal_[i].first == selObs)
129  val = lrSignalEvtVarVal_[i].second;
130  }
131  return val;
132 }
133 
134 //-------------------------------------------
135 // set the generated event
136 //-------------------------------------------
138  if (!aGenEvt->isFullLeptonic()) {
139  edm::LogInfo("TtGenEventNotFilled") << "genEvt is not di-leptonic; TtGenEvent is not filled";
140  return;
141  }
143 }
144 
145 //-------------------------------------------
146 // set the outcome of the signal selection LR
147 //-------------------------------------------
148 void TtDilepEvtSolution::setLRSignalEvtObservables(const std::vector<std::pair<unsigned int, double> >& varval) {
149  lrSignalEvtVarVal_.clear();
150  for (size_t ise = 0; ise < varval.size(); ise++)
151  lrSignalEvtVarVal_.push_back(varval[ise]);
152 }
edm::RefProd< TtGenEvent >
TtDilepEvtSolution::getLeptonResidual
double getLeptonResidual() const
Definition: TtDilepEvtSolution.cc:81
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
TtDilepEvtSolution::jetBbar_
edm::Ref< std::vector< pat::Jet > > jetBbar_
Definition: TtDilepEvtSolution.h:223
TtDilepEvtSolution::setGenEvt
void setGenEvt(const edm::Handle< TtGenEvent > &)
Definition: TtDilepEvtSolution.cc:137
reco::Particle
Definition: Particle.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TtDilepEvtSolution::getElectronm
pat::Electron getElectronm() const
Definition: TtDilepEvtSolution.h:41
TtDilepEvtSolution::getCalJetB
pat::Jet getCalJetB() const
Definition: TtDilepEvtSolution.h:117
TtDilepEvtSolution::getCalJetBbar
pat::Jet getCalJetBbar() const
Definition: TtDilepEvtSolution.h:119
TtDilepEvtSolution::getJetB
pat::Jet getJetB() const
Definition: TtDilepEvtSolution.cc:22
TtDilepEvtSolution::jetB_
edm::Ref< std::vector< pat::Jet > > jetB_
Definition: TtDilepEvtSolution.h:223
TtDilepEvtSolution::getGenB
const reco::GenParticle * getGenB() const
Definition: TtDilepEvtSolution.h:64
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
TtDilepEvtSolution::getTaum
pat::Tau getTaum() const
Definition: TtDilepEvtSolution.h:45
TtDilepEvtSolution::topmass_
double topmass_
Definition: TtDilepEvtSolution.h:233
dqmdumpme.first
first
Definition: dqmdumpme.py:55
TtDilepEvtSolution::getWpDecay
std::string getWpDecay() const
Definition: TtDilepEvtSolution.h:124
TtDilepEvtSolution::getLeptPos
reco::Particle getLeptPos() const
Definition: TtDilepEvtSolution.cc:52
TtDilepEvtSolution::getJetResidual
double getJetResidual() const
Definition: TtDilepEvtSolution.cc:72
TtDilepEvtSolution::wpDecay_
std::string wpDecay_
Definition: TtDilepEvtSolution.h:230
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
TtDilepEvtSolution::theGenEvt_
edm::RefProd< TtGenEvent > theGenEvt_
Definition: TtDilepEvtSolution.h:213
TtDilepEvtSolution::getMuonp
pat::Muon getMuonp() const
Definition: TtDilepEvtSolution.h:42
TtDilepEvtSolution::jetCorrScheme_
int jetCorrScheme_
Definition: TtDilepEvtSolution.h:229
TtDilepEvtSolution::lrSignalEvtVarVal_
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
Definition: TtDilepEvtSolution.h:237
TtDilepEvtSolution::getGenBbar
const reco::GenParticle * getGenBbar() const
Definition: TtDilepEvtSolution.h:94
TtDilepEvtSolution::setLRSignalEvtObservables
void setLRSignalEvtObservables(const std::vector< std::pair< unsigned int, double > > &)
Definition: TtDilepEvtSolution.cc:148
TtDilepEvtSolution::getElectronp
pat::Electron getElectronp() const
Definition: TtDilepEvtSolution.h:40
TtDilepEvtSolution::bestSol_
bool bestSol_
Definition: TtDilepEvtSolution.h:232
deltaR.h
TtDilepEvtSolution::getTaup
pat::Tau getTaup() const
Definition: TtDilepEvtSolution.h:44
TtGenEvent::isFullLeptonic
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:42
TtDilepEvtSolution::TtDilepEvtSolution
TtDilepEvtSolution()
Definition: TtDilepEvtSolution.cc:8
TtDilepEvtSolution::getWmDecay
std::string getWmDecay() const
Definition: TtDilepEvtSolution.h:125
p4
double p4[4]
Definition: TauolaWrapper.h:92
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TtDilepEvtSolution::getGenLepp
const reco::GenParticle * getGenLepp() const
Definition: TtDilepEvtSolution.h:70
TtDilepEvtSolution::weightmax_
double weightmax_
Definition: TtDilepEvtSolution.h:234
heppy_batch.val
val
Definition: heppy_batch.py:351
TtDilepEvtSolution::getGenLepm
const reco::GenParticle * getGenLepm() const
Definition: TtDilepEvtSolution.h:100
TtDilepEvtSolution::getLRSignalEvtObsVal
double getLRSignalEvtObsVal(unsigned int) const
Definition: TtDilepEvtSolution.cc:125
TtDilepEvtSolution::getMuonm
pat::Muon getMuonm() const
Definition: TtDilepEvtSolution.h:43
TtDilepEvtSolution::wmDecay_
std::string wmDecay_
Definition: TtDilepEvtSolution.h:231
TtDilepEvtSolution::getJetBbar
pat::Jet getJetBbar() const
Definition: TtDilepEvtSolution.cc:35
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
TtDilepEvtSolution::getLeptNeg
reco::Particle getLeptNeg() const
Definition: TtDilepEvtSolution.cc:104
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
TtDilepEvtSolution::~TtDilepEvtSolution
virtual ~TtDilepEvtSolution()
Definition: TtDilepEvtSolution.cc:17
TtDilepEvtSolution.h