#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 makeCutsTritium(const Long64_t drawEntries = 5000000) { // const Long64_t drawEntries = 100000; // 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; TString timeSiCondition; timeSiCondition.Form("0.3*tSQX_R[0]-0.125*tF5[0]<100"); // TString auxCon; for (Int_t j = 1; j<32; j++) { condition.Form(" && 0.3*tSQX_R[%d]-0.125*tF5[0]<100", j); timeSiCondition.Append(condition); } cout << timeSiCondition << endl; ///////////////////////////////////////////////////////////////////// // c3 /*TCanvas *c3[16]; // c3->Divide(4,4); for (Int_t i = 0; i < 16; i++) { canName.Form("c3_%d", i); canTitle.Form("time from CsI: %d", i); c3[i] = new TCanvas(canName, canTitle, 1000, 900); c3[i]->cd(); varName.Form("CsI_R[%d]:0.125*tCsI_R[%d]-0.125*tF5[0]", i, i); condition.Form("CsI_R[%d]>250 && trigger==3" "&& 0.125*tCsI_R[%d]-0.125*tF5[0] > -80" "&& 0.125*tCsI_R[%d]-0.125*tF5[0] < 0" "&& CsI_R[%d] < 4500", i, i, i, i); tr->SetMarkerColor(kBlack); tr->SetMarkerStyle(20); tr->SetMarkerSize(.4); tr->Draw(varName, condition, "", drawEntries); c3[i]->Update(); }//*/ // return; ///////////////////////////////////////////////////////////////////// // c4 TCanvas *c4[16]; TFile *fCutsTime = new TFile("cutsTimeCsI.root"); TCutG *currCut; TString cutName; for (Int_t i = 4; i < 16; i++) { canName.Form("c4_%d", i); canTitle.Form("PID plot from CsI filtered for time: %d", i); c4[i] = new TCanvas(canName, canTitle, 1000, 900); c4[i]->cd(); cutName.Form("cTime%d", i); currCut = (TCutG*)fCutsTime->Get(cutName); varName.Form("SQRXE:NeEvent.CsI_R[%d]", i); condition.Form("NeEvent.CsI_R[%d]<3500" // "&& 0.125*tCsI_R[%d]-0.125*tF5[0] > -70" // "&& 0.125*tCsI_R[%d]-0.125*tF5[0] < -40" "&& SQRXEsum<25 && SQRXmult==1" "&& trigger==3 && %s && %s", i, cutName.Data(), timeSiCondition.Data()); tr->SetMarkerColor(kBlack); tr->SetMarkerStyle(20); tr->SetMarkerSize(.4); tr->Draw(varName, condition, "", drawEntries); // tr->Draw(varName, "", "", drawEntries); // tr->Draw(varName, condition, "", drawEntries); // tAlphaCal->Draw(varName, "", "same"); c4[i]->Update(); }//*/ return; ///////////////////////////////////////////////////////////////////// // c5 return; }