Skip to content
Snippets Groups Projects
Commit 65939652 authored by Pierre Morfouace's avatar Pierre Morfouace
Browse files

Updating Vendeta macro and analysis

parent 0d9df437
No related branches found
No related tags found
No related merge requests found
Pipeline #194873 passed
...@@ -52,7 +52,7 @@ void Analysis::TreatEvent(){ ...@@ -52,7 +52,7 @@ void Analysis::TreatEvent(){
unsigned int FC_mult = FC->AnodeNumber.size(); unsigned int FC_mult = FC->AnodeNumber.size();
unsigned int HF_mult = FC->Time_HF.size(); unsigned int HF_mult = FC->Time_HF.size();
double GammaOffset[11] = {971.37, 970.67, 972.73, 972.59, 989.33, 982.03, 985.83, 985.13, 980.03, 976.83, 971.33}; double GammaOffset[11] = {971.37, 970.67, 972.73, 972.59, 989.33, 982.03, 999.59, 985.13, 980.03, 976.83, 958.46};
double incomingDT=0; double incomingDT=0;
double incomingE=0; double incomingE=0;
...@@ -72,7 +72,7 @@ void Analysis::TreatEvent(){ ...@@ -72,7 +72,7 @@ void Analysis::TreatEvent(){
} }
} }
if(FC_mult==1){ if(FC_mult==1 && incomingDT<1790 && incomingDT>0){
int anode = FC->AnodeNumber[0]; int anode = FC->AnodeNumber[0];
double Time_FC = FC->Time[0]; double Time_FC = FC->Time[0];
......
This diff is collapsed.
...@@ -6,84 +6,102 @@ int nentries=1e6; ...@@ -6,84 +6,102 @@ int nentries=1e6;
///////////////////////////////////// /////////////////////////////////////
void LoadRootFile(){ void LoadRootFile(){
chain = new TChain("PhysicsTree"); chain = new TChain("PhysicsTree");
chain->Add("/home/faster/nptool/Outputs/Analysis/run5.root"); chain->Add("/home/faster/nptool/Outputs/Analysis/run11.root");
//chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_1.root"); //chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_1.root");
//chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_2.root"); //chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_2.root");
//chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_3.root"); //chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_3.root");
//chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_4.root"); //chain->Add("/home/faster/nptool/Outputs/Analysis/test_sampler_qdc_cf_4.root");
} }
///////////////////////////////////// /////////////////////////////////////
void FillTOFHisto(){ void FillTOFHisto(){
LoadRootFile(); LoadRootFile();
nentries = chain->GetEntries(); nentries = chain->GetEntries();
cout << "Number of entries: " << nentries << endl; cout << "Number of entries: " << nentries << endl;
TFile* ofile = new TFile("histo_tof_file_run5.root","recreate"); TFile* ofile = new TFile("histo_tof_file_run11.root","recreate");
TH1F* hLG[791]; TH1F* hLG[791];
TH1F* hHG[791]; TH1F* hHG[791];
vector<double>* FC_Q1 = new vector<double>(); vector<double>* FC_Q1 = new vector<double>();
vector<double>* LG_Tof = new vector<double>(); vector<double>* LG_Tof = new vector<double>();
vector<int>* LG_ID = new vector<int>(); vector<int>* LG_ID = new vector<int>();
vector<int>* LG_Anode_ID = new vector<int>(); vector<double>* LG_DT = new vector<double>();
vector<double>* LG_Q1 = new vector<double>();
vector<double>* HG_Tof = new vector<double>(); vector<double>* LG_Q2 = new vector<double>();
vector<int>* HG_ID = new vector<int>(); vector<int>* LG_Anode_ID = new vector<int>();
vector<int>* HG_Anode_ID = new vector<int>(); vector<bool>* LG_FakeFission = new vector<bool>();
TFissionChamberPhysics* FC = new TFissionChamberPhysics(); vector<double>* HG_Tof = new vector<double>();
chain->SetBranchAddress("FissionChamber",&FC); vector<int>* HG_ID = new vector<int>();
vector<double>* HG_DT = new vector<double>();
chain->SetBranchAddress("FC_Q1",&FC_Q1); vector<double>* HG_Q1 = new vector<double>();
chain->SetBranchAddress("LG_Tof",&LG_Tof); vector<double>* HG_Q2 = new vector<double>();
chain->SetBranchAddress("LG_ID",&LG_ID); vector<int>* HG_Anode_ID = new vector<int>();
chain->SetBranchAddress("LG_Anode_ID",&LG_Anode_ID); vector<bool>* HG_FakeFission = new vector<bool>();
chain->SetBranchAddress("HG_Tof",&HG_Tof);
chain->SetBranchAddress("HG_ID",&HG_ID); TFissionChamberPhysics* FC = new TFissionChamberPhysics();
chain->SetBranchAddress("HG_Anode_ID",&HG_Anode_ID); chain->SetBranchAddress("FissionChamber",&FC);
for(int i=0; i<NumberOfDetectors; i++){ chain->SetBranchAddress("FC_Q1",&FC_Q1);
for(int j=0; j<NumberOfAnodes; j++){ chain->SetBranchAddress("LG_Tof",&LG_Tof);
int index = j + i*NumberOfAnodes; chain->SetBranchAddress("LG_ID",&LG_ID);
TString histo_name = Form("hLG_Det%i_Anode%i",i+1,j+1); chain->SetBranchAddress("LG_DT",&LG_DT);
hLG[index] = new TH1F(histo_name,histo_name,4000,-100,300); chain->SetBranchAddress("LG_Q1",&LG_Q1);
chain->SetBranchAddress("LG_Q2",&LG_Q2);
histo_name = Form("hHG_Det%i_Anode%i",i+1,j+1); chain->SetBranchAddress("LG_FakeFission",&LG_FakeFission);
hHG[index] = new TH1F(histo_name,histo_name,3000,0,300); chain->SetBranchAddress("LG_Anode_ID",&LG_Anode_ID);
} chain->SetBranchAddress("HG_Tof",&HG_Tof);
} chain->SetBranchAddress("HG_ID",&HG_ID);
for(int i=0; i<nentries; i++){ chain->SetBranchAddress("HG_DT",&HG_DT);
chain->GetEntry(i); chain->SetBranchAddress("HG_Q1",&HG_Q1);
chain->SetBranchAddress("HG_Q2",&HG_Q2);
if(i%100000==0){ chain->SetBranchAddress("HG_Anode_ID",&HG_Anode_ID);
cout << "\033[34m\r Processing tree..." << (double)i/nentries*100 << "\% done" << flush; chain->SetBranchAddress("HG_FakeFission",&HG_FakeFission);
}
//int FC_mult = FC->AnodeNumber.size(); for(int i=0; i<NumberOfDetectors; i++){
//cout << FC_mult << endl; for(int j=0; j<NumberOfAnodes; j++){
int mysize = LG_Tof->size(); int index = j + i*NumberOfAnodes;
for(int j=0; j<mysize; j++){ TString histo_name = Form("hLG_Det%i_Anode%i",i+1,j+1);
// LG // hLG[index] = new TH1F(histo_name,histo_name,2000,-100,300);
int index_LG = (LG_Anode_ID->at(j)-1) + (LG_ID->at(j)-1)*NumberOfAnodes;
if(LG_ID->at(j)>0 && LG_Anode_ID->at(j)>0){ histo_name = Form("hHG_Det%i_Anode%i",i+1,j+1);
hLG[index_LG]->Fill(LG_Tof->at(j)); hHG[index] = new TH1F(histo_name,histo_name,1500,0,300);
} }
} }
for(int i=0; i<nentries; i++){
mysize = HG_Tof->size(); chain->GetEntry(i);
for(int j=0; j<mysize; j++){
// HG // if(i%100000==0){
int index_HG = (HG_Anode_ID->at(j)-1) + (HG_ID->at(j)-1)*NumberOfAnodes; cout << "\033[34m\r Processing tree..." << (double)i/nentries*100 << "\% done" << flush;
if(HG_ID->at(j)>0 && HG_Anode_ID->at(j)>0){ }
hHG[index_HG]->Fill(HG_Tof->at(j)); //int FC_mult = FC->AnodeNumber.size();
} //cout << FC_mult << endl;
} int mysize = LG_Tof->size();
} for(int j=0; j<mysize; j++){
// LG //
ofile->Write(); int index_LG = (LG_Anode_ID->at(j)-1) + (LG_ID->at(j)-1)*NumberOfAnodes;
ofile->Close(); double PSD = LG_Q2->at(j)/LG_Q1->at(j);
if(LG_ID->at(j)>0 && LG_Anode_ID->at(j)>0 && LG_FakeFission->at(j)==0 && LG_DT->at(j)>1e7 && PSD>0.7){
hLG[index_LG]->Fill(LG_Tof->at(j));
}
}
mysize = HG_Tof->size();
for(int j=0; j<mysize; j++){
// HG //
int index_HG = (HG_Anode_ID->at(j)-1) + (HG_ID->at(j)-1)*NumberOfAnodes;
double PSD = HG_Q2->at(j)/HG_Q1->at(j);
if(HG_ID->at(j)>0 && HG_Anode_ID->at(j)>0 && HG_FakeFission->at(j)==0 && HG_DT->at(j)>1e7 && PSD>0.7){
hHG[index_HG]->Fill(HG_Tof->at(j));
}
}
}
ofile->Write();
ofile->Close();
} }
...@@ -10,8 +10,7 @@ bool Finder(TH1F* h, Double_t *mean, Double_t *sigma); ...@@ -10,8 +10,7 @@ bool Finder(TH1F* h, Double_t *mean, Double_t *sigma);
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
void OpenRootFile(){ void OpenRootFile(){
//ifile = new TFile("histo_tof_file_q1_80ns.root"); ifile = new TFile("histo_tof_file_run11.root");
ifile = new TFile("histo_tof_file_run5.root");
} }
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
...@@ -99,6 +98,9 @@ void FitTofGammaPeak(){ ...@@ -99,6 +98,9 @@ void FitTofGammaPeak(){
c1->cd(2); c1->cd(2);
gSigma_HG->Draw(); gSigma_HG->Draw();
gSigma_LG->SetName("sigma_LG");
gSigma_HG->SetName("sigma_HG");
gSigma_LG->Write(); gSigma_LG->Write();
gSigma_HG->Write(); gSigma_HG->Write();
...@@ -124,8 +126,8 @@ bool Finder(TH1F* h, Double_t *mean, Double_t *sigma){ ...@@ -124,8 +126,8 @@ bool Finder(TH1F* h, Double_t *mean, Double_t *sigma){
if(nfound == m_NumberOfGammaPeak){ if(nfound == m_NumberOfGammaPeak){
cout << "Gamma Peak Found" << endl; cout << "Gamma Peak Found" << endl;
for(int i=0; i<nfound; i++){ for(int i=0; i<nfound; i++){
linf = xpeaks[i]-2; linf = xpeaks[i]-1.8;
lsup = xpeaks[i]+1; lsup = xpeaks[i]+0.8;
TF1* gauss = new TF1("gaus","gaus",linf,lsup); TF1* gauss = new TF1("gaus","gaus",linf,lsup);
h->Fit(gauss,"RQ"); h->Fit(gauss,"RQ");
......
...@@ -6,19 +6,16 @@ int nentries=1e6; ...@@ -6,19 +6,16 @@ int nentries=1e6;
////////////////////////////////////////////////// //////////////////////////////////////////////////
void OpenRootFile(){ void OpenRootFile(){
chain = new TChain("RawTree"); chain = new TChain("RawTree");
chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_0001.root"); chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_*.root");
chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_0002.root");
chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_0003.root");
chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_0004.root");
chain->Add("/home/faster/fastertonptool/data/rootfiles/run11_0005.root");
} }
////////////////////////////////////////////////// //////////////////////////////////////////////////
void FillRawPSD(){ void FillRawPSD(){
OpenRootFile(); OpenRootFile();
nentries = chain->GetEntries(); nentries = chain->GetEntries();
cout << "Number of entries= " << nentries << endl;
TFile* ofile = new TFile("PSD_histo_run11.root","recreate");
TFile* ofile = new TFile("PSD_histo_run11_160ns.root","recreate");
TH2F* hLG[72]; TH2F* hLG[72];
TH2F* hHG[72]; TH2F* hHG[72];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment