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 
17 // Default Constructor...
19 {
20  init();
21 }
22 
23 
24 // Destructor
26 {
27 }
28 
29 void TMTQ::init()
30 {
31 
32  for(int j=0;j<nOutVar;j++){
33  cuts[0][j]=0.0;
34  cuts[1][j]=10.0e9;
35  mom[j]=new TMom();
36  }
37 }
38 
39 void TMTQ::addEntry(double peak, double sigma, double fit, double ampl, double trise, double fwhm, double fw20, double fw80, double ped, double pedsig, double sliding)
40 {
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 
61 void TMTQ::setCut(int ivar, double mean, double sig){
62 
63  if(ivar<nOutVar){
64  cuts[0][ivar]=mean-2.0*sig;
65  cuts[1][ivar]=mean+2.0*sig;
66 
67  mom[ivar]->setCut(cuts[0][ivar],cuts[1][ivar]);
68  }
69 }
70 
71 std::vector<double> TMTQ::get(int ivar){
72 
73  std::vector<double> res;
74 
75  if(ivar<nOutVar){
76 
77  res.push_back(mom[ivar]->getMean());
78  res.push_back(mom[ivar]->getRMS());
79  res.push_back(mom[ivar]->getM3());
80  res.push_back(mom[ivar]->getNevt());
81  res.push_back(mom[ivar]->getMin());
82  res.push_back(mom[ivar]->getMax());
83 
84  }
85  return res;
86 
87 }
88 
89 std::vector<double> TMTQ::getPeak(){std::vector<double> x=get(TMTQ::iPeak); return x;}
90 std::vector<double> TMTQ::getAmpl(){std::vector<double> x=get(TMTQ::iAmpl); return x;}
91 std::vector<double> TMTQ::getSigma(){std::vector<double> x=get(TMTQ::iSigma); return x;}
92 std::vector<double> TMTQ::getTrise(){std::vector<double> x=get(TMTQ::iTrise); return x;}
93 std::vector<double> TMTQ::getFit(){std::vector<double> x=get(TMTQ::iFit); return x;}
94 std::vector<double> TMTQ::getFwhm(){std::vector<double> x=get(TMTQ::iFwhm); return x;}
95 std::vector<double> TMTQ::getFw20(){std::vector<double> x=get(TMTQ::iFw20); return x;}
96 std::vector<double> TMTQ::getFw80(){std::vector<double> x=get(TMTQ::iFw80); return x;}
97 std::vector<double> TMTQ::getPed(){std::vector<double> x=get(TMTQ::iPed); return x;}
98 std::vector<double> TMTQ::getPedsig(){std::vector<double> x=get(TMTQ::iPedsig); return x;}
99 std::vector<double> TMTQ::getSliding(){std::vector<double> x=get(TMTQ::iSlide); return x;}
100 
101 
102 
void init()
Definition: TMTQ.cc:29
TMTQ()
Definition: TMTQ.cc:18
std::vector< double > getPeak()
Definition: TMTQ.cc:89
void addEntry(double, double, double, double, double, double, double, double, double, double, double)
Definition: TMTQ.cc:39
Definition: TMom.h:7
Definition: Electron.h:4
std::vector< double > getFw20()
Definition: TMTQ.cc:95
T x() const
Cartesian x coordinate.
virtual ~TMTQ()
Definition: TMTQ.cc:25
std::vector< double > get(int)
Definition: TMTQ.cc:71
std::vector< double > getTrise()
Definition: TMTQ.cc:92
std::vector< double > getPedsig()
Definition: TMTQ.cc:98
std::vector< double > getPed()
Definition: TMTQ.cc:97
std::vector< double > getSliding()
Definition: TMTQ.cc:99
std::vector< double > getFit()
Definition: TMTQ.cc:93
std::vector< double > getFw80()
Definition: TMTQ.cc:96
std::vector< double > getFwhm()
Definition: TMTQ.cc:94
std::vector< double > getAmpl()
Definition: TMTQ.cc:90
std::vector< double > getSigma()
Definition: TMTQ.cc:91
void setCut(int, double, double)
Definition: TMTQ.cc:61