34 for(
int j=0;
j<nOutVar;
j++){
36 _apdcuts[0][
j].clear();
37 _apdcuts[1][
j].clear();
40 _apdcuts[0][
j].push_back(0.0);
41 _apdcuts[1][
j].push_back(10.0e6);
42 _cutvars[
j].push_back(
j);
48 void TAPD::addEntry(
double apd,
double pn,
double pn0,
double pn1,
double time)
50 addEntry(apd, pn, pn0, pn1, time, 0.0, 0.0);
53 void TAPD::addEntry(
double apd,
double pn,
double pn0,
double pn1,
double time,
double apd0,
double apd1)
57 std::vector <double> valcuts[nOutVar];
60 if(pn!=0) val[iAPDoPN]=apd/pn;
61 else val[iAPDoPN]=0.0;
62 if(pn0!=0) val[iAPDoPN0]=apd/pn0;
63 else val[iAPDoPN0]=0.0;
64 if(pn1!=0) val[iAPDoPN1]=apd/pn1;
65 else val[iAPDoPN1]=0.0;
67 if(apd0!=0.)val[iAPDoAPD0]=apd/apd0;
68 else val[iAPDoAPD0]=0.0;
69 if(apd1!=0.)val[iAPDoAPD1]=apd/apd1;
70 else val[iAPDoAPD1]=0.0;
74 for(
int ivar=0;ivar<nOutVar;ivar++){
75 int dimcut=_cutvars[ivar].size();
76 for(
int ic=0;ic<dimcut;ic++){
77 assert(_cutvars[ivar].at(ic)<nOutVar);
78 valcuts[ivar].push_back(val[_cutvars[ivar].at(ic)]);
82 for(
int ivar=0;ivar<nOutVar;ivar++){
83 mom[ivar]->addEntry(val[ivar],valcuts[ivar]);
86 for(
size_t ic=0;ic<_cutvars[ivar].size();ic++){
88 for(
size_t iv=0;iv<_cutvars[ivar].size();iv++){
100 std::vector <int>cutvar;
101 cutvar.push_back(ivar);
103 std::vector <double>lowcut;
104 std::vector <double>highcut;
106 double low=mean-2.0*sig;
108 double high=mean+2.0*sig;
110 lowcut.push_back(low);
111 highcut.push_back(high);
113 setCut(ivar,cutvar,lowcut,highcut);
117 void TAPD::setCut(
int ivar,
const std::vector<int>& cutVars,
const std::vector<double>& lowCut,
const std::vector<double>& highCut){
120 int cutdim=cutVars.size();
122 assert(cutdim==(
int)lowCut.size());
123 assert(cutdim==(
int)highCut.size());
125 _apdcuts[0][ivar].clear();
126 _apdcuts[1][ivar].clear();
127 _cutvars[ivar].clear();
129 for (
int ic=0;ic<cutdim;ic++){
133 _apdcuts[0][ivar].push_back(lowCut.at(ic));
134 }
else _apdcuts[0][ivar].push_back(0.0);
136 _apdcuts[1][ivar].push_back(highCut.at(ic));
137 _cutvars[ivar].push_back(cutVars.at(ic));
141 mom[ivar]->setCut(_apdcuts[0][ivar],_apdcuts[1][ivar]);
157 void TAPD::set2DCut(
int ivar,
const std::vector<double>& lowCut,
const std::vector<double>& highCut){
159 assert (lowCut.size()==2);
160 assert (highCut.size()==2);
161 std::vector<int> cutVars;
162 cutVars.push_back(ivar);
164 setCut(ivar, cutVars, lowCut, highCut);
185 assert (lowCut.size()==2);
186 assert (highCut.size()==2);
187 std::vector<int> cutVars;
194 assert (lowCut.size()==2);
195 assert (highCut.size()==2);
196 std::vector<int> cutVars;
204 assert (lowCut.size()==2);
205 assert (highCut.size()==2);
206 std::vector<int> cutVars;
216 std::vector<double> res;
220 res.push_back(mom[ivar]->getMean());
221 res.push_back(mom[ivar]->getRMS());
222 res.push_back(mom[ivar]->getM3());
223 res.push_back(mom[ivar]->getNevt());
224 res.push_back(mom[ivar]->getMin());
225 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()
T x() const
Cartesian x coordinate.
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)