CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TMTQ.cc
Go to the documentation of this file.
1 /*
2  * \class TMTQ
3  *
4  * $Date: 2012/02/09 10:08:10 $
5  * \author: Julie Malcles - CEA/Saclay
6  */
7 
11 #include <TMath.h>
12 
13 using namespace std;
14 
15 //ClassImp(TMTQ)
16 
17 
18 // Default Constructor...
20 {
21  init();
22 }
23 
24 
25 // Destructor
27 {
28 }
29 
30 void TMTQ::init()
31 {
32 
33  for(int j=0;j<nOutVar;j++){
34  cuts[0][j]=0.0;
35  cuts[1][j]=10.0e9;
36  mom[j]=new TMom();
37  }
38 }
39 
40 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)
41 {
42  double val[nOutVar];
43 
44  val[iPeak]=peak;
45  val[iSigma]=sigma;
46  val[iFit]=fit;
47  val[iAmpl]=ampl;
48  val[iTrise]=trise;
49  val[iFwhm]=fwhm;
50  val[iFw20]=fw20;
51  val[iFw80]=fw80;
52  val[iPed]=ped;
53  val[iPedsig]=pedsig;
54  val[iSlide]=sliding;
55 
56  for(int ivar=0;ivar<nOutVar;ivar++){
57  mom[ivar]->addEntry(val[ivar]);
58  }
59 
60 }
61 
62 void TMTQ::setCut(int ivar, double mean, double sig){
63 
64  if(ivar<nOutVar){
65  cuts[0][ivar]=mean-2.0*sig;
66  cuts[1][ivar]=mean+2.0*sig;
67 
68  mom[ivar]->setCut(cuts[0][ivar],cuts[1][ivar]);
69  }
70 }
71 
72 std::vector<double> TMTQ::get(int ivar){
73 
74  std::vector<double> res;
75 
76  if(ivar<nOutVar){
77 
78  res.push_back(mom[ivar]->getMean());
79  res.push_back(mom[ivar]->getRMS());
80  res.push_back(mom[ivar]->getM3());
81  res.push_back(mom[ivar]->getNevt());
82  res.push_back(mom[ivar]->getMin());
83  res.push_back(mom[ivar]->getMax());
84 
85  }
86  return res;
87 
88 }
89 
90 std::vector<double> TMTQ::getPeak(){std::vector<double> x=get(TMTQ::iPeak); return x;}
91 std::vector<double> TMTQ::getAmpl(){std::vector<double> x=get(TMTQ::iAmpl); return x;}
92 std::vector<double> TMTQ::getSigma(){std::vector<double> x=get(TMTQ::iSigma); return x;}
93 std::vector<double> TMTQ::getTrise(){std::vector<double> x=get(TMTQ::iTrise); return x;}
94 std::vector<double> TMTQ::getFit(){std::vector<double> x=get(TMTQ::iFit); return x;}
95 std::vector<double> TMTQ::getFwhm(){std::vector<double> x=get(TMTQ::iFwhm); return x;}
96 std::vector<double> TMTQ::getFw20(){std::vector<double> x=get(TMTQ::iFw20); return x;}
97 std::vector<double> TMTQ::getFw80(){std::vector<double> x=get(TMTQ::iFw80); return x;}
98 std::vector<double> TMTQ::getPed(){std::vector<double> x=get(TMTQ::iPed); return x;}
99 std::vector<double> TMTQ::getPedsig(){std::vector<double> x=get(TMTQ::iPedsig); return x;}
100 std::vector<double> TMTQ::getSliding(){std::vector<double> x=get(TMTQ::iSlide); return x;}
101 
102 
103 
void init()
Definition: TMTQ.cc:30
TMTQ()
Definition: TMTQ.cc:19
std::vector< double > getPeak()
Definition: TMTQ.cc:90
int init
Definition: HydjetWrapper.h:63
void addEntry(double, double, double, double, double, double, double, double, double, double, double)
Definition: TMTQ.cc:40
Definition: TMom.h:7
std::vector< double > getFw20()
Definition: TMTQ.cc:96
virtual ~TMTQ()
Definition: TMTQ.cc:26
std::vector< double > get(int)
Definition: TMTQ.cc:72
std::vector< double > getTrise()
Definition: TMTQ.cc:93
int j
Definition: DBlmapReader.cc:9
std::vector< double > getPedsig()
Definition: TMTQ.cc:99
std::vector< double > getPed()
Definition: TMTQ.cc:98
std::vector< double > getSliding()
Definition: TMTQ.cc:100
std::vector< double > getFit()
Definition: TMTQ.cc:94
std::vector< double > getFw80()
Definition: TMTQ.cc:97
std::vector< double > getFwhm()
Definition: TMTQ.cc:95
std::vector< double > getAmpl()
Definition: TMTQ.cc:91
std::vector< double > getSigma()
Definition: TMTQ.cc:92
Definition: DDAxes.h:10
void setCut(int, double, double)
Definition: TMTQ.cc:62