CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes
TAPD Class Reference

#include <TAPD.h>

Public Types

enum  outVar {
  iAPD, iAPDoPN, iAPDoPN0, iAPDoPN1,
  iTime, iAPDoAPD0, iAPDoAPD1, nOutVar
}
 

Public Member Functions

void addEntry (double, double, double, double, double, double, double)
 
void addEntry (double, double, double, double, double)
 
std::vector< double > get (int)
 
std::vector< double > getAPD ()
 
std::vector< double > getAPDoAPD0 ()
 
std::vector< double > getAPDoAPD1 ()
 
std::vector< double > getAPDoPN ()
 
std::vector< double > getAPDoPN0 ()
 
std::vector< double > getAPDoPN1 ()
 
std::vector< double > getTime ()
 
void init ()
 
void set2DAPDCut (std::vector< double >, std::vector< double >)
 
void set2DAPDoAPD0Cut (std::vector< double >, std::vector< double >)
 
void set2DAPDoAPD1Cut (std::vector< double >, std::vector< double >)
 
void set2DAPDoPN0Cut (std::vector< double >, std::vector< double >)
 
void set2DAPDoPN1Cut (std::vector< double >, std::vector< double >)
 
void set2DAPDoPNCut (std::vector< double >, std::vector< double >)
 
void set2DCut (int, std::vector< double >, std::vector< double >)
 
void set2DTimeCut (std::vector< double >, std::vector< double >)
 
void setAPDCut (double, double)
 
void setAPDoPN0Cut (double, double)
 
void setAPDoPN1Cut (double, double)
 
void setAPDoPNCut (double, double)
 
void setCut (int, double, double)
 
void setCut (int, std::vector< int >, std::vector< double >, std::vector< double >)
 
void setTimeCut (double, double)
 
 TAPD ()
 
virtual ~TAPD ()
 

Public Attributes

std::vector< double > _apdcuts [2][nOutVar]
 
std::vector< int > _cutvars [nOutVar]
 
TMommom [nOutVar]
 

Detailed Description

Definition at line 8 of file TAPD.h.

Member Enumeration Documentation

Enumerator
iAPD 
iAPDoPN 
iAPDoPN0 
iAPDoPN1 
iTime 
iAPDoAPD0 
iAPDoAPD1 
nOutVar 

Definition at line 14 of file TAPD.h.

Constructor & Destructor Documentation

TAPD::TAPD ( )

Definition at line 21 of file TAPD.cc.

References init.

22 {
23  init();
24 }
void init()
Definition: TAPD.cc:32
TAPD::~TAPD ( )
virtual

Definition at line 28 of file TAPD.cc.

29 {
30 }

Member Function Documentation

void TAPD::addEntry ( double  apd,
double  pn,
double  pn0,
double  pn1,
double  time,
double  apd0,
double  apd1 
)

Definition at line 54 of file TAPD.cc.

References asciidump::at, and cond::rpcobgas::time.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

55 {
56 
57  double val[nOutVar];
58  std::vector <double> valcuts[nOutVar];
59 
60  val[iAPD]=apd;
61  if(pn!=0) val[iAPDoPN]=apd/pn;
62  else val[iAPDoPN]=0.0;
63  if(pn0!=0) val[iAPDoPN0]=apd/pn0;
64  else val[iAPDoPN0]=0.0;
65  if(pn1!=0) val[iAPDoPN1]=apd/pn1;
66  else val[iAPDoPN1]=0.0;
67  val[iTime]=time;
68  if(apd0!=0.)val[iAPDoAPD0]=apd/apd0;
69  else val[iAPDoAPD0]=0.0;
70  if(apd1!=0.)val[iAPDoAPD1]=apd/apd1;
71  else val[iAPDoAPD1]=0.0;
72 
73 
74 
75  for(int ivar=0;ivar<nOutVar;ivar++){
76  int dimcut=_cutvars[ivar].size();
77  for(int ic=0;ic<dimcut;ic++){
78  assert(_cutvars[ivar].at(ic)<nOutVar);
79  valcuts[ivar].push_back(val[_cutvars[ivar].at(ic)]);
80  }
81  }
82 
83  for(int ivar=0;ivar<nOutVar;ivar++){
84  mom[ivar]->addEntry(val[ivar],valcuts[ivar]);
85  // std::cout << "addEntry: val[ivar=" << ivar <<"] = "<<val[ivar]<< std::endl;
86 
87  for(size_t ic=0;ic<_cutvars[ivar].size();ic++){
88  // std::cout << "addEntry: valcuts[ivar="<< ivar <<"][ic="<<ic<<"] = "<<valcuts[ivar].at(ic)<< std::endl;
89  for(size_t iv=0;iv<_cutvars[ivar].size();iv++){
90  // std::cout <<"low cut:"<<_apdcuts[0][ivar].at(iv)<<", high cut:"<<_apdcuts[1][ivar].at(iv)<<", cutvar: "<<_cutvars[ivar].at(iv)<< std::endl;
91  }
92  }
93  }
94 
95 }
void addEntry(double val)
Definition: TMom.cc:111
TMom * mom[nOutVar]
Definition: TAPD.h:19
std::vector< int > _cutvars[nOutVar]
Definition: TAPD.h:17
list at
Definition: asciidump.py:428
void TAPD::addEntry ( double  apd,
double  pn,
double  pn0,
double  pn1,
double  time 
)

Definition at line 49 of file TAPD.cc.

References revisionDML::addEntry().

50 {
51  addEntry(apd, pn, pn0, pn1, time, 0.0, 0.0);
52 }
void addEntry(double, double, double, double, double, double, double)
Definition: TAPD.cc:54
std::vector< double > TAPD::get ( int  ivar)

Definition at line 215 of file TAPD.cc.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

215  {
216 
217  std::vector<double> res;
218 
219  if(ivar<nOutVar){
220 
221  res.push_back(mom[ivar]->getMean());
222  res.push_back(mom[ivar]->getRMS());
223  res.push_back(mom[ivar]->getM3());
224  res.push_back(mom[ivar]->getNevt());
225  res.push_back(mom[ivar]->getMin());
226  res.push_back(mom[ivar]->getMax());
227 
228  }
229 
230  // std::cout << "In get: ivar="<< ivar << ", mean="<< mom[ivar]->getMean()<<" res size="<< res.size()<< std::endl;
231 
232  return res;
233 
234 }
TMom * mom[nOutVar]
Definition: TAPD.h:19
std::vector< double > TAPD::getAPD ( )

Definition at line 236 of file TAPD.cc.

References iAPD, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

236 {std::vector<double> x=get(TAPD::iAPD); return x;}
Definition: DDAxes.h:10
std::vector< double > TAPD::getAPDoAPD0 ( )

Definition at line 241 of file TAPD.cc.

References iAPDoAPD0, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

241  {
242 std::vector<double> x=get(TAPD::iAPDoAPD0);
243 // std::cout<< "In GetAPDoAPD0: x[0]="<< x.at(0) << std::endl;
244  return x;
245 }
Definition: DDAxes.h:10
std::vector< double > TAPD::getAPDoAPD1 ( )

Definition at line 246 of file TAPD.cc.

References iAPDoAPD1, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

246 {std::vector<double> x=get(TAPD::iAPDoAPD1); return x;}
Definition: DDAxes.h:10
std::vector< double > TAPD::getAPDoPN ( )

Definition at line 237 of file TAPD.cc.

References iAPDoPN, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

237 {std::vector<double> x=get(TAPD::iAPDoPN); return x;}
Definition: DDAxes.h:10
std::vector< double > TAPD::getAPDoPN0 ( )

Definition at line 238 of file TAPD.cc.

References iAPDoPN0, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

