1 #ifndef RECOTOOL_CFALGOCHARGEDISTRIB_CXX 2 #define RECOTOOL_CFALGOCHARGEDISTRIB_CXX 40 if ( clusters.size() == 1 )
43 if (
_verbose) { std::cout <<
"Number of clusters taken into account: " << clusters.size() << std::endl; }
49 std::vector<std::vector<util::PxHit> >
Hits;
51 for (
size_t c=0; c < clusters.size(); c++)
52 Hits.push_back( clusters.at(c)->GetHitVector() );
67 for (
size_t c1=0;
c1 < (Hits.size()-1);
c1++){
68 for (
size_t c2=
c1+1;
c2 < Hits.size();
c2++){
69 if (
_verbose) { std::cout <<
"Considering Clusters: " <<
c1 <<
", " <<
c2 << std::endl; }
74 if (
_verbose) { std::cout <<
"Tot Overlap is: " << totOverlap << std::endl << std::endl; }
95 double Tmin = NumTimeSamples;
100 std::vector<float> QprofA(100,0.);
101 std::vector<float> QprofB(100,0.);
106 for(
auto const& hitA : hA) {
107 if(hitA.t > Tmax) Tmax = hitA.t;
108 if(hitA.t < Tmin) Tmin = hitA.t;
110 for(
auto const& hitB : hB) {
111 if(hitB.t > Tmax) Tmax = hitB.t;
112 if(hitB.t < Tmin) Tmin = hitB.t;
116 for(
auto const& hitA : hA){
117 QprofA.at(
int(99*(hitA.t-Tmin)/(Tmax-Tmin)) ) += hitA.charge;
120 for(
auto const& hitB : hB){
121 QprofB.at(
int(99*(hitB.t-Tmin)/(Tmax-Tmin)) ) += hitB.charge;
134 std::cout <<
"Q distribution for Cluster A:" << std::endl;
135 for (
size_t b=0; b < QprofA.size(); b++)
136 if ( QprofA.at(b) != 0 ) { std::cout << b <<
"\t" << QprofA.at(b) << std::endl; }
137 std::cout <<
"Q distribution for Cluster B:" << std::endl;
138 for (
size_t b=0; b < QprofB.size(); b++)
139 if ( QprofB.at(b) != 0 ) { std::cout << b <<
"\t" << QprofB.at(b) << std::endl; }
147 for (
size_t b=0; b < QprofA.size(); b++){
148 if ( QprofA.at(b) < QprofB.at(b) ) { conv += QprofA.at(b); }
149 else { conv += QprofB.at(b); }
151 if (
_verbose) { std::cout <<
"Convolution is: " << conv << std::endl; }
Class def header for a class CFAlgoChargeDistrib.
Double_t TimeToCm() const
virtual unsigned int NumberTimeSamples() const =0
art::PtrVector< recob::Hit > Hits