TCanvas *c1 = new TCanvas("c1","c1");
TFile *fin = new TFile("sort1.root");
TTree *tree = (TTree*)fin->Get("tree");
tree->Print();
ULong64_t timestamp;
Int_t xstrip,ystrip;
Float_t me,de;
tree->SetBranchAddress("timestamp",×tamp);
tree->SetBranchAddress("xstrip",&xstrip);
tree->SetBranchAddress("ystrip",&ystrip);
tree->SetBranchAddress("de",&de);
tree->SetBranchAddress("me",&me);
****************************************************************************** *Tree :tree : sorted events * *Entries : 107136 : Total = 2580874 bytes File Size = 1454832 * * : : Tree compression factor = 1.77 * ****************************************************************************** *Br 0 :timestamp : timestamp/l * *Entries : 107136 : Total Size= 860009 bytes File Size = 544219 * *Baskets : 27 : Basket Size= 32000 bytes Compression= 1.58 * *............................................................................* *Br 1 :me : me/F * *Entries : 107136 : Total Size= 430083 bytes File Size = 246434 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 1.74 * *............................................................................* *Br 2 :de : de/F * *Entries : 107136 : Total Size= 430083 bytes File Size = 379997 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 1.13 * *............................................................................* *Br 3 :xstrip : xstrip/I * *Entries : 107136 : Total Size= 430155 bytes File Size = 133106 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 3.23 * *............................................................................* *Br 4 :ystrip : ystrip/I * *Entries : 107136 : Total Size= 430155 bytes File Size = 149610 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 2.87 * *............................................................................*
//tree->Scan("xstrip:ystrip:timestamp:me","","colsize=30",100,10000);
tree->Draw("de>>hde(3000,0,30000)");//all
tree->Draw("de>>hdem(3000,0,30000)","me>0");//coincide with mwpc
tree->Draw("de>>hdenm(3000,0,30000)","me<0");//mwpc veto
TH1F *hde, *hdem, *hdenm;
hde = (TH1F*)gROOT->FindObject("hde");
hdem = (TH1F*)gROOT->FindObject("hdem");
hdenm = (TH1F*)gROOT->FindObject("hdenm");
hde->Draw();
hdem->SetLineColor(kGreen);
hdenm->SetLineColor(kRed);
hdem->Draw("same");
hdenm->Draw("same");
c1->Draw();
cout<<hdem->Integral(600,750)<<endl;
4172
hdenm->GetXaxis()->SetRangeUser(5000,8000);
hdenm->Draw();
c1->Draw();
tree->Draw("xstrip:ystrip>>(128,0,128,48,0,48)","","colz");
c1->SetLogy(0);
c1->SetLogz(0);
c1->Draw();
struct dssd
{
Float_t energy;
Int_t xstrip,ystrip;
};
dssd ds;
multimap<ULong64_t, dssd> mapimp, mapdec;//implantaion, decay
Long64_t nentries = tree->GetEntriesFast();
for (Long64_t jentry=0; jentry<nentries;jentry++) {
tree->GetEntry(jentry);
ds.energy = de;
ds.xstrip = xstrip;
ds.ystrip = ystrip;
if(me>0) mapimp.insert(pair<ULong64_t,dssd>(timestamp,ds));
else mapdec.insert(pair<ULong64_t,dssd>(timestamp,ds));
}
cout<<"The number of implantation/decay : "<<mapimp.size()<<" "<<mapdec.size()<<endl;
The number of implantation/decay : 77675 29461
一般来说束流在DSSD上有着很宽的位置分布(通过调束,使得束流在注入探测器上有着较宽的分布),且DSSD的每个pixel面积很小,可以认为束流强度不高时,重离子注入到某一颗粒后在一段不长的时间范围内(称为衰变时间窗),该颗粒上发生的衰变事件都是由该注入核引起的。换句话说,可将DSSD探测器看成 $x \times y$ 个独立的探测单元,每个单元在衰变时间窗内只有一个重离子注入,并发生衰变。
参数:ht,hx,hy; bt,be,bx,by
位置关联条件: hx==bx && hy==by
在衰变时间窗内,关联事件(注入时间,衰变时间)为
在衰变时间窗内注入和衰变事件都是关联的,时间差$\delta t=bt-ht$服从指数衰减分布。
在衰变时间窗内,关联事件(注入时间,衰变时间)为
事件 $(ht_i,bt_j),i \neq j$ 之间不存在关联关系,此时其时间差 $\delta t=bt-ht$,是不确定的,分布服从均匀分布。
对于衰变时间窗内的关联事件$(ht_i,bt_j),i = j$ ,$\delta t=bt-ht$服从指数衰减分布。
上述两种类型事件在实验上是不可区分的, 衰变时间谱($\delta t$)呈现指数+平台分布。
hx==bx && hy==by, hz==bz(当粒子注入到多个dssd时);
abs(hx-bx)<2 && abs(hx-bx)<2;
//implantation
ULong64_t hts;
Double_t he;
Int_t hx,hy;
//decay events within decay-time window.
Int_t bhit;
ULong64_t bts[1000];
Double_t be[1000];
Int_t bx[1000],by[1000];
Double_t decaytime[1000];
//for alpha-cascade events analysis
Int_t bphit;
ULong64_t bpts[1000];
Double_t bpe[1000];
TFile *fout=new TFile("decay.root","RECREATE");
TTree *tout= new TTree("tree","decay");
tout->Branch("hts",&hts,"hts/l");
tout->Branch("he",&he,"he/D");
tout->Branch("hx",&hx,"hx/I");
tout->Branch("hy",&hy,"hy/I");
tout->Branch("bhit",&bhit,"bhit/I");
tout->Branch("bts",&bts,"bts[bhit]/l");
tout->Branch("be",&be,"be[bhit]/D");
tout->Branch("bx",&bx,"bx[bhit]/I");
tout->Branch("by",&by,"by[bhit]/I");
tout->Branch("decaytime",&decaytime,"decaytime[bhit]/D");
tout->Branch("bphit",&bphit,"bphit/I");
tout->Branch("bpts",&bpts,"bpts[bphit]/l");
tout->Branch("bpe",&bpe,"bpe[bphit]/D");
ULong64_t twindow = 20000000000;//20s, 时间窗长度 > 10*T1/2
Int_t n=0;
for(auto ia = mapimp.begin(); ia!=mapimp.end();ia++) {
hts = ia->first;
he = ia->second.energy;
hx = ia->second.xstrip;
hy = ia->second.ystrip;
auto ib1 = mapdec.lower_bound(ia->first - twindow/2.); // for negative decaytime
auto ib2 = mapdec.upper_bound(ia->first + twindow); // for positive decaytime
bhit = 0;
bphit = 0;
if(ib1==mapdec.end()) continue;
for( ; ib1!=mapdec.end() && ib1!=ib2; ib1++) {
Int_t delx = abs(ib1->second.xstrip - hx);
Int_t dely = abs(ib1->second.ystrip - hy);
if(delx < 2 && dely < 2) {//deltaX,deltaY =0/-1/+1
bts[bhit] = ib1->first;
be[bhit] = ib1->second.energy;
bx[bhit] = ib1->second.xstrip;
by[bhit] = ib1->second.ystrip;
decaytime[bhit] = Long64_t(ib1->first - hts)/1.e6;//ms
//for alpha-cascade events analysis
if(decaytime[bhit]>0 && delx ==0 && dely ==0) {
bpts[bphit] = ib1->first;
bpe[bphit] = ib1->second.energy;
bphit++;
}
bhit++;
}
}
if(bhit>0) tout->Fill();
n++;
if(n%1000 == 0) cout<<".";
}
cout<<endl;
cout<<"Done!"<<endl;
tout->Write();
fout->Close();
............................................................................. Done!
TFile *fdecay = new TFile("decay.root");
TTree *tree = (TTree *)fdecay->Get("tree");
tree->Print();
****************************************************************************** *Tree :tree : decay * *Entries : 39009 : Total = 4507222 bytes File Size = 2059578 * * : : Tree compression factor = 2.19 * ****************************************************************************** *Br 0 :hts : hts/l * *Entries : 39009 : Total Size= 313277 bytes File Size = 202832 * *Baskets : 10 : Basket Size= 32000 bytes Compression= 1.54 * *............................................................................* *Br 1 :he : he/D * *Entries : 39009 : Total Size= 313263 bytes File Size = 175783 * *Baskets : 10 : Basket Size= 32000 bytes Compression= 1.78 * *............................................................................* *Br 2 :hx : hx/I * *Entries : 39009 : Total Size= 156854 bytes File Size = 48248 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 3.24 * *............................................................................* *Br 3 :hy : hy/I * *Entries : 39009 : Total Size= 156854 bytes File Size = 52315 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 2.99 * *............................................................................* *Br 4 :bhit : bhit/I * *Entries : 39009 : Total Size= 156872 bytes File Size = 19718 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 7.93 * *............................................................................* *Br 5 :bts : bts[bhit]/l * *Entries : 39009 : Total Size= 631982 bytes File Size = 295938 * *Baskets : 25 : Basket Size= 32000 bytes Compression= 2.13 * *............................................................................* *Br 6 :be : be[bhit]/D * *Entries : 39009 : Total Size= 631953 bytes File Size = 262652 * *Baskets : 25 : Basket Size= 32000 bytes Compression= 2.40 * *............................................................................* *Br 7 :bx : bx[bhit]/I * *Entries : 39009 : Total Size= 394707 bytes File Size = 137063 * *Baskets : 18 : Basket Size= 32000 bytes Compression= 2.87 * *............................................................................* *Br 8 :by : by[bhit]/I * *Entries : 39009 : Total Size= 394707 bytes File Size = 141034 * *Baskets : 18 : Basket Size= 32000 bytes Compression= 2.79 * *............................................................................* *Br 9 :decaytime : decaytime[bhit]/D * *Entries : 39009 : Total Size= 632156 bytes File Size = 476584 * *Baskets : 25 : Basket Size= 32000 bytes Compression= 1.32 * *............................................................................* *Br 10 :bphit : bphit/I * *Entries : 39009 : Total Size= 156881 bytes File Size = 18370 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 8.51 * *............................................................................* *Br 11 :bpts : bpts[bphit]/l * *Entries : 39009 : Total Size= 283918 bytes File Size = 123035 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 2.30 * *............................................................................* *Br 12 :bpe : bpe[bphit]/D * *Entries : 39009 : Total Size= 283900 bytes File Size = 103025 * *Baskets : 14 : Basket Size= 32000 bytes Compression= 2.75 * *............................................................................*
TCut cdxdy00 = "abs(bx-hx)==0 && abs(by-hy)==0";
tree->Draw("be:decaytime>>(200,0,2e4,300,5000,8000)",cdxdy00,"colz");
c1->Draw();
TCut cAc211a = "be>7400 && be<7510 && decaytime>0";
tree->Draw("decaytime>>hdtAc211a(200,0,2e4)",cdxdy00 && cAc211a,"colz");
c1->SetLogy();
c1->Draw();
TCut cdxdy11 = "abs(bx-hx)==1 && abs(by-hy)==1 && decaytime>0";
TCut cAc211 = "be>7400 && be<7510";
tree->Draw("decaytime>>hdtAc211b(200,0,2e4)",cdxdy11 && cAc211,"colz");
c1->SetLogy();
c1->Draw();
TCut cdxdy0110 = "abs(bx-hx) + abs(by-hy)==1 && decaytime>0";
TCut cAc211 = "be>7400 && be<7510";
tree->Draw("decaytime>>hdtAc211c(200,0,2e4)",cdxdy0110 && cAc211,"colz");
c1->SetLogy();
c1->Draw();
在下面的处理中只用 $\Delta x/\Delta y = 0$的条件
对不同能量,不同类型的粒子,由于在探测器中的射程和散射程度的不同,关联的位置范围都有可能不同。
应进行上述检验确定合理的位置关联范围。
TF1 *fp01 = new TF1("fp01","pol0",1.5e4,2e4);
hdtAc211a->Fit(fp01,"LR");
Double_t p01 = fp01->GetParameter(0);
c1->SetLogy();
c1->Draw();
FCN=32.4205 FROM MIGRAD STATUS=CONVERGED 53 CALLS 54 TOTAL EDM=6.37252e-07 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p0 1.77985e+00 1.88664e-01 7.38324e-04 -4.23124e-03 ERR DEF= 0.5
TF1 *fdecay1 = new TF1("fdecay1","[0]+[1]*TMath::Exp(-x*TMath::Log(2.)/[2])",1,1e4);//skip 1ms
fdecay1->FixParameter(0,p01);
fdecay1->SetParameter(2,1e2);
hdtAc211a->Fit(fdecay1,"RL");
cout<<endl;
cout<<"half-life of 211Ac is "<<fdecay1->GetParameter(2)<<" +/- "<<fdecay1->GetParError(2)<<" ms"<<endl;
c1->SetLogy();
c1->Draw();
FCN=52.6145 FROM MIGRAD STATUS=CONVERGED 138 CALLS 139 TOTAL EDM=9.13665e-10 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p0 1.77985e+00 fixed 2 p1 6.07619e+02 1.89243e+01 6.55598e-02 -2.12807e-06 3 p2 2.53200e+02 5.92143e+00 2.05334e-02 -6.95988e-06 ERR DEF= 0.5 half-life of 211Ac is 253.2 +/- 5.92143 ms
取前5*decaytime范围作为来自于全部衰变+本底贡献的alpha
取远处20-25*decaytime范围作为来自于本底贡献的alpha
前两者相减作为来自衰变的alpha
蓝色为本底alpha,红色为减本底后的alpha能谱
在下面的图中只有半衰期小于1s的能量大于7400keV的$\alpha$ ($^{211,212}$Ac)减去了正确的本底。
tree->Draw("be>>hbeall(300,5000,8000)",cdxdy00 && "decaytime<5*250");
tree->Draw("be>>hbebkg(300,5000,8000)",cdxdy00 && "decaytime>20*250 && decaytime<25*250");
TH1F *hbeall = (TH1F*)gROOT->FindObject("hbeall");
TH1F *hbebkg = (TH1F*)gROOT->FindObject("hbebkg");
TH1F *hbenet = new TH1F("hbenet","energy_background subtracted",300,5000,8000);
hbenet->Add(hbeall,hbebkg,1,-1);
hbenet->SetLineColor(kRed);
hbeall->SetLineColor(kGreen);
hbeall->Draw();
hbebkg->Draw("same");
hbenet->Draw("same");
c1->SetLogy(0);
c1->Draw();
TCut cdxdy00 = "abs(bx-hx)==0 && abs(by-hy)==0";
tree->Draw("be:decaytime>>(300,-1e4,2e4,300,5000,8000)",cdxdy00,"colz");
c1->Draw();
TCut cAc211a = "be>7400 && be<7510";
tree->Draw("decaytime>>hdtAc211d(300,-1e4,2e4)",cdxdy00 && cAc211a,"colz");
c1->SetLogy();
c1->Draw();
TF1 *fp01d = new TF1("fp01d","pol0",-0.8e4,-0.3e4);
hdtAc211d->Fit(fp01d,"LR");
Double_t p01d = fp01d->GetParameter(0);
c1->SetLogy();
c1->Draw();
FCN=27.3895 FROM MIGRAD STATUS=CONVERGED 53 CALLS 54 TOTAL EDM=1.7046e-07 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p0 1.57993e+00 1.77756e-01 6.42253e-04 -2.32267e-03 ERR DEF= 0.5
TF1 *fdecay2 = new TF1("fdecay2","[0]+[1]*TMath::Exp(-x*TMath::Log(2.)/[2])",1,1e4);
fdecay2->FixParameter(0,p01d);
fdecay2->SetParameter(2,1e2);
hdtAc211d->Fit(fdecay2,"RL");
cout<<endl;
cout<<"half-life of 211Ac is "<<fdecay2->GetParameter(2)<<" +/- "<<fdecay2->GetParError(2)<<" ms"<<endl;
c1->SetLogy();
c1->Draw();
FCN=52.6114 FROM MIGRAD STATUS=CONVERGED 137 CALLS 138 TOTAL EDM=8.41325e-08 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p0 1.57993e+00 fixed 2 p1 6.05513e+02 1.88295e+01 6.52003e-02 -9.64404e-06 3 p2 2.54654e+02 5.93702e+00 2.05807e-02 2.19015e-05 ERR DEF= 0.5 half-life of 211Ac is 254.654 +/- 5.93702 ms
TCut cdxdy00 = "abs(bx-hx)==0 && abs(by-hy)==0";
tree->Draw("be>>hbealln(300,5000,8000)",cdxdy00 && "decaytime>0 && decaytime<5*250");
TH1F *hbealln = (TH1F*)gROOT->FindObject("hbealln");
tree->Draw("be>>hbebkgn(300,5000,8000)",cdxdy00 && "decaytime>-5*250-300 && decaytime<-300");
TH1F *hbebkgn = (TH1F*)gROOT->FindObject("hbebkgn");
TH1F *hbenetn = new TH1F("hbenetn","energy_background subtracted",300,5000,8000);
hbenetn->Add(hbealln,hbebkgn,1,-1);
hbenetn->SetLineColor(kRed);
hbealln->SetLineColor(kGreen);
hbealln->Draw();
hbebkgn->Draw("same");
hbenetn->Draw("same");
c1->SetLogy(0);
c1->Draw();
选择事件:decaytime>0 && bx==hx && by==hy
bpts[0]-ht<700 //ms
bpts[1]-bpts[0]<19*1000 //ms
tree->Draw("bphit","bphit>0");
c1->SetLogy();
c1->Draw();
TCut cs1 = "bphit>1 && (bpts[0]-hts)/1.e6<700";
TCut cs2 = "(bpts[1]-bpts[0])/1.e6<19000";
tree->Draw("bpe[1]:bpe[0]>>hbe12(200,6000,8000,200,6000,8000)",cs1&&cs2,"colz");
c1->SetLogy(0);
c1->Draw();
TCut cecut = "abs(bpe[1]-6767)<50 && abs(bpe[0]-7477)<50";
tree->Draw("(bpts[1]-bpts[0])/1.e6>>hdt12(100,0,20000)",cs1&&cs2&&cecut ,"colz");
c1->SetLogy();
c1->Draw();