238 {std::vector<double> x=get(TAPD::iAPDoPN0); return x;}
Definition: DDAxes.h:10
std::vector< double > TAPD::getAPDoPN1 ( )

Definition at line 239 of file TAPD.cc.

References iAPDoPN1, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

239 {std::vector<double> x=get(TAPD::iAPDoPN1); return x;}
Definition: DDAxes.h:10
std::vector< double > TAPD::getTime ( )

Definition at line 240 of file TAPD.cc.

References iTime, and x.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

240 {std::vector<double> x=get(TAPD::iTime); return x;}
Definition: DDAxes.h:10
void TAPD::init ( )

Definition at line 32 of file TAPD.cc.

References j.

33 {
34 
35  for(int j=0;j<nOutVar;j++){
36 
37  _apdcuts[0][j].clear();
38  _apdcuts[1][j].clear();
39  _cutvars[j].clear();
40 
41  _apdcuts[0][j].push_back(0.0);
42  _apdcuts[1][j].push_back(10.0e6);
43  _cutvars[j].push_back(j);
44 
45  mom[j]=new TMom();
46  }
47 }
std::vector< double > _apdcuts[2][nOutVar]
Definition: TAPD.h:16
TMom * mom[nOutVar]
Definition: TAPD.h:19
Definition: TMom.h:7
int j
Definition: DBlmapReader.cc:9
std::vector< int > _cutvars[nOutVar]
Definition: TAPD.h:17
void TAPD::set2DAPDCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 170 of file TAPD.cc.

References iAPD.

170  {
171  set2DCut(TAPD::iAPD, lowCut, highCut);
172 }
void set2DCut(int, std::vector< double >, std::vector< double >)
Definition: TAPD.cc:158
void TAPD::set2DAPDoAPD0Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 184 of file TAPD.cc.

References iAPD, iAPDoAPD0, and iTime.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

184  {
185 
186  assert (lowCut.size()==2);
187  assert (highCut.size()==2);
188  std::vector<int> cutVars;
189  cutVars.push_back(TAPD::iAPD);
190  cutVars.push_back(TAPD::iTime);
191  setCut(TAPD::iAPDoAPD0, cutVars, lowCut, highCut);
192 }
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::set2DAPDoAPD1Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 193 of file TAPD.cc.

References iAPD, iAPDoAPD1, and iTime.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

193  {
194 
195  assert (lowCut.size()==2);
196  assert (highCut.size()==2);
197  std::vector<int> cutVars;
198  cutVars.push_back(TAPD::iAPD);
199  cutVars.push_back(TAPD::iTime);
200  setCut(TAPD::iAPDoAPD1, cutVars, lowCut, highCut);
201 }
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::set2DAPDoPN0Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 176 of file TAPD.cc.

References iAPDoPN0.

176  {
177  set2DCut(TAPD::iAPDoPN0, lowCut, highCut);
178 }
void set2DCut(int, std::vector< double >, std::vector< double >)
Definition: TAPD.cc:158
void TAPD::set2DAPDoPN1Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 179 of file TAPD.cc.

References iAPDoPN1.

179  {
180  set2DCut(TAPD::iAPDoPN1, lowCut, highCut);
181 }
void set2DCut(int, std::vector< double >, std::vector< double >)
Definition: TAPD.cc:158
void TAPD::set2DAPDoPNCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 173 of file TAPD.cc.

References iAPDoPN.

