BeAnalysis.h 4.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * BeAnalysis.h
 *
 *  Created on: Jul 19, 2017
 *      Author: vratik
 */

#ifndef BE_BEANALYSIS_H_
#define BE_BEANALYSIS_H_

#include <iostream>

//#include <TObject.h>
#include "TChain.h"
15
#include "TCut.h"
16
#include "TCanvas.h"
17 18 19 20 21 22 23 24 25 26

using std::cout;
using std::endl;

class BeAnalysis {
public:
	BeAnalysis();
	virtual ~BeAnalysis();
	ClassDef(BeAnalysis, 1);

27 28 29 30 31 32 33 34
	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);
35 36 37 38 39 40

	void OpenSimChains();
	void OpenExpChain();

	TChain* GetExpChain() {return che;};
	TChain* GetSimChain(Int_t i) {return chs[i];};
41 42 43 44 45
	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 SetCuts();

	void SetCMAngularRange(Int_t minAngle, Int_t maxAngle);
46
private:
47
	void SetCMAngularCuts();
48
public:
49 50
	void SetRangeProportion(Float_t rangeProportion = 1.1, Bool_t autoRange = 1);

51 52
	void SetNoExpEvents(Long64_t *noExpEvents = 0);
	void SetNoSimEvents(Long64_t *noSimEvents = 0);
53
	void SetRatiosGStoEX();
54 55 56
	void ExpEventsECuts();
	void SimEventsECuts();
	void EpsilonTRange();
57 58

	void Spectra();
59
	void EpsilonT();
60 61 62 63 64
	void CosThetaTk();
	void EpsilonY();
	void CosThetaYk();
	void ThetaAT();

65 66 67
	void SetFigures(TString figPath = "figures/", TString figFormat = ".eps", Bool_t kSave = 1);


68 69 70 71 72
//
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
73

74 75 76 77 78 79 80 81
	Int_t lowExpFile;
	Int_t upExpFile;
	TString expFiles;
	TString simFiles[6];
	TString inputFiles[6];
	Int_t lowSimFile[6];
	Int_t upSimFile[6];

82 83 84 85 86 87 88
	Int_t kMinAngle;
	Int_t kMaxAngle;

	TCut cAngles;
	TCut crAngles;

	Bool_t kChains[6];
89 90
	Int_t noIntervals;
	Bool_t *epsilonT;	//!
91 92
	Bool_t *cosThetaT;	//!
	Bool_t *epsilonY;	//!
93
	Bool_t *cosThetaY;	//!
94

95 96
	Bool_t *thetaAT;	//!

97 98
	Bool_t kAutoRange;
	Float_t kRangeProportion;
99 100
	Bool_t kVerbose;
	Float_t kRangeProportionIn;
101 102

	Long64_t eMaxEvents;
103 104 105 106 107 108
//	Long64_t eEventsAl0;
//	Long64_t eEventsNoAl0;
//	Long64_t eEventsAl180;
//	Long64_t eEventsNoAl180;
//	Long64_t eEventsAl90;
//	Long64_t eEventsNoAl90;
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
	Long64_t eEvents[6];

	Long64_t sMaxEvents;
	Long64_t sEventsAl0;
	Long64_t sEventsNoAl0;
	Long64_t sEventsAl180;
	Long64_t sEventsNoAl180;
	Long64_t sEventsAl90;
	Long64_t sEventsNoAl90;
	Long64_t sEvents[6];

	TCut sRatioAl0;
	TCut sRatioNoAl0;
	TCut sRatioAl180;
	TCut sRatioNoAl180;
	TCut sRatioAl90;
	TCut sRatioNoAl90;
	TCut sRatio[6];

128 129 130 131
	Long64_t eEventsECuts[5][6];
	Long64_t sEventsECuts[5][6];
	Double_t eTRange[5][6];

132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
	//cuts
	TCut cBe20;
	TCut cBe3;
	TCut cBeWork;
	TCut cBe0_14;
	//	TCut cBe0_14 = "fBeIM>0 && fBeIM<1.6";
	//	TCut cBe0_14 = "fBeIM>0 && fBeIM<1.20";
	TCut cBe14_19;
	TCut cBe19_25;
	TCut cBe25_31;
	TCut cBe31_37;
	TCut cBeE[5];

	TCut cEpsilonT;
	//	TCut cEpsilonT = "fTpp/fBeIM<1.";
	//	TCut cEpsilonY = "fTap/fBeIM<0.5";
	TCut cEpsilonY;

	//raw files
	//energy cuts
	TCut crBe20;
	TCut crBe3;
	TCut crBeWork;
	TCut crBe0_14;
	//	TCut crBe0_14 = "f6BeIM>0 && f6BeIM<1.6";
	//	TCut crBe0_14 = "f6BeIM>0.5 && f6BeIM<1.20";
	TCut crBe14_19;
	TCut crBe19_25;
	TCut crBe25_31;
	TCut crBe31_37;
	TCut crBeE[5];
	//angular cuts


	//	TCut crEpsilonT = "fTpp/f6BeIM>0.8";
	TCut crEpsilonT;
	//	TCut crEpsilonT = "fTpp/f6BeIM<1.";
	//	TCut crEpsilonY = "fTap/f6BeIM<0.5";
	TCut crEpsilonY;

	//simulation input
	TCut ciBe0_14;
	//	TCut ciBe0_14 = "E_IM>0 && E_IM<1.6";
	//	TCut ciBe0_14 = "E_IM>0.5 && E_IM<1.20";
	TCut ciBe14_19;
	TCut ciBe19_25;
	TCut ciBe25_31;
	TCut ciBe31_37;
	TCut ciBeE[5];

	TCut ciEpsilon;
	//	TCut ciEpsilon = "sTpp/E_IM<1.";
	//	TCut ciEpsilonY = "sTap/E_IM<0.5";
	TCut ciEpsilonY;

	TCut cQ;
	TCut cProtons;
	//	TCut cProtons = "fP1Lab.fE-938.272<34 && fP2Lab.fE-938.272<34 && fP1Lab.fE-938.272>1 && fP2Lab.fE-938.272>1";

	Bool_t spectra;

	//auxiliary strings
	TString drawCommand;
	TString hsName;
	TString heName;
197
	TString hiName;
198 199

	TString canvasName;
200
	TString canvasTitle;
201

202 203 204 205 206 207 208
	Bool_t kSaveFigures;
	TString figurePath;
	TString figureFormat;

private:
	void SaveFigures(TCanvas *canvas, TString variable, Int_t interval);

209 210 211
};

#endif /* BE_BEANALYSIS_H_ */