CMS 3D CMS Logo

PFTau3ProngSummary.cc
Go to the documentation of this file.
2 #include "TMatrixT.h"
3 #include "TMatrixTSym.h"
4 #include "TVectorT.h"
5 using namespace reco;
6 
8  TLorentzVector a1,
9  double vertex_chi2,
10  double vertex_ndf) {
11  TIP_ = TIP;
12  for (unsigned int i = 0; i < nsolutions; i++) {
13  has3ProngSolution_.push_back(false);
14  solution_Chi2_.push_back(0);
15  thetaGJsig_.push_back(0);
16  tau_p4_.push_back(TLorentzVector(0, 0, 0, 0));
17  daughter_PDGID_.push_back(std::vector<int>());
18  daughter_charge_.push_back(std::vector<int>());
19  daughter_p4_.push_back(std::vector<TLorentzVector>());
20  }
21  a1_ = a1;
22  sv_ = TVector3(TIP_->secondaryVertex()->x(), TIP_->secondaryVertex()->y(), TIP_->secondaryVertex()->z());
23  svcov_ = TIP_->secondaryVertexCov();
24  vertex_chi2_ = vertex_chi2;
25  vertex_ndf_ = vertex_ndf;
26 }
27 
29  TLorentzVector a1,
30  double vertex_chi2,
31  double vertex_ndf,
32  TVector3 sv,
33  CovMatrix svcov) {
34  TIP_ = TIP;
35  for (unsigned int i = 0; i < nsolutions; i++) {
36  has3ProngSolution_.push_back(false);
37  solution_Chi2_.push_back(0);
38  thetaGJsig_.push_back(0);
39  tau_p4_.push_back(TLorentzVector(0, 0, 0, 0));
40  daughter_PDGID_.push_back(std::vector<int>());
41  daughter_charge_.push_back(std::vector<int>());
42  daughter_p4_.push_back(std::vector<TLorentzVector>());
43  }
44  a1_ = a1;
45  sv_ = sv;
46  svcov_ = svcov;
47  vertex_chi2_ = vertex_chi2;
48  vertex_ndf_ = vertex_ndf;
49 }
50 
52  for (unsigned int i = 0; i < nsolutions; i++) {
53  has3ProngSolution_.push_back(false);
54  solution_Chi2_.push_back(0);
55  thetaGJsig_.push_back(0);
56  tau_p4_.push_back(TLorentzVector(0, 0, 0, 0));
57  daughter_PDGID_.push_back(std::vector<int>());
58  daughter_charge_.push_back(std::vector<int>());
59  daughter_p4_.push_back(std::vector<TLorentzVector>());
60  }
61 }
62 
64 
65 bool PFTau3ProngSummary::AddSolution(unsigned int solution,
66  const TLorentzVector& tau,
67  const std::vector<TLorentzVector>& daughter_p4,
68  const std::vector<int>& daughter_charge,
69  const std::vector<int>& daughter_PDGID,
70  bool has3ProngSolution,
71  double solutionChi2,
72  double thetaGJsig) {
73  if (solution < nsolutions) {
74  has3ProngSolution_[solution] = true;
75  solution_Chi2_[solution] = solutionChi2;
76  thetaGJsig_[solution] = thetaGJsig;
77  tau_p4_[solution] = tau;
78  daughter_PDGID_[solution] = daughter_PDGID;
79  daughter_charge_[solution] = daughter_charge;
80  daughter_p4_[solution] = daughter_p4;
81  return true;
82  }
83  return false;
84 }
85 
86 double PFTau3ProngSummary::M_12() const {
87  for (unsigned int i = 0; i < has3ProngSolution_.size(); i++) {
88  if (has3ProngSolution_[i] == true) {
89  int charge = Tau_Charge();
90  TLorentzVector LV;
91  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++) {
92  if (daughter_charge_[i][j] == charge)
93  LV += daughter_p4_[i][j];
94  }
95  return LV.M();
96  }
97  }
98  return 0.0;
99 }
100 double PFTau3ProngSummary::M_13() const {
101  for (unsigned int i = 0; i < has3ProngSolution_.size(); i++) {
102  if (has3ProngSolution_[i] == true) {
103  int charge = Tau_Charge();
104  TLorentzVector LV_opp;
105  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++) {
106  if (daughter_charge_[i][j] == -1 * charge)
107  LV_opp = daughter_p4_[i][j];
108  }
109  TLorentzVector LV_pair;
110  bool found(false);
111  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++) {
112  if (daughter_charge_[i][j] == charge) {
113  TLorentzVector LV = daughter_p4_[i][j];
114  LV += LV_opp;
115  if (!found)
116  LV_pair = LV;
117  else if (LV_pair.M() > LV.M())
118  LV_pair = LV;
119  found = true;
120  }
121  }
122  if (found)
123  return LV_pair.M();
124  }
125  }
126  return 0.0;
127 }
128 
129 double PFTau3ProngSummary::M_23() const {
130  for (unsigned int i = 0; i < has3ProngSolution_.size(); i++) {
131  if (has3ProngSolution_[i] == true) {
132  int charge = Tau_Charge();
133  TLorentzVector LV_opp;
134  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++) {
135  if (daughter_charge_[i][j] == -1 * charge)
136  LV_opp = daughter_p4_[i][j];
137  }
138  TLorentzVector LV_pair;
139  bool found(false);
140  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++) {
141  if (daughter_charge_[i][j] == charge) {
142  TLorentzVector LV = daughter_p4_[i][j];
143  LV += LV_opp;
144  if (!found)
145  LV_pair = LV;
146  else if (LV_pair.M() < LV.M())
147  LV_pair = LV;
148  found = true;
149  }
150  }
151  if (found)
152  return LV_pair.M();
153  }
154  }
155  return 0.0;
156 }
157 
159  for (unsigned int i = 0; i < has3ProngSolution_.size(); i++) {
160  if (has3ProngSolution_[i] == true) {
161  int charge = 0;
162  for (unsigned int j = 0; j < daughter_p4_[i].size(); j++)
163  charge += daughter_charge_[i][j];
164  return charge;
165  }
166  }
167  return 0;
168 }
reco::PFTau3ProngSummary::TIP_
reco::PFTauTransverseImpactParameterRef TIP_
Definition: PFTau3ProngSummary.h:95
mps_fire.i
i
Definition: mps_fire.py:428
reco::PFTau3ProngSummary::has3ProngSolution_
std::vector< bool > has3ProngSolution_
Definition: PFTau3ProngSummary.h:101
metsig::tau
Definition: SignAlgoResolutions.h:49
reco::PFTau3ProngSummary::solution_Chi2_
std::vector< double > solution_Chi2_
Definition: PFTau3ProngSummary.h:102
reco::PFTau3ProngSummary::daughter_p4_
std::vector< std::vector< TLorentzVector > > daughter_p4_
Definition: PFTau3ProngSummary.h:107
reco::PFTau3ProngSummary::daughter_charge_
std::vector< std::vector< int > > daughter_charge_
Definition: PFTau3ProngSummary.h:106
reco::PFTau3ProngSummary::thetaGJsig_
std::vector< double > thetaGJsig_
Definition: PFTau3ProngSummary.h:103
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
reco::PFTau3ProngSummary::clone
PFTau3ProngSummary * clone() const
Definition: PFTau3ProngSummary.cc:63
reco::PFTau3ProngSummary::a1_
TLorentzVector a1_
Definition: PFTau3ProngSummary.h:96
reco::PFTau3ProngSummary
Definition: PFTau3ProngSummary.h:25
edm::Ref< PFTauTransverseImpactParameterCollection >
reco::PFTau3ProngSummary::Tau_Charge
int Tau_Charge() const
Definition: PFTau3ProngSummary.cc:158
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
reco::PFTau3ProngSummary::svcov_
CovMatrix svcov_
Definition: PFTau3ProngSummary.h:98
reco::PFTau3ProngSummary::tau_p4_
std::vector< TLorentzVector > tau_p4_
Definition: PFTau3ProngSummary.h:104
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::PFTau3ProngSummary::M_12
double M_12() const
Definition: PFTau3ProngSummary.cc:86
reco::PFTau3ProngSummary::PFTau3ProngSummary
PFTau3ProngSummary()
constructor from values
Definition: PFTau3ProngSummary.cc:51
reco::PFTau3ProngSummary::vertex_ndf_
double vertex_ndf_
Definition: PFTau3ProngSummary.h:100
reco::PFTau3ProngSummary::nsolutions
Definition: PFTau3ProngSummary.h:27
reco::PFTau3ProngSummary::M_13
double M_13() const
Definition: PFTau3ProngSummary.cc:100
reco::PFTau3ProngSummary::vertex_chi2_
double vertex_chi2_
Definition: PFTau3ProngSummary.h:99
LV
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPlotter.h:15
reco::PFTau3ProngSummary::M_23
double M_23() const
Definition: PFTau3ProngSummary.cc:129
reco::PFTau3ProngSummary::daughter_PDGID_
std::vector< std::vector< int > > daughter_PDGID_
Definition: PFTau3ProngSummary.h:105
reco::PFTau3ProngSummary::CovMatrix
math::Error< dimension >::type CovMatrix
Definition: PFTau3ProngSummary.h:30
reco::PFTau3ProngSummary::sv_
TVector3 sv_
Definition: PFTau3ProngSummary.h:97
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
PFTau3ProngSummary.h
reco::PFTau3ProngSummary::AddSolution
virtual bool AddSolution(unsigned int solution, const TLorentzVector &tau, const std::vector< TLorentzVector > &daughter_p4, const std::vector< int > &daughter_charge, const std::vector< int > &daughter_PDGID, bool has3ProngSolution, double solutionChi2, double thetaGJsig)
Definition: PFTau3ProngSummary.cc:65