CMS 3D CMS Logo

TMTQ.cc
Go to the documentation of this file.
1 /*
2  * \class TMTQ
3  *
4  * \author: Julie Malcles - CEA/Saclay
5  */
6 
10 #include <TMath.h>
11 
12 using namespace std;
13 
14 //ClassImp(TMTQ)
15 
16 // Default Constructor...
17 TMTQ::TMTQ() { init(); }
18 
19 // Destructor
21 
22 void TMTQ::init() {
23  for (int j = 0; j < nOutVar; j++) {
24  cuts[0][j] = 0.0;
25  cuts[1][j] = 10.0e9;
26  mom[j] = new TMom();
27  }
28 }
29 
30 void TMTQ::addEntry(double peak,
31  double sigma,
32  double fit,
33  double ampl,
34  double trise,
35  double fwhm,
36  double fw20,
37  double fw80,
38  double ped,
39  double pedsig,
40  double sliding) {
41  double val[nOutVar];
42 
43  val[iPeak] = peak;
44  val[iSigma] = sigma;
45  val[iFit] = fit;
46  val[iAmpl] = ampl;
47  val[iTrise] = trise;
48  val[iFwhm] = fwhm;
49  val[iFw20] = fw20;
50  val[iFw80] = fw80;
51  val[iPed] = ped;
52  val[iPedsig] = pedsig;
53  val[iSlide] = sliding;
54 
55  for (int ivar = 0; ivar < nOutVar; ivar++) {
56  mom[ivar]->addEntry(val[ivar]);
57  }
58 }
59 
60 void TMTQ::setCut(int ivar, double mean, double sig) {
61  if (ivar < nOutVar) {
62  cuts[0][ivar] = mean - 2.0 * sig;
63  cuts[1][ivar] = mean + 2.0 * sig;
64 
65  mom[ivar]->setCut(cuts[0][ivar], cuts[1][ivar]);
66  }
67 }
68 
69 std::vector<double> TMTQ::get(int ivar) {
70  std::vector<double> res;
71 
72  if (ivar < nOutVar) {
73  res.push_back(mom[ivar]->getMean());
74  res.push_back(mom[ivar]->getRMS());
75  res.push_back(mom[ivar]->getM3());
76  res.push_back(mom[ivar]->getNevt());
77  res.push_back(mom[ivar]->getMin());
78  res.push_back(mom[ivar]->getMax());
79  }
80  return res;
81 }
82 
83 std::vector<double> TMTQ::getPeak() {
84  std::vector<double> x = get(TMTQ::iPeak);
85  return x;
86 }
87 std::vector<double> TMTQ::getAmpl() {
88  std::vector<double> x = get(TMTQ::iAmpl);
89  return x;
90 }
91 std::vector<double> TMTQ::getSigma() {
92  std::vector<double> x = get(TMTQ::iSigma);
93  return x;
94 }
95 std::vector<double> TMTQ::getTrise() {
96  std::vector<double> x = get(TMTQ::iTrise);
97  return x;
98 }
99 std::vector<double> TMTQ::getFit() {
100  std::vector<double> x = get(TMTQ::iFit);
101  return x;
102 }
103 std::vector<double> TMTQ::getFwhm() {
104  std::vector<double> x = get(TMTQ::iFwhm);
105  return x;
106 }
107 std::vector<double> TMTQ::getFw20() {
108  std::vector<double> x = get(TMTQ::iFw20);
109  return x;
110 }
111 std::vector<double> TMTQ::getFw80() {
112  std::vector<double> x = get(TMTQ::iFw80);
113  return x;
114 }
115 std::vector<double> TMTQ::getPed() {
116  std::vector<double> x = get(TMTQ::iPed);
117  return x;
118 }
119 std::vector<double> TMTQ::getPedsig() {
120  std::vector<double> x = get(TMTQ::iPedsig);
121  return x;
122 }
123 std::vector<double> TMTQ::getSliding() {
124  std::vector<double> x = get(TMTQ::iSlide);
125  return x;
126 }
void init()
Definition: TMTQ.cc:22
TMTQ()
Definition: TMTQ.cc:17
std::vector< double > getPeak()
Definition: TMTQ.cc:83
int init
Definition: HydjetWrapper.h:64
void addEntry(double, double, double, double, double, double, double, double, double, double, double)
Definition: TMTQ.cc:30
Definition: TMom.h:7
Definition: Electron.h:6
std::vector< double > getFw20()
Definition: TMTQ.cc:107
virtual ~TMTQ()
Definition: TMTQ.cc:20
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
std::vector< double > get(int)
Definition: TMTQ.cc:69
std::vector< double > getTrise()
Definition: TMTQ.cc:95
std::vector< double > getPedsig()
Definition: TMTQ.cc:119
std::vector< double > getPed()
Definition: TMTQ.cc:115
std::vector< double > getSliding()
Definition: TMTQ.cc:123
std::vector< double > getFit()
Definition: TMTQ.cc:99
std::vector< double > getFw80()
Definition: TMTQ.cc:111
std::vector< double > getFwhm()
Definition: TMTQ.cc:103
float x
std::vector< double > getAmpl()
Definition: TMTQ.cc:87
std::vector< double > getSigma()
Definition: TMTQ.cc:91
void setCut(int, double, double)
Definition: TMTQ.cc:60