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 }
init
int init
Definition: HydjetWrapper.h:64
TMTQ::iPeak
Definition: TMTQ.h:10
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
TMTQ::init
void init()
Definition: TMTQ.cc:22
TMTQ::get
std::vector< double > get(int)
Definition: TMTQ.cc:69
L1TowerCalibrationProducer_cfi.fit
fit
Definition: L1TowerCalibrationProducer_cfi.py:36
TMTQ::getPedsig
std::vector< double > getPedsig()
Definition: TMTQ.cc:119
TMTQ::getFw20
std::vector< double > getFw20()
Definition: TMTQ.cc:107
TMTQ::setCut
void setCut(int, double, double)
Definition: TMTQ.cc:60
TMTQ::~TMTQ
virtual ~TMTQ()
Definition: TMTQ.cc:20
TMTQ::getSliding
std::vector< double > getSliding()
Definition: TMTQ.cc:123
TMTQ::getPeak
std::vector< double > getPeak()
Definition: TMTQ.cc:83
TMTQ::iPed
Definition: TMTQ.h:10
TMTQ::iTrise
Definition: TMTQ.h:10
TMTQ::iAmpl
Definition: TMTQ.h:10
TMTQ::getFit
std::vector< double > getFit()
Definition: TMTQ.cc:99
TMTQ::getFw80
std::vector< double > getFw80()
Definition: TMTQ.cc:111
TMTQ::getFwhm
std::vector< double > getFwhm()
Definition: TMTQ.cc:103
TMom
Definition: TMom.h:7
TMTQ::iFw80
Definition: TMTQ.h:10
TMTQ::iFw20
Definition: TMTQ.h:10
TMTQ::getTrise
std::vector< double > getTrise()
Definition: TMTQ.cc:95
TMTQ::iPedsig
Definition: TMTQ.h:10
TMTQ::addEntry
void addEntry(double, double, double, double, double, double, double, double, double, double, double)
Definition: TMTQ.cc:30
TMTQ::getPed
std::vector< double > getPed()
Definition: TMTQ.cc:115
get
#define get
res
Definition: Electron.h:6
TMTQ::getSigma
std::vector< double > getSigma()
Definition: TMTQ.cc:91
TMarkov.h
heppy_batch.val
val
Definition: heppy_batch.py:351
std
Definition: JetResolutionObject.h:76
TMom.h
TMTQ::getAmpl
std::vector< double > getAmpl()
Definition: TMTQ.cc:87
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
TMTQ::iFit
Definition: TMTQ.h:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TMTQ::iSlide
Definition: TMTQ.h:10
fit
Definition: CombinedChiSquaredLikelihood.h:6
TMTQ::iSigma
Definition: TMTQ.h:10
TMTQ.h
TMTQ::TMTQ
TMTQ()
Definition: TMTQ.cc:17
TMTQ::iFwhm
Definition: TMTQ.h:10