Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 181 → Rev 182

/drs/drs.C
93,15 → 93,15
sprintf(histname,"cftime_%02d",i);
h1_cftime[i]=new TH1F(histname,histname,500,d[i].twin[0],d[i].twin[1]);
sprintf(histname,"cftdif_%02d",i);
h1_cftdif[i]=new TH1F(histname,histname,2000,d[i].twin[0],d[i].twin[1]);
h1_cftdif[i]=new TH1F(histname,histname,2000,d[i].twin[0]-d[trgch].twin[0],d[i].twin[1]-d[trgch].twin[0]);
sprintf(histname,"qdc_%02d",i);
h1_qdc[i]=new TH1F(histname,histname,500,-0.1,4.9);
h1_qdc[i]=new TH1F(histname,histname,500,-0.5,4.5);
sprintf(histname,"dpo_%02d",i);
h2_dpo[i]=new TH2F(histname,histname,DWIDTH,-0.1,204.7,1100,-0.55,0.55);
sprintf(histname,"tdcadc_%02d",i);
h2_tdcadc[i]=new TH2F(histname,histname,250,0.,0.5,400,d[i].twin[0],d[i].twin[1]);
h2_tdcadc[i]=new TH2F(histname,histname,250,-0.1,0.5,400,d[i].twin[0]-d[trgch].twin[0],d[i].twin[1]-d[trgch].twin[0]);
sprintf(histname,"ctdcadc_%02d",i);
h2_ctdcadc[i]=new TH2F(histname,histname,250,0.,0.5,400,d[i].twin[0],d[i].twin[1]);
h2_ctdcadc[i]=new TH2F(histname,histname,250,-0.1,0.5,400,d[i].twin[0]-d[trgch].twin[0],d[i].twin[1]-d[trgch].twin[0]);
gr_wfm[i]=new TGraph(DWIDTH);
gr_wfm[i]->SetMinimum(-0.55);
gr_wfm[i]->SetMaximum(0.55);
189,15 → 189,22
if (recid[0] == 'E') {
for ( i=0; i<nch; i++) {
if (!lwfm[i]) continue;
if ((chmin[i][0]>d[i].vcut[0])&&(chmin[i][0]<d[i].vcut[1])) {
h1_cftdif[i]->Fill(cftime[i]-cftime[trgch]+110.);
double pulseheight = (d[i].edge)? chmax[i][0]: chmin[i][0];
if ((pulseheight >d[i].vcut[0])&&
(pulseheight <d[i].vcut[1]) ) {
h1_cftdif[i]->Fill(cftime[i]-cftime[trgch]);
}
// h2_tdcadc[i]->Fill(-chmin[i][0],letime[i][1]-cftime[trgch][1]+72);
// h2_ctdcadc[i]->Fill(-chmin[i][0],cftime[i][1]-cftime[trgch][1]+72);
h2_tdcadc[i]->Fill(-chmin[0][0],letime[i]-cftime[trgch]+72);
h2_ctdcadc[i]->Fill(-chmin[0][0],cftime[i]-cftime[trgch]+72);
if (!d[i].edge) pulseheight = - pulseheight;
h2_tdcadc[i] ->Fill(pulseheight,letime[i]-cftime[trgch]);
h2_ctdcadc[i]->Fill(pulseheight,cftime[i]-cftime[trgch]);
//if (i==1) printf("ph=%f %f\n", pulseheight, letime[i]-cftime[trgch]);
}
h2_ctalk->Fill(-chmin[0][0],-chmin[1][0]);
double ph0 = (d[0].edge)? chmax[0][0]: -chmin[0][0];
double ph1 = (d[1].edge)? chmax[1][0]: -chmin[1][0];
h2_ctalk->Fill(ph0,ph1);
}
if (event<1) continue;
if (recid[0]!='C') continue;
257,7 → 264,8
float t0n = t[i-1];
// charge in the range
if ((t0>d[ich].adcgate[0])&&(t0<d[ich].adcgate[1])) {
qdc[ich]+=-y[i]*(t0p-t0n)/2;
float sign = (d[ich].edge)? 1: -1;
qdc[ich]+=sign*y[i]*(t0p-t0n)/2.;
}
}
 
329,10 → 337,10
// float threshold[4][2]={{0.,-0.05},{0.,-0.05},{0.,-0.25},{0.,-0.25}};
// float twin[4][2]={{80.,100.},{80.,100.},{90.,110.},{50.,70.}};
// float adcgate[4][2]={{80.,110.},{80.,110.},{90.,110.},{50.,70.}};
float threshold[4][2]={{0.,-0.05},{0.,-0.05},{0.,-0.25},{0.,-0.25}};
double threshold[4][2]={{0.,-0.05},{0.,-0.05},{0.,-0.25},{0.,-0.25}};
float twin[4][2]={{100.,120.},{100.,120.},{110.,130.},{60.,80.}};
float adcgate[4][2]={{105.,125.},{105.,125.},{110.,130.},{60.,80.}};
float vcut[4][2]={{-0.49,-0.07},{-1,1},{-1,1},{-1,1}};
double vcut[4][2]={{-0.49,-0.07},{-1,1},{-1,1},{-1,1}};
int edge[4]={1,1,1,1};// 0 -- rising, 1 -- falling
 
DrsChannel c[2];