AculCalibScint.h 1.91 KB
Newer Older
1 2 3 4 5 6
#pragma once

//#include "TObject.h"
//#include "TROOT.h"
#include <iostream>
#include <fstream>
7
//#include <vector>
8 9 10

#include "TFile.h"
#include "TTree.h"
11 12 13
//#include "TCanvas.h"
#include "TH1I.h"
#include "TGraphErrors.h"
14
//#include "TArrayD.h"
15
#include "TF1.h"
16 17 18 19 20

#include "./AculCalib.h"

using std::cout;
using std::endl;
21
//using std::vector;
22 23 24 25 26 27 28 29 30 31

class AculCalibScint : public AculCalib {

private:
//
	//todo delete this strange double array somewhere
	TFile **fInFiles;
	TTree **fTrees;

	TFile *fCutFile;
32

33 34
	vector< vector<TH1I*> > fHistFull;
	vector< vector<TH1I*> > fHistCut;
35
//
36 37
	vector< vector<Double_t> > fMeanPeakPos;
	vector< vector<Double_t> > fMeanPeakRMS;
38
//
39 40
	//todo make vector of graphs
	TGraphErrors *gCal[16];
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
//	TFile *fGraphs;

public:
//	AculCalibScint() : a(0), b(0), c(0), p(0){};
	AculCalibScint();
	AculCalibScint(const char* parfile);
	virtual ~AculCalibScint();
	// Define the class for the cint dictionary
	ClassDef (AculCalibScint,1);

	virtual void Init();

//	void SetParFile(const char* parfile);

	void PrintTrees();
//	void PrintParameters(const char* option = "");
//	void PrintPeakRanges();

59 60 61
	void DrawVariable(const char* variable, Int_t treeID, TCanvas *canvas, Int_t lowRange = 0, Int_t upRange = 4096);
	void DrawBeam(TCanvas *canvas, Int_t file, const char* variable);

62
	void GetPeakMean(const char* variable, Int_t treeID, /*Int_t energy,*/ TCanvas *canvas, const char* beamcut, const Int_t nbins = 4096, Int_t lowRange = 0);
63 64 65 66 67
	void Calibrate(TCanvas *canvas, Bool_t savefile = 0, const char* filename = "", const char* option = "READ");

	void WriteClbParameters(const char* filename);

	TTree* GetTree(Int_t treeID);
68 69 70 71 72 73 74

//private functions:
//	void LoadCuts();

private:
	void OpenFiles();
	void LoadTrees();
75 76 77 78 79

	void SaveClbGraphs(const char* filename, const char* option = "READ");
	void FillGraph(TGraphErrors *g, Int_t npoints, /*Double_t *energies,*/ Int_t graphNumber, const char* option = "");


80 81
//	void SetPars();
};