35 for(
int j=0;
j<nOutVar;
j++){
37 _apdcuts[0][
j].clear();
38 _apdcuts[1][
j].clear();
41 _apdcuts[0][
j].push_back(0.0);
42 _apdcuts[1][
j].push_back(10.0e6);
43 _cutvars[
j].push_back(
j);
51 addEntry(apd, pn, pn0, pn1, time, 0.0, 0.0);
54 void TAPD::addEntry(
double apd,
double pn,
double pn0,
double pn1,
double time,
double apd0,
double apd1)
58 std::vector <double> valcuts[nOutVar];
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;
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;
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)]);
83 for(
int ivar=0;ivar<nOutVar;ivar++){
84 mom[ivar]->addEntry(val[ivar],valcuts[ivar]);
87 for(
size_t ic=0;ic<_cutvars[ivar].size();ic++){
89 for(
size_t iv=0;iv<_cutvars[ivar].size();iv++){
101 std::vector <int>cutvar;
102 cutvar.push_back(ivar);
104 std::vector <double>lowcut;
105 std::vector <double>highcut;
107 double low=mean-2.0*sig;
109 double high=mean+2.0*sig;
111 lowcut.push_back(low);
112 highcut.push_back(high);
114 setCut(ivar,cutvar,lowcut,highcut);
118 void TAPD::setCut(
int ivar, std::vector<int> cutVars, std::vector<double> lowCut, std::vector<double> highCut){
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());
126 _apdcuts[0][ivar].clear();
127 _apdcuts[1][ivar].clear();
128 _cutvars[ivar].clear();
130 for (
int ic=0;ic<cutdim;ic++){
134 _apdcuts[0][ivar].push_back(lowCut.at(ic));
135 }
else _apdcuts[0][ivar].push_back(0.0);
137 _apdcuts[1][ivar].push_back(highCut.at(ic));
138 _cutvars[ivar].push_back(cutVars.at(ic));
142 mom[ivar]->setCut(_apdcuts[0][ivar],_apdcuts[1][ivar]);
158 void TAPD::set2DCut(
int ivar, std::vector<double> lowCut,std::vector<double> highCut){
160 assert (lowCut.size()==2);
161 assert (highCut.size()==2);
162 std::vector<int> cutVars;
163 cutVars.push_back(ivar);
165 setCut(ivar, cutVars, lowCut, highCut);
186 assert (lowCut.size()==2);
187 assert (highCut.size()==2);
188 std::vector<int> cutVars;
195 assert (lowCut.size()==2);
196 assert (highCut.size()==2);
197 std::vector<int> cutVars;
205 assert (lowCut.size()==2);
206 assert (highCut.size()==2);
207 std::vector<int> cutVars;
217 std::vector<double> res;
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());
void setAPDCut(double, double)
void addEntry(double, double, double, double, double, double, double)
void set2DAPDoPN0Cut(std::vector< double >, std::vector< double >)
std::vector< double > getAPDoPN0()
void setTimeCut(double, double)
void setCut(int, double, double)
void set2DTimeCut(std::vector< double >, std::vector< double >)
void setAPDoPN0Cut(double, double)
std::vector< double > getAPDoPN1()
void set2DAPDoPNCut(std::vector< double >, std::vector< double >)
std::vector< double > getAPDoAPD0()
std::vector< double > get(int)
void set2DAPDoAPD0Cut(std::vector< double >, std::vector< double >)
std::vector< double > getAPDoAPD1()
std::vector< double > getAPD()
void set2DCut(int, std::vector< double >, std::vector< double >)
void set2DAPDCut(std::vector< double >, std::vector< double >)
void set2DAPDoAPD1Cut(std::vector< double >, std::vector< double >)
std::vector< double > getAPDoPN()
void set2DAPDoPN1Cut(std::vector< double >, std::vector< double >)
std::vector< double > getTime()
void setAPDoPNCut(double, double)
void setAPDoPN1Cut(double, double)