TF1*f_sp_ps=newTF1("f_sp_ps","[0]*pow(x,[1])+[2]",50,250);//stopping power of protons in polystyrene [MeV cm2 /g]
f_sp_ps->SetParameters(361.936,-0.892255,1.19133);//protons between 50 and 220 MeV
if(fChain==0)return;
Long64_tnentries=fChain->GetEntriesFast();
Long64_tnbytes=0,nb=0;
for(Long64_tjentry=0;jentry<nentries;jentry++){
Long64_tientry=LoadTree(jentry);
if(ientry<0)break;
nb=fChain->GetEntry(jentry);nbytes+=nb;
// if (Cut(ientry) < 0) continue;
// cout << jentry << endl;
h_endist_0->Fill(ENDIST[0]);// edep by ionisation
h_endist_1->Fill(ENDIST[1]);// edep by pi0, e-, e+ and #gamma
h_endist_2->Fill(ENDIST[2]);// edep by nuclear recoils and heavy fragments
h_endist_3->Fill(ENDIST[3]);// edep by part. #lt threshold
h_endist_4->Fill(ENDIST[4]);// E leaving the syste
h_endist_5->Fill(ENDIST[5]);// E carried by discarded particles
h_endist_6->Fill(ENDIST[6]);// resid, excit. E after evap.
h_endist_7->Fill(ENDIST[7]);// edep by low-energy neutrons
h_endist_8->Fill(ENDIST[8]);// E of part. #gt time limit
h_endist_9->Fill(ENDIST[9]);// E lost in endothermic nuclear reactions
h_endist_10->Fill(ENDIST[10]);// E lost in endothermic low-E n-reaction
h_endist_11->Fill(ENDIST[11]);// missing E
etotal=0.;
for(unsignedinti=0;i<3;i++){
etotal+=ENDIST[i];
}
ratio_electron=ENDIST[1]/etotal;
ratio_primary=ENDIST[0]/etotal;
h_ratio_e->Fill(ratio_electron);
h_ratio_p->Fill(ratio_primary);
h_sum_ep->Fill(ENDIST[1]+ENDIST[0]);
h_let_ep->Fill((ENDIST[1]+ENDIST[0])/scale);
h_let_e->Fill((ENDIST[1])/scale);
h_let_p->Fill((ENDIST[0])/scale);
spratio=(((ENDIST[0]+ENDIST[1])/scale*1000/1.06)/f_sp_ps->Eval((DATA_ENERGY[0]+ENDIST[4])*1000));//ratio of deposited energy to PSTAR stopping power (MeV/cm/density) / MeVcm2/g