36 TDirectory *
dir =
new TDirectoryFile(
"FCAL",
"FCAL");
39 tree1 =
new TTree(
"digihit",
"digihit" );
41 cout <<
" SASCHA I AM HERE " << endl;
44 tree1->Branch(
"nhit", &nhit,
"nhit/I");
45 tree1->Branch(
"column", &
column,
"column[nhit]/I");
46 tree1->Branch(
"row", &row,
"row[nhit]/I");
47 tree1->Branch(
"peak", &peak,
"peak[nhit]/I");
48 tree1->Branch(
"integral", &integral,
"integral[nhit]/I");
49 tree1->Branch(
"pedestal", &
pedestal,
"pedestal[nhit]/I");
50 tree1->Branch(
"time", &time,
"time[nhit]/I");
51 tree1->Branch(
"qf", &qf,
"qf[nhit]/I");
53 tree1->Branch(
"waveform", &waveform,
"waveform[nhit][100]/I");
55 tree1->Branch(
"nsamples_integral", &nsamples_integral,
"nsamples_integral/I");
56 tree1->Branch(
"nsamples_pedestal", &nsamples_pedestal,
"nsamples_pedestal/I");
60 for(Int_t ii = 0; ii < 59; ii++){
61 for(Int_t jj = 0; jj < 59; jj++){
66 sprintf(title,
"Waveform_%d_%d",ii, jj);
67 fcal_wave[ii][jj] =
new TProfile(title,title,100,-0.5,99.5,-10.,4096);
69 sprintf(title1,
"Peak_%d_%d", ii, jj);
70 fcal_peak[ii][jj] =
new TH1F(title1, title1, 4096, -0.5, 4095.5);
103 vector<const DFCALDigiHit*> fcal_digihits;
105 loop->Get(fcal_digihits);
107 cout <<
" Event number = " << eventnumber << endl;
108 cout <<
" Number of hits = " << fcal_digihits.size() << endl;
112 memset(row,0,
sizeof(row));
113 memset(peak,0,
sizeof(peak));
114 memset(integral,0,
sizeof(integral));
116 memset(time,0,
sizeof(time));
117 memset(qf,0,
sizeof(qf));
118 memset(waveform,0,
sizeof(waveform));
119 nsamples_integral = 0;
120 nsamples_pedestal = 0;
123 japp->RootWriteLock();
126 for(
unsigned int ii = 0; ii < fcal_digihits.size(); ii++){
134 row[nhit] = fcal_hit->
row;
141 time[nhit] = (fcal_hit->
pulse_time & 0x7FC0) >> 6;
142 qf[nhit] = fcal_hit->
QF;
149 fcal_peak[
column[nhit]][row[nhit]]->Fill(
float(fcal_hit->
pulse_peak) - 100.);
156 fcal_hit->GetSingle(pulsedata);
160 pulsedata->GetSingle(windorawdata);
164 const vector<uint16_t> &samplesvector = windorawdata->
samples;
166 unsigned int nsamples = samplesvector.size();
168 for(uint16_t samp = 0; samp < nsamples; samp++){
169 waveform[nhit][samp] = samplesvector[samp];
171 fcal_wave[
column[nhit]][row[nhit]]->Fill(
float(samp),
float(samplesvector[samp]));
181 else cout <<
"Too many hits " << endl;
uint32_t QF
Quality Factor from FPGA algorithms.
uint32_t pulse_peak
maximum sample in pulse
uint32_t nsamples_integral
number of samples used in integral
sprintf(text,"Post KinFit Cut")
vector< uint16_t > samples
uint32_t pulse_time
identified pulse time as returned by FPGA algorithm
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t init(void)
Called once at program start.
uint32_t pedestal
pedestal info used by FPGA (if any)
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
uint32_t pulse_integral
identified pulse integral as returned by FPGA algorithm
uint32_t nsamples_pedestal
number of samples used in pedestal
jerror_t brun(JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t fini(void)
Called after last event of last event source has been processed.
static TH1I * pedestal[nChan]