Skip to content
Snippets Groups Projects
Commit 1e068a96 authored by Theodore Efremov's avatar Theodore Efremov :hibiscus:
Browse files

advance in the understanding of the chio

parent 3314319e
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #362456 passed
#ifndef TICPHYSICS_H
#ifdef TICPHYSICS_H
#define TICPHYSICS_H
#include "TICPhysics.h"
#endif
#include <TCanvas.h>
#include <TChain.h>
#include <TF1.h>
......@@ -9,7 +12,6 @@
#include <fstream>
#include <vector>
#endif
using namespace std;
//////////////////////////////////////////////////////////////////////////////////////////
......@@ -39,13 +41,17 @@ void ICCorr() {
vector<TH2F*> hIC,hICorr;
TH2F* hICorr_X = new TH2F("hICorr_X","hICorr_X",1000,-600,400,500,1,1.6);
TH2F* hICorr_Y = new TH2F("hICorr_Y","hICorr_Y",1000,-100,100,500,1,1.6);
TH2F* hDE_Ecorr = new TH2F("DE_Ecorr","DE_Ecorr",1000,100,1,1000,100,1);
TH2F* hDEBis_Ecorr = new
TH2F("DEBis_Ecorr","DEBis_Ecorr",1000,0,20000,1000,0,25000);
TH2F* hDE_E = new TH2F("DE_E","DE_E",1000,100,1,1000,100,1);
TH2F* hDE_Ecorr01 = new TH2F("DE_Ecorr01","DE_Ecorr01",1000,100,1,1000,100,1);
TH2F* hDEBis_Ecorr01 = new
TH2F("DEBis_Ecorr01","DEBis_Ecorr01",1000,0,20000,1000,0,25000);
TH2F* hDE_E_IC1_Corr = new
TH2F("hDE_E_IC1_Corr","hDE_E_IC1_Corr",1000,0,20000,1000,0,25000);
TH2F* hDE_E_IC0_Corr = new
TH2F("hDE_E_IC0_Corr","hDE_E_IC0_Corr",1000,0,20000,1000,0,25000);
hICorr.push_back(hICorr_X);
hICorr.push_back(hICorr_Y);
......@@ -91,18 +97,21 @@ void ICCorr() {
}
chain->GetEntry(e);
// Correction 1on0
double IC_CorrX = IC->fIC_raw[1]/ IC->fIC_raw[0] * spline[0]->Eval(0) /
spline[0]->Eval(FF_IC_X) ;
double IC0_CorrX = IC->fIC_raw[1] / IC_CorrX ;
double IC_temp_CorrX = IC->fIC_raw[1] / IC_CorrX ;
double IC_CorrY = IC->fIC_raw[1]/ IC0_CorrX * spline[1]->Eval(0) /
double IC_CorrY = IC->fIC_raw[1]/ IC_temp_CorrX * spline[1]->Eval(0) /
spline[1]->Eval(FF_IC_Y) ;
hICorr[0]->Fill(FF_IC_X,IC_CorrX);
hICorr[1]->Fill(FF_IC_Y,IC_CorrY);
//Correction 1
double IC0_Corr = IC->fIC_raw[1] /IC_CorrY;
if (IC0_Corr != IC0_Corr ) IC0_Corr = 0;
......@@ -112,8 +121,11 @@ void ICCorr() {
double IC1_CorrX = IC->fIC_raw[1] * spline[2]->Eval(0) /
spline[2]->Eval(FF_IC_X) ;
//Correction 0
double IC0_CorrY = IC->fIC_raw[0] * spline[4]->Eval(0)/ spline[4]->Eval(FF_IC_Y);
double IC0_CorrX = IC->fIC_raw[0] * spline[3]->Eval(0)/ spline[3]->Eval(FF_IC_X);
double DE = 0 ,E =0 ,DEcorr=0 ,DEIC1corr =0;
double DE = 0 ,E =0 ,DEcorr=0 ,DEIC1corr =0, DE_IC0_Corr_Y=0;
//===========================================================================================================
// Fill De from seg 1 to 3
......@@ -129,15 +141,23 @@ void ICCorr() {
// Filling DE with ICO
//===========================================================================================================
DEcorr += DE ;
DE_IC0_Corr_Y += DE;
if ((IC0_Corr < 1e100 && IC0_Corr >-1000) || true){
DEcorr += IC0_Corr ;
}
else DEcorr += IC->fIC_raw[0];
if ((IC0_CorrX < 1e100 && IC0_CorrX >-1000) || true){
DE_IC0_Corr_Y += IC0_CorrX ;
}
else DE_IC0_Corr_Y += IC->fIC_raw[0];
DE += IC->fIC_raw[0] ;
DE = DE *0.5 + IC->fIC_raw[4];
DEcorr = DEcorr *0.5 + IC->fIC_raw[4];
DE_IC0_Corr_Y = DE_IC0_Corr_Y *0.5 + IC->fIC_raw[4];
/*
cout << IC0_Corr << " " << IC->fIC_raw[0] << endl;
......@@ -154,10 +174,11 @@ void ICCorr() {
//double DE_Bis = 0.5*(IC->fIC_raw[1]+IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
DEIC1corr = 0.5*(IC1_CorrY +IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
hDEBis_Ecorr->Fill(E,DE_Bis);
hDEBis_Ecorr01->Fill(E,DE_Bis);
hDE_E->Fill(E,DE);
hDE_Ecorr->Fill(E,DEcorr);
hDE_Ecorr01->Fill(E,DEcorr);
hDE_E_IC1_Corr->Fill(E,DEIC1corr);
hDE_E_IC0_Corr->Fill(E,DE_IC0_Corr_Y);
} //End loop on event
//===========================================================================================================
......@@ -180,10 +201,10 @@ void ICCorr() {
c2->cd(1);
hDE_E->Draw();
c2->cd(2);
hDE_Ecorr->Draw();
hDE_Ecorr01->Draw();
c2->cd(3);
hDEBis_Ecorr->Draw();
hDEBis_Ecorr01->Draw();
c2->cd(4);
hDE_E_IC1_Corr->Draw();
hDE_E_IC0_Corr->Draw();
} // End spline chio XY
......@@ -3,10 +3,13 @@
The first segment of the IC of vamos has some inhomegeneity on its response while moving on the X or
Y axis.
To correct it we create a spline of the ratio between the signal given by a good
functionning segment and the first segment.
Then we substract the evaluation of this spline to the data.
- There is an decreasing exponential dependencie in y of the signal due to
electron recombination
- The signal between the frisch grid and the anode shouldn't be used due to
dependencie with the distance to the anode and of the removal of the screening
of the electron by the grid.
- We should use the edge of the distribution in Y to make our fit of the
exponential to automatically select one of the lighter ion.
## The code
......
//#ifdef TICPhysics
#include "TICPhysics.h"
#include <TICPhysics.h>
//#endif
#include <TCanvas.h>
#include <TChain.h>
......
#include "TICPhysics.h"
#include <TCanvas.h>
#include <TChain.h>
#include <TF1.h>
#include <TFile.h>
#include <TH2.h>
#include <TSpline.h>
#include <fstream>
#include <vector>
using namespace std;
//////////////////////////////////////////////////////////////////////////////////////////
void TestSpline() {
//===========================================================================================================
// Loading var
//===========================================================================================================
TChain* chain = new TChain("PhysicsTree");
chain->Add("../../../root/analysis/VamosCalib241.root");
TICPhysics* IC = new TICPhysics() ;
double FF_IC_X, FF_IC_Y;
chain->SetBranchStatus("FF_IC_X", true);
chain->SetBranchAddress("FF_IC_X", &FF_IC_X);
chain->SetBranchStatus("FF_IC_Y", true);
chain->SetBranchAddress("FF_IC_Y", &FF_IC_Y);
chain->SetBranchStatus("IC", true);
chain->SetBranchAddress("IC", &IC);
TFile* fHisto = TFile::Open("Output/Histo.root");
TFile* fSpline = TFile::Open("Output/spline_Chio_2024.root");
vector<TH2F*> hIC,hICorr;
TH2F* hICorr_X = new TH2F("hICorr_X","hICorr_X",1000,-600,400,500,1,1.6);
TH2F* hICorr_Y = new TH2F("hICorr_Y","hICorr_Y",1000,-100,100,500,1,1.6);
TH2F* hDE_Ecorr = new TH2F("DE_Ecorr","DE_Ecorr",1000,100,1,1000,100,1);
TH2F* hDEBis_Ecorr = new
TH2F("DEBis_Ecorr","DEBis_Ecorr",1000,0,20000,1000,0,25000);
TH2F* hDE_E = new TH2F("DE_E","DE_E",1000,100,1,1000,100,1);
TH2F* hDE_E_IC1_Corr = new
TH2F("hDE_E_IC1_Corr","hDE_E_IC1_Corr",1000,0,20000,1000,0,25000);
hICorr.push_back(hICorr_X);
hICorr.push_back(hICorr_Y);
hIC.push_back((TH2F*)fHisto->Get("hChio_IC0_IC1_X_all"));
hIC.push_back((TH2F*)fHisto->Get("hChio_IC0_IC1_Y_all"));
vector<TSpline3*> spline;
for (int i = 0; i < 4; i++) {
if (i<2) spline.push_back((TSpline3*)fSpline->Get(Form("fsplineIC0_%d",i)));
else if ( i>=2 && i<4) spline.push_back((TSpline3*)fSpline->Get(Form("fsplineIC1_%d",i)));
} //End loop on histogram
//===========================================================================================================
// Event Loop
//===========================================================================================================
int Nentries = chain->GetEntries();
for (int e = 0; e < Nentries; e++) {
// Printing status
if (e % 100000 == 0){
cout << "Please wait, we are " << e * 100. / Nentries << "% done ..\r" << flush;
}
chain->GetEntry(e);
double IC_CorrX = IC->fIC_raw[1]/ IC->fIC_raw[0] * spline[0]->Eval(0) /
spline[0]->Eval(FF_IC_X) ;
double IC0_CorrX = IC->fIC_raw[1] / IC_CorrX ;
double IC_CorrY = IC->fIC_raw[1]/ IC0_CorrX * spline[1]->Eval(0) /
spline[1]->Eval(FF_IC_Y) ;
hICorr[0]->Fill(FF_IC_X,IC_CorrX);
hICorr[1]->Fill(FF_IC_Y,IC_CorrY);
double IC0_Corr = IC->fIC_raw[1] /IC_CorrY;
if (IC0_Corr != IC0_Corr ) IC0_Corr = 0;
double IC1_CorrY = IC->fIC_raw[1] * spline[3]->Eval(0) /
spline[3]->Eval(FF_IC_Y) ;
double IC1_CorrX = IC->fIC_raw[1] * spline[2]->Eval(0) /
spline[2]->Eval(FF_IC_X) ;
double DE = 0 ,E =0 ,DEcorr=0 ,DEIC1corr =0;
//===========================================================================================================
// Fill De from seg 1 to 3
//===========================================================================================================
for (int seg = 0 ; seg < sizeof(IC->fIC_raw)/sizeof(IC->fIC_raw[0]) ; seg++ ){
if(seg > 1 && seg < 4) DE += IC->fIC_raw[seg] ;
else if (seg >4) E+= IC->fIC_raw[seg] ;
}
//===========================================================================================================
// Filling DE with ICO
//===========================================================================================================
DEcorr += DE ;
if ((IC0_Corr < 1e100 && IC0_Corr >-1000) || true){
DEcorr += IC0_Corr ;
}
else DEcorr += IC->fIC_raw[0];
DE += IC->fIC_raw[0] ;
DE = DE *0.5 + IC->fIC_raw[4];
DEcorr = DEcorr *0.5 + IC->fIC_raw[4];
/*
cout << IC0_Corr << " " << IC->fIC_raw[0] << endl;
cout << DEcorr << " " << DE << endl;
cout << "*************************" << endl;
*/
//===========================================================================================================
// Chio online
//===========================================================================================================
double IC1corr = (IC->fIC_raw[1]*(1-0.000686068*FF_IC_Y))*(1-4.88238e-05*FF_IC_Y+7.40395e-06*FF_IC_Y*FF_IC_Y);
double DE_Bis = 0.5*(IC1corr+IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
//double DE_Bis = 0.5*(IC->fIC_raw[1]+IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
DEIC1corr = 0.5*(IC1_CorrY +IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
hDEBis_Ecorr->Fill(E,DE_Bis);
hDE_E->Fill(E,DE);
hDE_Ecorr->Fill(E,DEcorr);
hDE_E_IC1_Corr->Fill(E,DEIC1corr);
} //End loop on event
//===========================================================================================================
// Drawing histo
//===========================================================================================================
TCanvas* c1 = new TCanvas("c1","c1",1000,1000);
c1->Divide(2,2);
c1->cd(1);
hICorr[0]->Draw();
c1->cd(2);
hIC[0]->Draw();
c1->cd(3);
hICorr[1]->Draw();
c1->cd(4);
hIC[1]->Draw();
TCanvas* c2 = new TCanvas("c2","c2",1500,1000);
c2->Divide(4);
c2->cd(1);
hDE_E->Draw();
c2->cd(2);
hDE_Ecorr->Draw();
c2->cd(3);
hDEBis_Ecorr->Draw();
c2->cd(4);
hDE_E_IC1_Corr->Draw();
} // End spline chio XY
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment