1 #ifndef RECOTOOL_CFALGOTIMEPROF_CXX 2 #define RECOTOOL_CFALGOTIMEPROF_CXX 9 #include "TPrincipal.h" 14 #include "TVirtualFitter.h" 46 for(
auto const& ptr : clusters)
if(!ptr)
return -1;
48 std::vector<util::PxHit> hits0;
49 std::vector<util::PxHit> hits1;
50 std::vector<util::PxHit> hits2;
53 for(
auto const& c : clusters)
64 if(c->Plane() ==0) hits0 = c->GetHitVector();
65 if(c->Plane() ==1) hits1 = c->GetHitVector();
66 if(c->Plane() ==2) hits2 = c->GetHitVector();
110 std::vector<float> tprofmatches;
112 tprofmatches.push_back(tprof01);
113 tprofmatches.push_back(tprof02);
114 tprofmatches.push_back(tprof12);
119 for(
unsigned int a=0;a<tprofmatches.size();a++)
121 if(tprofmatches[a]==-1)
continue;
123 matchscore +=tprofmatches[a];
130 matchscore /= avgcounter;
156 std::vector< std::vector<TH1D*> > signals(nplanes);
157 std::vector< std::vector<TH1D*> > pulses(nplanes);
159 double time_diff = ( detp->
GetXTicksOffset((
int)(hita.at(0).plane),0,0) -
165 for(
auto const& h : hita) {
166 if(h.t > max_time) max_time = h.t;
167 if(h.t < min_time) min_time = h.t;
169 for(
auto const& h : hitb) {
170 if( (h.t + time_diff) > max_time ) max_time = h.t + time_diff;
171 if( (h.t + time_diff) < min_time ) min_time = h.t + time_diff;
174 TH1D histo_a(
"ha",
"", 200, min_time-1, max_time+1);
175 TH1D histo_b(
"hb",
"", 200, min_time-1, max_time+1);
176 TH1D histo_inta(
"hinta",
"", 200, min_time-1, max_time+1);
177 TH1D histo_intb(
"hintb",
"", 200, min_time-1, max_time+1);
181 for(
auto const& ha : hita){
184 double charge = ha.charge;
186 int bin = histo_a.FindBin(time);
187 histo_a.SetBinContent(bin,histo_a.GetBinContent(bin)+charge);
188 for (
int j = bin; j<=histo_a.GetNbinsX(); ++j){
189 histo_inta.SetBinContent(j,histo_inta.GetBinContent(j)+charge);
192 if (histo_inta.Integral()) histo_inta.Scale(1./histo_inta.GetBinContent(histo_inta.GetNbinsX()));
193 for(
auto const& hb : hitb){
194 double time = hb.t + time_diff;
196 double charge = hb.charge;
197 int bin = histo_b.FindBin(time);
198 histo_b.SetBinContent(bin,histo_b.GetBinContent(bin)+charge);
199 for (
int j = bin; j<=histo_b.GetNbinsX(); ++j){
200 histo_intb.SetBinContent(j,histo_intb.GetBinContent(j)+charge);
213 if (histo_intb.Integral()) histo_intb.Scale(1./histo_intb.GetBinContent(histo_intb.GetNbinsX()));
214 ks = histo_inta.KolmogorovTest(&histo_intb);
216 std::cout<<ks<<std::endl;
Double_t TimeToCm() const
virtual unsigned int NumberTimeSamples() const =0
Class def header for a class CFAlgoTimeProf.
virtual double GetXTicksOffset(int p, int t, int c) const =0