diff --git a/.gitignore b/.gitignore index e856ffb..78a5eed 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ *txt *.o *.exe -*.sh* \ No newline at end of file +*.sh* +*.png \ No newline at end of file diff --git a/Alignment/offsets_50_V0.txt b/Alignment/offsets_50_V0.txt new file mode 100644 index 0000000..95fe927 --- /dev/null +++ b/Alignment/offsets_50_V0.txt @@ -0,0 +1,6 @@ +wc_y 0.829562 +wc_x 6.6548 +hodoY1 -1.71754 +hodoX1 6.11462 +hodoY2 -1.65129 +hodoX2 3.61044 diff --git a/BuildFile.xml b/BuildFile.xml deleted file mode 100644 index 39cdb79..0000000 --- a/BuildFile.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TB/EffAll.pdf b/EffAll.pdf similarity index 100% rename from TB/EffAll.pdf rename to EffAll.pdf diff --git a/TB/Job/empty.txt b/Job/empty.txt similarity index 100% rename from TB/Job/empty.txt rename to Job/empty.txt diff --git a/TB/Makefile b/Makefile similarity index 87% rename from TB/Makefile rename to Makefile index 9544d28..71c3c7a 100644 --- a/TB/Makefile +++ b/Makefile @@ -3,11 +3,11 @@ ROOT_LIB:=`root-config --libs --glibs` ROOT_FLAGS:=`root-config --cflags --ldflags` ROOT_INCLUDE:=`root-config --incdir` -DEPS= interface/MCPMap.h interface/init_Reco_Tree.h interface/init_tree_H4.h interface/analysis_tools.h interface/histoFuncT.h interface/ScaleEstimators.h -DEPS_OBJ= lib/MCPMap.o lib/init_Reco_Tree.o lib/init_tree_H4.o lib/analysis_tools.o lib/histoFuncT.o lib/ScaleEstimators.o +DEPS= interface/MCPMap.h interface/init_Reco_Tree.h interface/init_tree_H4.h interface/analysis_tools.h interface/histoFuncT.h interface/ScaleEstimators.h interface/CfgManager.h interface/TagHelper.h interface/HodoCluster.h interface/AlignmentOfficer.h +DEPS_OBJ= lib/MCPMap.o lib/init_Reco_Tree.o lib/init_tree_H4.o lib/analysis_tools.o lib/histoFuncT.o lib/ScaleEstimators.o lib/CfgManager.o lib/TagHelper.o lib/HodoCluster.o lib/AlignmentOfficer.o CC = g++ -CFLAGS = -Wall +CFLAGS = -std=c++11 lib/%.o: src/%.cc $(DEPS) $(CC) $(CFLAGS) -c -o $@ $< $(ROOT_LIB) $(ROOT_FLAGS) diff --git a/TB/BuildFile.xml b/TB/BuildFile.xml deleted file mode 100644 index 39cdb79..0000000 --- a/TB/BuildFile.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TB/bin/analyzer.cpp b/TB/bin/analyzer.cpp deleted file mode 100755 index 9dd477b..0000000 --- a/TB/bin/analyzer.cpp +++ /dev/null @@ -1,1038 +0,0 @@ -/***************************************************************************************** - This program compute charge or efficiency for all the run in a selected Scan for - selected MCP under test. - - compile with ---> c++ -o analyzer bin/analyzer.cpp `root-config --cflags --glibs --libs` - run with: ./analyzer cfg/treshold.txt MiB3 all eff HVScan Scan2 - where the arguments are: 1) cfg file with the tresholds 2) MCP to analyze 4) analysis type (eff,time) 5) Scan type (HV or X0) 6) suffix of reco file in input - -****************************************************************************************/ -#include -#include -#include -#include - -#include "TROOT.h" -#include "TSystem.h" -#include "TKey.h" -#include "TFile.h" -#include "TTree.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TF1.h" -#include "TGraphAsymmErrors.h" -#include "TString.h" -#include "TCut.h" -#include "TMath.h" -#include "TApplication.h" -#include "TError.h" -#include "TCanvas.h" -#include "TGraphErrors.h" -#include "TPad.h" -#include "TStyle.h" - -#include "../interface/init_Reco_Tree.h" -#include "../interface/MCPMap.h" - -using namespace std; - -int main(int argc, char** argv) -{ - gSystem->Load("libTree"); - char *label, *doWhat, *scanType; - Fill_MCPList(); - Fill_inverted_MCPList(); - - //---Read input options--- - std::ifstream inputCfg (argv[1],ios::in); - std::string MCP = argv[2]; - doWhat = argv[3]; - scanType = argv[4]; - label = argv[5]; - - std::cout<<"----START ANALYZER: analyzing MCP "< treshold; - int ch, tresh; - int nChannels=0; - int trigPos1 = -1; //positions of the trigger chamber in the reco tree - int clockPos1 = -1, clockPos2 = -1; - - //---Open cfg file and fill map with treshold for each channel--- - while(!inputCfg.eof()) - { - inputCfg >> ch >> tresh; - treshold.insert(std::make_pair(ch,tresh)); - nChannels++; - } - - //-----Create output files----- - - //open reco tree - std::string inFileName = "ntuples/reco_"+string(label)+".root"; - TFile *inFile = new TFile (inFileName.c_str()); - TTree* nt = (TTree*)inFile->Get("reco_tree"); - InitRecoTree(nt); - //---txt--- - char outputFileName[200]=""; - sprintf(outputFileName, "results/%s_%s_%s_%s.txt", MCP.c_str(), doWhat, scanType, label); - std::ofstream outputFile (outputFileName, std::ofstream::out); - - //---ROOT--- - char mkdir_command[100]; - TFile* outROOT_eff = NULL; - TFile* outROOT_Q = NULL; - TFile* outROOT_CFD = NULL; - TFile* outROOT_LED = NULL; - //---efficiency - if(strcmp(doWhat, "eff") == 0 || strcmp(doWhat, "all") == 0) - { - sprintf(mkdir_command, "if [ ! -e plots/efficiency_studies ] ; then mkdir plots/efficiency_studies ; fi"); - system(mkdir_command); - outROOT_eff = TFile::Open(Form("plots/efficiency_studies/%s_%s_%s.root", MCP.c_str(), scanType, label), "recreate"); - } - //---charge - if(strcmp(doWhat, "Q") == 0 || strcmp(doWhat, "all") == 0) - { - sprintf(mkdir_command, "if [ ! -e plots/charge_studies ] ; then mkdir plots/charge_studies ; fi"); - system(mkdir_command); - outROOT_Q = TFile::Open(Form("plots/charge_studies/%s_%s_%s.root", MCP.c_str(), scanType, label), "recreate"); - } - //---time resolution CFD - if(strcmp(doWhat, "timeCFD") == 0 || strcmp(doWhat, "all") == 0) - { - sprintf(mkdir_command, "if [ ! -e plots/resCFD_studies ] ; then mkdir plots/resCFD_studies ; fi"); - system(mkdir_command); - outROOT_CFD = TFile::Open(Form("plots/resCFD_studies/%s_%s_%s.root", MCP.c_str(), scanType, label), "recreate"); - } - //---time resolution LED - if(strcmp(doWhat, "timeLED") == 0 || strcmp(doWhat, "all") == 0) - { - sprintf(mkdir_command, "if [ ! -e plots/resLED_studies ] ; then mkdir plots/resLED_studies ; fi"); - system(mkdir_command); - outROOT_LED = TFile::Open(Form("plots/resLED_studies/%s_%s_%s.root", MCP.c_str(), scanType, label), "recreate"); - } - - - //---open tree and get: run list and corresponding HV/X0--- - std::vector HVVal; - HVVal.clear(); - std::vector X0Step; - X0Step.clear(); - std::vector ScanList; - ScanList.clear(); - - //Output Histos - TH1F *h_XDiff_Hodo1TDC = new TH1F( "h_XDiff_Hodo1TDC", "", 60, -60., 60.); h_XDiff_Hodo1TDC->GetXaxis()->SetTitle("HODOX1 - TDCX [mm]"); - TH1F *h_YDiff_Hodo1TDC = new TH1F( "h_YDiff_Hodo1TDC", "", 60, -60., 60.); h_YDiff_Hodo1TDC->GetXaxis()->SetTitle("HODOY1 - TDCY [mm]"); - TH1F *h_XDiff_Hodo2TDC = new TH1F( "h_XDiff_Hodo2TDC", "", 60, -60., 60.); h_XDiff_Hodo2TDC->GetXaxis()->SetTitle("HODOX2 - TDCX [mm]"); - TH1F *h_YDiff_Hodo2TDC = new TH1F( "h_YDiff_Hodo2TDC", "", 60, -60., 60.); h_YDiff_Hodo2TDC->GetXaxis()->SetTitle("HODOY2 - TDCY [mm]"); - TH1F *h_XDiff_Hodo12 = new TH1F( "h_XDiff_Hodo12", "", 60, -15., 15.); h_XDiff_Hodo12->GetXaxis()->SetTitle("HODOX1 - HODOX2 [mm]"); - TH1F *h_YDiff_Hodo12 = new TH1F( "h_YDiff_Hodo12", "", 60, -15., 15.); h_YDiff_Hodo12->GetXaxis()->SetTitle("HODOY1 - HODOY2 [mm]"); - TH1F *h_XDiff_Hodo1TDC_c = new TH1F( "h_XDiff_Hodo1TDC_c", "", 20, -10., 10.); h_XDiff_Hodo1TDC_c->GetXaxis()->SetTitle("HODOX1 - TDCX [mm]"); - TH1F *h_YDiff_Hodo1TDC_c = new TH1F( "h_YDiff_Hodo1TDC_c", "", 20, -10., 10.); h_YDiff_Hodo1TDC_c->GetXaxis()->SetTitle("HODOY1 - TDCY [mm]"); - TH1F *h_XDiff_Hodo2TDC_c = new TH1F( "h_XDiff_Hodo2TDC_c", "", 20, -10., 10.); h_XDiff_Hodo2TDC_c->GetXaxis()->SetTitle("HODOX2 - TDCX [mm]"); - TH1F *h_YDiff_Hodo2TDC_c = new TH1F( "h_YDiff_Hodo2TDC_c", "", 20, -10., 10.); h_YDiff_Hodo2TDC_c->GetXaxis()->SetTitle("HODOY2 - TDCY [mm]"); - TH1F *h_XDiff_Hodo12_c = new TH1F( "h_XDiff_Hodo12_c", "", 20, -10., 10.); h_XDiff_Hodo12_c->GetXaxis()->SetTitle("HODOX1 - HODOX2 [mm]"); - TH1F *h_YDiff_Hodo12_c = new TH1F( "h_YDiff_Hodo12_c", "", 20, -10., 10.); h_YDiff_Hodo12_c->GetXaxis()->SetTitle("HODOY1 - HODOY2 [mm]"); - TH1F *h_nX1 = new TH1F( "h_nX1", "", 50, 0., 50.); h_nX1->GetXaxis()->SetTitle("N Fibers X1"); - TH1F *h_nY1 = new TH1F( "h_nY1", "", 50, 0., 50.); h_nY1->GetXaxis()->SetTitle("NFibers Y1"); - TH1F *h_nX2 = new TH1F( "h_nX2", "", 50, 0., 50.); h_nX2->GetXaxis()->SetTitle("N Fibers X2"); - TH1F *h_nY2 = new TH1F( "h_nY2", "", 50, 0., 50.); h_nY2->GetXaxis()->SetTitle("N Fibers Y2"); - TH1F *h_pX1 = new TH1F( "h_pX1", "", 60, -30., 30.); h_pX1->GetXaxis()->SetTitle("HODO1 X [mm]"); - TH1F *h_pY1 = new TH1F( "h_pY1", "", 60, -30., 30.); h_pY1->GetXaxis()->SetTitle("HODO1 Y [mm]"); - TH1F *h_TDCX = new TH1F( "h_TDCX", "", 60, -30., 30.); h_TDCX->GetXaxis()->SetTitle("TDC X [mm]"); - TH1F *h_TDCY = new TH1F( "h_TDCY", "", 60, -30., 30.); h_TDCY->GetXaxis()->SetTitle("TDC Y [mm]"); - TH2F *h_Corr_TDC_HODO1_X = new TH2F( "h_Corr_TDC_HODO1_X", "", 60, -30., 30.,60, -30., 30.); h_Corr_TDC_HODO1_X->GetXaxis()->SetTitle("HODO1 X [mm]"); h_Corr_TDC_HODO1_X->GetYaxis()->SetTitle("TDC X [mm]"); - TH2F *h_Corr_TDC_HODO1_Y = new TH2F( "h_Corr_TDC_HODO1_Y", "", 60, -30., 30.,60, -30., 30.); h_Corr_TDC_HODO1_Y->GetXaxis()->SetTitle("HODO1 Y [mm]"); h_Corr_TDC_HODO1_X->GetYaxis()->SetTitle("TDC Y [mm]"); - TH2F *h_TriggM2 = new TH2F( "h_TriggM2", "", 32, -16., 16., 32, -16., 16.); h_TriggM2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_TriggM2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_TriggM3 = new TH2F( "h_TriggM3", "", 32, -16., 16., 32, -16., 16.); h_TriggM3->GetXaxis()->SetTitle("HODO2 X [mm]"); h_TriggM3->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_TriggZ1 = new TH2F( "h_TriggZ1", "", 32, -16., 16., 32, -16., 16.); h_TriggZ1->GetXaxis()->SetTitle("HODO2 X [mm]"); h_TriggZ1->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_TriggZ2 = new TH2F( "h_TriggZ2", "", 32, -16., 16., 32, -16., 16.); h_TriggZ2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_TriggZ2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_TriggSe = new TH2F( "h_TriggSe", "", 32, -16., 16., 32, -16., 16.); h_TriggSe->GetXaxis()->SetTitle("HODO2 X [mm]"); h_TriggSe->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_NumEff_M2 = new TH2F( "h_NumEff_M2", "", 32, -16, 16, 32, -16, 16); h_NumEff_M2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_NumEff_M2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_NumEff_M3 = new TH2F( "h_NumEff_M3", "", 32, -16, 16, 32, -16, 16); h_NumEff_M3->GetXaxis()->SetTitle("HODO2 X [mm]"); h_NumEff_M3->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_NumEff_Z1 = new TH2F( "h_NumEff_Z1", "", 32, -16, 16, 32, -16, 16); h_NumEff_Z1->GetXaxis()->SetTitle("HODO2 X [mm]"); h_NumEff_Z1->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_NumEff_Z2 = new TH2F( "h_NumEff_Z2", "", 32, -16, 16, 32, -16, 16); h_NumEff_Z2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_NumEff_Z2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_NumEff_Se = new TH2F( "h_NumEff_Se", "", 32, -16, 16, 32, -16, 16); h_NumEff_Se->GetXaxis()->SetTitle("HODO2 X [mm]"); h_NumEff_Se->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_Eff_vsH2_M2 = new TH2F( "h_Eff_vsH2_M2", "", 32, -16, 16, 32, -16, 16); h_Eff_vsH2_M2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_Eff_vsH2_M2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_Eff_vsH2_M3 = new TH2F( "h_Eff_vsH2_M3", "", 32, -16, 16, 32, -16, 16); h_Eff_vsH2_M3->GetXaxis()->SetTitle("HODO2 X [mm]"); h_Eff_vsH2_M3->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_Eff_vsH2_Z1 = new TH2F( "h_Eff_vsH2_Z1", "", 32, -16, 16, 32, -16, 16); h_Eff_vsH2_Z1->GetXaxis()->SetTitle("HODO2 X [mm]"); h_Eff_vsH2_Z1->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_Eff_vsH2_Z2 = new TH2F( "h_Eff_vsH2_Z2", "", 32, -16, 16, 32, -16, 16); h_Eff_vsH2_Z2->GetXaxis()->SetTitle("HODO2 X [mm]"); h_Eff_vsH2_Z2->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TH2F *h_Eff_vsH2_Se = new TH2F( "h_Eff_vsH2_Se", "", 32, -16, 16, 32, -16, 16); h_Eff_vsH2_Se->GetXaxis()->SetTitle("HODO2 X [mm]"); h_Eff_vsH2_Se->GetYaxis()->SetTitle("HODO2 Y [mm]"); - TGraphAsymmErrors *TG_effHODO2_X, *TG_effHODO2_Y, *TG_effHODO1_X, *TG_effHODO1_Y, * TG_effTDC_X, * TG_effTDC_Y; - TH1F * h_N_Trig1_vsX = new TH1F( "h_N_Trig1_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig1_hodo2_vsX = new TH1F( "h_N_Trig1_hodo2_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig1_vsY = new TH1F( "h_N_Trig1_vsY", "", 16, -16, 16 ); - TH1F * h_N_Trig1_hodo2_vsY = new TH1F( "h_N_Trig1_hodo2_vsY", "", 16, -16, 16 ); - TH1F * h_N_Trig2_vsX = new TH1F( "h_N_Trig2_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig2_hodo1_vsX = new TH1F( "h_N_Trig2_hodo1_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig2_vsY = new TH1F( "h_N_Trig2_vsY", "", 16, -16, 16 ); - TH1F * h_N_Trig2_hodo1_vsY = new TH1F( "h_N_Trig2_hodo1_vsY", "", 16, -16, 16 ); - TH1F * h_N_Trig1_TDC_vsX = new TH1F( "h_N_Trig1_TDC_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig1Tdc_vsX = new TH1F( "h_N_Trig1Tdc_vsX", "", 16, -16, 16 ); - TH1F * h_N_Trig1_TDC_vsY = new TH1F( "h_N_Trig1_TDC_vsY", "", 16, -16, 16 ); - TH1F * h_N_Trig1Tdc_vsY = new TH1F( "h_N_Trig1Tdc_vsY", "", 16, -16, 16 ); - float HODOX1TDC = 0.283591, HODOY1TDC = 2.45504; - float HODOX2TDC = 2.80849, HODOY2TDC = 2.52657; - float ShiftX = -4.749, ShiftY = -2.948; - //---save list of HV (or X0) step--- - if (strcmp(scanType,"HV")==0) { - int prev=0; - for (int iEntry=0; iEntryGetEntries(); iEntry++) - { - nt->GetEntry(iEntry); - if (HV[MCPNumber]!=prev) { - ScanList.push_back((float)HV[MCPNumber]); - HVVal.push_back(HV[MCPNumber]); - X0Step.push_back(X0); - prev=HV[MCPNumber]; - if (iEntry==0) { - for (int i=0; iGetEntries(); iEntry++){ - nt->GetEntry(iEntry); - if (HV[MCPNumber]!=prev) { - ScanList.push_back((float)HV[MCPNumber]); - HVVal.push_back(HV[MCPNumber]); - X0Step.push_back(X0); - prev=HV[MCPNumber]; - if (iEntry==0) { - for (int i=0; iGetEntries(); iEntry++){ - nt->GetEntry(iEntry); - //HODO position from fibers - int nX1(0), nY1(0), nX2(0), nY2(0); - float pX1(0.), pY1(0.), pX2(0.), pY2(0.); - int f_minX1=-1, f_maxX1=-1, f_minY1=-1, f_maxY1=-1, f_minX2=-1, f_maxX2=-1, f_minY2=-1, f_maxY2=-1; - int iMINX1 = 99, iMAXX1 = -99, iMINY1 = 99, iMAXY1 = -99, iMINX2 = 99, iMAXX2 = -99, iMINY2 = 99, iMAXY2 = -99; - for(int i=0; i<64; i++){ - if( hodoX1[i] ){ pX1 +=i; nX1 += hodoX1[i]; if(iiMAXX1){ f_maxX1 = i; iMAXX1 = i; } } - if( hodoY1[i] ){ pY1 +=i; nY1 += hodoY1[i]; if(iiMAXY1){ f_maxY1 = i; iMAXY1 = i; } } - if( hodoX2[i] ){ pX2 +=i; nX2 += hodoX2[i]; if(iiMAXX2){ f_maxX2 = i; iMAXX2 = i; } } - if( hodoY2[i] ){ pY2 +=i; nY2 += hodoY2[i]; if(iiMAXY2){ f_maxY2 = i; iMAXY2 = i; } } - } - h_nX1->Fill( nX1 ); h_nY1->Fill( nY1 ); h_nX2->Fill( nX2 ); h_nY2->Fill( nY2 ); - //Selection - bool sele ( nX1<4 && nY1<4 && nX2<4 && nY2<4 && nX1>1 && nY1>1 && nX2>1 && nY2>1 ); - bool ClusterShape = ( f_maxX1-f_minX1==nX1-1 && f_maxY1-f_minY1==nY1-1 && f_maxX2-f_minX2==nX2-1 && f_maxY2-f_minY2==nY2-1 ); //Fibers all close each others - sele &= (charge_corr[trigPos1] > treshold.at(trigPos1) ); - sele &= ClusterShape; - //Differences in position - pX1 /= nX1; pY1 /= nY1; pX2 /= nX2; pY2 /= nY2; //HODO pos - pX1 -= 32.; pY1 -= 32.; pX2 -= 32.; pY2 -= 32.; //Centered to 0 - tdcY *= -1; //righ sign - pX1 /= 2; pY1 /= 2; pX2 /= 2; pY2 /= 2; //conversion to mm (1 fiber is 0.5) - if(nX1==0) pX1=-99.; if(nY1==0) pY1=-99.; if(nX2==0) pX2=-99.; if(nY2==0) pY2=-99.; //If no hit position -99 - float pX1_c = pX1-HODOX1TDC-ShiftX, pY1_c = pY1-HODOY1TDC-ShiftY, pX2_c = pX2-HODOX2TDC-ShiftX, pY2_c = pY2-HODOY2TDC-ShiftY, tdcX_c = tdcX-ShiftX, tdcY_c = tdcY-ShiftY; //Times centered in 0 - if( sele ){ - //Correl - h_pX1->Fill(pX1); - h_pY1->Fill(pY1); - h_TDCX->Fill(tdcX); - h_TDCY->Fill(tdcY); - h_Corr_TDC_HODO1_X->Fill(pX1,tdcX); - h_Corr_TDC_HODO1_Y->Fill(pY1,tdcY); - //Diff - h_XDiff_Hodo1TDC->Fill( pX1-tdcX ); - h_YDiff_Hodo1TDC->Fill( pY1-tdcY ); - h_XDiff_Hodo2TDC->Fill( pX2-tdcX ); - h_YDiff_Hodo2TDC->Fill( pY2-tdcY ); - h_XDiff_Hodo12->Fill( pX1-pX2 ); - h_YDiff_Hodo12->Fill( pY1-pY2 ); - h_XDiff_Hodo1TDC_c->Fill( pX1_c-tdcX_c ); - h_YDiff_Hodo1TDC_c->Fill( pY1_c-tdcY_c ); - h_XDiff_Hodo2TDC_c->Fill( pX2_c-tdcX_c ); - h_YDiff_Hodo2TDC_c->Fill( pY2_c-tdcY_c ); - h_XDiff_Hodo12_c->Fill( pX1_c-pX2_c ); - h_YDiff_Hodo12_c->Fill( pY1_c-pY2_c ); - //Eff as a function of HODO2 position - int binX = int( (16.+pX2_c) ); - int binY = int( (16.+pY2_c) ); - bool HV1_MiB2( TString(label).Contains("HVScan1") && HV[MCPList.at("MiB2")]==2750 ); - bool HV1_MiB3( TString(label).Contains("HVScan1") && HV[MCPList.at("MiB3")]==3100 ); - bool HV1_MiZ1( TString(label).Contains("HVScan1") && HV[MCPList.at("ZStack1")]==3150 ); - bool HV1_MiZ2( TString(label).Contains("HVScan1") && HV[MCPList.at("ZStack2")]==3300 ); - bool HV1_MiSe( TString(label).Contains("HVScan1") && HV[MCPList.at("enSEE")]==2200 ); - bool HV2_MiB2( TString(label).Contains("HVScan2") && HV[MCPList.at("MiB2")]==2750 ); - bool HV2_MiB3( TString(label).Contains("HVScan2") && HV[MCPList.at("MiB3")]==3100 ); - bool HV2_MiZ1( TString(label).Contains("HVScan2") && HV[MCPList.at("ZStack1")]==3300 ); - bool HV2_MiZ2( TString(label).Contains("HVScan2") && HV[MCPList.at("ZStack2")]==3100 ); - bool HV2_MiSe( TString(label).Contains("HVScan2") && HV[MCPList.at("enSEE")]==2200 ); - bool HV68_MiB2( (TString(label).Contains("HVScan6") || TString(label).Contains("HVScan8") ) && HV[MCPList.at("MiB2")]==2750 ); - bool HV68_MiB3( (TString(label).Contains("HVScan6") || TString(label).Contains("HVScan8") ) && HV[MCPList.at("MiB3")]==3100 ); - bool HV68_MiZ1( (TString(label).Contains("HVScan6") || TString(label).Contains("HVScan8") ) && HV[MCPList.at("ZStack1")]==3300 ); - bool HV68_MiZ2( (TString(label).Contains("HVScan6") || TString(label).Contains("HVScan8") ) && HV[MCPList.at("ZStack2")]==3300 ); - bool HV68_MiSe( (TString(label).Contains("HVScan6") || TString(label).Contains("HVScan8") ) && HV[MCPList.at("enSEE")]==2200 ); - bool X0_0( X0==0 ); - if( HV1_MiB2 || HV2_MiB2 || HV68_MiB2 || X0_0 ){ - h_TriggM2->SetBinContent( binX+1, binY+1, h_TriggM2->GetBinContent(binX+1, binY+1) + 1 ); - if( (charge_corr[ MCPList.at("MiB2") ] > treshold.at( MCPList.at("MiB2") ) ) ){ - h_NumEff_M2->SetBinContent( binX+1, binY+1, h_NumEff_M2->GetBinContent(binX+1, binY+1) + 1 ); - } - } - if( HV1_MiB3 || HV2_MiB3 || HV68_MiB3 || X0_0 ){ - h_TriggM3->SetBinContent( binX+1, binY+1, h_TriggM3->GetBinContent(binX+1, binY+1) + 1 ); - if( (charge_corr[ MCPList.at("MiB3") ] > treshold.at( MCPList.at("MiB3") ) ) ){ - h_NumEff_M3->SetBinContent( binX+1, binY+1, h_NumEff_M3->GetBinContent(binX+1, binY+1) + 1 ); - } - } - if( HV1_MiZ1 || HV2_MiZ1 || HV68_MiZ1 || X0_0 ){ - h_TriggZ1->SetBinContent( binX+1, binY+1, h_TriggZ1->GetBinContent(binX+1, binY+1) + 1 ); - if( (charge_corr[ MCPList.at("ZStack1") ] > treshold.at( MCPList.at("ZStack1") ) ) ){ - h_NumEff_Z1->SetBinContent( binX+1, binY+1, h_NumEff_Z1->GetBinContent(binX+1, binY+1) + 1 ); - } - } - if( HV1_MiZ2 || HV2_MiZ2 || HV68_MiZ2 || X0_0 ){ - h_TriggZ2->SetBinContent( binX+1, binY+1, h_TriggZ2->GetBinContent(binX+1, binY+1) + 1 ); - if( (charge_corr[ MCPList.at("ZStack2") ] > treshold.at( MCPList.at("ZStack2") ) ) ){ - h_NumEff_Z2->SetBinContent( binX+1, binY+1, h_NumEff_Z2->GetBinContent(binX+1, binY+1) + 1 ); - } - } - if( HV1_MiSe || HV2_MiSe || HV68_MiSe || X0_0 ){ - h_TriggSe->SetBinContent( binX+1, binY+1, h_TriggSe->GetBinContent(binX+1, binY+1) + 1 ); - if( (charge_corr[ MCPList.at("enSEE") ] > treshold.at( MCPList.at("enSEE") ) ) ){ - h_NumEff_Se->SetBinContent( binX+1, binY+1, h_NumEff_Se->GetBinContent(binX+1, binY+1) + 1 ); - } - } - } - //Efficiensies for HODOS - bool Trigger_HODO1 = ( f_maxX1-f_minX1==nX1-1 && nX1<3 && nY1<3 && nX1>1 && nY1>1 ); - bool Mcp_tri = (charge_corr[trigPos1] > treshold.at(trigPos1) ); - bool hodo_pos = fabs(pX1_c-pX2_c)<=2 && fabs(pY1_c-pY2_c)<=2; - if( Trigger_HODO1 && Mcp_tri ){ - N_Trig1 += 1; - int binX = int( (16.+pX1_c)/2. ); - int binY = int( (16.+pY1_c)/2. ); - h_N_Trig1_vsX->SetBinContent( binX+1, h_N_Trig1_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig1_vsY->SetBinContent( binY+1, h_N_Trig1_vsY->GetBinContent(binY+1)+1 ); - bool sele_HODO2 = ( nX2>=1 && nY2>=1 ); - if( sele_HODO2 && hodo_pos){ - N_Trig1_hodo2 += 1; - h_N_Trig1_hodo2_vsX->SetBinContent( binX+1, h_N_Trig1_hodo2_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig1_hodo2_vsY->SetBinContent( binY+1, h_N_Trig1_hodo2_vsY->GetBinContent(binY+1)+1 ); - } - } - bool tdc_pos = ( fabs(pX1_c-tdcX_c)<4 && fabs(pY1_c-tdcY_c)<4 ); - if( Trigger_HODO1 && Mcp_tri ){ - N_Trig1wc += 1; - int binX = int( (16.+pX1_c)/2. ); - int binY = int( (16.+pY1_c)/2. ); - h_N_Trig1Tdc_vsX->SetBinContent( binX+1, h_N_Trig1Tdc_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig1Tdc_vsY->SetBinContent( binY+1, h_N_Trig1Tdc_vsY->GetBinContent(binY+1)+1 ); - bool sele_WC = tdcX_c > -70 && tdcY_c > -70; - if( sele_WC && tdc_pos){ - N_Trig1_WC += 1; - h_N_Trig1_TDC_vsX->SetBinContent( binX+1, h_N_Trig1_TDC_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig1_TDC_vsY->SetBinContent( binY+1, h_N_Trig1_TDC_vsY->GetBinContent(binY+1)+1 ); - } - } - bool Trigger_HODO2 = ( f_maxX2-f_minX2==nX2-1 && nX2<3 && nY2<3 && nX2>1 && nY2>1 ); - hodo_pos = fabs(pX1_c-pX2_c)<=2 && fabs(pY1_c-pY2_c)<=2; - if( Trigger_HODO2 && Mcp_tri ){ - N_Trig2 += 1; - int binX = int( (16.+pX2_c)/2. ); - int binY = int( (16.+pY2_c)/2. ); - h_N_Trig2_vsX->SetBinContent( binX+1, h_N_Trig2_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig2_vsY->SetBinContent( binY+1, h_N_Trig2_vsY->GetBinContent(binY+1)+1 ); - bool sele_HODO1 = ( nX1>=1 && nY1>=1 && hodo_pos ); - if( sele_HODO1 ){ - N_Trig2_hodo1 += 1; - h_N_Trig2_hodo1_vsX->SetBinContent( binX+1, h_N_Trig2_hodo1_vsX->GetBinContent(binX+1)+1 ); - h_N_Trig2_hodo1_vsY->SetBinContent( binY+1, h_N_Trig2_hodo1_vsY->GetBinContent(binY+1)+1 ); - } - } - }//iEntry - //HODOS efficiencies - if( N_Trig1!=0 ) cout<<"Trigger HODO1: Efficiency on HODO2 is: "<GetBinContent(i+1) < 6000 ){ h_N_Trig1_vsX->SetBinContent(i+1,0); h_N_Trig1_hodo2_vsX->SetBinContent(i+1,0); } - if( h_N_Trig1_vsY->GetBinContent(i+1) < 6000 ){ h_N_Trig1_vsY->SetBinContent(i+1,0); h_N_Trig1_hodo2_vsY->SetBinContent(i+1,0); } - if( h_N_Trig2_vsX->GetBinContent(i+1) < 6000 ){ h_N_Trig2_vsX->SetBinContent(i+1,0); h_N_Trig2_hodo1_vsX->SetBinContent(i+1,0); } - if( h_N_Trig2_vsY->GetBinContent(i+1) < 6000 ){ h_N_Trig2_vsY->SetBinContent(i+1,0); h_N_Trig2_hodo1_vsY->SetBinContent(i+1,0); } - if( h_N_Trig1Tdc_vsX->GetBinContent(i+1) < 6000 ){ h_N_Trig1_TDC_vsX->SetBinContent(i+1,0); h_N_Trig1Tdc_vsX->SetBinContent(i+1,0); } - if( h_N_Trig1Tdc_vsY->GetBinContent(i+1) < 6000 ){ h_N_Trig1_TDC_vsY->SetBinContent(i+1,0); h_N_Trig1Tdc_vsY->SetBinContent(i+1,0); } - } - TG_effHODO2_X = new TGraphAsymmErrors (h_N_Trig1_hodo2_vsX, h_N_Trig1_vsX); TG_effHODO2_X->SetName("TG_effHODO2_X"); - TG_effHODO2_Y = new TGraphAsymmErrors (h_N_Trig1_hodo2_vsY, h_N_Trig1_vsY); TG_effHODO2_Y->SetName("TG_effHODO2_Y"); - TG_effHODO1_X = new TGraphAsymmErrors (h_N_Trig2_hodo1_vsX, h_N_Trig2_vsX); TG_effHODO1_X->SetName("TG_effHODO1_X"); - TG_effHODO1_Y = new TGraphAsymmErrors (h_N_Trig2_hodo1_vsY, h_N_Trig2_vsY); TG_effHODO1_Y->SetName("TG_effHODO1_Y"); - TG_effTDC_X = new TGraphAsymmErrors (h_N_Trig1_TDC_vsX, h_N_Trig1Tdc_vsX); TG_effTDC_X->SetName("TG_effTDC_X"); - TG_effTDC_Y = new TGraphAsymmErrors (h_N_Trig1_TDC_vsY, h_N_Trig1Tdc_vsY); TG_effTDC_Y->SetName("TG_effTDC_Y"); - }//if HODO - else { - float prev=-1.; - for (int iEntry=0; iEntryGetEntries(); iEntry++) - { - nt->GetEntry(iEntry); - if (X0>(prev+0.001)||X0<(prev-0.001)) { - ScanList.push_back(X0); - HVVal.push_back(HV[MCPNumber]); - X0Step.push_back(X0); - prev=X0; - if (iEntry==0) { - for (int i=0; i \ntrigger 1 = "<SetName("eff"); - - TGraphErrors *g_Q = new TGraphErrors(); - g_Q->SetName("Q"); - - TGraphErrors *g_resCFD = new TGraphErrors(); - g_resCFD->SetName("resCFD"); - - TGraphErrors *g_resLED = new TGraphErrors(); - g_resLED->SetName("resLED"); - - TGraphErrors* g_frac_saturated = new TGraphErrors(); - g_frac_saturated->SetName("frac_saturated"); - -//------Build TCut and draw variables----------------------------------------------------- - //---efficiency - char var_sig[100]=""; - char var_trig0[100]=""; - // char var_dt_vs_ampM[100]=""; - // char var_dtStart_vs_ampM[100] = ""; - // char var_dtStart_vs_Tot[100] = ""; - char var_fracSaturated[100]=""; - char var_evtAll[100]=""; - //---charge - char var_charge[200]=""; - //---time resolution - char var_timeCFD[200]=""; - char var_timeCFD_red[200]=""; - char var_timeCFD_vs_TOT[500] = ""; - char var_timeCFD_vs_ampMax[500] = ""; - char var_timeLED[200] = ""; - char var_timeLED_red[200] = ""; - char var_timeLED_vs_TOT[500] = ""; - char var_timeLED_vs_ampMax[500] = ""; - //---cut strings - char str_cut_sig[500]=""; - char str_cut_trig0[500]=""; - char str_cut_tdc[500]=""; - char str_cut_saturated[500]=""; - char str_cut_nFibers[500]=""; - char str_cut_trig_not_sat[500]=""; - char str_cut_bad_timeCFD[500]=""; - char str_cut_bad_timeLED[500]=""; - //---Define Cuts--- - sprintf(str_cut_sig, "charge_corr[%d] > %d", MCPNumber, treshold.at(MCPNumber)); - sprintf(str_cut_trig0, "charge_corr[%d] > %d", trigPos1, treshold.at(trigPos1)); - float cutTDCX_min = -5.+ShiftX, cutTDCX_max = 3.+ShiftX, cutTDCY_min = -2.+ShiftY, cutTDCY_max = 6.+ShiftY; - sprintf(str_cut_tdc, "tdcX > %f && tdcX < %f && tdcY >%f && tdcY < %f", cutTDCX_min, cutTDCX_max, cutTDCY_min, cutTDCY_max); - sprintf(str_cut_saturated, "amp_max[%d] > 3450", MCPNumber); - sprintf(str_cut_nFibers, "nhodoX1<=3 && nhodoX2<=3 && nhodoY1<=3 && nhodoY2<=3"); - sprintf(str_cut_trig_not_sat, "amp_max[%d] < 3450", trigPos1); - sprintf(str_cut_bad_timeCFD, "time_start_150[%d] != -20", MCPNumber); - if (MCPList.at(MCP)==4) - { - sprintf(str_cut_bad_timeLED, "time_start_150[%d] != 20 && time_start_150[%d] != 20 && " - "((time_start_150[%d]-time_CF_corr[%d])<-3/5*(time_stop_150[%d]-time_start_150[%d]))", - MCPNumber, trigPos1, MCPNumber, trigPos1, MCPNumber, MCPNumber); - } - else - { - sprintf(str_cut_bad_timeLED, "time_start_150[%d] != 20 && time_start_150[%d] != 20 && " - "((time_start_150[%d]-time_CF_corr[%d])<-1/3*(time_stop_150[%d]-time_start_150[%d])+2)", - MCPNumber, trigPos1, MCPNumber, trigPos1, MCPNumber, MCPNumber); - } - //---construct TCut - TCut cut_sig = str_cut_sig; - TCut cut_trig0 = str_cut_trig0; - TCut cut_tdc = str_cut_tdc; - TCut cut_saturated = str_cut_saturated; - TCut cut_nFibers = str_cut_nFibers; - TCut cut_trig_not_sat = str_cut_trig_not_sat; - TCut cut_bad_timeCFD = str_cut_bad_timeCFD; - TCut cut_bad_timeLED = str_cut_bad_timeLED; - - -//-------Runs loop------------------------------------------------------------------------ - for(unsigned int i=0; i 796 && amp_max[%d] > 4000", MCPNumber); - //---and print infos - char var_name[3] = "X0"; - if(TString(scanType).Contains("HV") == 1) - sprintf(var_name, "HV"); - - //-------define histos------------------------------------------------------------ - //-----create objects names----- - char h_fracSat_name[20], h_evtAll_name[20]; - char h_sig_name[20], h_trig0_name[20]; - char h_charge_name[20]; - char pr_timeCFD_vs_TOT_name[20], h_resCFD_name[20], f_resCFD_name[20], f_corrCFD_name[20], f_corrCFD2_name[40]; - char pr_timeLED_vs_TOT_name[20], h_resLED_name[20], f_resLED_name[20], f_corrLED_name[20], f_corrLED2_name[40]; - char pr_timeCFD_vs_ampMaxCorr_name[40], pr_timeLED_vs_ampMaxCorr_name[40]; - //-----create objects------ - //---saturated events fraction - sprintf(h_fracSat_name, "h_fracSat_name_%d", i); - sprintf(h_evtAll_name, "h_evtAll_name_%d", i); - TH1F* h_fracSat = new TH1F(h_fracSat_name, h_fracSat_name, 100, 0., 100.); - TH1F* h_evtAll = new TH1F(h_evtAll_name, h_evtAll_name, 100, 0., 100.); - //---efficiency - sprintf(h_sig_name, "h_sig_%d", i); - sprintf(h_trig0_name, "h_trig0_%d", i); - TH1F* h_sig= new TH1F(h_sig_name, h_sig_name, 500, -5000, 25000); - TH1F* h_trig0 = new TH1F(h_trig0_name, h_trig0_name, 500, -5000, 25000); - //---TOT - char TOT_diff[100]; - sprintf(TOT_diff, "(time_stop_150[%d]-time_start_150[%d])", MCPNumber, MCPNumber); - //---charge - sprintf(h_charge_name, "h_charge_%d", i); - TH1F* h_charge = new TH1F(h_charge_name, "charge distribution", 500, -500, 110000); - // TH1F* h_charge = new TH1F(h_charge_name, "TOT distribution", 200, 0, 10); - //---time CFD/TOT corrected - sprintf(pr_timeCFD_vs_TOT_name, "pr_timeCFD_vs_TOT_%d", i); - sprintf(pr_timeCFD_vs_ampMaxCorr_name, "pr_timeCFD_vs_ampMaxCorr_%d", i); - sprintf(h_resCFD_name, "h_resCFD_%d", i); - sprintf(f_resCFD_name, "f_resCFD_%d", i); - sprintf(f_corrCFD_name, "f_corrCFD_%d", i); - sprintf(f_corrCFD_name, "f_corrCFD2_%d", i); - TH1F* h_resCFD = new TH1F(h_resCFD_name, "Electron Beam 50 GeV", 250, -1, 1); - h_resCFD->GetXaxis()->SetTitle("time_{MCP}-time_{TRIG} (ns)"); - h_resCFD->GetYaxis()->SetTitle("Entries"); - h_resCFD->GetXaxis()->SetTitleSize(0.05); - h_resCFD->GetYaxis()->SetTitleSize(0.05); - h_resCFD->GetXaxis()->SetTitleOffset(0.9); - h_resCFD->GetYaxis()->SetTitleOffset(0.9); - TF1* f_resCFD = new TF1(f_resCFD_name, "gausn", -1, 1); - TProfile* pr_timeCFD_vs_TOT; - TProfile* pr_timeCFD_vs_ampMaxCorr; - TF1* f_corrCFD; - TF1* f_corrCFD2; - if(strcmp(scanType, "HV") == 0) - { - pr_timeCFD_vs_TOT = new TProfile(pr_timeCFD_vs_TOT_name, "timeCF vs TOT difference", - 25, 0, 5, -5, 2); - f_corrCFD = new TF1(f_corrCFD_name, "pol2", 0, 5); - - pr_timeCFD_vs_ampMaxCorr = new TProfile(pr_timeCFD_vs_ampMaxCorr_name, "timeCF vs ampMaxCorr", - 20, 0, 8000, -2, 2); - f_corrCFD2 = new TF1(f_corrCFD2_name, "pol4", 0, 8000); - } - else - { - pr_timeCFD_vs_TOT = new TProfile(pr_timeCFD_vs_TOT_name, "timeCF vs TOT difference", - 30, 0, 10, -5, 2); - f_corrCFD = new TF1(f_corrCFD_name, "pol2", 0, 6); - - pr_timeCFD_vs_ampMaxCorr = new TProfile(pr_timeCFD_vs_ampMaxCorr_name, "timeCF vs ampMaxCorr", - 20, 0, 8000, -2, 2); - f_corrCFD2 = new TF1(f_corrCFD2_name, "pol4", 0, 8000); - } - pr_timeCFD_vs_TOT->SetMarkerStyle(20); - pr_timeCFD_vs_TOT->SetMarkerSize(0.7); - pr_timeCFD_vs_ampMaxCorr->SetMarkerStyle(20); - pr_timeCFD_vs_ampMaxCorr->SetMarkerSize(0.7); - //---time LED/TOT corrected - sprintf(pr_timeLED_vs_TOT_name, "pr_timeLED_vs_TOT_%d", i); - sprintf(pr_timeLED_vs_ampMaxCorr_name, "pr_timeLED_vs_ampMaxCorr_%d", i); - sprintf(h_resLED_name, "h_resLED_%d", i); - sprintf(f_resLED_name, "f_resLED_%d", i); - sprintf(f_corrLED_name, "f_corrLED_%d", i); - TH1F* h_resLED = new TH1F(h_resLED_name, "time res with LED method", 250, -1, 1); - TF1* f_resLED = new TF1(f_resLED_name, "gausn", -1, 1); - TProfile* pr_timeLED_vs_TOT; - TProfile* pr_timeLED_vs_ampMaxCorr; - TF1* f_corrLED; - TF1* f_corrLED2; - if(strcmp(scanType, "HV") == 0) - { - pr_timeLED_vs_TOT = new TProfile(pr_timeLED_vs_TOT_name, "time vs TOT difference", - 25, 0, 5, -5, 2); - f_corrLED = new TF1(f_corrLED_name, "pol2", 0, 5); - - pr_timeLED_vs_ampMaxCorr = new TProfile(pr_timeLED_vs_ampMaxCorr_name, "timeLED vs ampMaxCorr", - 20, 0, 8000, -2, 2); - f_corrLED2 = new TF1(f_corrLED2_name, "pol4", 0, 8000); - } - else - { - pr_timeLED_vs_TOT = new TProfile(pr_timeLED_vs_TOT_name, "time vs TOT difference", - 30, 0, 10, -5, 2); - f_corrLED = new TF1(f_corrLED_name, "pol2", 0, 6); - - pr_timeLED_vs_ampMaxCorr = new TProfile(pr_timeLED_vs_ampMaxCorr_name, "timeLED vs ampMaxCorr", - 20, 0, 8000, -2, 2); - f_corrLED2 = new TF1(f_corrLED2_name, "pol4", 0, 8000); - } - pr_timeLED_vs_TOT->SetMarkerStyle(20); - pr_timeLED_vs_TOT->SetMarkerSize(0.7); - pr_timeLED_vs_ampMaxCorr->SetMarkerStyle(20); - pr_timeLED_vs_ampMaxCorr->SetMarkerSize(0.7); - - //-----Saturated event computation---- - sprintf(var_fracSaturated, "time_CF[%d] >> %s", MCPNumber, h_fracSat_name); - sprintf(var_evtAll, "time_CF[%d] >> %s", MCPNumber, h_evtAll_name); - nt->Draw(var_fracSaturated, cut_trig0 && cut_sig && cut_scan && cut_saturated && cut_tdc && cut_nFibers); - nt->Draw(var_evtAll, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers); - if(TString(scanType).Contains("HV") == 1) - { - if(h_evtAll->GetEntries() != 0) - g_frac_saturated->SetPoint(i, HVVal.at(i), 100.*h_fracSat->GetEntries()/h_evtAll->GetEntries()); - else - g_frac_saturated->SetPoint(i, HVVal.at(i), 0); - } - else - { - if(h_evtAll->GetEntries() != 0) - g_frac_saturated->SetPoint(i, X0Step.at(i), 100.*h_fracSat->GetEntries()/h_evtAll->GetEntries()); - else - g_frac_saturated->SetPoint(i, X0Step.at(i), 0); - } - //-----Efficiency study----- - if(strcmp(doWhat, "eff") == 0 || strcmp(doWhat, "all") == 0) - { - sprintf(var_sig, "charge_corr[%d]>>%s", MCPNumber, h_sig_name); - sprintf(var_trig0, "charge_corr[%d]>>%s", trigPos1, h_trig0_name); - nt->Draw(var_sig, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers, "goff"); - nt->Draw(var_trig0, cut_trig0 && cut_scan && cut_tdc && cut_nFibers, "goff"); - float eff = h_sig->GetEntries()/h_trig0->GetEntries(); - float e_eff = TMath::Sqrt((TMath::Abs(eff*(1-eff)))/h_trig0->GetEntries()); - if(eff < 0) - eff = 0; - if(i == 0) - { - printf("---------Efficiency----------\n"); - printf(" %s\teff\te_%s\te_eff\n", var_name, var_name); - printf("-----------------------------\n"); - } - if(TString(scanType).Contains("HV") == 1) - { - printf("%d\t%.3f\t%.3f\t%.3f\n", HVVal.at(i), eff, 0., e_eff); - outputFile << HVVal.at(i)<<"\t"<SetPoint(i, HVVal.at(i), eff); - g_eff->SetPointError(i, 0, e_eff); - } - else - { - if (TString(label).Contains("scanX0_HVHigh50GeV")) { //correct efficiencies at 0X0 - if (TString(MCP).Contains("ZStack2") && X0Step.at(i)==0.) { - eff = 0.6635633; - e_eff = 0.009062424; - } - else if (TString(MCP).Contains("enSEE") && X0Step.at(i)==0.) { - eff = 0.6846591; - e_eff = 0.009360672; - } - else if (TString(MCP).Contains("ZStack1") && X0Step.at(i)==0.) { - eff = 0.6325325; - e_eff = 0.009567964; - } - else if (TString(MCP).Contains("MiB3") && X0Step.at(i)==0.) { - eff = 0.5150362; - e_eff = 0.009750873; - } - } - if (TString(label).Contains("AngScan_HVHigh")) { //correct efficiencies at 0 degrees for angular scan - if (TString(MCP).Contains("enSEE") ) { - eff -= 0.08; - // e_eff = 0.009360672; - } - else if (TString(MCP).Contains("ZStack1") ) { - eff -= 0.034; - // e_eff = 0.009567964; - } - else if (TString(MCP).Contains("MiB3") ) { - eff -= 0.08; - if (X0Step.at(i)==0.) eff-=0.012; - // e_eff = 0.009750873; - } - } - printf("%.3f\t%.3f\t%.3f\t%.3f\n", X0Step.at(i), eff, 0., e_eff); - outputFile << X0Step.at(i)<<"\t"<SetPoint(i, X0Step.at(i), eff); - g_eff->SetPointError(i, 0, e_eff); - } - if(i == (ScanList.size()-1)) - printf("-----------------------------\n"); - } - //-----Charge study----- - if(strcmp(doWhat, "Q") == 0)// || strcmp(doWhat, "all") == 0) - { - if(i == 0) - { - printf("---------Efficiency----------\n"); - printf(" %s\tQ\te_%s\te_Q\n", var_name, var_name); - printf("-----------------------------\n"); - } - // sprintf(var_charge, "%s>>%s", TOT_diff, h_charge_name); - sprintf(var_charge, "charge_corr[%d]>>%s", MCPNumber, h_charge_name); - nt->Draw(var_charge, cut_scan && cut_tdc && cut_nFibers, "goff"); - if(TString(scanType).Contains("HV") == 1) - { - printf("%d\t%.0f\t%.0f\t%.0f\n", HVVal.at(i), h_charge->GetMean(), 0., h_charge->GetMeanError()); - outputFile << HVVal.at(i)<<"\t"<GetMean()<<"\t 0.\t"<GetMeanError()<SetPoint(i, HVVal.at(i), h_charge->GetMean()); - g_Q->SetPoint(i, 0, h_charge->GetMeanError()); - } - else - { - printf("%.0f\t%.3f\t%.0f\t%.3f\n", X0Step.at(i), h_charge->GetMean(), 0., h_charge->GetMeanError()); - outputFile << X0Step.at(i)<<"\t"<GetMean()<<"\t 0.\t"<GetMeanError()<SetPoint(i, X0Step.at(i), h_charge->GetMean()); - g_Q->SetPoint(i, 0, h_charge->GetMeanError()); - } - if(i == (ScanList.size()-1)) - printf("-----------------------------\n"); - } - //-----TIME RESOLUTION STUDY----- - //---time resolution with CFD--- - if(strcmp(doWhat, "timeCFD") == 0 || strcmp(doWhat, "all") == 0) - { - //---print banner - if(i == 0) - { - printf("----------Time Resolution(ps)----------\n"); - printf(" #\t%s\tt_res\te_%s\te_t_res\tX_prob\n", var_name, var_name); - printf("---------------------------------------\n"); - } - //---change TOT for X0 runs - if(strcmp(scanType, "X0") == 0 && X0Step.at(i) != 0 && MCPNumber < 3) - sprintf(TOT_diff, "(time_stop_500[%d]-time_start_500[%d])", MCPNumber, MCPNumber); - //---create variables - char t_CF_diff[100]; - if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) - sprintf(t_CF_diff, "(time_CF_corr[%d]-(time_CF_corr[%d]-time_CF_corr[%d])-time_CF_corr[%d])", MCPNumber, clockPos2, clockPos1, trigPos1); - else - sprintf(t_CF_diff, "(time_CF_corr[%d]-time_CF_corr[%d])", MCPNumber, trigPos1); - sprintf(var_timeCFD_vs_TOT, "%s:%s>>%s", t_CF_diff, TOT_diff, pr_timeCFD_vs_TOT_name); - //---correction - nt->Draw(var_timeCFD_vs_TOT, cut_trig0 && cut_sig && cut_scan && cut_nFibers - && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD, "goff"); - //---skip run with low stat - if(pr_timeCFD_vs_TOT->GetEntries() < 200) - h_resCFD->Rebin(2); - if(pr_timeCFD_vs_TOT->GetEntries() < 50) - continue; - pr_timeCFD_vs_TOT->Fit(f_corrCFD, "QR"); - - //---draw res histo with corrections - sprintf(var_timeCFD, "%s-(%f + %f*%s + %f*%s*%s)>>%s", - t_CF_diff, f_corrCFD->GetParameter(0), f_corrCFD->GetParameter(1), TOT_diff, - f_corrCFD->GetParameter(2), TOT_diff, TOT_diff, h_resCFD_name); - //f_corrCFD->GetParameter(3), TOT_diff, TOT_diff, TOT_diff, h_resCFD_name); - nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers - && cut_trig_not_sat && cut_bad_timeCFD, "goff"); - - //correction vs ampMax - sprintf(var_timeCFD_red, "(%s-(%f + %f*%s + %f*%s*%s))", - t_CF_diff, f_corrCFD->GetParameter(0), f_corrCFD->GetParameter(1), TOT_diff, - f_corrCFD->GetParameter(2), TOT_diff, TOT_diff); - sprintf(var_timeCFD_vs_ampMax, "%s:amp_max_corr[%d]>>%s", var_timeCFD_red, MCPNumber, pr_timeCFD_vs_ampMaxCorr_name); - nt->Draw(var_timeCFD_vs_ampMax, cut_trig0 && cut_sig && cut_scan && cut_nFibers - && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD, "goff"); - // pr_timeCFD_vs_ampMaxCorr->Fit(f_corrCFD2, "QR"); - - //---draw res histo with corrections - /* sprintf(var_timeCFD, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d])>>%s", - var_timeCFD_red, f_corrCFD2->GetParameter(0), f_corrCFD2->GetParameter(1), MCPNumber, - f_corrCFD2->GetParameter(2), MCPNumber, MCPNumber, - f_corrCFD2->GetParameter(3), MCPNumber, MCPNumber, MCPNumber, - f_corrCFD2->GetParameter(4), MCPNumber, MCPNumber, MCPNumber, MCPNumber, h_resCFD_name); - nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers - && cut_trig_not_sat && cut_bad_timeCFD, "goff"); - */ - //---fit coincidence peak - f_resCFD->SetParameters(h_resCFD->GetEntries(), h_resCFD->GetMean(), h_resCFD->GetRMS()); - f_resCFD->SetParLimits(1, -0.05, 0.05); - f_resCFD->SetParLimits(2, 0.01, 0.5); - h_resCFD->Fit(f_resCFD, "QRB"); - h_resCFD->Fit(f_resCFD, "QRBIM", "", f_resCFD->GetParameter(1)-2*f_resCFD->GetParameter(2), - f_resCFD->GetParameter(1)+2*f_resCFD->GetParameter(2)); - //---get resolution - float e_t_res = f_resCFD->GetParError(2)*1000.; - float t_res = f_resCFD->GetParameter(2)*1000.; - float prob = f_resCFD->GetProb(); - //---print results + graph - if(TString(scanType).Contains("HV") == 1) - { - printf("%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i), t_res, 0., e_t_res, prob); - outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), HVVal.at(i), t_res); - g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); - } - else - { - printf("%d\t%.3f\t%.1f\t%.1f\t%.1f\t%.3f\n", i, X0Step.at(i), t_res, 0., e_t_res, prob); - outputFile << X0Step.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), X0Step.at(i), t_res); - g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); - } - if(i == (ScanList.size()-1)) - printf("---------------------------------------\n"); - //---write plots in the out file - outROOT_CFD->cd(); - pr_timeCFD_vs_TOT->Write(); - pr_timeCFD_vs_ampMaxCorr->Write(); - gStyle->SetOptStat(0000); - gStyle->SetOptFit(1111); - h_resCFD->Write(); - pr_timeCFD_vs_TOT->Delete(); - pr_timeCFD_vs_ampMaxCorr->Delete(); - h_resCFD->Delete(); - } - //---Time resolution with LED and TOT correction--- - if(strcmp(doWhat, "timeLED") == 0 || strcmp(doWhat, "all") == 0) - { - //---print banner - if(i == 0) - { - printf("----------Time Resolution(ps)----------\n"); - printf(" #\t%s\tt_res\te_%s\te_t_res\tX_prob\n", var_name, var_name); - printf("---------------------------------------\n"); - } - //---create variables - char t_start_diff[100]; - if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) - sprintf(t_start_diff, "(time_start_150[%d]-(time_start_150[%d]-time_start_150[%d])-time_CF_corr[%d])", MCPNumber, clockPos2, clockPos1, trigPos1); - else - sprintf(t_start_diff, "(time_start_150[%d]-time_CF_corr[%d])", MCPNumber, trigPos1); - //---change TOT for X0 runs - if(strcmp(scanType, "X0") == 0 && X0Step.at(i) != 0 && MCPNumber < 3) - { - sprintf(TOT_diff, "(time_stop_500[%d]-time_start_500[%d])", MCPNumber, MCPNumber); - if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) - sprintf(t_start_diff, "(time_start_500[%d]-(time_start_500[%d]-time_start_500[%d])-time_CF_corr[%d])", MCPNumber,clockPos2,clockPos1,trigPos1); - else - sprintf(t_start_diff, "(time_start_500[%d]-time_CF_corr[%d])", MCPNumber,trigPos1); - } - sprintf(var_timeLED_vs_TOT, "%s:%s>>%s", t_start_diff, TOT_diff, pr_timeLED_vs_TOT_name); - //---correction - nt->Draw(var_timeLED_vs_TOT, cut_trig0 && cut_sig && cut_scan && cut_nFibers - && cut_tdc && cut_trig_not_sat && cut_bad_timeLED, "goff"); - //---skip run with low stat - if(pr_timeLED_vs_TOT->GetEntries() < 200) - h_resLED->Rebin(2); - if(pr_timeLED_vs_TOT->GetEntries() < 50) - continue; - pr_timeLED_vs_TOT->Fit(f_corrLED, "QR"); - - //---draw res histo with corrections - sprintf(var_timeLED, "%s-(%f + %f*%s + %f*%s*%s)>>%s", - t_start_diff, f_corrLED->GetParameter(0), f_corrLED->GetParameter(1), TOT_diff, - f_corrLED->GetParameter(2), TOT_diff, TOT_diff, h_resLED_name); - nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers - && cut_trig_not_sat && cut_bad_timeLED, "goff"); - - sprintf(var_timeLED_red, "(%s-(%f + %f*%s + %f*%s*%s))", - t_start_diff, f_corrLED->GetParameter(0), f_corrLED->GetParameter(1), TOT_diff, - f_corrLED->GetParameter(2), TOT_diff, TOT_diff); - sprintf(var_timeLED_vs_ampMax, "%s:amp_max_corr[%d]>>%s", var_timeLED_red, MCPNumber, pr_timeLED_vs_ampMaxCorr_name); - nt->Draw(var_timeLED_vs_ampMax, cut_trig0 && cut_sig && cut_scan && cut_nFibers - && cut_tdc && cut_trig_not_sat && cut_bad_timeLED, "goff"); - // pr_timeLED_vs_ampMaxCorr->Fit(f_corrLED2, "QR"); - - //---draw res histo with corrections - /* sprintf(var_timeLED, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d])>>%s", - var_timeLED_red, f_corrLED2->GetParameter(0), f_corrLED2->GetParameter(1), MCPNumber, - f_corrLED2->GetParameter(2), MCPNumber, MCPNumber, - f_corrLED2->GetParameter(3), MCPNumber, MCPNumber, MCPNumber, - f_corrLED2->GetParameter(4), MCPNumber, MCPNumber, MCPNumber, MCPNumber, h_resLED_name); - nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers - && cut_trig_not_sat && cut_bad_timeLED, "goff"); - */ - //---fit coincidence peak - f_resLED->SetParameters(h_resLED->GetEntries(), h_resLED->GetMean(), h_resLED->GetRMS()); - f_resLED->SetParLimits(1, -0.05, 0.05); - f_resLED->SetParLimits(2, 0.02, 0.5); - h_resLED->Fit(f_resLED, "QRB"); - f_resLED->SetParLimits(2, 0.01, 0.4); - h_resLED->Fit(f_resLED, "QRBIM", "", f_resLED->GetParameter(1)-2*f_resLED->GetParameter(2), - f_resLED->GetParameter(1)+2*f_resLED->GetParameter(2)); - //---get resolution - float e_t_res = f_resLED->GetParError(2)*1000.; - float t_res = f_resLED->GetParameter(2)*1000.; - float prob = f_resLED->GetProb(); - //---print results + graph - if(TString(scanType).Contains("HV") == 1) - { - printf("%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i), t_res, 0., e_t_res, prob); - outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resLED->GetN(), HVVal.at(i), t_res); - g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); - } - else - { - printf("%d\t%.3f\t%.1f\t%.1f\t%.1f\t%.3f\n", i, X0Step.at(i), t_res, 0., e_t_res, prob); - outputFile << X0Step.at(i)<<"\t"<SetPoint(g_resLED->GetN(), X0Step.at(i), t_res); - g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); - } - if(i == (ScanList.size()-1)) - printf("---------------------------------------\n"); - //---write plots in the out file - outROOT_LED->cd(); - pr_timeLED_vs_TOT->Write(); - pr_timeLED_vs_ampMaxCorr->Write(); - gStyle->SetOptStat(0000); - gStyle->SetOptFit(1111); - h_resLED->Write(); - pr_timeLED_vs_TOT->Delete(); - pr_timeLED_vs_ampMaxCorr->Delete(); - h_resLED->Delete(); - } - } - - //---Save global scan graph--- - //---efficiency - if(outROOT_eff) - { - outROOT_eff->cd(); - g_eff->Write(); - g_frac_saturated->Write(); - outROOT_eff->Close(); - } - //---charge - if(outROOT_Q) - { - outROOT_Q->cd(); - g_Q->Write(); - g_frac_saturated->Write(); - outROOT_Q->Close(); - } - //---time resolution CFD - if(outROOT_CFD) - { - outROOT_CFD->cd(); - g_resCFD->Write(); - g_frac_saturated->Write(); - outROOT_CFD->Close(); - } - //---time resolution LED - if(outROOT_LED) - { - outROOT_LED->cd(); - g_resLED->Write(); - g_frac_saturated->Write(); - outROOT_LED->Close(); - } - - // - std::cout<<"results printed in results/"<Write(); - h_YDiff_Hodo1TDC->Write(); - h_XDiff_Hodo2TDC->Write(); - h_YDiff_Hodo2TDC->Write(); - h_XDiff_Hodo12->Write(); - h_YDiff_Hodo12->Write(); - h_XDiff_Hodo1TDC_c->Write(); - h_YDiff_Hodo1TDC_c->Write(); - h_XDiff_Hodo2TDC_c->Write(); - h_YDiff_Hodo2TDC_c->Write(); - h_XDiff_Hodo12_c->Write(); - h_YDiff_Hodo12_c->Write(); - h_nX1->Write(); - h_nY1->Write(); - h_nX2->Write(); - h_nY2->Write(); - h_pX1->Write(); - h_pY1->Write(); - h_TDCX->Write(); - h_TDCY->Write(); - h_Corr_TDC_HODO1_X->Write(); - h_Corr_TDC_HODO1_Y->Write(); - //Eff Hodos - h_N_Trig1_hodo2_vsX->Write(); h_N_Trig1_vsX->Write(); - h_N_Trig1_hodo2_vsY->Write(); h_N_Trig1_vsY->Write(); - h_N_Trig2_hodo1_vsX->Write(); h_N_Trig2_vsX->Write(); - h_N_Trig2_hodo1_vsY->Write(); h_N_Trig2_vsY->Write(); - h_N_Trig1_TDC_vsX->Write(); h_N_Trig1Tdc_vsX->Write(); - h_N_Trig1_TDC_vsY->Write(); h_N_Trig1Tdc_vsY->Write(); - TG_effHODO2_X->GetXaxis()->SetTitle("HODO2 X [mm]"); TG_effHODO2_X->GetYaxis()->SetTitle("Eff."); TG_effHODO2_X->SetMinimum(0); TG_effHODO2_X->SetMaximum(1); - TG_effHODO2_Y->GetXaxis()->SetTitle("HODO2 Y [mm]"); TG_effHODO2_Y->GetYaxis()->SetTitle("Eff."); TG_effHODO2_Y->SetMinimum(0); TG_effHODO2_Y->SetMaximum(1); - TG_effHODO1_X->GetXaxis()->SetTitle("HODO1 X [mm]"); TG_effHODO1_X->GetYaxis()->SetTitle("Eff."); TG_effHODO1_X->SetMinimum(0); TG_effHODO1_X->SetMaximum(1); - TG_effHODO1_Y->GetXaxis()->SetTitle("HODO1 Y [mm]"); TG_effHODO1_Y->GetYaxis()->SetTitle("Eff."); TG_effHODO1_Y->SetMinimum(0); TG_effHODO1_Y->SetMaximum(1); - TG_effTDC_X->GetXaxis()->SetTitle("TDC X [mm]"); TG_effTDC_X->GetYaxis()->SetTitle("Eff."); TG_effTDC_X->SetMinimum(0); TG_effTDC_X->SetMaximum(1); - TG_effTDC_Y->GetXaxis()->SetTitle("TDC Y [mm]"); TG_effTDC_Y->GetYaxis()->SetTitle("Eff."); TG_effTDC_Y->SetMinimum(0); TG_effTDC_Y->SetMaximum(1); - TG_effHODO2_X->Write(); - TG_effHODO2_Y->Write(); - TG_effHODO1_X->Write(); - TG_effHODO1_Y->Write(); - TG_effTDC_X->Write(); - TG_effTDC_Y->Write(); - //Eff MCP vs hodo2 - h_TriggM2->Write(); - h_TriggM3->Write(); - h_TriggZ1->Write(); - h_TriggZ2->Write(); - h_TriggSe->Write(); - h_NumEff_M2->Write(); - h_NumEff_M3->Write(); - h_NumEff_Z1->Write(); - h_NumEff_Z2->Write(); - h_NumEff_Se->Write(); - for(int i=0; i<32; i++){ - for(int j=0; j<32; j++){ -//cout<<"ECCO: "<GetBinContent(i+1, j+1) <<" / "<< h_TriggM2->GetBinContent(i+1, j+1)<GetBinContent(i+1, j+1) > 10 ) h_Eff_vsH2_M2->SetBinContent( i+1, j+1, h_NumEff_M2->GetBinContent(i+1, j+1) / h_TriggM2->GetBinContent(i+1, j+1) ); - if( h_TriggM3->GetBinContent(i+1, j+1) > 10 ) h_Eff_vsH2_M3->SetBinContent( i+1, j+1, h_NumEff_M3->GetBinContent(i+1, j+1) / h_TriggM3->GetBinContent(i+1, j+1) ); - if( h_TriggZ1->GetBinContent(i+1, j+1) > 10 ) h_Eff_vsH2_Z1->SetBinContent( i+1, j+1, h_NumEff_Z1->GetBinContent(i+1, j+1) / h_TriggZ1->GetBinContent(i+1, j+1) ); - if( h_TriggZ2->GetBinContent(i+1, j+1) > 10 ) h_Eff_vsH2_Z2->SetBinContent( i+1, j+1, h_NumEff_Z2->GetBinContent(i+1, j+1) / h_TriggZ2->GetBinContent(i+1, j+1) ); - if( h_TriggSe->GetBinContent(i+1, j+1) > 10 ) h_Eff_vsH2_Se->SetBinContent( i+1, j+1, h_NumEff_Se->GetBinContent(i+1, j+1) / h_TriggSe->GetBinContent(i+1, j+1) ); - } - } - h_Eff_vsH2_M2->Write(); - h_Eff_vsH2_M3->Write(); - h_Eff_vsH2_Z1->Write(); - h_Eff_vsH2_Z2->Write(); - h_Eff_vsH2_Se->Write(); - } - - - inFile->Close(); - - return 0; -} - diff --git a/TB/bin/drawEfficiency.cpp b/TB/bin/drawEfficiency.cpp deleted file mode 100644 index 925db51..0000000 --- a/TB/bin/drawEfficiency.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/***************************************************************************************** - This program draws efficiency plots - -****************************************************************************************/ -#include -#include -#include -#include - -#include "TROOT.h" -#include "TSystem.h" -#include "TKey.h" -#include "TFile.h" -#include "TTree.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TF1.h" -#include "TString.h" -#include "TCut.h" -#include "TMath.h" -#include "TApplication.h" -#include "TError.h" -#include "TCanvas.h" -#include "TGraphErrors.h" -#include "TPad.h" -#include "TStyle.h" -#include "TMultiGraph.h" -#include "TLegend.h" -#include "TPaveLabel.h" -#include "TPaveText.h" - -using namespace std; - -void banner4Plot (){ - TPaveText* pt ; - pt = new TPaveText(.14,0.91,.25,.94,"NDC"); - pt->AddText("Preliminary"); - pt->SetFillColor(0); - pt->SetTextSize(0.035); - pt->SetFillStyle(0); - pt->SetLineColor(0); - pt->SetLineWidth(0); - pt->SetMargin(0); - pt->SetShadowColor(0); - pt->Draw(); -} - -int main(int argc, char** argv) -{ - - std::string plot_type = argv[1]; - //"HVScan"; - // std::string plot_type = "AngScanHigh"; - // std::string plot_type = "scanX0_HVLow_50"; - // std::string plot_type = "scanX0_HVLow_20"; - std::cout<Get("eff"); - TGraphErrors* eff_MiB3_OFF = (TGraphErrors*)inF_MiB3_OFF->Get("eff"); - TGraphErrors* eff_enSEE = (TGraphErrors*)inF_enSEE->Get("eff"); - TGraphErrors* eff_ZStack1_ON = (TGraphErrors*)inF_ZStack1_ON->Get("eff"); - TGraphErrors* eff_ZStack1_OFF = (TGraphErrors*)inF_ZStack1_OFF->Get("eff"); - TGraphErrors* eff_ZStack2_ON = (TGraphErrors*)inF_ZStack2_ON->Get("eff"); - TGraphErrors* eff_ZStack2_OFF = (TGraphErrors*)inF_ZStack2_OFF->Get("eff"); - - //settings - eff_MiB3_ON->SetMarkerColor(kGreen+1); - eff_MiB3_ON->SetLineColor(kGreen+1); - eff_MiB3_OFF->SetMarkerColor(kGreen+1); - eff_MiB3_OFF->SetLineColor(kGreen+1); - eff_ZStack2_ON->SetMarkerColor(kBlue); - eff_ZStack2_ON->SetLineColor(kBlue); - eff_ZStack1_ON->SetMarkerColor(kRed); - eff_ZStack1_ON->SetLineColor(kRed); - eff_ZStack2_OFF->SetMarkerColor(kBlue); - eff_ZStack2_OFF->SetLineColor(kBlue); - eff_ZStack1_OFF->SetMarkerColor(kRed); - eff_ZStack1_OFF->SetLineColor(kRed); - eff_enSEE->SetMarkerColor(1); - eff_enSEE->SetLineColor(1); - // - eff_MiB3_ON->SetMarkerStyle(20); - eff_MiB3_ON->SetLineWidth(2); - eff_MiB3_ON->SetMarkerSize(0.9); - eff_MiB3_OFF->SetMarkerStyle(22); - eff_MiB3_OFF->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerStyle(20); - eff_ZStack2_ON->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerSize(0.9); - eff_ZStack1_ON->SetMarkerStyle(20); - eff_ZStack1_ON->SetLineWidth(2); - eff_ZStack1_ON->SetMarkerSize(0.9); - eff_ZStack2_OFF->SetMarkerStyle(22); - eff_ZStack2_OFF->SetLineWidth(2); - eff_ZStack1_OFF->SetMarkerStyle(22); - eff_ZStack1_OFF->SetLineWidth(2); - eff_enSEE->SetMarkerStyle(22); - eff_enSEE->SetLineWidth(2); - - - legC->SetTextFont(42); - legC->SetTextSize(0.034); - legC->SetFillColor(kWhite); - legC->SetLineColor(kWhite); - legC->SetShadowColor(kWhite); - - legC->AddEntry(eff_MiB3_ON, "Double layer - PMT-MCP mode", "p"); - legC->AddEntry(eff_MiB3_OFF, "Double layer - iMCP mode", "p"); - legC->AddEntry(eff_ZStack2_ON, "ZStack2 - PMT-MCP mode", "p"); - legC->AddEntry(eff_ZStack2_OFF, "ZStack2 - iMCP mode", "p"); - legC->AddEntry(eff_ZStack1_ON, "ZStack1 PMT-MCP mode", "p"); - legC->AddEntry(eff_ZStack1_OFF, "ZStack1 - iMCP mode", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode", "p"); - - mg->Add(eff_MiB3_ON); - mg->Add(eff_MiB3_OFF); - mg->Add(eff_ZStack1_ON); - mg->Add(eff_ZStack1_OFF); - mg->Add(eff_ZStack2_OFF); - mg->Add(eff_ZStack2_ON); - mg->Add(eff_ZStack2_OFF); - mg->Add(eff_enSEE); - - // TCanvas* c = new TCanvas("cEff","cEff",400,800); - TCanvas* c = new TCanvas(); - gPad->SetTicks(); - char plot_name[100]; - std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; - system(command.c_str()); - sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); - - mg->Draw("APL"); - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(1200,3400); - mg->GetXaxis()->SetTitle("Bias Voltage (V)"); - mg->GetXaxis()->SetTitleSize(0.05); - mg->GetYaxis()->SetTitle("Efficiency"); - mg->GetYaxis()->SetTitleSize(0.05); - mg->SetMaximum(1); - mg->SetMinimum(0); - mg->Draw("APL"); - legC->Draw("same"); - banner4Plot(); - c->Update(); - - c->Print(plot_name, "pdf"); - sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); - c->Print(plot_name, "png"); - - sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); - c->SaveAs(plot_name, "root"); - sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); - c->SaveAs(plot_name, "C"); - } - - else { - - legC = new TLegend(0.4,0.15,0.65,0.42,NULL,"brNDC"); - - TGraphErrors* eff_MiB3; - TGraphErrors* eff_enSEE; - TGraphErrors* eff_ZStack1; - TGraphErrors* eff_ZStack2; - - if(plot_type == "AngScanHigh"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_AngScan_HVHigh.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_AngScan_HVHigh.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_AngScan_HVHigh.root"); - } - if(plot_type == "AngScanLow"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_AngScan_HVLow.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_AngScan_HVLow.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_AngScan_HVLow.root"); - } - - if(plot_type == "scanX0_HVHigh_50"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_scanX0_HVHigh50GeV.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_scanX0_HVHigh50GeV.root"); - inF_ZStack2 = TFile::Open("plots/efficiency_studies/ZStack2_X0_scanX0_HVHigh50GeV.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_scanX0_HVHigh50GeV.root"); - } - if(plot_type == "scanX0_HVHigh_20"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_scanX0_HVHigh20GeV.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_scanX0_HVHigh20GeV.root"); - inF_ZStack2 = TFile::Open("plots/efficiency_studies/ZStack2_X0_scanX0_HVHigh20GeV.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_scanX0_HVHigh20GeV.root"); - } - if(plot_type == "scanX0_HVLow_50"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_scanX0_HVLow50GeV.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_scanX0_HVLow50GeV.root"); - inF_ZStack2 = TFile::Open("plots/efficiency_studies/ZStack2_X0_scanX0_HVLow50GeV.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_scanX0_HVLow50GeV.root"); - } - if(plot_type == "scanX0_HVLow_20"){ - inF_MiB3 = TFile::Open("plots/efficiency_studies/MiB3_X0_scanX0_HVLow20GeV.root"); - inF_enSEE = TFile::Open("plots/efficiency_studies/enSEE_X0_scanX0_HVLow20GeV.root"); - inF_ZStack2 = TFile::Open("plots/efficiency_studies/ZStack2_X0_scanX0_HVLow20GeV.root"); - inF_ZStack1 = TFile::Open("plots/efficiency_studies/ZStack1_X0_scanX0_HVLow20GeV.root"); - } - - - eff_MiB3 = (TGraphErrors*)inF_MiB3->Get("eff"); - eff_enSEE = (TGraphErrors*)inF_enSEE->Get("eff"); - eff_ZStack1 = (TGraphErrors*)inF_ZStack1->Get("eff"); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - eff_ZStack2 = (TGraphErrors*)inF_ZStack2->Get("eff"); - - //settings - eff_MiB3->SetMarkerColor(kGreen+1); - eff_MiB3->SetLineColor(kGreen+1); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") { - eff_ZStack2->SetMarkerColor(kBlue); - eff_ZStack2->SetLineColor(kBlue); - } - eff_ZStack1->SetMarkerColor(kRed); - eff_ZStack1->SetLineColor(kRed); - eff_enSEE->SetMarkerColor(1); - eff_enSEE->SetLineColor(1); - // - eff_MiB3->SetMarkerStyle(20); - eff_MiB3->SetLineWidth(2); - eff_MiB3->SetMarkerSize(0.9); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") { - eff_ZStack2->SetMarkerStyle(20); - eff_ZStack2->SetLineWidth(2); - eff_ZStack2->SetMarkerSize(0.9); - } - eff_ZStack1->SetMarkerStyle(20); - eff_ZStack1->SetLineWidth(2); - eff_ZStack1->SetMarkerSize(0.9); - eff_enSEE->SetMarkerStyle(20); - eff_enSEE->SetLineWidth(2); - eff_enSEE->SetMarkerSize(0.9); - - legC->SetTextFont(42); - legC->SetTextSize(0.037); - legC->SetFillColor(kWhite); - legC->SetLineColor(kWhite); - legC->SetShadowColor(kWhite); - - if(plot_type == "AngScanLow"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 1900 V", "p"); - } - if(plot_type == "AngScanHigh"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 2200 V", "p"); - } - - if(plot_type == "scanX0_HVHigh_50" || plot_type == "scanX0_HVHigh_20"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_ZStack2, "ZStack2 - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 2200 V", "p"); - } - - if(plot_type == "scanX0_HVLow_50" || plot_type == "scanX0_HVLow_20"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_ZStack2, "ZStack2 - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 1900 V", "p"); - } - - mg->Add(eff_MiB3); - mg->Add(eff_ZStack1); - mg->Add(eff_enSEE); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - mg->Add(eff_ZStack2); - - TCanvas* c = new TCanvas(); - gPad->SetTicks(); - char plot_name[100]; - std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; - system(command.c_str()); - sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); - - mg->Draw("APL"); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - { - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20") { - mg->SetTitle("Electron Beam 20 GeV"); - mg->GetXaxis()->SetRangeUser(-0.1,5.1); - } - else { - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(-0.1,5.1); - } - mg->GetXaxis()->SetTitle("Number of X_{0}"); - mg->GetXaxis()->SetTitleSize(0.046); - mg->GetYaxis()->SetTitle("Efficiency"); - mg->GetYaxis()->SetTitleSize(0.046); - // mg->SetTitle(plot_type.c_str()); - mg->SetMaximum(1); - mg->SetMinimum(0); - } - else - { - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(-1., 46.); - mg->GetXaxis()->SetTitle("Angle (degrees)"); - mg->GetXaxis()->SetTitleSize(0.045); - mg->GetYaxis()->SetTitle("Efficiency"); - mg->GetYaxis()->SetTitleSize(0.045); - mg->GetYaxis()->SetTitleOffset(1.12); //damned root - // mg->SetTitle(plot_type.c_str()); - mg->SetMaximum(0.8); - mg->SetMinimum(0.4); - c->SetCanvasSize(500,400); - } - - mg->Draw("APL"); - legC->Draw("same"); - banner4Plot(); - c->Update(); - - c->Print(plot_name, "pdf"); - sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); - c->Print(plot_name, "png"); - - sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); - c->Print(plot_name, "root"); - sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); - c->SaveAs(plot_name, "C"); - } - - - return 0; -} - diff --git a/TB/bin/drawResolutionCFD.cpp b/TB/bin/drawResolutionCFD.cpp deleted file mode 100644 index 98c5c75..0000000 --- a/TB/bin/drawResolutionCFD.cpp +++ /dev/null @@ -1,458 +0,0 @@ -/***************************************************************************************** - This program draws time resolution plots - -****************************************************************************************/ -#include -#include -#include -#include - -#include "TROOT.h" -#include "TSystem.h" -#include "TKey.h" -#include "TFile.h" -#include "TTree.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TF1.h" -#include "TString.h" -#include "TCut.h" -#include "TMath.h" -#include "TApplication.h" -#include "TError.h" -#include "TCanvas.h" -#include "TGraphErrors.h" -#include "TPad.h" -#include "TStyle.h" -#include "TMultiGraph.h" -#include "TLegend.h" -#include "TPaveLabel.h" -#include "TPaveText.h" - -using namespace std; - -void banner4Plot (){ - TPaveText* pt ; - pt = new TPaveText(.14,0.91,.25,.94,"NDC"); - pt->AddText("Preliminary"); - pt->SetFillColor(0); - pt->SetTextSize(0.035); - pt->SetFillStyle(0); - pt->SetLineColor(0); - pt->SetLineWidth(0); - pt->SetMargin(0); - pt->SetShadowColor(0); - pt->Draw(); -} - -int main(int argc, char** argv) -{ - - std::string plot_type = argv[1]; - - std::cout<Get("resCFD"); - TGraphErrors* eff_MiB3_OFF = (TGraphErrors*)inF_MiB3_OFF->Get("resCFD"); - TGraphErrors* eff_enSEE = (TGraphErrors*)inF_enSEE->Get("resCFD"); - TGraphErrors* eff_ZStack1_ON = (TGraphErrors*)inF_ZStack1_ON->Get("resCFD"); - TGraphErrors* eff_ZStack1_OFF = (TGraphErrors*)inF_ZStack1_OFF->Get("resCFD"); - TGraphErrors* eff_ZStack2_ON = (TGraphErrors*)inF_ZStack2_ON->Get("resCFD"); - TGraphErrors* eff_ZStack2_OFF = (TGraphErrors*)inF_ZStack2_OFF->Get("resCFD"); - - //settings - eff_MiB3_ON->SetMarkerColor(kGreen+1); - eff_MiB3_ON->SetLineColor(kGreen+1); - eff_MiB3_OFF->SetMarkerColor(kGreen+1); - eff_MiB3_OFF->SetLineColor(kGreen+1); - eff_ZStack2_ON->SetMarkerColor(kBlue); - eff_ZStack2_ON->SetLineColor(kBlue); - eff_ZStack1_ON->SetMarkerColor(kRed); - eff_ZStack1_ON->SetLineColor(kRed); - eff_ZStack2_OFF->SetMarkerColor(kBlue); - eff_ZStack2_OFF->SetLineColor(kBlue); - eff_ZStack1_OFF->SetMarkerColor(kRed); - eff_ZStack1_OFF->SetLineColor(kRed); - eff_enSEE->SetMarkerColor(1); - eff_enSEE->SetLineColor(1); - // - eff_MiB3_ON->SetMarkerStyle(20); - eff_MiB3_ON->SetLineWidth(2); - eff_MiB3_ON->SetMarkerSize(0.7); - eff_MiB3_OFF->SetMarkerStyle(22); - eff_MiB3_OFF->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerStyle(20); - eff_ZStack2_ON->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerSize(0.7); - eff_ZStack1_ON->SetMarkerStyle(20); - eff_ZStack1_ON->SetLineWidth(2); - eff_ZStack1_ON->SetMarkerSize(0.7); - eff_ZStack2_OFF->SetMarkerStyle(22); - eff_ZStack2_OFF->SetLineWidth(2); - eff_ZStack1_OFF->SetMarkerStyle(22); - eff_ZStack1_OFF->SetLineWidth(2); - eff_enSEE->SetMarkerStyle(22); - eff_enSEE->SetLineWidth(2); - - - legC->SetTextFont(42); - legC->SetTextSize(0.048); - legC->SetFillColor(kWhite); - legC->SetLineColor(kWhite); - legC->SetShadowColor(kWhite); - - legC->AddEntry(eff_MiB3_ON, "Double layer - PMT-MCP mode", "p"); - //legC->AddEntry(eff_MiB3_OFF, "MiB3 chevron-OFF", "p"); - legC->AddEntry(eff_ZStack2_ON, "ZStack2 - PMT-MCP mode", "p"); - //legC->AddEntry(eff_ZStack2_OFF, "ZStack2 OFF", "p"); - legC->AddEntry(eff_ZStack1_ON, "ZStack1 - PMT-MCP mode", "p"); - //legC->AddEntry(eff_ZStack1_OFF, "ZStack1 OFF", "p"); - //legC->AddEntry(eff_enSEE, "SEE OFF", "p"); - - mg->Add(eff_MiB3_ON); - // mg->Add(eff_MiB3_OFF); - mg->Add(eff_ZStack1_ON); - //mg->Add(eff_ZStack1_OFF); - //mg->Add(eff_ZStack2_OFF); - mg->Add(eff_ZStack2_ON); - //mg->Add(eff_ZStack2_OFF); - //mg->Add(eff_enSEE); - - TCanvas* c = new TCanvas(); - gPad->SetTicks(); - char plot_name[100]; - std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; - system(command.c_str()); - sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); - - mg->Draw("AP"); - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(1400,3400); - mg->GetXaxis()->SetTitle("Bias voltage (V)"); - mg->GetXaxis()->SetTitleSize(0.048); - mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); - mg->GetYaxis()->SetTitleSize(0.048); - mg->SetMaximum(100); - mg->SetMinimum(0); - mg->Draw("AP"); - legC->Draw("same"); - banner4Plot(); - c->Update(); - - c->Print(plot_name, "pdf"); - sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); - c->Print(plot_name, "png"); - - sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); - c->SaveAs(plot_name, "root"); - sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); - c->SaveAs(plot_name, "C"); - } - - if(plot_type == "HVScanOFF"){ - legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); - - inF_MiB3_ON = TFile::Open("plots/resCFD_studies/MiB3_HV_HVScan2.root"); - inF_MiB3_OFF = TFile::Open("plots/resCFD_studies/MiB3_HV_HVScan7.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_HV_HVScan5.root"); - inF_ZStack1_ON = TFile::Open("plots/resCFD_studies/ZStack1_HV_HVScan1.root"); - inF_ZStack1_OFF = TFile::Open("plots/resCFD_studies/ZStack1_HV_HVScan8.root"); - inF_ZStack2_ON = TFile::Open("plots/resCFD_studies/ZStack2_HV_HVScan2.root"); - inF_ZStack2_OFF = TFile::Open("plots/resCFD_studies/ZStack2_HV_HVScan6.root"); - - TGraphErrors* eff_MiB3_ON = (TGraphErrors*)inF_MiB3_ON->Get("resCFD"); - TGraphErrors* eff_MiB3_OFF = (TGraphErrors*)inF_MiB3_OFF->Get("resCFD"); - TGraphErrors* eff_enSEE = (TGraphErrors*)inF_enSEE->Get("resCFD"); - TGraphErrors* eff_ZStack1_ON = (TGraphErrors*)inF_ZStack1_ON->Get("resCFD"); - TGraphErrors* eff_ZStack1_OFF = (TGraphErrors*)inF_ZStack1_OFF->Get("resCFD"); - TGraphErrors* eff_ZStack2_ON = (TGraphErrors*)inF_ZStack2_ON->Get("resCFD"); - TGraphErrors* eff_ZStack2_OFF = (TGraphErrors*)inF_ZStack2_OFF->Get("resCFD"); - - //settings - eff_MiB3_ON->SetMarkerColor(kGreen+1); - eff_MiB3_ON->SetLineColor(kGreen+1); - eff_MiB3_OFF->SetMarkerColor(kGreen+1); - eff_MiB3_OFF->SetLineColor(kGreen+1); - eff_ZStack2_ON->SetMarkerColor(kBlue); - eff_ZStack2_ON->SetLineColor(kBlue); - eff_ZStack1_ON->SetMarkerColor(kRed); - eff_ZStack1_ON->SetLineColor(kRed); - eff_ZStack2_OFF->SetMarkerColor(kBlue); - eff_ZStack2_OFF->SetLineColor(kBlue); - eff_ZStack1_OFF->SetMarkerColor(kRed); - eff_ZStack1_OFF->SetLineColor(kRed); - eff_enSEE->SetMarkerColor(1); - eff_enSEE->SetLineColor(1); - // - eff_MiB3_ON->SetMarkerStyle(20); - eff_MiB3_ON->SetLineWidth(2); - eff_MiB3_ON->SetMarkerSize(0.7); - eff_MiB3_OFF->SetMarkerStyle(22); - eff_MiB3_OFF->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerStyle(20); - eff_ZStack2_ON->SetLineWidth(2); - eff_ZStack2_ON->SetMarkerSize(0.7); - eff_ZStack1_ON->SetMarkerStyle(20); - eff_ZStack1_ON->SetLineWidth(2); - eff_ZStack1_ON->SetMarkerSize(0.7); - eff_ZStack2_OFF->SetMarkerStyle(22); - eff_ZStack2_OFF->SetLineWidth(2); - eff_ZStack1_OFF->SetMarkerStyle(22); - eff_ZStack1_OFF->SetLineWidth(2); - eff_enSEE->SetMarkerStyle(22); - eff_enSEE->SetLineWidth(2); - - - legC->SetTextFont(42); - legC->SetTextSize(0.045); - legC->SetFillColor(kWhite); - legC->SetLineColor(kWhite); - legC->SetShadowColor(kWhite); - - // legC->AddEntry(eff_MiB3_ON, "MiB3 chevron-ON", "p"); - legC->AddEntry(eff_MiB3_OFF, "Double layer - iMCP mode", "p"); - // legC->AddEntry(eff_ZStack2_ON, "ZStack2 ON", "p"); - legC->AddEntry(eff_ZStack2_OFF, "ZStack2 - iMCP mode", "p"); - // legC->AddEntry(eff_ZStack1_ON, "ZStack1 ON", "p"); - legC->AddEntry(eff_ZStack1_OFF, "ZStack1 - iMCP mode", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode", "p"); - - // mg->Add(eff_MiB3_ON); - mg->Add(eff_MiB3_OFF); - // mg->Add(eff_ZStack1_ON); - mg->Add(eff_ZStack1_OFF); - mg->Add(eff_ZStack2_OFF); - // mg->Add(eff_ZStack2_ON); - mg->Add(eff_ZStack2_OFF); - mg->Add(eff_enSEE); - - TCanvas* c = new TCanvas(); - gPad->SetTicks(); - char plot_name[100]; - std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; - system(command.c_str()); - sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); - - mg->Draw("AP"); - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(1400,3400); - mg->GetXaxis()->SetTitle("Bias voltage (V)"); - mg->GetXaxis()->SetTitleSize(0.048); - mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); - mg->GetYaxis()->SetTitleSize(0.048); - mg->SetMaximum(100); - mg->SetMinimum(0); - mg->Draw("AP"); - legC->Draw("same"); - banner4Plot(); - c->Update(); - - c->Print(plot_name, "pdf"); - sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); - c->Print(plot_name, "png"); - - sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); - c->SaveAs(plot_name, "root"); - sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); - c->SaveAs(plot_name, "C"); - } - - else { - legC = new TLegend(0.45,0.60,0.65,0.80,NULL,"brNDC"); - - TGraphErrors* eff_MiB3; - TGraphErrors* eff_enSEE; - TGraphErrors* eff_ZStack1; - TGraphErrors* eff_ZStack2; - - if(plot_type == "AngScanHigh"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_AngScan_HVHigh.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_AngScan_HVHigh.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_AngScan_HVHigh.root"); - } - if(plot_type == "AngScanLow"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_AngScan_HVLow.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_AngScan_HVLow.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_AngScan_HVLow.root"); - } - - if(plot_type == "scanX0_HVHigh_50"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_scanX0_HVHigh50GeV.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_scanX0_HVHigh50GeV.root"); - inF_ZStack2 = TFile::Open("plots/resCFD_studies/ZStack2_X0_scanX0_HVHigh50GeV.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_scanX0_HVHigh50GeV.root"); - } - if(plot_type == "scanX0_HVHigh_20"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_scanX0_HVHigh20GeV.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_scanX0_HVHigh20GeV.root"); - inF_ZStack2 = TFile::Open("plots/resCFD_studies/ZStack2_X0_scanX0_HVHigh20GeV.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_scanX0_HVHigh20GeV.root"); - } - if(plot_type == "scanX0_HVLow_50"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_scanX0_HVLow50GeV.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_scanX0_HVLow50GeV.root"); - inF_ZStack2 = TFile::Open("plots/resCFD_studies/ZStack2_X0_scanX0_HVLow50GeV.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_scanX0_HVLow50GeV.root"); - } - if(plot_type == "scanX0_HVLow_20"){ - inF_MiB3 = TFile::Open("plots/resCFD_studies/MiB3_X0_scanX0_HVLow20GeV.root"); - inF_enSEE = TFile::Open("plots/resCFD_studies/enSEE_X0_scanX0_HVLow20GeV.root"); - inF_ZStack2 = TFile::Open("plots/resCFD_studies/ZStack2_X0_scanX0_HVLow20GeV.root"); - inF_ZStack1 = TFile::Open("plots/resCFD_studies/ZStack1_X0_scanX0_HVLow20GeV.root"); - } - - - eff_MiB3 = (TGraphErrors*)inF_MiB3->Get("resCFD"); - eff_enSEE = (TGraphErrors*)inF_enSEE->Get("resCFD"); - eff_ZStack1 = (TGraphErrors*)inF_ZStack1->Get("resCFD"); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - eff_ZStack2 = (TGraphErrors*)inF_ZStack2->Get("resCFD"); - - //settings - eff_MiB3->SetMarkerColor(kGreen+1); - eff_MiB3->SetLineColor(kGreen+1); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") { - eff_ZStack2->SetMarkerColor(kBlue); - eff_ZStack2->SetLineColor(kBlue); - } - eff_ZStack1->SetMarkerColor(kRed); - eff_ZStack1->SetLineColor(kRed); - eff_enSEE->SetMarkerColor(1); - eff_enSEE->SetLineColor(1); - // - eff_MiB3->SetMarkerStyle(20); - eff_MiB3->SetLineWidth(2); - eff_MiB3->SetMarkerSize(0.7); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") { - eff_ZStack2->SetMarkerStyle(20); - eff_ZStack2->SetLineWidth(2); - eff_ZStack2->SetMarkerSize(0.7); - } - eff_ZStack1->SetMarkerStyle(20); - eff_ZStack1->SetLineWidth(2); - eff_ZStack1->SetMarkerSize(0.7); - eff_enSEE->SetMarkerStyle(20); - eff_enSEE->SetLineWidth(2); - eff_enSEE->SetMarkerSize(0.7); - - legC->SetTextFont(42); - legC->SetTextSize(0.04); - legC->SetFillColor(kWhite); - legC->SetLineColor(kWhite); - legC->SetShadowColor(kWhite); - - if(plot_type == "AngScanLow"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 1900 V", "p"); - } - if(plot_type == "AngScanHigh"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 2200 V", "p"); - } - - if(plot_type == "scanX0_HVHigh_50" || plot_type == "scanX0_HVHigh_20"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3200 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 2200 V", "p"); - legC->AddEntry(eff_ZStack2, "ZStack2 - iMCP mode - 3200", "p"); - } - - if(plot_type == "scanX0_HVLow_50" || plot_type == "scanX0_HVLow_20"){ - legC->AddEntry(eff_MiB3, "Double layer - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_ZStack1, "ZStack1 - iMCP mode - 3000 V", "p"); - legC->AddEntry(eff_enSEE, "SEE - iMCP mode - 1900 V", "p"); - legC->AddEntry(eff_ZStack2, "ZStack2 - iMCP mode - 3000", "p"); - } - - mg->Add(eff_MiB3); - mg->Add(eff_ZStack1); - mg->Add(eff_enSEE); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - mg->Add(eff_ZStack2); - - TCanvas* c = new TCanvas(); - gPad->SetTicks(); - char plot_name[100]; - std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; - system(command.c_str()); - sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); - - mg->Draw("AP"); - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20" || plot_type=="scanX0_HVHigh_50" || plot_type=="scanX0_HVLow_50") - { - if (plot_type=="scanX0_HVLow_20" || plot_type=="scanX0_HVHigh_20") { - mg->SetTitle("Electron Beam 20 GeV"); - mg->GetXaxis()->SetRangeUser(-0.1,5.1); - } - else { - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(-0.1,5.1); - } - mg->GetXaxis()->SetTitle("Number of X_{0}"); - mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); - mg->GetXaxis()->SetTitleSize(0.045); - mg->GetYaxis()->SetTitleSize(0.045); - // mg->SetTitle(plot_type.c_str()); - } - else - { - mg->SetTitle("Electron Beam 50 GeV"); - mg->GetXaxis()->SetRangeUser(-0.1, 50); - mg->GetXaxis()->SetTitle("Angle (degrees)"); - mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); - mg->GetXaxis()->SetTitleSize(0.045); - mg->GetYaxis()->SetTitleSize(0.045); - // mg->SetTitle(plot_type.c_str()); - } - - mg->SetMaximum(100); - mg->SetMinimum(0); - mg->Draw("AP"); - legC->Draw("same"); - banner4Plot(); - c->Update(); - - c->Print(plot_name, "pdf"); - sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); - c->Print(plot_name, "png"); - - sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); - c->SaveAs(plot_name, "root"); - sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); - c->SaveAs(plot_name, "C"); - } - - - return 0; -} - diff --git a/TB/bin/dumper.cpp b/TB/bin/dumper.cpp deleted file mode 100644 index f847495..0000000 --- a/TB/bin/dumper.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/******************************************************************************* -THIS PROGRAM READ THE RAW DATA AND PRODUCE THE RECO FILE USED FOR THE ANALYSIS -- - compile with --> c++ -o dumper bin/dumper.cpp `root-config --cflags --glibs` - run with --> ./dumper cfg/example_cfg_file.cfg /gwteray/users/marzocchi/iMCP/dataTrees 9 prova - where arguments are: -cfg_file -inputFolder -# of channels -suffix for the output File - -BE CAREFUL: the number of channels MUST coincide with the number of channel in the cfg file - -*******************************************************************************/ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "TROOT.h" -#include "TFile.h" -#include "TSystem.h" -#include "TStyle.h" -#include "TChain.h" -#include "TF1.h" -#include "TH1F.h" -#include "TH1D.h" -#include "TProfile.h" -#include "TMath.h" -#include "TString.h" -#include "TClass.h" -#include "TApplication.h" - -#include "../interface/analysis_tools.h" -#include "../interface/init_tree_H4.h" -#include "../interface/init_Reco_Tree.h" -//#include "../interface/histo_func.h" -#include "../interface/MCPMap.h" - -//*******MAIN******************************************************************* -int main (int argc, char** argv) -{ - std::cout<<"--------DUMPER: READ RAW DATA AND PRODUCE RECO TREE--------"<cd(); - - TProfile** wf_promed = new TProfile*[11]; - for(int iCh=0; iCh<11; ++iCh) wf_promed[iCh] = new TProfile(Form("wf_promed_%d",iCh), "", 102400, 0., 1024.); - - TTree* outTree = new TTree("reco_tree", "reco_tree"); - outTree->SetDirectory(0); - SetOutTree(outTree); - - int run=0, chNumber=0, HVtemp=0, PC=0; - float X0temp=0.; - std::string name, trig1, trig2; - - //---------definitions----------- - std::map PCOn; - std::map HVVal; - std::map MCPName; - - int start=0; - //-------start to read the cfg file-------- - while(!inputCfg.eof()) - { - PCOn.clear(); - HVVal.clear(); - MCPName.clear(); - - if (start==0) { //read trigger chambers - inputCfg >> trig1 >> trig2; - start=1; - } - - //-----fill maps-------- - for (int count=0; count be careful to give the right number in input!!!! - { - if (count==10) { - PCOn.insert(std::make_pair(10,-1)); - HVVal.insert(std::make_pair(10,-1)); - MCPName.insert(std::make_pair(10,string("trig2"))); - continue; - } - - inputCfg >> run >> chNumber >> HVtemp >> X0temp >> PC >> name; - - PCOn.insert(std::make_pair(chNumber,PC)); - HVVal.insert(std::make_pair(chNumber,HVtemp)); - if (count==8) - MCPName.insert(std::make_pair(chNumber,string("trig1"))); - else - MCPName.insert(std::make_pair(chNumber,name)); - } - - //-----Definitions - vector digiCh[11]; - float timeCF[11], timeCFcorr[11], timeCF30[11]; - float timeOT[11], timeStart[11], timeStop[11], ampMaxT[11]; - float timeStart_1000[11], timeStop_1000[11], timeStart_150[11], timeStop_150[11]; - float timeStart_200[11], timeStop_200[11], timeStart_500[11], timeStop_500[11], timeStart_300[11], timeStop_300[11]; - float intBase[11], intSignal[11], intSignalcorr[11], ampMax[11], ampMaxcorr[11]; - ///int fibreX[8], hodoYchannels[8]; - float tStart, tStop; - - //--reading wire chamber from other tree -- - TChain* t1 = new TChain("outputTree"); - InitTree2(t1); - - //---Chain - TChain* chain = new TChain("H4tree"); - InitTree(chain); - - char command1[300]; - sprintf(command1, "find %s/%d/*/dqmPlotstotal.root > listTemp_%s_%d.txt", (inputFolder).c_str(), run, outputFile.c_str(), run); - system(command1); - char command2[300]; - sprintf(command2, "find %s/%d/[0-9]*.root > listTemp2_%s_%d.txt", (inputFolder).c_str(), run, outputFile.c_str(), run); - system(command2); - - char list1[200]; - char list2[200]; - sprintf (list1, "listTemp_%s_%d.txt", outputFile.c_str(), run); - sprintf (list2, "listTemp2_%s_%d.txt", outputFile.c_str(), run); - - ifstream rootList (list1); - ifstream rootList2 (list2); - - while (!rootList.eof() && !rootList2.eof()) - { - char iRun_tW[70]; - rootList >> iRun_tW; - char iRun_str[70]; - rootList2 >> iRun_str; - - TChain* tTemp = new TChain("outputTree"); - tTemp->Add(iRun_tW); - TChain* tTempH4 = new TChain("H4tree"); - tTempH4->Add(iRun_str); - - if (tTemp->GetEntries() == tTempH4->GetEntries()) - { - t1->Add(iRun_tW); - chain->Add(iRun_str); - } - else - std::cout<<"Bad spill found.. Skipped"<Delete(); - tTempH4->Delete(); - } - - char command3[300]; - sprintf(command3, "rm listTemp_%s_%d.txt", outputFile.c_str(), run); - char command4[300]; - sprintf(command4, "rm listTemp2_%s_%d.txt", outputFile.c_str(), run); - - system(command3); - system(command4); - - std::cout<<"start reading run: "<Add(iRun_str); - cout << "\nReading: "<GetEntries(); iEntry++){ - // for(int iEntry=7932; iEntry<7933; iEntry++){ //RA - - if(iEntry % 1000 == 0) - cout << "read entry: " << iEntry << endl; - //-----Unpack data-------------------------------------------------- - for(int iCh=0; iChGetEntry(iEntry); - - unsigned int spill=spillNumber; - event=evtNumber; - - if (spill!=spillNumber || event!=evtNumber) { - std::cout<<"PROBLEM: non-coherent read"<= HODOX_ADC_START_CHANNEL && - adcChannel[iCh] <= HODOX_ADC_END_CHANNEL) - fibreX[(adcChannel[iCh]-HODOX_ADC_START_CHANNEL)] = adcData[iCh]; - if(adcBoard[iCh] == 1 && adcChannel[iCh] >= HODOY_ADC_START_CHANNEL && - adcChannel[iCh] <= HODOY_ADC_END_CHANNEL) - fibreY[(adcChannel[iCh]-HODOY_ADC_START_CHANNEL)] = adcData[iCh]; - } - */ - - //---Read digitizer samples - // std::cout << " nDigiSamples = " << nDigiSamples << std::endl; - for(unsigned int iSample=0; iSample 1024*10 - 1) break; - } - - - int triggerTime=100; //DON'T CHANGE THIS!!!!! - SubtractBaseline(5, 25, &digiCh[4]); //trigger baseline subtraction - triggerTime=int(TimeConstFrac(triggerTime, 300, &digiCh[4], 1.)/0.2); //trigger - if (triggerTime<100 || triggerTime >800) continue; - - //---loop over MPC's channels - for(int iCh=0; iCh 50 && t1 < 1024 && t2 > 50 && t2 < 1024) ampMax[iCh] = AmpMax(t1, t2, &digiCh[iCh]); - ampMax[iCh] = AmpMax(47, 500, &digiCh[iCh]); - if(ampMax[iCh] < -30. && ampMax[iCh] > -3000.){ - double timeCFpm = TimeConstFracAbs(47, 800, &digiCh[iCh], 0.5, ampMax[iCh]); - for(unsigned int iSample=0; iSample 80. && timeCFpm < 220.) wf_promed[iCh]->Fill( (iSample + 300 - timeCFpm) , (-1.*digiCh[iCh].at(iSample)/ampMax[iCh])); - } - }//unsaturated - - if(t1 > 50 && t1 < 1024 && t2 > 50 && t2 < 1024){ - ampMax[iCh] = AmpMax(t1, t2, &digiCh[iCh]); - intSignal[iCh] = ComputeIntegral(t1, t2, &digiCh[iCh]); - } - /* else{ //A COSA SERVE???? - intSignal[iCh] = ComputeIntegral(50, 70, &digiCh[iCh]); - ampMax[iCh] = AmpMax(0, 1024, &digiCh[iCh]); - }*/ - - //time OT - TimeOverThreshold(t1-10, t2+30, &digiCh[iCh], -150., tStart, tStop); - timeStart_150[iCh]=tStart; - timeStop_150[iCh]=tStop; - - TimeOverThreshold(t1-10, t2+30, &digiCh[iCh], -200., tStart, tStop); - timeStart_200[iCh]=tStart; - timeStop_200[iCh]=tStop; - - TimeOverThreshold(t1-10, t2+30, &digiCh[iCh], -300., tStart, tStop); - timeStart_300[iCh]=tStart; - timeStop_300[iCh]=tStop; - - TimeOverThreshold(t1-10, t2+30, &digiCh[iCh], -500., tStart, tStop); - timeStart_500[iCh]=tStart; - timeStop_500[iCh]=tStop; - - TimeOverThreshold(t1-10, t2+30, &digiCh[iCh], -1000., tStart, tStop); - timeStart_1000[iCh]=tStart; - timeStop_1000[iCh]=tStop; - - /* - if( (tStart < 0. || tStop < 0.) && tStart != -100){ - std::cout << "iEntry = " << iEntry << std::endl; - std::cout << " channel iCh = " << iCh << " tStart = " << tStart - << " tStop = " << tStop - << " ampMax[iCh] = " << ampMax[iCh] << std::endl; - - TH1F* histo = new TH1F("histo", "", 1024, 0., 1024.); - for(int iBinni=0; iBinni<1024; ++iBinni) - histo->SetBinContent(iBinni+1, digiCh[iCh].at(iBinni)); - TFile outF("outF.root", "recreate"); - outF.cd(); - histo->Write(); - outF.Close(); - return 1000; - } - */ - - timeOT[iCh] = TimeOverThreshold(t1-10, t2+10, &digiCh[iCh], -1000., tStart, tStop); - timeStart[iCh]=tStart; - timeStop[iCh]=tStop; - - timeCF[iCh] = TimeConstFracAbs(t1-10, t2+10, &digiCh[iCh], 0.5, ampMax[iCh]); - timeCF30[iCh] = TimeConstFracAbs(t1-10, t2+10, &digiCh[iCh], 0.3, ampMax[iCh]); - - /* if (iCh==4) { - std::cout<1024) { std::cout< -6000.) timeCFcorr[iCh] = TimeConstFracAbs(t1-10, t2+10, &digiCh[iCh], 0.5, ampMaxcorr[iCh]); - else timeCFcorr[iCh] = -999.; - } - - else timeCFcorr[iCh] = timeCF[iCh]; - */ - } - } - - //--------dump ntuple - impulses are negative, invert the sign - for (int iCh=0; iChGetEntry(iEntry); - tdcX = (*TDCreco)[0]; - tdcY = (*TDCreco)[1]; - // event = evtNumber; - - nhodoX1=0; - nhodoX2=0; - nhodoY1=0; - nhodoY2=0; - - for (int i=0; i<64; i++) - { - hodoX1[i] = (*HODOX1)[i]; - hodoX2[i] = (*HODOX2)[i]; - hodoY1[i] = (*HODOY1)[i]; - hodoY2[i] = (*HODOY2)[i]; - //std::cout<<(*HODOX1)[i]<<" "<Fill(); - - // } - } - //---Get ready for next run - chain->Delete(); - t1->Delete(); - } - //-----close everything----------------------------------------------------- - for(int iCh=0; iChWrite(); - - outTree->Write(); - outROOT->Close(); - -//---------Done----------------------------------------------------------------- -} - - diff --git a/TB/cfg/AngScan_HVHigh.cfg b/TB/cfg/AngScan_HVHigh.cfg deleted file mode 100644 index aa408ee..0000000 --- a/TB/cfg/AngScan_HVHigh.cfg +++ /dev/null @@ -1,41 +0,0 @@ -MiB2 MiB3 -784 0 -1 45 0 Off1 -784 1 -1 45 0 Off2 -784 2 -1 45 0 Off3 -784 3 -1 45 0 Off4 -784 4 2750 45 1 MiB2 -784 5 3200 45 0 ZStack1 -784 6 2200 45 0 enSEE -784 7 3200 45 0 ZStack2 -784 8 -1 45 0 Off5 -784 9 3200 45 0 MiB3 -787 0 -1 25 0 Off1 -787 1 -1 25 0 Off2 -787 2 -1 25 0 Off3 -787 3 -1 25 0 Off4 -787 4 2750 25 1 MiB2 -787 5 3200 25 0 ZStack1 -787 6 2200 25 0 enSEE -787 7 3200 25 0 ZStack2 -787 8 -1 25 0 Off5 -787 9 3200 25 0 MiB3 -788 0 -1 10 0 Off1 -788 1 -1 10 0 Off2 -788 2 -1 10 0 Off3 -788 3 -1 10 0 Off4 -788 4 2750 10 1 MiB2 -788 5 3200 10 0 ZStack1 -788 6 2200 10 0 enSEE -788 7 3200 10 0 ZStack2 -788 8 -1 10 0 Off5 -788 9 3200 10 0 MiB3 -773 0 -1 0 0 Off1 -773 1 -1 0 0 Off2 -773 2 -1 0 0 Off3 -773 3 -1 0 0 Off4 -773 4 2750 0 1 MiB2 -773 5 3300 0 0 ZStack1 -773 6 2200 0 0 enSEE -773 7 3300 0 0 ZStack2 -773 8 -1 0 0 Off5 -773 9 3300 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/AngScan_HVLow.cfg b/TB/cfg/AngScan_HVLow.cfg deleted file mode 100644 index d528643..0000000 --- a/TB/cfg/AngScan_HVLow.cfg +++ /dev/null @@ -1,41 +0,0 @@ -MiB2 MiB3 -785 0 -1 45 0 Off1 -785 1 -1 45 0 Off2 -785 2 -1 45 0 Off3 -785 3 -1 45 0 Off4 -785 4 2750 45 1 MiB2 -785 5 3000 45 0 ZStack1 -785 6 1900 45 0 enSEE -785 7 3000 45 0 ZStack2 -785 8 -1 45 0 Off5 -785 9 3000 45 0 MiB3 -786 0 -1 25 0 Off1 -786 1 -1 25 0 Off2 -786 2 -1 25 0 Off3 -786 3 -1 25 0 Off4 -786 4 2750 25 1 MiB2 -786 5 3000 25 0 ZStack1 -786 6 1900 25 0 enSEE -786 7 3000 25 0 ZStack2 -786 8 -1 25 0 Off5 -786 9 3000 25 0 MiB3 -789 0 -1 10 0 Off1 -789 1 -1 10 0 Off2 -789 2 -1 10 0 Off3 -789 3 -1 10 0 Off4 -789 4 2750 10 1 MiB2 -789 5 3000 10 0 ZStack1 -789 6 1900 10 0 enSEE -789 7 3000 10 0 ZStack2 -789 8 -1 10 0 Off5 -789 9 3000 10 0 MiB3 -776 0 -1 0 0 Off1 -776 1 -1 0 0 Off2 -776 2 -1 0 0 Off3 -776 3 -1 0 0 Off4 -776 4 2750 0 1 MiB2 -776 5 3000 0 0 ZStack1 -776 6 1900 0 0 enSEE -776 7 3000 0 0 ZStack2 -776 8 -1 0 0 Off5 -776 9 3000 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/H4test_X0scan_HVH_20GeV.cfg b/TB/cfg/H4test_X0scan_HVH_20GeV.cfg deleted file mode 100644 index 63dcc76..0000000 --- a/TB/cfg/H4test_X0scan_HVH_20GeV.cfg +++ /dev/null @@ -1,51 +0,0 @@ -MiB2 MiB3 -640 0 -1 0.1 0 Off1 -640 1 -1 0.1 0 Off2 -640 2 -1 0.1 0 Off3 -640 3 -1 0.1 0 Off4 -640 4 2750 0 1 MiB2 -640 5 2600 5 1 ZStack1 -640 6 2200 5 0 enSEE -640 7 3200 5 0 ZStack2 -640 8 -1 0.1 0 Off5 -640 9 3100 5 0 MiB3 -641 0 -1 0.1 0 Off1 -641 1 -1 0.1 0 Off2 -641 2 -1 0.1 0 Off3 -641 3 -1 0.1 0 Off4 -641 4 2750 0 1 MiB2 -641 5 2600 3 1 ZStack1 -641 6 2200 3 0 enSEE -641 7 3200 3 0 ZStack2 -641 8 -1 0.1 0 Off5 -641 9 3100 3 0 MiB3 -649 0 -1 0.1 0 Off1 -649 1 -1 0.1 0 Off2 -649 2 -1 0.1 0 Off3 -649 3 -1 0.1 0 Off4 -649 4 2750 0 1 MiB2 -649 5 2600 2 1 ZStack1 -649 6 2200 2 0 enSEE -649 7 3200 2 0 ZStack2 -649 8 -1 0.1 0 Off5 -649 9 3100 2 0 MiB3 -650 0 -1 0.1 0 Off1 -650 1 -1 0.1 0 Off2 -650 2 -1 0.1 0 Off3 -650 3 -1 0.1 0 Off4 -650 4 2750 0 1 MiB2 -650 5 2600 1 1 ZStack1 -650 6 2200 1 0 enSEE -650 7 3200 1 0 ZStack2 -650 8 -1 0.1 0 Off5 -650 9 3100 1 0 MiB3 -657 0 -1 0.1 0 Off1 -657 1 -1 0.1 0 Off2 -657 2 -1 0.1 0 Off3 -657 3 -1 0.1 0 Off4 -657 4 2750 0 1 MiB2 -657 5 2600 0 1 ZStack1 -657 6 2200 0 0 enSEE -657 7 3200 0 0 ZStack2 -657 8 -1 0.1 0 Off5 -657 9 3100 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/H4test_X0scan_HVH_50GeV.cfg b/TB/cfg/H4test_X0scan_HVH_50GeV.cfg deleted file mode 100644 index 25c0906..0000000 --- a/TB/cfg/H4test_X0scan_HVH_50GeV.cfg +++ /dev/null @@ -1,51 +0,0 @@ -MiB2 MiB3 -637 0 -1 0.1 0 Off1 -637 1 -1 0.1 0 Off2 -637 2 -1 0.1 0 Off3 -637 3 -1 0.1 0 Off4 -637 4 2750 0 1 MiB2 -637 5 2900 5 1 ZStack1 -637 6 2200 5 0 enSEE -637 7 3200 5 0 ZStack2 -637 8 -1 0.1 0 Off5 -637 9 3100 5 0 MiB3 -645 0 -1 0.1 0 Off1 -645 1 -1 0.1 0 Off2 -645 2 -1 0.1 0 Off3 -645 3 -1 0.1 0 Off4 -645 4 2750 0 1 MiB2 -645 5 2600 3 1 ZStack1 -645 6 2200 3 0 enSEE -645 7 3200 3 0 ZStack2 -645 8 -1 0.1 0 Off5 -645 9 3100 3 0 MiB3 -646 0 -1 0.1 0 Off1 -646 1 -1 0.1 0 Off2 -646 2 -1 0.1 0 Off3 -646 3 -1 0.1 0 Off4 -646 4 2750 0 1 MiB2 -646 5 2600 2 1 ZStack1 -646 6 2200 2 0 enSEE -646 7 3200 2 0 ZStack2 -646 8 -1 0.1 0 Off5 -646 9 3100 2 0 MiB3 -653 0 -1 0.1 0 Off1 -653 1 -1 0.1 0 Off2 -653 2 -1 0.1 0 Off3 -653 3 -1 0.1 0 Off4 -653 4 2750 0 1 MiB2 -653 5 2600 1 1 ZStack1 -653 6 2200 1 0 enSEE -653 7 3200 1 0 ZStack2 -653 8 -1 0.1 0 Off5 -653 9 3100 1 0 MiB3 -654 0 -1 0.1 0 Off1 -654 1 -1 0.1 0 Off2 -654 2 -1 0.1 0 Off3 -654 3 -1 0.1 0 Off4 -654 4 2750 0 1 MiB2 -654 5 2600 0 1 ZStack1 -654 6 2200 0 0 enSEE -654 7 3200 0 0 ZStack2 -654 8 -1 0.1 0 Off5 -654 9 3100 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/H4test_X0scan_HVL_20GeV.cfg b/TB/cfg/H4test_X0scan_HVL_20GeV.cfg deleted file mode 100644 index 1c71144..0000000 --- a/TB/cfg/H4test_X0scan_HVL_20GeV.cfg +++ /dev/null @@ -1,51 +0,0 @@ -MiB2 MiB3 -639 0 -1 0.1 0 Off1 -639 1 -1 0.1 0 Off2 -639 2 -1 0.1 0 Off3 -639 3 -1 0.1 0 Off4 -639 4 2750 0 1 MiB2 -639 5 2600 5 1 ZStack1 -639 6 1900 5 0 enSEE -639 7 3000 5 0 ZStack2 -639 8 -1 0.1 0 Off5 -639 9 2800 5 0 MiB3 -642 0 -1 0.1 0 Off1 -642 1 -1 0.1 0 Off2 -642 2 -1 0.1 0 Off3 -642 3 -1 0.1 0 Off4 -642 4 2750 0 1 MiB2 -642 5 2600 3 1 ZStack1 -642 6 1900 3 0 enSEE -642 7 3000 3 0 ZStack2 -642 8 -1 0.1 0 Off5 -642 9 2800 3 0 MiB3 -648 0 -1 0.1 0 Off1 -648 1 -1 0.1 0 Off2 -648 2 -1 0.1 0 Off3 -648 3 -1 0.1 0 Off4 -648 4 2750 0 1 MiB2 -648 5 2600 2 1 ZStack1 -648 6 1900 2 0 enSEE -648 7 3000 2 0 ZStack2 -648 8 -1 0.1 0 Off5 -648 9 2800 2 0 MiB3 -651 0 -1 0.1 0 Off1 -651 1 -1 0.1 0 Off2 -651 2 -1 0.1 0 Off3 -651 3 -1 0.1 0 Off4 -651 4 2750 0 1 MiB2 -651 5 2600 1 1 ZStack1 -651 6 1900 1 0 enSEE -651 7 3000 1 0 ZStack2 -651 8 -1 0.1 0 Off5 -651 9 2800 1 0 MiB3 -656 0 -1 0.1 0 Off1 -656 1 -1 0.1 0 Off2 -656 2 -1 0.1 0 Off3 -656 3 -1 0.1 0 Off4 -656 4 2750 0 1 MiB2 -656 5 2600 0 1 ZStack1 -656 6 1900 0 0 enSEE -656 7 3000 0 0 ZStack2 -656 8 -1 0.1 0 Off5 -656 9 2800 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/H4test_X0scan_HVL_50GeV.cfg b/TB/cfg/H4test_X0scan_HVL_50GeV.cfg deleted file mode 100644 index f9200a6..0000000 --- a/TB/cfg/H4test_X0scan_HVL_50GeV.cfg +++ /dev/null @@ -1,51 +0,0 @@ -MiB2 MiB3 -638 0 -1 0.1 0 Off1 -638 1 -1 0.1 0 Off2 -638 2 -1 0.1 0 Off3 -638 3 -1 0.1 0 Off4 -638 4 2750 0 1 MiB2 -638 5 2600 5 1 ZStack1 -638 6 1900 5 0 enSEE -638 7 3000 5 0 ZStack2 -638 8 -1 0.1 0 Off5 -638 9 2800 5 0 MiB3 -643 0 -1 0.1 0 Off1 -643 1 -1 0.1 0 Off2 -643 2 -1 0.1 0 Off3 -643 3 -1 0.1 0 Off4 -643 4 2750 0 1 MiB2 -643 5 2600 3 1 ZStack1 -643 6 1900 3 0 enSEE -643 7 3000 3 0 ZStack2 -643 8 -1 0.1 0 Off5 -643 9 2800 3 0 MiB3 -647 0 -1 0.1 0 Off1 -647 1 -1 0.1 0 Off2 -647 2 -1 0.1 0 Off3 -647 3 -1 0.1 0 Off4 -647 4 2750 0 1 MiB2 -647 5 2600 2 1 ZStack1 -647 6 1900 2 0 enSEE -647 7 3000 2 0 ZStack2 -647 8 -1 0.1 0 Off5 -647 9 2800 2 0 MiB3 -652 0 -1 0.1 0 Off1 -652 1 -1 0.1 0 Off2 -652 2 -1 0.1 0 Off3 -652 3 -1 0.1 0 Off4 -652 4 2750 0 1 MiB2 -652 5 2600 1 1 ZStack1 -652 6 1900 1 0 enSEE -652 7 3000 1 0 ZStack2 -652 8 -1 0.1 0 Off5 -652 9 2800 1 0 MiB3 -655 0 -1 0.1 0 Off1 -655 1 -1 0.1 0 Off2 -655 2 -1 0.1 0 Off3 -655 3 -1 0.1 0 Off4 -655 4 2750 0 1 MiB2 -655 5 2600 0 1 ZStack1 -655 6 1900 0 0 enSEE -655 7 3000 0 0 ZStack2 -655 8 -1 0.1 0 Off5 -655 9 2800 0 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan1.cfg b/TB/cfg/HVScan1.cfg deleted file mode 100644 index c376d67..0000000 --- a/TB/cfg/HVScan1.cfg +++ /dev/null @@ -1,311 +0,0 @@ -MiB2 MiB3 -604 0 -1 0.1 0 Off1 -604 1 -1 0.1 0 Off2 -604 2 -1 0.1 0 Off3 -604 3 -1 0.1 0 Off4 -604 4 2750 0.1 1 MiB2 -604 5 1800 0.1 1 ZStack1 -604 6 1100 0.1 0 enSEE -604 7 1800 0.1 0 ZStack2 -604 8 -1 0.1 0 Off5 -604 9 1800 0.1 0 MiB3 -605 0 -1 0.1 0 Off1 -605 1 -1 0.1 0 Off2 -605 2 -1 0.1 0 Off3 -605 3 -1 0.1 0 Off4 -605 4 2750 0.1 1 MiB2 -605 5 1850 0.1 1 ZStack1 -605 6 1150 0.1 0 enSEE -605 7 1850 0.1 0 ZStack2 -605 8 -1 0.1 0 Off5 -605 9 1850 0.1 0 MiB3 -606 0 -1 0.1 0 Off1 -606 1 -1 0.1 0 Off2 -606 2 -1 0.1 0 Off3 -606 3 -1 0.1 0 Off4 -606 4 2750 0.1 1 MiB2 -606 5 1900 0.1 1 ZStack1 -606 6 1200 0.1 0 enSEE -606 7 1900 0.1 0 ZStack2 -606 8 -1 0.1 0 Off5 -606 9 1900 0.1 0 MiB3 -607 0 -1 0.1 0 Off1 -607 1 -1 0.1 0 Off2 -607 2 -1 0.1 0 Off3 -607 3 -1 0.1 0 Off4 -607 4 2750 0.1 1 MiB2 -607 5 1950 0.1 1 ZStack1 -607 6 1250 0.1 0 enSEE -607 7 1950 0.1 0 ZStack2 -607 8 -1 0.1 0 Off5 -607 9 1950 0.1 0 MiB3 -608 0 -1 0.1 0 Off1 -608 1 -1 0.1 0 Off2 -608 2 -1 0.1 0 Off3 -608 3 -1 0.1 0 Off4 -608 4 2750 0.1 1 MiB2 -608 5 2000 0.1 1 ZStack1 -608 6 1300 0.1 0 enSEE -608 7 2000 0.1 0 ZStack2 -608 8 -1 0.1 0 Off5 -608 9 2000 0.1 0 MiB3 -609 0 -1 0.1 0 Off1 -609 1 -1 0.1 0 Off2 -609 2 -1 0.1 0 Off3 -609 3 -1 0.1 0 Off4 -609 4 2750 0.1 1 MiB2 -609 5 2050 0.1 1 ZStack1 -609 6 1350 0.1 0 enSEE -609 7 2050 0.1 0 ZStack2 -609 8 -1 0.1 0 Off5 -609 9 2050 0.1 0 MiB3 -610 0 -1 0.1 0 Off1 -610 1 -1 0.1 0 Off2 -610 2 -1 0.1 0 Off3 -610 3 -1 0.1 0 Off4 -610 4 2750 0.1 1 MiB2 -610 5 2100 0.1 1 ZStack1 -610 6 1400 0.1 0 enSEE -610 7 2100 0.1 0 ZStack2 -610 8 -1 0.1 0 Off5 -610 9 2100 0.1 0 MiB3 -611 0 -1 0.1 0 Off1 -611 1 -1 0.1 0 Off2 -611 2 -1 0.1 0 Off3 -611 3 -1 0.1 0 Off4 -611 4 2750 0.1 1 MiB2 -611 5 2150 0.1 1 ZStack1 -611 6 1450 0.1 0 enSEE -611 7 2150 0.1 0 ZStack2 -611 8 -1 0.1 0 Off5 -611 9 2150 0.1 0 MiB3 -612 0 -1 0.1 0 Off1 -612 1 -1 0.1 0 Off2 -612 2 -1 0.1 0 Off3 -612 3 -1 0.1 0 Off4 -612 4 2750 0.1 1 MiB2 -612 5 2200 0.1 1 ZStack1 -612 6 1500 0.1 0 enSEE -612 7 2200 0.1 0 ZStack2 -612 8 -1 0.1 0 Off5 -612 9 2200 0.1 0 MiB3 -613 0 -1 0.1 0 Off1 -613 1 -1 0.1 0 Off2 -613 2 -1 0.1 0 Off3 -613 3 -1 0.1 0 Off4 -613 4 2750 0.1 1 MiB2 -613 5 2250 0.1 1 ZStack1 -613 6 1550 0.1 0 enSEE -613 7 2250 0.1 0 ZStack2 -613 8 -1 0.1 0 Off5 -613 9 2250 0.1 0 MiB3 -614 0 -1 0.1 0 Off1 -614 1 -1 0.1 0 Off2 -614 2 -1 0.1 0 Off3 -614 3 -1 0.1 0 Off4 -614 4 2750 0.1 1 MiB2 -614 5 2300 0.1 1 ZStack1 -614 6 1600 0.1 0 enSEE -614 7 2300 0.1 0 ZStack2 -614 8 -1 0.1 0 Off5 -614 9 2300 0.1 0 MiB3 -615 0 -1 0.1 0 Off1 -615 1 -1 0.1 0 Off2 -615 2 -1 0.1 0 Off3 -615 3 -1 0.1 0 Off4 -615 4 2750 0.1 1 MiB2 -615 5 2350 0.1 1 ZStack1 -615 6 1650 0.1 0 enSEE -615 7 2350 0.1 0 ZStack2 -615 8 -1 0.1 0 Off5 -615 9 2350 0.1 0 MiB3 -616 0 -1 0.1 0 Off1 -616 1 -1 0.1 0 Off2 -616 2 -1 0.1 0 Off3 -616 3 -1 0.1 0 Off4 -616 4 2750 0.1 1 MiB2 -616 5 2400 0.1 1 ZStack1 -616 6 1700 0.1 0 enSEE -616 7 2400 0.1 0 ZStack2 -616 8 -1 0.1 0 Off5 -616 9 2400 0.1 0 MiB3 -617 0 -1 0.1 0 Off1 -617 1 -1 0.1 0 Off2 -617 2 -1 0.1 0 Off3 -617 3 -1 0.1 0 Off4 -617 4 2750 0.1 1 MiB2 -617 5 2450 0.1 1 ZStack1 -617 6 1750 0.1 0 enSEE -617 7 2450 0.1 0 ZStack2 -617 8 -1 0.1 0 Off5 -617 9 2450 0.1 0 MiB3 -618 0 -1 0.1 0 Off1 -618 1 -1 0.1 0 Off2 -618 2 -1 0.1 0 Off3 -618 3 -1 0.1 0 Off4 -618 4 2750 0.1 1 MiB2 -618 5 2500 0.1 1 ZStack1 -618 6 1800 0.1 0 enSEE -618 7 2500 0.1 0 ZStack2 -618 8 -1 0.1 0 Off5 -618 9 2500 0.1 0 MiB3 -619 0 -1 0.1 0 Off1 -619 1 -1 0.1 0 Off2 -619 2 -1 0.1 0 Off3 -619 3 -1 0.1 0 Off4 -619 4 2750 0.1 1 MiB2 -619 5 2550 0.1 1 ZStack1 -619 6 1850 0.1 0 enSEE -619 7 2550 0.1 0 ZStack2 -619 8 -1 0.1 0 Off5 -619 9 2550 0.1 0 MiB3 -620 0 -1 0.1 0 Off1 -620 1 -1 0.1 0 Off2 -620 2 -1 0.1 0 Off3 -620 3 -1 0.1 0 Off4 -620 4 2750 0.1 1 MiB2 -620 5 2600 0.1 1 ZStack1 -620 6 1900 0.1 0 enSEE -620 7 2600 0.1 0 ZStack2 -620 8 -1 0.1 0 Off5 -620 9 2600 0.1 0 MiB3 -621 0 -1 0.1 0 Off1 -621 1 -1 0.1 0 Off2 -621 2 -1 0.1 0 Off3 -621 3 -1 0.1 0 Off4 -621 4 2750 0.1 1 MiB2 -621 5 2650 0.1 1 ZStack1 -621 6 1950 0.1 0 enSEE -621 7 2650 0.1 0 ZStack2 -621 8 -1 0.1 0 Off5 -621 9 2650 0.1 0 MiB3 -622 0 -1 0.1 0 Off1 -622 1 -1 0.1 0 Off2 -622 2 -1 0.1 0 Off3 -622 3 -1 0.1 0 Off4 -622 4 2750 0.1 1 MiB2 -622 5 2700 0.1 1 ZStack1 -622 6 2000 0.1 0 enSEE -622 7 2700 0.1 0 ZStack2 -622 8 -1 0.1 0 Off5 -622 9 2700 0.1 0 MiB3 -623 0 -1 0.1 0 Off1 -623 1 -1 0.1 0 Off2 -623 2 -1 0.1 0 Off3 -623 3 -1 0.1 0 Off4 -623 4 2750 0.1 1 MiB2 -623 5 2750 0.1 1 ZStack1 -623 6 2050 0.1 0 enSEE -623 7 2750 0.1 0 ZStack2 -623 8 -1 0.1 0 Off5 -623 9 2750 0.1 0 MiB3 -624 0 -1 0.1 0 Off1 -624 1 -1 0.1 0 Off2 -624 2 -1 0.1 0 Off3 -624 3 -1 0.1 0 Off4 -624 4 2750 0.1 1 MiB2 -624 5 2800 0.1 1 ZStack1 -624 6 2100 0.1 0 enSEE -624 7 2800 0.1 0 ZStack2 -624 8 -1 0.1 0 Off5 -624 9 2800 0.1 0 MiB3 -625 0 -1 0.1 0 Off1 -625 1 -1 0.1 0 Off2 -625 2 -1 0.1 0 Off3 -625 3 -1 0.1 0 Off4 -625 4 2750 0.1 1 MiB2 -625 5 2850 0.1 1 ZStack1 -625 6 2150 0.1 0 enSEE -625 7 2850 0.1 0 ZStack2 -625 8 -1 0.1 0 Off5 -625 9 2850 0.1 0 MiB3 -626 0 -1 0.1 0 Off1 -626 1 -1 0.1 0 Off2 -626 2 -1 0.1 0 Off3 -626 3 -1 0.1 0 Off4 -626 4 2750 0.1 1 MiB2 -626 5 2900 0.1 1 ZStack1 -626 6 2200 0.1 0 enSEE -626 7 2900 0.1 0 ZStack2 -626 8 -1 0.1 0 Off5 -626 9 2900 0.1 0 MiB3 -627 0 -1 0.1 0 Off1 -627 1 -1 0.1 0 Off2 -627 2 -1 0.1 0 Off3 -627 3 -1 0.1 0 Off4 -627 4 2750 0.1 1 MiB2 -627 5 2950 0.1 1 ZStack1 -627 6 2200 0.1 0 enSEE -627 7 2950 0.1 0 ZStack2 -627 8 -1 0.1 0 Off5 -627 9 2950 0.1 0 MiB3 -628 0 -1 0.1 0 Off1 -628 1 -1 0.1 0 Off2 -628 2 -1 0.1 0 Off3 -628 3 -1 0.1 0 Off4 -628 4 2750 0.1 1 MiB2 -628 5 3000 0.1 1 ZStack1 -628 6 2200 0.1 0 enSEE -628 7 3000 0.1 0 ZStack2 -628 8 -1 0.1 0 Off5 -628 9 3000 0.1 0 MiB3 -629 0 -1 0.1 0 Off1 -629 1 -1 0.1 0 Off2 -629 2 -1 0.1 0 Off3 -629 3 -1 0.1 0 Off4 -629 4 2750 0.1 1 MiB2 -629 5 3050 0.1 1 ZStack1 -629 6 2200 0.1 0 enSEE -629 7 3050 0.1 0 ZStack2 -629 8 -1 0.1 0 Off5 -629 9 3050 0.1 0 MiB3 -630 0 -1 0.1 0 Off1 -630 1 -1 0.1 0 Off2 -630 2 -1 0.1 0 Off3 -630 3 -1 0.1 0 Off4 -630 4 2750 0.1 1 MiB2 -630 5 3100 0.1 1 ZStack1 -630 6 2200 0.1 0 enSEE -630 7 3100 0.1 0 ZStack2 -630 8 -1 0.1 0 Off5 -630 9 3100 0.1 0 MiB3 -632 0 -1 0.1 0 Off1 -632 1 -1 0.1 0 Off2 -632 2 -1 0.1 0 Off3 -632 3 -1 0.1 0 Off4 -632 4 2750 0.1 1 MiB2 -632 5 3150 0.1 1 ZStack1 -632 6 2200 0.1 0 enSEE -632 7 3150 0.1 0 ZStack2 -632 8 -1 0.1 0 Off5 -632 9 3150 0.1 0 MiB3 -633 0 -1 0.1 0 Off1 -633 1 -1 0.1 0 Off2 -633 2 -1 0.1 0 Off3 -633 3 -1 0.1 0 Off4 -633 4 2750 0.1 1 MiB2 -633 5 2900 0.1 1 ZStack1 -633 6 2200 0.1 0 enSEE -633 7 3200 0.1 0 ZStack2 -633 8 -1 0.1 0 Off5 -633 9 3100 0.1 0 MiB3 -634 0 -1 0.1 0 Off1 -634 1 -1 0.1 0 Off2 -634 2 -1 0.1 0 Off3 -634 3 -1 0.1 0 Off4 -634 4 2750 0.1 1 MiB2 -634 5 2900 0.1 1 ZStack1 -634 6 2200 0.1 0 enSEE -634 7 3250 0.1 0 ZStack2 -634 8 -1 0.1 0 Off5 -634 9 3100 0.1 0 MiB3 -635 0 -1 0.1 0 Off1 -635 1 -1 0.1 0 Off2 -635 2 -1 0.1 0 Off3 -635 3 -1 0.1 0 Off4 -635 4 2750 0.1 1 MiB2 -635 5 2900 0.1 1 ZStack1 -635 6 2200 0.1 0 enSEE -635 7 3300 0.1 0 ZStack2 -635 8 -1 0.1 0 Off5 -635 9 3100 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan2.cfg b/TB/cfg/HVScan2.cfg deleted file mode 100644 index 5bfb038..0000000 --- a/TB/cfg/HVScan2.cfg +++ /dev/null @@ -1,241 +0,0 @@ -MiB2 MiB3 -694 0 -1 0.1 0 Off1 -694 1 -1 0.1 0 Off2 -694 2 -1 0.1 0 Off3 -694 3 -1 0.1 0 Off4 -694 4 2750 0.1 1 MiB2 -694 5 3300 0.1 0 ZStack1 -694 6 2200 0.1 0 enSEE -694 7 3100 0.1 1 ZStack2 -694 8 -1 0.1 0 Off5 -694 9 3100 0.1 1 MiB3 -716 0 -1 0.1 0 Off1 -716 1 -1 0.1 0 Off2 -716 2 -1 0.1 0 Off3 -716 3 -1 0.1 0 Off4 -716 4 2750 0.1 1 MiB2 -716 5 3250 0.1 0 ZStack1 -716 6 2150 0.1 0 enSEE -716 7 3050 0.1 1 ZStack2 -716 8 -1 0.1 0 Off5 -716 9 3050 0.1 1 MiB3 -695 0 -1 0.1 0 Off1 -695 1 -1 0.1 0 Off2 -695 2 -1 0.1 0 Off3 -695 3 -1 0.1 0 Off4 -695 4 2750 0.1 1 MiB2 -695 5 3200 0.1 0 ZStack1 -695 6 2100 0.1 0 enSEE -695 7 3000 0.1 1 ZStack2 -695 8 -1 0.1 0 Off5 -695 9 3000 0.1 1 MiB3 -715 0 -1 0.1 0 Off1 -715 1 -1 0.1 0 Off2 -715 2 -1 0.1 0 Off3 -715 3 -1 0.1 0 Off4 -715 4 2750 0.1 1 MiB2 -715 5 3150 0.1 0 ZStack1 -715 6 2050 0.1 0 enSEE -715 7 2950 0.1 1 ZStack2 -715 8 -1 0.1 0 Off5 -715 9 2950 0.1 1 MiB3 -696 0 -1 0.1 0 Off1 -696 1 -1 0.1 0 Off2 -696 2 -1 0.1 0 Off3 -696 3 -1 0.1 0 Off4 -696 4 2750 0.1 1 MiB2 -696 5 3100 0.1 0 ZStack1 -696 6 2000 0.1 0 enSEE -696 7 2900 0.1 1 ZStack2 -696 8 -1 0.1 0 Off5 -696 9 2900 0.1 1 MiB3 -714 0 -1 0.1 0 Off1 -714 1 -1 0.1 0 Off2 -714 2 -1 0.1 0 Off3 -714 3 -1 0.1 0 Off4 -714 4 2750 0.1 1 MiB2 -714 5 3050 0.1 0 ZStack1 -714 6 1950 0.1 0 enSEE -714 7 2850 0.1 1 ZStack2 -714 8 -1 0.1 0 Off5 -714 9 2850 0.1 1 MiB3 -697 0 -1 0.1 0 Off1 -697 1 -1 0.1 0 Off2 -697 2 -1 0.1 0 Off3 -697 3 -1 0.1 0 Off4 -697 4 2750 0.1 1 MiB2 -697 5 3000 0.1 0 ZStack1 -697 6 1900 0.1 0 enSEE -697 7 2800 0.1 1 ZStack2 -697 8 -1 0.1 0 Off5 -697 9 2800 0.1 1 MiB3 -713 0 -1 0.1 0 Off1 -713 1 -1 0.1 0 Off2 -713 2 -1 0.1 0 Off3 -713 3 -1 0.1 0 Off4 -713 4 2750 0.1 1 MiB2 -713 5 2950 0.1 0 ZStack1 -713 6 1850 0.1 0 enSEE -713 7 2750 0.1 1 ZStack2 -713 8 -1 0.1 0 Off5 -713 9 2750 0.1 1 MiB3 -698 0 -1 0.1 0 Off1 -698 1 -1 0.1 0 Off2 -698 2 -1 0.1 0 Off3 -698 3 -1 0.1 0 Off4 -698 4 2750 0.1 1 MiB2 -698 5 2900 0.1 0 ZStack1 -698 6 1800 0.1 0 enSEE -698 7 2700 0.1 1 ZStack2 -698 8 -1 0.1 0 Off5 -698 9 2700 0.1 1 MiB3 -699 0 -1 0.1 0 Off1 -699 1 -1 0.1 0 Off2 -699 2 -1 0.1 0 Off3 -699 3 -1 0.1 0 Off4 -699 4 2750 0.1 1 MiB2 -699 5 2850 0.1 0 ZStack1 -699 6 1750 0.1 0 enSEE -699 7 2650 0.1 1 ZStack2 -699 8 -1 0.1 0 Off5 -699 9 2650 0.1 1 MiB3 -700 0 -1 0.1 0 Off1 -700 1 -1 0.1 0 Off2 -700 2 -1 0.1 0 Off3 -700 3 -1 0.1 0 Off4 -700 4 2750 0.1 1 MiB2 -700 5 2800 0.1 0 ZStack1 -700 6 1700 0.1 0 enSEE -700 7 2600 0.1 1 ZStack2 -700 8 -1 0.1 0 Off5 -700 9 2600 0.1 1 MiB3 -701 0 -1 0.1 0 Off1 -701 1 -1 0.1 0 Off2 -701 2 -1 0.1 0 Off3 -701 3 -1 0.1 0 Off4 -701 4 2750 0.1 1 MiB2 -701 5 2750 0.1 0 ZStack1 -701 6 1650 0.1 0 enSEE -701 7 2550 0.1 1 ZStack2 -701 8 -1 0.1 0 Off5 -701 9 2550 0.1 1 MiB3 -702 0 -1 0.1 0 Off1 -702 1 -1 0.1 0 Off2 -702 2 -1 0.1 0 Off3 -702 3 -1 0.1 0 Off4 -702 4 2750 0.1 1 MiB2 -702 5 2700 0.1 0 ZStack1 -702 6 1600 0.1 0 enSEE -702 7 2500 0.1 1 ZStack2 -702 8 -1 0.1 0 Off5 -702 9 2500 0.1 1 MiB3 -703 0 -1 0.1 0 Off1 -703 1 -1 0.1 0 Off2 -703 2 -1 0.1 0 Off3 -703 3 -1 0.1 0 Off4 -703 4 2750 0.1 1 MiB2 -703 5 2650 0.1 0 ZStack1 -703 6 1550 0.1 0 enSEE -703 7 2450 0.1 1 ZStack2 -703 8 -1 0.1 0 Off5 -703 9 2450 0.1 1 MiB3 -704 0 -1 0.1 0 Off1 -704 1 -1 0.1 0 Off2 -704 2 -1 0.1 0 Off3 -704 3 -1 0.1 0 Off4 -704 4 2750 0.1 1 MiB2 -704 5 2600 0.1 0 ZStack1 -704 6 1500 0.1 0 enSEE -704 7 2400 0.1 1 ZStack2 -704 8 -1 0.1 0 Off5 -704 9 2400 0.1 1 MiB3 -705 0 -1 0.1 0 Off1 -705 1 -1 0.1 0 Off2 -705 2 -1 0.1 0 Off3 -705 3 -1 0.1 0 Off4 -705 4 2750 0.1 1 MiB2 -705 5 2450 0.1 0 ZStack1 -705 6 1450 0.1 0 enSEE -705 7 2350 0.1 1 ZStack2 -705 8 -1 0.1 0 Off5 -705 9 2350 0.1 1 MiB3 -706 0 -1 0.1 0 Off1 -706 1 -1 0.1 0 Off2 -706 2 -1 0.1 0 Off3 -706 3 -1 0.1 0 Off4 -706 4 2750 0.1 1 MiB2 -706 5 2500 0.1 0 ZStack1 -706 6 1400 0.1 0 enSEE -706 7 2300 0.1 1 ZStack2 -706 8 -1 0.1 0 Off5 -706 9 2300 0.1 1 MiB3 -707 0 -1 0.1 0 Off1 -707 1 -1 0.1 0 Off2 -707 2 -1 0.1 0 Off3 -707 3 -1 0.1 0 Off4 -707 4 2750 0.1 1 MiB2 -707 5 2550 0.1 0 ZStack1 -707 6 1350 0.1 0 enSEE -707 7 2250 0.1 1 ZStack2 -707 8 -1 0.1 0 Off5 -707 9 2250 0.1 1 MiB3 -708 0 -1 0.1 0 Off1 -708 1 -1 0.1 0 Off2 -708 2 -1 0.1 0 Off3 -708 3 -1 0.1 0 Off4 -708 4 2750 0.1 1 MiB2 -708 5 2400 0.1 0 ZStack1 -708 6 1300 0.1 0 enSEE -708 7 2200 0.1 1 ZStack2 -708 8 -1 0.1 0 Off5 -708 9 2200 0.1 1 MiB3 -709 0 -1 0.1 0 Off1 -709 1 -1 0.1 0 Off2 -709 2 -1 0.1 0 Off3 -709 3 -1 0.1 0 Off4 -709 4 2750 0.1 1 MiB2 -709 5 2350 0.1 0 ZStack1 -709 6 1250 0.1 0 enSEE -709 7 2150 0.1 1 ZStack2 -709 8 -1 0.1 0 Off5 -709 9 2150 0.1 1 MiB3 -710 0 -1 0.1 0 Off1 -710 1 -1 0.1 0 Off2 -710 2 -1 0.1 0 Off3 -710 3 -1 0.1 0 Off4 -710 4 2750 0.1 1 MiB2 -710 5 2300 0.1 0 ZStack1 -710 6 1200 0.1 0 enSEE -710 7 2100 0.1 1 ZStack2 -710 8 -1 0.1 0 Off5 -710 9 2100 0.1 1 MiB3 -711 0 -1 0.1 0 Off1 -711 1 -1 0.1 0 Off2 -711 2 -1 0.1 0 Off3 -711 3 -1 0.1 0 Off4 -711 4 2750 0.1 1 MiB2 -711 5 2250 0.1 0 ZStack1 -711 6 1150 0.1 0 enSEE -711 7 2050 0.1 1 ZStack2 -711 8 -1 0.1 0 Off5 -711 9 2050 0.1 1 MiB3 -712 0 -1 0.1 0 Off1 -712 1 -1 0.1 0 Off2 -712 2 -1 0.1 0 Off3 -712 3 -1 0.1 0 Off4 -712 4 2750 0.1 1 MiB2 -712 5 2200 0.1 0 ZStack1 -712 6 1100 0.1 0 enSEE -712 7 2000 0.1 1 ZStack2 -712 8 -1 0.1 0 Off5 -712 9 2000 0.1 1 MiB3 -693 0 -1 0.1 0 Off1 -693 1 -1 0.1 0 Off2 -693 2 -1 0.1 0 Off3 -693 3 -1 0.1 0 Off4 -693 4 2750 0.1 1 MiB2 -693 5 1800 0.1 0 ZStack1 -693 6 1100 0.1 0 enSEE -693 7 1800 0.1 1 ZStack2 -693 8 -1 0.1 0 Off5 -693 9 1800 0.1 1 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan3.cfg b/TB/cfg/HVScan3.cfg deleted file mode 100644 index 34662bf..0000000 --- a/TB/cfg/HVScan3.cfg +++ /dev/null @@ -1,81 +0,0 @@ -MiB2 MiB3 -717 0 -1 0.1 0 Off1 -717 1 -1 0.1 0 Off2 -717 2 -1 0.1 0 Off3 -717 3 -1 0.1 0 Off4 -717 4 2750 0.1 1 MiB2 -717 5 3100 0.1 0 ZStack1 -717 6 2100 0.1 0 enSEE -717 7 3100 0.1 0 ZStack2 -717 8 -1 0.1 0 Off5 -717 9 3100 0.1 0 MiB3 -718 0 -1 0.1 0 Off1 -718 1 -1 0.1 0 Off2 -718 2 -1 0.1 0 Off3 -718 3 -1 0.1 0 Off4 -718 4 2750 0.1 1 MiB2 -718 5 3000 0.1 0 ZStack1 -718 6 2000 0.1 0 enSEE -718 7 3000 0.1 0 ZStack2 -718 8 -1 0.1 0 Off5 -718 9 3000 0.1 0 MiB3 -719 0 -1 0.1 0 Off1 -719 1 -1 0.1 0 Off2 -719 2 -1 0.1 0 Off3 -719 3 -1 0.1 0 Off4 -719 4 2750 0.1 1 MiB2 -719 5 2900 0.1 0 ZStack1 -719 6 1900 0.1 0 enSEE -719 7 2900 0.1 0 ZStack2 -719 8 -1 0.1 0 Off5 -719 9 2900 0.1 0 MiB3 -720 0 -1 0.1 0 Off1 -720 1 -1 0.1 0 Off2 -720 2 -1 0.1 0 Off3 -720 3 -1 0.1 0 Off4 -720 4 2750 0.1 1 MiB2 -720 5 3300 0.1 0 ZStack1 -720 6 2200 0.1 0 enSEE -720 7 3300 0.1 0 ZStack2 -720 8 -1 0.1 0 Off5 -720 9 3300 0.1 0 MiB3 -721 0 -1 0.1 0 Off1 -721 1 -1 0.1 0 Off2 -721 2 -1 0.1 0 Off3 -721 3 -1 0.1 0 Off4 -721 4 2750 0.1 1 MiB2 -721 5 2700 0.1 0 ZStack1 -721 6 1700 0.1 0 enSEE -721 7 2700 0.1 0 ZStack2 -721 8 -1 0.1 0 Off5 -721 9 2700 0.1 0 MiB3 -722 0 -1 0.1 0 Off1 -722 1 -1 0.1 0 Off2 -722 2 -1 0.1 0 Off3 -722 3 -1 0.1 0 Off4 -722 4 2750 0.1 1 MiB2 -722 5 2500 0.1 0 ZStack1 -722 6 1500 0.1 0 enSEE -722 7 2500 0.1 0 ZStack2 -722 8 -1 0.1 0 Off5 -722 9 2500 0.1 0 MiB3 -723 0 -1 0.1 0 Off1 -723 1 -1 0.1 0 Off2 -723 2 -1 0.1 0 Off3 -723 3 -1 0.1 0 Off4 -723 4 2750 0.1 1 MiB2 -723 5 2300 0.1 0 ZStack1 -723 6 1300 0.1 0 enSEE -723 7 2300 0.1 0 ZStack2 -723 8 -1 0.1 0 Off5 -723 9 2300 0.1 0 MiB3 -724 0 -1 0.1 0 Off1 -724 1 -1 0.1 0 Off2 -724 2 -1 0.1 0 Off3 -724 3 -1 0.1 0 Off4 -724 4 2750 0.1 1 MiB2 -724 5 2100 0.1 0 ZStack1 -724 6 1100 0.1 0 enSEE -724 7 2100 0.1 0 ZStack2 -724 8 -1 0.1 0 Off5 -724 9 2100 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan4.cfg b/TB/cfg/HVScan4.cfg deleted file mode 100644 index a1f5719..0000000 --- a/TB/cfg/HVScan4.cfg +++ /dev/null @@ -1,111 +0,0 @@ -MiB2 MiB3 -727 0 -1 0.1 0 Off1 -727 1 -1 0.1 0 Off2 -727 2 -1 0.1 0 Off3 -727 3 -1 0.1 0 Off4 -727 4 2750 0.1 1 MiB2 -727 5 2200 0.1 0 ZStack1 -727 6 1200 0.1 0 enSEE -727 7 2200 0.1 0 ZStack2 -727 8 -1 0.1 0 Off5 -727 9 2200 0.1 0 MiB3 -728 0 -1 0.1 0 Off1 -728 1 -1 0.1 0 Off2 -728 2 -1 0.1 0 Off3 -728 3 -1 0.1 0 Off4 -728 4 2750 0.1 1 MiB2 -728 5 2300 0.1 0 ZStack1 -728 6 1300 0.1 0 enSEE -728 7 2300 0.1 0 ZStack2 -728 8 -1 0.1 0 Off5 -728 9 2300 0.1 0 MiB3 -729 0 -1 0.1 0 Off1 -729 1 -1 0.1 0 Off2 -729 2 -1 0.1 0 Off3 -729 3 -1 0.1 0 Off4 -729 4 2750 0.1 1 MiB2 -729 5 2400 0.1 0 ZStack1 -729 6 1400 0.1 0 enSEE -729 7 2400 0.1 0 ZStack2 -729 8 -1 0.1 0 Off5 -729 9 2400 0.1 0 MiB3 -730 0 -1 0.1 0 Off1 -730 1 -1 0.1 0 Off2 -730 2 -1 0.1 0 Off3 -730 3 -1 0.1 0 Off4 -730 4 2750 0.1 1 MiB2 -730 5 2500 0.1 0 ZStack1 -730 6 1500 0.1 0 enSEE -730 7 2500 0.1 0 ZStack2 -730 8 -1 0.1 0 Off5 -730 9 2500 0.1 0 MiB3 -731 0 -1 0.1 0 Off1 -731 1 -1 0.1 0 Off2 -731 2 -1 0.1 0 Off3 -731 3 -1 0.1 0 Off4 -731 4 2750 0.1 1 MiB2 -731 5 2600 0.1 0 ZStack1 -731 6 1600 0.1 0 enSEE -731 7 2600 0.1 0 ZStack2 -731 8 -1 0.1 0 Off5 -731 9 2600 0.1 0 MiB3 -732 0 -1 0.1 0 Off1 -732 1 -1 0.1 0 Off2 -732 2 -1 0.1 0 Off3 -732 3 -1 0.1 0 Off4 -732 4 2750 0.1 1 MiB2 -732 5 2700 0.1 0 ZStack1 -732 6 1700 0.1 0 enSEE -732 7 2700 0.1 0 ZStack2 -732 8 -1 0.1 0 Off5 -732 9 2700 0.1 0 MiB3 -733 0 -1 0.1 0 Off1 -733 1 -1 0.1 0 Off2 -733 2 -1 0.1 0 Off3 -733 3 -1 0.1 0 Off4 -733 4 2750 0.1 1 MiB2 -733 5 2800 0.1 0 ZStack1 -733 6 1800 0.1 0 enSEE -733 7 2800 0.1 0 ZStack2 -733 8 -1 0.1 0 Off5 -733 9 2800 0.1 0 MiB3 -734 0 -1 0.1 0 Off1 -734 1 -1 0.1 0 Off2 -734 2 -1 0.1 0 Off3 -734 3 -1 0.1 0 Off4 -734 4 2750 0.1 1 MiB2 -734 5 2900 0.1 0 ZStack1 -734 6 1900 0.1 0 enSEE -734 7 2900 0.1 0 ZStack2 -734 8 -1 0.1 0 Off5 -734 9 2900 0.1 0 MiB3 -735 0 -1 0.1 0 Off1 -735 1 -1 0.1 0 Off2 -735 2 -1 0.1 0 Off3 -735 3 -1 0.1 0 Off4 -735 4 2750 0.1 1 MiB2 -735 5 3000 0.1 0 ZStack1 -735 6 2000 0.1 0 enSEE -735 7 3000 0.1 0 ZStack2 -735 8 -1 0.1 0 Off5 -735 9 3000 0.1 0 MiB3 -736 0 -1 0.1 0 Off1 -736 1 -1 0.1 0 Off2 -736 2 -1 0.1 0 Off3 -736 3 -1 0.1 0 Off4 -736 4 2750 0.1 1 MiB2 -736 5 3100 0.1 0 ZStack1 -736 6 2100 0.1 0 enSEE -736 7 3100 0.1 0 ZStack2 -736 8 -1 0.1 0 Off5 -736 9 3100 0.1 0 MiB3 -737 0 -1 0.1 0 Off1 -737 1 -1 0.1 0 Off2 -737 2 -1 0.1 0 Off3 -737 3 -1 0.1 0 Off4 -737 4 2750 0.1 1 MiB2 -737 5 3200 0.1 0 ZStack1 -737 6 2200 0.1 0 enSEE -737 7 3200 0.1 0 ZStack2 -737 8 -1 0.1 0 Off5 -737 9 3200 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan5.cfg b/TB/cfg/HVScan5.cfg deleted file mode 100644 index 861c682..0000000 --- a/TB/cfg/HVScan5.cfg +++ /dev/null @@ -1,111 +0,0 @@ -MiB2 MiB3 -738 0 -1 0.1 0 Off1 -738 1 -1 0.1 0 Off2 -738 2 -1 0.1 0 Off3 -738 3 -1 0.1 0 Off4 -738 4 2750 0.1 1 MiB2 -738 5 3300 0.1 0 ZStack1 -738 6 2200 0.1 0 enSEE -738 7 3300 0.1 0 ZStack2 -738 8 -1 0.1 0 Off5 -738 9 3300 0.1 0 MiB3 -739 0 -1 0.1 0 Off1 -739 1 -1 0.1 0 Off2 -739 2 -1 0.1 0 Off3 -739 3 -1 0.1 0 Off4 -739 4 2750 0.1 1 MiB2 -739 5 3200 0.1 0 ZStack1 -739 6 2100 0.1 0 enSEE -739 7 3200 0.1 0 ZStack2 -739 8 -1 0.1 0 Off5 -739 9 3200 0.1 0 MiB3 -740 0 -1 0.1 0 Off1 -740 1 -1 0.1 0 Off2 -740 2 -1 0.1 0 Off3 -740 3 -1 0.1 0 Off4 -740 4 2750 0.1 1 MiB2 -740 5 3100 0.1 0 ZStack1 -740 6 2000 0.1 0 enSEE -740 7 3100 0.1 0 ZStack2 -740 8 -1 0.1 0 Off5 -740 9 3100 0.1 0 MiB3 -741 0 -1 0.1 0 Off1 -741 1 -1 0.1 0 Off2 -741 2 -1 0.1 0 Off3 -741 3 -1 0.1 0 Off4 -741 4 2750 0.1 1 MiB2 -741 5 3000 0.1 0 ZStack1 -741 6 1900 0.1 0 enSEE -741 7 3000 0.1 0 ZStack2 -741 8 -1 0.1 0 Off5 -741 9 3000 0.1 0 MiB3 -742 0 -1 0.1 0 Off1 -742 1 -1 0.1 0 Off2 -742 2 -1 0.1 0 Off3 -742 3 -1 0.1 0 Off4 -742 4 2750 0.1 1 MiB2 -742 5 2900 0.1 0 ZStack1 -742 6 1800 0.1 0 enSEE -742 7 2900 0.1 0 ZStack2 -742 8 -1 0.1 0 Off5 -742 9 2900 0.1 0 MiB3 -743 0 -1 0.1 0 Off1 -743 1 -1 0.1 0 Off2 -743 2 -1 0.1 0 Off3 -743 3 -1 0.1 0 Off4 -743 4 2750 0.1 1 MiB2 -743 5 2800 0.1 0 ZStack1 -743 6 1700 0.1 0 enSEE -743 7 2800 0.1 0 ZStack2 -743 8 -1 0.1 0 Off5 -743 9 2800 0.1 0 MiB3 -744 0 -1 0.1 0 Off1 -744 1 -1 0.1 0 Off2 -744 2 -1 0.1 0 Off3 -744 3 -1 0.1 0 Off4 -744 4 2750 0.1 1 MiB2 -744 5 2700 0.1 0 ZStack1 -744 6 1600 0.1 0 enSEE -744 7 2700 0.1 0 ZStack2 -744 8 -1 0.1 0 Off5 -744 9 2700 0.1 0 MiB3 -745 0 -1 0.1 0 Off1 -745 1 -1 0.1 0 Off2 -745 2 -1 0.1 0 Off3 -745 3 -1 0.1 0 Off4 -745 4 2750 0.1 1 MiB2 -745 5 2600 0.1 0 ZStack1 -745 6 1500 0.1 0 enSEE -745 7 2600 0.1 0 ZStack2 -745 8 -1 0.1 0 Off5 -745 9 2600 0.1 0 MiB3 -746 0 -1 0.1 0 Off1 -746 1 -1 0.1 0 Off2 -746 2 -1 0.1 0 Off3 -746 3 -1 0.1 0 Off4 -746 4 2750 0.1 1 MiB2 -746 5 2500 0.1 0 ZStack1 -746 6 1400 0.1 0 enSEE -746 7 2500 0.1 0 ZStack2 -746 8 -1 0.1 0 Off5 -746 9 2500 0.1 0 MiB3 -747 0 -1 0.1 0 Off1 -747 1 -1 0.1 0 Off2 -747 2 -1 0.1 0 Off3 -747 3 -1 0.1 0 Off4 -747 4 2750 0.1 1 MiB2 -747 5 2400 0.1 0 ZStack1 -747 6 1300 0.1 0 enSEE -747 7 2400 0.1 0 ZStack2 -747 8 -1 0.1 0 Off5 -747 9 2400 0.1 0 MiB3 -748 0 -1 0.1 0 Off1 -748 1 -1 0.1 0 Off2 -748 2 -1 0.1 0 Off3 -748 3 -1 0.1 0 Off4 -748 4 2750 0.1 1 MiB2 -748 5 2300 0.1 0 ZStack1 -748 6 1200 0.1 0 enSEE -748 7 2300 0.1 0 ZStack2 -748 8 -1 0.1 0 Off5 -748 9 2300 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan6.cfg b/TB/cfg/HVScan6.cfg deleted file mode 100644 index 62f18c4..0000000 --- a/TB/cfg/HVScan6.cfg +++ /dev/null @@ -1,111 +0,0 @@ -MiB2 MiB3 -749 0 -1 0.1 0 Off1 -749 1 -1 0.1 0 Off2 -749 2 -1 0.1 0 Off3 -749 3 -1 0.1 0 Off4 -749 4 2750 0.1 1 MiB2 -749 5 3300 0.1 0 ZStack1 -749 6 2200 0.1 0 enSEE -749 7 3300 0.1 0 ZStack2 -749 8 -1 0.1 0 Off5 -749 9 3300 0.1 0 MiB3 -750 0 -1 0.1 0 Off1 -750 1 -1 0.1 0 Off2 -750 2 -1 0.1 0 Off3 -750 3 -1 0.1 0 Off4 -750 4 2750 0.1 1 MiB2 -750 5 3200 0.1 0 ZStack1 -750 6 2100 0.1 0 enSEE -750 7 3200 0.1 0 ZStack2 -750 8 -1 0.1 0 Off5 -750 9 3200 0.1 0 MiB3 -751 0 -1 0.1 0 Off1 -751 1 -1 0.1 0 Off2 -751 2 -1 0.1 0 Off3 -751 3 -1 0.1 0 Off4 -751 4 2750 0.1 1 MiB2 -751 5 3100 0.1 0 ZStack1 -751 6 2000 0.1 0 enSEE -751 7 3100 0.1 0 ZStack2 -751 8 -1 0.1 0 Off5 -751 9 3100 0.1 0 MiB3 -752 0 -1 0.1 0 Off1 -752 1 -1 0.1 0 Off2 -752 2 -1 0.1 0 Off3 -752 3 -1 0.1 0 Off4 -752 4 2750 0.1 1 MiB2 -752 5 3000 0.1 0 ZStack1 -752 6 1900 0.1 0 enSEE -752 7 3000 0.1 0 ZStack2 -752 8 -1 0.1 0 Off5 -752 9 3000 0.1 0 MiB3 -753 0 -1 0.1 0 Off1 -753 1 -1 0.1 0 Off2 -753 2 -1 0.1 0 Off3 -753 3 -1 0.1 0 Off4 -753 4 2750 0.1 1 MiB2 -753 5 2900 0.1 0 ZStack1 -753 6 1800 0.1 0 enSEE -753 7 2900 0.1 0 ZStack2 -753 8 -1 0.1 0 Off5 -753 9 2900 0.1 0 MiB3 -754 0 -1 0.1 0 Off1 -754 1 -1 0.1 0 Off2 -754 2 -1 0.1 0 Off3 -754 3 -1 0.1 0 Off4 -754 4 2750 0.1 1 MiB2 -754 5 2800 0.1 0 ZStack1 -754 6 1700 0.1 0 enSEE -754 7 2800 0.1 0 ZStack2 -754 8 -1 0.1 0 Off5 -754 9 2800 0.1 0 MiB3 -755 0 -1 0.1 0 Off1 -755 1 -1 0.1 0 Off2 -755 2 -1 0.1 0 Off3 -755 3 -1 0.1 0 Off4 -755 4 2750 0.1 1 MiB2 -755 5 2700 0.1 0 ZStack1 -755 6 1600 0.1 0 enSEE -755 7 2700 0.1 0 ZStack2 -755 8 -1 0.1 0 Off5 -755 9 2700 0.1 0 MiB3 -758 0 -1 0.1 0 Off1 -758 1 -1 0.1 0 Off2 -758 2 -1 0.1 0 Off3 -758 3 -1 0.1 0 Off4 -758 4 2750 0.1 1 MiB2 -758 5 0 0.1 0 ZStack1 -758 6 0 0.1 0 enSEE -758 7 2600 0.1 0 ZStack2 -758 8 -1 0.1 0 Off5 -758 9 0 0.1 0 MiB3 -759 0 -1 0.1 0 Off1 -759 1 -1 0.1 0 Off2 -759 2 -1 0.1 0 Off3 -759 3 -1 0.1 0 Off4 -759 4 2750 0.1 1 MiB2 -759 5 0 0.1 0 ZStack1 -759 6 0 0.1 0 enSEE -759 7 2500 0.1 0 ZStack2 -759 8 -1 0.1 0 Off5 -759 9 0 0.1 0 MiB3 -760 0 -1 0.1 0 Off1 -760 1 -1 0.1 0 Off2 -760 2 -1 0.1 0 Off3 -760 3 -1 0.1 0 Off4 -760 4 2750 0.1 1 MiB2 -760 5 0 0.1 0 ZStack1 -760 6 0 0.1 0 enSEE -760 7 2400 0.1 0 ZStack2 -760 8 -1 0.1 0 Off5 -760 9 0 0.1 0 MiB3 -761 0 -1 0.1 0 Off1 -761 1 -1 0.1 0 Off2 -761 2 -1 0.1 0 Off3 -761 3 -1 0.1 0 Off4 -761 4 2750 0.1 1 MiB2 -761 5 0 0.1 0 ZStack1 -761 6 0 0.1 0 enSEE -761 7 2300 0.1 0 ZStack2 -761 8 -1 0.1 0 Off5 -761 9 0 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan7.cfg b/TB/cfg/HVScan7.cfg deleted file mode 100644 index 522d5bb..0000000 --- a/TB/cfg/HVScan7.cfg +++ /dev/null @@ -1,111 +0,0 @@ -MiB2 MiB3 -762 0 -1 0.1 0 Off1 -762 1 -1 0.1 0 Off2 -762 2 -1 0.1 0 Off3 -762 3 -1 0.1 0 Off4 -762 4 2750 0.1 1 MiB2 -762 5 2300 0.1 0 ZStack1 -762 6 1200 0.1 0 enSEE -762 7 2300 0.1 0 ZStack2 -762 8 -1 0.1 0 Off5 -762 9 2300 0.1 0 MiB3 -763 0 -1 0.1 0 Off1 -763 1 -1 0.1 0 Off2 -763 2 -1 0.1 0 Off3 -763 3 -1 0.1 0 Off4 -763 4 2750 0.1 1 MiB2 -763 5 2400 0.1 0 ZStack1 -763 6 1300 0.1 0 enSEE -763 7 2400 0.1 0 ZStack2 -763 8 -1 0.1 0 Off5 -763 9 2400 0.1 0 MiB3 -764 0 -1 0.1 0 Off1 -764 1 -1 0.1 0 Off2 -764 2 -1 0.1 0 Off3 -764 3 -1 0.1 0 Off4 -764 4 2750 0.1 1 MiB2 -764 5 2500 0.1 0 ZStack1 -764 6 1400 0.1 0 enSEE -764 7 2500 0.1 0 ZStack2 -764 8 -1 0.1 0 Off5 -764 9 2500 0.1 0 MiB3 -765 0 -1 0.1 0 Off1 -765 1 -1 0.1 0 Off2 -765 2 -1 0.1 0 Off3 -765 3 -1 0.1 0 Off4 -765 4 2750 0.1 1 MiB2 -765 5 2600 0.1 0 ZStack1 -765 6 1500 0.1 0 enSEE -765 7 2600 0.1 0 ZStack2 -765 8 -1 0.1 0 Off5 -765 9 2600 0.1 0 MiB3 -766 0 -1 0.1 0 Off1 -766 1 -1 0.1 0 Off2 -766 2 -1 0.1 0 Off3 -766 3 -1 0.1 0 Off4 -766 4 2750 0.1 1 MiB2 -766 5 2700 0.1 0 ZStack1 -766 6 1600 0.1 0 enSEE -766 7 2700 0.1 0 ZStack2 -766 8 -1 0.1 0 Off5 -766 9 2700 0.1 0 MiB3 -767 0 -1 0.1 0 Off1 -767 1 -1 0.1 0 Off2 -767 2 -1 0.1 0 Off3 -767 3 -1 0.1 0 Off4 -767 4 2750 0.1 1 MiB2 -767 5 2800 0.1 0 ZStack1 -767 6 1700 0.1 0 enSEE -767 7 2800 0.1 0 ZStack2 -767 8 -1 0.1 0 Off5 -767 9 2800 0.1 0 MiB3 -768 0 -1 0.1 0 Off1 -768 1 -1 0.1 0 Off2 -768 2 -1 0.1 0 Off3 -768 3 -1 0.1 0 Off4 -768 4 2750 0.1 1 MiB2 -768 5 2900 0.1 0 ZStack1 -768 6 1800 0.1 0 enSEE -768 7 2900 0.1 0 ZStack2 -768 8 -1 0.1 0 Off5 -768 9 2900 0.1 0 MiB3 -769 0 -1 0.1 0 Off1 -769 1 -1 0.1 0 Off2 -769 2 -1 0.1 0 Off3 -769 3 -1 0.1 0 Off4 -769 4 2750 0.1 1 MiB2 -769 5 3000 0.1 0 ZStack1 -769 6 1900 0.1 0 enSEE -769 7 3000 0.1 0 ZStack2 -769 8 -1 0.1 0 Off5 -769 9 3000 0.1 0 MiB3 -770 0 -1 0.1 0 Off1 -770 1 -1 0.1 0 Off2 -770 2 -1 0.1 0 Off3 -770 3 -1 0.1 0 Off4 -770 4 2750 0.1 1 MiB2 -770 5 3100 0.1 0 ZStack1 -770 6 2000 0.1 0 enSEE -770 7 3100 0.1 0 ZStack2 -770 8 -1 0.1 0 Off5 -770 9 3100 0.1 0 MiB3 -771 0 -1 0.1 0 Off1 -771 1 -1 0.1 0 Off2 -771 2 -1 0.1 0 Off3 -771 3 -1 0.1 0 Off4 -771 4 2750 0.1 1 MiB2 -771 5 3200 0.1 0 ZStack1 -771 6 2100 0.1 0 enSEE -771 7 3200 0.1 0 ZStack2 -771 8 -1 0.1 0 Off5 -771 9 3200 0.1 0 MiB3 -772 0 -1 0.1 0 Off1 -772 1 -1 0.1 0 Off2 -772 2 -1 0.1 0 Off3 -772 3 -1 0.1 0 Off4 -772 4 2750 0.1 1 MiB2 -772 5 3300 0.1 0 ZStack1 -772 6 2200 0.1 0 enSEE -772 7 3300 0.1 0 ZStack2 -772 8 -1 0.1 0 Off5 -772 9 3300 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/HVScan8.cfg b/TB/cfg/HVScan8.cfg deleted file mode 100644 index f62cc87..0000000 --- a/TB/cfg/HVScan8.cfg +++ /dev/null @@ -1,111 +0,0 @@ -MiB2 MiB3 -773 0 -1 0.1 0 Off1 -773 1 -1 0.1 0 Off2 -773 2 -1 0.1 0 Off3 -773 3 -1 0.1 0 Off4 -773 4 2750 0.1 1 MiB2 -773 5 3300 0.1 0 ZStack1 -773 6 2200 0.1 0 enSEE -773 7 3300 0.1 0 ZStack2 -773 8 -1 0.1 0 Off5 -773 9 3300 0.1 0 MiB3 -774 0 -1 0.1 0 Off1 -774 1 -1 0.1 0 Off2 -774 2 -1 0.1 0 Off3 -774 3 -1 0.1 0 Off4 -774 4 2750 0.1 1 MiB2 -774 5 3200 0.1 0 ZStack1 -774 6 2100 0.1 0 enSEE -774 7 3200 0.1 0 ZStack2 -774 8 -1 0.1 0 Off5 -774 9 3200 0.1 0 MiB3 -775 0 -1 0.1 0 Off1 -775 1 -1 0.1 0 Off2 -775 2 -1 0.1 0 Off3 -775 3 -1 0.1 0 Off4 -775 4 2750 0.1 1 MiB2 -775 5 3100 0.1 0 ZStack1 -775 6 2000 0.1 0 enSEE -775 7 3100 0.1 0 ZStack2 -775 8 -1 0.1 0 Off5 -775 9 3100 0.1 0 MiB3 -776 0 -1 0.1 0 Off1 -776 1 -1 0.1 0 Off2 -776 2 -1 0.1 0 Off3 -776 3 -1 0.1 0 Off4 -776 4 2750 0.1 1 MiB2 -776 5 3000 0.1 0 ZStack1 -776 6 1900 0.1 0 enSEE -776 7 3000 0.1 0 ZStack2 -776 8 -1 0.1 0 Off5 -776 9 3000 0.1 0 MiB3 -777 0 -1 0.1 0 Off1 -777 1 -1 0.1 0 Off2 -777 2 -1 0.1 0 Off3 -777 3 -1 0.1 0 Off4 -777 4 2750 0.1 1 MiB2 -777 5 2900 0.1 0 ZStack1 -777 6 1800 0.1 0 enSEE -777 7 2900 0.1 0 ZStack2 -777 8 -1 0.1 0 Off5 -777 9 2900 0.1 0 MiB3 -778 0 -1 0.1 0 Off1 -778 1 -1 0.1 0 Off2 -778 2 -1 0.1 0 Off3 -778 3 -1 0.1 0 Off4 -778 4 2750 0.1 1 MiB2 -778 5 2800 0.1 0 ZStack1 -778 6 1700 0.1 0 enSEE -778 7 2800 0.1 0 ZStack2 -778 8 -1 0.1 0 Off5 -778 9 2800 0.1 0 MiB3 -779 0 -1 0.1 0 Off1 -779 1 -1 0.1 0 Off2 -779 2 -1 0.1 0 Off3 -779 3 -1 0.1 0 Off4 -779 4 2750 0.1 1 MiB2 -779 5 2700 0.1 0 ZStack1 -779 6 1600 0.1 0 enSEE -779 7 2700 0.1 0 ZStack2 -779 8 -1 0.1 0 Off5 -779 9 2700 0.1 0 MiB3 -780 0 -1 0.1 0 Off1 -780 1 -1 0.1 0 Off2 -780 2 -1 0.1 0 Off3 -780 3 -1 0.1 0 Off4 -780 4 2750 0.1 1 MiB2 -780 5 2600 0.1 0 ZStack1 -780 6 1500 0.1 0 enSEE -780 7 2600 0.1 0 ZStack2 -780 8 -1 0.1 0 Off5 -780 9 2600 0.1 0 MiB3 -781 0 -1 0.1 0 Off1 -781 1 -1 0.1 0 Off2 -781 2 -1 0.1 0 Off3 -781 3 -1 0.1 0 Off4 -781 4 2750 0.1 1 MiB2 -781 5 2500 0.1 0 ZStack1 -781 6 1400 0.1 0 enSEE -781 7 2500 0.1 0 ZStack2 -781 8 -1 0.1 0 Off5 -781 9 2500 0.1 0 MiB3 -782 0 -1 0.1 0 Off1 -782 1 -1 0.1 0 Off2 -782 2 -1 0.1 0 Off3 -782 3 -1 0.1 0 Off4 -782 4 2750 0.1 1 MiB2 -782 5 2400 0.1 0 ZStack1 -782 6 1300 0.1 0 enSEE -782 7 2400 0.1 0 ZStack2 -782 8 -1 0.1 0 Off5 -782 9 2400 0.1 0 MiB3 -783 0 -1 0.1 0 Off1 -783 1 -1 0.1 0 Off2 -783 2 -1 0.1 0 Off3 -783 3 -1 0.1 0 Off4 -783 4 2750 0.1 1 MiB2 -783 5 2300 0.1 0 ZStack1 -783 6 1200 0.1 0 enSEE -783 7 2300 0.1 0 ZStack2 -783 8 -1 0.1 0 Off5 -783 9 2300 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/README.md b/TB/cfg/README.md deleted file mode 100644 index 2d34bcd..0000000 --- a/TB/cfg/README.md +++ /dev/null @@ -1,12 +0,0 @@ -####### instruction to create the cfg file ########### - -The .cfg file given in input to read raw data must have: - -- a first row with the name of the two MCPs used as trigger: the 1st one SHOULD BE the MCP used for the time measurement - -- then, many rows with the following sintax: - 247 0 2500 0.1 1 MiB1 -where 247=run number, 0=channel number, 2500=HV, 0.1=X0, 1=PC ON (0=OFF), MiB1=MCP name (should match the names saved in src/MCPMap.cc) -for each run, there must be exactly n rows, where n=number of channel in input (from the digitizer). Then, n rows for the next run, etc.. - -for example, look at Scan2.cfg. \ No newline at end of file diff --git a/TB/cfg/pedestal.cfg b/TB/cfg/pedestal.cfg deleted file mode 100644 index a81fa20..0000000 --- a/TB/cfg/pedestal.cfg +++ /dev/null @@ -1,11 +0,0 @@ -MiB2 MiB3 -726 0 -1 0.1 0 Off1 -726 1 -1 0.1 0 Off2 -726 2 -1 0.1 0 Off3 -726 3 -1 0.1 0 Off4 -726 4 2750 0.1 1 MiB2 -726 5 2200 0.1 0 ZStack1 -726 6 1200 0.1 0 enSEE -726 7 2200 0.1 0 ZStack2 -726 8 -1 0.1 0 Off5 -726 9 2200 0.1 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/preshower_600GeV_HighV.cfg b/TB/cfg/preshower_600GeV_HighV.cfg deleted file mode 100644 index 79c514e..0000000 --- a/TB/cfg/preshower_600GeV_HighV.cfg +++ /dev/null @@ -1,51 +0,0 @@ -MiB2 MiB3 -658 0 600 20 1 Off1 -658 1 600 20 1 Off2 -658 2 600 20 1 Off3 -658 3 600 20 1 Off4 -658 4 2750 20 1 MiB2 -658 5 2600 20 1 ZStack1 -658 6 2200 20 0 enSEE -658 7 3200 20 0 ZStack2 -658 8 -1 20 0 Off5 -658 9 3100 20 1 MiB3 -661 0 600 50 1 Off1 -661 1 600 50 1 Off2 -661 2 600 50 1 Off3 -661 3 600 50 1 Off4 -661 4 2750 50 1 MiB2 -661 5 2600 50 1 ZStack1 -661 6 2200 50 0 enSEE -661 7 3200 50 0 ZStack2 -661 8 -1 50 0 Off5 -661 9 3100 50 1 MiB3 -662 0 600 100 1 Off1 -662 1 600 100 1 Off2 -662 2 600 100 1 Off3 -662 3 600 100 1 Off4 -662 4 2750 100 1 MiB2 -662 5 2600 100 1 ZStack1 -662 6 2200 100 0 enSEE -662 7 3200 100 0 ZStack2 -662 8 -1 100 0 Off5 -662 9 3100 100 1 MiB3 -665 0 600 150 1 Off1 -665 1 600 150 1 Off2 -665 2 600 150 1 Off3 -665 3 600 150 1 Off4 -665 4 2750 150 1 MiB2 -665 5 2600 150 1 ZStack1 -665 6 2200 150 0 enSEE -665 7 3200 150 0 ZStack2 -665 8 -1 150 0 Off5 -665 9 3100 150 1 MiB3 -666 0 600 200 1 Off1 -666 1 600 200 1 Off2 -666 2 600 200 1 Off3 -666 3 600 200 1 Off4 -666 4 2750 200 1 MiB2 -666 5 2600 200 1 ZStack1 -666 6 2200 200 0 enSEE -666 7 3200 200 0 ZStack2 -666 8 -1 200 0 Off5 -666 9 3100 200 1 MiB3 \ No newline at end of file diff --git a/TB/cfg/scanX0_HVHigh20GeV.cfg b/TB/cfg/scanX0_HVHigh20GeV.cfg deleted file mode 100644 index 50ec062..0000000 --- a/TB/cfg/scanX0_HVHigh20GeV.cfg +++ /dev/null @@ -1,71 +0,0 @@ -MiB2 MiB3 -813 0 -1 0 0 Off1 -813 1 -1 0 0 Off2 -813 2 -1 0 0 Off3 -813 3 -1 0 0 Off4 -813 4 2750 0 1 MiB2 -813 5 3200 0 0 ZStack1 -813 6 2200 0 0 enSEE -813 7 3200 0 0 ZStack2 -813 8 -1 0 0 Off5 -813 9 3200 0 0 MiB3 -810 0 -1 1 0 Off1 -810 1 -1 1 0 Off2 -810 2 -1 1 0 Off3 -810 3 -1 1 0 Off4 -810 4 2750 1 1 MiB2 -810 5 3200 1 0 ZStack1 -810 6 2200 1 0 enSEE -810 7 3200 1 0 ZStack2 -810 8 -1 1 0 Off5 -810 9 3200 1 0 MiB3 -809 0 -1 2 0 Off1 -809 1 -1 2 0 Off2 -809 2 -1 2 0 Off3 -809 3 -1 2 0 Off4 -809 4 2750 2 1 MiB2 -809 5 3200 2 0 ZStack1 -809 6 2200 2 0 enSEE -809 7 3200 2 0 ZStack2 -809 8 -1 2 0 Off5 -809 9 3200 2 0 MiB3 -806 0 -1 3 0 Off1 -806 1 -1 3 0 Off2 -806 2 -1 3 0 Off3 -806 3 -1 3 0 Off4 -806 4 2750 3 1 MiB2 -806 5 3200 3 0 ZStack1 -806 6 2200 3 0 enSEE -806 7 3200 3 0 ZStack2 -806 8 -1 3 0 Off5 -806 9 3200 3 0 MiB3 -805 0 -1 4 0 Off1 -805 1 -1 4 0 Off2 -805 2 -1 4 0 Off3 -805 3 -1 4 0 Off4 -805 4 2750 4 1 MiB2 -805 5 3200 4 0 ZStack1 -805 6 2200 4 0 enSEE -805 7 3200 4 0 ZStack2 -805 8 -1 4 0 Off5 -805 9 3200 4 0 MiB3 -801 0 -1 5 0 Off1 -801 1 -1 5 0 Off2 -801 2 -1 5 0 Off3 -801 3 -1 5 0 Off4 -801 4 2750 5 1 MiB2 -801 5 3200 5 0 ZStack1 -801 6 2200 5 0 enSEE -801 7 3200 5 0 ZStack2 -801 8 -1 5 0 Off5 -801 9 3200 5 0 MiB3 -814 0 -1 7 0 Off1 -814 1 -1 7 0 Off2 -814 2 -1 7 0 Off3 -814 3 -1 7 0 Off4 -814 4 2750 7 1 MiB2 -814 5 3200 7 0 ZStack1 -814 6 2200 7 0 enSEE -814 7 3200 7 0 ZStack2 -814 8 -1 7 0 Off5 -814 9 3200 7 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/scanX0_HVHigh50GeV.cfg b/TB/cfg/scanX0_HVHigh50GeV.cfg deleted file mode 100644 index c15feab..0000000 --- a/TB/cfg/scanX0_HVHigh50GeV.cfg +++ /dev/null @@ -1,61 +0,0 @@ -MiB2 MiB3 -749 0 -1 0 0 Off1 -749 1 -1 0 0 Off2 -749 2 -1 0 0 Off3 -749 3 -1 0 0 Off4 -749 4 2750 0 1 MiB2 -749 5 3300 0 0 ZStack1 -749 6 2200 0 0 enSEE -749 7 3300 0 0 ZStack2 -749 8 -1 0 0 Off5 -749 9 3300 0 0 MiB3 -792 0 -1 1 0 Off1 -792 1 -1 1 0 Off2 -792 2 -1 1 0 Off3 -792 3 -1 1 0 Off4 -792 4 2750 1 1 MiB2 -792 5 3200 1 0 ZStack1 -792 6 2200 1 0 enSEE -792 7 3200 1 0 ZStack2 -792 8 -1 1 0 Off5 -792 9 3200 1 0 MiB3 -793 0 -1 2 0 Off1 -793 1 -1 2 0 Off2 -793 2 -1 2 0 Off3 -793 3 -1 2 0 Off4 -793 4 2750 2 1 MiB2 -793 5 3200 2 0 ZStack1 -793 6 2200 2 0 enSEE -793 7 3200 2 0 ZStack2 -793 8 -1 2 0 Off5 -793 9 3200 2 0 MiB3 -796 0 -1 3 0 Off1 -796 1 -1 3 0 Off2 -796 2 -1 3 0 Off3 -796 3 -1 3 0 Off4 -796 4 2750 3 1 MiB2 -796 5 3200 3 0 ZStack1 -796 6 2200 3 0 enSEE -796 7 3200 3 0 ZStack2 -796 8 -1 3 0 Off5 -796 9 3200 3 0 MiB3 -797 0 -1 4 0 Off1 -797 1 -1 4 0 Off2 -797 2 -1 4 0 Off3 -797 3 -1 4 0 Off4 -797 4 2750 4 1 MiB2 -797 5 3200 4 0 ZStack1 -797 6 2200 4 0 enSEE -797 7 3200 4 0 ZStack2 -797 8 -1 4 0 Off5 -797 9 3200 4 0 MiB3 -800 0 -1 5 0 Off1 -800 1 -1 5 0 Off2 -800 2 -1 5 0 Off3 -800 3 -1 5 0 Off4 -800 4 2750 5 1 MiB2 -800 5 3200 5 0 ZStack1 -800 6 2200 5 0 enSEE -800 7 3200 5 0 ZStack2 -800 8 -1 5 0 Off5 -800 9 3200 5 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/scanX0_HVLow20GeV.cfg b/TB/cfg/scanX0_HVLow20GeV.cfg deleted file mode 100644 index ac127d5..0000000 --- a/TB/cfg/scanX0_HVLow20GeV.cfg +++ /dev/null @@ -1,71 +0,0 @@ -MiB2 MiB3 -812 0 -1 0 0 Off1 -812 1 -1 0 0 Off2 -812 2 -1 0 0 Off3 -812 3 -1 0 0 Off4 -812 4 2750 0 1 MiB2 -812 5 3000 0 0 ZStack1 -812 6 1900 0 0 enSEE -812 7 3000 0 0 ZStack2 -812 8 -1 0 0 Off5 -812 9 3000 0 0 MiB3 -811 0 -1 1 0 Off1 -811 1 -1 1 0 Off2 -811 2 -1 1 0 Off3 -811 3 -1 1 0 Off4 -811 4 2750 1 1 MiB2 -811 5 3000 1 0 ZStack1 -811 6 1900 1 0 enSEE -811 7 3000 1 0 ZStack2 -811 8 -1 1 0 Off5 -811 9 3000 1 0 MiB3 -808 0 -1 2 0 Off1 -808 1 -1 2 0 Off2 -808 2 -1 2 0 Off3 -808 3 -1 2 0 Off4 -808 4 2750 2 1 MiB2 -808 5 3000 2 0 ZStack1 -808 6 1900 2 0 enSEE -808 7 3000 2 0 ZStack2 -808 8 -1 2 0 Off5 -808 9 3000 2 0 MiB3 -807 0 -1 3 0 Off1 -807 1 -1 3 0 Off2 -807 2 -1 3 0 Off3 -807 3 -1 3 0 Off4 -807 4 2750 3 1 MiB2 -807 5 3000 3 0 ZStack1 -807 6 1900 3 0 enSEE -807 7 3000 3 0 ZStack2 -807 8 -1 3 0 Off5 -807 9 3000 3 0 MiB3 -803 0 -1 4 0 Off1 -803 1 -1 4 0 Off2 -803 2 -1 4 0 Off3 -803 3 -1 4 0 Off4 -803 4 2750 4 1 MiB2 -803 5 3000 4 0 ZStack1 -803 6 1900 4 0 enSEE -803 7 3000 4 0 ZStack2 -803 8 -1 4 0 Off5 -803 9 3000 4 0 MiB3 -802 0 -1 5 0 Off1 -802 1 -1 5 0 Off2 -802 2 -1 5 0 Off3 -802 3 -1 5 0 Off4 -802 4 2750 5 1 MiB2 -802 5 3000 5 0 ZStack1 -802 6 1900 5 0 enSEE -802 7 3000 5 0 ZStack2 -802 8 -1 5 0 Off5 -802 9 3000 5 0 MiB3 -815 0 -1 7 0 Off1 -815 1 -1 7 0 Off2 -815 2 -1 7 0 Off3 -815 3 -1 7 0 Off4 -815 4 2750 7 1 MiB2 -815 5 3000 7 0 ZStack1 -815 6 1900 7 0 enSEE -815 7 3000 7 0 ZStack2 -815 8 -1 7 0 Off5 -815 9 3000 7 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/scanX0_HVLow50GeV.cfg b/TB/cfg/scanX0_HVLow50GeV.cfg deleted file mode 100644 index d76ed48..0000000 --- a/TB/cfg/scanX0_HVLow50GeV.cfg +++ /dev/null @@ -1,71 +0,0 @@ -MiB2 MiB3 -752 0 -1 0 0 Off1 -752 1 -1 0 0 Off2 -752 2 -1 0 0 Off3 -752 3 -1 0 0 Off4 -752 4 2750 0 1 MiB2 -752 5 3000 0 0 ZStack1 -752 6 1900 0 0 enSEE -752 7 3000 0 0 ZStack2 -752 8 -1 0 0 Off5 -752 9 3000 0 0 MiB3 -790 0 -1 1 0 Off1 -790 1 -1 1 0 Off2 -790 2 -1 1 0 Off3 -790 3 -1 1 0 Off4 -790 4 2750 1 1 MiB2 -790 5 3000 1 0 ZStack1 -790 6 1900 1 0 enSEE -790 7 3000 1 0 ZStack2 -790 8 -1 1 0 Off5 -790 9 3000 1 0 MiB3 -791 0 -1 1 0 Off1 -791 1 -1 1 0 Off2 -791 2 -1 1 0 Off3 -791 3 -1 1 0 Off4 -791 4 2750 1 1 MiB2 -791 5 3000 1 0 ZStack1 -791 6 1900 1 0 enSEE -791 7 3000 1 0 ZStack2 -791 8 -1 1 0 Off5 -791 9 3000 1 0 MiB3 -794 0 -1 2 0 Off1 -794 1 -1 2 0 Off2 -794 2 -1 2 0 Off3 -794 3 -1 2 0 Off4 -794 4 2750 2 1 MiB2 -794 5 3000 2 0 ZStack1 -794 6 1900 2 0 enSEE -794 7 3000 2 0 ZStack2 -794 8 -1 2 0 Off5 -794 9 3000 2 0 MiB3 -795 0 -1 3 0 Off1 -795 1 -1 3 0 Off2 -795 2 -1 3 0 Off3 -795 3 -1 3 0 Off4 -795 4 2750 3 1 MiB2 -795 5 3000 3 0 ZStack1 -795 6 1900 3 0 enSEE -795 7 3000 3 0 ZStack2 -795 8 -1 3 0 Off5 -795 9 3000 3 0 MiB3 -798 0 -1 4 0 Off1 -798 1 -1 4 0 Off2 -798 2 -1 4 0 Off3 -798 3 -1 4 0 Off4 -798 4 2750 4 1 MiB2 -798 5 3000 4 0 ZStack1 -798 6 1900 4 0 enSEE -798 7 3000 4 0 ZStack2 -798 8 -1 4 0 Off5 -798 9 3000 4 0 MiB3 -799 0 -1 5 0 Off1 -799 1 -1 5 0 Off2 -799 2 -1 5 0 Off3 -799 3 -1 5 0 Off4 -799 4 2750 5 1 MiB2 -799 5 3000 5 0 ZStack1 -799 6 1900 5 0 enSEE -799 7 3000 5 0 ZStack2 -799 8 -1 5 0 Off5 -799 9 3000 5 0 MiB3 \ No newline at end of file diff --git a/TB/cfg/treshold_3s.txt b/TB/cfg/treshold_3s.txt deleted file mode 100644 index 4cc41a9..0000000 --- a/TB/cfg/treshold_3s.txt +++ /dev/null @@ -1,10 +0,0 @@ -0 120 -1 100 -2 107 -3 110 -4 75 -5 0 -6 0 -7 0 -8 0 -9 0 diff --git a/TB/cfg/treshold_5s.txt b/TB/cfg/treshold_5s.txt deleted file mode 100644 index 4d41fda..0000000 --- a/TB/cfg/treshold_5s.txt +++ /dev/null @@ -1,10 +0,0 @@ -0 200 -1 168 -2 179 -3 184 -4 125 -5 0 -6 0 -7 0 -8 0 -9 0 diff --git a/TB/cfg/treshold_SB1000.txt b/TB/cfg/treshold_SB1000.txt deleted file mode 100644 index cc07a6d..0000000 --- a/TB/cfg/treshold_SB1000.txt +++ /dev/null @@ -1,10 +0,0 @@ -0 110 -1 153 -2 335 -3 164 -4 110 -5 -1 -6 -1 -7 -1 -8 -1 -9 -1 diff --git a/TB/interface/init_Reco_Tree.h b/TB/interface/init_Reco_Tree.h deleted file mode 100644 index b2f18bf..0000000 --- a/TB/interface/init_Reco_Tree.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef __init_Reco_Tree__ -#define __init_Reco_Tree__ - -#include "TTree.h" -#include "TChain.h" - -// Declaration of leaf types -extern int event; -extern float time_CF[11]; -extern float time_CF_corr[11]; -extern float time_CF30[11]; -extern float time_OT[11]; -extern float time_start[11]; -extern float time_stop[11]; -extern float time_start_1000[11]; -extern float time_stop_1000[11]; -extern float time_start_150[11]; -extern float time_stop_150[11]; -extern float time_start_200[11]; -extern float time_stop_200[11]; -extern float time_start_500[11]; -extern float time_stop_500[11]; -extern float time_start_300[11]; -extern float time_stop_300[11]; -extern float time_Max[11]; -extern float amp_max[11]; -extern float amp_max_corr[11]; -extern float amp_max_time[11]; -extern float charge[11]; -extern float charge_corr[11]; -extern float baseline[11]; -extern int run_id; -extern int isPCOn[11]; -extern int HV[11]; -extern int isTrigger[11]; -extern float X0; -extern float tdcX; -extern float tdcY; -extern bool hodoX1[64]; -extern bool hodoY1[64]; -extern bool hodoX2[64]; -extern bool hodoY2[64]; -extern int nhodoX1; -extern int nhodoX2; -extern int nhodoY1; -extern int nhodoY2; -/* -extern int fibreX[8]; -extern int fibreY[8]; -extern int sci_front_adc; -*/ - -// List of branches -extern TBranch *b_event; -extern TBranch *b_time_CF; //! -extern TBranch *b_time_CF_corr; //! -extern TBranch *b_time_CF30; //! -extern TBranch *b_time_OT; //! -extern TBranch *b_time_start; -extern TBranch *b_time_stop; -extern TBranch *b_time_start_1000; -extern TBranch *b_time_stop_1000; -extern TBranch *b_time_start_150; -extern TBranch *b_time_stop_150; -extern TBranch *b_time_start_200; -extern TBranch *b_time_stop_200; -extern TBranch *b_time_start_500; -extern TBranch *b_time_stop_500; -extern TBranch *b_time_start_300; -extern TBranch *b_time_stop_300; -extern TBranch *b_time_Max; //! -extern TBranch *b_amp_max; //! -extern TBranch *b_amp_max_corr; //! -extern TBranch *b_amp_max_time; //! -extern TBranch *b_baseline; //! -extern TBranch *b_charge; //! -extern TBranch *b_charge_corr; //! -extern TBranch *b_run_id; //! -extern TBranch *b_isPCOn; //! -extern TBranch *b_HV; //! -extern TBranch *b_isTrigger; -extern TBranch *b_X0; -extern TBranch *b_tdcX; -extern TBranch *b_tdcY; -extern TBranch *b_hodoX1; -extern TBranch *b_hodoY1; -extern TBranch *b_hodoX2; -extern TBranch *b_hodoY2; -extern TBranch *b_nhodoX1; -extern TBranch *b_nhodoY1; -extern TBranch *b_nhodoX2; -extern TBranch *b_nhodoY2; -/* -extern TBranch *b_fibreX; //! -extern TBranch *b_fibreY; //! -extern TBranch *b_sci_front_adc; //! -*/ - -void InitRecoTree(TTree* nt); - -void init(); - -void SetOutTree(TTree* outTree); - -#endif diff --git a/TB/python/drawEfficiency.py b/TB/python/drawEfficiency.py deleted file mode 100644 index 2b1b47a..0000000 --- a/TB/python/drawEfficiency.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -import sys -import os -import commands -from commands import getstatusoutput -import datetime -import argparse -import string -if __name__ == '__main__': - os.system('./drawEfficiency.exe HVScan') - os.system('./drawEfficiency.exe scanX0_HVHigh_50') - os.system('./drawEfficiency.exe scanX0_HVHigh_20') - os.system('./drawEfficiency.exe scanX0_HVLow_50') - os.system('./drawEfficiency.exe scanX0_HVLow_20') - os.system('./drawEfficiency.exe AngScanLow') - os.system('./drawEfficiency.exe AngScanHigh') - - diff --git a/TB/python/drawResolutionCFD.py b/TB/python/drawResolutionCFD.py deleted file mode 100644 index e5e498f..0000000 --- a/TB/python/drawResolutionCFD.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python -import sys -import os -import commands -from commands import getstatusoutput -import datetime -import argparse -import string -if __name__ == '__main__': - os.system('./drawResolutionCFD.exe HVScanON') - os.system('./drawResolutionCFD.exe HVScanOFF') - os.system('./drawResolutionCFD.exe scanX0_HVHigh_50') - os.system('./drawResolutionCFD.exe scanX0_HVHigh_20') - os.system('./drawResolutionCFD.exe scanX0_HVLow_50') - os.system('./drawResolutionCFD.exe scanX0_HVLow_20') - os.system('./drawResolutionCFD.exe AngScanLow') - os.system('./drawResolutionCFD.exe AngScanHigh') - - diff --git a/TB/python/drawWaveform.py b/TB/python/drawWaveform.py deleted file mode 100755 index d455378..0000000 --- a/TB/python/drawWaveform.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python -import sys -import os -import commands -from commands import getstatusoutput -import datetime -import argparse -import string -if __name__ == '__main__': - parser = argparse.ArgumentParser (description = 'draw waveform: read raw data and draw some waveforms') - parser.add_argument ('-d', '--dir' , default = '/gwteray/users/brianza/iMCP_H4', help='directory containing raw data') - parser.add_argument ('-r', '--run' , default = '744', help='run to scan') - parser.add_argument ('-c', '--channel' , default = '4', help='channel to analyze') - parser.add_argument ('-f', '--firstEntry' , default = '0', help='first entry') - parser.add_argument ('-n', '--nEvents' , default = '100', help='number of events to analyze') - args = parser.parse_args () - print './drawWaveform '+args.dir+' '+args.run+' '+args.channel+' '+args.firstEntry+' '+args.nEvents - os.system('./drawWaveform.exe '+args.dir+' '+args.run+' '+args.channel+' '+args.firstEntry+' '+args.nEvents) - diff --git a/TB/python/prodNtuple.py b/TB/python/prodNtuple.py deleted file mode 100755 index a51240d..0000000 --- a/TB/python/prodNtuple.py +++ /dev/null @@ -1,28 +0,0 @@ -#! /usr/bin/env python -import os -import glob -import math -from array import array -import sys -import time -import subprocess - -currentDir = os.getcwd(); -CMSSWDir = currentDir+"../../"; - -name = ["HVScan1","HVScan2","HVScan3","HVScan4","HVScan5","HVScan6","HVScan7","HVScan8","AngScan_HVHigh","AngScan_HVLow","pedestal","preshower_600GeV_HighV","scanX0_HVHigh20GeV","scanX0_HVHigh50GeV","scanX0_HVLow20GeV","scanX0_HVLow50GeV","H4test_X0scan_HVH_20GeV", "H4test_X0scan_HVH_50GeV", "H4test_X0scan_HVL_20GeV", "H4test_X0scan_HVL_50GeV"]; - -for i in range(len(name)): - fn = "Job/Job_"+name[i]; - outScript = open(fn+".sh","w"); - command = "python python/dumper.py -cfg cfg/"+name[i]+".cfg -n "+name[i]; - - outScript.write('#!/bin/bash'); - outScript.write("\n"+'cd '+CMSSWDir); - outScript.write("\n"+'eval `scram runtime -sh`'); - outScript.write("\n"+'cd '+currentDir); - outScript.write("\n"+"unbuffer "+command+" > "+fn+"_output.txt"); - outScript.close(); - - os.system("chmod 777 "+currentDir+"/"+fn+".sh"); - os.system("qsub -V -d "+currentDir+" -q longcms "+currentDir+"/"+fn+".sh"); diff --git a/TB/script/runAllEff.sh b/TB/script/runAllEff.sh deleted file mode 100644 index 6f9d511..0000000 --- a/TB/script/runAllEff.sh +++ /dev/null @@ -1,31 +0,0 @@ -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n HVScan1 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n HVScan5 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n HVScan6 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n HVScan7 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n HVScan8 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a eff -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a eff -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a eff -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a eff -n AngScan_HVHigh -s X0 diff --git a/TB/script/runAllTime.sh b/TB/script/runAllTime.sh deleted file mode 100644 index 225a981..0000000 --- a/TB/script/runAllTime.sh +++ /dev/null @@ -1,41 +0,0 @@ -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n HVScan1 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n HVScan5 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n HVScan6 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n HVScan7 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n HVScan8 -s HV - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a time -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n scanX0_HVHigh50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a time -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n scanX0_HVHigh20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a time -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n scanX0_HVLow20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a time -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n scanX0_HVLow50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n AngScan_HVLow -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a time -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a time -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a time -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a time -n AngScan_HVHigh -s X0 diff --git a/TB/script/runAllTimeCFD.sh b/TB/script/runAllTimeCFD.sh deleted file mode 100644 index 9d68b82..0000000 --- a/TB/script/runAllTimeCFD.sh +++ /dev/null @@ -1,41 +0,0 @@ -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n HVScan1 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n HVScan5 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n HVScan6 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n HVScan7 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n HVScan8 -s HV - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeCFD -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n scanX0_HVHigh50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeCFD -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n scanX0_HVHigh20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeCFD -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n scanX0_HVLow20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeCFD -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n scanX0_HVLow50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n AngScan_HVLow -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeCFD -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeCFD -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeCFD -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeCFD -n AngScan_HVHigh -s X0 diff --git a/TB/script/runAllTimeLED.sh b/TB/script/runAllTimeLED.sh deleted file mode 100644 index 9f63828..0000000 --- a/TB/script/runAllTimeLED.sh +++ /dev/null @@ -1,41 +0,0 @@ -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n HVScan1 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n HVScan2 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n HVScan5 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n HVScan6 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n HVScan7 -s HV -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n HVScan8 -s HV - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeLED -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n scanX0_HVHigh50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n scanX0_HVHigh50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeLED -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n scanX0_HVHigh20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n scanX0_HVHigh20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeLED -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n scanX0_HVLow20GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n scanX0_HVLow20GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB2 -a timeLED -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n scanX0_HVLow50GeV -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n scanX0_HVLow50GeV -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n AngScan_HVLow -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n AngScan_HVLow -s X0 - -python python/analyzer.py -cfg cfg/treshold_5s.txt -m enSEE -a timeLED -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack1 -a timeLED -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m ZStack2 -a timeLED -n AngScan_HVHigh -s X0 -python python/analyzer.py -cfg cfg/treshold_5s.txt -m MiB3 -a timeLED -n AngScan_HVHigh -s X0 diff --git a/TB/src/MCPMap.cc b/TB/src/MCPMap.cc deleted file mode 100644 index 99dc7b3..0000000 --- a/TB/src/MCPMap.cc +++ /dev/null @@ -1,34 +0,0 @@ -#include "../interface/MCPMap.h" - -std::map MCPList; -std::map inverted_MCPList; - -void Fill_MCPList (void) - { - MCPList.insert(std::make_pair("MiB2",0)); - MCPList.insert(std::make_pair("ZStack1",1)); - MCPList.insert(std::make_pair("enSEE",2)); - MCPList.insert(std::make_pair("ZStack2",3)); - MCPList.insert(std::make_pair("MiB3",4)); - MCPList.insert(std::make_pair("Off1",5)); - MCPList.insert(std::make_pair("Off2",6)); - MCPList.insert(std::make_pair("Off3",7)); - MCPList.insert(std::make_pair("Off4",8)); - MCPList.insert(std::make_pair("trig1",9)); - MCPList.insert(std::make_pair("trig2",10)); - } - -void Fill_inverted_MCPList (void) - { - inverted_MCPList.insert(std::make_pair(0,"MiB2")); - inverted_MCPList.insert(std::make_pair(1,"ZStack1")); - inverted_MCPList.insert(std::make_pair(2,"enSEE")); - inverted_MCPList.insert(std::make_pair(3,"ZStack2")); - inverted_MCPList.insert(std::make_pair(4,"MiB3")); - inverted_MCPList.insert(std::make_pair(5,"Off1")); - inverted_MCPList.insert(std::make_pair(6,"Off2")); - inverted_MCPList.insert(std::make_pair(7,"Off3")); - inverted_MCPList.insert(std::make_pair(8,"Off4")); - inverted_MCPList.insert(std::make_pair(9,"trig1")); - inverted_MCPList.insert(std::make_pair(10,"trig2")); - } diff --git a/TB/src/init_Reco_Tree.cc b/TB/src/init_Reco_Tree.cc deleted file mode 100644 index 4f9c652..0000000 --- a/TB/src/init_Reco_Tree.cc +++ /dev/null @@ -1,202 +0,0 @@ -#include "../interface/init_Reco_Tree.h" - -int event; -float time_CF[11]; -float time_CF_corr[11]; -float time_CF30[11]; -float time_OT[11]; -float time_start[11]; -float time_stop[11]; -float time_start_1000[11]; -float time_stop_1000[11]; -float time_start_150[11]; -float time_stop_150[11]; -float time_start_200[11]; -float time_stop_200[11]; -float time_start_500[11]; -float time_stop_500[11]; -float time_start_300[11]; -float time_stop_300[11]; -float time_Max[11]; -float amp_max[11]; -float amp_max_corr[11]; -float amp_max_time[11]; -float charge[11]; -float charge_corr[11]; -float baseline[11]; -/*int fibreX[8]; -int fibreY[8]; -int sci_front_adc; -*/ -int run_id; -int isPCOn[11]; -int HV[11]; -int isTrigger[11]; -float X0; -float tdcX; -float tdcY; -bool hodoX1[64]; -bool hodoY1[64]; -bool hodoX2[64]; -bool hodoY2[64]; -int nhodoX1; -int nhodoX2; -int nhodoY1; -int nhodoY2; - -// List of branches -TBranch *b_event; -TBranch *b_time_CF; //! -TBranch *b_time_CF_corr; //! -TBranch *b_time_CF30; //! -TBranch *b_time_OT; //! -TBranch *b_time_start; -TBranch *b_time_stop; -TBranch *b_time_start_1000; -TBranch *b_time_stop_1000; -TBranch *b_time_start_150; -TBranch *b_time_stop_150; -TBranch *b_time_start_200; -TBranch *b_time_stop_200; -TBranch *b_time_start_500; -TBranch *b_time_stop_500; -TBranch *b_time_start_300; -TBranch *b_time_stop_300; -TBranch *b_time_Max; //! -TBranch *b_amp_max; //! -TBranch *b_amp_max_corr; //! -TBranch *b_amp_max_time; //! -TBranch *b_baseline; //! -TBranch *b_charge; //! -TBranch *b_charge_corr; //! -/* -TBranch *b_fibreX; //! -TBranch *b_fibreY; //! -TBranch *b_sci_front_adc; //! -*/ -TBranch *b_run_id; //! -TBranch *b_isPCOn; //! -TBranch *b_HV; //! -TBranch *b_isTrigger; -TBranch *b_X0; -TBranch *b_tdcX; -TBranch *b_tdcY; -TBranch *b_hodoX1; -TBranch *b_hodoY1; -TBranch *b_hodoX2; -TBranch *b_hodoY2; -TBranch *b_nhodoX1; -TBranch *b_nhodoY1; -TBranch *b_nhodoX2; -TBranch *b_nhodoY2; - -void init() -{ -} - -void SetOutTree(TTree* outTree) -{ - //---standard analysis branches - outTree->Branch("event",&event,"event/I"); - outTree->Branch("time_CF",&time_CF,"time_CF[11]/F"); - outTree->Branch("time_CF_corr",&time_CF_corr,"time_CF_corr[11]/F"); - outTree->Branch("time_CF30",&time_CF30,"time_CF30[11]/F"); - outTree->Branch("time_OT",&time_OT,"time_OT[11]/F"); - outTree->Branch("time_start",&time_start,"time_start[11]/F"); - outTree->Branch("time_stop",&time_stop,"time_stop[11]/F"); - outTree->Branch("time_start_1000",&time_start_1000,"time_start_1000[11]/F"); - outTree->Branch("time_stop_1000",&time_stop_1000,"time_stop_1000[11]/F"); - outTree->Branch("time_start_150",&time_start_150,"time_start_150[11]/F"); - outTree->Branch("time_stop_150",&time_stop_150,"time_stop_150[11]/F"); - outTree->Branch("time_start_200",&time_start_200,"time_start_200[11]/F"); - outTree->Branch("time_stop_200",&time_stop_200,"time_stop_200[11]/F"); - outTree->Branch("time_start_500",&time_start_500,"time_start_500[11]/F"); - outTree->Branch("time_stop_500",&time_stop_500,"time_stop_500[11]/F"); - outTree->Branch("time_start_300",&time_start_300,"time_start_300[11]/F"); - outTree->Branch("time_stop_300",&time_stop_300,"time_stop_300[11]/F"); - outTree->Branch("time_Max",&time_Max,"time_Max[11]/F"); - outTree->Branch("amp_max",&_max,"amp_max[11]/F"); - outTree->Branch("amp_max_corr",&_max_corr,"amp_max_corr[11]/F"); - outTree->Branch("amp_max_time",&_max_time,"amp_max_time[11]/F"); - outTree->Branch("charge",&charge,"charge[11]/F"); - outTree->Branch("charge_corr",&charge_corr,"charge_corr[11]/F"); - outTree->Branch("baseline",&baseline,"baseline[11]/F"); - - //---hodoscope branches - // outTree->Branch("fibreX",&fibreX,"fibreX[8]/I"); - // outTree->Branch("fibreY",&fibreY,"fibreY[8]/I"); - - //---global branches - // outTree->Branch("sci_front_adc",&sci_front_adc,"sci_front_adc/I"); - outTree->Branch("run_id",&run_id,"run_id/I"); - - //---additional branches - outTree->Branch("isPCOn",&isPCOn,"isPCOn[11]/I"); - outTree->Branch("HV",&HV,"HV[11]/I"); - outTree->Branch("isTrigger",&isTrigger,"isTrigger[11]/I"); - outTree->Branch("X0",&X0,"X0/F"); - - outTree->Branch("tdcX",&tdcX,"tdcX/F"); - outTree->Branch("tdcY",&tdcY,"tdcY/F"); - - outTree->Branch("hodoX1",&hodoX1,"hodoX1[64]/O"); - outTree->Branch("hodoY1",&hodoY1,"hodoY1[64]/O"); - outTree->Branch("hodoX2",&hodoX2,"hodoX2[64]/O"); - outTree->Branch("hodoY2",&hodoY2,"hodoY2[64]/O"); - - outTree->Branch("nhodoX1",&nhodoX1,"nhodoX1/I"); - outTree->Branch("nhodoY1",&nhodoY1,"nhodoY1/I"); - outTree->Branch("nhodoX2",&nhodoX2,"nhodoX2/I"); - outTree->Branch("nhodoY2",&nhodoY2,"nhodoY2/I"); - // outTree->Branch("MCPName"+nameMCP->at(Ch_1),&baseline_Ch1,"baseline_"+nameMCP->at(Ch_1)+"/F"); -} - - -void InitRecoTree(TTree* nt) -{ - nt->SetBranchAddress("event", &event, &b_event); - nt->SetBranchAddress("time_CF", &time_CF, &b_time_CF); - nt->SetBranchAddress("time_CF_corr", &time_CF_corr, &b_time_CF_corr); - nt->SetBranchAddress("time_CF30", &time_CF30, &b_time_CF30); - nt->SetBranchAddress("time_OT", &time_OT, &b_time_OT); - nt->SetBranchAddress("time_start", &time_start, &b_time_start); - nt->SetBranchAddress("time_stop", &time_stop, &b_time_stop); - nt->SetBranchAddress("time_start_1000", &time_start_1000, &b_time_start_1000); - nt->SetBranchAddress("time_stop_1000", &time_stop_1000, &b_time_stop_1000); - nt->SetBranchAddress("time_start_150", &time_start_150, &b_time_start_150); - nt->SetBranchAddress("time_stop_150", &time_stop_150, &b_time_stop_150); - nt->SetBranchAddress("time_start_200", &time_start_200, &b_time_start_200); - nt->SetBranchAddress("time_stop_200", &time_stop_200, &b_time_stop_200); - nt->SetBranchAddress("time_start_500", &time_start_500, &b_time_start_500); - nt->SetBranchAddress("time_stop_500", &time_stop_500, &b_time_stop_500); - nt->SetBranchAddress("time_start_300", &time_start_300, &b_time_start_300); - nt->SetBranchAddress("time_stop_300", &time_stop_300, &b_time_stop_300); - nt->SetBranchAddress("time_Max", &time_Max, &b_time_Max); - nt->SetBranchAddress("amp_max", &_max, &b_amp_max); - nt->SetBranchAddress("amp_max_corr", &_max_corr, &b_amp_max_corr); - nt->SetBranchAddress("amp_max_time", &_max_time, &b_amp_max_time); - nt->SetBranchAddress("charge", &charge, &b_charge); - nt->SetBranchAddress("charge_corr", &charge_corr, &b_charge_corr); - nt->SetBranchAddress("baseline", &baseline, &b_baseline); - nt->SetBranchAddress("run_id", &run_id, &b_run_id); - nt->SetBranchAddress("isPCOn", &isPCOn, &b_isPCOn); - nt->SetBranchAddress("HV", &HV, &b_HV); - nt->SetBranchAddress("isTrigger", &isTrigger, &b_isTrigger); - nt->SetBranchAddress("X0", &X0, &b_X0); - nt->SetBranchAddress("tdcX", &tdcX, &b_tdcX); - nt->SetBranchAddress("tdcY", &tdcY, &b_tdcY); - nt->SetBranchAddress("hodoX1", &hodoX1, &b_hodoX1); - nt->SetBranchAddress("hodoY1", &hodoY1, &b_hodoY1); - nt->SetBranchAddress("hodoX2", &hodoX2, &b_hodoX2); - nt->SetBranchAddress("hodoY2", &hodoY2, &b_hodoY2); - nt->SetBranchAddress("nhodoX1", &nhodoX1, &b_nhodoX1); - nt->SetBranchAddress("nhodoY1", &nhodoY1, &b_nhodoY1); - nt->SetBranchAddress("nhodoX2", &nhodoX2, &b_nhodoX2); - nt->SetBranchAddress("nhodoY2", &nhodoY2, &b_nhodoY2); - - /* - nt->SetBranchAddress("fibreX", &fibreX, &b_fibreX); - nt->SetBranchAddress("fibreY", &fibreY, &b_fibreY); - nt->SetBranchAddress("sci_front_adc", &sci_front_adc, &b_sci_front_adc); - */ -} diff --git a/bin/analyzer.cpp b/bin/analyzer.cpp new file mode 100755 index 0000000..daa679a --- /dev/null +++ b/bin/analyzer.cpp @@ -0,0 +1,1149 @@ +/***************************************************************************************** + This program compute charge or efficiency for all the run in a selected Scan for + selected MCP under test. + +NEW - FOR BTF: +- options "HV1" means HV1 varying while HV2 fixed +- options "HV2" means HV2 varying while HV1 fixed +- options "HV12" means both HV varying (use HV1-HV2 as variable) + +****************************************************************************************/ +#include +#include +#include +#include + +#include "TROOT.h" +#include "TSystem.h" +#include "TKey.h" +#include "TFile.h" +#include "TTree.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TProfile.h" +#include "TF1.h" +#include "TGraphAsymmErrors.h" +#include "TString.h" +#include "TCut.h" +#include "TMath.h" +#include "TApplication.h" +#include "TError.h" +#include "TCanvas.h" +#include "TGraphErrors.h" +#include "TPad.h" +#include "TStyle.h" +#include "TStyle.h" + +#include "../interface/init_Reco_Tree.h" +#include "../interface/MCPMap.h" + +using namespace std; + +int main(int argc, char** argv) +{ + gSystem->Load("libTree"); + char *label, *doWhat, *scanTypeIN, *scanType, *inputDir; + Fill_MCPList(); + Fill_inverted_MCPList(); + + + for(std::map::iterator iT = MCPList.begin(); iT != MCPList.end(); ++iT) + std::cout << iT->first << " => " << iT->second << '\n'; + + //---Read input options--- + std::ifstream inputCfg ( (std::string(argv[1])).c_str(),ios::in); + std::string MCP = argv[2]; + doWhat = argv[3]; + scanTypeIN = argv[4]; + label = argv[5]; + inputDir = argv[6]; + + scanType=scanTypeIN; + if (strcmp(scanTypeIN,"Ang")==0) + scanType="X0"; + + std::cout << "----START ANALYZER: analyzing MCP " << MCP <<", mode: "<>> doWhat = " << doWhat << std::endl; + std::cout << " >>> scanType = " << scanType << std::endl; + + int MCPNumber = MCPList.at(MCP); + std::map treshold; + int ch, tresh; + int nChannels=0; + int trigPos1 = -1; //position of the trigger chamber in the reco tree + int trigPos2 = -1; //position of 2nd the trigger chamber in the reco tree + int clockPos1 = -1, clockPos2 = -1; + + //---Open cfg file and fill map with treshold for each channel--- + while(!inputCfg.eof()) + { + inputCfg >> ch >> tresh; + treshold.insert(std::make_pair(ch,tresh)); + nChannels++; + } + + for(std::map::iterator iT = treshold.begin(); iT != treshold.end(); ++iT) + std::cout << iT->first << " => " << iT->second << '\n'; + + //-----Create output files----- + + //open reco tree + std::string inFileName = string(inputDir)+"reco_"+string(label)+".root"; + TFile *inFile = new TFile (inFileName.c_str()); + TTree* nt = (TTree*)inFile->Get("reco_tree"); + InitRecoTree(nt); + + std::cout << " >>> inFileName = " << inFileName << std::endl; + + //---txt--- + char outputFileName[200]=""; + sprintf(outputFileName, "results/%s_%s_%s_%s.txt", MCP.c_str(), doWhat, scanTypeIN, label); + std::ofstream outputFile (outputFileName, std::ofstream::out); + + //---ROOT--- + char mkdir_command[100]; + TFile* outROOT_eff = NULL; + TFile* outROOT_Q = NULL; + TFile* outROOT_CFD = NULL; + TFile* outROOT_LED = NULL; + //---efficiency + if(strcmp(doWhat, "eff") == 0 || strcmp(doWhat, "all") == 0) + { + sprintf(mkdir_command, "if [ ! -e plots/efficiency_studies ] ; then mkdir plots/efficiency_studies ; fi"); + system(mkdir_command); + outROOT_eff = TFile::Open(Form("plots/efficiency_studies/%s_%s_%s.root", MCP.c_str(), scanTypeIN, label), "recreate"); + } + //---charge + if(strcmp(doWhat, "Q") == 0 || strcmp(doWhat, "all") == 0) + { + sprintf(mkdir_command, "if [ ! -e plots/charge_studies ] ; then mkdir plots/charge_studies ; fi"); + system(mkdir_command); + outROOT_Q = TFile::Open(Form("plots/charge_studies/%s_%s_%s.root", MCP.c_str(), scanTypeIN, label), "recreate"); + } + //---time resolution CFD + if(strcmp(doWhat, "timeCFD") == 0 || strcmp(doWhat, "all") == 0) + { + sprintf(mkdir_command, "if [ ! -e plots/resCFD_studies ] ; then mkdir plots/resCFD_studies ; fi"); + system(mkdir_command); + outROOT_CFD = TFile::Open(Form("plots/resCFD_studies/%s_%s_%s.root", MCP.c_str(), scanTypeIN, label), "recreate"); + } + //---time resolution LED + if(strcmp(doWhat, "timeLED") == 0 || strcmp(doWhat, "all") == 0) + { + sprintf(mkdir_command, "if [ ! -e plots/resLED_studies ] ; then mkdir plots/resLED_studies ; fi"); + system(mkdir_command); + outROOT_LED = TFile::Open(Form("plots/resLED_studies/%s_%s_%s.root", MCP.c_str(), scanTypeIN, label), "recreate"); + } + + + //---open tree and get: run list and corresponding HV/X0--- + std::vector HVVal; + HVVal.clear(); + std::vector HV2Val; + HV2Val.clear(); + std::vector X0Step; + X0Step.clear(); + std::vector ScanList; + ScanList.clear(); + + nChannels=8; //FIX A BUG + + std::cout << " >>>> nt->GetEntries() = " << nt->GetEntries() << std::endl; + + //---save list of HV (or X0) step--- + if (strcmp(scanType,"HV1")==0 || strcmp(scanType,"HV2")==0 || + strcmp(scanType,"HV12")==0 || strcmp(scanType,"X0")==0) { + int prev=0, prev2=0, prevX0 = -1 ; + for (int iEntry=0; iEntryGetEntries(); iEntry++) + { + // std::cout << " >>> iEntry = " << iEntry << std::endl; + nt->GetEntry(iEntry); + if( ((HV[MCPNumber]!=prev || HV2[MCPNumber]!=prev2 ) && + (strcmp(scanType,"HV1")==0) || strcmp(scanType,"HV2")==0 || strcmp(scanType,"HV12")==0) || + (X0 != prevX0 && strcmp(scanType,"X0") ==0) ){ + ScanList.push_back((float)HV[MCPNumber]); + HVVal.push_back(HV[MCPNumber]); + HV2Val.push_back(HV2[MCPNumber]); + X0Step.push_back(X0); + prev=HV[MCPNumber]; + prev2=HV2[MCPNumber]; + // std::cout << " >>> X0 = " << X0 << "prevX0 = " << prevX0 << std::endl; + prevX0 = X0; + if(iEntry==0) { + for(int i=0; iGetEntry(0); + ScanList.push_back(1.); + X0Step.push_back(1.); + ScanList.push_back(2.); + X0Step.push_back(2.); + ScanList.push_back(3.); + X0Step.push_back(3.); + ScanList.push_back(4.); + X0Step.push_back(4.); + ScanList.push_back(5.); + X0Step.push_back(5.); + for (int i=0; iGetEntries(); iEntry++) + { + nt->GetEntry(iEntry); + if (X0>(prev+0.001)||X0<(prev-0.001)) { + ScanList.push_back(X0); + HVVal.push_back(HV[MCPNumber]); + HV2Val.push_back(HV2[MCPNumber]); + X0Step.push_back(X0); + prev=X0; + if (iEntry==0) { + for (int i=0; i \ntrigger 1 = "<SetName("eff"); + + TGraphErrors *g_Q = new TGraphErrors(); + g_Q->SetName("Q"); + + TGraphErrors *g_resCFD = new TGraphErrors(); + g_resCFD->SetName("resCFD"); + + TGraphErrors *g_resLED = new TGraphErrors(); + g_resLED->SetName("resLED"); + + TGraphErrors* g_frac_saturated = new TGraphErrors(); + g_frac_saturated->SetName("frac_saturated"); + +//------Build TCut and draw variables----------------------------------------------------- + //---efficiency + char var_sig[100]=""; + char var_trig0[100]=""; + // char var_dt_vs_ampM[100]=""; + // char var_dtStart_vs_ampM[100] = ""; + // char var_dtStart_vs_Tot[100] = ""; + char var_fracSaturated[100]=""; + char var_evtAll[100]=""; + //---charge + char var_charge[200]=""; + //---time resolution + char var_timeCFD[200]=""; + char var_timeCFD_red[200]=""; + char var_timeCFD_vs_TOT[500] = ""; + char var_timeCFD_vs_ampMax[500] = ""; + char var_timeCFD_vs_ampMaxNoCorr[500] = ""; + char var_timeLED[200] = ""; + char var_timeLED_red[200] = ""; + char var_timeLED_vs_TOT[500] = ""; + char var_timeLED_vs_ampMax[500] = ""; + char var_timeLED_vs_ampMax_NoCorr[500] = ""; + //---cut strings + char str_cut_sig[500]=""; + char str_cut_trig0[500]=""; + char str_cut_tdc[500]=""; + char str_cut_saturated[500]=""; + char str_cut_nFibers[500]=""; + char str_cut_HODO[500]= ""; + char str_cut_trig_not_sat[500]=""; + char str_cut_mcp_not_sat[500]=""; + char str_cut_bad_timeCFD[500]=""; + char str_cut_bad_timeLED[500]=""; + char str_cut_multiplicity[500]=""; + char str_cut_multiplicity2[500]=""; + char str_cut_multiplicity3[500]=""; + char str_cut_multiplicity4[500]=""; + char str_cut_multiplicity5[500]=""; + char str_cut_noisePeak[500]=""; + //---Define Cuts--- + // sprintf(str_cut_sig, "charge_corr[%d] > %d", MCPNumber, treshold.at(MCPNumber)); + // sprintf(str_cut_trig0, "charge_corr[%d] > %d", trigPos1, treshold.at(trigPos1)); + // float cutTDCX_min = -5.+ShiftX, cutTDCX_max = 3.+ShiftX, cutTDCY_min = -2.+ShiftY, cutTDCY_max = 6.+ShiftY; + // sprintf(str_cut_tdc, "tdcX > %f && tdcX < %f && tdcY >%f && tdcY < %f", cutTDCX_min, cutTDCX_max, cutTDCY_min, cutTDCY_max); + // sprintf(str_cut_saturated, "amp_max[%d] > 3450", MCPNumber); + // sprintf(str_cut_nFibers, "nhodoX<=3 && nhodoY<=3 && "); + // if(scanType == "HV1") + if(label == "Planacon_ON_HVScan"){ + if(MCP == "Plana1") + sprintf(str_cut_HODO, "pos_hodoY2>1 && pos_hodoY2<5 && pos_hodoX2>0 && pos_hodoX2<4 && pos_hodoY1>1 && pos_hodoY1<5 && pos_hodoX1>-2 && pos_hodoX1<1"); + if(MCP == "Plana2") + sprintf(str_cut_HODO, "pos_hodoY2>0 && pos_hodoY2<5 && pos_hodoX2>-5 && pos_hodoX2<3 && pos_hodoY1>0 && pos_hodoY1<5 && pos_hodoX1>-7 && pos_hodoX1<0"); + if(MCP == "Plana3") + sprintf(str_cut_HODO, "pos_hodoY2>-2 && pos_hodoY2<5 && pos_hodoX2>0 && pos_hodoX2<4 && pos_hodoY1>0 && pos_hodoY1<5 && pos_hodoX1>-2 && pos_hodoX1<1"); + if(MCP == "Plana4") + sprintf(str_cut_HODO, "pos_hodoY2>-3 && pos_hodoY2<5 && pos_hodoX2>-5 && pos_hodoX2<2 && pos_hodoY1>-2 && pos_hodoY1<5 && pos_hodoX1>-7 && pos_hodoX1<1"); + } + + if(label == "Planacon_OFF_HVScan"){ + if(MCP == "Plana1") + sprintf(str_cut_HODO, "pos_hodoY2>1 && pos_hodoY2<5 && pos_hodoX2>-2 && pos_hodoX2<4 && pos_hodoY1>0 && pos_hodoY1<5 && pos_hodoX1>-6 && pos_hodoX1<1"); + if(MCP == "Plana2") + sprintf(str_cut_HODO, "pos_hodoY2>2 && pos_hodoY2<5 && pos_hodoX2>-5 && pos_hodoX2<-1 && pos_hodoY1>1 && pos_hodoY1<5 && pos_hodoX1>-8 && pos_hodoX1<-3"); + if(MCP == "Plana3") + sprintf(str_cut_HODO, "pos_hodoY2>0 && pos_hodoY2<5 && pos_hodoX2>1 && pos_hodoX2<4 && pos_hodoY1>1 && pos_hodoY1<5 && pos_hodoX1>-1 && pos_hodoX1<1"); + if(MCP == "Plana4") + sprintf(str_cut_HODO, "pos_hodoY2>-1 && pos_hodoY2<5 && pos_hodoX2>-5 && pos_hodoX2<-2 && pos_hodoY1>-2 && pos_hodoY1<5 && pos_hodoX1>-8 && pos_hodoX1<-4"); + } + + if(label == "Planacon_OFF_X0Scan"){ + if(MCP == "Plana1") + sprintf(str_cut_HODO, "pos_hodoY2>-4 && pos_hodoY2<5 && pos_hodoX2>-4 && pos_hodoX2<4 && pos_hodoY1>-2 && pos_hodoY1<5 && pos_hodoX1>-6 && pos_hodoX1<1"); + if(MCP == "Plana2") + sprintf(str_cut_HODO, "pos_hodoY2>-4 && pos_hodoY2<5 && pos_hodoX2>-4 && pos_hodoX2<4 && pos_hodoY1>-2 && pos_hodoY1<5 && pos_hodoX1>-6 && pos_hodoX1<1"); + if(MCP == "Plana3") + sprintf(str_cut_HODO, "pos_hodoY2>-4 && pos_hodoY2<5 && pos_hodoX2>-3 && pos_hodoX2<4 && pos_hodoY1>-2 && pos_hodoY1<5 && pos_hodoX1>-4 && pos_hodoX1<1"); + if(MCP == "Plana4") + sprintf(str_cut_HODO, "pos_hodoY2>-4 && pos_hodoY2<5 && pos_hodoX2>-4 && pos_hodoX2<3 && pos_hodoY1>-3 && pos_hodoY1<5 && pos_hodoX1>-6 && pos_hodoX1<0"); + } + // sprintf(str_cut_trig_not_sat, "amp_max[%d] < 3450", trigPos1); + // sprintf(str_cut_bad_timeCFD, "time_start_150[%d] != -20", MCPNumber); + + sprintf(str_cut_sig, "charge[%d] > %d", MCPNumber, treshold.at(MCPNumber)); + sprintf(str_cut_trig0, "charge[%d] > %d", trigPos1, treshold.at(trigPos1)); + // if(strcmp(scanTypeIN, "X0") == 0) + // sprintf(str_cut_tdc, "hodoXpos>10 && hodoXpos<15 && hodoYpos>10 && hodoYpos<15"); + //else + + sprintf(str_cut_tdc, "1==1"); + sprintf(str_cut_nFibers, "1==1"); //selectionOFF + + if(strcmp(doWhat, "timeCFD") == 0 || strcmp(doWhat, "timeLED") == 0 ) + sprintf(str_cut_saturated, "amp_max[%d] > 3500", MCPNumber); + + //RA 3500 + sprintf(str_cut_trig_not_sat, "amp_max[%d] < 3500", trigPos1); + sprintf(str_cut_mcp_not_sat, "amp_max[%d] < 3500", MCPNumber); + + /* + //500 option + sprintf(str_cut_bad_timeCFD, "time_start_500[%d] > -10", MCPNumber); + sprintf(str_cut_bad_timeLED, "time_start_500[%d] > -10", MCPNumber); + */ + + //150 option + sprintf(str_cut_bad_timeCFD, "time_start_150[%d] > -10", MCPNumber); + sprintf(str_cut_bad_timeLED, "time_start_150[%d] > -10", MCPNumber); + + // sprintf(str_cut_sci, "sci_front_adc > 400 && sci_front_adc <550"); + if (TString(MCP).Contains("Double") == 1) { + sprintf(str_cut_multiplicity, "amp_max[1]<20 && amp_max[2]<20 && sci_front_adc > 80 && sci_front_adc < 350");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity2, "amp_max[1]<20 && amp_max[2]<20 && sci_front_adc > 350 && sci_front_adc < 850");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity3, "amp_max[1]<20 && amp_max[2]<20 && sci_front_adc > 850 && sci_front_adc < 1450");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity4, "amp_max[1]<20 && amp_max[2]<20 && sci_front_adc > 1450 && sci_front_adc < 2100");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity5, "amp_max[1]<20 && amp_max[2]<20 && sci_front_adc > 2100 && sci_front_adc < 2700");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + } + else { + sprintf(str_cut_multiplicity, "amp_max[3]<20 && amp_max[4]<20 && sci_front_adc > 80 && sci_front_adc < 350");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity2, "amp_max[3]<20 && amp_max[4]<20 && sci_front_adc > 350 && sci_front_adc < 850");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity3, "amp_max[3]<20 && amp_max[4]<20 && sci_front_adc > 850 && sci_front_adc < 1450");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity4, "amp_max[3]<20 && amp_max[4]<20 && sci_front_adc > 1450 && sci_front_adc < 2100");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + sprintf(str_cut_multiplicity5, "amp_max[3]<20 && amp_max[4]<20 && sci_front_adc > 2100 && sci_front_adc < 2700");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + } + int notMCPnumber = 2; + // if(notMCPnumber == MCPNumber) notMCPnumber = notMCPnumber + 1; + sprintf(str_cut_noisePeak, "1==1"); + // sprintf(str_cut_noisePeak, "amp_max[%d] < 30", notMCPnumber); + sprintf(str_cut_multiplicity, "1==1");// && bgo_back_adc > 420 && bgo_back_adc < 640"); + + /* if (MCPList.at(MCP)==4) + { + sprintf(str_cut_bad_timeLED, "time_start_150[%d] != 20 && time_start_150[%d] != 20 && " + "((time_start_150[%d]-time_CF_corr[%d])<-3/5*(time_stop_150[%d]-time_start_150[%d]))", + MCPNumber, trigPos1, MCPNumber, trigPos1, MCPNumber, MCPNumber); + } + else + { + sprintf(str_cut_bad_timeLED, "time_start_150[%d] != 20 && time_start_150[%d] != 20 && " + "((time_start_150[%d]-time_CF_corr[%d])<-1/3*(time_stop_150[%d]-time_start_150[%d])+2)", + MCPNumber, trigPos1, MCPNumber, trigPos1, MCPNumber, MCPNumber); + } + */ + //---construct TCut + TCut cut_sig = str_cut_sig; + TCut cut_trig0 = str_cut_trig0; + TCut cut_tdc = str_cut_tdc; + TCut cut_saturated = str_cut_saturated; + TCut cut_nFibers = str_cut_nFibers; + TCut cut_HODO = str_cut_HODO; + TCut cut_trig_not_sat = str_cut_trig_not_sat; + TCut cut_mcp_not_sat = str_cut_mcp_not_sat; + TCut cut_bad_timeCFD = str_cut_bad_timeCFD; + TCut cut_bad_timeLED = str_cut_bad_timeLED; + TCut cut_multiplicity = str_cut_multiplicity; + TCut cut_multiplicityVect[5] = {str_cut_multiplicity,str_cut_multiplicity2,str_cut_multiplicity3,str_cut_multiplicity4,str_cut_multiplicity5}; + // TCut cut_multiplicity2 = str_cut_multiplicity2; + // TCut cut_multiplicity3 = str_cut_multiplicity3; + //TCut cut_multiplicity4 = str_cut_multiplicity4; + //TCut cut_multiplicity5 = str_cut_multiplicity5; + TCut cut_noisePeak = str_cut_noisePeak; + + + for(unsigned int i=0; i>>>> INIZIO >>>>>>>>> HVVal.at(i) = " << HVVal.at(i) + << " HV2Val.at(i) = " << HV2Val.at(i) << std::endl; + } + +//-------Runs loop------------------------------------------------------------------------ + for(unsigned int i=0; i 796 && amp_max[%d] > 4000", MCPNumber); + //---and print infos + char var_name[3] = "X0"; + if(TString(scanType).Contains("HV") == 1) + sprintf(var_name, "HV"); + if(TString(scanType).Contains("multiplicity") == 1) + sprintf(var_name, "multiplicity"); + + //-------define histos------------------------------------------------------------ + //-----create objects names----- + char h_fracSat_name[20], h_evtAll_name[20]; + char h_sig_name[20], h_trig0_name[20]; + char h_charge_name[20]; + char pr_timeCFD_vs_TOT_name[20], h_resCFD_noCorr_name[20], h_resCFD_TOTCorr_name[20], h_resCFD_name[20], + f_resCFD_name[20], f_corrCFD_name[20], f_corrCFD2_name[40], f_corrCFD3_name[40]; + char pr_timeLED_vs_TOT_name[20], h_resLED_noCorr_name[20], h_resLED_TOTCorr_name[20], h_resLED_name[20], f_resLED_name[20], + f_corrLED_name[20], f_corrLED2_name[40], f_corrLED3_name[40]; + char pr_timeCFD_vs_ampMaxCorr_name[40], pr_timeCFD_vs_ampMax_name[40], pr_timeLED_vs_ampMaxCorr_name[40], pr_timeLED_vs_ampMax_name[40]; + //-----create objects------ + //---saturated events fraction + sprintf(h_fracSat_name, "h_fracSat_name_%d", i); + sprintf(h_evtAll_name, "h_evtAll_name_%d", i); + TH1F* h_fracSat = new TH1F(h_fracSat_name, h_fracSat_name, 100, 0., 100.); + TH1F* h_evtAll = new TH1F(h_evtAll_name, h_evtAll_name, 100, 0., 100.); + //---efficiency + sprintf(h_sig_name, "h_sig_%d", i); + sprintf(h_trig0_name, "h_trig0_%d", i); + TH1F* h_sig= new TH1F(h_sig_name, h_sig_name, 500, -5000, 40000); + TH1F* h_trig0 = new TH1F(h_trig0_name, h_trig0_name, 500, -5000, 40000); + //---TOT + char TOT_diff[100]; + //500 + //sprintf(TOT_diff, "(time_stop_500[%d]-time_start_500[%d])", MCPNumber, MCPNumber); + //150 + sprintf(TOT_diff, "(time_stop_150[%d]-time_start_150[%d])", MCPNumber, MCPNumber); + + //---charge + sprintf(h_charge_name, "h_charge_%d", i); + TH1F* h_charge = new TH1F(h_charge_name, "charge distribution", 500, -500, 110000); + // TH1F* h_charge = new TH1F(h_charge_name, "TOT distribution", 200, 0, 10); + //---time CFD/TOT corrected + sprintf(pr_timeCFD_vs_TOT_name, "pr_timeCFD_vs_TOT_%d", i); + sprintf(pr_timeCFD_vs_ampMaxCorr_name, "pr_timeCFD_vs_ampMaxCorr_%d", i); + sprintf(pr_timeCFD_vs_ampMax_name, "pr_timeCFD_vs_ampMax_%d", i); + sprintf(h_resCFD_name, "h_resCFD_%d", i); + sprintf(h_resCFD_noCorr_name, "h_resCFD_noCorr_%d", i); + sprintf(h_resCFD_TOTCorr_name, "h_resCFD_TOTCorr_%d", i); + sprintf(f_resCFD_name, "f_resCFD_%d", i); + sprintf(f_corrCFD_name, "f_corrCFD_%d", i); + sprintf(f_corrCFD_name, "f_corrCFD2_%d", i); + // TH1F* h_resCFD = new TH1F(h_resCFD_name, "Electron Beam 50 GeV", 250, -0.5, 0.5); + TH1F* h_resCFD; + if(MCP != "Plana3") h_resCFD = new TH1F(h_resCFD_name, "Electron Beam 50 GeV", 1500, -10., 2.); + else h_resCFD = new TH1F(h_resCFD_name, "Electron Beam 50 GeV", 1500, -10., 2.); + TH1F* h_resCFD_noCorr = (TH1F*)h_resCFD->Clone(h_resCFD_noCorr_name); + h_resCFD_noCorr->Reset(); + TH1F* h_resCFD_TOTCorr = (TH1F*)h_resCFD->Clone(h_resCFD_TOTCorr_name); + h_resCFD_TOTCorr->Reset(); + + h_resCFD->GetXaxis()->SetTitle("time_{MCP}-time_{TRIG} (ns)"); + h_resCFD->GetYaxis()->SetTitle("Entries"); + h_resCFD->GetXaxis()->SetTitleSize(0.05); + h_resCFD->GetYaxis()->SetTitleSize(0.05); + h_resCFD->GetXaxis()->SetTitleOffset(0.9); + h_resCFD->GetYaxis()->SetTitleOffset(0.9); + // TF1* f_resCFD = new TF1(f_resCFD_name, "gausn", -1, 1); + TF1* f_resCFD; + if(MCP != "Plana3") f_resCFD = new TF1(f_resCFD_name, "gausn", -10, 1); + else f_resCFD = new TF1(f_resCFD_name, "gausn", -10, 1); + TProfile* pr_timeCFD_vs_TOT; + TProfile* pr_timeCFD_vs_ampMaxCorr; + TProfile* pr_timeCFD_vs_ampMax; + TF1* f_corrCFD; + TF1* f_corrCFD2; + TF1* f_corrCFD3; + + if(strcmp(scanType, "HV") == 0) + { + pr_timeCFD_vs_TOT = new TProfile(pr_timeCFD_vs_TOT_name, "timeCF vs TOT difference", + 25, 0, 5, -5, 2); + f_corrCFD = new TF1(f_corrCFD_name, "pol2", 0, 5); + + pr_timeCFD_vs_ampMaxCorr = new TProfile(pr_timeCFD_vs_ampMaxCorr_name, "timeCF vs ampMaxCorr", + 20, 0, 8000, -2, 2); + f_corrCFD2 = new TF1(f_corrCFD2_name, "pol2", 0, 8000); + + pr_timeCFD_vs_ampMax = new TProfile(pr_timeCFD_vs_ampMax_name, "timeCF vs ampMax", + 20, 0, 8000, -2, 2); + f_corrCFD3 = new TF1(f_corrCFD3_name, "pol2", 0, 8000); + } + else + { + pr_timeCFD_vs_TOT = new TProfile(pr_timeCFD_vs_TOT_name, "timeCF vs TOT difference", + 30, 0, 10, -5, 5); + f_corrCFD = new TF1(f_corrCFD_name, "pol2", 0, 6); + + pr_timeCFD_vs_ampMaxCorr = new TProfile(pr_timeCFD_vs_ampMaxCorr_name, "timeCF vs ampMaxCorr", + 20, 0, 8000, -2, 2); + f_corrCFD2 = new TF1(f_corrCFD2_name, "pol2", 0, 8000); + + pr_timeCFD_vs_ampMax = new TProfile(pr_timeCFD_vs_ampMax_name, "timeCF vs ampMax", + 20, 0, 8000, -2, 2); + f_corrCFD3 = new TF1(f_corrCFD3_name, "pol2", 0, 8000); + } + pr_timeCFD_vs_TOT->SetMarkerStyle(20); + pr_timeCFD_vs_TOT->SetMarkerSize(0.7); + pr_timeCFD_vs_ampMaxCorr->SetMarkerStyle(20); + pr_timeCFD_vs_ampMaxCorr->SetMarkerSize(0.7); + //---time LED/TOT corrected + sprintf(pr_timeLED_vs_TOT_name, "pr_timeLED_vs_TOT_%d", i); + sprintf(pr_timeLED_vs_ampMaxCorr_name, "pr_timeLED_vs_ampMaxCorr_%d", i); + sprintf(pr_timeLED_vs_ampMax_name, "pr_timeLED_vs_ampMax_%d", i); + sprintf(h_resLED_name, "h_resLED_%d", i); + sprintf(h_resLED_noCorr_name, "h_resLED_noCorr_%d", i); + sprintf(h_resLED_TOTCorr_name, "h_resLED_TOTCorr_%d", i); + sprintf(f_resLED_name, "f_resLED_%d", i); + sprintf(f_corrLED_name, "f_corrLED_%d", i); + // TH1F* h_resLED = new TH1F(h_resLED_name, "time res with LED method", 250, -0.5, 0.5); + TH1F* h_resLED; + if(MCP != "Plana3") h_resLED = new TH1F(h_resLED_name, "time res with LED method", 1500, -10., 2.); + else h_resLED = new TH1F(h_resLED_name, "time res with LED method", 1500, -10., 2.); + TH1F* h_resLED_noCorr = (TH1F*)h_resLED->Clone(h_resLED_noCorr_name); + h_resLED_noCorr->Reset(); + TH1F* h_resLED_TOTCorr = (TH1F*)h_resLED->Clone(h_resLED_TOTCorr_name); + h_resLED_TOTCorr->Reset(); + // TF1* f_resLED = new TF1(f_resLED_name, "gausn", -1, 1); + TF1* f_resLED; + if(MCP != "Plana3") f_resLED = new TF1(f_resLED_name, "gausn", -10, 1); + else f_resLED = new TF1(f_resLED_name, "gausn", -10, 1); + TProfile* pr_timeLED_vs_TOT; + TProfile* pr_timeLED_vs_ampMaxCorr; + TProfile* pr_timeLED_vs_ampMax; + TF1* f_corrLED; + TF1* f_corrLED2; + TF1* f_corrLED3; + if(strcmp(scanType, "HV") == 0) + { + pr_timeLED_vs_TOT = new TProfile(pr_timeLED_vs_TOT_name, "time vs TOT difference", + 25, 0, 5, -5, 2); + f_corrLED = new TF1(f_corrLED_name, "pol2", 0, 5); + + pr_timeLED_vs_ampMaxCorr = new TProfile(pr_timeLED_vs_ampMaxCorr_name, "timeLED vs ampMaxCorr", + 20, 0, 8000, -2, 2); + f_corrLED2 = new TF1(f_corrLED2_name, "pol4", 0, 8000); + + pr_timeLED_vs_ampMax = new TProfile(pr_timeLED_vs_ampMax_name, "timeLED vs ampMax", + 20, 0, 8000, -2, 2); + f_corrLED3 = new TF1(f_corrLED3_name, "pol2", 0, 8000); + } + else + { + pr_timeLED_vs_TOT = new TProfile(pr_timeLED_vs_TOT_name, "time vs TOT difference", + 30, 0, 10, -5, 2); + f_corrLED = new TF1(f_corrLED_name, "pol2", 0, 6); + + pr_timeLED_vs_ampMaxCorr = new TProfile(pr_timeLED_vs_ampMaxCorr_name, "timeLED vs ampMaxCorr", + 20, 0, 8000, -2, 2); + f_corrLED2 = new TF1(f_corrLED2_name, "pol4", 0, 8000); + + pr_timeLED_vs_ampMax = new TProfile(pr_timeLED_vs_ampMax_name, "timeLED vs ampMax", + 20, 0, 8000, -2, 2); + f_corrLED3 = new TF1(f_corrLED3_name, "pol2", 0, 8000); + } + pr_timeLED_vs_TOT->SetMarkerStyle(20); + pr_timeLED_vs_TOT->SetMarkerSize(0.7); + pr_timeLED_vs_ampMaxCorr->SetMarkerStyle(20); + pr_timeLED_vs_ampMaxCorr->SetMarkerSize(0.7); + + //-----Saturated event computation---- + sprintf(var_fracSaturated, "time_CF[%d] >> %s", MCPNumber, h_fracSat_name); + sprintf(var_evtAll, "time_CF[%d] >> %s", MCPNumber, h_evtAll_name); + nt->Draw(var_fracSaturated, cut_trig0 && cut_sig && cut_scan && cut_saturated && cut_tdc && cut_nFibers && cut_HODO); + nt->Draw(var_evtAll, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_HODO); + if(TString(scanType).Contains("HV") == 1) + { + if(h_evtAll->GetEntries() != 0) + g_frac_saturated->SetPoint(i, HVVal.at(i), 100.*h_fracSat->GetEntries()/h_evtAll->GetEntries()); + else + g_frac_saturated->SetPoint(i, HVVal.at(i), 0); + } + else + { + if(h_evtAll->GetEntries() != 0) + g_frac_saturated->SetPoint(i, X0Step.at(i), 100.*h_fracSat->GetEntries()/h_evtAll->GetEntries()); + else + g_frac_saturated->SetPoint(i, X0Step.at(i), 0); + } + //-----Efficiency study----- + if(strcmp(doWhat, "eff") == 0 || strcmp(doWhat, "all") == 0) + { + sprintf(var_sig, "charge[%d]>>%s", MCPNumber, h_sig_name); + sprintf(var_trig0, "charge[%d]>>%s", trigPos1, h_trig0_name); + // nt->Draw(var_sig, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_multiplicity, "goff"); + // nt->Draw(var_trig0, cut_trig0 && cut_scan && cut_tdc && cut_nFibers && cut_tdc && cut_multiplicity, "goff"); + //nt->Draw(var_sig, cut_trig0 && cut_sig && cut_scan && cut_multiplicity && cut_tdc, "goff"); + //nt->Draw(var_trig0, cut_trig0 && cut_scan && cut_multiplicity && cut_tdc, "goff"); + if (strcmp(scanType,"multiplicity1")==0 || strcmp(scanType,"multiplicity2")==0) { + nt->Draw(var_sig, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_noisePeak && cut_HODO, "goff"); + nt->Draw(var_trig0, cut_trig0 && cut_scan && cut_tdc && cut_noisePeak && cut_HODO, "goff"); + } + else { + nt->Draw(var_sig, cut_trig0 && cut_sig && cut_scan && cut_multiplicity && cut_tdc && cut_noisePeak && cut_HODO, "goff"); + nt->Draw(var_trig0, cut_trig0 && cut_scan && cut_multiplicity && cut_tdc && cut_noisePeak && cut_HODO, "goff"); + } + std::cout<<"DEBUG - sign: "<Integral(0, h_sig->GetNbinsX()+1)<<" - trig: "<Integral(0, h_trig0->GetNbinsX()+1)<> h_sig->GetEntries() = " << h_sig->GetEntries() << std::endl; + std::cout << ">> h_trig0->GetEntries() = " << h_trig0->GetEntries() << std::endl; + + float eff = h_sig->GetEntries()/h_trig0->GetEntries(); + float e_eff = TMath::Sqrt((TMath::Abs(eff*(1-eff)))/h_trig0->Integral(0, h_trig0->GetNbinsX()+1)); //BUG + // float e_eff = eff*TMath::Sqrt(1/(float)h_sig->GetEntries()+1)+1/(float)h_trig0->GetEntries(); + if(eff < 0) + eff = 0; + if(i == 0) + { + printf("---------Efficiency----------\n"); + printf(" %s\teff\te_%s\te_eff\n", var_name, var_name); + printf("-----------------------------\n"); + } + if(TString(scanType).Contains("HV12") == 1) + { + // printf("%d\t%.3f\t%.3f\t%.3f\n", HVVal.at(i) - HV2Val.at(i), eff, 0., e_eff); + printf("%d\t%d\t%.3f\t%.3f\t%.3f\n", HVVal.at(i), HV2Val.at(i), eff, 0., e_eff); + outputFile << HVVal.at(i)<<"\t"<SetPoint(i, - HVVal.at(i) + HV2Val.at(i), eff); + g_eff->SetPoint(i, HVVal.at(i), eff); + g_eff->SetPointError(i, 0, e_eff); + } + else if(TString(scanType).Contains("HV1") == 1) + { + printf("%d\t%.3f\t%.3f\t%.3f\n", HVVal.at(i), eff, 0., e_eff); + outputFile << HVVal.at(i)<<"\t"<SetPoint(i, HVVal.at(i), eff); + g_eff->SetPointError(i, 0, e_eff); + } + else if(TString(scanType).Contains("HV2") == 1) + { + printf("%d\t%d\t%.3f\t%.3f\n", HV2Val.at(i), eff, 0., e_eff); + outputFile << HV2Val.at(i)<<"\t"<SetPoint(i, HV2Val.at(i), eff); + g_eff->SetPointError(i, 0, e_eff); + } + else + { + printf("%.3f\t%.3f\t%.3f\t%.3f\n", X0Step.at(i), eff, 0., e_eff); + outputFile << X0Step.at(i)<<"\t"<SetPoint(i, X0Step.at(i), eff); + g_eff->SetPointError(i, 0, e_eff); + } + if(i == (ScanList.size()-1)) + printf("-----------------------------\n"); + } + //-----Charge study----- + /* if(strcmp(doWhat, "Q") == 0)// || strcmp(doWhat, "all") == 0) + { + if(i == 0) + { + printf("---------Efficiency----------\n"); + printf(" %s\tQ\te_%s\te_Q\n", var_name, var_name); + printf("-----------------------------\n"); + } + // sprintf(var_charge, "%s>>%s", TOT_diff, h_charge_name); + sprintf(var_charge, "charge[%d]>>%s", MCPNumber, h_charge_name); + nt->Draw(var_charge, cut_scan && cut_tdc && cut_nFibers, "goff"); + if(TString(scanType).Contains("HV") == 1) + { + printf("%d\t%.0f\t%.0f\t%.0f\n", HVVal.at(i), h_charge->GetMean(), 0., h_charge->GetMeanError()); + outputFile << HVVal.at(i)<<"\t"<GetMean()<<"\t 0.\t"<GetMeanError()<SetPoint(i, HVVal.at(i), h_charge->GetMean()); + g_Q->SetPoint(i, 0, h_charge->GetMeanError()); + } + else + { + printf("%.0f\t%.3f\t%.0f\t%.3f\n", X0Step.at(i), h_charge->GetMean(), 0., h_charge->GetMeanError()); + outputFile << X0Step.at(i)<<"\t"<GetMean()<<"\t 0.\t"<GetMeanError()<SetPoint(i, X0Step.at(i), h_charge->GetMean()); + g_Q->SetPoint(i, 0, h_charge->GetMeanError()); + } + if(i == (ScanList.size()-1)) + printf("-----------------------------\n"); + } */ + //-----TIME RESOLUTION STUDY----- + //---time resolution with CFD--- + if(strcmp(doWhat, "timeCFD") == 0 || strcmp(doWhat, "all") == 0) + { + //---print banner + if(i == 0) + { + printf("----------Time Resolution(ps)----------\n"); + printf(" #\t%s\tt_res\te_%s\te_t_res\tX_prob\n", var_name, var_name); + printf("---------------------------------------\n"); + } + //---change TOT for X0 runs + if(strcmp(scanType, "X0") == 0 && X0Step.at(i) != 0 && MCPNumber < 3) + //sprintf(TOT_diff, "(time_stop_500[%d]-time_start_500[%d])", MCPNumber, MCPNumber); + sprintf(TOT_diff, "(time_stop_150[%d]-time_start_150[%d])", MCPNumber, MCPNumber); + //---create variables + char t_CF_diff[100]; + // if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) + // sprintf(t_CF_diff, "(time_CF_corr[%d]-(time_CF_corr[%d]-time_CF_corr[%d])-time_CF_corr[%d])", MCPNumber, clockPos2, clockPos1, trigPos1); + // else + sprintf(t_CF_diff, "(time_CF[%d]-time_CF[%d])", MCPNumber, trigPos1); + sprintf(var_timeCFD_vs_TOT, "%s:%s>>%s", t_CF_diff, TOT_diff, pr_timeCFD_vs_TOT_name); + //---correction + if (strcmp(scanType,"multiplicity1")==0 || strcmp(scanType,"multiplicity2")==0) { + nt->Draw(var_timeCFD_vs_TOT, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD && cut_HODO, "goff"); + } + else { + nt->Draw(var_timeCFD_vs_TOT, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + } + //---skip run with low stat + + /* + if(pr_timeCFD_vs_TOT->GetEntries() < 200) + h_resCFD->Rebin(2); + if(pr_timeCFD_vs_TOT->GetEntries() < 50) + continue; + */ + + h_resCFD_noCorr->Rebin(4); + // if(h_resCFD_noCorr->GetEntries() < 50) h_resCFD_noCorr->Rebin(2); + + pr_timeCFD_vs_TOT->Fit(f_corrCFD, "QR"); + + //---draw res histo with corrections + + //RA + sprintf(var_timeCFD, "%s>>%s", + t_CF_diff, h_resCFD_noCorr_name); + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_mcp_not_sat + && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + + sprintf(var_timeCFD, "%s-(%f + %f*%s + %f*%s*%s)>>%s", + t_CF_diff, f_corrCFD->GetParameter(0), f_corrCFD->GetParameter(1), TOT_diff, + f_corrCFD->GetParameter(2), TOT_diff, TOT_diff, h_resCFD_name); + //f_corrCFD->GetParameter(3), TOT_diff, TOT_diff, TOT_diff, h_resCFD_name); + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_mcp_not_sat + && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + + + sprintf(var_timeCFD, "%s-(%f + %f*%s + %f*%s*%s)>>%s", + t_CF_diff, f_corrCFD->GetParameter(0), f_corrCFD->GetParameter(1), TOT_diff, + f_corrCFD->GetParameter(2), TOT_diff, TOT_diff, h_resCFD_TOTCorr_name); + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_mcp_not_sat + && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + + + if (strcmp(scanType,"multiplicity1")==0 || strcmp(scanType,"multiplicity2")==0) { + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_mcp_not_sat + && cut_trig_not_sat && cut_bad_timeCFD && cut_HODO, "goff"); + } + else { + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers && cut_mcp_not_sat + && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + } + //correction vs ampMax + + sprintf(var_timeCFD_red, "(%s-(%f + %f*%s + %f*%s*%s))", + t_CF_diff, f_corrCFD->GetParameter(0), f_corrCFD->GetParameter(1), TOT_diff, + f_corrCFD->GetParameter(2), TOT_diff, TOT_diff); + sprintf(var_timeCFD_vs_ampMax, "%s:amp_max_corr[%d]>>%s", var_timeCFD_red, MCPNumber, pr_timeCFD_vs_ampMaxCorr_name); + nt->Draw(var_timeCFD_vs_ampMax, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + + TFitResultPtr r = pr_timeCFD_vs_ampMaxCorr->Fit(f_corrCFD2, "QR"); + int status = int(r); + + + sprintf(var_timeCFD_vs_ampMaxNoCorr, "(%s):amp_max_corr[%d]>>%s", t_CF_diff, MCPNumber, pr_timeCFD_vs_ampMax_name); + nt->Draw(var_timeCFD_vs_ampMaxNoCorr, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + + // pr_timeCFD_vs_ampMax->Fit(f_corrCFD3, "QR"); + + std::cout << " >>> fitStatus = " << status << std::endl; + + //---draw res histo with corrections + /* + sprintf(var_timeCFD, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d])>>%s", + var_timeCFD_red, f_corrCFD2->GetParameter(0), f_corrCFD2->GetParameter(1), MCPNumber, + f_corrCFD2->GetParameter(2), MCPNumber, MCPNumber, + f_corrCFD2->GetParameter(3), MCPNumber, MCPNumber, MCPNumber, + f_corrCFD2->GetParameter(4), MCPNumber, MCPNumber, MCPNumber, MCPNumber, h_resCFD_name); + */ + if(status == 0){ + sprintf(var_timeCFD, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d])>>%s", + var_timeCFD_red, f_corrCFD2->GetParameter(0), f_corrCFD2->GetParameter(1), MCPNumber, + f_corrCFD2->GetParameter(2), MCPNumber, MCPNumber, + h_resCFD_name); + nt->Draw(var_timeCFD, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeCFD && cut_multiplicity && cut_HODO, "goff"); + } + + //if(h_resCFD->GetEntries() < 100) continue; + if(h_resCFD->GetEntries() < 25) continue; + + //---fit coincidence peak + f_resCFD->SetParameters(h_resCFD_noCorr->GetEntries(), h_resCFD_noCorr->GetMean(), h_resCFD_noCorr->GetRMS()); + f_resCFD->SetParLimits(1, h_resCFD_noCorr->GetMean()-1., h_resCFD_noCorr->GetMean()+1.); + f_resCFD->SetParLimits(2, 0.005, 0.5); + if( ( (HVVal.at(i) == 1600 || HVVal.at(i) == 1550 || HVVal.at(i) == 1450) && MCP == "Plana4") || + // ( (HVVal.at(i) == 2200 || HVVal.at(i) == 1600 || HVVal.at(i) == 1550 || HVVal.at(i) == 1450) && MCP == "Plana4" && strcmp(scanType, "X0") == 0) || + ( (HVVal.at(i) == 1800 || HVVal.at(i) == 1650 || HVVal.at(i) == 1550 || HVVal.at(i) == 1500) && MCP == "Plana2") || + ( (HVVal.at(i) == 2100 || HVVal.at(i) == 1900 || HVVal.at(i) == 1750) && MCP == "Plana1") ){ + f_resCFD->SetParLimits(1, -5.5, -4.5); + } + + //f_resCFD->SetRange(h_resCFD->GetMean()-1.5, h_resCFD->GetMean()+1.5); + // std::cout << " h_resCFD->GetMean()-1. = " << h_resCFD->GetMean()-1. << std::endl; + /* + h_resCFD->Fit(f_resCFD, "QRB"); + h_resCFD->Fit(f_resCFD, "QRBIM", "", f_resCFD->GetParameter(1)-2*f_resCFD->GetParameter(2), + f_resCFD->GetParameter(1)+2*f_resCFD->GetParameter(2)); + */ + h_resCFD_noCorr->Fit(f_resCFD, "QRB"); + h_resCFD_noCorr->Fit(f_resCFD, "QRBIM", "", f_resCFD->GetParameter(1)-2*f_resCFD->GetParameter(2), + f_resCFD->GetParameter(1)+2*f_resCFD->GetParameter(2)); + + TCanvas* cTres = new TCanvas(); + cTres->cd(); + h_resCFD->Draw(); + f_resCFD->SetLineColor(kBlue); + f_resCFD->Draw("same"); + + //---get resolution + float e_t_res = f_resCFD->GetParError(2)*1000.; + float t_res = f_resCFD->GetParameter(2)*1000.; + float prob = f_resCFD->GetProb(); + //---print results + graph + if(TString(scanType).Contains("HV1") == 1) + { + std::cout << " >>>>> HVVal.at(i) = " << HVVal.at(i) + << " >>>>> HV2Val.at(i) = " << HV2Val.at(i) << std::endl; + printf("%d\t%d\t%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),i, HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), HVVal.at(i), t_res); + g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); + + cTres->Print(Form("plots/resCFD_studies/fit/%s_%s_%s_HV%d_X0%d.png", MCP.c_str(), scanTypeIN, label, HVVal.at(i), X0Step.at(i)), "png"); + } + + else if(TString(scanType).Contains("HV2") == 1) + { + printf("%d\t%d\t%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),i, HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HV2Val.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), HV2Val.at(i), t_res); + g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); + } + else if(TString(scanType).Contains("HV12") == 1) + { + printf("%d\t%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), HVVal.at(i), t_res); + g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); + } + else + { + printf("%d\t%.3f\t%.1f\t%.1f\t%.1f\t%.3f\n", i, X0Step.at(i), t_res, 0., e_t_res, prob); + outputFile << X0Step.at(i)<<"\t"<SetPoint(g_resCFD->GetN(), X0Step.at(i), t_res); + g_resCFD->SetPointError(g_resCFD->GetN()-1, 0, e_t_res); + } + if(i == (ScanList.size()-1)) + printf("---------------------------------------\n"); + //---write plots in the out file + outROOT_CFD->cd(); + pr_timeCFD_vs_TOT->Write(); + pr_timeCFD_vs_ampMaxCorr->Write(); + pr_timeCFD_vs_ampMax->Write(); + gStyle->SetOptStat(0000); + gStyle->SetOptFit(1111); + h_resCFD->Write(); + h_resCFD_noCorr->Write(); + h_resCFD_TOTCorr->Write(); + pr_timeCFD_vs_TOT->Delete(); + pr_timeCFD_vs_ampMaxCorr->Delete(); + h_resCFD->Delete(); + } + //---Time resolution with LED and TOT correction--- + if(strcmp(doWhat, "timeLED") == 0 || strcmp(doWhat, "all") == 0) + { + //---print banner + if(i == 0) + { + printf("----------Time Resolution(ps)----------\n"); + printf(" #\t%s\tt_res\te_%s\te_t_res\tX_prob\n", var_name, var_name); + printf("---------------------------------------\n"); + } + //---create variables + char t_start_diff[100]; + // if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) + // sprintf(t_start_diff, "(time_start_150[%d]-(time_start_150[%d]-time_start_150[%d])-time_CF_corr[%d])", MCPNumber, clockPos2, clockPos1, trigPos1); + //else + //sprintf(t_start_diff, "(time_start_500[%d]-time_CF_corr[%d])", MCPNumber, trigPos1); + sprintf(t_start_diff, "(time_start_150[%d]-time_CF_corr[%d])", MCPNumber, trigPos1); + + //---change TOT for X0 runs + if(strcmp(scanType, "X0") == 0 && X0Step.at(i) != 0 && MCPNumber < 3) + { + //sprintf(TOT_diff, "(time_stop_500[%d]-time_start_500[%d])", MCPNumber, MCPNumber); + sprintf(TOT_diff, "(time_stop_150[%d]-time_start_150[%d])", MCPNumber, MCPNumber); + + // if (strcmp((inverted_MCPList.at(MCPNumber)).c_str(),"MiB3")==0) + // sprintf(t_start_diff, "(time_start_500[%d]-(time_start_500[%d]-time_start_500[%d])-time_CF_corr[%d])", MCPNumber,clockPos2,clockPos1,trigPos1); + //else + + //sprintf(t_start_diff, "(time_start_500[%d]-time_CF_corr[%d])", MCPNumber,trigPos1); + sprintf(t_start_diff, "(time_start_150[%d]-time_CF_corr[%d])", MCPNumber,trigPos1); + } + sprintf(var_timeLED_vs_TOT, "%s:%s>>%s", t_start_diff, TOT_diff, pr_timeLED_vs_TOT_name); + //---correction + nt->Draw(var_timeLED_vs_TOT, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + //---skip run with low stat + if(pr_timeLED_vs_TOT->GetEntries() < 200) + h_resLED->Rebin(2); + if(pr_timeLED_vs_TOT->GetEntries() < 50) + continue; + + pr_timeLED_vs_TOT->Fit(f_corrLED, "QR"); + + //---draw res histo with corrections + sprintf(var_timeLED, "%s>>%s", + t_start_diff, h_resLED_noCorr_name); + nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + sprintf(var_timeLED, "%s-(%f + %f*%s + %f*%s*%s)>>%s", + t_start_diff, f_corrLED->GetParameter(0), f_corrLED->GetParameter(1), TOT_diff, + f_corrLED->GetParameter(2), TOT_diff, TOT_diff, h_resLED_name); + nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + sprintf(var_timeLED, "%s-(%f + %f*%s + %f*%s*%s)>>%s", + t_start_diff, f_corrLED->GetParameter(0), f_corrLED->GetParameter(1), TOT_diff, + f_corrLED->GetParameter(2), TOT_diff, TOT_diff, h_resLED_TOTCorr_name); + nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + sprintf(var_timeLED_red, "(%s-(%f + %f*%s + %f*%s*%s))", + t_start_diff, f_corrLED->GetParameter(0), f_corrLED->GetParameter(1), TOT_diff, + f_corrLED->GetParameter(2), TOT_diff, TOT_diff); + sprintf(var_timeLED_vs_ampMax, "%s:amp_max_corr[%d]>>%s", var_timeLED_red, MCPNumber, pr_timeLED_vs_ampMaxCorr_name); + nt->Draw(var_timeLED_vs_ampMax, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + TFitResultPtr r = pr_timeLED_vs_ampMaxCorr->Fit(f_corrLED2, "QR"); + int status = (r); + + sprintf(var_timeLED_vs_ampMax_NoCorr, "%s:amp_max_corr[%d]>>%s", t_start_diff, MCPNumber, pr_timeLED_vs_ampMax_name); + nt->Draw(var_timeLED_vs_ampMax_NoCorr, cut_trig0 && cut_sig && cut_scan && cut_nFibers + && cut_tdc && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + // pr_timeLED_vs_ampMax->Fit(f_corrLED3, "QR"); + + + //---draw res histo with corrections + + + if(status == 0){ + //pol4 + /* + sprintf(var_timeLED, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d]*amp_max_corr[%d])>>%s", + var_timeLED_red, f_corrLED2->GetParameter(0), f_corrLED2->GetParameter(1), MCPNumber, + f_corrLED2->GetParameter(2), MCPNumber, MCPNumber, + f_corrLED2->GetParameter(3), MCPNumber, MCPNumber, MCPNumber, + f_corrLED2->GetParameter(4), MCPNumber, MCPNumber, MCPNumber, MCPNumber, h_resLED_name); + nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeLED, "goff"); + */ + //pol2 + sprintf(var_timeLED, "%s-(%f + %f*amp_max_corr[%d] + %f*amp_max_corr[%d]*amp_max_corr[%d])>>%s", + var_timeLED_red, f_corrLED2->GetParameter(0), f_corrLED2->GetParameter(1), MCPNumber, + f_corrLED2->GetParameter(2), MCPNumber, MCPNumber, h_resLED_name); + nt->Draw(var_timeLED, cut_trig0 && cut_sig && cut_scan && cut_tdc && cut_nFibers + && cut_trig_not_sat && cut_bad_timeLED && cut_HODO, "goff"); + + } + + if(h_resLED->GetEntries() < 100) continue; + + //---fit coincidence peak + f_resLED->SetParameters(h_resLED->GetEntries(), h_resLED->GetMean(), h_resLED->GetRMS()); + // f_resLED->SetParLimits(1, -0.05, 0.05); + // f_resLED->SetParLimits(2, 0.02, 0.5); + f_resLED->SetParLimits(1, h_resLED->GetMean()-1., h_resLED->GetMean()+1.); + f_resLED->SetParLimits(2, 0.01, 0.5); + /* + + if( ( (HVVal.at(i) == 1600 || HVVal.at(i) == 1550 || HVVal.at(i) == 1450) && MCP == "Plana4") || + ( (HVVal.at(i) == 1800 || HVVal.at(i) == 1650 || HVVal.at(i) == 1550) && MCP == "Plana2") ){ + f_resLED->SetParLimits(1, -5.5, -4.5); + + } + */ + /* + h_resLED->Fit(f_resLED, "QRB"); + h_resLED->Fit(f_resLED, "QRBIM", "", f_resLED->GetParameter(1)-2*f_resLED->GetParameter(2), + f_resLED->GetParameter(1)+2*f_resLED->GetParameter(2)); + */ + h_resLED->Fit(f_resLED, "QRB"); + h_resLED->Fit(f_resLED, "QRBIM", "", f_resLED->GetParameter(1)-2*f_resLED->GetParameter(2), + f_resLED->GetParameter(1)+2*f_resLED->GetParameter(2)); + + TCanvas* cTres = new TCanvas(); + cTres->cd(); + h_resCFD->Draw(); + f_resCFD->SetLineColor(kBlue); + f_resCFD->Draw("same"); + + //---get resolution + float e_t_res = f_resLED->GetParError(2)*1000.; + float t_res = f_resLED->GetParameter(2)*1000.; + float prob = f_resLED->GetProb(); + //---print results + graph + if(TString(scanType).Contains("HV1") == 1) + { + printf("%d\t%d\t%%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),i, HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resLED->GetN(), HVVal.at(i), t_res); + g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); + + cTres->Print(Form("plots/resLED_studies/fit/%s_%s_%s_HV%d_X0%d.png", MCP.c_str(), scanTypeIN, label, HVVal.at(i), X0Step.at(i)), "png"); + } + else if(TString(scanType).Contains("HV12") == 1) + { + printf("%d\t%d\t%%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),i, HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HV2Val.at(i)<<"\t"<SetPoint(g_resLED->GetN(), HV2Val.at(i), t_res); + g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); + } + else if(TString(scanType).Contains("HV12") == 1) + { + printf("%d\t%d\t%%d\t%d\t%.1f\t%.0f\t%.1f\t%.3f\n", i, HVVal.at(i),i, HV2Val.at(i), t_res, 0., e_t_res, prob); + outputFile << HVVal.at(i)<<"\t"<SetPoint(g_resLED->GetN(), HVVal.at(i), t_res); + g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); + } + else + { + printf("%d\t%.3f\t%.1f\t%.1f\t%.1f\t%.3f\n", i, X0Step.at(i), t_res, 0., e_t_res, prob); + outputFile << X0Step.at(i)<<"\t"<SetPoint(g_resLED->GetN(), X0Step.at(i), t_res); + g_resLED->SetPointError(g_resLED->GetN()-1, 0, e_t_res); + } + if(i == (ScanList.size()-1)) + printf("---------------------------------------\n"); + //---write plots in the out file + outROOT_LED->cd(); + pr_timeLED_vs_TOT->Write(); + pr_timeLED_vs_ampMaxCorr->Write(); + pr_timeLED_vs_ampMax->Write(); + gStyle->SetOptStat(0000); + gStyle->SetOptFit(1111); + h_resLED->Write(); + h_resLED_noCorr->Write(); + h_resLED_TOTCorr->Write(); + pr_timeLED_vs_TOT->Delete(); + pr_timeLED_vs_ampMaxCorr->Delete(); + h_resLED->Delete(); + } + } + + //---Save global scan graph--- + //---efficiency + if(outROOT_eff) + { + outROOT_eff->cd(); + g_eff->Write(); + g_frac_saturated->Write(); + outROOT_eff->Close(); + std::cout << " >>> outROOT_eff -> Name() = " << outROOT_eff->GetName() << std::endl; + + } + //---charge + if(outROOT_Q) + { + outROOT_Q->cd(); + g_Q->Write(); + g_frac_saturated->Write(); + outROOT_Q->Close(); + } + //---time resolution CFD + if(outROOT_CFD) + { + outROOT_CFD->cd(); + g_resCFD->Write(); + g_frac_saturated->Write(); + outROOT_CFD->Close(); + } + //---time resolution LED + if(outROOT_LED) + { + outROOT_LED->cd(); + g_resLED->Write(); + g_frac_saturated->Write(); + outROOT_LED->Close(); + } + + // + std::cout<<"results printed in results/"<Close(); + + return 0; +} + diff --git a/TB/bin/calcTreshold.cpp b/bin/calcTreshold.cpp similarity index 95% rename from TB/bin/calcTreshold.cpp rename to bin/calcTreshold.cpp index e5b6025..882f1b3 100644 --- a/TB/bin/calcTreshold.cpp +++ b/bin/calcTreshold.cpp @@ -56,8 +56,10 @@ int main (int argc, char** argv) std::cout<<"-----------COMPUTING CHARGE TRESHOLDS FOR EACH CHANNEL------------"<treshold and PC is ON---------"<Load("libTree"); + int SBTreshold=1000; - int nChannels=9; + int nChannels=18; int HVtresh=2000; std::string inputFileName = argv[1]; @@ -87,10 +89,10 @@ int main (int argc, char** argv) TLegend* leg = new TLegend(0.88,0.45,0.98,0.65); TGraph* g_SoB[20]; - TF1* base[10]; - TF1* base2sig[10]; + TF1* base[18]; + TF1* base2sig[18]; - TCanvas* baseFit[10]; + TCanvas* baseFit[18]; //------analyze the good channels and compute the charge tresholds-------- std::cout<<"\n--------------------------------\n-->OK, now computing tresholds:"<>%s", iCh, hSName); + sprintf(hSDraw, "charge[%d]>>%s", iCh, hSName); sprintf(hBDraw, "baseline[%d]>>%s", iCh, hBName); sprintf(hBDrawFit, "baseline[%d]>>%s", iCh, hBNameFit); char cut[300]; - sprintf(cut, "isPCOn[%d]!=2 && HV[%d]>=%d && tdcX > -8 && tdcX < 0 && tdcY >-2 && tdcY < 6", iCh, iCh, HVtresh); + // sprintf(cut, "isPCOn[%d]!=2 && HV[%d]>=%d && tdcX > -8 && tdcX < 0 && tdcY >-2 && tdcY < 6", iCh, iCh, HVtresh); + sprintf(cut, "isPCOn[%d]!=2 && HV[%d]>=%d", iCh, iCh, HVtresh); inputTree->Draw(hSDraw,cut,"goff"); inputTree->Draw(hBDraw,cut); diff --git a/TB/bin/calcTreshold_fitTemplate.cpp b/bin/calcTreshold_fitTemplate.cpp similarity index 100% rename from TB/bin/calcTreshold_fitTemplate.cpp rename to bin/calcTreshold_fitTemplate.cpp diff --git a/bin/drawEfficiency.cpp b/bin/drawEfficiency.cpp new file mode 100644 index 0000000..d61fb96 --- /dev/null +++ b/bin/drawEfficiency.cpp @@ -0,0 +1,950 @@ +/***************************************************************************************** + This program draws efficiency plots + +****************************************************************************************/ +#include +#include +#include +#include + +#include "TROOT.h" +#include "TSystem.h" +#include "TKey.h" +#include "TFile.h" +#include "TTree.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TProfile.h" +#include "TF1.h" +#include "TString.h" +#include "TCut.h" +#include "TMath.h" +#include "TApplication.h" +#include "TError.h" +#include "TCanvas.h" +#include "TGraphErrors.h" +#include "TPad.h" +#include "TStyle.h" +#include "TMultiGraph.h" +#include "TLegend.h" +#include "TPaveLabel.h" +#include "TPaveText.h" + +using namespace std; + +void banner4Plot (){ + TPaveText* pt ; + pt = new TPaveText(.14,0.91,.25,.94,"NDC"); + pt->AddText("Preliminary"); + pt->SetFillColor(0); + pt->SetTextSize(0.035); + pt->SetFillStyle(0); + pt->SetLineColor(0); + pt->SetLineWidth(0); + pt->SetMargin(0); + pt->SetShadowColor(0); + pt->Draw(); +} + +int main(int argc, char** argv) +{ + + std::string plot_type = argv[1]; + //"HVScan"; + // std::string plot_type = "AngScanHigh"; + // std::string plot_type = "scanX0_HVLow_50"; + // std::string plot_type = "scanX0_HVLow_20"; + std::cout<Get("eff"); + TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + //eff_GaAsEm_OFF->SetMarkerColor(kGreen+1); + //eff_GaAsEm_OFF->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + // + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); +// eff_GaAsEm_OFF->SetMarkerStyle(22); +// eff_GaAsEm_OFF->SetLineWidth(2); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(22); + eff_MultiAlkEm->SetLineWidth(2); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk. emitt. ON: #DeltaV_{12} = 300 V", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. ON: #DeltaV_{12} = 300 V", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = HV_{2}", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = HV_{2}", "p"); + + mg->Add(eff_GaAsEm); +// mg->Add(eff_GaAsEm_OFF); + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + mg->Add(eff_MultiAlkEm); + + // TCanvas* c = new TCanvas("cEff","cEff",400,800); + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("APL"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1200,4000); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.05); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.05); + mg->SetMaximum(1); + mg->SetMinimum(0); + mg->Draw("APL"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + +/////----------------------------------------------------------------------------////////////// + +if(plot_type == "HV1"){ + legC = new TLegend(0.52,0.58,0.80,0.83,NULL,"brNDC"); + + //plot name MCPName_ScanType_HVScanScanType_MCPName + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_HV1_HVScan1_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_HV1_HVScan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_HV1_HVScan1_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_HV1_HVScan1_Double9040.root"); + TGraphErrors* eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + //eff_GaAsEm_OFF->SetMarkerColor(kGreen+1); + //eff_GaAsEm_OFF->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + // + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); +// eff_GaAsEm_OFF->SetMarkerStyle(22); +// eff_GaAsEm_OFF->SetLineWidth(2); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(22); + eff_MultiAlkEm->SetLineWidth(2); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt. HV_{2} = 3100 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. HV_{2} = 3100 (V)", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); +// legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 2700 (V)", "p"); +// legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); +// mg->Add(eff_GaAsEm_OFF); + // mg->Add(eff_Double9090); + // mg->Add(eff_Double9040); + mg->Add(eff_MultiAlkEm); + + // TCanvas* c = new TCanvas("cEff","cEff",400,800); + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("APL"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1200,4000); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.05); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.05); + mg->SetMaximum(1); + mg->SetMinimum(0); + mg->Draw("APL"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + +/////----------------------------------------------------------------------------////////////// + +if(plot_type == "HV2"){ + legC = new TLegend(0.12,0.62,0.40,0.87,NULL,"brNDC"); + + //plot name MCPName_ScanType_HVScanScanType_MCPName + // inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_HV1_HVScan1_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + //inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_HV1_HVScan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_HV2_HVScan2_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_HV2_HVScan2_Double9040.root"); + inF_Double9090b = TFile::Open("plots/efficiency_studies/Double9090_HV1_HVScan1_Double9090.root"); + inF_Double9040b = TFile::Open("plots/efficiency_studies/Double9040_HV1_HVScan1_Double9040.root"); + //TGraphErrors* eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + TGraphErrors* eff_Double9090b = (TGraphErrors*)inF_Double9090b->Get("eff"); + TGraphErrors* eff_Double9040b = (TGraphErrors*)inF_Double9040b->Get("eff"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + // + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + + + eff_Double9040b->SetMarkerColor(kBlue); + eff_Double9040b->SetLineColor(kBlue); + eff_Double9090b->SetMarkerColor(kRed); + eff_Double9090b->SetLineColor(kRed); + // + eff_Double9040b->SetMarkerStyle(22); + eff_Double9040b->SetLineWidth(2); + eff_Double9040b->SetMarkerSize(0.9); + eff_Double9090b->SetMarkerStyle(22); + eff_Double9090b->SetLineWidth(2); + eff_Double9090b->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = 2700 (V), scan on HV_{2}", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = 2700 (V), scan on HV_{2}", "p"); + + legC->AddEntry(eff_Double9040b, "Double9040 HV_{2} = 2700 (V), scan on HV_{1}", "p"); + legC->AddEntry(eff_Double9090b, "Double9090 HV_{2} = 2700 (V), scan on HV_{1}", "p"); + + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + mg->Add(eff_Double9090b); + mg->Add(eff_Double9040b); + + // TCanvas* c = new TCanvas("cEff","cEff",400,800); + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("APL"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1200,4000); + mg->GetXaxis()->SetTitle("HV_{1} or HV_{2} (V)"); + mg->GetXaxis()->SetTitleSize(0.05); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.05); + mg->SetMaximum(1); + mg->SetMinimum(0); + mg->Draw("APL"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + +/////----------------------------------------------------------------------------////////////// + +if(plot_type == "Extreme"){ + legC = new TLegend(0.12,0.72,0.30,0.87,NULL,"brNDC"); + + //plot name MCPName_ScanType_HVScanScanType_MCPName + // inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_HV1_HVScan1_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + //inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_HV1_HVScan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_HV1_HVScanExt_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_HV1_HVScanExt_Double9040.root"); + //TGraphErrors* eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + //TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + // + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 3000 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 3000 (V)", "p"); + + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + + // TCanvas* c = new TCanvas("cEff","cEff",400,800); + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("APL"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(2200,4000); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.05); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.05); + mg->SetMaximum(1); + mg->SetMinimum(0); + mg->Draw("APL"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + +/////----------------------------------------------------------------------------////////////// + +if(plot_type == "Ang"){ + legC = new TLegend(0.12,0.62,0.40,0.87,NULL,"brNDC"); + + //plot name MCPName_ScanType_HVScanScanType_MCPName + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_Ang_AngScan_Double9040.root"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + // + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = 2700 V, HV_{2} = 2700 V", "p"); + + mg->Add(eff_Double9040); + + // TCanvas* c = new TCanvas("cEff","cEff",400,800); + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("APL"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-1,50); + mg->GetXaxis()->SetTitle("Angle (degrees)"); + mg->GetXaxis()->SetTitleSize(0.05); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.05); + mg->SetMaximum(0.9); + mg->SetMinimum(0.5); + mg->Draw("APL"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + +/////----------------------------------------------------------------------------////////////// + + + if(plot_type == "X0_12"){ + legC = new TLegend(0.15,0.15,0.45,0.32,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_X0_X0Scan12_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_X0_X0Scan12_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_X0_X0Scan12_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_X0_X0Scan12_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("ALP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("Number of X_{0}"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(1.05); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (ON) HV_{1} = -3800 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (ON) HV_{1} = -3400 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + + mg->Draw("ALP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->Print(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + +/////----------------------------------------------------------------------------////////////// + + + if(plot_type == "X0_1"){ + legC = new TLegend(0.15,0.15,0.45,0.32,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_X0_X0Scan1_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_X0_X0Scan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_X0_X0Scan1_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_X0_X0Scan1_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("ALP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("Number of X_{0}"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(1.05); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (OFF) HV_{1} = -3450 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (OFF) HV_{1} = -3050 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + + mg->Draw("ALP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->Print(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "multiplicity1"){ + legC = new TLegend(0.15,0.15,0.45,0.32,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_multiplicity1_LongScan0X0_GaAsEm_1.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_multiplicity1_LongScan0X0_MultiAlkEm_1.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_multiplicity1_LongScan0X0_Double9090_1.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_multiplicity1_LongScan0X0_Double9040_1.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("ALP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("multiplicity"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(1.05); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (ON) HV_{1} = -3800 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (ON) HV_{1} = -3400 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + + mg->Draw("ALP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->Print(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + +/////----------------------------------------------------------------------------////////////// + + + if(plot_type == "multiplicity2"){ + legC = new TLegend(0.15,0.15,0.45,0.32,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_multiplicity2_LongScan0X0_GaAsEm_2.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_multiplicity2_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_multiplicity2_LongScan0X0_MultiAlkEm_2.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_multiplicity2_LongScan0X0_Double9090_2.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_multiplicity2_LongScan0X0_Double9040_2.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("ALP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("multiplicity"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(1.05); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (OFF) HV_{1} = -3450 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (OFF) HV_{1} = -3050 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + + mg->Draw("ALP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->Print(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + +/////----------------------------------------------------------------------------////////////// + + if(plot_type == "LongScan2X0"){ + legC = new TLegend(0.15,0.15,0.45,0.32,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/efficiency_studies/GaAsEm_HV1_LongScan2X0_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_multiplicity2_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/efficiency_studies/MultiAlkEm_HV1_LongScan2X0_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/efficiency_studies/Double9090_HV1_LongScan2X0_Double9090.root"); + inF_Double9040 = TFile::Open("plots/efficiency_studies/Double9040_HV1_LongScan2X0_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("eff"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("eff"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("eff"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("eff"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/efficiency_%s.pdf", plot_type.c_str()); + + mg->Draw("ALP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,3800); + mg->GetXaxis()->SetTitle("HV_{2} (V)"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Efficiency"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(1.05); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt. HV_{2} = 3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. HV_{2} = 3100 (V)", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 2700 (V)", "p"); + + mg->Draw("ALP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/efficiency_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/efficiency_%s.root", plot_type.c_str()); + c->Print(plot_name, "root"); + sprintf(plot_name, "final_plots/efficiency_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + return 0; +} + diff --git a/bin/drawResolutionCFD.cpp b/bin/drawResolutionCFD.cpp new file mode 100644 index 0000000..72b7179 --- /dev/null +++ b/bin/drawResolutionCFD.cpp @@ -0,0 +1,1097 @@ +/***************************************************************************************** + This program draws time resolution plots + +****************************************************************************************/ +#include +#include +#include +#include + +#include "TROOT.h" +#include "TSystem.h" +#include "TKey.h" +#include "TFile.h" +#include "TTree.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TProfile.h" +#include "TF1.h" +#include "TString.h" +#include "TCut.h" +#include "TMath.h" +#include "TApplication.h" +#include "TError.h" +#include "TCanvas.h" +#include "TGraphErrors.h" +#include "TPad.h" +#include "TStyle.h" +#include "TMultiGraph.h" +#include "TLegend.h" +#include "TPaveLabel.h" +#include "TPaveText.h" + +using namespace std; + +void banner4Plot (){ + TPaveText* pt ; + pt = new TPaveText(.14,0.91,.25,.94,"NDC"); + pt->AddText("Preliminary"); + pt->SetFillColor(0); + pt->SetTextSize(0.035); + pt->SetFillStyle(0); + pt->SetLineColor(0); + pt->SetLineWidth(0); + pt->SetMargin(0); + pt->SetShadowColor(0); + pt->Draw(); +} + +int main(int argc, char** argv) +{ + + std::string plot_type = argv[1]; + + std::cout<Get("resCFD"); + TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + //eff_GaAsEm_OFF->SetMarkerColor(kGreen+1); + //eff_GaAsEm_OFF->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + // + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); +// eff_GaAsEm_OFF->SetMarkerStyle(22); +// eff_GaAsEm_OFF->SetLineWidth(2); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(22); + eff_MultiAlkEm->SetLineWidth(2); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk. emitt. ON: #DeltaV_{12} = 300 V", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. ON: #DeltaV_{12} = 300 V", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = HV_{2}", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = HV_{2}", "p"); + + mg->Add(eff_GaAsEm); +// mg->Add(eff_GaAsEm_OFF); + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + mg->Add(eff_MultiAlkEm); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,4000); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(200); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "HV1"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_HV1_HVScan1_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_HV1_HVScan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_HV1_HVScan1_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_HV1_HVScan1_Double9040.root"); + TGraphErrors* eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + //eff_GaAsEm_OFF->SetMarkerColor(kGreen+1); + //eff_GaAsEm_OFF->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + // + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); +// eff_GaAsEm_OFF->SetMarkerStyle(22); +// eff_GaAsEm_OFF->SetLineWidth(2); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(22); + eff_MultiAlkEm->SetLineWidth(2); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt. HV_{2} = 3100 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. HV{2} = 3100 (V)", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); +// mg->Add(eff_GaAsEm_OFF); + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + mg->Add(eff_MultiAlkEm); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,3800); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(200); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "HV2"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_HV2_HVScan2_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_HV2_HVScan2_Double9040.root"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + + // + + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = 2700 (V)", "p"); + + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,3800); + mg->GetXaxis()->SetTitle("HV_{2} (V)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(200); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "Extreme"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_HV1_HVScanExt_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_HV1_HVScanExt_Double9040.root"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + + // + + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 3000 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 3000 (V)", "p"); + + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,3800); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(200); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "Ang"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_Ang_AngScan_Double9040.root"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + + // + + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = 2700 V, HV_{2} = 2700 V", "p"); + + mg->Add(eff_Double9040); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-1,50); + mg->GetXaxis()->SetTitle("Angle (degrees)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(200); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "X0_12"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_X0_X0Scan12_GaAsEm.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_X0_X0Scan12_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_X0_X0Scan12_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_X0_X0Scan12_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (ON) HV_{1} = -3800 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (ON) HV_{1} = -3400 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("Number of X_{0}"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "X0_1"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_X0_X0Scan1_GaAsEm.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_X0_X0Scan1_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_X0_X0Scan1_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_X0_X0Scan1_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (OFF) HV_{1} = -3450 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (OFF) HV_{1} = -3050 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("Number of X_{0}"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "multiplicity1"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_multiplicity1_LongScan0X0_GaAsEm_1.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_multiplicity1_LongScan0X0_MultiAlkEm_1.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_multiplicity1_LongScan0X0_Double9090_1.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_multiplicity1_LongScan0X0_Double9040_1.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("multiplicity"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (ON) HV_{1} = -3800 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (ON) HV_{1} = -3400 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "multiplicity2"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_multiplicity2_LongScan0X0_GaAsEm_2.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_multiplicity2_LongScan0X0_MultiAlkEm_2.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_multiplicity2_LongScan0X0_Double9090_2.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_multiplicity2_LongScan0X0_Double9040_2.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (OFF) HV_{1} = -3450 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (OFF) HV_{1} = -3050 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2400 (V), HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("multiplicity"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + /////----------------------------------------------------------------------------////////////// + + if(plot_type == "LongScan2X0"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_HV1_LongScan2X0_GaAsEm.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_HV1_LongScan2X0_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_HV1_LongScan2X0_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_HV1_LongScan2X0_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("resCFD"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("resCFD"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("resCFD"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("resCFD"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt. HV_{2} = 3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. HV_{2} = 3100 (V)", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,3800); + mg->GetXaxis()->SetTitle("HV_{2} (V)"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("Spread on the time difference (ps)"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + if(plot_type == "saturated_HV12"){ + legC = new TLegend(0.15,0.60,0.35,0.85,NULL,"brNDC"); + + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_HV12_HVScan12_MultiAlkEm.root"); + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_HV12_HVScan12_GaAsEm.root"); + //inF_GaAsEm_OFF = TFile::Open("plots/efficiency_studies/GaAsEm_HV_HVScan7.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_HV12_HVScan12_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_HV12_HVScan12_Double9040.root"); + TGraphErrors* eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("frac_saturated"); + TGraphErrors* eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("frac_saturated"); + TGraphErrors* eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("frac_saturated"); + TGraphErrors* eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("frac_saturated"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + //eff_GaAsEm_OFF->SetMarkerColor(kGreen+1); + //eff_GaAsEm_OFF->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + // + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); +// eff_GaAsEm_OFF->SetMarkerStyle(22); +// eff_GaAsEm_OFF->SetLineWidth(2); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(22); + eff_MultiAlkEm->SetLineWidth(2); + + legC->SetTextFont(42); + legC->SetTextSize(0.034); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk. emitt. ON: #DeltaV_{12} = 300 V", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. ON: #DeltaV_{12} = 300 V", "p"); +// legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = HV_{2}", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = HV_{2}", "p"); + + mg->Add(eff_GaAsEm); +// mg->Add(eff_GaAsEm_OFF); + mg->Add(eff_Double9090); + mg->Add(eff_Double9040); + mg->Add(eff_MultiAlkEm); + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(1400,4000); + mg->GetXaxis()->SetTitle("HV_{1} (V)"); + mg->GetXaxis()->SetTitleSize(0.048); + mg->GetYaxis()->SetTitle("% of saturated events"); + mg->GetYaxis()->SetTitleSize(0.048); + mg->SetMaximum(100); + mg->SetMinimum(0); + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + if(plot_type == "saturated_X0_12"){ + legC = new TLegend(0.15,0.65,0.35,0.85,NULL,"brNDC"); + + inF_GaAsEm = TFile::Open("plots/resCFD_studies/GaAsEm_X0_X0Scan12_GaAsEm.root"); + inF_MultiAlkEm = TFile::Open("plots/resCFD_studies/MultiAlkEm_X0_X0Scan12_MultiAlkEm.root"); + inF_Double9090 = TFile::Open("plots/resCFD_studies/Double9090_X0_X0Scan12_Double9090.root"); + inF_Double9040 = TFile::Open("plots/resCFD_studies/Double9040_X0_X0Scan12_Double9040.root"); + + TGraphErrors* eff_GaAsEm; + TGraphErrors* eff_MultiAlkEm; + TGraphErrors* eff_Double9090; + TGraphErrors* eff_Double9040; + + + eff_GaAsEm = (TGraphErrors*)inF_GaAsEm->Get("frac_saturated"); + eff_MultiAlkEm = (TGraphErrors*)inF_MultiAlkEm->Get("frac_saturated"); + eff_Double9090 = (TGraphErrors*)inF_Double9090->Get("frac_saturated"); + eff_Double9040 = (TGraphErrors*)inF_Double9040->Get("frac_saturated"); + + //settings + eff_GaAsEm->SetMarkerColor(kGreen+1); + eff_GaAsEm->SetLineColor(kGreen+1); + eff_Double9040->SetMarkerColor(kBlue); + eff_Double9040->SetLineColor(kBlue); + eff_Double9090->SetMarkerColor(kRed); + eff_Double9090->SetLineColor(kRed); + eff_MultiAlkEm->SetMarkerColor(1); + eff_MultiAlkEm->SetLineColor(1); + eff_GaAsEm->SetMarkerStyle(20); + eff_GaAsEm->SetLineWidth(2); + eff_GaAsEm->SetMarkerSize(0.9); + eff_Double9040->SetMarkerStyle(20); + eff_Double9040->SetLineWidth(2); + eff_Double9040->SetMarkerSize(0.9); + eff_Double9090->SetMarkerStyle(20); + eff_Double9090->SetLineWidth(2); + eff_Double9090->SetMarkerSize(0.9); + eff_MultiAlkEm->SetMarkerStyle(20); + eff_MultiAlkEm->SetLineWidth(2); + eff_MultiAlkEm->SetMarkerSize(0.9); + + legC->SetTextFont(42); + legC->SetTextSize(0.037); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + legC->AddEntry(eff_MultiAlkEm, "MultiAlk emitt (ON) HV_{1} = -3800 HV_{2} = -3500 (V)", "p"); + legC->AddEntry(eff_GaAsEm, "GaAs emitt. (ON) HV_{1} = -3400 (V) HV_{2} = -3100 (V)", "p"); + //legC->AddEntry(eff_GaAsEm_OFF, "GaAs emitt. - iMCP mode", "p"); + legC->AddEntry(eff_Double9040, "Double9040 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + legC->AddEntry(eff_Double9090, "Double9090 HV_{1} = -2700 (V), HV_{2} = 2700 (V)", "p"); + + mg->Add(eff_GaAsEm); + mg->Add(eff_Double9090); + mg->Add(eff_MultiAlkEm); + mg->Add(eff_Double9040); + + + TCanvas* c = new TCanvas(); + gPad->SetTicks(); + char plot_name[100]; + std::string command = "if [ ! -e final_plots/ ] ; then mkdir final_plots ; fi"; + system(command.c_str()); + sprintf(plot_name, "final_plots/timeResCFD_%s.pdf", plot_type.c_str()); + + mg->Draw("AP"); + mg->SetTitle("Electron Beam 450 MeV"); + mg->GetXaxis()->SetRangeUser(-0.1,7.2); + mg->GetXaxis()->SetTitle("Number of X_{0}"); + mg->GetXaxis()->SetTitleSize(0.046); + mg->GetYaxis()->SetTitle("% of saturated events"); + mg->GetYaxis()->SetTitleSize(0.046); + mg->SetMaximum(200); + mg->SetMinimum(0); + + mg->Draw("AP"); + legC->Draw("same"); + banner4Plot(); + c->Update(); + + c->Print(plot_name, "pdf"); + sprintf(plot_name, "final_plots/timeResCFD_%s.png", plot_type.c_str()); + c->Print(plot_name, "png"); + + sprintf(plot_name, "final_plots/timeResCFD_%s.root", plot_type.c_str()); + c->SaveAs(plot_name, "root"); + sprintf(plot_name, "final_plots/timeResCFD_%s.C", plot_type.c_str()); + c->SaveAs(plot_name, "C"); + } + + + return 0; +} + diff --git a/TB/bin/drawResolutionLED.cpp b/bin/drawResolutionLED.cpp similarity index 100% rename from TB/bin/drawResolutionLED.cpp rename to bin/drawResolutionLED.cpp diff --git a/TB/bin/drawSaturatedFrac.cpp b/bin/drawSaturatedFrac.cpp similarity index 100% rename from TB/bin/drawSaturatedFrac.cpp rename to bin/drawSaturatedFrac.cpp diff --git a/TB/bin/drawWaveform.cpp b/bin/drawWaveform.cpp similarity index 71% rename from TB/bin/drawWaveform.cpp rename to bin/drawWaveform.cpp index 93eab2d..0a3a88e 100644 --- a/TB/bin/drawWaveform.cpp +++ b/bin/drawWaveform.cpp @@ -59,6 +59,7 @@ int main (int argc, char** argv) int channel = atoi (argv[3]); int firstEntry = atoi (argv[4]); int nEvents = atoi (argv[5]); + int trigPos = atoi(argv[6]); nEvents += firstEntry; std::cout << " >>> run = " << run << std::endl; @@ -78,49 +79,51 @@ int main (int argc, char** argv) int triggerTime; //--reading wire chamber from other tree -- - TChain* t1 = new TChain("outputTree"); - InitTree2(t1); + // TChain* tC = new TChain("outputTree"); + // InitTree2(tC); //---Chain TChain* chain = new TChain("H4tree"); InitTree(chain); - char command1[300]; - sprintf(command1, "find %s/%d/*/dqmPlotstotal.root > listTemp.txt", (inputFolder).c_str(), run); - system(command1); + // char command1[300]; + // sprintf(command1, "find %s/%d/*/dqmPlotstotal.root > listTemp.txt", (inputFolder).c_str(), run); + // system(command1); char command2[300]; - sprintf(command2, "find %s/%d/[0-9]*.root > listTemp2.txt", (inputFolder).c_str(), run); + sprintf(command2, "find %s/%d.root > listTemp2.txt", (inputFolder).c_str(), run); system(command2); - ifstream rootList ("listTemp.txt"); + // ifstream rootList ("listTemp.txt"); ifstream rootList2 ("listTemp2.txt"); - while (!rootList.eof() && !rootList2.eof()) + // while (!rootList.eof() && !rootList2.eof()) + while (!rootList2.eof()) { - char iRun_tW[70]; - rootList >> iRun_tW; + // char iRun_tW[70]; + // rootList >> iRun_tW; char iRun_str[70]; rootList2 >> iRun_str; - TChain* tTemp = new TChain("outputTree"); - tTemp->Add(iRun_tW); + // TChain* tTemp = new TChain("outputTree"); + // tTemp->Add(iRun_tW); TChain* tTempH4 = new TChain("H4tree"); tTempH4->Add(iRun_str); - if (tTemp->GetEntries() == tTempH4->GetEntries()) + // if (tTemp->GetEntries() == tTempH4->GetEntries()) + if (tTempH4->GetEntries()) { - t1->Add(iRun_tW); + // tC->Add(iRun_tW); chain->Add(iRun_str); } else std::cout<<"Bad spill found.. Skipped"< 1024*10 - 1) break; // std::cout << " >>> iSample = " << iSample << std::endl; // std::cout << " >>> digiChannel[iSample] = " << digiChannel[iSample] << std::endl; @@ -163,24 +165,25 @@ int main (int argc, char** argv) int i=0; //---loop over MPC's channels - triggerTime=100; + triggerTime=100; if (iEntry>=firstEntry) { - - SubtractBaseline(5, 25, &digiCh[4]); - triggerTime=int(TimeConstFrac(triggerTime, 300, &digiCh[4], 1.)/0.2); + SubtractBaseline(5, 25, &digiCh[trigPos]); + triggerTime=int(TimeConstFrac(triggerTime, 400, &digiCh[trigPos], 1.)/0.2); if (triggerTime<100 || triggerTime >800) continue; + int ampMaxTimeTemp = TimeConstFrac(triggerTime-50, triggerTime+50, &digiCh[channel], 1)/0.2; - int intTrigger = -ComputeIntegral(triggerTime-18, triggerTime+12, &digiCh[4]); - if (intTrigger<125) continue; + t1 = ampMaxTimeTemp-13; + t2 = ampMaxTimeTemp+12; - ampMaxTimeTemp = TimeConstFrac(triggerTime-50, triggerTime+50, &digiCh[channel], 1)/0.2; - if (channel!=4) SubtractBaseline(ampMaxTimeTemp-40, ampMaxTimeTemp-20, &digiCh[channel]); + // if (channel!=trigPos) SubtractBaseline(t1-27, t1-7, &digiCh[channel]); + if (channel!=trigPos) SubtractBaseline(25, 50, &digiCh[channel]); + if(t1 > 50 && t1 < 1024 && t2 > 50 && t2 < 1024) ampMaxTimeTemp = AmpMax(t1, t2, &digiCh[channel]); + ampMaxTimeTemp = AmpMax(47, 500, &digiCh[channel]); - int ampMax = AmpMax(ampMaxTimeTemp-13, ampMaxTimeTemp+12, &digiCh[channel]); - timeCF = TimeConstFracAbs(ampMaxTimeTemp-23, ampMaxTimeTemp+22, &digiCh[channel], 0.5, ampMax); - // if (-AmpMax(5, 25, &digiCh[channel])<-200) std::cout<Draw("PL,same"); } - if (channel!=4) { - line = new TLine(ampMaxTimeTemp-13, -2000, ampMaxTimeTemp-13, 200); - line2 = new TLine(ampMaxTimeTemp+12, -2000, ampMaxTimeTemp+12, 200); - line3 = new TLine(ampMaxTimeTemp-20, -2000, ampMaxTimeTemp-20, 200); - line4 = new TLine(ampMaxTimeTemp-40, -2000, ampMaxTimeTemp-40, 200); + if (channel!=trigPos) { + line = new TLine(t1, -2000, t1, 200); + line2 = new TLine(t2, -2000, t2, 200); + line3 = new TLine(t1-7, -2000, t1-7, 200); + line4 = new TLine(t1-27, -2000, t1-27, 200); line5 = new TLine(triggerTime-50, -2000, triggerTime-50, 200); line6 = new TLine(triggerTime+50, -2000, triggerTime+50, 200); line7 = new TLine(timeCF, -2000, timeCF, 200); mgWF->Draw("apl"); - line->DrawLine(ampMaxTimeTemp-13, -2000, ampMaxTimeTemp-13, 200); + line->DrawLine(t1, -2000, t1, 200); line->SetLineColor(2); line->Draw("same"); - line2->DrawLine(ampMaxTimeTemp+12, -2000, ampMaxTimeTemp+12, 200); + line2->DrawLine(t2, -2000, t2, 200); line2->SetLineColor(2); line2->Draw("same"); - line3->DrawLine(ampMaxTimeTemp-20, -2000, ampMaxTimeTemp-20, 200); + line3->DrawLine(t1-7, -2000, t1-7, 200); line3->SetLineColor(4); line3->Draw("same"); - line4->DrawLine(ampMaxTimeTemp-40, -2000, ampMaxTimeTemp-40, 200); + line4->DrawLine(t1-27, -2000, t1-27, 200); line4->SetLineColor(4); line4->Draw("same"); line7->DrawLine(timeCF, -2000, timeCF, 200); @@ -234,8 +237,8 @@ int main (int argc, char** argv) } else { - line = new TLine(ampMaxTimeTemp-13, -2000, ampMaxTimeTemp-13, 200); - line2 = new TLine(ampMaxTimeTemp+12, -2000, ampMaxTimeTemp+12, 200); + line = new TLine(t1, -2000, t1, 200); + line2 = new TLine(t2, -2000, t2, 200); line3 = new TLine(5, -2000, 5, 200); line4 = new TLine(25, -2000, 25, 200); line5 = new TLine(triggerTime-50, -2000, triggerTime-50, 200); diff --git a/bin/dumper.cpp b/bin/dumper.cpp new file mode 100644 index 0000000..7973db9 --- /dev/null +++ b/bin/dumper.cpp @@ -0,0 +1,1164 @@ +/******************************************************************************* +THIS PROGRAM READ THE RAW DATA AND PRODUCE THE RECO FILE USED FOR THE ANALYSIS +- + +BE CAREFUL: the number of channels MUST coincide with the number of channel in the cfg file + +*******************************************************************************/ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TROOT.h" +#include "TFile.h" +#include "TSystem.h" +#include "TStyle.h" +#include "TChain.h" +#include "TF1.h" +#include "TH1F.h" +#include "TH1D.h" +#include "TProfile.h" +#include "TMath.h" +#include "TString.h" +#include "TClass.h" +#include "TApplication.h" + +#include "../interface/analysis_tools.h" +#include "../interface/init_tree_H4.h" +#include "../interface/init_Reco_Tree.h" +#include "../interface/MCPMap.h" +#include "../interface/CfgManager.h" +#include "../interface/TagHelper.h" +#include "../interface/HodoCluster.h" +#include "../interface/AlignmentOfficer.h" + +using namespace std; + +// 2015 hodo mapping +map ADC_to_PMT_map; +map PMT_to_hodoX_map; +map PMT_to_hodoY_map; + + +#define wcXl 0 +#define wcXr 1 +#define wcYd 3 +#define wcYu 2 + +#define nFibersHodo 64 +//#define nBGOChannels 8 +//#define nSCINTChannels 0 +#define nHODOSMALLChannels 8 +//#define emptyChannelIndex 4 + + +#define HODOX1_CHANNELS 64 +#define HODOY1_CHANNELS 64 +#define HODOX2_CHANNELS 64 +#define HODOY2_CHANNELS 64 + +#define HODOSMALLX_CHANNELS 4 +#define HODOSMALLY_CHANNELS 4 + +void assignValues( std::vector &target, std::vector source, unsigned int startPos ); +void assignValuesBool( std::vector &target, std::vector source, unsigned int startPos ); +//void computeCherenkov(std::vector &cher,std::vector wls); +void doHodoReconstructionBool( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, float Cut ); +std::vector getHodoClustersBool( std::vector hodo, float fibreWidth, int nClusterMax, float Cut ); + +void doHodoReconstruction( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, float Cut ); +std::vector getHodoClusters( std::vector hodo, float fibreWidth, int nClusterMax, float Cut ); +std::vector getHodoClustersMultipleCuts( std::vector hodo, float fibreWidth, int nClusterMax, std::vector Cut ); +void copyArray( int n, float *source, float *target ); +void doHodoReconstructionMultipleCuts( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, std::vector Cut ); +//float timeSampleUnit(int drs4Freq); + + + +void FillMaps() +{ + // PMT In - PNT Out [both 0->63] + ADC_to_PMT_map.insert(pair(0,35)); + ADC_to_PMT_map.insert(pair(1,41)); + ADC_to_PMT_map.insert(pair(2,48)); + ADC_to_PMT_map.insert(pair(3,56)); + ADC_to_PMT_map.insert(pair(4,57)); + ADC_to_PMT_map.insert(pair(5,49)); + ADC_to_PMT_map.insert(pair(6,58)); + ADC_to_PMT_map.insert(pair(7,50)); + ADC_to_PMT_map.insert(pair(8,32)); + ADC_to_PMT_map.insert(pair(9,59)); + ADC_to_PMT_map.insert(pair(10,33)); + ADC_to_PMT_map.insert(pair(11,51)); + ADC_to_PMT_map.insert(pair(12,40)); + ADC_to_PMT_map.insert(pair(13,60)); + ADC_to_PMT_map.insert(pair(14,34)); + ADC_to_PMT_map.insert(pair(15,52)); + ADC_to_PMT_map.insert(pair(16,42)); + ADC_to_PMT_map.insert(pair(17,61)); + ADC_to_PMT_map.insert(pair(18,43)); + ADC_to_PMT_map.insert(pair(19,53)); + ADC_to_PMT_map.insert(pair(20,62)); + ADC_to_PMT_map.insert(pair(21,44)); + ADC_to_PMT_map.insert(pair(22,63)); + ADC_to_PMT_map.insert(pair(23,54)); + ADC_to_PMT_map.insert(pair(24,36)); + ADC_to_PMT_map.insert(pair(25,55)); + ADC_to_PMT_map.insert(pair(26,46)); + ADC_to_PMT_map.insert(pair(27,45)); + ADC_to_PMT_map.insert(pair(28,47)); + ADC_to_PMT_map.insert(pair(29,38)); + ADC_to_PMT_map.insert(pair(30,37)); + ADC_to_PMT_map.insert(pair(31,39)); + ADC_to_PMT_map.insert(pair(32,29)); + ADC_to_PMT_map.insert(pair(33,31)); + ADC_to_PMT_map.insert(pair(34,21)); + ADC_to_PMT_map.insert(pair(35,30)); + ADC_to_PMT_map.insert(pair(36,23)); + ADC_to_PMT_map.insert(pair(37,28)); + ADC_to_PMT_map.insert(pair(38,22)); + ADC_to_PMT_map.insert(pair(39,15)); + ADC_to_PMT_map.insert(pair(40,20)); + ADC_to_PMT_map.insert(pair(41,14)); + ADC_to_PMT_map.insert(pair(42,7)); + ADC_to_PMT_map.insert(pair(43,27)); + ADC_to_PMT_map.insert(pair(44,6)); + ADC_to_PMT_map.insert(pair(45,13)); + ADC_to_PMT_map.insert(pair(46,3)); + ADC_to_PMT_map.insert(pair(47,5)); + ADC_to_PMT_map.insert(pair(48,12)); + ADC_to_PMT_map.insert(pair(49,4)); + ADC_to_PMT_map.insert(pair(50,11)); + ADC_to_PMT_map.insert(pair(51,19)); + ADC_to_PMT_map.insert(pair(52,10)); + ADC_to_PMT_map.insert(pair(53,18)); + ADC_to_PMT_map.insert(pair(54,2)); + ADC_to_PMT_map.insert(pair(55,17)); + ADC_to_PMT_map.insert(pair(56,9)); + ADC_to_PMT_map.insert(pair(57,16)); + ADC_to_PMT_map.insert(pair(58,1)); + ADC_to_PMT_map.insert(pair(59,0)); + ADC_to_PMT_map.insert(pair(60,25)); + ADC_to_PMT_map.insert(pair(61,8)); + ADC_to_PMT_map.insert(pair(62,26)); + ADC_to_PMT_map.insert(pair(63,24)); + + // PMT Out - Hodo X [both 0->63] + PMT_to_hodoX_map.insert(pair(0,28)); + PMT_to_hodoX_map.insert(pair(1,17)); + PMT_to_hodoX_map.insert(pair(2,16)); + PMT_to_hodoX_map.insert(pair(3,15)); + PMT_to_hodoX_map.insert(pair(4,14)); + PMT_to_hodoX_map.insert(pair(5,13)); + PMT_to_hodoX_map.insert(pair(6,12)); + PMT_to_hodoX_map.insert(pair(7,0)); + PMT_to_hodoX_map.insert(pair(8,29)); + PMT_to_hodoX_map.insert(pair(9,18)); + PMT_to_hodoX_map.insert(pair(10,19)); + PMT_to_hodoX_map.insert(pair(11,20)); + PMT_to_hodoX_map.insert(pair(12,9)); + PMT_to_hodoX_map.insert(pair(13,10)); + PMT_to_hodoX_map.insert(pair(14,11)); + PMT_to_hodoX_map.insert(pair(15,1)); + PMT_to_hodoX_map.insert(pair(16,30)); + PMT_to_hodoX_map.insert(pair(17,23)); + PMT_to_hodoX_map.insert(pair(18,22)); + PMT_to_hodoX_map.insert(pair(19,21)); + PMT_to_hodoX_map.insert(pair(20,8)); + PMT_to_hodoX_map.insert(pair(21,7)); + PMT_to_hodoX_map.insert(pair(22,6)); + PMT_to_hodoX_map.insert(pair(23,2)); + PMT_to_hodoX_map.insert(pair(24,31)); + PMT_to_hodoX_map.insert(pair(25,24)); + PMT_to_hodoX_map.insert(pair(26,25)); + PMT_to_hodoX_map.insert(pair(27,26)); + PMT_to_hodoX_map.insert(pair(28,27)); + PMT_to_hodoX_map.insert(pair(29,5)); + PMT_to_hodoX_map.insert(pair(30,4)); + PMT_to_hodoX_map.insert(pair(31,3)); + + // PMT Out - Hodo Y [both 0->63] + PMT_to_hodoY_map.insert(pair(32,3)); + PMT_to_hodoY_map.insert(pair(33,4)); + PMT_to_hodoY_map.insert(pair(34,5)); + PMT_to_hodoY_map.insert(pair(35,27)); + PMT_to_hodoY_map.insert(pair(36,26)); + PMT_to_hodoY_map.insert(pair(37,25)); + PMT_to_hodoY_map.insert(pair(38,24)); + PMT_to_hodoY_map.insert(pair(39,31)); + PMT_to_hodoY_map.insert(pair(40,2)); + PMT_to_hodoY_map.insert(pair(41,6)); + PMT_to_hodoY_map.insert(pair(42,7)); + PMT_to_hodoY_map.insert(pair(43,8)); + PMT_to_hodoY_map.insert(pair(44,21)); + PMT_to_hodoY_map.insert(pair(45,22)); + PMT_to_hodoY_map.insert(pair(46,23)); + PMT_to_hodoY_map.insert(pair(47,30)); + PMT_to_hodoY_map.insert(pair(48,1)); + PMT_to_hodoY_map.insert(pair(49,11)); + PMT_to_hodoY_map.insert(pair(50,10)); + PMT_to_hodoY_map.insert(pair(51,9)); + PMT_to_hodoY_map.insert(pair(52,20)); + PMT_to_hodoY_map.insert(pair(53,19)); + PMT_to_hodoY_map.insert(pair(54,18)); + PMT_to_hodoY_map.insert(pair(55,29)); + PMT_to_hodoY_map.insert(pair(56,0)); + PMT_to_hodoY_map.insert(pair(57,12)); + PMT_to_hodoY_map.insert(pair(58,13)); + PMT_to_hodoY_map.insert(pair(59,14)); + PMT_to_hodoY_map.insert(pair(60,15)); + PMT_to_hodoY_map.insert(pair(61,16)); + PMT_to_hodoY_map.insert(pair(62,17)); + PMT_to_hodoY_map.insert(pair(63,28)); +} + +//*******MAIN******************************************************************* +int main (int argc, char** argv) +{ + cout<<"--------DUMPER: READ RAW DATA AND PRODUCE RECO TREE--------"<("global", "inputDir"); + string outputFile = CFG.GetOpt("global", "outputFile"); + string runType = CFG.GetOpt("global", "runType"); + int nRuns = CFG.GetOpt("global", "nRuns"); + int nCh = CFG.GetOpt("global", "nChannels"); + int trigPos = CFG.GetOpt("global", "trigPos"); + // int trigPos2 = CFG.GetOpt("global", "trigPos2"); + int trigPos2 = -1; + + + + std::string tag = "V00"; + std::string theBeamEnergy = Form("%.0f",50); + + //---------output tree---------------- + TFile* outROOT = TFile::Open(outputFile.c_str(), "recreate"); + outROOT->cd(); + + TProfile** wf_promed = new TProfile*[18]; + for(int iCh=0; iCh<18; ++iCh) + wf_promed[iCh] = new TProfile(Form("wf_promed_%d",iCh), "", 102400, 0., 1024.); + + TTree* outTree = new TTree("reco_tree", "reco_tree"); + outTree->SetDirectory(0); + std::cout << " >>> SetOutTree HERE!!!!!!!!!!!!!! " << std::endl; + SetOutTree(outTree); + std::cout << " >>> SetOutTree done " << std::endl; + + int iRun=0; + int start=0; + //-------runs loop + while(iRun < nRuns) + { + int run = CFG.GetOpt("global", "runs", iRun); + + //-----Definitions + vector digiCh[18]; + vector digiCh_dummy[18]; + float timeCF[18], timeCFcorr[18], timeCF30[18]; + float timeOT[18], timeStart[18], timeStop[18], ampMaxT[18]; + float timeStart_1000[18], timeStop_1000[18], timeStart_150[18], timeStop_150[18]; + float timeStart_200[18], timeStop_200[18], timeStart_500[18], timeStop_500[18], timeStart_300[18], timeStop_300[18]; + float intBase[18], intSignal[18], intSignalcorr[18], ampMax[18], ampMaxcorr[18]; + ///int fibreX[8], hodoYchannels[8]; + float tStart, tStop; + + //--reading wire chamber from other tree -- + // TChain* positionTree = new TChain("outputTree"); + // InitTree2(positionTree); + + //---Chain + TChain* chain = new TChain("H4tree"); + InitTree(chain); + + // char command1[300]; + // sprintf(command1, "find %s/%d/*/dqmPlotstotal.root > ntuples/listTemp_%d.txt", (inputFolder).c_str(), run, run); + // system(command1); + char command2[300]; + // sprintf(command2, "find %s/%d.root > ntuples/listTemp2_%d.txt", (inputFolder).c_str(), run, run); + sprintf(command2, "find %s/%d/*.root > ntuples/listTemp2_%d.txt", (inputFolder).c_str(), run, run); + system(command2); + + // char list1[200]; + char list2[200]; + // sprintf (list1, "ntuples/listTemp_%d.txt", run); + sprintf (list2, "ntuples/listTemp2_%d.txt", run); + + // ifstream rootList (list1); + ifstream rootList2 (list2); + + // while (!rootList.eof() && !rootList2.eof()) + // { + // char iRun_tW[70]; + // rootList >> iRun_tW; + // char iRun_str[70]; + // rootList2 >> iRun_str; + + // TChain* tTemp = new TChain("outputTree"); + // tTemp->Add(iRun_tW); + // TChain* tTempH4 = new TChain("H4tree"); + // tTempH4->Add(iRun_str); + + // if (tTemp->GetEntries() == tTempH4->GetEntries()) + // { + // positionTree->Add(iRun_tW); + // chain->Add(iRun_str); + // } + // else + // cout<<"Bad spill found.. Skipped"<Delete(); + // tTempH4->Delete(); + // } + + while(!rootList2.eof()) + { + char iRun_str[70]; + rootList2 >> iRun_str; + + chain->Add(iRun_str); + } + + // char command3[300]; + // sprintf(command3, "rm ntuples/listTemp_%d.txt", run); + char command4[300]; + sprintf(command4, "rm ntuples/listTemp2_%d.txt", run); + + // system(command3); + system(command4); + + + TagHelper tagHelper(tag,theBeamEnergy); + AlignmentOfficer alignOfficer(tagHelper.getAlignmentFileName()); + + + cout << "start reading run: " << run << endl; + + //-----Data loop-------------------------------------------------------- + for(int iEntry=0; iEntryGetEntries(); iEntry++) + { + if(iEntry % 1000 == 0) + cout << "read entry: " << iEntry << " / " << chain->GetEntriesFast() << endl; + //-----Unpack data-------------------------------------------------- + for(int iCh=0; iCh<18; iCh++) + { + digiCh[iCh].clear(); + digiCh_dummy[iCh].clear(); + + } + //---Read the entry + chain->GetEntry(iEntry); + + unsigned int spill=spillNumber; + event=evtNumber; + + if (spill!=spillNumber || event!=evtNumber) { + cout<<"PROBLEM: non-coherent read"< HODOSMALLvalues; + HODOSMALLvalues.clear(); + HODOSMALLvalues.resize(nHODOSMALLChannels, 0); + for(unsigned int iAdc=0; iAdc 13) continue; + if(ch < 6){ //2,3,4,5 are on y; 10,11,12,13 on x + HODOSMALLvalues.at(ch-2) = adcData[iAdc]; + } + else if(ch > 9){ + HODOSMALLvalues.at(ch-6) = adcData[iAdc]; + } + } + } + + + //fillTDC + //std::cout << " fill TDC " << std::endl; + std::vector TDCreco; + TDCreco.clear(); + TDCreco.resize(2,-999); + + std::vector tdc_readings[4]; + float tdc_recox = -999; + float tdc_recoy = -999; + + for(unsigned int iTdc = 0; iTdc- 999 && tdc_recoy >- 999){ + TDCreco[0] = tdc_recox; + TDCreco[1] = tdc_recoy; + } + + + //fillFiber + //std::cout << " fill fibers " << std::endl; + std::vector fiberOrderA; + std::vector fiberOrderB; + + fiberOrderA.clear(); + fiberOrderB.clear(); + + fiberOrderA.push_back(31); + fiberOrderA.push_back(29); + fiberOrderA.push_back(23); + fiberOrderA.push_back(21); + fiberOrderA.push_back(5); + fiberOrderA.push_back(7); + fiberOrderA.push_back(15); + fiberOrderA.push_back(13); + fiberOrderA.push_back(1); + fiberOrderA.push_back(3); + fiberOrderA.push_back(11); + fiberOrderA.push_back(9); + fiberOrderA.push_back(6); + fiberOrderA.push_back(8); + fiberOrderA.push_back(16); + fiberOrderA.push_back(14); + fiberOrderA.push_back(17); + fiberOrderA.push_back(27); + fiberOrderA.push_back(19); + fiberOrderA.push_back(25); + fiberOrderA.push_back(24); + fiberOrderA.push_back(22); + fiberOrderA.push_back(32); + fiberOrderA.push_back(30); + fiberOrderA.push_back(4); + fiberOrderA.push_back(2); + fiberOrderA.push_back(12); + fiberOrderA.push_back(10); + fiberOrderA.push_back(20); + fiberOrderA.push_back(18); + fiberOrderA.push_back(28); + fiberOrderA.push_back(26); + + fiberOrderB.push_back(54); + fiberOrderB.push_back(64); + fiberOrderB.push_back(56); + fiberOrderB.push_back(62); + fiberOrderB.push_back(49); + fiberOrderB.push_back(51); + fiberOrderB.push_back(59); + fiberOrderB.push_back(57); + fiberOrderB.push_back(53); + fiberOrderB.push_back(55); + fiberOrderB.push_back(63); + fiberOrderB.push_back(61); + fiberOrderB.push_back(45); + fiberOrderB.push_back(47); + fiberOrderB.push_back(37); + fiberOrderB.push_back(39); + fiberOrderB.push_back(34); + fiberOrderB.push_back(42); + fiberOrderB.push_back(36); + fiberOrderB.push_back(44); + fiberOrderB.push_back(50); + fiberOrderB.push_back(52); + fiberOrderB.push_back(58); + fiberOrderB.push_back(60); + fiberOrderB.push_back(38); + fiberOrderB.push_back(48); + fiberOrderB.push_back(40); + fiberOrderB.push_back(46); + fiberOrderB.push_back(41); + fiberOrderB.push_back(43); + fiberOrderB.push_back(33); + fiberOrderB.push_back(35); + + //fillHODO + //std::cout << " fill HODO " << std::endl; + std::vector HODOX1; + std::vector HODOX2; + std::vector HODOY1; + std::vector HODOY2; + HODOX1.clear(); HODOX1.resize(nFibersHodo,false); + HODOX2.clear(); HODOX2.resize(nFibersHodo,false); + HODOY1.clear(); HODOY1.resize(nFibersHodo,false); + HODOY2.clear(); HODOY2.resize(nFibersHodo,false); + std::vector *hodo; + + for(unsigned int iPat=0; iPat *fiberorder = (bool)(patternChannel[iPat]&0b1) ? &fiberOrderB : &fiberOrderA; + for(unsigned int j=0; j<32; j++){ + bool thisfibon = (pattern[iPat]>>j)&0b1; + hodo->at(fiberorder->at(j)-1) = thisfibon; + } + } + } +// for(unsigned int iF=0; iFat(0); +// nTDCHits[1] = nTDCHits->at(1); +// nTDCHits[2] = nTDCHits->at(2); +// nTDCHits[3] = nTDCHits->at(3); + + wc_x = TDCreco[0]; + wc_y = TDCreco[1]; + + if( nRuns >= 170 ) wc_y = -wc_y; + + wc_x_corr = wc_x + alignOfficer.getOffset("wc_x"); + wc_y_corr = wc_y + alignOfficer.getOffset("wc_y"); + + + + + + int posOf2FibClustX1=0; + int nrOf2FibreClustersX1 = 0; + for( int i=0; i800) continue; + + //---loop over MPC's channels + for(int jCh=0; jCh("global", "MCPs", jCh); + int iCh = CFG.GetOpt(currentMCP, "digiChannel"); + + + if(currentMCP.find("clock") != string::npos || currentMCP.find("TorGain1") != string::npos || currentMCP.find("TorGain2") != string::npos ) + { + + std::cout << " sono nel caso clock " << std::endl; + + SubtractBaseline(5, 25, &digiCh[iCh]); + ampMax[iCh] = AmpMax(51, 1000, &digiCh[iCh]); + intBase[iCh] = ComputeIntegral(26, 50, &digiCh[iCh]); + intSignal[iCh] = ComputeIntegral(51, 1000, &digiCh[iCh]); + timeCF[iCh] = TimeConstFracAbs(51, 1000, &digiCh[iCh], 0.5, ampMax[iCh]); + + TimeOverThreshold(51, 1000, &digiCh[iCh], -150., tStart, tStop); + timeStart_150[iCh]=tStart; + timeStop_150[iCh]=tStop; + + TimeOverThreshold(51, 1000, &digiCh[iCh], -200., tStart, tStop); + timeStart_200[iCh]=tStart; + timeStop_200[iCh]=tStop; + + TimeOverThreshold(51, 1000, &digiCh[iCh], -300., tStart, tStop); + timeStart_300[iCh]=tStart; + timeStop_300[iCh]=tStop; + + TimeOverThreshold(51, 1000, &digiCh[iCh], -500., tStart, tStop); + timeStart_500[iCh]=tStart; + timeStop_500[iCh]=tStop; + + TimeOverThreshold(51, 1000, &digiCh[iCh], -1000., tStart, tStop); + timeStart_1000[iCh]=tStart; + timeStop_1000[iCh]=tStop; + + timeOT[iCh] = TimeOverThreshold(51, 1000, &digiCh[iCh], -1000., tStart, tStop); + timeStart[iCh]=tStart; + timeStop[iCh]=tStop; + + ampMaxcorr[iCh] = -1.*ampMax[iCh]; + intSignalcorr[iCh] = -1.*intSignal[iCh]; + timeCFcorr[iCh] = timeCF[iCh]; + } + else + { + int ampMaxTimeTemp = TimeConstFrac(triggerTime-50, triggerTime+50, &digiCh[iCh], 1)/0.2; + //time of max sample (window's coincidence:-50,50) + //window for charge calculation + int t1 = ampMaxTimeTemp-13; + int t2 = ampMaxTimeTemp+12; + ampMaxT[iCh]=ampMaxTimeTemp; + + //subtract baseline immediately before pulse + // if(iCh!=trigPos) + // SubtractBaseline(t1-27, t1-7, &digiCh[iCh]); + SubtractBaseline(25, 50, &digiCh[iCh]); + intBase[iCh] = ComputeIntegral(50, 75, &digiCh[iCh]); + + if(t1 > 50 && t1 < 1024 && t2 > 50 && t2 < 1024){ + ampMax[iCh] = AmpMax(t1, t2, &digiCh[iCh]); + intSignal[iCh] = ComputeIntegral(t1, t2, &digiCh[iCh]); + //std::cout<(currentMCP, "isPCON"), run); + intSignalcorr[iCh] = + get_charge_from_amp_max(iCh, ampMaxcorr[iCh], CFG.GetOpt(currentMCP, "isPCON"), run); + timeCFcorr[iCh] = + get_time_CF_from_time_OT(iCh, timeOT[iCh]*0.2, CFG.GetOpt(currentMCP, "isPCON"), + run, tStart*0.2)/0.2; + } + else + { + ampMaxcorr[iCh] = -1.*ampMax[iCh]; + intSignalcorr[iCh] = -1.*intSignal[iCh]; + timeCFcorr[iCh] = timeCF[iCh]; + } + } + + //---fill the MCP reco variables + time_CF[MCPList.at(currentMCP)] = timeCF[iCh]*0.2; + time_CF_corr[MCPList.at(currentMCP)] = timeCFcorr[iCh]*0.2; + time_CF30[MCPList.at(currentMCP)] = timeCF30[iCh]*0.2; + time_OT[MCPList.at(currentMCP)] = timeOT[iCh]*0.2; + time_start[MCPList.at(currentMCP)] = timeStart[iCh]*0.2; + time_stop[MCPList.at(currentMCP)] = timeStop[iCh]*0.2; + time_start_150[MCPList.at(currentMCP)] = timeStart_150[iCh]*0.2; + time_stop_150[MCPList.at(currentMCP)] = timeStop_150[iCh]*0.2; + time_start_200[MCPList.at(currentMCP)] = timeStart_200[iCh]*0.2; + time_stop_200[MCPList.at(currentMCP)] = timeStop_200[iCh]*0.2; + time_start_300[MCPList.at(currentMCP)] = timeStart_300[iCh]*0.2; + time_stop_300[MCPList.at(currentMCP)] = timeStop_300[iCh]*0.2; + time_start_500[MCPList.at(currentMCP)] = timeStart_500[iCh]*0.2; + time_stop_500[MCPList.at(currentMCP)] = timeStop_500[iCh]*0.2; + time_start_1000[MCPList.at(currentMCP)] = timeStart_1000[iCh]*0.2; + time_stop_1000[MCPList.at(currentMCP)] = timeStop_1000[iCh]*0.2; + amp_max[MCPList.at(currentMCP)] = -ampMax[iCh]; + amp_max_corr[MCPList.at(currentMCP)] = ampMaxcorr[iCh]; + amp_max_time[MCPList.at(currentMCP)] = ampMaxT[iCh]*0.2; + charge[MCPList.at(currentMCP)] = -intSignal[iCh]; + charge_corr[MCPList.at(currentMCP)] = intSignalcorr[iCh]; + baseline[MCPList.at(currentMCP)] = -intBase[iCh]; + + isPCOn[MCPList.at(currentMCP)] = CFG.GetOpt(currentMCP, "isPCON"); + HV[MCPList.at(currentMCP)] = CFG.GetOpt(currentMCP, "HV", iRun); + HV2[MCPList.at(currentMCP)] = CFG.GetOpt(currentMCP, "HV2", iRun); + isTrigger[MCPList.at(currentMCP)] = CFG.GetOpt(currentMCP, "isTrigger"); + } + + run_id = run; + X0 = -1; + if(runType == "X0") + X0 = CFG.GetOpt("global", "nX0", iRun); + + // positionTree->GetEntry(iEntry); + // tdcX = (*TDCreco)[0]; + // tdcY = (*TDCreco)[1]; + // // event = evtNumber; + + // nhodoX1=0; + // nhodoX2=0; + // nhodoY1=0; + // nhodoY2=0; + + // for (int i=0; i<64; i++) + // { + // hodoX1[i] = (*HODOX1)[i]; + // hodoX2[i] = (*HODOX2)[i]; + // hodoY1[i] = (*HODOY1)[i]; + // hodoY2[i] = (*HODOY2)[i]; + // //cout<<(*HODOX1)[i]<<" "<Fill(); + } + //---Get ready for next run + outTree->AutoSave(); + chain->Delete(); + // positionTree->Delete(); + ++iRun; + } + //-----close everything----------------------------------------------------- + for(int iCh=0; iChWrite(); + + outTree->Write(); + outROOT->Close(); + +//---------Done----------------------------------------------------------------- +} + + + + +void assignValues( std::vector &target, std::vector source, unsigned int startPos ) { + + for( unsigned i=0; i &target, std::vector source, unsigned int startPos ) { + + for( unsigned i=0; i getHodoClusters( std::vector hodo, float fibreWidth, int nClusterMax, float Cut ) { + + std::vector clusters; + + HodoCluster* currentCluster = new HodoCluster( hodo.size(), fibreWidth ); + + for( unsigned i=0; i Cut) { // hit + + if( currentCluster->getSize() < nClusterMax ) { + + currentCluster->addFibre( i ); + + } else { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + currentCluster->addFibre( i ); // get that fibre! + + } + + } else { // as soon as you find a hole + + if( currentCluster->getSize() > 0 ) { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + + } + + } + + + } // for fibres + + + if( currentCluster->getSize()>0 ) + clusters.push_back( currentCluster ); // store last cluster + + + return clusters; + +} + +std::vector getHodoClustersMultipleCuts( std::vector hodo, float fibreWidth, int nClusterMax, std::vector Cut ) { + + std::vector clusters; + + HodoCluster* currentCluster = new HodoCluster( hodo.size(), fibreWidth ); + + for( unsigned i=0; i Cut[i]) { // hit + + if( currentCluster->getSize() < nClusterMax ) { + + currentCluster->addFibre( i ); + + } else { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + currentCluster->addFibre( i ); // get that fibre! + + } + + } else { // as soon as you find a hole + + if( currentCluster->getSize() > 0 ) { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + + } + + } + + + } // for fibres + + + if( currentCluster->getSize()>0 ) + clusters.push_back( currentCluster ); // store last cluster + + + return clusters; + +} + + + + +void doHodoReconstruction( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, float Cut ) { + + std::vector clusters = getHodoClusters( values, fibreWidth, clusterMaxFibres, Cut ); + + nClusters = clusters.size(); + for( unsigned i=0; igetSize(); + pos[i] = clusters[i]->getPosition(); + } + +} + +void doHodoReconstructionMultipleCuts( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, std::vector Cut ) { + + std::vector clusters = getHodoClustersMultipleCuts( values, fibreWidth, clusterMaxFibres, Cut ); + + nClusters = clusters.size(); + for( unsigned i=0; igetSize(); + pos[i] = clusters[i]->getPosition(); + } + +} + + +void copyArray( int n, float *source, float *target ) { + + for( unsigned i=0; i getHodoClustersBool( std::vector hodo, float fibreWidth, int nClusterMax, float Cut ) { + + std::vector clusters; + + HodoCluster* currentCluster = new HodoCluster( hodo.size(), fibreWidth ); + + for( unsigned i=0; i Cut) { // hit + + if( currentCluster->getSize() < nClusterMax ) { + + currentCluster->addFibre( i ); + + } else { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + currentCluster->addFibre( i ); // get that fibre! + + } + + } else { // as soon as you find a hole + + if( currentCluster->getSize() > 0 ) { + + clusters.push_back( currentCluster ); // store old one + currentCluster = new HodoCluster( hodo.size(), fibreWidth ); // create a new one + + } + + } + + + } // for fibres + + + if( currentCluster->getSize()>0 ) + clusters.push_back( currentCluster ); // store last cluster + + + return clusters; + +} + + +void doHodoReconstructionBool( std::vector values, int &nClusters, int *nFibres, float *pos, float fibreWidth, int clusterMaxFibres, float Cut ) { + + std::vector clusters = getHodoClustersBool( values, fibreWidth, clusterMaxFibres, Cut ); + + nClusters = clusters.size(); + for( unsigned i=0; igetSize(); + pos[i] = clusters[i]->getPosition(); + } + +} diff --git a/TB/bin/dumper_fitTemplate.cpp b/bin/dumper_fitTemplate.cpp similarity index 99% rename from TB/bin/dumper_fitTemplate.cpp rename to bin/dumper_fitTemplate.cpp index a3b9e5b..29cf64d 100644 --- a/TB/bin/dumper_fitTemplate.cpp +++ b/bin/dumper_fitTemplate.cpp @@ -374,8 +374,8 @@ int main (int argc, char** argv) X0 = X0temp; t1->GetEntry(iEntry); - tdcX = (*TDCreco)[0]; - tdcY = (*TDCreco)[1]; + // tdcX = (*TDCreco)[0]; + // tdcY = (*TDCreco)[1]; if (spill!=spillNumber || event!=evtNumber) { std::cout<<"PROBLEM: non-coherent read"< +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_HV12_HVScan12_GaAsEm_muon.root + +nX0 0 +nRuns 30 +nChannels 2 +trigPos 0 +runType HV12 + +runs 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3263 3264 3266 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 + +MCPs MiB2 GaAsEm + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 1 +isPCON 0 +isTrigger 0 +HV 3500 3500 3500 3400 3400 3400 3400 3300 3300 3300 3300 3200 3200 3200 3100 3100 3000 3000 2900 2900 2800 2800 2700 2700 2700 2600 2600 2600 2500 2500 +HV2 3200 3200 3200 3100 3100 3100 3100 3000 3000 3000 3000 2900 2900 2900 2800 2800 2700 2700 2600 2600 2500 2500 2400 2400 2400 2300 2300 2300 2200 2200 + \ No newline at end of file diff --git a/cfg/HV1_HVScan1_EEZStack_muon.cfg b/cfg/HV1_HVScan1_EEZStack_muon.cfg new file mode 100644 index 0000000..f531917 --- /dev/null +++ b/cfg/HV1_HVScan1_EEZStack_muon.cfg @@ -0,0 +1,31 @@ + +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_HV1_HVScan1_EEZStack_muon.root + +nX0 0 +nRuns 15 +nChannels 2 +trigPos 0 +runType HV12 + +runs 3284 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3263 3264 3266 3268 + +MCPs MiB2 EEZStack + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 2 +isPCON 0 +isTrigger 0 +HV 3700 3500 3300 3300 3100 3100 2900 2900 2700 2700 2500 2500 2300 2300 2100 +HV2 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 + \ No newline at end of file diff --git a/cfg/HV2_HVScan2_EEZStack_muon.cfg b/cfg/HV2_HVScan2_EEZStack_muon.cfg new file mode 100644 index 0000000..b28b014 --- /dev/null +++ b/cfg/HV2_HVScan2_EEZStack_muon.cfg @@ -0,0 +1,31 @@ + +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_HV2_HVScan2_EEZStack_muon.root + +nX0 0 +nRuns 15 +nChannels 2 +trigPos 0 +runType HV2 + +runs 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 + +MCPs MiB2 EEZStack + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 2 +isPCON 0 +isTrigger 0 +HV 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 3500 +HV2 1200 1100 1000 900 800 700 600 500 400 300 300 200 200 100 0 + \ No newline at end of file diff --git a/cfg/HVScan1_muon.cfg b/cfg/HVScan1_muon.cfg new file mode 100644 index 0000000..ee1020e --- /dev/null +++ b/cfg/HVScan1_muon.cfg @@ -0,0 +1,119 @@ + +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_HVScan1_mu.root + +nX0 0 +nRuns 1 +nChannels 13 +trigPos 0 +runType HV12 + +runs 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3263 3264 3266 3268 + +MCPs MiB2 GaAsEm EEZStack HGCalFront HGCalBack TorNoGain TorGain1 TorGain1 TorLowGain CeF3_1 CeF3_2 CeF3_3 CeF3_4 + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 1 +isPCON 0 +isTrigger 0 +HV 3500 3500 3500 3400 3400 3400 3300 +HV2 3200 3200 3200 3100 3100 3100 3000 + + + +digiChannel 2 +isPCON 0 +isTrigger 0 +HV 3300 3300 3300 3100 3100 2900 2700 +HV2 1000 1000 1000 1000 1000 1000 1000 + + + +digiChannel 3 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 4 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 5 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 6 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 7 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 8 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 9 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 10 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 11 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 12 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + diff --git a/cfg/Scan_Torino_muon.cfg b/cfg/Scan_Torino_muon.cfg new file mode 100644 index 0000000..c860959 --- /dev/null +++ b/cfg/Scan_Torino_muon.cfg @@ -0,0 +1,55 @@ + +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_Scan_Torino_muon.root + +nX0 0 +nRuns 17 +nChannels 4 +trigPos 0 +runType HV12 + +runs 3256 3257 3258 3259 3260 3261 3263 3264 3266 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 + +MCPs MiB2 TorNoGain TorGain1 TorGain1 + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 5 +isPCON 0 +isTrigger 0 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 6 +isPCON 0 +isTrigger 0 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 7 +isPCON 0 +isTrigger 0 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + + + +digiChannel 8 +isPCON 0 +isTrigger 0 +HV 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 +HV2 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 2750 + diff --git a/cfg/singleRun.cfg b/cfg/singleRun.cfg new file mode 100644 index 0000000..d90617e --- /dev/null +++ b/cfg/singleRun.cfg @@ -0,0 +1,119 @@ + +inputDir /home/luca/Documenti/universita/PHD/IMCP/H2_2015 +outputFile ntuples/reco_singleRun3252.root + +nX0 0 +nRuns 1 +nChannels 8 +trigPos 0 +runType HV12 + +runs 3271b + +MCPs MiB2 GaAsEm EEZStack HGCalFront HGCalBack TorNoGain TorGain1 TorGain1 TorLowGain CeF3_1 CeF3_2 CeF3_3 CeF3_4 + + + + +digiChannel 0 +isPCON 1 +isTrigger 1 +HV 2750 +HV2 2750 + + + +digiChannel 1 +isPCON 0 +isTrigger 0 +HV 3500 +HV2 3200 + + + +digiChannel 2 +isPCON 0 +isTrigger 0 +HV 3300 +HV2 1000 + + + +digiChannel 3 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 4 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 5 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 6 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 7 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 8 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 9 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 10 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 11 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + + + +digiChannel 12 +isPCON 0 +isTrigger 0 +HV 2750 +HV2 2750 + diff --git a/cfg/treshold_5s.txt b/cfg/treshold_5s.txt new file mode 100644 index 0000000..a65f173 --- /dev/null +++ b/cfg/treshold_5s.txt @@ -0,0 +1,18 @@ +0 100 +1 100 +2 100 +3 0 +4 0 +5 0 +6 0 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 diff --git a/interface/AlignmentOfficer.h b/interface/AlignmentOfficer.h new file mode 100644 index 0000000..cc8b6da --- /dev/null +++ b/interface/AlignmentOfficer.h @@ -0,0 +1,34 @@ +#ifndef AlignmentOfficer_h +#define AlignmentOfficer_h + +#include +#include +#include + + + +class AlignmentOfficer { + + public: + + AlignmentOfficer( const std::string& fileName ); + ~AlignmentOfficer() {}; + + void setOffsetsFile( const std::string& fileName ); + + void fix( const std::string& name, int n, float *x ); + + float getOffset( const std::string& name ); + + + + private: + + std::map offsets_; + std::string alignmentFile_; + +}; + + + +#endif diff --git a/interface/CfgManager.h b/interface/CfgManager.h new file mode 100644 index 0000000..24fd594 --- /dev/null +++ b/interface/CfgManager.h @@ -0,0 +1,46 @@ +#ifndef __CFG_MANAGER__ +#define __CFG_MANAGER__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +class CfgManager +{ +public: + //---ctors--- + CfgManager() {}; + CfgManager(map > >* defaultCfg) {SetDefaultCfg(defaultCfg);}; + CfgManager(const char* file) {ParseConfigFile(file);}; + //---dtor--- + ~CfgManager() {}; + + //---getters--- + template T GetOpt(string block, string key, int opt=0); + + //---setters--- + inline void SetDefaultCfg(map > >* defaultCfg) + {opts_ = *defaultCfg;}; + + //---utils--- + void Errors(string block, string key, int opt=0); + inline void ParseConfigFile(string* file) {ParseConfigFile(file->c_str());}; + void ParseConfigFile(const char* file); + + //---operators--- + friend ostream& operator<<(ostream& out, const CfgManager& obj); + +private: + map > > opts_; +}; + +#endif diff --git a/interface/HodoCluster.h b/interface/HodoCluster.h new file mode 100644 index 0000000..ceb0e53 --- /dev/null +++ b/interface/HodoCluster.h @@ -0,0 +1,34 @@ +#ifndef HodoCluster_h +#define HodoCluster_h + +class HodoCluster { + + public: + + HodoCluster( int totFibres, float width ) { + size_ = 0; + pos_ = 0.; + hodoTotFibres_ = totFibres; + fibreWidth_ = width; + } + + ~HodoCluster() {}; + + int getSize() { return size_; }; + float getPosition() { return pos_; }; + + void addFibre( int i ); + + + private: + + int size_; + float pos_; + + int hodoTotFibres_; + float fibreWidth_; // in mm + +}; + + +#endif diff --git a/TB/interface/MCPMap.h b/interface/MCPMap.h similarity index 100% rename from TB/interface/MCPMap.h rename to interface/MCPMap.h diff --git a/TB/interface/ScaleEstimators.h b/interface/ScaleEstimators.h similarity index 100% rename from TB/interface/ScaleEstimators.h rename to interface/ScaleEstimators.h diff --git a/interface/TagHelper.h b/interface/TagHelper.h new file mode 100644 index 0000000..945ebd5 --- /dev/null +++ b/interface/TagHelper.h @@ -0,0 +1,42 @@ +#ifndef TagHelper_h +#define TagHelper_h + + +#include + + + +class TagHelper { + + + public: + + TagHelper( const std::string& tag, const std::string& Energy ); + ~TagHelper(); + + void setTag( const std::string& tag, const std::string& Energy ); + + std::string getCeF3FileName() const; + std::string getBGOFileName() const; + std::string getAlignmentFileName() const; + + std::string getTag() const { return tag_; }; + std::string getCeF3Tag() const { return tag_cef3_; }; + std::string getBGOTag() const { return tag_bgo_; }; + std::string getAlignmentTag() const { return tag_align_; }; + + + + private: + + std::string tag_; + std::string tag_cef3_; + std::string tag_bgo_; + std::string tag_align_; + + +}; + + + +#endif diff --git a/TB/interface/analysis_tools.h b/interface/analysis_tools.h similarity index 100% rename from TB/interface/analysis_tools.h rename to interface/analysis_tools.h diff --git a/TB/interface/histoFuncT.h b/interface/histoFuncT.h similarity index 100% rename from TB/interface/histoFuncT.h rename to interface/histoFuncT.h diff --git a/TB/interface/histo_func.h b/interface/histo_func.h similarity index 100% rename from TB/interface/histo_func.h rename to interface/histo_func.h diff --git a/interface/init_Reco_Tree.h b/interface/init_Reco_Tree.h new file mode 100644 index 0000000..2b3f80f --- /dev/null +++ b/interface/init_Reco_Tree.h @@ -0,0 +1,185 @@ +#ifndef __init_Reco_Tree__ +#define __init_Reco_Tree__ + +#include "TTree.h" +#include "TChain.h" +#include + +// Declaration of leaf types +extern int event; +extern float time_CF[8]; +extern float time_CF_corr[8]; +extern float time_CF30[8]; +extern float time_OT[8]; +extern float time_start[8]; +extern float time_stop[8]; +extern float time_start_1000[8]; +extern float time_stop_1000[8]; +extern float time_start_150[8]; +extern float time_stop_150[8]; +extern float time_start_200[8]; +extern float time_stop_200[8]; +extern float time_start_500[8]; +extern float time_stop_500[8]; +extern float time_start_300[8]; +extern float time_stop_300[8]; +extern float time_Max[8]; +extern float amp_max[8]; +extern float amp_max_corr[8]; +extern float amp_max_time[8]; +extern float charge[8]; +extern float charge_corr[8]; +extern float baseline[8]; +extern int run_id; +extern int isPCOn[8]; +extern int HV[8]; +extern int HV2[8]; +extern int isTrigger[8]; +extern float X0; + +extern int sci_front_adc; +extern int bgo_back_adc; + +extern int nClusters_hodoX1; +extern int nFibres_hodoX1[64]; +extern float pos_hodoX1[64]; +extern float pos_corr_hodoX1[64]; + +extern int nClusters_hodoY1; +extern int nFibres_hodoY1[64]; +extern float pos_hodoY1[64]; +extern float pos_corr_hodoY1[64]; + +extern int nClusters_hodoX2; +extern int nFibres_hodoX2[64]; +extern float pos_hodoX2[64]; +extern float pos_corr_hodoX2[64]; + +extern int nClusters_hodoY2; +extern int nFibres_hodoY2[64]; +extern float pos_hodoY2[64]; +extern float pos_corr_hodoY2[64]; + +extern int nClusters_hodoSmallX; +extern int nFibres_hodoSmallX[4]; +extern float pos_hodoSmallX[4]; +extern float pos_corr_hodoSmallX[4]; + +extern int nClusters_hodoSmallY; +extern int nFibres_hodoSmallY[4]; +extern float pos_hodoSmallY[4]; +extern float pos_corr_hodoSmallY[4]; + + +extern int nTDCHits[4]; +extern float pos_2FibClust_hodoX1; +extern float pos_2FibClust_corr_hodoX1; +extern float pos_2FibClust_hodoY1; +extern float pos_2FibClust_corr_hodoY1; +extern float pos_2FibClust_hodoX2; +extern float pos_2FibClust_corr_hodoX2; +extern float pos_2FibClust_hodoY2; +extern float pos_2FibClust_corr_hodoY2; +extern float cluster_pos_hodoX1; +extern float cluster_pos_corr_hodoX1; +extern float cluster_pos_hodoX2; +extern float cluster_pos_corr_hodoX2; +extern float cluster_pos_hodoY1; +extern float cluster_pos_corr_hodoY1; +extern float cluster_pos_hodoY2; +extern float cluster_pos_corr_hodoY2; +extern float wc_x; +extern float wc_y; +extern float wc_x_corr; +extern float wc_y_corr; + +// List of branches +extern TBranch *b_event; +extern TBranch *b_time_CF; //! +extern TBranch *b_time_CF_corr; //! +extern TBranch *b_time_CF30; //! +extern TBranch *b_time_OT; //! +extern TBranch *b_time_start; +extern TBranch *b_time_stop; +extern TBranch *b_time_start_1000; +extern TBranch *b_time_stop_1000; +extern TBranch *b_time_start_150; +extern TBranch *b_time_stop_150; +extern TBranch *b_time_start_200; +extern TBranch *b_time_stop_200; +extern TBranch *b_time_start_500; +extern TBranch *b_time_stop_500; +extern TBranch *b_time_start_300; +extern TBranch *b_time_stop_300; +extern TBranch *b_time_Max; //! +extern TBranch *b_amp_max; //! +extern TBranch *b_amp_max_corr; //! +extern TBranch *b_amp_max_time; //! +extern TBranch *b_baseline; //! +extern TBranch *b_charge; //! +extern TBranch *b_charge_corr; //! +extern TBranch *b_run_id; //! +extern TBranch *b_isPCOn; //! +extern TBranch *b_HV; //! +extern TBranch *b_HV2; //! +extern TBranch *b_isTrigger; +extern TBranch *b_X0; +extern TBranch *b_sci_front_adc; +extern TBranch *b_bgo_back_adc; + +extern TBranch *b_nClusters_hodoX1; //! +extern TBranch *b_nFibres_hodoX1; //! +extern TBranch *b_pos_hodoX1; //! +extern TBranch *b_pos_corr_hodoX1; //! +extern TBranch *b_nClusters_hodoY1; //! +extern TBranch *b_nFibres_hodoY1; //! +extern TBranch *b_pos_hodoY1; //! +extern TBranch *b_pos_corr_hodoY1; //! +extern TBranch *b_nClusters_hodoX2; //! +extern TBranch *b_nFibres_hodoX2; //! +extern TBranch *b_pos_hodoX2; //! +extern TBranch *b_pos_corr_hodoX2; //! +extern TBranch *b_nClusters_hodoY2; //! +extern TBranch *b_nFibres_hodoY2; //! +extern TBranch *b_pos_hodoY2; //! +extern TBranch *b_pos_corr_hodoY2; //! +extern TBranch *b_nClusters_hodoSmallX; //! +extern TBranch *b_nFibres_hodoSmallX; //! +extern TBranch *b_pos_hodoSmallX; //! +extern TBranch *b_pos_corr_hodoSmallX; //! +extern TBranch *b_nClusters_hodoSmallY; //! +extern TBranch *b_nFibres_hodoSmallY; //! +extern TBranch *b_pos_hodoSmallY; //! +extern TBranch *b_pos_corr_hodoSmallY; //! + +extern TBranch *b_nTDCHits; //! +extern TBranch *b_pos_2FibClust_hodoX1; //! +extern TBranch *b_pos_2FibClust_corr_hodoX1; //! +extern TBranch *b_pos_2FibClust_hodoY1; //! +extern TBranch *b_pos_2FibClust_corr_hodoY1; //! +extern TBranch *b_pos_2FibClust_hodoX2; //! +extern TBranch *b_pos_2FibClust_corr_hodoX2; //! +extern TBranch *b_pos_2FibClust_hodoY2; //! +extern TBranch *b_pos_2FibClust_corr_hodoY2; //! +extern TBranch *b_cluster_pos_hodoX1; //! +extern TBranch *b_cluster_pos_corr_hodoX1; //! +extern TBranch *b_cluster_pos_hodoX2; //! +extern TBranch *b_cluster_pos_corr_hodoX2; //! +extern TBranch *b_cluster_pos_hodoY1; //! +extern TBranch *b_cluster_pos_corr_hodoY1; //! +extern TBranch *b_cluster_pos_hodoY2; //! +extern TBranch *b_cluster_pos_corr_hodoY2; //! +extern TBranch *b_wc_x; //! +extern TBranch *b_wc_y; //! +extern TBranch *b_wc_x_corr; //! +extern TBranch *b_wc_y_corr; //! + + + +void InitRecoTree(TTree* nt); + +void init(); + +void SetOutTree(TTree* outTree); + +#endif diff --git a/TB/interface/init_tree_BTF.h b/interface/init_tree_BTF.h similarity index 100% rename from TB/interface/init_tree_BTF.h rename to interface/init_tree_BTF.h diff --git a/TB/interface/init_tree_H4.h b/interface/init_tree_H4.h similarity index 80% rename from TB/interface/init_tree_H4.h rename to interface/init_tree_H4.h index ce1b9a9..6fad38a 100644 --- a/TB/interface/init_tree_H4.h +++ b/interface/init_tree_H4.h @@ -12,13 +12,19 @@ extern unsigned int evtTimeStart; // unsigned int boardTriggerBit; // unsigned int triggerWord; extern unsigned int nAdcChannels; -extern unsigned int adcBoard[100]; +extern unsigned int adcBoard[100]; extern unsigned int adcChannel[100]; extern unsigned int adcData[100]; extern unsigned int nTdcChannels; extern unsigned int tdcBoard[10]; extern unsigned int tdcChannel[10]; extern unsigned int tdcData[10]; + +extern unsigned int nPatterns; +extern unsigned int pattern[16]; +extern unsigned int patternBoard[16]; +extern unsigned int patternChannel[16]; + extern unsigned int nDigiSamples; extern unsigned int digiGroup[100000]; extern unsigned int digiChannel[100000]; @@ -26,10 +32,8 @@ extern unsigned int digiSampleIndex[100000]; extern float digiSampleValue[100000]; extern std::vector *TDCreco; -extern std::vector *HODOX1; -extern std::vector *HODOX2; -extern std::vector *HODOY1; -extern std::vector *HODOY2; +extern float HODOX[32]; +extern float HODOY[32]; extern unsigned int spillNumber; @@ -48,6 +52,12 @@ extern TBranch *b_nTdcChannels; //! extern TBranch *b_tdcBoard; //! extern TBranch *b_tdcChannel; //! extern TBranch *b_tdcData; //! + +extern TBranch *b_nPatterns; +extern TBranch *b_pattern; +extern TBranch *b_patternBoard; +extern TBranch *b_patternChannel; + extern TBranch *b_nDigiSamples; //! extern TBranch *b_digiGroup; //! extern TBranch *b_digiChannel; //! @@ -55,10 +65,8 @@ extern TBranch *b_digiSampleIndex; //! extern TBranch *b_digiSampleValue; //! extern TBranch *b_TDCreco; -extern TBranch *b_HODOX1; -extern TBranch *b_HODOX2; -extern TBranch *b_HODOY1; -extern TBranch *b_HODOY2; +extern TBranch *b_HODOX; +extern TBranch *b_HODOY; extern TBranch *b_spillNumber; void InitTree(TChain* nt); diff --git a/TB/lib/.gitignore b/lib/.gitignore similarity index 100% rename from TB/lib/.gitignore rename to lib/.gitignore diff --git a/TB/macro/calcEff.C b/macro/calcEff.C similarity index 100% rename from TB/macro/calcEff.C rename to macro/calcEff.C diff --git a/TB/macro/computeTimeOT.C b/macro/computeTimeOT.C similarity index 100% rename from TB/macro/computeTimeOT.C rename to macro/computeTimeOT.C diff --git a/TB/macro/drawBranches.C b/macro/drawBranches.C similarity index 100% rename from TB/macro/drawBranches.C rename to macro/drawBranches.C diff --git a/TB/macro/drawEfficiency.C b/macro/drawEfficiency.C similarity index 100% rename from TB/macro/drawEfficiency.C rename to macro/drawEfficiency.C diff --git a/macro/drawEfficiency_tool.C b/macro/drawEfficiency_tool.C new file mode 100644 index 0000000..355fc6a --- /dev/null +++ b/macro/drawEfficiency_tool.C @@ -0,0 +1,186 @@ +#include "TROOT.h" +#include "TStyle.h" +#include "TFile.h" +#include "TF1.h" +#include "TH1.h" +#include "TH2.h" +#include "TProfile.h" +#include "TGraph.h" +#include "TGraphErrors.h" +#include "TCanvas.h" +#include "TColor.h" +#include "TPaveStats.h" +#include "TPad.h" +#include "TLegend.h" +#include "TLatex.h" +#include "TTree.h" +#include "TChain.h" +#include "TVirtualFitter.h" +#include "TMath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void drawEfficiency_tool() +{ + + std::vector nameCh; + nameCh.push_back("Plana4"); + nameCh.push_back("Plana3"); + nameCh.push_back("Plana2"); + nameCh.push_back("Plana1"); + + + std::string analysisType; + analysisType = "eff"; + // analysisType = "timeCFD"; + // analysisType = "timeLED"; + + + std::string HVE; + HVE = "ON_HVScan"; + // HVE = "OFF_HVScan"; + // HVE = "OFF_X0Scan"; + + + std::string XaxisLabel; + if(HVE == "ON_HVScan" || HVE == "OFF_HVScan") XaxisLabel = "HV1"; + if(HVE == "OFF_X0Scan") XaxisLabel = "X0"; + + + int nCh = 4; + TFile** inF = new TFile*[4]; + // TMultiGraph *mg = new TMultiGraph(); + TGraphErrors** gr = new TGraphErrors*[4]; + TGraphErrors** gr_Sat = new TGraphErrors*[4]; + + + int markerStyleExt[4] = {4, 20, 5, 25}; + float markerSizeExt[4] = {1, 1, 1, 1}; + int lineWidthExt[4] = {2, 2, 2, 2}; + int colorsExt[4] = {kRed+2, kBlue+2, kGreen+2, kCyan}; + + std::vector markerStyle; + std::vector markerSize; + std::vector lineWidth; + std::vector colors; + for(int posVec = 0; posVecGet("eff"); + } + if(analysisType == "timeCFD"){ + inF[iCh] = TFile::Open(("plots/resCFD_studies/"+nameCh.at(iCh)+"_"+XaxisLabel+"_Planacon_"+HVE+".root").c_str()); + gr[iCh] = (TGraphErrors*)inF[iCh]->Get("resCFD"); + } + if(analysisType == "timeLED"){ + inF[iCh] = TFile::Open(("plots/resLED_studies/"+nameCh.at(iCh)+"_"+XaxisLabel+"_Planacon_"+HVE+".root").c_str()); + gr[iCh] = (TGraphErrors*)inF[iCh]->Get("resLED"); + } + gr_Sat[iCh] = (TGraphErrors*)inF[iCh]->Get("frac_saturated"); + std::cout << "name = " << inF[iCh]->GetName() << std::endl; + + + + //settings + gr[iCh]->SetMarkerColor(colors.at(iCh)); + gr[iCh]->SetLineColor(colors.at(iCh)); + + gr[iCh]->SetMarkerStyle(markerStyle.at(iCh)); + gr[iCh]->SetLineWidth(lineWidth.at(iCh)); + + gr_Sat[iCh]->SetMarkerColor(colors.at(iCh)); + gr_Sat[iCh]->SetLineColor(colors.at(iCh)); + + gr_Sat[iCh]->SetMarkerStyle(markerStyle.at(iCh)); + gr_Sat[iCh]->SetLineWidth(lineWidth.at(iCh)); + } + + + TLegend *legC = new TLegend(0.50,0.20,0.79,0.4,NULL,"brNDC"); + legC->SetTextFont(42); + legC->SetTextSize(0.03); + legC->SetFillColor(kWhite); + legC->SetLineColor(kWhite); + legC->SetShadowColor(kWhite); + for(int iCh=0; iChAddEntry(gr[iCh], (nameCh.at(iCh)).c_str(), "p"); + } + + TCanvas* c_eff = new TCanvas(); + gPad->SetTicks(); + gr[0]->SetTitle( HVE.c_str()); + gr[0]->GetXaxis()->SetTitle(XaxisLabel.c_str()); + if(analysisType == "eff") + gr[0]->GetYaxis()->SetTitle("Efficiency"); + if(analysisType == "timeCFD" || analysisType == "timeLED") + gr[0]->GetYaxis()->SetTitle("time resolution"); + if(analysisType == "eff") + gr[0]->GetYaxis()->SetRangeUser(0., 1.); + if(analysisType == "timeCFD" || analysisType == "timeLED") + gr[0]->GetYaxis()->SetRangeUser(0., 300.); + gr[0]->Draw("apl"); + for(int iCh=1; iChDraw("pl, same"); + } + legC->Draw("same"); + + if(analysisType == "eff") + c_eff->Print(("plots/efficiency_studies/"+HVE+".png").c_str(), "png"); + if(analysisType == "timeCFD") + c_eff->Print(("plots/resCFD_studies/"+HVE+".png").c_str(), "png"); + if(analysisType == "timeLED") + c_eff->Print(("plots/resLED_studies/"+HVE+".png").c_str(), "png"); + + + ////////Saturation + TCanvas* c_sat = new TCanvas(); + gPad->SetTicks(); + gr_Sat[0]->SetTitle( HVE.c_str()); + gr_Sat[0]->GetXaxis()->SetTitle(XaxisLabel.c_str()); + if(analysisType == "eff") + gr_Sat[0]->GetYaxis()->SetTitle("Efficiency"); + if(analysisType == "timeCFD" || analysisType == "timeLED") + gr_Sat[0]->GetYaxis()->SetTitle("time resolution"); + if(analysisType == "eff") + gr_Sat[0]->GetYaxis()->SetRangeUser(0., 1.); + if(analysisType == "timeCFD" || analysisType == "timeLED") + gr_Sat[0]->GetYaxis()->SetRangeUser(0., 300.); + gr_Sat[0]->Draw("apl"); + for(int iCh=1; iChDraw("pl, same"); + } + legC->Draw("same"); + + if(analysisType == "eff") + c_sat->Print(("plots/efficiency_studies/SatFrac_"+HVE+".png").c_str(), "png"); + if(analysisType == "timeCFD") + c_sat->Print(("plots/resCFD_studies/SatFrac_"+HVE+".png").c_str(), "png"); + if(analysisType == "timeLED") + c_sat->Print(("plots/resLED_studies/SatFrac_"+HVE+".png").c_str(), "png"); + +} diff --git a/macro/drawHodos.C b/macro/drawHodos.C new file mode 100644 index 0000000..ecc8fd3 --- /dev/null +++ b/macro/drawHodos.C @@ -0,0 +1,250 @@ +#include "TROOT.h" +#include "TStyle.h" +#include "TFile.h" +#include "TF1.h" +#include "TH1.h" +#include "TH2.h" +#include "TProfile.h" +#include "TGraph.h" +#include "TGraphErrors.h" +#include "TCanvas.h" +#include "TColor.h" +#include "TPaveStats.h" +#include "TPad.h" +#include "TLegend.h" +#include "TLatex.h" +#include "TTree.h" +#include "TChain.h" +#include "TVirtualFitter.h" +#include "TMath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void drawHodos(){ + + gStyle->SetOptStat(0); + + // + + /* + TH2F* h1_Plana1_hodo2 = new TH2F("h1_Plana1_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h1_Plana1_hodo1 = new TH2F("h1_Plana1_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h1_Plana2_hodo2 = new TH2F("h1_Plana2_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h1_Plana2_hodo1 = new TH2F("h1_Plana2_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h1_Plana3_hodo2 = new TH2F("h1_Plana3_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h1_Plana3_hodo1 = new TH2F("h1_Plana3_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h1_Plana4_hodo2 = new TH2F("h1_Plana4_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h1_Plana4_hodo1 = new TH2F("h1_Plana4_hodo1", "", 30, -15, 15, 30, -15, 15); + + // + TH2F* h2_Plana1_hodo2 = new TH2F("h2_Plana1_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h2_Plana1_hodo1 = new TH2F("h2_Plana1_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h2_Plana2_hodo2 = new TH2F("h2_Plana2_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h2_Plana2_hodo1 = new TH2F("h2_Plana2_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h2_Plana3_hodo2 = new TH2F("h2_Plana3_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h2_Plana3_hodo1 = new TH2F("h2_Plana3_hodo1", "", 30, -15, 15, 30, -15, 15); + + TH2F* h2_Plana4_hodo2 = new TH2F("h2_Plana4_hodo2", "", 30, -15, 15, 30, -15, 15); + TH2F* h2_Plana4_hodo1 = new TH2F("h2_Plana4_hodo1", "", 30, -15, 15, 30, -15, 15); + */ + TCanvas* c1 = new TCanvas(); + c1->cd(); + + + + + TFile* f2 = TFile::Open("ntuples/reco_Planacon_OFF_HVScan.root"); + TTree* ntu2 = (TTree*)f2->Get("reco_tree"); + ntu2->Draw("pos_hodoY2:pos_hodoX2 >> h2_Plana1_hodo2", "charge[0] > 138 && charge[1] > 155"); + h2_Plana1_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana1_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana1_hodo2->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana1_hodo2->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana1_hodo2.png", ".png"); + ntu2->Draw("pos_hodoY1:pos_hodoX1 >> h2_Plana1_hodo1", "charge[0] > 138 && charge[1] > 155"); + h2_Plana1_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana1_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana1_hodo1->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana1_hodo1->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana1_hodo1.png", ".png"); + + + ntu2->Draw("pos_hodoY2:pos_hodoX2 >> h2_Plana2_hodo2", "charge[0] > 138 && charge[2] > 151"); + h2_Plana2_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana2_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana2_hodo2->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana2_hodo2->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana2_hodo2.png", ".png"); + ntu2->Draw("pos_hodoY1:pos_hodoX1 >> h2_Plana2_hodo1", "charge[0] > 138 && charge[2] > 151"); + h2_Plana2_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana2_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana2_hodo1->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana2_hodo1->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana2_hodo1.png", ".png"); + + + ntu2->Draw("pos_hodoY2:pos_hodoX2 >> h2_Plana3_hodo2", "charge[0] > 138 && charge[3] > 159"); + h2_Plana3_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana3_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana3_hodo2->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana3_hodo2->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana3_hodo2.png", ".png"); + ntu2->Draw("pos_hodoY1:pos_hodoX1 >> h2_Plana3_hodo1", "charge[0] > 138 && charge[3] > 159"); + h2_Plana3_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana3_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana3_hodo1->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana3_hodo1->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana3_hodo1.png", ".png"); + + + ntu2->Draw("pos_hodoY2:pos_hodoX2 >> h2_Plana4_hodo2", "charge[0] > 138 && charge[4] > 164"); + h2_Plana4_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana4_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana4_hodo2->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana4_hodo2->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana4_hodo2.png", ".png"); + ntu2->Draw("pos_hodoY1:pos_hodoX1 >> h2_Plana4_hodo1", "charge[0] > 138 && charge[4] > 164"); + h2_Plana4_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h2_Plana4_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h2_Plana4_hodo1->GetZaxis()->SetRangeUser(0., 300.); + h2_Plana4_hodo1->Draw("colz"); + c1->Print("macro/plots/h2_OFF_HVS_Plana4_hodo1.png", ".png"); + + + TFile* f3 = TFile::Open("ntuples/reco_Planacon_OFF_X0Scan.root"); + TTree* ntu3 = (TTree*)f3->Get("reco_tree"); + ntu3->Draw("pos_hodoY2:pos_hodoX2 >> h3_Plana1_hodo2", "charge[0] > 138 && charge[1] > 155"); + h3_Plana1_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana1_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana1_hodo2->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana1_hodo2->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana1_hodo2.png", ".png"); + ntu3->Draw("pos_hodoY1:pos_hodoX1 >> h3_Plana1_hodo1", "charge[0] > 138 && charge[1] > 155"); + h3_Plana1_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana1_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana1_hodo1->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana1_hodo1->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana1_hodo1.png", ".png"); + + + ntu3->Draw("pos_hodoY2:pos_hodoX2 >> h3_Plana2_hodo2", "charge[0] > 138 && charge[2] > 151"); + h3_Plana2_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana2_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana2_hodo2->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana2_hodo2->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana2_hodo2.png", ".png"); + ntu3->Draw("pos_hodoY1:pos_hodoX1 >> h3_Plana2_hodo1", "charge[0] > 138 && charge[2] > 151"); + h3_Plana2_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana2_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana1_hodo1->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana2_hodo1->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana2_hodo1.png", ".png"); + + + ntu3->Draw("pos_hodoY2:pos_hodoX2 >> h3_Plana3_hodo2", "charge[0] > 138 && charge[3] > 159"); + h3_Plana3_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana3_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana3_hodo2->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana3_hodo2->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana3_hodo2.png", ".png"); + ntu3->Draw("pos_hodoY1:pos_hodoX1 >> h3_Plana3_hodo1", "charge[0] > 138 && charge[3] > 159"); + h3_Plana3_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana3_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana3_hodo1->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana3_hodo1->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana3_hodo1.png", ".png"); + + + ntu3->Draw("pos_hodoY2:pos_hodoX2 >> h3_Plana4_hodo2", "charge[0] > 138 && charge[4] > 164"); + h3_Plana4_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana4_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana4_hodo2->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana4_hodo2->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana4_hodo2.png", ".png"); + ntu3->Draw("pos_hodoY1:pos_hodoX1 >> h3_Plana4_hodo1", "charge[0] > 138 && charge[4] > 164"); + h3_Plana4_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h3_Plana4_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h3_Plana4_hodo1->GetZaxis()->SetRangeUser(0., 1000.); + h3_Plana4_hodo1->Draw("colz"); + c1->Print("macro/plots/h3_OFF_X0S_Plana4_hodo1.png", ".png"); + + + + // HV ON + TFile* f1 = TFile::Open("ntuples/reco_Planacon_ON_HVScan.root"); + TTree* ntu = (TTree*)f1->Get("reco_tree"); + + ntu->Draw("pos_hodoY2:pos_hodoX2 >> h1_Plana1_hodo2", "charge[0] > 138 && charge[1] > 155"); + h1_Plana1_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana1_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana1_hodo2->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana1_hodo2->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana1_hodo2.png", ".png"); + ntu->Draw("pos_hodoY1:pos_hodoX1 >> h1_Plana1_hodo1", "charge[0] > 138 && charge[1] > 155"); + h1_Plana1_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana1_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana1_hodo1->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana1_hodo1->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana1_hodo1.png", ".png"); + + ntu->Draw("pos_hodoY2:pos_hodoX2 >> h1_Plana2_hodo2", "charge[0] > 138 && charge[2] > 151"); + h1_Plana2_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana2_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana2_hodo2->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana2_hodo2->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana2_hodo2.png", ".png"); + ntu->Draw("pos_hodoY1:pos_hodoX1 >> h1_Plana2_hodo1", "charge[0] > 138 && charge[2] > 151"); + h1_Plana2_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana2_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana2_hodo1->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana2_hodo1->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana2_hodo1.png", ".png"); + + ntu->Draw("pos_hodoY2:pos_hodoX2 >> h1_Plana3_hodo2", "charge[0] > 138 && charge[3] > 159"); + h1_Plana3_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana3_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana3_hodo2->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana3_hodo2->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana3_hodo2.png", ".png"); + ntu->Draw("pos_hodoY1:pos_hodoX1 >> h1_Plana3_hodo1", "charge[0] > 138 && charge[3] > 159"); + h1_Plana3_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana3_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana3_hodo1->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana3_hodo1->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana3_hodo1.png", ".png"); + + ntu->Draw("pos_hodoY2:pos_hodoX2 >> h1_Plana4_hodo2", "charge[0] > 138 && charge[4] > 164"); + h1_Plana4_hodo2->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana4_hodo2->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana4_hodo2->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana4_hodo2->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana4_hodo2.png", ".png"); + ntu->Draw("pos_hodoY1:pos_hodoX1 >> h1_Plana4_hodo1", "charge[0] > 138 && charge[4] > 164"); + h1_Plana4_hodo1->GetXaxis()->SetRangeUser(-10, 10); + h1_Plana4_hodo1->GetYaxis()->SetRangeUser(-10, 10); + h1_Plana4_hodo1->GetZaxis()->SetRangeUser(0., 3000.); + h1_Plana4_hodo1->Draw("colz"); + c1->Print("macro/plots/h1_ON_HVS_Plana4_hodo1.png", ".png"); + + + +} diff --git a/TB/macro/drawResolution.C b/macro/drawResolution.C similarity index 100% rename from TB/macro/drawResolution.C rename to macro/drawResolution.C diff --git a/TB/macro/drawSaturatedFraction.C b/macro/drawSaturatedFraction.C similarity index 100% rename from TB/macro/drawSaturatedFraction.C rename to macro/drawSaturatedFraction.C diff --git a/TB/macro/fitHodo.C b/macro/fitHodo.C similarity index 100% rename from TB/macro/fitHodo.C rename to macro/fitHodo.C diff --git a/TB/macro/rootlogon.C b/macro/rootlogon.C similarity index 100% rename from TB/macro/rootlogon.C rename to macro/rootlogon.C diff --git a/TB/ntuples/.gitignore b/ntuples/.gitignore similarity index 100% rename from TB/ntuples/.gitignore rename to ntuples/.gitignore diff --git a/TB/plots/.gitignore b/plots/.gitignore similarity index 100% rename from TB/plots/.gitignore rename to plots/.gitignore diff --git a/TB/python/analyzer.py b/python/analyzer.py similarity index 72% rename from TB/python/analyzer.py rename to python/analyzer.py index 1821358..1d78cff 100755 --- a/TB/python/analyzer.py +++ b/python/analyzer.py @@ -12,8 +12,9 @@ parser.add_argument ('-m', '--MCP' , default = 'MiB3', help='MCP to analyze') parser.add_argument ('-a', '--analysis' , default = "eff", help='select analysis: eff->efficiency, Q->charge, time->CDF resolution, timeLED') parser.add_argument ('-s', '--scan' , default = "HV", help='type of scan: HV = scan in HV, X0 = scan in X0') - parser.add_argument ('-n', '--name' , default = "HVScan1", help='suffix of the reco file in input') + parser.add_argument ('-n', '--name' , default = "prova", help='suffix of the reco file in input') + parser.add_argument ('-i', '--inputDir', default='/gwteray/users/pigazzini/IMCP/BTF2015/ntuples/', help='input directory') args = parser.parse_args () - print 'analyzer '+args.cfg+' '+args.MCP+' '+args.analysis+' '+args.scan+' '+args.name - os.system('./analyzer.exe '+args.cfg+' '+args.MCP+' '+args.analysis+' '+args.scan+' '+args.name) + print 'analyzer '+args.cfg+' '+args.MCP+' '+args.analysis+' '+args.scan+' '+args.name+' '+args.inputDir + os.system('./analyzer.exe '+args.cfg+' '+args.MCP+' '+args.analysis+' '+args.scan+' '+args.name+' '+args.inputDir) diff --git a/TB/python/calcTreshold.py b/python/calcTreshold.py similarity index 81% rename from TB/python/calcTreshold.py rename to python/calcTreshold.py index 2ab034b..f763846 100755 --- a/TB/python/calcTreshold.py +++ b/python/calcTreshold.py @@ -8,10 +8,10 @@ import string if __name__ == '__main__': parser = argparse.ArgumentParser (description = 'calcTreshold: calculate charge tresholds for each channel') - parser.add_argument ('-i', '--inputFile' , default = 'ntuples/reco_HVScan1.root' , help='input file') + parser.add_argument ('-i', '--inputFile' , default = 'ntuples/reco_HVScan1_double.root' , help='input file') parser.add_argument ('-SB', '--tresholdValue' , default = '1000', help='value to use in calculating S/B treshold') - parser.add_argument ('-c', '--chNumber' , default = '10', help='number of channels (in the raw data!)') - parser.add_argument ('-HV', '--HV' , default = '2700', help='analyze only channels with HV>treshold') + parser.add_argument ('-c', '--chNumber' , default = '18', help='number of channels (in the raw data!)') + parser.add_argument ('-HV', '--HV' , default = '2650', help='analyze only channels with HV>treshold') args = parser.parse_args () print 'calcTreshold '+args.inputFile+' '+args.tresholdValue+' '+args.chNumber+' '+args.HV os.system('./calcTreshold.exe '+args.inputFile+' '+args.tresholdValue+' '+args.chNumber+' '+args.HV) diff --git a/TB/python/calcTreshold_fitTemplate.py b/python/calcTreshold_fitTemplate.py similarity index 100% rename from TB/python/calcTreshold_fitTemplate.py rename to python/calcTreshold_fitTemplate.py diff --git a/python/drawEfficiency.py b/python/drawEfficiency.py new file mode 100644 index 0000000..16be949 --- /dev/null +++ b/python/drawEfficiency.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +import sys +import os +import commands +from commands import getstatusoutput +import datetime +import argparse +import string +if __name__ == '__main__': + os.system('./drawEfficiency.exe HV12') + os.system('./drawEfficiency.exe HV1') + os.system('./drawEfficiency.exe HV2') + os.system('./drawEfficiency.exe Extreme') + os.system('./drawEfficiency.exe Ang') + os.system('./drawEfficiency.exe X0_12') + os.system('./drawEfficiency.exe X0_1') + os.system('./drawEfficiency.exe multiplicity1') + os.system('./drawEfficiency.exe multiplicity2') + os.system('./drawEfficiency.exe LongScan2X0') + diff --git a/python/drawResolutionCFD.py b/python/drawResolutionCFD.py new file mode 100644 index 0000000..26c77ad --- /dev/null +++ b/python/drawResolutionCFD.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +import sys +import os +import commands +from commands import getstatusoutput +import datetime +import argparse +import string +if __name__ == '__main__': + os.system('./drawResolutionCFD.exe HV12') + os.system('./drawResolutionCFD.exe HV1') + os.system('./drawResolutionCFD.exe HV2') + os.system('./drawResolutionCFD.exe Extreme') + os.system('./drawResolutionCFD.exe Ang') + os.system('./drawResolutionCFD.exe X0_12') + os.system('./drawResolutionCFD.exe X0_1') +# os.system('./drawResolutionCFD.exe multiplicity1') +# os.system('./drawResolutionCFD.exe multiplicity2') + os.system('./drawResolutionCFD.exe LongScan2X0') + os.system('./drawResolutionCFD.exe saturated_HV12') + os.system('./drawResolutionCFD.exe saturated_X0_12') + diff --git a/TB/python/drawResolutionLED.py b/python/drawResolutionLED.py similarity index 100% rename from TB/python/drawResolutionLED.py rename to python/drawResolutionLED.py diff --git a/TB/python/drawSaturatedFrac.py b/python/drawSaturatedFrac.py similarity index 100% rename from TB/python/drawSaturatedFrac.py rename to python/drawSaturatedFrac.py diff --git a/python/drawWaveform.py b/python/drawWaveform.py new file mode 100755 index 0000000..9eb6acb --- /dev/null +++ b/python/drawWaveform.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +import sys +import os +import commands +from commands import getstatusoutput +import datetime +import argparse +import string +if __name__ == '__main__': + parser = argparse.ArgumentParser (description = 'draw waveform: read raw data and draw some waveforms') + parser.add_argument ('-d', '--dir' , default = '/gwteray/users/pigazzini/IMCP/BTF2015/raw_data', help='directory containing raw data') + parser.add_argument ('-r', '--run' , default = '1834', help='run to scan') + parser.add_argument ('-c', '--channel' , default = '1', help='channel to analyze') + parser.add_argument ('-f', '--firstEntry' , default = '11', help='first entry') + parser.add_argument ('-n', '--nEvents' , default = '1', help='number of events to analyze') + parser.add_argument ('-tP', '--trigPos' , default = '4', help='position (channel) of the trigger in the raw files') + args = parser.parse_args () + print './drawWaveform '+args.dir+' '+args.run+' '+args.channel+' '+args.firstEntry+' '+args.nEvents+' '+args.trigPos + os.system('./drawWaveform.exe '+args.dir+' '+args.run+' '+args.channel+' '+args.firstEntry+' '+args.nEvents+' '+args.trigPos) + diff --git a/TB/python/dumper.py b/python/dumper.py similarity index 57% rename from TB/python/dumper.py rename to python/dumper.py index b0e6fcd..6aa9a63 100755 --- a/TB/python/dumper.py +++ b/python/dumper.py @@ -8,11 +8,12 @@ import string if __name__ == '__main__': parser = argparse.ArgumentParser (description = 'dumper: create reco tree from raw data') - parser.add_argument ('-cfg', '--cfg' , default = 'cfg/HVScan1.cfg' , help='list of run') + parser.add_argument ('-cfg', '--cfg' , default = 'cfg/prova.cfg' , help='list of run') parser.add_argument ('-d', '--dir' , default = '/gwteray/users/brianza/iMCP_H4', help='directory containing raw data') - parser.add_argument ('-c', '--chNumber' , default = '11', help='number of channels (in the raw data!)') - parser.add_argument ('-n', '--name' , default = 'HVScan1', help='suffix of reco output file') + parser.add_argument ('-c', '--chNumber' , default = '18', help='number of channels (in the raw data!)') + parser.add_argument ('-n', '--name' , default = 'prova', help='suffix of reco output file') + parser.add_argument ('-tP', '--trigPos' , default = '4', help='position (channel) of the trigger in the raw files') args = parser.parse_args () - print 'dumper '+args.cfg+' '+args.dir+' '+args.chNumber+' '+args.name - os.system('./dumper.exe '+args.cfg+' '+args.dir+' '+args.chNumber+' '+args.name) + print 'dumper '+args.cfg+' '+args.dir+' '+args.chNumber+' '+args.name+' '+args.trigPos + os.system('./dumper.exe '+args.cfg+' '+args.dir+' '+args.chNumber+' '+args.name+' '+args.trigPos) diff --git a/TB/python/dumper_fitTemplate.py b/python/dumper_fitTemplate.py similarity index 100% rename from TB/python/dumper_fitTemplate.py rename to python/dumper_fitTemplate.py diff --git a/TB/python/preshower.py b/python/preshower.py similarity index 100% rename from TB/python/preshower.py rename to python/preshower.py diff --git a/python/prodNtuple.py b/python/prodNtuple.py new file mode 100755 index 0000000..18ba543 --- /dev/null +++ b/python/prodNtuple.py @@ -0,0 +1,39 @@ +#! /usr/bin/env python +import os +import glob +import math +from array import array +import sys +import time +import subprocess + +currentDir = os.getcwd(); +CMSSWDir = currentDir+"/../../"; + +name = ["AngScan_Double9040","HVScan12_Double9040_part1","HVScan12_Double9040_part2","HVScan12_Double9090","HVScan12_GaAsEm_part1","HVScan12_GaAsEm_part2", + "HVScan12_MultiAlkEm_part1","HVScan12_MultiAlkEm_part2","HVScan12bis_GaAsEm","HVScan1_Double9040","HVScan1_Double9090","HVScan1_GaAsEm", + "HVScan1_MultiAlkEm","HVScan2_Double9040","HVScan2_Double9090","HVScanExt_Double9040","HVScanExt_Double9090","LongScan0X0_Double9040", + "LongScan0X0_Double9090","LongScan0X0_GaAsEm","LongScan0X0_MultiAlkEm","LongScan0X0_Double9040_2", + "LongScan0X0_Double9090_2","LongScan0X0_GaAsEm_2","LongScan0X0_MultiAlkEm_2","LongScan2X0_Double9040","LongScan2X0_Double9090","LongScan2X0_GaAsEm", + "LongScan2X0_MultiAlkEm","X0Scan12_Double9040","X0Scan12_Double9090","X0Scan12_GaAsEm","X0Scan12_MultiAlkEm","X0Scan1_Double9040", + "X0Scan1_Double9090","X0Scan1_MultiAlkEm","X0Scan1_GaAsEm"]; +''' +name = ["LongScan0X0_Double9040", + "LongScan0X0_Double9090","LongScan0X0_GaAsEm","LongScan0X0_MultiAlkEm","LongScan0X0_Double9040_2", + "LongScan0X0_Double9090_2","LongScan0X0_GaAsEm_2","LongScan0X0_MultiAlkEm_2"]; +''' + +for i in range(len(name)): + fn = "Job/Job_"+name[i]; + outScript = open(fn+".sh","w"); + command = "python python/dumper.py -cfg cfg/"+name[i]+".cfg -n "+name[i]; + + outScript.write('#!/bin/bash'); + outScript.write("\n"+'cd '+CMSSWDir); + outScript.write("\n"+'eval `scram runtime -sh`'); + outScript.write("\n"+'cd '+currentDir); + outScript.write("\n"+"unbuffer "+command+" > "+fn+"_output.txt"); + outScript.close(); + + os.system("chmod 777 "+currentDir+"/"+fn+".sh"); + os.system("qsub -V -d "+currentDir+" -q production "+currentDir+"/"+fn+".sh"); diff --git a/TB/results/.gitignore b/results/.gitignore similarity index 100% rename from TB/results/.gitignore rename to results/.gitignore diff --git a/script/cp-data.sh b/script/cp-data.sh new file mode 100755 index 0000000..b761bfd --- /dev/null +++ b/script/cp-data.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mkdir ${1} +scp -r cmsdaq@192.168.189.82:/data/IMCP/DQM/${1}/*root ${1} diff --git a/TB/script/runAllAnalysis.sh b/script/runAllAnalysis.sh similarity index 65% rename from TB/script/runAllAnalysis.sh rename to script/runAllAnalysis.sh index f8a72c0..f76b788 100644 --- a/TB/script/runAllAnalysis.sh +++ b/script/runAllAnalysis.sh @@ -1,6 +1,4 @@ sh script/runAllEff.sh sh script/runAllTimeCFD.sh -sh script/runAllTimeLED.sh python python/drawEfficiency.py python python/drawResolutionCFD.py -python python/drawResolutionLED.py diff --git a/script/runAllEff.sh b/script/runAllEff.sh new file mode 100644 index 0000000..65b1d98 --- /dev/null +++ b/script/runAllEff.sh @@ -0,0 +1,38 @@ +python python/analyzer.py -m MultiAlkEm -a eff -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_MultiAlkEm +python python/analyzer.py -m GaAsEm -a eff -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_GaAsEm +python python/analyzer.py -m Double9040 -a eff -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_Double9040 +python python/analyzer.py -m Double9090 -a eff -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_Double9090 +python python/analyzer.py -m MultiAlkEm -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_MultiAlkEm +python python/analyzer.py -m GaAsEm -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_GaAsEm +python python/analyzer.py -m Double9040 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_Double9040 +python python/analyzer.py -m Double9090 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_Double9090 +python python/analyzer.py -m Double9040 -a eff -s HV2 -cfg cfg/treshold_5s.txt -n HVScan2_Double9040 +python python/analyzer.py -m Double9090 -a eff -s HV2 -cfg cfg/treshold_5s.txt -n HVScan2_Double9090 + +python python/analyzer.py -m Double9040 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScanExt_Double9040 +python python/analyzer.py -m Double9090 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n HVScanExt_Double9090 + +python python/analyzer.py -m MultiAlkEm -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_MultiAlkEm +python python/analyzer.py -m GaAsEm -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_GaAsEm +python python/analyzer.py -m Double9040 -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_Double9040 +python python/analyzer.py -m Double9090 -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_Double9090 +python python/analyzer.py -m MultiAlkEm -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_MultiAlkEm +python python/analyzer.py -m GaAsEm -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_GaAsEm +python python/analyzer.py -m Double9040 -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_Double9040 +python python/analyzer.py -m Double9090 -a eff -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_Double9090 + +python python/analyzer.py -m MultiAlkEm -a eff -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_MultiAlkEm_1 +python python/analyzer.py -m GaAsEm -a eff -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_GaAsEm_1 +python python/analyzer.py -m Double9040 -a eff -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9040_1 +python python/analyzer.py -m Double9090 -a eff -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9090_1 +python python/analyzer.py -m MultiAlkEm -a eff -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_MultiAlkEm_2 +python python/analyzer.py -m GaAsEm -a eff -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_GaAsEm_2 +python python/analyzer.py -m Double9040 -a eff -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9040_2 +python python/analyzer.py -m Double9090 -a eff -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9090_2 + +python python/analyzer.py -m MultiAlkEm -a eff -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_MultiAlkEm +python python/analyzer.py -m GaAsEm -a eff -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_GaAsEm +python python/analyzer.py -m Double9040 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_Double9040 +python python/analyzer.py -m Double9090 -a eff -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_Double9090 + +python python/analyzer.py -m Double9040 -a eff -s Ang -cfg cfg/treshold_5s.txt -n AngScan_Double9040 diff --git a/script/runAllTimeCFD.sh b/script/runAllTimeCFD.sh new file mode 100644 index 0000000..d2f544b --- /dev/null +++ b/script/runAllTimeCFD.sh @@ -0,0 +1,38 @@ +python python/analyzer.py -m MultiAlkEm -a timeCFD -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_MultiAlkEm +python python/analyzer.py -m GaAsEm -a timeCFD -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_GaAsEm +python python/analyzer.py -m Double9040 -a timeCFD -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s HV12 -cfg cfg/treshold_5s.txt -n HVScan12_Double9090 +python python/analyzer.py -m MultiAlkEm -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_MultiAlkEm +python python/analyzer.py -m GaAsEm -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_GaAsEm +python python/analyzer.py -m Double9040 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScan1_Double9090 +python python/analyzer.py -m Double9040 -a timeCFD -s HV2 -cfg cfg/treshold_5s.txt -n HVScan2_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s HV2 -cfg cfg/treshold_5s.txt -n HVScan2_Double9090 + +python python/analyzer.py -m Double9040 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScanExt_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n HVScanExt_Double9090 + +python python/analyzer.py -m MultiAlkEm -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_MultiAlkEm +python python/analyzer.py -m GaAsEm -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_GaAsEm +python python/analyzer.py -m Double9040 -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan12_Double9090 +python python/analyzer.py -m MultiAlkEm -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_MultiAlkEm +python python/analyzer.py -m GaAsEm -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_GaAsEm +python python/analyzer.py -m Double9040 -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s X0 -cfg cfg/treshold_5s.txt -n X0Scan1_Double9090 + +python python/analyzer.py -m MultiAlkEm -a timeCFD -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_MultiAlkEm_1 +python python/analyzer.py -m GaAsEm -a timeCFD -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_GaAsEm_1 +python python/analyzer.py -m Double9040 -a timeCFD -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9040_1 +python python/analyzer.py -m Double9090 -a timeCFD -s multiplicity1 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9090_1 +python python/analyzer.py -m MultiAlkEm -a timeCFD -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_MultiAlkEm_2 +python python/analyzer.py -m GaAsEm -a timeCFD -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_GaAsEm_2 +python python/analyzer.py -m Double9040 -a timeCFD -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9040_2 +python python/analyzer.py -m Double9090 -a timeCFD -s multiplicity2 -cfg cfg/treshold_5s.txt -n LongScan0X0_Double9090_2 + +python python/analyzer.py -m MultiAlkEm -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_MultiAlkEm +python python/analyzer.py -m GaAsEm -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_GaAsEm +python python/analyzer.py -m Double9040 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_Double9040 +python python/analyzer.py -m Double9090 -a timeCFD -s HV1 -cfg cfg/treshold_5s.txt -n LongScan2X0_Double9090 + +python python/analyzer.py -m Double9040 -a timeCFD -s Ang -cfg cfg/treshold_5s.txt -n AngScan_Double9040 diff --git a/src/AlignmentOfficer.cc b/src/AlignmentOfficer.cc new file mode 100644 index 0000000..ea9da9f --- /dev/null +++ b/src/AlignmentOfficer.cc @@ -0,0 +1,53 @@ +#include "../interface/AlignmentOfficer.h" + +#include +#include + + + +AlignmentOfficer::AlignmentOfficer( const std::string& fileName ) { + + this->setOffsetsFile(fileName); + +} + + + +void AlignmentOfficer::setOffsetsFile( const std::string& fileName ) { + + offsets_.clear(); + + alignmentFile_ = fileName; + + std::ifstream ifs(fileName.c_str()); + + while( ifs.good() ) { + + std::string name; + float offset; + ifs >> name >> offset; + + offsets_[name] = offset; + + } + + std::cout << "-> Loaded alignment offsets from file: " << fileName << std::endl; + +} + + + +float AlignmentOfficer::getOffset( const std::string& name ) { + + return offsets_[name]; + +} + + + +void AlignmentOfficer::fix( const std::string& name, int n, float* x ) { + + for( unsigned i=0; i double CfgManager::GetOpt(string block, string key, int opt) +{ + Errors(block, key, opt); + + double opt_val; + istringstream buffer(opts_[block].at(key).at(opt)); + buffer >> opt_val; + + return opt_val; +} + +template<> float CfgManager::GetOpt(string block, string key, int opt) +{ + return (float)GetOpt(block, key, opt); +} + +template<> int CfgManager::GetOpt(string block, string key, int opt) +{ + return (int)GetOpt(block, key, opt); +} + +template<> string CfgManager::GetOpt(string block, string key, int opt) +{ + Errors(block, key, opt); + return opts_[block].at(key).at(opt); +} + +//**********utils************************************************************************* + +void CfgManager::Errors(string block, string key, int opt) +{ + if(opts_.count(block) == 0) + { + cout << "> CfgManager --- ERROR: block '"<< block << "' not found" << endl; + exit(-1); + } + if(opts_[block].count(key) == 0) + { + cout << "> CfgManager --- ERROR: option '"<< key << "' not found" << endl; + exit(-1); + } + if(opt >= opts_[block].at(key).size()) + { + cout << "> CfgManager --- ERROR: option '"<< key << "' as less then " + << opt << "values (" << opts_[block].at(key).size() << ")" << endl; + exit(-1); + } + return; +} + +void CfgManager::ParseConfigFile(const char* file) +{ + ifstream cfgFile(file, ios::in); + string buffer; + string current_block="global"; + map > block_opts; + while(getline(cfgFile, buffer)) + { + if(buffer.size() == 0 || buffer.at(0) == '#') + continue; + istringstream splitter(buffer); + vector tokens = vector(istream_iterator(splitter), + istream_iterator()); + if(tokens.at(0).at(0) == '<') + { + if(tokens.at(0).at(1) == '/') + { + tokens.at(0).erase(tokens.at(0).begin(), tokens.at(0).begin()+2); + tokens.at(0).erase(--tokens.at(0).end()); + if(tokens.at(0) == current_block) + { + opts_[current_block] = block_opts; + block_opts.clear(); + current_block = "global"; + } + else + cout << "> CfgManager --- ERROR: wrong closing block // " << tokens.at(0) << endl; + } + else + { + tokens.at(0).erase(tokens.at(0).begin()); + tokens.at(0).erase(--tokens.at(0).end()); + current_block = tokens.at(0); + } + } + else + { + string key=tokens.at(0); + tokens.erase(tokens.begin()); + block_opts[key] = tokens; + } + } + cfgFile.close(); +} + +//**********operators********************************************************************* + +ostream& operator<<(ostream& out, const CfgManager& obj) +{ + map > >::const_iterator itBlock; + //---banner + out << "current configuration:" << endl; + //---options + for(itBlock=obj.opts_.begin(); itBlock!=obj.opts_.end(); ++itBlock) + { + out << setw(20) << itBlock->first; + map >::const_iterator itOpt; + for(itOpt=itBlock->second.begin(); itOpt!=itBlock->second.end(); ++itOpt) + { + for(int iOpt=0; iOptsecond.size(); ++iOpt) + { + out << setw(itOpt->first.size()+3) << itOpt->first; + out << setw(itOpt->second.at(iOpt).size()+3) << itOpt->second.at(iOpt); + out << endl; + } + } + out << endl; + } + return out; +} diff --git a/src/HodoCluster.cc b/src/HodoCluster.cc new file mode 100644 index 0000000..efc192f --- /dev/null +++ b/src/HodoCluster.cc @@ -0,0 +1,26 @@ +#include "../interface/HodoCluster.h" +#include + + + + +void HodoCluster::addFibre( int i ) { + + float xmin = 0.5*(hodoTotFibres_-1)*fibreWidth_; + float thisPos = fibreWidth_*((float)i) - xmin; + + if( size_==0 ) { + + pos_ += thisPos; + size_+=1; + + } else { + + pos_ *= (float)size_; + pos_ += thisPos; + size_+=1; + pos_ /= size_; + + } + +} diff --git a/src/MCPMap.cc b/src/MCPMap.cc new file mode 100644 index 0000000..2d9bd45 --- /dev/null +++ b/src/MCPMap.cc @@ -0,0 +1,61 @@ +#include "../interface/MCPMap.h" + +std::map MCPList; +std::map inverted_MCPList; + +void Fill_MCPList (void) + { + /*MCPList.insert(std::make_pair("MiB2",0)); + MCPList.insert(std::make_pair("GaAsEm",1)); + MCPList.insert(std::make_pair("MultiAlkEm",2)); + MCPList.insert(std::make_pair("Double9090",3)); + MCPList.insert(std::make_pair("Double9040",4)); + MCPList.insert(std::make_pair("clock1",5)); + MCPList.insert(std::make_pair("clock2",6)); + MCPList.insert(std::make_pair("Roma1",7)); + MCPList.insert(std::make_pair("Off2",8)); + MCPList.insert(std::make_pair("Off3",9)); + MCPList.insert(std::make_pair("Off4",10)); + MCPList.insert(std::make_pair("Off6",11)); + MCPList.insert(std::make_pair("Off7",12)); + MCPList.insert(std::make_pair("Off8",13)); + MCPList.insert(std::make_pair("Off9",14)); + MCPList.insert(std::make_pair("Off10",15)); + MCPList.insert(std::make_pair("Off11",16)); + MCPList.insert(std::make_pair("Off12",17)); */ + +MCPList.insert(std::make_pair("MiB2",0)); + MCPList.insert(std::make_pair("Plana1",1)); + MCPList.insert(std::make_pair("Plana2",2)); + MCPList.insert(std::make_pair("Plana3",3)); + MCPList.insert(std::make_pair("Plana4",4)); + } + +void Fill_inverted_MCPList (void) + { + /* inverted_MCPList.insert(std::make_pair(0,"MiB2")); + inverted_MCPList.insert(std::make_pair(1,"GaAsEm")); + inverted_MCPList.insert(std::make_pair(2,"MultiAlkEm")); + inverted_MCPList.insert(std::make_pair(3,"Double9090")); + inverted_MCPList.insert(std::make_pair(4,"Double9040")); + inverted_MCPList.insert(std::make_pair(5,"clock1")); + inverted_MCPList.insert(std::make_pair(6,"clock2")); + inverted_MCPList.insert(std::make_pair(7,"Roma1")); + inverted_MCPList.insert(std::make_pair(8,"Off2")); + inverted_MCPList.insert(std::make_pair(9,"Off3")); + inverted_MCPList.insert(std::make_pair(10,"Off4")); + inverted_MCPList.insert(std::make_pair(11,"Off6")); + inverted_MCPList.insert(std::make_pair(12,"Off7")); + inverted_MCPList.insert(std::make_pair(13,"Off8")); + inverted_MCPList.insert(std::make_pair(14,"Off9")); + inverted_MCPList.insert(std::make_pair(15,"Off10")); + inverted_MCPList.insert(std::make_pair(16,"Off11")); + inverted_MCPList.insert(std::make_pair(17,"Off12")); */ + + +inverted_MCPList.insert(std::make_pair(0,"MiB2")); + inverted_MCPList.insert(std::make_pair(1,"Plana1")); + inverted_MCPList.insert(std::make_pair(2,"Plana2")); + inverted_MCPList.insert(std::make_pair(3,"Plana3")); + inverted_MCPList.insert(std::make_pair(4,"Plana4")); + } diff --git a/TB/src/ScaleEstimators.cc b/src/ScaleEstimators.cc similarity index 100% rename from TB/src/ScaleEstimators.cc rename to src/ScaleEstimators.cc diff --git a/src/TagHelper.cc b/src/TagHelper.cc new file mode 100644 index 0000000..d6bb740 --- /dev/null +++ b/src/TagHelper.cc @@ -0,0 +1,89 @@ +#include "../interface/TagHelper.h" + +#include +#include + + + +TagHelper::TagHelper( const std::string& tag,const std::string& Energy ) { + + setTag(tag, Energy); + +} + + + + + +TagHelper::~TagHelper() { + +} + + + +void TagHelper::setTag( const std::string& tag, const std::string& Energy ) { + + tag_ = tag; + + if( tag=="V00" ) { + + tag_cef3_ ="V0"; + tag_bgo_ ="V0"; + tag_align_ = Energy+"_V0"; + + }else if( tag=="V01" ) { + + tag_cef3_ ="V1"; + tag_bgo_ ="V0"; + tag_align_ = Energy+"_V1"; + + }else if( tag=="V02" ) { + + tag_cef3_ ="V1"; + tag_bgo_ ="V0"; + tag_align_ = Energy+"_V2"; + + }else if( tag=="dev" ) { + + tag_cef3_ ="V1"; + tag_bgo_ ="V0"; + tag_align_ = Energy+"_dev"; + + } else { + std::cout << "[TagHelper] :: Tag " << tag << " does not exist. Exiting" << std::endl; + exit(12345); + + } + +} + + + + +std::string TagHelper::getCeF3FileName() const { + + std::string fileName = "CeF3Calibration/constants_" + tag_cef3_ + ".txt"; + + return fileName; + +} + + +std::string TagHelper::getBGOFileName() const { + + std::string fileName = "BGOCalibration/constants_" + tag_bgo_ + ".txt"; + + return fileName; + +} + + +std::string TagHelper::getAlignmentFileName() const { + + std::string fileName = "Alignment/offsets_" + tag_align_ + ".txt"; + + // std::string fileName = "Alignment/offsets_" + Energy + tag_align_ + ".txt"; + + return fileName; + +} diff --git a/TB/src/analysis_tools.cc b/src/analysis_tools.cc similarity index 99% rename from TB/src/analysis_tools.cc rename to src/analysis_tools.cc index 9e56ecd..35152d1 100644 --- a/TB/src/analysis_tools.cc +++ b/src/analysis_tools.cc @@ -473,8 +473,7 @@ float ComputeIntegral(int t1, int t2, const vector* samples) { float integral=0; for(int bin=t1; binat(bin)>0) integral+=0; - integral += samples->at(bin); + integral += samples->at(bin); return integral; } diff --git a/TB/src/histoFuncT.cc b/src/histoFuncT.cc similarity index 100% rename from TB/src/histoFuncT.cc rename to src/histoFuncT.cc diff --git a/src/init_Reco_Tree.cc b/src/init_Reco_Tree.cc new file mode 100644 index 0000000..127502f --- /dev/null +++ b/src/init_Reco_Tree.cc @@ -0,0 +1,360 @@ +#include "../interface/init_Reco_Tree.h" + +int event; +float time_CF[8]; +float time_CF_corr[8]; +float time_CF30[8]; +float time_OT[8]; +float time_start[8]; +float time_stop[8]; +float time_start_1000[8]; +float time_stop_1000[8]; +float time_start_150[8]; +float time_stop_150[8]; +float time_start_200[8]; +float time_stop_200[8]; +float time_start_500[8]; +float time_stop_500[8]; +float time_start_300[8]; +float time_stop_300[8]; +float time_Max[8]; +float amp_max[8]; +float amp_max_corr[8]; +float amp_max_time[8]; +float charge[8]; +float charge_corr[8]; +float baseline[8]; +int sci_front_adc; +int bgo_back_adc; +int run_id; +int isPCOn[8]; +int HV[8]; +int HV2[8]; +int isTrigger[8]; +float X0; + +int nClusters_hodoX1; +int nFibres_hodoX1[64]; +float pos_hodoX1[64]; +float pos_corr_hodoX1[64]; + +int nClusters_hodoY1; +int nFibres_hodoY1[64]; +float pos_hodoY1[64]; +float pos_corr_hodoY1[64]; + +int nClusters_hodoX2; +int nFibres_hodoX2[64]; +float pos_hodoX2[64]; +float pos_corr_hodoX2[64]; + +int nClusters_hodoY2; +int nFibres_hodoY2[64]; +float pos_hodoY2[64]; +float pos_corr_hodoY2[64]; + +int nClusters_hodoSmallX; +int nFibres_hodoSmallX[4]; +float pos_hodoSmallX[4]; +float pos_corr_hodoSmallX[4]; + +int nClusters_hodoSmallY; +int nFibres_hodoSmallY[4]; +float pos_hodoSmallY[4]; +float pos_corr_hodoSmallY[4]; + +int nTDCHits[4]; +float pos_2FibClust_hodoX1; +float pos_2FibClust_corr_hodoX1; + +float pos_2FibClust_hodoY1; +float pos_2FibClust_corr_hodoY1; + +float pos_2FibClust_hodoX2; +float pos_2FibClust_corr_hodoX2; + +float pos_2FibClust_hodoY2; +float pos_2FibClust_corr_hodoY2; + +float cluster_pos_hodoX1; +float cluster_pos_corr_hodoX1; +float cluster_pos_hodoX2; +float cluster_pos_corr_hodoX2; +float cluster_pos_hodoY1; +float cluster_pos_corr_hodoY1; +float cluster_pos_hodoY2; +float cluster_pos_corr_hodoY2; +float wc_x; +float wc_y; +float wc_x_corr; +float wc_y_corr; + +// List of branches +TBranch *b_event; +TBranch *b_time_CF; //! +TBranch *b_time_CF_corr; //! +TBranch *b_time_CF30; //! +TBranch *b_time_OT; //! +TBranch *b_time_start; +TBranch *b_time_stop; +TBranch *b_time_start_1000; +TBranch *b_time_stop_1000; +TBranch *b_time_start_150; +TBranch *b_time_stop_150; +TBranch *b_time_start_200; +TBranch *b_time_stop_200; +TBranch *b_time_start_500; +TBranch *b_time_stop_500; +TBranch *b_time_start_300; +TBranch *b_time_stop_300; +TBranch *b_time_Max; //! +TBranch *b_amp_max; //! +TBranch *b_amp_max_corr; //! +TBranch *b_amp_max_time; //! +TBranch *b_baseline; //! +TBranch *b_charge; //! +TBranch *b_charge_corr; //! +TBranch *b_sci_front_adc; //! +TBranch *b_bgo_back_adc; //! +TBranch *b_run_id; //! +TBranch *b_isPCOn; //! +TBranch *b_HV; //! +TBranch *b_HV2; //! +TBranch *b_isTrigger; +TBranch *b_X0; + +TBranch *b_nClusters_hodoX1; //! +TBranch *b_nFibres_hodoX1; //! +TBranch *b_pos_hodoX1; //! +TBranch *b_pos_corr_hodoX1; //! +TBranch *b_nClusters_hodoY1; //! +TBranch *b_nFibres_hodoY1; //! +TBranch *b_pos_hodoY1; //! +TBranch *b_pos_corr_hodoY1; //! +TBranch *b_nClusters_hodoX2; //! +TBranch *b_nFibres_hodoX2; //! +TBranch *b_pos_hodoX2; //! +TBranch *b_pos_corr_hodoX2; //! +TBranch *b_nClusters_hodoY2; //! +TBranch *b_nFibres_hodoY2; //! +TBranch *b_pos_hodoY2; //! +TBranch *b_pos_corr_hodoY2; //! +TBranch *b_nClusters_hodoSmallX; //! +TBranch *b_nFibres_hodoSmallX; //! +TBranch *b_pos_hodoSmallX; //! +TBranch *b_pos_corr_hodoSmallX; //! +TBranch *b_nClusters_hodoSmallY; //! +TBranch *b_nFibres_hodoSmallY; //! +TBranch *b_pos_hodoSmallY; //! +TBranch *b_pos_corr_hodoSmallY; //! + +TBranch *b_nTDCHits; //! +TBranch *b_pos_2FibClust_hodoX1; //! +TBranch *b_pos_2FibClust_corr_hodoX1; //! +TBranch *b_pos_2FibClust_hodoY1; //! +TBranch *b_pos_2FibClust_corr_hodoY1; //! +TBranch *b_pos_2FibClust_hodoX2; //! +TBranch *b_pos_2FibClust_corr_hodoX2; //! +TBranch *b_pos_2FibClust_hodoY2; //! +TBranch *b_pos_2FibClust_corr_hodoY2; //! +TBranch *b_cluster_pos_hodoX1; //! +TBranch *b_cluster_pos_corr_hodoX1; //! +TBranch *b_cluster_pos_hodoX2; //! +TBranch *b_cluster_pos_corr_hodoX2; //! +TBranch *b_cluster_pos_hodoY1; //! +TBranch *b_cluster_pos_corr_hodoY1; //! +TBranch *b_cluster_pos_hodoY2; //! +TBranch *b_cluster_pos_corr_hodoY2; //! +TBranch *b_wc_x; //! +TBranch *b_wc_y; //! +TBranch *b_wc_x_corr; //! +TBranch *b_wc_y_corr; //! + +void init() +{ +} + +void SetOutTree(TTree* outTree) +{ + //---standard analysis branches + outTree->Branch("event",&event,"event/I"); + outTree->Branch("time_CF",&time_CF,"time_CF[8]/F"); + outTree->Branch("time_CF_corr",&time_CF_corr,"time_CF_corr[8]/F"); + outTree->Branch("time_CF30",&time_CF30,"time_CF30[8]/F"); + outTree->Branch("time_OT",&time_OT,"time_OT[8]/F"); + outTree->Branch("time_start",&time_start,"time_start[8]/F"); + outTree->Branch("time_stop",&time_stop,"time_stop[8]/F"); + outTree->Branch("time_start_1000",&time_start_1000,"time_start_1000[8]/F"); + outTree->Branch("time_stop_1000",&time_stop_1000,"time_stop_1000[8]/F"); + outTree->Branch("time_start_150",&time_start_150,"time_start_150[8]/F"); + outTree->Branch("time_stop_150",&time_stop_150,"time_stop_150[8]/F"); + outTree->Branch("time_start_200",&time_start_200,"time_start_200[8]/F"); + outTree->Branch("time_stop_200",&time_stop_200,"time_stop_200[8]/F"); + outTree->Branch("time_start_500",&time_start_500,"time_start_500[8]/F"); + outTree->Branch("time_stop_500",&time_stop_500,"time_stop_500[8]/F"); + outTree->Branch("time_start_300",&time_start_300,"time_start_300[8]/F"); + outTree->Branch("time_stop_300",&time_stop_300,"time_stop_300[8]/F"); + outTree->Branch("time_Max",&time_Max,"time_Max[8]/F"); + outTree->Branch("amp_max",&_max,"amp_max[8]/F"); + outTree->Branch("amp_max_corr",&_max_corr,"amp_max_corr[8]/F"); + outTree->Branch("amp_max_time",&_max_time,"amp_max_time[8]/F"); + outTree->Branch("charge",&charge,"charge[8]/F"); + outTree->Branch("charge_corr",&charge_corr,"charge_corr[8]/F"); + outTree->Branch("baseline",&baseline,"baseline[8]/F"); + + //---global branches + outTree->Branch("sci_front_adc",&sci_front_adc,"sci_front_adc/I"); + outTree->Branch("bgo_back_adc",&bgo_back_adc,"bgo_back_adc/I"); + outTree->Branch("run_id",&run_id,"run_id/I"); + + //---additional branches + outTree->Branch("isPCOn",&isPCOn,"isPCOn[8]/I"); + outTree->Branch("HV",&HV,"HV[8]/I"); + outTree->Branch("HV2",&HV2,"HV2[8]/I"); + outTree->Branch("isTrigger",&isTrigger,"isTrigger[8]/I"); + outTree->Branch("X0",&X0,"X0/F"); + + // hodo + outTree->Branch( "nClusters_hodoX1", &nClusters_hodoX1, "nClusters_hodoX1/I" ); + outTree->Branch( "nFibres_hodoX1", nFibres_hodoX1, "nFibres_hodoX1[nClusters_hodoX1]/I" ); + outTree->Branch( "pos_hodoX1", pos_hodoX1, "pos_hodoX1[nClusters_hodoX1]/F" ); + outTree->Branch( "pos_corr_hodoX1", pos_corr_hodoX1, "pos_corr_hodoX1[nClusters_hodoX1]/F" ); + + outTree->Branch( "nClusters_hodoY1", &nClusters_hodoY1, "nClusters_hodoY1/I" ); + outTree->Branch( "nFibres_hodoY1", nFibres_hodoY1, "nFibres_hodoY1[nClusters_hodoY1]/I" ); + outTree->Branch( "pos_hodoY1", pos_hodoY1, "pos_hodoY1[nClusters_hodoY1]/F" ); + outTree->Branch( "pos_corr_hodoY1", pos_corr_hodoY1, "pos_corr_hodoY1[nClusters_hodoY1]/F" ); + + outTree->Branch( "nClusters_hodoX2", &nClusters_hodoX2, "nClusters_hodoX2/I" ); + outTree->Branch( "nFibres_hodoX2", nFibres_hodoX2, "nFibres_hodoX2[nClusters_hodoX2]/I" ); + outTree->Branch( "pos_hodoX2", pos_hodoX2, "pos_hodoX2[nClusters_hodoX2]/F" ); + outTree->Branch( "pos_corr_hodoX2", pos_corr_hodoX2, "pos_corr_hodoX2[nClusters_hodoX2]/F" ); + + outTree->Branch( "nClusters_hodoY2", &nClusters_hodoY2, "nClusters_hodoY2/I" ); + outTree->Branch( "nFibres_hodoY2", nFibres_hodoY2, "nFibres_hodoY2[nClusters_hodoY2]/I" ); + outTree->Branch( "pos_hodoY2", pos_hodoY2, "pos_hodoY2[nClusters_hodoY2]/F" ); + outTree->Branch( "pos_corr_hodoY2", pos_corr_hodoY2, "pos_corr_hodoY2[nClusters_hodoY2]/F" ); + + outTree->Branch( "nClusters_hodoSmallX", &nClusters_hodoSmallX, "nClusters_hodoSmallX/I" ); + outTree->Branch( "nFibres_hodoSmallX", nFibres_hodoSmallX, "nFibres_hodoSmallX[nClusters_hodoSmallX]/I" ); + outTree->Branch( "pos_hodoSmallX", pos_hodoSmallX, "pos_hodoSmallX[nClusters_hodoSmallX]/F" ); + outTree->Branch( "pos_corr_hodoSmallX", pos_corr_hodoSmallX, "pos_corr_hodoSmallX[nClusters_hodoSmallX]/F" ); + + outTree->Branch( "nClusters_hodoSmallY", &nClusters_hodoSmallY, "nClusters_hodoSmallY/I" ); + outTree->Branch( "nFibres_hodoSmallY", nFibres_hodoSmallY, "nFibres_hodoSmallY[nClusters_hodoSmallY]/I" ); + outTree->Branch( "pos_hodoSmallY", pos_hodoSmallY, "pos_hodoSmallY[nClusters_hodoSmallY]/F" ); + outTree->Branch( "pos_corr_hodoSmallY", pos_corr_hodoSmallY, "pos_corr_hodoSmallY[nClusters_hodoSmallY]/F" ); + + outTree->Branch( "nTDCHits", &nTDCHits, "nTDCHits[4]/I" ); + outTree->Branch( "pos_2FibClust_hodoX1", &pos_2FibClust_hodoX1, "pos_2FibClust_hodoX1/F" ); + outTree->Branch( "pos_2FibClust_corr_hodoX1", &pos_2FibClust_corr_hodoX1, "pos_2FibClust_corr_hodoX1/F" ); + + outTree->Branch( "pos_2FibClust_hodoY1", &pos_2FibClust_hodoY1, "pos_2FibClust_hodoY1/F" ); + outTree->Branch( "pos_2FibClust_corr_hodoY1", &pos_2FibClust_corr_hodoY1, "pos_2FibClust_corr_hodoY1/F" ); + outTree->Branch( "pos_2FibClust_hodoX2", &pos_2FibClust_hodoX2, "pos_2FibClust_hodoX2/F" ); + outTree->Branch( "pos_2FibClust_corr_hodoX2", &pos_2FibClust_corr_hodoX2, "pos_2FibClust_corr_hodoX2/F" ); + + outTree->Branch( "pos_2FibClust_hodoY2", &pos_2FibClust_hodoY2, "pos_2FibClust_hodoY2/F" ); + outTree->Branch( "pos_2FibClust_corr_hodoY2", &pos_2FibClust_corr_hodoY2, "pos_2FibClust_corr_hodoY2/F" ); + outTree->Branch( "cluster_pos_hodoX1", &cluster_pos_hodoX1, "cluster_pos_hodoX1/F" ); + outTree->Branch( "cluster_pos_corr_hodoX1", &cluster_pos_corr_hodoX1, "cluster_pos_corr_hodoX1/F" ); + outTree->Branch( "cluster_pos_hodoX2", &cluster_pos_hodoX2, "cluster_pos_hodoX2/F" ); + outTree->Branch( "cluster_pos_corr_hodoX2", &cluster_pos_corr_hodoX2, "cluster_pos_corr_hodoX2/F" ); + + outTree->Branch( "cluster_pos_hodoY1", &cluster_pos_hodoY1, "cluster_pos_hodoY1/F" ); + outTree->Branch( "cluster_pos_corr_hodoY1", &cluster_pos_corr_hodoY1, "cluster_pos_corr_hodoY1/F" ); + outTree->Branch( "cluster_pos_hodoY2", &cluster_pos_hodoY2, "cluster_pos_hodoY2/F" ); + outTree->Branch( "cluster_pos_corr_hodoY2", &cluster_pos_corr_hodoY2, "cluster_pos_corr_hodoY2/F" ); + + + outTree->Branch( "wc_x", &wc_x, "wc_x/F"); + outTree->Branch( "wc_y", &wc_y, "wc_y/F"); + outTree->Branch( "wc_x_corr", &wc_x_corr, "wc_x_corr/F"); + outTree->Branch( "wc_y_corr", &wc_y_corr, "wc_y_corr/F"); + +} + + +void InitRecoTree(TTree* nt) +{ + nt->SetBranchAddress("event", &event, &b_event); + nt->SetBranchAddress("time_CF", &time_CF, &b_time_CF); + nt->SetBranchAddress("time_CF_corr", &time_CF_corr, &b_time_CF_corr); + nt->SetBranchAddress("time_CF30", &time_CF30, &b_time_CF30); + nt->SetBranchAddress("time_OT", &time_OT, &b_time_OT); + nt->SetBranchAddress("time_start", &time_start, &b_time_start); + nt->SetBranchAddress("time_stop", &time_stop, &b_time_stop); + nt->SetBranchAddress("time_start_1000", &time_start_1000, &b_time_start_1000); + nt->SetBranchAddress("time_stop_1000", &time_stop_1000, &b_time_stop_1000); + nt->SetBranchAddress("time_start_150", &time_start_150, &b_time_start_150); + nt->SetBranchAddress("time_stop_150", &time_stop_150, &b_time_stop_150); + nt->SetBranchAddress("time_start_200", &time_start_200, &b_time_start_200); + nt->SetBranchAddress("time_stop_200", &time_stop_200, &b_time_stop_200); + nt->SetBranchAddress("time_start_500", &time_start_500, &b_time_start_500); + nt->SetBranchAddress("time_stop_500", &time_stop_500, &b_time_stop_500); + nt->SetBranchAddress("time_start_300", &time_start_300, &b_time_start_300); + nt->SetBranchAddress("time_stop_300", &time_stop_300, &b_time_stop_300); + nt->SetBranchAddress("time_Max", &time_Max, &b_time_Max); + nt->SetBranchAddress("amp_max", &_max, &b_amp_max); + nt->SetBranchAddress("amp_max_corr", &_max_corr, &b_amp_max_corr); + nt->SetBranchAddress("amp_max_time", &_max_time, &b_amp_max_time); + nt->SetBranchAddress("charge", &charge, &b_charge); + nt->SetBranchAddress("charge_corr", &charge_corr, &b_charge_corr); + nt->SetBranchAddress("baseline", &baseline, &b_baseline); + nt->SetBranchAddress("run_id", &run_id, &b_run_id); + nt->SetBranchAddress("isPCOn", &isPCOn, &b_isPCOn); + nt->SetBranchAddress("HV", &HV, &b_HV); + nt->SetBranchAddress("HV2", &HV2, &b_HV2); + nt->SetBranchAddress("isTrigger", &isTrigger, &b_isTrigger); + nt->SetBranchAddress("X0", &X0, &b_X0); + nt->SetBranchAddress("sci_front_adc", &sci_front_adc, &b_sci_front_adc); + nt->SetBranchAddress("bgo_back_adc", &bgo_back_adc, &b_bgo_back_adc); + + nt->SetBranchAddress("nClusters_hodoX1", &nClusters_hodoX1, &b_nClusters_hodoX1); + nt->SetBranchAddress("nFibres_hodoX1", nFibres_hodoX1, &b_nFibres_hodoX1); + nt->SetBranchAddress("pos_hodoX1", pos_hodoX1, &b_pos_hodoX1); + nt->SetBranchAddress("pos_corr_hodoX1", pos_corr_hodoX1, &b_pos_corr_hodoX1); + nt->SetBranchAddress("nClusters_hodoY1", &nClusters_hodoY1, &b_nClusters_hodoY1); + nt->SetBranchAddress("nFibres_hodoY1", nFibres_hodoY1, &b_nFibres_hodoY1); + nt->SetBranchAddress("pos_hodoY1", pos_hodoY1, &b_pos_hodoY1); + nt->SetBranchAddress("pos_corr_hodoY1", pos_corr_hodoY1, &b_pos_corr_hodoY1); + nt->SetBranchAddress("nClusters_hodoX2", &nClusters_hodoX2, &b_nClusters_hodoX2); + nt->SetBranchAddress("nFibres_hodoX2", nFibres_hodoX2, &b_nFibres_hodoX2); + nt->SetBranchAddress("pos_hodoX2", pos_hodoX2, &b_pos_hodoX2); + nt->SetBranchAddress("pos_corr_hodoX2", pos_corr_hodoX2, &b_pos_corr_hodoX2); + nt->SetBranchAddress("nClusters_hodoY2", &nClusters_hodoY2, &b_nClusters_hodoY2); + nt->SetBranchAddress("nFibres_hodoY2", nFibres_hodoY2, &b_nFibres_hodoY2); + nt->SetBranchAddress("pos_hodoY2", pos_hodoY2, &b_pos_hodoY2); + nt->SetBranchAddress("pos_corr_hodoY2", pos_corr_hodoY2, &b_pos_corr_hodoY2); + nt->SetBranchAddress("nClusters_hodoSmallX", &nClusters_hodoSmallX, &b_nClusters_hodoSmallX); + nt->SetBranchAddress("nFibres_hodoSmallX", nFibres_hodoSmallX, &b_nFibres_hodoSmallX); + nt->SetBranchAddress("pos_hodoSmallX", pos_hodoSmallX, &b_pos_hodoSmallX); + nt->SetBranchAddress("pos_corr_hodoSmallX", pos_corr_hodoSmallX, &b_pos_corr_hodoSmallX); + nt->SetBranchAddress("nClusters_hodoSmallY", &nClusters_hodoSmallY, &b_nClusters_hodoSmallY); + nt->SetBranchAddress("nFibres_hodoSmallY", nFibres_hodoSmallY, &b_nFibres_hodoSmallY); + nt->SetBranchAddress("pos_hodoSmallY", pos_hodoSmallY, &b_pos_hodoSmallY); + nt->SetBranchAddress("pos_corr_hodoSmallY", pos_corr_hodoSmallY, &b_pos_corr_hodoSmallY); + + nt->SetBranchAddress("nTDCHits", &nTDCHits, &b_nTDCHits); + nt->SetBranchAddress("pos_2FibClust_hodoX1", &pos_2FibClust_hodoX1, &b_pos_2FibClust_hodoX1); + nt->SetBranchAddress("pos_2FibClust_corr_hodoX1", &pos_2FibClust_corr_hodoX1, &b_pos_2FibClust_corr_hodoX1); + nt->SetBranchAddress("pos_2FibClust_hodoY1", &pos_2FibClust_hodoY1, &b_pos_2FibClust_hodoY1); + nt->SetBranchAddress("pos_2FibClust_corr_hodoY1", &pos_2FibClust_corr_hodoY1, &b_pos_2FibClust_corr_hodoY1); + nt->SetBranchAddress("pos_2FibClust_hodoX2", &pos_2FibClust_hodoX2, &b_pos_2FibClust_hodoX2); + nt->SetBranchAddress("pos_2FibClust_corr_hodoX2", &pos_2FibClust_corr_hodoX2, &b_pos_2FibClust_corr_hodoX2); + nt->SetBranchAddress("pos_2FibClust_hodoY2", &pos_2FibClust_hodoY2, &b_pos_2FibClust_hodoY2); + nt->SetBranchAddress("pos_2FibClust_corr_hodoY2", &pos_2FibClust_corr_hodoY2, &b_pos_2FibClust_corr_hodoY2); + nt->SetBranchAddress("cluster_pos_hodoX1", &cluster_pos_hodoX1, &b_cluster_pos_hodoX1); + nt->SetBranchAddress("cluster_pos_corr_hodoX1", &cluster_pos_corr_hodoX1, &b_cluster_pos_corr_hodoX1); + nt->SetBranchAddress("cluster_pos_hodoX2", &cluster_pos_hodoX2, &b_cluster_pos_hodoX2); + nt->SetBranchAddress("cluster_pos_corr_hodoX2", &cluster_pos_corr_hodoX2, &b_cluster_pos_corr_hodoX2); + nt->SetBranchAddress("cluster_pos_hodoY1", &cluster_pos_hodoY1, &b_cluster_pos_hodoY1); + nt->SetBranchAddress("cluster_pos_corr_hodoY1", &cluster_pos_corr_hodoY1, &b_cluster_pos_corr_hodoY1); + nt->SetBranchAddress("cluster_pos_hodoY2", &cluster_pos_hodoY2, &b_cluster_pos_hodoY2); + nt->SetBranchAddress("cluster_pos_corr_hodoY2", &cluster_pos_corr_hodoY2, &b_cluster_pos_corr_hodoY2); + nt->SetBranchAddress("wc_x", &wc_x, &b_wc_x); + nt->SetBranchAddress("wc_y", &wc_y, &b_wc_y); + nt->SetBranchAddress("wc_x_corr", &wc_x_corr, &b_wc_x_corr); + nt->SetBranchAddress("wc_y_corr", &wc_y_corr, &b_wc_y_corr); + +} diff --git a/TB/src/init_tree_BTF.cc b/src/init_tree_BTF.cc similarity index 100% rename from TB/src/init_tree_BTF.cc rename to src/init_tree_BTF.cc diff --git a/TB/src/init_tree_H4.cc b/src/init_tree_H4.cc similarity index 78% rename from TB/src/init_tree_H4.cc rename to src/init_tree_H4.cc index db6a48d..24e43ed 100644 --- a/TB/src/init_tree_H4.cc +++ b/src/init_tree_H4.cc @@ -15,17 +15,18 @@ unsigned int nTdcChannels; unsigned int tdcBoard[10]; unsigned int tdcChannel[10]; unsigned int tdcData[10]; + +unsigned int nPatterns; +unsigned int pattern[16]; +unsigned int patternBoard[16]; +unsigned int patternChannel[16]; + unsigned int nDigiSamples; unsigned int digiGroup[100000]; unsigned int digiChannel[100000]; unsigned int digiSampleIndex[100000]; float digiSampleValue[100000]; -std::vector *TDCreco =0; -std::vector *HODOX1 = 0; -std::vector *HODOX2 = 0; -std::vector *HODOY1 = 0; -std::vector *HODOY2 = 0; unsigned int spillNumber; // List of branches @@ -43,22 +44,25 @@ TBranch *b_nTdcChannels; //! TBranch *b_tdcBoard; //! TBranch *b_tdcChannel; //! TBranch *b_tdcData; //! + +TBranch *b_nPatterns; +TBranch *b_pattern; +TBranch *b_patternBoard; +TBranch *b_patternChannel; + TBranch *b_nDigiSamples; //! TBranch *b_digiGroup; //! TBranch *b_digiChannel; //! TBranch *b_digiSampleIndex; //! TBranch *b_digiSampleValue; //! -TBranch *b_TDCreco; -TBranch *b_HODOX1; -TBranch *b_HODOX2; -TBranch *b_HODOY1; -TBranch *b_HODOY2; TBranch *b_spillNumber; void InitTree(TChain* nt) { + // std::cout << " InitTree normal " << std::endl; + nt->SetBranchAddress("evtNumber", &evtNumber, &b_evtNumber); nt->SetBranchAddress("evtTimeDist", &evtTimeDist, &b_evtTimeDist); nt->SetBranchAddress("evtTimeStart", &evtTimeStart, &b_evtTimeStart); @@ -69,27 +73,34 @@ void InitTree(TChain* nt) nt->SetBranchAddress("adcBoard", adcBoard, &b_adcBoard); nt->SetBranchAddress("adcChannel", adcChannel, &b_adcChannel); nt->SetBranchAddress("adcData", adcData, &b_adcData); + nt->SetBranchAddress("nTdcChannels", &nTdcChannels, &b_nTdcChannels); nt->SetBranchAddress("tdcBoard", tdcBoard, &b_tdcBoard); nt->SetBranchAddress("tdcChannel", tdcChannel, &b_tdcChannel); nt->SetBranchAddress("tdcData", tdcData, &b_tdcData); + + nt->SetBranchAddress("nPatterns", &nPatterns, &b_nPatterns); + nt->SetBranchAddress("pattern", pattern, &b_pattern); + nt->SetBranchAddress("patternBoard", &patternBoard, &b_patternBoard); + nt->SetBranchAddress("patternChannel", &patternChannel, &b_patternChannel); + nt->SetBranchAddress("nDigiSamples", &nDigiSamples, &b_nDigiSamples); nt->SetBranchAddress("digiGroup", digiGroup, &b_digiGroup); nt->SetBranchAddress("digiChannel", digiChannel, &b_digiChannel); nt->SetBranchAddress("digiSampleIndex", digiSampleIndex, &b_digiSampleIndex); nt->SetBranchAddress("digiSampleValue", digiSampleValue, &b_digiSampleValue); - nt->SetBranchAddress("spillNumber", &spillNumber, &b_spillNumber); - + nt->SetBranchAddress("spillNumber", &spillNumber, &b_spillNumber); } void InitTree2(TChain* nt2) { - nt2->SetBranchAddress("TDCreco", &TDCreco);//, &b_TDCreco); - nt2->SetBranchAddress("HODOX1", &HODOX1); - nt2->SetBranchAddress("HODOX2", &HODOX2); - nt2->SetBranchAddress("HODOY1", &HODOY1); - nt2->SetBranchAddress("HODOY2", &HODOY2); + // std::cout << " InitTree2 " << std::endl; +// nt2->SetBranchAddress("TDCreco", &TDCreco);//, &b_TDCreco); +// nt2->SetBranchAddress("HODOX1", &HODOX1); +// nt2->SetBranchAddress("HODOX2", &HODOX2); +// nt2->SetBranchAddress("HODOY1", &HODOY1); +// nt2->SetBranchAddress("HODOY2", &HODOY2); nt2->SetBranchAddress("spillNumber", &spillNumber, &b_spillNumber); nt2->SetBranchAddress("evtNumber", &evtNumber, &b_evtNumber); diff --git a/TB/thisroot.csh b/thisroot.csh similarity index 100% rename from TB/thisroot.csh rename to thisroot.csh diff --git a/TB/thisroot.sh b/thisroot.sh similarity index 100% rename from TB/thisroot.sh rename to thisroot.sh