CMS 3D CMS Logo

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)
 
void addEntry (double, double, 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 (const std::vector< double > &, const std::vector< double > &)
 
void set2DAPDoAPD0Cut (const std::vector< double > &, const std::vector< double > &)
 
void set2DAPDoAPD1Cut (const std::vector< double > &, const std::vector< double > &)
 
void set2DAPDoPN0Cut (const std::vector< double > &, const std::vector< double > &)
 
void set2DAPDoPN1Cut (const std::vector< double > &, const std::vector< double > &)
 
void set2DAPDoPNCut (const std::vector< double > &, const std::vector< double > &)
 
void set2DCut (int, const std::vector< double > &, const std::vector< double > &)
 
void set2DTimeCut (const std::vector< double > &, const std::vector< double > &)
 
void setAPDCut (double, double)
 
void setAPDoPN0Cut (double, double)
 
void setAPDoPN1Cut (double, double)
 
void setAPDoPNCut (double, double)
 
void setCut (int, const std::vector< int > &, const std::vector< double > &, const std::vector< double > &)
 
void setCut (int, double, 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

◆ outVar

Enumerator
iAPD 
iAPDoPN 
iAPDoPN0 
iAPDoPN1 
iTime 
iAPDoAPD0 
iAPDoAPD1 
nOutVar 

Definition at line 10 of file TAPD.h.

Constructor & Destructor Documentation

◆ TAPD()

TAPD::TAPD ( )

Definition at line 19 of file TAPD.cc.

19 { init(); }

References init.

◆ ~TAPD()

TAPD::~TAPD ( )
virtual

Definition at line 22 of file TAPD.cc.

22 {}

Member Function Documentation

◆ addEntry() [1/2]

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

Definition at line 38 of file TAPD.cc.

38  {
39  addEntry(apd, pn, pn0, pn1, time, 0.0, 0.0);
40 }

References ntuplemaker::time.

◆ addEntry() [2/2]

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

Definition at line 42 of file TAPD.cc.

42  {
43  double val[nOutVar];
44  std::vector<double> valcuts[nOutVar];
45 
46  val[iAPD] = apd;
47  if (pn != 0)
48  val[iAPDoPN] = apd / pn;
49  else
50  val[iAPDoPN] = 0.0;
51  if (pn0 != 0)
52  val[iAPDoPN0] = apd / pn0;
53  else
54  val[iAPDoPN0] = 0.0;
55  if (pn1 != 0)
56  val[iAPDoPN1] = apd / pn1;
57  else
58  val[iAPDoPN1] = 0.0;
59  val[iTime] = time;
60  if (apd0 != 0.)
61  val[iAPDoAPD0] = apd / apd0;
62  else
63  val[iAPDoAPD0] = 0.0;
64  if (apd1 != 0.)
65  val[iAPDoAPD1] = apd / apd1;
66  else
67  val[iAPDoAPD1] = 0.0;
68 
69  for (int ivar = 0; ivar < nOutVar; ivar++) {
70  int dimcut = _cutvars[ivar].size();
71  for (int ic = 0; ic < dimcut; ic++) {
72  assert(_cutvars[ivar].at(ic) < nOutVar);
73  valcuts[ivar].push_back(val[_cutvars[ivar].at(ic)]);
74  }
75  }
76 
77  for (int ivar = 0; ivar < nOutVar; ivar++) {
78  mom[ivar]->addEntry(val[ivar], valcuts[ivar]);
79  // std::cout << "addEntry: val[ivar=" << ivar <<"] = "<<val[ivar]<< std::endl;
80 
81  for (size_t ic = 0; ic < _cutvars[ivar].size(); ic++) {
82  // std::cout << "addEntry: valcuts[ivar="<< ivar <<"][ic="<<ic<<"] = "<<valcuts[ivar].at(ic)<< std::endl;
83  for (size_t iv = 0; iv < _cutvars[ivar].size(); iv++) {
84  // std::cout <<"low cut:"<<_apdcuts[0][ivar].at(iv)<<", high cut:"<<_apdcuts[1][ivar].at(iv)<<", cutvar: "<<_cutvars[ivar].at(iv)<< std::endl;
85  }
86  }
87  }
88 }

References cms::cuda::assert(), ntuplemaker::time, and heppy_batch::val.

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

◆ get()

std::vector< double > TAPD::get ( int  ivar)

Definition at line 199 of file TAPD.cc.

199  {
200  std::vector<double> res;
201 
202  if (ivar < nOutVar) {
203  res.push_back(mom[ivar]->getMean());
204  res.push_back(mom[ivar]->getRMS());
205  res.push_back(mom[ivar]->getM3());
206  res.push_back(mom[ivar]->getNevt());
207  res.push_back(mom[ivar]->getMin());
208  res.push_back(mom[ivar]->getMax());
209  }
210 
211  // std::cout << "In get: ivar="<< ivar << ", mean="<< mom[ivar]->getMean()<<" res size="<< res.size()<< std::endl;
212 
213  return res;
214 }

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), data_sources.json_list::as_dicts(), data_sources.json_list::as_table(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), data_sources.json_list::first(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), data_sources.json_list::indices(), data_sources.json_list::last(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), util.rrapi.RRApi::reports(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

◆ getAPD()

std::vector< double > TAPD::getAPD ( )

Definition at line 216 of file TAPD.cc.

216  {
217  std::vector<double> x = get(TAPD::iAPD);
218  return x;
219 }

References get, and iAPD.

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

◆ getAPDoAPD0()

std::vector< double > TAPD::getAPDoAPD0 ( )

Definition at line 236 of file TAPD.cc.

236  {
237  std::vector<double> x = get(TAPD::iAPDoAPD0);
238  // std::cout<< "In GetAPDoAPD0: x[0]="<< x.at(0) << std::endl;
239  return x;
240 }

References get, and iAPDoAPD0.

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

◆ getAPDoAPD1()

std::vector< double > TAPD::getAPDoAPD1 ( )

Definition at line 241 of file TAPD.cc.

241  {
242  std::vector<double> x = get(TAPD::iAPDoAPD1);
243  return x;
244 }

References get, and iAPDoAPD1.

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

◆ getAPDoPN()

std::vector< double > TAPD::getAPDoPN ( )

Definition at line 220 of file TAPD.cc.

220  {
221  std::vector<double> x = get(TAPD::iAPDoPN);
222  return x;
223 }

References get, and iAPDoPN.

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

◆ getAPDoPN0()

std::vector< double > TAPD::getAPDoPN0 ( )

Definition at line 224 of file TAPD.cc.

224  {
225  std::vector<double> x = get(TAPD::iAPDoPN0);
226  return x;
227 }

References get, and iAPDoPN0.

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

◆ getAPDoPN1()

std::vector< double > TAPD::getAPDoPN1 ( )

Definition at line 228 of file TAPD.cc.

228  {
229  std::vector<double> x = get(TAPD::iAPDoPN1);
230  return x;
231 }

References get, and iAPDoPN1.

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

◆ getTime()

std::vector< double > TAPD::getTime ( )

Definition at line 232 of file TAPD.cc.

232  {
233  std::vector<double> x = get(TAPD::iTime);
234  return x;
235 }

References get, and iTime.

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

◆ init()

void TAPD::init ( )

Definition at line 24 of file TAPD.cc.

24  {
25  for (int j = 0; j < nOutVar; j++) {
26  _apdcuts[0][j].clear();
27  _apdcuts[1][j].clear();
28  _cutvars[j].clear();
29 
30  _apdcuts[0][j].push_back(0.0);
31  _apdcuts[1][j].push_back(10.0e6);
32  _cutvars[j].push_back(j);
33 
34  mom[j] = new TMom();
35  }
36 }

References dqmiolumiharvest::j.

◆ set2DAPDCut()

void TAPD::set2DAPDCut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 160 of file TAPD.cc.

160  {
161  set2DCut(TAPD::iAPD, lowCut, highCut);
162 }

References iAPD.

◆ set2DAPDoAPD0Cut()

void TAPD::set2DAPDoAPD0Cut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 173 of file TAPD.cc.

173  {
174  assert(lowCut.size() == 2);
175  assert(highCut.size() == 2);
176  std::vector<int> cutVars;
177  cutVars.push_back(TAPD::iAPD);
178  cutVars.push_back(TAPD::iTime);
179  setCut(TAPD::iAPDoAPD0, cutVars, lowCut, highCut);
180 }

References cms::cuda::assert(), iAPD, iAPDoAPD0, and iTime.

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

◆ set2DAPDoAPD1Cut()

void TAPD::set2DAPDoAPD1Cut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 181 of file TAPD.cc.

181  {
182  assert(lowCut.size() == 2);
183  assert(highCut.size() == 2);
184  std::vector<int> cutVars;
185  cutVars.push_back(TAPD::iAPD);
186  cutVars.push_back(TAPD::iTime);
187  setCut(TAPD::iAPDoAPD1, cutVars, lowCut, highCut);
188 }

References cms::cuda::assert(), iAPD, iAPDoAPD1, and iTime.

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

◆ set2DAPDoPN0Cut()

void TAPD::set2DAPDoPN0Cut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 166 of file TAPD.cc.

166  {
167  set2DCut(TAPD::iAPDoPN0, lowCut, highCut);
168 }

References iAPDoPN0.

◆ set2DAPDoPN1Cut()

void TAPD::set2DAPDoPN1Cut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 169 of file TAPD.cc.

169  {
170  set2DCut(TAPD::iAPDoPN1, lowCut, highCut);
171 }

References iAPDoPN1.

◆ set2DAPDoPNCut()

void TAPD::set2DAPDoPNCut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 163 of file TAPD.cc.

163  {
164  set2DCut(TAPD::iAPDoPN, lowCut, highCut);
165 }

References iAPDoPN.

◆ set2DCut()

void TAPD::set2DCut ( int  ivar,
const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 151 of file TAPD.cc.

151  {
152  assert(lowCut.size() == 2);
153  assert(highCut.size() == 2);
154  std::vector<int> cutVars;
155  cutVars.push_back(ivar);
156  cutVars.push_back(TAPD::iTime);
157  setCut(ivar, cutVars, lowCut, highCut);
158 }

References cms::cuda::assert(), and iTime.

◆ set2DTimeCut()

void TAPD::set2DTimeCut ( const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 190 of file TAPD.cc.

190  {
191  assert(lowCut.size() == 2);
192  assert(highCut.size() == 2);
193  std::vector<int> cutVars;
194  cutVars.push_back(TAPD::iAPD);
195  cutVars.push_back(TAPD::iTime);
196  setCut(TAPD::iTime, cutVars, lowCut, highCut);
197 }

References cms::cuda::assert(), iAPD, and iTime.

◆ setAPDCut()

void TAPD::setAPDCut ( double  mean,
double  sig 
)

Definition at line 141 of file TAPD.cc.

141 { setCut(TAPD::iAPD, mean, sig); }

References iAPD, and SiStripPI::mean.

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

◆ setAPDoPN0Cut()

void TAPD::setAPDoPN0Cut ( double  mean,
double  sig 
)

Definition at line 143 of file TAPD.cc.

143 { setCut(TAPD::iAPDoPN0, mean, sig); }

References iAPDoPN0, and SiStripPI::mean.

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

◆ setAPDoPN1Cut()

void TAPD::setAPDoPN1Cut ( double  mean,
double  sig 
)

Definition at line 144 of file TAPD.cc.

144 { setCut(TAPD::iAPDoPN1, mean, sig); }

References iAPDoPN1, and SiStripPI::mean.

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

◆ setAPDoPNCut()

void TAPD::setAPDoPNCut ( double  mean,
double  sig 
)

Definition at line 142 of file TAPD.cc.

142 { setCut(TAPD::iAPDoPN, mean, sig); }

References iAPDoPN, and SiStripPI::mean.

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

◆ setCut() [1/2]

void TAPD::setCut ( int  ivar,
const std::vector< int > &  cutVars,
const std::vector< double > &  lowCut,
const std::vector< double > &  highCut 
)

Definition at line 110 of file TAPD.cc.

113  {
114  assert(ivar < nOutVar);
115  int cutdim = cutVars.size();
116  assert(cutdim < nOutVar);
117  assert(cutdim == (int)lowCut.size());
118  assert(cutdim == (int)highCut.size());
119 
120  _apdcuts[0][ivar].clear();
121  _apdcuts[1][ivar].clear();
122  _cutvars[ivar].clear();
123 
124  for (int ic = 0; ic < cutdim; ic++) {
125  // FINISH THIS
126  if (lowCut.at(ic) > 0) {
127  _apdcuts[0][ivar].push_back(lowCut.at(ic));
128  } else
129  _apdcuts[0][ivar].push_back(0.0);
130 
131  _apdcuts[1][ivar].push_back(highCut.at(ic));
132  _cutvars[ivar].push_back(cutVars.at(ic));
133  }
134 
135  mom[ivar]->setCut(_apdcuts[0][ivar], _apdcuts[1][ivar]);
136 }

References cms::cuda::assert().

◆ setCut() [2/2]

void TAPD::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 90 of file TAPD.cc.

90  {
91  assert(ivar < nOutVar);
92 
93  std::vector<int> cutvar;
94  cutvar.push_back(ivar);
95 
96  std::vector<double> lowcut;
97  std::vector<double> highcut;
98 
99  double low = mean - 2.0 * sig;
100  if (low < 0)
101  low = 0.0;
102  double high = mean + 2.0 * sig;
103 
104  lowcut.push_back(low);
105  highcut.push_back(high);
106 
107  setCut(ivar, cutvar, lowcut, highcut);
108 }

References cms::cuda::assert(), LaserClient_cfi::high, LaserClient_cfi::low, and SiStripPI::mean.

◆ setTimeCut()

void TAPD::setTimeCut ( double  mean,
double  sig 
)

Definition at line 145 of file TAPD.cc.

145 { setCut(TAPD::iTime, mean, sig); }

References iTime, and SiStripPI::mean.

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

Member Data Documentation

◆ _apdcuts

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

Definition at line 12 of file TAPD.h.

◆ _cutvars

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

Definition at line 13 of file TAPD.h.

◆ mom

TMom* TAPD::mom[nOutVar]

Definition at line 15 of file TAPD.h.

TAPD::nOutVar
Definition: TAPD.h:10
TMom::addEntry
void addEntry(double val)
Definition: TMom.cc:88
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
cms::cuda::assert
assert(be >=bs)
TAPD::iAPDoPN
Definition: TAPD.h:10
DDAxes::x
TAPD::set2DCut
void set2DCut(int, const std::vector< double > &, const std::vector< double > &)
Definition: TAPD.cc:151
TAPD::iAPDoPN0
Definition: TAPD.h:10
TMom::setCut
void setCut(double, double)
Definition: TMom.cc:72
TAPD::iAPD
Definition: TAPD.h:10
TAPD::iAPDoAPD0
Definition: TAPD.h:10
TAPD::mom
TMom * mom[nOutVar]
Definition: TAPD.h:15
TAPD::_cutvars
std::vector< int > _cutvars[nOutVar]
Definition: TAPD.h:13
TMom
Definition: TMom.h:7
TAPD::_apdcuts
std::vector< double > _apdcuts[2][nOutVar]
Definition: TAPD.h:12
TAPD::iAPDoPN1
Definition: TAPD.h:10
TAPD::addEntry
void addEntry(double, double, double, double, double, double, double)
Definition: TAPD.cc:42
res
Definition: Electron.h:6
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
heppy_batch.val
val
Definition: heppy_batch.py:351
TAPD::setCut
void setCut(int, double, double)
Definition: TAPD.cc:90
TAPD::init
void init()
Definition: TAPD.cc:24
TAPD::iAPDoAPD1
Definition: TAPD.h:10
TAPD::iTime
Definition: TAPD.h:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TAPD::get
std::vector< double > get(int)
Definition: TAPD.cc:199
ntuplemaker.time
time
Definition: ntuplemaker.py:310
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52