#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; }