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 }
pat::Jet getCalJetBbar() const
edm::Ref< std::vector< pat::Jet > > jetB_
pat::Jet getJetB() const
const reco::GenParticle * getGenB() const
reco::Particle getLeptNeg() const
pat::Electron getElectronp() const
const reco::GenParticle * getGenBbar() const
pat::Jet getJetBbar() const
void setLRSignalEvtObservables(const std::vector< std::pair< unsigned int, double > > &)
edm::Ref< std::vector< pat::Jet > > jetBbar_
double getLRSignalEvtObsVal(unsigned int) const
edm::RefProd< TtGenEvent > theGenEvt_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Log< level::Info, false > LogInfo
pat::Tau getTaup() const
pat::Muon getMuonm() const
pat::Muon getMuonp() const
void setGenEvt(const edm::Handle< TtGenEvent > &)
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
double getLeptonResidual() const
Analysis-level calorimeter jet class.
Definition: Jet.h:77
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:42
std::string getWpDecay() const
std::string getWmDecay() const
reco::Particle getLeptPos() const
double getJetResidual() const
pat::Jet getCalJetB() const
const reco::GenParticle * getGenLepm() const
const reco::GenParticle * getGenLepp() const
pat::Electron getElectronm() const
pat::Tau getTaum() const