25 for (
int j = 0;
j < nOutVar;
j++) {
26 _apdcuts[0][
j].clear();
27 _apdcuts[1][
j].clear();
30 _apdcuts[0][
j].push_back(0.0);
31 _apdcuts[1][
j].push_back(10.0e6);
32 _cutvars[
j].push_back(
j);
39 addEntry(apd, pn, pn0, pn1,
time, 0.0, 0.0);
42 void TAPD::addEntry(
double apd,
double pn,
double pn0,
double pn1,
double time,
double apd0,
double apd1) {
44 std::vector<double> valcuts[nOutVar];
48 val[iAPDoPN] = apd / pn;
52 val[iAPDoPN0] = apd / pn0;
56 val[iAPDoPN1] = apd / pn1;
61 val[iAPDoAPD0] = apd / apd0;
65 val[iAPDoAPD1] = apd / apd1;
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)]);
77 for (
int ivar = 0; ivar < nOutVar; ivar++) {
78 mom[ivar]->addEntry(
val[ivar], valcuts[ivar]);
81 for (
size_t ic = 0; ic < _cutvars[ivar].size(); ic++) {
83 for (
size_t iv = 0;
iv < _cutvars[ivar].size();
iv++) {
93 std::vector<int> cutvar;
94 cutvar.push_back(ivar);
96 std::vector<double> lowcut;
97 std::vector<double> highcut;
104 lowcut.push_back(
low);
105 highcut.push_back(
high);
107 setCut(ivar, cutvar, lowcut, highcut);
111 const std::vector<int>& cutVars,
112 const std::vector<double>& lowCut,
113 const std::vector<double>& highCut) {
115 int cutdim = cutVars.size();
117 assert(cutdim == (
int)lowCut.size());
118 assert(cutdim == (
int)highCut.size());
120 _apdcuts[0][ivar].clear();
121 _apdcuts[1][ivar].clear();
122 _cutvars[ivar].clear();
124 for (
int ic = 0; ic < cutdim; ic++) {
126 if (lowCut.at(ic) > 0) {
127 _apdcuts[0][ivar].push_back(lowCut.at(ic));
129 _apdcuts[0][ivar].push_back(0.0);
131 _apdcuts[1][ivar].push_back(highCut.at(ic));
132 _cutvars[ivar].push_back(cutVars.at(ic));
135 mom[ivar]->setCut(_apdcuts[0][ivar], _apdcuts[1][ivar]);
151 void TAPD::set2DCut(
int ivar,
const std::vector<double>& lowCut,
const std::vector<double>& highCut) {
152 assert(lowCut.size() == 2);
153 assert(highCut.size() == 2);
154 std::vector<int> cutVars;
155 cutVars.push_back(ivar);
157 setCut(ivar, cutVars, lowCut, highCut);
174 assert(lowCut.size() == 2);
175 assert(highCut.size() == 2);
176 std::vector<int> cutVars;
182 assert(lowCut.size() == 2);
183 assert(highCut.size() == 2);
184 std::vector<int> cutVars;
191 assert(lowCut.size() == 2);
192 assert(highCut.size() == 2);
193 std::vector<int> cutVars;
200 std::vector<double>
res;
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());
void setAPDCut(double, double)
void addEntry(double, double, double, double, double, double, double)
std::vector< double > getAPDoPN0()
void setTimeCut(double, double)
void setCut(int, double, double)
void set2DAPDoPN0Cut(const std::vector< double > &, const std::vector< double > &)
void set2DAPDoAPD1Cut(const std::vector< double > &, const std::vector< double > &)
void setAPDoPN0Cut(double, double)
std::vector< double > getAPDoPN1()
std::vector< double > getAPDoAPD0()
void set2DAPDoAPD0Cut(const std::vector< double > &, const std::vector< double > &)
std::vector< double > get(int)
std::vector< double > getAPDoAPD1()
std::vector< double > getAPD()
void set2DAPDoPN1Cut(const std::vector< double > &, const std::vector< double > &)
void set2DCut(int, const std::vector< double > &, const std::vector< double > &)
void set2DAPDoPNCut(const std::vector< double > &, const std::vector< double > &)
std::vector< double > getAPDoPN()
void set2DTimeCut(const std::vector< double > &, const std::vector< double > &)
std::vector< double > getTime()
void set2DAPDCut(const std::vector< double > &, const std::vector< double > &)
void setAPDoPNCut(double, double)
void setAPDoPN1Cut(double, double)