/* * BeAnalysis.h * * Created on: Jul 19, 2017 * Author: vratik */ #ifndef BE_BEANALYSIS_H_ #define BE_BEANALYSIS_H_ #include //#include #include "TChain.h" #include "TCut.h" #include "TCanvas.h" #define NOINTERVALS 5; using std::cout; using std::endl; class BeAnalysis { public: BeAnalysis(); virtual ~BeAnalysis(); ClassDef(BeAnalysis, 1); void SetExpChain(TString files, Int_t minFnumber, Int_t maxFnumber); void SetSimChains(TString chainAl0name, TString chainNoAl0name, TString chainAl180name, TString chainNoAl180name, TString chainAl90name, TString chainNoAl90name); void SetInputChains(TString inputAl0name, TString inputNoAl0name, TString inputAl180name, TString inputNoAl180name, TString inputAl90name, TString inputNoAl90name); void SetNoSimFiles(Int_t *minFnumber = 0, Int_t *maxFnumber = 0); void OpenSimChains(); void OpenExpChain(); void SetNoBinsSpectra(Int_t noBins = 100) {noBinsSpectra = noBins;}; void SetSpectraRange(Double_t minEnergy = 0., Double_t maxEnergy = 10.) {minSpectraEnergy = minEnergy; maxSpectraEnergy = maxEnergy;}; void SetNoBinsCorrelations(Int_t noBins = 30) {noBinsCorr = noBins;}; void SetNoBinsThetaA(Int_t noBins = 30) {noBinsThetaA = noBins;}; TChain* GetExpChain() {return che;}; TChain* GetSimChain(Int_t i) {return chs[i];}; void SetChainsToDraw(Bool_t ch0 = 1, Bool_t ch1 = 1, Bool_t ch2 = 1, Bool_t ch3 = 1, Bool_t ch4 = 1, Bool_t ch5 = 1); void SetSimCuts(TString sEt[5]/*, TString sET0 = "", TString sET1 = "", TString sET2 = "", TString sET3 = "", TString sET4 = ""*/); void SetInputCuts(TString iEt[5]/*, TString sET0 = "", TString sET1 = "", TString sET2 = "", TString sET3 = "", TString sET4 = ""*/); void SetCMAngularRange(Int_t minAngle, Int_t maxAngle); void SetRangeProportion(Float_t rangeProportion = 1.1, Bool_t autoRange = 1); void SetNoExpEvents(Long64_t *noExpEvents = 0); void SetNoSimEvents(Long64_t *noSimEvents = 0); void SetRatiosGStoEX(TString sRatioAl0, TString sRatioNoAl0, TString sRatioAl180, TString sRatioNoAl180, TString sRatioAl90, TString sRatioNoAl90); void ExpEventsECuts(Long64_t noExpEvents[5][6] = 0); void SimEventsECuts(Long64_t noSimEvents[5][6] = 0); void EpsilonTRange(); void SetSpectra(Bool_t kSpectra = 1) {spectra = kSpectra;}; void SetEpsilonTintervals(Bool_t intervals[6] = 0); void SetCosThetaTkIntervals(Bool_t intervals[6] = 0); void SetEpsilonYintervals(Bool_t intervals[6] = 0); void SetCosThetaYkIntervals(Bool_t intervals[6] = 0); void SetThetaATintervals(Bool_t intervals[6] = 0); void Spectra(); void EpsilonT(); void CosThetaTk(); void EpsilonY(); void CosThetaYk(); void ThetaAT(); void SetFigures(TString figPath = "figures/", TString figFormat = ".eps", Bool_t kSave = 1); void SaveSpectrumHist(Int_t chain, TString outfilename = "figures/spectra.root"); void SaveEpsilonTHist(Int_t interval, Int_t chain, TString outfilename = "figures/epsilonT.root"); void SaveCosThetaTHist(Int_t interval, Int_t chain); void SaveEpsilonYHist(Int_t interval, Int_t chain); void SaveThetaAHist(Int_t interval, Int_t chain); // private: TChain *che; //chain with experimental trees TChain *chs[6]; //array of chains with simulation trees TTree *ti[6]; //array of chains with simulation input private: Int_t lowExpFile; Int_t upExpFile; TString expFiles; TString simFiles[6]; TString inputFiles[6]; Int_t lowSimFile[6]; Int_t upSimFile[6]; Int_t noBinsSpectra; Double_t minSpectraEnergy; Double_t maxSpectraEnergy; Int_t noBinsCorr; Int_t noBinsThetaA; Int_t kMinAngle; Int_t kMaxAngle; //histograms TH1F *hsSpectra[6]; TH1F *heSpectra[6]; TH1F *hSdiff[6]; TH1F *hseT[5][6]; TH1F *heeT[5][6]; TH1F *hieT[5][6]; TH1F *hscoskT[5][6]; TH1F *hecoskT[5][6]; TH1F *hicoskT[5][6]; TH1F *hseY[5][6]; TH1F *heeY[5][6]; TH1F *hieY[5][6]; TH1F *hsthetaAT[5][6]; TH1F *hethetaAT[5][6]; TH1F *hithetaAT[5][6]; //cuts TCut cAngles; TCut crAngles; Bool_t kChains[6]; Int_t noIntervals; Bool_t *epsilonT; //! Bool_t *cosThetaT; //! Bool_t *epsilonY; //! Bool_t *cosThetaY; //! Bool_t *thetaAT; //! Bool_t kAutoRange; Float_t kRangeProportion; Bool_t kVerbose; Float_t kRangeProportionIn; Long64_t eMaxEvents; Long64_t eEvents[6]; Long64_t sMaxEvents; Long64_t sEvents[6]; TCut sRatio[6]; Long64_t eEventsECuts[5][6]; //! Long64_t sEventsECuts[5][6]; //! Double_t eTRange[5][6]; //! //cuts TCut cBeWork; TCut cBeE[5]; TCut cEpsilonT; TCut cEpsilonY; //raw files //energy cuts TCut crBeWork; TCut crBeE[5]; //angular cuts TCut crEpsilonT; TCut crEpsilonY; //simulation input TCut ciBeE[5]; TCut ciEpsilon; // TCut ciEpsilonY; TCut cQ; TCut cProtons; Bool_t spectra; //auxiliary strings TString drawCommand; TString hsName; TString heName; TString hiName; TString canvasName; TString canvasTitle; Bool_t kSaveFigures; TString figurePath; TString figureFormat; private: void InitHistos(); void SaveFigures(TCanvas *canvas, TString variable, Int_t interval); void CanvasDivision(TCanvas *c); void SetCuts(); void SetCMAngularCuts(); }; #endif /* BE_BEANALYSIS_H_ */