TH2D *corr_ctofvstx=new TH2D("corr_ctofvstx","corr_ctofvstx",240,-120,120,75,2.5,4);//ctof归一到100 cm且考虑offset影响后与tx关联
TH2D *corr_ctofvstx1=new TH2D("corr_ctofvstx1","corr_ctofvstx (all gamma)",240,-120,120,75,2.5,4);//ctof归一到100 cm且考虑offset影响(all gamma)后与tx关联
TH1D *corr_tof=new TH1D("corr_tof","corr_tof",200,0, 20);//模拟得到的tof归一到100 cm
TH1D *ntof=new TH1D("ntof","ntof",200,0, 20);//模拟测的得到的ctof归一到100 cm
TH1D *ntof1=new TH1D("ntof1","ntof all gamma",200,0, 20);//模拟测的得到的ctof归一到100 cm(all gamma)
TH1D *hce=new TH1D("hce","hce",500,0, 200);//模拟测的得到的ctof归一到100 cm
TH1D *hce1=new TH1D("hce1","hce all gamma",500,0, 200);//模拟测的得到的ctof归一到100 cm(all gamma)
//对事件进行遍历
Long64_t nentries=tree->GetEntries();
for(Long64_t jentry=0; jentry<nentries; jentry++)
{
tree->GetEntry(jentry);
Double_t tx=3.742*(td-tu-14.915); //时间差法刻度的位置
Double_t d=TMath::Sqrt(502.5*502.5+tx*tx);//考虑了探测器的厚度的飞行距离
Double_t corr_ctof=(ctof-26.2096)/d*100.;//不同距离的tof统一修正到100 cm
corr_ctofvstx->Fill(tx, corr_ctof);
Double_t C=d/30.-(42.9542+1.95083e-6*tx+3.20798e-5*tx*tx);
Double_t corr_ctof1=(ctof+C)/d*100.;//不同距离的tof统一修正到100 cm all gamma
corr_ctofvstx1->Fill(tx, corr_ctof1);
ntof->Fill(corr_ctof);
ntof1->Fill(corr_ctof1);
corr_tof->Fill(tof*100./d);
if( pid ==1)
{
Double_t ce=(939.56563*100.*100.)/(2.*30.*30.*corr_ctof*corr_ctof);
hce->Fill(ce);
Double_t ce1=(939.56563*100.*100.)/(2.*30.*30.*corr_ctof1*corr_ctof1);
hce1->Fill(ce1);
}
/* else
{
Double_t ce=0.;
hce->Fill(ce);
Double_t ce1=0.;
hce1->Fill(ce1);
}*/
}
corr_ctofvstx->Draw("colz");
c1->Draw();