173  {
174  set2DCut(TAPD::iAPDoPN, lowCut, highCut);
175 }
void set2DCut(int, std::vector< double >, std::vector< double >)
Definition: TAPD.cc:158
void TAPD::set2DCut ( int  ivar,
std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 158 of file TAPD.cc.

References iTime.

158  {
159 
160  assert (lowCut.size()==2);
161  assert (highCut.size()==2);
162  std::vector<int> cutVars;
163  cutVars.push_back(ivar);
164  cutVars.push_back(TAPD::iTime);
165  setCut(ivar, cutVars, lowCut, highCut);
166 
167 }
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::set2DTimeCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 203 of file TAPD.cc.

References iAPD, and iTime.

203  {
204 
205  assert (lowCut.size()==2);
206  assert (highCut.size()==2);
207  std::vector<int> cutVars;
208  cutVars.push_back(TAPD::iAPD);
209  cutVars.push_back(TAPD::iTime);
210  setCut(TAPD::iTime, cutVars, lowCut, highCut);
211 }
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setAPDCut ( double  mean,
double  sig 
)

Definition at line 148 of file TAPD.cc.

References iAPD.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

148 {setCut(TAPD::iAPD,mean,sig);}
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setAPDoPN0Cut ( double  mean,
double  sig 
)

Definition at line 150 of file TAPD.cc.

References iAPDoPN0.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

150 {setCut(TAPD::iAPDoPN0,mean,sig);}
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setAPDoPN1Cut ( double  mean,
double  sig 
)

Definition at line 151 of file TAPD.cc.

References iAPDoPN1.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

151 {setCut(TAPD::iAPDoPN1,mean,sig);}
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setAPDoPNCut ( double  mean,
double  sig 
)

Definition at line 149 of file TAPD.cc.

References iAPDoPN.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

149 {setCut(TAPD::iAPDoPN,mean,sig);}
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 97 of file TAPD.cc.

97  {
98 
99  assert(ivar<nOutVar);
100 
101  std::vector <int>cutvar;
102  cutvar.push_back(ivar);
103 
104  std::vector <double>lowcut;
105  std::vector <double>highcut;
106 
107  double low=mean-2.0*sig;
108  if (low<0) low=0.0;
109  double high=mean+2.0*sig;
110 
111  lowcut.push_back(low);
112  highcut.push_back(high);
113 
114  setCut(ivar,cutvar,lowcut,highcut);
115 
116 }
void setCut(int, double, double)
Definition: TAPD.cc:97
void TAPD::setCut ( int  ivar,
std::vector< int >  cutVars,
std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 118 of file TAPD.cc.

118  {
119 
120  assert(ivar<nOutVar);
121  int cutdim=cutVars.size();
122  assert(cutdim<nOutVar);
123  assert(cutdim==(int)lowCut.size());
124  assert(cutdim==(int)highCut.size());
125 
126  _apdcuts[0][ivar].clear();
127  _apdcuts[1][ivar].clear();
128  _cutvars[ivar].clear();
129 
130  for (int ic=0;ic<cutdim;ic++){
131 
132  // FINISH THIS
133  if(lowCut.at(ic)>0){
134  _apdcuts[0][ivar].push_back(lowCut.at(ic));
135  }else _apdcuts[0][ivar].push_back(0.0);
136 
137  _apdcuts[1][ivar].push_back(highCut.at(ic));
138  _cutvars[ivar].push_back(cutVars.at(ic));
139 
140  }
141 
142  mom[ivar]->setCut(_apdcuts[0][ivar],_apdcuts[1][ivar]);
143 }
std::vector< double > _apdcuts[2][nOutVar]
Definition: TAPD.h:16
TMom * mom[nOutVar]
Definition: TAPD.h:19
void setCut(double, double)
Definition: TMom.cc:91
std::vector< int > _cutvars[nOutVar]
Definition: TAPD.h:17
void TAPD::setTimeCut ( double  mean,
double  sig 
)

Definition at line 152 of file TAPD.cc.

References iTime.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

152 {setCut(TAPD::iTime,mean,sig);}
void setCut(int, double, double)
Definition: TAPD.cc:97

Member Data Documentation

std::vector<double> TAPD::_apdcuts[2][nOutVar]

Definition at line 16 of file TAPD.h.

std::vector<int> TAPD::_cutvars[nOutVar]

Definition at line 17 of file TAPD.h.

TMom* TAPD::mom[nOutVar]

Definition at line 19 of file TAPD.h.