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

End of analysis XY now moving on to optimisation

parent 90d822a5
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #376296 passed
......@@ -630,10 +630,10 @@ void Analysis::InitOutputBranch(){
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T0VM",&MTOF_FP1_T0VM,"MTOF_FP1_T0VM/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T1VM",&MTOF_FP1_T1VM,"MTOF_FP1_T1VM/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP0_T0VN",&MTOF_FP0_T0VN,"MTOF_FP0_T0VN/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP0_T1VN",&MTOF_FP0_T1VN,"MTOF_FP0_T1VN/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T0VN",&MTOF_FP1_T0VN,"MTOF_FP1_T0VN/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T1VN",&MTOF_FP1_T1VN,"MTOF_FP1_T1VN/I");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP0_T0VN",&MTOF_FP0_T0VN,"MTOF_FP0_T0VN/S");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP0_T1VN",&MTOF_FP0_T1VN,"MTOF_FP0_T1VN/S");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T0VN",&MTOF_FP1_T0VN,"MTOF_FP1_T0VN/S");
RootOutput::getInstance()->GetTree()->Branch("MTOF_FP1_T1VN",&MTOF_FP1_T1VN,"MTOF_FP1_T1VN/S");
RootOutput::getInstance()->GetTree()->Branch("theta_lab_fission",&theta_lab_fission,"theta_lab_fission/D");
RootOutput::getInstance()->GetTree()->Branch("theta_cm_fission",&theta_cm_fission,"theta_cm_fission/D");
......
#include "TTimeData.h"
#include <TICPhysics.h>
#include <TFPMWPhysics.h>
#include <TCanvas.h>
#include <TChain.h>
#include <TF1.h>
......@@ -27,8 +28,10 @@ void DECorr(bool cut = false, bool spline = false) {
chain->Add("../../../root/analysis/VamosCalib247.root");
TICPhysics* IC = new TICPhysics() ;
TTimeData *Time = new TTimeData();
double FF_IC_X, FF_IC_Y, FF_V13, Y;
TTimeData *Time = new TTimeData() ;
TFPMWPhysics *FPMW = new TFPMWPhysics();
double FF_IC_X, FF_IC_Y, FF_V13, Y, FF_Theta;
chain->SetBranchStatus("FF_IC_X", true);
chain->SetBranchAddress("FF_IC_X", &FF_IC_X);
......@@ -38,7 +41,13 @@ void DECorr(bool cut = false, bool spline = false) {
chain->SetBranchStatus("IC", true);
chain->SetBranchAddress("IC", &IC);
chain->SetBranchStatus("FPMW", true);
chain->SetBranchAddress("FPMW", &FPMW);
chain->SetBranchStatus("FF_Theta", true);
chain->SetBranchAddress("FF_Theta", &FF_Theta);
chain->SetBranchStatus("FF_V13", true);
chain->SetBranchAddress("FF_V13", &FF_V13);
......@@ -59,19 +68,28 @@ void DECorr(bool cut = false, bool spline = false) {
ProfileEvaluator Profile;
Profile.LoadProfile("Output/RatioProfile.root","ICOneZeroProfile");
TCutG *CutZ;
TCutG *CutZ, *CutZ0 , *CutZ02 , *CutZ023 ,*CutZ0234;
TCutG *CutZbis;
TFile *fCut;
if (cut) {
fCut = TFile::Open("Output/CutDeCorr.root");
CutZbis = (TCutG*)fCut->Get("CutZbis") ;
CutZ = (TCutG*)fCut->Get("CutZ") ;
CutZ0 = (TCutG*)fCut->Get("CutZ0") ;
CutZ02 = (TCutG*)fCut->Get("CutZ02") ;
CutZ023 = (TCutG*)fCut->Get("CutZ023") ;
CutZ0234 = (TCutG*)fCut->Get("CutZ0234") ;
}
TFile *fSpline;
TSpline3 *splineDEcorr, *splineDEbis;
TSpline3 *splineDE,*splineDE0, *splineDE02,*splineDE023,*splineDE0234,*splineDEbis;
fSpline= new TFile("Output/splineDE.root","open");
splineDEcorr = (TSpline3*) fSpline->Get("SplineDe_0");
splineDE = (TSpline3*) fSpline->Get("SplineDe");
splineDE0 = (TSpline3*) fSpline->Get("SplineDe_0");
splineDE02 = (TSpline3*) fSpline->Get("SplineDe_02");
splineDE023 = (TSpline3*) fSpline->Get("SplineDe_023");
splineDE0234 = (TSpline3*) fSpline->Get("SplineDe_0234");
splineDEbis = (TSpline3*) fSpline->Get("SplineDebis");
vector<TSpline3*> vsplineDE;
......@@ -96,16 +114,66 @@ void DECorr(bool cut = false, bool spline = false) {
if (vsplineDE[i]==nullptr) vsplineDE.erase(vsplineDE.begin()+i);
}
TFile *fSplineIC = new TFile("Output/spline_P2P_2024.root","open");
// Get number of spline
int SplineCount = 0 ;
TIter next(fSplineIC->GetListOfKeys());
TKey* key;
while ((key=(TKey*)next())){
if (std::string(key->GetClassName()) == "TSpline3"){
SplineCount ++;
}
}
//Defining output histo
TH2F* hDE_E = new TH2F("DE_E","DE_E",1000,0,22000,1000,0,28000);
TH2F* hDE_E_splined = new TH2F("DE_E_splined","DE_E_splined",1000,0,22000,1000,0,28000);
TH2F* hDE_Ebis = new TH2F("DE_Ebis","DE_Ebis",1000,0,22000,1000,0,24000);
vector<TSpline3*> spline_X(11), spline_Y(11);
for (int i = 0; i < SplineCount ; i++) {
int seg = int((i-2)/2 +1 );
if (i < 2){
spline_X.at(0) = (TSpline3 *)fSplineIC->Get("fspline_IC0_X");
spline_Y.at(0) = (TSpline3 *)fSplineIC->Get("fspline_IC0_Y");
}
else if ( i>=2 && i<4){
spline_X.at(1) = (TSpline3 *)fSplineIC->Get("fspline_IC1_X");
spline_Y.at(1) = (TSpline3 *)fSplineIC->Get("fspline_IC1_Y");
}
else if (seg >=2 && (i%2 == 0) ) {
spline_X.at(seg) = (TSpline3 *)fSplineIC->Get(Form("fspline_IC%d_X",seg));
}
else if (seg >=2 && !(i%2 == 0) ) {
spline_Y.at(seg) = (TSpline3 *)fSplineIC->Get(Form("fspline_IC%d_Y",seg));
}
} //End loop on histogram
TH2F* hDE_Y = new TH2F("DE_Y","DE_Y",1000,-1000,1000,1000,0,28000);
TH2F* hDE_Y_splined = new TH2F("DE_Ysplined","DE_Ysplined",1000,-1000,1000,1000,0,28000);
TH2F* hDE_Y_splined = new TH2F("DE_Ysplined","DE_Ysplined",1000,-1000,1000,1000,0,28000);
double XmaxDE = 26000, XMaxE = 35000;
//Defining output histo
TH2F* hDE_E = new TH2F("DE_E","DE_E",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_E_splined = new TH2F("DE_E_splined","DE_E_splined",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_Ebis = new TH2F("DE_Ebis","DE_Ebis",1000,0,XMaxE,1000,0,24000);
TH2F* hDE_E0 = new TH2F("DE_E0","DE_E0",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_E02 = new TH2F("DE_E02","DE_E02",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_E023 = new TH2F("DE_E023","DE_E023",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_E0234 = new TH2F("DE_E0234","DE_E0234",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_E1234 = new TH2F("DE_E1234","DE_E1234",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_Y = new TH2F("DE_Y","DE_Y",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE0_Y = new TH2F("DE0_Y","DE0_Y",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE02_Y = new TH2F("DE02_Y","DE02_Y",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE023_Y = new TH2F("DE023_Y","DE023_Y",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE0234_Y = new TH2F("DE0234_Y","DE0234_Y",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE_Y_cut = new TH2F("DE_Y_cut","DE_Y_cut",500,-1000,1000,500,0,XmaxDE);
TH2F* hDE0_Y_cut = new TH2F("DE0_Y_cut","DE0_Y_cut",500,-1000,1000,500,0,XmaxDE);
TH2F* hDE02_Y_cut = new TH2F("DE02_Y_cut","DE02_Y_cut",500,-1000,1000,500,0,XmaxDE);
TH2F* hDE023_Y_cut = new TH2F("DE023_Y_cut","DE023_Y_cut",500,-1000,1000,500,0,XmaxDE);
TH2F* hDE0234_Y_cut = new TH2F("DE0234_Y_cut","DE0234_Y_cut",500,-1000,1000,500,0,XmaxDE);
TH2F* hDE_Y_splined = new TH2F("DE_Ysplined","DE_Ysplined",1000,-1000,1000,1000,0,XmaxDE);
TH2F* hDE_Y_splined_nocut = new TH2F("DE_Ysplined_nocut","DE_Ysplined_nocut",1000,-1000,1000,1000,0,22000);
TH2F* hIC_Y = new TH2F("IC_Y","IC_Y",1000,-1000,1000,1000,0,22000);
TH2F* hIC_Y_splined = new TH2F("IC_Ysplined","IC_Ysplined",1000,-1000,1000,1000,0,22000);
......@@ -116,11 +184,15 @@ void DECorr(bool cut = false, bool spline = false) {
TH2F* hDE_Y_bis = new TH2F("DE_Ybis","DE_Ybis",1000,-1000,1000,1000,0,22000);
TH2F* hDEbis_Y_corr = new TH2F("DE_Ybiscorr","DE_Ybiscorr",1000,-1000,1000,1000,0,22000);
TH2F* hDE_E_corr = new TH2F("DE_Ecorr","DE_Ecorr",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE0_E_corr = new TH2F("DE0_Ecorr","DE0_Ecorr",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE02_E_corr = new TH2F("DE02_Ecorr","DE02_Ecorr",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE023_E_corr = new TH2F("DE023_Ecorr","DE023_Ecorr",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE0234_E_corr = new TH2F("DE0234_Ecorr","DE0234_Ecorr",1000,0,XMaxE,1000,0,XmaxDE);
TH2F* hDE_Ebis_corr = new TH2F("DE_Ebiscorr","DE_Ebiscorr",1000,0,XMaxE,1000,0,24000);
TH2F* hDE_E_corr = new TH2F("DE_Ecorr","DE_Ecorr",1000,0,22000,1000,0,28000);
TH2F* hDE_Ebis_corr = new TH2F("DE_Ebiscorr","DE_Ebiscorr",1000,0,22000,1000,0,24000);
TH2F* hDE_V = new TH2F("DE_V","DE_V",1000,0,5,1000,0,28000);
TH2F* hDE_V = new TH2F("DE_V","DE_V",1000,0,5,1000,0,XmaxDE);
// Def Lim spline
double Ymin = -1000 , Ymax =1000;
......@@ -130,6 +202,7 @@ void DECorr(bool cut = false, bool spline = false) {
int Nentries = chain->GetEntries();
//int Nentries = 1000000;
auto start = std::chrono::high_resolution_clock::now();
int NSegment = 11;
for (int e = 0; e < Nentries; e++) {
if (e % 100000 == 0 && e > 0 ) {
......@@ -142,31 +215,62 @@ void DECorr(bool cut = false, bool spline = false) {
}
chain->GetEntry(e);
vector<double> ICcorr_Y(NSegment), ICcorr_X(NSegment);
vector<double> Temp_X(NSegment) , Temp_Y(NSegment);
if (Time->GetMWPC13Mult() ==1 && IC->fIC_TS.size()>=8){ //only mult 1 event
UShort_t FPMW_Section = Time->GetSection_MWPC3(0);
double FF_DriftTime = 10* (IC->fIC_TS.at(0) - Time->GetTS_MWPC13(0)) - ((Time->GetTime_MWPC13(0)+Toff13.at(FPMW_Section))) ;
double FF_DriftTime = 10* (IC->fIC_TS.at(0) - Time->GetTS_MWPC13(0)) - ((Time->GetTime_MWPC13(0)+Toff13.at(FPMW_Section))) ;
for (int seg = 1; seg < IC->fIC_TS.size() ; seg++) { // loop on multiplicity of event
if (seg == NSegment) seg = 0; //from 1to NSeg finishing with 0
double FF_DriftTime_temp = 10* (IC->fIC_TS.at(seg) - Time->GetTS_MWPC13(0)) - ((Time->GetTime_MWPC13(0)+Toff13.at(FPMW_Section))) ;
if (spline_Y.at(seg)==0){
ICcorr_Y.at(seg) = IC->fIC_raw[seg];
}
else {
if (seg == 0) {
ICcorr_Y.at(seg) = ICcorr_Y.at(0) * spline_Y.at(0)->Eval(0)/spline_Y.at(0)->Eval(FF_DriftTime);
}
else if (seg == 1){
ICcorr_Y.at(seg) = IC->fIC_raw[1]*spline_Y.at(1)->Eval(0)/spline_Y.at(1)->Eval(FF_DriftTime);
}
else if (seg > 1) {
ICcorr_Y.at(seg) = IC->fIC_raw[seg] * spline_Y.at(seg)->Eval(0)/ spline_Y.at(seg)->Eval(FF_DriftTime);
}
if (!(ICcorr_Y.at(seg)==ICcorr_Y.at(seg))) ICcorr_Y.at(seg) = 0;
} //end if non empty
if (seg == 0) break;
}//endloop seg
Double_t PolX = -4.24954 * 1e-7 *FF_IC_X*FF_IC_X - 8.62213 * 1e-5 * FF_IC_X + 1.37;
Double_t ICRatio = IC->fIC_raw[1]/IC->fIC_raw[0];
Double_t ICRatioCorr = ICRatio * PolX / Profile.Evaluate(FF_IC_X,FF_DriftTime,true);
Double_t ICcorr_Y = IC->fIC_raw[0] / PolX * Profile.Evaluate(FF_IC_X,FF_DriftTime,true);
Double_t ICcorr_Y0 = IC->fIC_raw[0] / PolX * Profile.Evaluate(FF_IC_X,FF_DriftTime,true);
if (ICRatioCorr >1.4){
ICRatioCorr = ICRatio * PolX / Profile.Evaluate(FF_IC_X,FF_DriftTime,false);
ICcorr_Y =IC->fIC_raw[0] / PolX * Profile.Evaluate(FF_IC_X,FF_DriftTime,false);
ICcorr_Y0 = IC->fIC_raw[0] / PolX * Profile.Evaluate(FF_IC_X,FF_DriftTime,false);
if (ICRatioCorr >100) {
ICcorr_Y = IC->fIC_raw[0];
ICcorr_Y0 = IC->fIC_raw[0];
}
}
double DE = 0 , DE_splined=0 ,DE_corr=0, DE_Ybis=0;
double E =0;
double E =0, E_splined=0;
for (int seg = 0 ; seg < sizeof(IC->fIC_raw)/sizeof(IC->fIC_raw[0]) ; seg++ ){
if (seg >4){
E += double(IC->fIC_raw[seg]) ;
if (seg == 5) E += double(IC->fIC_raw[seg]);
else E += 2*double(IC->fIC_raw[seg]) ;
}
}
......@@ -176,33 +280,52 @@ void DECorr(bool cut = false, bool spline = false) {
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];
DE = 0.5*(double(IC->fIC_raw[0])+ double(IC->fIC_raw[1]) +double(IC->fIC_raw[2])+ double(IC->fIC_raw[3])) + double(IC->fIC_raw[4]);
DE_splined = 0.5*(ICcorr_Y+ IC->fIC_raw[1] +IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
DE = 0.5* ( IC->fIC_raw[0]+ double(IC->fIC_raw[1]) +double(IC->fIC_raw[2])+ double(IC->fIC_raw[3])) + double(IC->fIC_raw[4]);
DE_splined = 0.5* ( ICcorr_Y0+ ICcorr_Y.at(1) +IC->fIC_raw[2]+ IC->fIC_raw[3]) + IC->fIC_raw[4];
double DE0 = 0.5* ( ICcorr_Y0 + ICcorr_Y.at(1) +IC->fIC_raw[2] + IC->fIC_raw[3]) + IC->fIC_raw[4];
double DE02 = 0.5* ( ICcorr_Y0+ ICcorr_Y.at(1) +ICcorr_Y.at(2)+ IC->fIC_raw[3]) + IC->fIC_raw[4];
double DE023 = 0.5* ( ICcorr_Y0+ ICcorr_Y.at(1) +ICcorr_Y.at(2)+ ICcorr_Y.at(3)) + IC->fIC_raw[4];
double DE0234 = 0.5*( ICcorr_Y0+ ICcorr_Y.at(1) +ICcorr_Y.at(2)+ ICcorr_Y.at(3)) + ICcorr_Y.at(4);
double DE1234 = 0.5*( double(IC->fIC_raw[1]) +double(IC->fIC_raw[2])+ double(IC->fIC_raw[3])) + double(IC->fIC_raw[4]);
//DE_splined = 0.5*( ICcorr_Y[1] +IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
//************* Cut ******************
bool CutV = abs( FF_V13-3.94)<0.1;
bool CutVbis = abs( FF_V13-3.94)<0.1;
bool CutV = abs( E-6000)<500;
bool CutVbis = abs( E-6000)<500;
//bool CutV = true;
//bool CutVbis = true;
//***********Fill histo*************
if (FF_DriftTime >Ymin && FF_DriftTime <Ymax ){
if (FF_DriftTime >Ymin && FF_DriftTime <Ymax && (FF_Theta >0)){
//*************Init DE_E*****************
hDE_E->Fill(E,DE);
hDE_E_splined->Fill(E,DE_splined);
hDE_E -> Fill(E,DE);
hDE_E_splined -> Fill(E,DE_splined);
hDE_E0 -> Fill(E,DE0);
hDE_E02 -> Fill(E,DE02);
hDE_E023 -> Fill(E,DE023);
hDE_E0234 -> Fill(E,DE0234);
hDE_E1234 -> Fill(E,DE1234);
hDE_Ebis->Fill(E,DE_Bis);
hDE_V->Fill(FF_V13,DE_splined);
//******* Coor DE ************
if (spline== true ){
DE_corr = DE_splined * splineDEcorr->Eval(0) / splineDEcorr->Eval(FF_DriftTime);
double DE_corr = DE * splineDE->Eval(0) / splineDE->Eval(FF_DriftTime);
double DE0_corr = DE0 * splineDE0->Eval(0) / splineDE0->Eval(FF_DriftTime);
double DE02_corr = DE02 * splineDE02->Eval(0) / splineDE02->Eval(FF_DriftTime);
double DE023_corr = DE023 * splineDE023->Eval(0) / splineDE023->Eval(FF_DriftTime);
double DE0234_corr = DE0234 * splineDE0234->Eval(0) / splineDE0234->Eval(FF_DriftTime);
hDE_E_corr->Fill(E,DE_corr);
hDE0_E_corr->Fill(E,DE0_corr);
hDE02_E_corr->Fill(E,DE02_corr);
hDE023_E_corr->Fill(E,DE023_corr);
hDE0234_E_corr->Fill(E,DE0234_corr);
DE_Ybis = DE_Bis * splineDEbis->Eval(0) / splineDEbis->Eval(FF_DriftTime);
hDE_Ebis_corr->Fill(E,DE_Ybis);
......@@ -211,23 +334,21 @@ void DECorr(bool cut = false, bool spline = false) {
else {
DE_corr = DE_splined;
hDE_E_corr->Fill(E,DE_corr);
DE_Ybis = DE_Bis ;
hDE_Ebis_corr->Fill(E,DE_Ybis);
}
bool CutCharge ;
if (cut == true) CutCharge = CutZ->IsInside(FF_V13,DE_splined);
//bool CutChargeBis = CutZ->IsInside(E,DE_Y_Recur);
//bool CutVbis = CutZbis->IsInside(E,DE_Bis);
// DE_Y in a cut
if (cut == true ) {
bool CutCharge = CutZ->IsInside(FF_DriftTime,DE);
bool CutCharge0 = CutZ0->IsInside(FF_DriftTime,DE0);
bool CutCharge02 = CutZ02->IsInside(FF_DriftTime,DE02);
bool CutCharge023 = CutZ023->IsInside(FF_DriftTime,DE023);
bool CutCharge0234 = CutZ0234->IsInside(FF_DriftTime,DE0234);
if (cut == true ) {
if ( CutV && E>6000) {
if (CutV ) {
hDE_Y_corr_nocut->Fill(FF_DriftTime,DE_corr);
hDE_Y_splined_nocut->Fill(FF_DriftTime,DE_splined);
hDE_Y->Fill(FF_DriftTime,DE);
......@@ -235,22 +356,46 @@ void DECorr(bool cut = false, bool spline = false) {
hDE_Y_corr->Fill(FF_DriftTime,DE_corr);
hIC_Y->Fill(FF_DriftTime,IC->fIC_raw[0]);
hIC_Y_splined->Fill(FF_DriftTime,ICcorr_Y);
hIC_Y_splined->Fill(FF_DriftTime,ICcorr_Y0);
hDE_Y->Fill(FF_DriftTime,DE);
hDE0_Y->Fill(FF_DriftTime,DE0);
hDE02_Y->Fill(FF_DriftTime,DE02);
hDE023_Y->Fill(FF_DriftTime,DE023);
hDE0234_Y->Fill(FF_DriftTime,DE0234);
if (CutCharge) hDE_Y_cut->Fill(FF_DriftTime,DE);
if (CutCharge0) hDE0_Y_cut->Fill(FF_DriftTime,DE0);
if (CutCharge02) hDE02_Y_cut->Fill(FF_DriftTime,DE02);
if (CutCharge023) hDE023_Y_cut->Fill(FF_DriftTime,DE023);
if (CutCharge0234) hDE0234_Y_cut->Fill(FF_DriftTime,DE0234);
}
}//end cut
else {
if(E>6000){
hDE_Y->Fill(FF_DriftTime,DE);
if(true ){
hDE_Y_bis->Fill(FF_DriftTime,DE_Bis);
hDE_Y_splined->Fill(FF_DriftTime,DE_splined);
hDE_Y_corr->Fill(FF_DriftTime,DE_corr);
hIC_Y->Fill(FF_DriftTime,IC->fIC_raw[0]);
hIC_Y_splined->Fill(FF_DriftTime,ICcorr_Y);
hIC_Y_splined->Fill(FF_DriftTime,ICcorr_Y0);
if (CutV ) {
hDE_Y->Fill(FF_DriftTime,DE);
hDE0_Y->Fill(FF_DriftTime,DE0);
hDE02_Y->Fill(FF_DriftTime,DE02);
hDE023_Y->Fill(FF_DriftTime,DE023);
hDE0234_Y->Fill(FF_DriftTime,DE0234);
}
}
}
if (cut == true && CutVbis) {
hDE_Y_bis->Fill(Y,DE_Bis);
hDEbis_Y_corr->Fill(Y,DE_Ybis);
}
else{;}
......@@ -261,98 +406,141 @@ void DECorr(bool cut = false, bool spline = false) {
// making spline
TSpline3 *splineDE, *osplineDEbis;
if (spline == true){
splineDE = MakeSpline(hDE_Y_splined,0,Ymin,Ymax,0,23000);
osplineDEbis = MakeSpline(hDE_Y_bis,1,Ymin,Ymax,0,23000);
TFile *fSpline = new TFile("Output/splineDE.root","recreate");
splineDE->SetName("SplineDe_0");
splineDE->Write();
osplineDEbis->SetName("SplineDebis");
osplineDEbis->Write();
fSpline->Close();
}
TSpline3 *splineDe, *splineDe0, *splineDe02,*splineDe023,*splineDe0234,*osplineDEbis;
splineDe = MakeSpline(hDE_Y_cut,0,Ymin,Ymax,0,23000);
splineDe0 = MakeSpline(hDE0_Y_cut,1,Ymin,Ymax,0,23000);
splineDe02 = MakeSpline(hDE02_Y_cut,2,Ymin,Ymax,0,23000);
splineDe023 = MakeSpline(hDE023_Y_cut,3,Ymin,Ymax,0,23000);
splineDe0234 = MakeSpline(hDE0234_Y_cut,4,Ymin,Ymax,0,23000);
osplineDEbis = MakeSpline(hDE_Y,5,Ymin,Ymax,0,23000);
TFile *fSplineDE = new TFile("Output/splineDE.root","recreate");
splineDe->SetName("SplineDe");
splineDe->Write();
splineDe0->SetName("SplineDe_0");
splineDe0->Write();
splineDe02->SetName("SplineDe_02");
splineDe02->Write();
splineDe023->SetName("SplineDe_023");
splineDe023->Write();
splineDe0234->SetName("SplineDe_0234");
splineDe0234->Write();
osplineDEbis->SetName("SplineDebis");
osplineDEbis->Write();
fSplineDE->Close();
//===========================================================================================================
// Drawing histo
//===========================================================================================================
gStyle->SetPalette(kRainBow);
TCanvas* c = new TCanvas("c","c",1500,1000);
c->Divide(2,2);
c->cd(1);
gPad->SetLogz();
hDE_Y->ProfileX()->Draw();
c->cd(2);
gPad->SetLogz();
hDE_Y_splined->ProfileX()->Draw();
c->cd(3);
gPad->SetLogz();
hIC_Y->ProfileX()->Draw();
c->cd(4);
gPad->SetLogz();
hIC_Y_splined->ProfileX()->Draw();
TCanvas* c6 = new TCanvas("c6","c6",1500,1000);
c6->Divide(2);
c6->cd(1);
gPad->SetLogz();
hDE_Y_splined->ProfileX()->Draw();
c6->cd(2);
gPad->SetLogz();
hDE_Y_corr->ProfileX()->Draw();
TCanvas* c7 = new TCanvas("correction succesive","correction succesive",1500,1000);
c7->Divide(6);
c7->cd(1);
hDE_E->GetXaxis()->SetTitle("E");
hDE_E->GetYaxis()->SetTitle("DE");
hDE_E->Draw();
c7->cd(2);
hDE_E0->GetXaxis()->SetTitle("E");
hDE_E0->GetYaxis()->SetTitle("DE");
hDE_E0->Draw();
c7->cd(3);
hDE_E02->GetXaxis()->SetTitle("E");
hDE_E02->GetYaxis()->SetTitle("DE");
hDE_E02->Draw();
c7->cd(4);
hDE_E023->GetXaxis()->SetTitle("E");
hDE_E023->GetYaxis()->SetTitle("DE");
hDE_E023->Draw();
c7->cd(5);
hDE_E0234->GetXaxis()->SetTitle("E");
hDE_E0234->GetYaxis()->SetTitle("DE");
hDE_E0234->Draw();
c7->cd(6);
hDE_E1234->GetXaxis()->SetTitle("E");
hDE_E1234->GetYaxis()->SetTitle("DE");
hDE_E1234->Draw();
TCanvas *c4 = new TCanvas("c4","c4",1500,1000);
c4->Divide(2);
c4->Divide(5);
c4->cd(1);
hDE_Y->Draw();
c4->cd(2);
hDE_Y_splined->Draw();
hDE0_Y->Draw();
c4->cd(3);
hDE02_Y->Draw();
TCanvas *c5 = new TCanvas("c5","c5",1500,1000);
hDE_E->Draw("colz");
c4->cd(4);
hDE023_Y->Draw();
c4->cd(5);
hDE0234_Y->Draw();
TCanvas *c1 = new TCanvas("c1","c1",1500,1000);
hDE_V->Draw();
TCanvas* c2 = new TCanvas("c2","c2",1500,1000);
c2->Divide(3 + 1*spline);
c2->Divide(6 );
c2->cd(1);
hDE_E->SetTitle("Unmodified");
gPad->Modified();
gPad->Update();
hDE_E->Draw("colz");
hDE_E->GetXaxis()->SetTitle("E");
hDE_E->GetYaxis()->SetTitle("DE");
hDE_E_corr->Draw("colz");
hDE_E_corr->GetXaxis()->SetTitle("E");
hDE_E_corr->GetYaxis()->SetTitle("DE");
c2->cd(2);
hDE_Ebis->SetTitle("Online");
gPad->Modified();
gPad->Update();
hDE_Ebis->Draw("colz");
hDE_Ebis->GetXaxis()->SetTitle("E");
hDE_Ebis->GetYaxis()->SetTitle("DE");
hDE0_E_corr->Draw("colz");
hDE0_E_corr->GetXaxis()->SetTitle("E");
hDE0_E_corr->GetYaxis()->SetTitle("DE");
c2->cd(3);
hDE_E_splined->SetTitle("IC Corrected in DT");
gPad->Modified();
gPad->Update();
hDE_E_splined->Draw("colz");
hDE_E_splined->GetXaxis()->SetTitle("E");
hDE_E_splined->GetYaxis()->SetTitle("DE");
if ( spline == true){
c2->cd(4);
hDE_E_corr->SetTitle("DE Corrected");
gPad->Modified();
gPad->Update();
hDE_E_corr->Draw("colz");
hDE_E_corr->GetXaxis()->SetTitle("E");
hDE_E_corr->GetYaxis()->SetTitle("DE");
}
hDE02_E_corr->Draw("colz");
hDE02_E_corr->GetXaxis()->SetTitle("E");
hDE02_E_corr->GetYaxis()->SetTitle("DE");
c2->cd(4);
gPad->Modified();
gPad->Update();
hDE023_E_corr->Draw("colz");
hDE023_E_corr->GetXaxis()->SetTitle("E");
hDE023_E_corr->GetYaxis()->SetTitle("DE");
c2->cd(5);
gPad->Modified();
gPad->Update();
hDE0234_E_corr->Draw("colz");
hDE0234_E_corr->GetXaxis()->SetTitle("E");
hDE0234_E_corr->GetYaxis()->SetTitle("DE");
c2->cd(6);
hDE_Ebis->SetTitle("online");
gPad->Modified();
gPad->Update();
hDE_Ebis->Draw("colz");
hDE_Ebis->GetXaxis()->SetTitle("E");
hDE_Ebis->GetYaxis()->SetTitle("DE");
} // End spline chio XY
......
File deleted
File deleted
......@@ -90,8 +90,8 @@ void ToffGenerator(bool Create = true ){
//===========================================================================================================
// Loop on entries
//===========================================================================================================
//int Nentries = chain->GetEntries();
int Nentries = 1000000;
int Nentries = chain->GetEntries();
//int Nentries = 1000000;
auto start = std::chrono::high_resolution_clock::now();
for (int e = 0; e < Nentries; e++) {
......
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