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

Test for de_e with p2p

parent b7c9ccec
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #364247 passed
...@@ -44,7 +44,7 @@ void ICCorr() { ...@@ -44,7 +44,7 @@ void ICCorr() {
// Filling the input histo // Filling the input histo
int NSegment = 11 ; int NSegment = 5 ;
vector<TH2F*> hICseg_ICprev, hICX,hICY ,hICseg_ICprevX,hICseg_ICprevY, hICcorr; vector<TH2F*> hICseg_ICprev, hICX,hICY ,hICseg_ICprevX,hICseg_ICprevY, hICcorr;
for(int seg=0; seg<NSegment; seg++){ for(int seg=0; seg<NSegment; seg++){
...@@ -84,10 +84,9 @@ void ICCorr() { ...@@ -84,10 +84,9 @@ void ICCorr() {
for (int i = 0; i < SplineCount ; i++) { for (int i = 0; i < SplineCount ; i++) {
int seg = int((i-2)/2 +1 ); int seg = int((i-2)/2 +1 );
cout << " i " << i << " seg "<< seg << endl; if (i < 2){
if (i < 2){ spline_X.at(0) = (TSpline3 *)fSpline->Get("fspline_IC1_IC0_X");
spline_X.at(0) = (TSpline3 *)fSpline->Get("fspline_IC1/IC0_X"); spline_Y.at(0) = (TSpline3 *)fSpline->Get("fspline_IC1_IC0_Y");
spline_Y.at(0) = (TSpline3 *)fSpline->Get("fspline_IC1/IC0_Y");
} }
else if ( i>=2 && i<4){ else if ( i>=2 && i<4){
...@@ -95,13 +94,12 @@ void ICCorr() { ...@@ -95,13 +94,12 @@ void ICCorr() {
spline_Y.at(1) = (TSpline3 *)fSpline->Get("fsplineIC1_Y"); spline_Y.at(1) = (TSpline3 *)fSpline->Get("fsplineIC1_Y");
} }
else if (seg >=2 && (i%2 == 0) ) { else if (seg >=2 && (i%2 == 0) ) {
spline_X.at(seg) = (TSpline3 *)fSpline->Get(Form("fspline_IC%d/IC%d_X",seg,seg-1)); spline_X.at(seg) = (TSpline3 *)fSpline->Get(Form("fspline_IC%d_IC%d_X",seg,seg-1));
} }
else if (seg >=2 && !(i%2 == 0) ) { else if (seg >=2 && !(i%2 == 0) ) {
spline_Y.at(seg) = (TSpline3 *)fSpline->Get(Form("fspline_IC%d/IC%d_Y",seg,seg-1)); spline_Y.at(seg) = (TSpline3 *)fSpline->Get(Form("fspline_IC%d_IC%d_Y",seg,seg-1));
} }
} //End loop on histogram } //End loop on histogram
cout << spline_Y[0]->Eval(3)<< endl;
//=========================================================================================================== //===========================================================================================================
// get fit // get fit
//=========================================================================================================== //===========================================================================================================
...@@ -128,7 +126,7 @@ void ICCorr() { ...@@ -128,7 +126,7 @@ void ICCorr() {
chain->GetEntry(e); chain->GetEntry(e);
vector<double> ICcorr_Y(11), ICcorr_X(11); // the [0] element of spline is the vector<double> ICcorr_Y(5), ICcorr_X(11); // the [0] element of spline is the
// correction on the first // correction on the first
// segment of ic // segment of ic
for (int seg = 0; seg < ICcorr_Y.size() ; seg++) { for (int seg = 0; seg < ICcorr_Y.size() ; seg++) {
...@@ -142,7 +140,6 @@ void ICCorr() { ...@@ -142,7 +140,6 @@ void ICCorr() {
//cout << ICcorr_Y.at(0) << " " << IC->fIC_raw[0]<< endl; //cout << ICcorr_Y.at(0) << " " << IC->fIC_raw[0]<< endl;
} }
else if (seg > 1) { else if (seg > 1) {
cout << "bug " <<seg << endl;
double temp = IC->fIC_raw[seg]/ICcorr_Y.at(seg-1) * spline_Y.at(seg)->Eval(0)/ spline_Y.at(seg)->Eval(FF_IC_Y); double temp = IC->fIC_raw[seg]/ICcorr_Y.at(seg-1) * spline_Y.at(seg)->Eval(0)/ spline_Y.at(seg)->Eval(FF_IC_Y);
ICcorr_Y.at(seg) = ICcorr_Y.at(seg-1) * temp; ICcorr_Y.at(seg) = ICcorr_Y.at(seg-1) * temp;
} }
...@@ -159,7 +156,7 @@ void ICCorr() { ...@@ -159,7 +156,7 @@ void ICCorr() {
for (int seg = 0 ; seg < sizeof(IC->fIC_raw)/sizeof(IC->fIC_raw[0]) ; seg++ ){ for (int seg = 0 ; seg < sizeof(IC->fIC_raw)/sizeof(IC->fIC_raw[0]) ; seg++ ){
if (seg >4){ if (seg >4){
E += IC->fIC_raw[seg] ; E += IC->fIC_raw[seg] ;
Ecorr += ICcorr_Y.at(seg) ; //Ecorr += ICcorr_Y.at(seg) ;
} }
} }
......
...@@ -70,14 +70,14 @@ void SplineChioP2P() { ...@@ -70,14 +70,14 @@ void SplineChioP2P() {
// X Spline // X Spline
SplineICurrent.push_back(MakeSpline(hIC[seg][0] , NCallSpline, XMin[2] , XMax[2], YMin[2], YMax[2])); SplineICurrent.push_back(MakeSpline(hIC[seg][0] , NCallSpline, XMin[2] , XMax[2], YMin[2], YMax[2]));
if (seg == 0) SplineICurrent.at(0)->SetName(Form("fspline_IC%d/IC%d_X",seg+1,seg)); if (seg == 0) SplineICurrent.at(0)->SetName(Form("fspline_IC%d_IC%d_X",seg+1,seg));
else if (seg != 0) SplineICurrent.at(0)->SetName(Form("fspline_IC%d/IC%d_X",seg,seg-1)); else if (seg != 0) SplineICurrent.at(0)->SetName(Form("fspline_IC%d_IC%d_X",seg,seg-1));
NCallSpline+=1; NCallSpline+=1;
// Y Spline // Y Spline
SplineICurrent.push_back(MakeSpline(hIC[seg][1] , NCallSpline, XMin[3] , XMax[3], YMin[3], YMax[3])); SplineICurrent.push_back(MakeSpline(hIC[seg][1] , NCallSpline, XMin[3] , XMax[3], YMin[3], YMax[3]));
if (seg == 0) SplineICurrent.at(1)->SetName(Form("fspline_IC%d/IC%d_Y",seg+1,seg)); if (seg == 0) SplineICurrent.at(1)->SetName(Form("fspline_IC%d_IC%d_Y",seg+1,seg));
else if (seg != 0)SplineICurrent.at(1)->SetName(Form("fspline_IC%d/IC%d_Y",seg,seg-1)); else if (seg != 0)SplineICurrent.at(1)->SetName(Form("fspline_IC%d_IC%d_Y",seg,seg-1));
NCallSpline+=1; NCallSpline+=1;
//push vector into memory //push vector into memory
...@@ -177,8 +177,8 @@ vector<TH2F*> HistoFillerIC(int segment, vector<vector<TSpline3*>> Spline_All_IC ...@@ -177,8 +177,8 @@ vector<TH2F*> HistoFillerIC(int segment, vector<vector<TSpline3*>> Spline_All_IC
// Beginning loop on entries // Beginning loop on entries
//=========================================================================================================== //===========================================================================================================
// int Nentries = chain->GetEntries(); int Nentries = chain->GetEntries();
int Nentries = 100000; //int Nentries = 100000;
auto start = std::chrono::high_resolution_clock::now(); auto start = std::chrono::high_resolution_clock::now();
for (int e = 0; e < Nentries; e++) { for (int e = 0; e < Nentries; e++) {
...@@ -318,8 +318,8 @@ vector<vector<TH2F*>>HistoFillerICcorr(int segment, vector<vector<TSpline3*>> Sp ...@@ -318,8 +318,8 @@ vector<vector<TH2F*>>HistoFillerICcorr(int segment, vector<vector<TSpline3*>> Sp
// Beginning loop on entries // Beginning loop on entries
//=========================================================================================================== //===========================================================================================================
// int Nentries = chain->GetEntries(); int Nentries = chain->GetEntries();
int Nentries = 100000; //int Nentries = 100000;
auto start = std::chrono::high_resolution_clock::now(); auto start = std::chrono::high_resolution_clock::now();
for (int e = 0; e < Nentries; e++) { 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