53 string out_basename =
argv[0];
55 out_basename =
argv[3];
65 const double event_time = t0 + 1*
units::ms;
69 for(
int i=0; i<6; i++){
73 vertex +
Vector(0, 0, 0.1*stepsize)),
81 const double nsigma = 3.0;
89 const double t_min = event_time - 1*
units::s;
90 const double t_max = event_time + 1*
units::s;
91 const int nt = (t_max-t_min)/t_sample;
96 const double p_min = -10*p_sample;
97 const double p_max = 10*p_sample;
98 const int np = (p_max-p_min)/p_sample;
99 const Binning pbins(np, p_min, p_max);
104 TCanvas* canvas =
new TCanvas(
"c",
"canvas",1000,1000);
105 gStyle->SetOptStat(0);
124 for(
auto depo :
depos)
126 auto drifted = std::make_shared<Gen::TransportedDepo>(depo, field_origin.x(),
drift_speed);
127 double center_time = drifted->time();
128 double center_pitch = drifted->pos().z();
131 <<
" time-T0=" << (drifted->time()-
t0)/units::us<<
"us" 132 <<
" pt=" << drifted->pos() /
units::mm <<
" mm\n";
137 charge[5 - pcount] =
new TF1(Form(
"charge%d",5-pcount),
"1", center_pitch-0.01, center_pitch+0.01);
141 charge[5 - pcount] =
new TF1(Form(
"charge%d",5-pcount),
"[0]*TMath::Gaus(x, [1], [2], 0)", -0.3, 0.9);
142 charge[5 - pcount]->SetParameters(1, center_pitch, sigma_pitch);
143 charge[5 - pcount]->SetNpx(1000);
148 gd.set_sampling(
tbins, pbins, nsigma, fluctuate);
150 int offsetbin = gd.poffset_bin();
151 cout<<
"Offset bin: "<<offsetbin<<
std::endl;
152 auto weight = gd.weights();
153 for(
unsigned int i=0; i<
weight.size(); i++)
155 if(10-offsetbin-i==0){
157 double check =
WeightGaus(pbins.edge(10), pbins.edge(10)+p_sample, center_pitch, sigma_pitch);
158 cout<<
"weight "<<check<<
endl;
159 y[5 - pcount] =
weight[i];
160 x[5 - pcount] = center_pitch;
161 yc[5 - pcount] =
check;
162 xc[5 - pcount] = center_pitch;
168 cout<<
"Points: "<<pcount<<
endl;
169 cout<<
"Weights: "<<wcount<<
endl;
170 for(
int i=0; i<pcount; i++)
172 cout<<x[i]<<
", "<<y[i]<<
endl;
176 TGraph *
graph =
new TGraph(6, x, y);
177 graph->SetTitle(
"Gaussian");
178 TGraph *graphc =
new TGraph(6, xc, yc);
180 graph->GetXaxis()->SetLimits(-0.3, 0.9);
181 graph->GetYaxis()->SetRangeUser(0, 1.1);
183 graphc->Draw(
"* same");
184 graphc->SetMarkerColor(kRed);
185 graphc->SetMarkerStyle(24);
186 graphc->SetMarkerSize(2);
187 TBox bb(0, 0, 0.3, 1.1);
188 bb.SetLineColor(kRed);
189 bb.SetFillColorAlpha(7, 0.4);
192 Int_t
color[6] = {2, 4, 6, 8, 9, 1};
193 for(
int i=0; i<pcount; i++)
195 charge[i]->Draw(
"same");
196 charge[i]->SetLineColor(color[i]);
197 charge[i]->SetLineStyle(kDashed);
200 canvas->Print(Form(
"%s-Gaus7.pdf", out_basename.c_str()),
"pdf");
double WeightGaus(double x1, double x2, double mean, double sigma)
code to link reconstructed objects back to the MC truth information
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
def graph(desc, maker=maker)
bool check(const std::vector< std::vector< float > > &outputs)
Binning tbins(nticks, t0, t0+readout_time)
A producer of depositions created from some number of simple, linear tracks.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
std::vector< float > Vector
const GenericPointer< typename T::ValueType > & pointer
QTextStream & endl(QTextStream &s)