23 #include <TApplication.h>
44 const int feech[] = { 115, 119, 123, 127, 113, 117, 121, 125 };
60 cout <<
"evDisplay <prdf>" << endl;
65 Double_t
par0[] = { 0., 0., 4., 0., 0., 0.};
75 signal = par[0]*pow((x[0]-par[1]),par[2])*exp(-(x[0]-par[1])*par[3]);
82 fittime =
new TH1F(
"fittime",
"Fitted pulse peak time", 100, 0., 24.);
83 fitmax =
new TH1F(
"fitmax",
"Fitted pulse amplitude", 500, 0., 5000.);
84 fitwidth =
new TH1F(
"fitwidth",
"Fitted pulse width", 100, 0., 5.);
85 pedval =
new TH1F(
"pedval",
"Pedestal at t==0", 100, 2000.,2100.);
86 pedslope =
new TH1F(
"pedslope",
"Pedestal slope", 100, -1., 1.);
87 fitintegral =
new TH1F(
"fitintegral",
"Integral of fitted curve (pedestal suppressed)", 100, 0., 10000.);
96 TString fitName =
feech[chan]%2?
"HG_" :
"LG_";
99 fitName +=
feech[chan];
101 shapes[chan]= (TF1*) (gROOT->FindObject(
"fitName"));
106 shapes[chan]->SetLineColor(2);
108 Double_t peakVal = 0.;
109 for (
int iSample=0; iSample<
NSAMPLES; iSample++) {
110 if(
shapeD[chan][iSample]>peakVal) {
111 peakVal =
shapeD[chan][iSample];
116 if(peakVal<0.) peakVal = 0.;
117 par0[0] = peakVal/3.;
129 gpulse[chan]->Fit(
shapes[chan],
"",
"RQ", 0., (Double_t)NSAMPLES);
134 cout<<
"EVENT "<<
nevents<<
" SHAPE "<<(
char*)(
shapes[chan]->GetName())<<
" peakVal "<<peakVal<<
" peakPos "<<peakPos<<
" fitMax "<<fMax<<
" fitPos "<<fPos<<endl;
144 int main(
int argc,
char **argv)
152 TString prdfname = argv[1];
153 TString basename = prdfname;
154 basename.ReplaceAll(
".prdf",
"");
155 Ssiz_t lastslash = basename.Last(
'/');
156 basename.Remove(0,lastslash+1);
158 basename.ReplaceAll(
"rc-",
"");
161 char *
file = argv[1];
162 TApplication theApp(
"theApp",&argc,argv);
175 ev_display =
new TCanvas(
"sphenix",
"sphenix display",400*nx_c,200*ny_c);
185 for (
int ich=0; ich<
NCH; ich++)
188 name =
"gch"; name += ich;
189 gpulse[ich]->SetName(name);
190 gpulse[ich]->SetMarkerStyle(20);
191 gpulse[ich]->SetMarkerSize(0.4);
202 cout <<
"Couldn't open input file " << file << endl;
215 cout <<
"eventseq " << eventseq <<
" event type = " << evt->
getEvtType() << endl;
226 int nmod_per_fem = spacket->
iValue(0,
"NRMODULES");
228 cout <<
"EVENT "<<eventseq <<
" modules per FEM "<<nmod_per_fem<<endl;
230 for (
int ich=0; ich<
NCH; ich++)
233 for (
int isamp=0; isamp<
NSAMPLES; isamp++)
236 gpulse[ich]->SetPoint(isamp,(Double_t)isamp,(Double_t)val);
237 shapeD[ich][isamp] = (Double_t)val;
259 cout<<
"Updating canvas "<<endl;
285 cout<<
"ALLDONE"<<endl;