makeCutsHelium.cxx 2.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
#include "TSystem.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TCanvas.h"
#include "TBox.h"
#include "TCut.h"
#include "TCutG.h"

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

void makeCutsHelium(const Long64_t drawEntries = 10000000) {

//	TFile *fr = new TFile("~/data/exp1804/h5_11_00.root");
	TChain *tr = new TChain("AnalysisxTree");
	tr->Add("~/data/exp1804/h5_14_0?.root");
	tr->Add("~/data/exp1804/be10_0?_?0.root");


	TChain *trCal = new TChain("cal");
//	trCal->Add("~/data/exp1804/h5_11_0?_calib.root");
	trCal->Add("~/data/exp1804/h5_14_0?_calib.root");
	trCal->Add("~/data/exp1804/be10_0?_?0_calib.root");

	tr->AddFriend(trCal);

	TFile *fcal = new TFile("~/data/exp1804/calib/si_20_03_calib.root");
	TTree *tAlphaCal = (TTree*)fcal->Get("cal");
	tAlphaCal->SetMarkerColor(kRed);
	tAlphaCal->SetMarkerStyle(20);
	tAlphaCal->SetMarkerSize(.6);

	TFile *fc = new TFile("cutsIdentification.root", "READ");
	TCutG *cUS = (TCutG*)fc->Get("c7UpperShadow");
	TCutG *cLS = (TCutG*)fc->Get("c7LowerShadow");
	cLS->SetLineColor(kMagenta);
	TCutG *cMA = (TCutG*)fc->Get("c7MainAlpha");
	TCutG *cA = (TCutG*)fc->Get("c7All");
	TCutG *cBL = (TCutG*)fc->Get("cBeamLeft");
	TCutG *cBR = (TCutG*)fc->Get("cBeamRight");


//	const Int_t drawEntries = 6000000;
//	const Int_t drawEntries = tr->GetEntries();

	tr->GetListOfFiles()->Print();
	trCal->GetListOfFiles()->Print();

	cout << tr->GetEntries() << " events." << endl;
	cout << trCal->GetEntries() << " calibrated events." << endl;

	TString varName;
	TString condition;

	cout << drawEntries << " entries in input chain will be processed." << endl;

//	const Int_t firstThinStrip = 5;

	TString canName;
	TString canTitle;

	/////////////////////////////////////////////////////////////////////
	//	c4


	TCanvas *c4[16];

	for (Int_t i = 4; i < 14; i++) {
		canName.Form("c4_%d", i);
		canTitle.Form("PID plot from left telescope: %d", i);
		c4[i] = new TCanvas(canName, canTitle, 1000, 900);
		c4[i]->cd();

				//		varName.Form("SQ20E[%d]:SQLYEsum", i);
		varName.Form("SQ20E[%d]:SQ20E[%d]+SQLYEsum", i, i);
		condition.Form("SQ20E[%d]>1.2 && SQ20E[%d]<5 "
				"&& SQLYEsum>1.1 && SQLYEsum<30 "
				"&& SQLYE[0]<1. && SQLYE[15]<1."
				"&& SQLYmult==1 && SQLXmult==1"
				"&& trigger==3",
				i, i);
		tr->SetMarkerColor(kBlack);
		tr->Draw(varName, condition, "col", drawEntries);
		//		tr->Draw(varName, condition, "", drawEntries);

//		tAlphaCal->Draw(varName, "", "same");

		c4[i]->Update();
	}//for */



	return;





}