Commit c8d06270 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Many modifications made in long period.

parent 5f8327ee
This diff is collapsed.
......@@ -4,4 +4,6 @@
// gInterpreter->AddIncludePath("/home/vratik/workspace/AculUtils/TELoss");
gSystem->Load("../libUserAnalysis.so");
// gSystem->Load("../../AculUtils/libTELoss.so");
gStyle->SetOptStat(1);
}
This diff is collapsed.
#include "TSystem.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TCanvas.h"
#include "TBox.h"
#include "TCut.h"
#include "TCutG.h"
#include "TStopwatch.h"
using std::cout;
using std::endl;
void searchTimeConditions() {
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");
tr->SetMarkerStyle(20);
tr->SetMarkerSize(0.4);
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;
TString timeSiLeftCondition;
timeSiLeftCondition.Form("(SQLXtime[0]>0");
for (Int_t j = 1; j<32; j++) {
condition.Form("|| SQLXtime[%d]>0", j);
timeSiLeftCondition.Append(condition);
}
timeSiLeftCondition.Append(")");
Int_t firstThinStrip = 5;
Int_t conTimeMult = 1;
TStopwatch stopwatch;
stopwatch.Start();
/////////////////////////////////////////////////////////////////////
// c1
TCanvas *c1 = new TCanvas("c1", "time in thin detector", 1600, 1200);
c1->Divide(4,4);
firstThinStrip = 0;
Int_t minTimeLthin[16] {
410, 410, 420, 415,
420, 410, 415, 415,
420, 420, 420, 420,
410, 425, 0, 0
};
Int_t maxTimeLthin[16] {
520, 525, 520, 530,
520, 530, 525, 525,
530, 530, 530, 520,
510, 525, 0, 0
};
cout << tr->GetEntries() << " events." << endl;
cout << trCal->GetEntries() << " calibrated events." << endl;
drawEntries = 10000000;
cout << drawEntries << " entries in input chain will be processed." << endl;
for (Int_t i = 0; i < 15; i++) {
c1->cd(i+1);
varName.Form("SQ20E[%d]:tSQ20[%d]*0.3", i+firstThinStrip, i+firstThinStrip);
condition.Form("tSQ20[%d]*0.3>300 && tSQ20[%d]*0.3<700 && SQ20E[%d]>0 && SQ20E[%d]<4",
i+firstThinStrip, i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);
tr->SetMarkerColor(kBlack);
tr->Draw(varName, condition, "col", drawEntries);
c1->Update();
condition.Form("tSQ20[%d]>0 && SQ20E[%d]>0 && SQ20E[%d]<40 && SQ20timeMult==%d",
i+firstThinStrip, i+firstThinStrip, i+firstThinStrip, conTimeMult);
tr->SetMarkerColor(kRed);
tr->Draw(varName, condition, "same", drawEntries);
c1->Update();
}//*/
// return;
/////////////////////////////////////////////////////////////////////
// c2
TCanvas *c2 = new TCanvas("c2", "time issues in 32 X-strips: 0-15", 1600, 1200);
c2->Divide(4,4);
firstThinStrip = 0;
Double_t minTimeLX[32] {
0, 0, 325, 328,
330, 0, 0, 330,
326, 328, 326, 335,
326, 328, 328, 330,
//
420, 425, 420, 420,
420, 420, 420, 420,
430, 425, 420, 420,
415, 415, 425, 415
};
Double_t maxTimeLX[32] {
0, 0, 345, 345,
350, 0, 0, 350,
345, 345, 345, 350,
340, 342, 345, 345,
//
460, 460, 460, 460,
460, 460, 460, 460,
460, 460, 460, 460,
460, 460, 460, 453
};
cout << tr->GetEntries() << " events." << endl;
cout << trCal->GetEntries() << " calibrated events." << endl;
drawEntries = 1000000;
cout << drawEntries << " entries in input chain will be processed." << endl;
for (Int_t i = 0; i < 16; i++) {
c2->cd(i+1);
varName.Form("SQLXE[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("0.3*tSQX_L[%d]>310 && 0.3*tSQX_L[%d]<380 && SQLXE[%d]>0 && trigger==3",
i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);
tr->SetMarkerColor(kRed);
tr->SetMarkerStyle(20);
tr->SetMarkerSize(.4);
tr->Draw(varName, condition, "col", drawEntries);
varName.Form("SQLXE[%d]:SQLXtime[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("SQLXtime[%d]>0 && SQLXE[%d]>0 && SQLXtimeMult==%d",
i+firstThinStrip, i+firstThinStrip, conTimeMult);
varName.Form("SQLXEtimeFiltered[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("0.3*tSQX_L[%d]>200 && 0.3*tSQX_L[%d]<500 && SQLXEtimeFilteredSum>0 && SQLXtimeMult==%d",
i+firstThinStrip, i+firstThinStrip, conTimeMult);
cout << condition << endl;
tr->Draw(varName, condition, "same", drawEntries);
c2->Update();
}//for */
// return;
/////////////////////////////////////////////////////////////////////
// c2_1
TCanvas *c2_1 = new TCanvas("c2_1", "time issues in 32 X-strips: 16-31", 1600, 1200);
c2_1->Divide(4,4);
firstThinStrip = 16;
cout << tr->GetEntries() << " events." << endl;
cout << trCal->GetEntries() << " calibrated events." << endl;
drawEntries = 1000000;
cout << drawEntries << " entries in input chain will be processed." << endl;
for (Int_t i = 0; i < 16; i++) {
c2_1->cd(i+1);
varName.Form("SQLXE[%d]:0.3*tSQX_L[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("0.3*tSQX_L[%d]>390 && 0.3*tSQX_L[%d]<480 && SQLXE[%d]>0", i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);
tr->Draw(varName, condition, "col", drawEntries);
varName.Form("SQLXE[%d]:SQLXtime[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("SQLXtime[%d]>0 && SQLXE[%d]>0 && SQLXtimeMult==%d",
i+firstThinStrip, i+firstThinStrip, conTimeMult);
tr->Draw(varName, condition, "same", drawEntries);
c2_1->Update();
}//for */
// return;
/////////////////////////////////////////////////////////////////////
// c3
TCanvas *c3 = new TCanvas("c3", "time issues in 16 Y-strips", 1600, 1200);
c3->Divide(4,4);
firstThinStrip = 0;
cout << tr->GetEntries() << " events." << endl;
cout << trCal->GetEntries() << " calibrated events." << endl;
drawEntries = 1000000;
cout << drawEntries << " entries in input chain will be processed." << endl;
Float_t timeCorr[16] = {0, -2, 0, 2,
-2.5, 5, -6, 4,
7, 3, 3, 4,
6, 4, -4, 13
};
for (Int_t i = 0; i < 16; i++) {
c3->cd(i+1);
varName.Form("SQLYE[%d]:0.3*tSQY_L[%d]+%f", i+firstThinStrip, i+firstThinStrip, timeCorr[i]);
condition.Form("0.3*tSQY_L[%d]>300 && 0.3*tSQY_L[%d]<360 && SQLYE[%d]>0", i+firstThinStrip, i+firstThinStrip, i+firstThinStrip);
tr->SetMarkerColor(kRed);
tr->SetMarkerStyle(20);
tr->SetMarkerSize(.4);
tr->Draw(varName, condition, "col", drawEntries);
// tr->Draw(varName, condition, "", drawEntries);
varName.Form("SQLYEtimeFiltered[%d]:SQLYtime[%d]", i+firstThinStrip, i+firstThinStrip);
condition.Form("0.3*tSQY_L[%d]>200 && 0.3*tSQY_L[%d]<500 && SQLYEtimeFilteredSum>0 && SQLYtimeMult==%d",
i+firstThinStrip, i+firstThinStrip, conTimeMult);
cout << condition << endl;
tr->Draw(varName, condition, "same", drawEntries);
c3->Update();
condition.Form("0.3*tSQY_L[%d]+%f>325 && 0.3*tSQY_L[%d]+%f<333 && SQLYE[%d]>0",
i+firstThinStrip, timeCorr[i], i+firstThinStrip, timeCorr[i], i+firstThinStrip);
tr->SetMarkerColor(kRed);
tr->Draw(varName, condition, "same", drawEntries);
// tAlphaCal->Draw(varName, "", "same");
c3->Update();
}//for */
// return;
/////////////////////////////////////////////////////////////////////
// c4
TCanvas *c4 = new TCanvas("c4", "Multiplicity", 1800, 900);
c4->Divide(3,2);
cout << tr->GetEntries() << " events." << endl;
cout << trCal->GetEntries() << " calibrated events." << endl;
drawEntries = 1000000;
cout << drawEntries << " entries in input chain will be processed." << endl;
c4->cd(1);
varName.Form("SQLXmult");
condition.Form("trigger==3 && SQLXmult>0 && SQLXmult<8");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
c4->cd(4);
varName.Form("SQLXtimeMult");
condition.Form("trigger==3 && SQLXtimeMult>0 && SQLXtimeMult<8");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
c4->cd(2);
varName.Form("SQLYmult");
condition.Form("trigger==3 && SQLYmult>0 && SQLYmult<8");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
c4->cd(5);
varName.Form("SQLYtimeMult");
condition.Form("trigger==3 && SQLYtimeMult>0 && SQLYtimeMult<18");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
c4->cd(3);
varName.Form("SQ20EcorrMult");
condition.Form("trigger==3 && SQ20EcorrMult>0");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
c4->cd(6);
varName.Form("SQ20timeMult");
condition.Form("trigger==3 && SQ20timeMult>0");
tr->Draw(varName, condition, "", drawEntries);
c4->Update();
//*/
return;
}
......@@ -76,7 +76,7 @@ void showBananas2() {
// c1
/*TCanvas *c1 = new TCanvas("c1", "time in thin detector", 1600, 1200);
TCanvas *c1 = new TCanvas("c1", "time in thin detector", 1600, 1200);
c1->Divide(4,4);
firstThinStrip = 0;
......@@ -104,7 +104,7 @@ void showBananas2() {
/////////////////////////////////////////////////////////////////////
// c2
/*TCanvas *c2 = new TCanvas("c2", "time issues in 32 X-strips: 0-15", 1600, 1200);
TCanvas *c2 = new TCanvas("c2", "time issues in 32 X-strips: 0-15", 1600, 1200);
c2->Divide(4,4);
firstThinStrip = 0;
......@@ -147,7 +147,7 @@ void showBananas2() {
// return;
return;
/////////////////////////////////////////////////////////////////////
......
This diff is collapsed.
......@@ -7,21 +7,17 @@
using std::cout;
using std::endl;
void showBeam(const Long64_t drawEntries = 100000)
void showBeam(const Long64_t drawEntries = 100000, const TString beam = "he")
{
TChain *tr = new TChain("AnalysisxTree");
// tr->Add("~/data/exp1804/h5_14_0?.root");
// tr->Add("~/data/exp1804/output.root");
tr->Add("~/data/exp1804/h5_12.root");
if (beam.Contains("he")) tr->Add("~/data/exp1804/h5_14_0?.root");
if (beam.Contains("be")) tr->Add("~/data/exp1804/be10_03_?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/h5_14_0?_calib.root");
// tr->AddFriend(trCal);
if (beam.Contains("he")) trCal->Add("~/data/exp1804/h5_14_0?_calib.root");
if (beam.Contains("be")) trCal->Add("~/data/exp1804/be10_03_?0_calib.root");
// const Int_t drawEntries = 6000000;
// const Int_t drawEntries = tr->GetEntries();
......@@ -37,27 +33,17 @@ void showBeam(const Long64_t drawEntries = 100000)
// cout << drawEntries << " entries in input chain will be processed." << endl;
/////////////////////////////////////////////////////////////////////
// c1
// TCanvas *c1 = new TCanvas("c1", "R: 0-7", 1600, 800);
// c1->Divide(4,2);
TCanvas *c1 = new TCanvas("beam", "beam info", 1200, 1200);
c1->Divide(2,2);
c1->cd(1);
// tr->Draw("trigger", "", "", drawEntries);
c1->cd(3);
// af5 = (NeEvent->F5[0]+NeEvent->F5[1]+NeEvent->F5[2]+NeEvent->F5[3]+4.*gRandom->Uniform())/4.
// tf5 = (NeEvent->tF5[0]+NeEvent->tF5[1]+NeEvent->tF5[2]+NeEvent->tF5[3]+4.*gRandom->Uniform())/4.;
// tf3 = (NeEvent->tF3[0]+NeEvent->tF3[1]+NeEvent->tF3[2]+NeEvent->tF3[3]+4.*gRandom->Uniform())/4.;
// ToF = (tf5 - tf3)*0.125+89.165;
// af5:TOF
// tr->Draw("(NeEvent->F5[0]+NeEvent->F5[1]+NeEvent->F5[2]+NeEvent->F5[3])/4.", "", "", drawEntries);
// tr->Draw("(F5[0]+F5[1]+F5[2]+F5[3])/4.", "", "", drawEntries);
// tr->Draw("(tF5[0]+tF5[1]+tF5[2]+tF5[3])/4.;", "", "", drawEntries);
// tr->Draw("( (tF5[0]+tF5[1]+tF5[2]+tF5[3]) - (tF3[0]+tF3[1]+tF3[2]+tF3[3]) )/4.*0.125+89.165;",
// "tF5[0]>0 && tF5[1]>0 && tF5[2]>0 && tF5[3]>0 && tF3[0]>0 && tF3[1]>0 && tF3[2]>0 && tF3[3]>0", "", drawEntries);
tr->Draw("(F5[0]+F5[1]+F5[2]+F5[3])/4.:( (tF5[0]+tF5[1]+tF5[2]+tF5[3]) - (tF3[0]+tF3[1]+tF3[2]+tF3[3]) )/4.*0.125+89.165;",
"tF5[0]>0 && tF5[1]>0 && tF5[2]>0 && tF5[3]>0 "
"&& tF3[0]>0 && tF3[1]>0 && tF3[2]>0 && tF3[3]>0 "
......@@ -108,6 +94,9 @@ void showBeam(const Long64_t drawEntries = 100000)
h2->GetYaxis()->SetTitleSize(0.06);
h2->GetYaxis()->SetTitleOffset(0.75);
/////////////////////////////////////////////////////////////////////
// c2
TCanvas *c2 = new TCanvas("c2", "Bugs in MWPC", 1200, 1200);
c2->Divide(2,2);
......@@ -126,6 +115,128 @@ void showBeam(const Long64_t drawEntries = 100000)
c2->cd(4);
tr->Draw("y2[0]", "ny2==0", "", drawEntries);
c2->Update();
/////////////////////////////////////////////////////////////////////
// c3
TCanvas *c3 = new TCanvas("c3", "Wire multiplicity", 1200, 1200);
c3->Divide(2,2);
c3->cd(1);
// tr->Draw("x1[0]", "x2[0]<1000 && nx2==1", "", drawEntries);
tr->Draw("nx1", "nx1<30000", "", drawEntries);
c3->cd(2);
tr->Draw("ny1", "ny1<30000", "", drawEntries);
c3->cd(3);
tr->Draw("nx2", "nx2<30000", "", drawEntries);
c3->cd(4);
tr->Draw("ny2", "ny2<30000", "", drawEntries);
/////////////////////////////////////////////////////////////////////
// c4
TCanvas *c4 = new TCanvas("c4", "MWPC time", 1200, 1200);
c4->Divide(2,2);
c4->cd(1);
// tr->Draw("x1[0]", "x2[0]<1000 && nx2==1", "", drawEntries);
tr->Draw("tMWPC[0]*0.125", "nx1<30000", "", drawEntries);
tr->SetLineColor(kRed);
tr->Draw("tMWPC[0]*0.125", "nx1<30000 && trigger==1", "same", drawEntries);
tr->SetLineColor(kBlue);
tr->Draw("tMWPC[0]*0.125", "nx1<30000 && trigger==3", "same", drawEntries);
tr->SetLineColor(kBlack);
c4->cd(2);
tr->Draw("tMWPC[1]*0.125", "ny1<30000", "", drawEntries);
tr->Draw("tMWPC[1]*0.125-tF5[0]*0.125", "ny1<30000", "", drawEntries);
c4->cd(3);
tr->Draw("tMWPC[2]*0.125", "nx2<30000", "", drawEntries);
c4->cd(4);
tr->Draw("tMWPC[3]*0.125", "ny2<30000", "", drawEntries);
c4->Update();
/////////////////////////////////////////////////////////////////////
// c5
TCanvas *c5 = new TCanvas("c5", "Multiplicity filtered for time", 1200, 1200);
c5->Divide(2,2);
c5->cd(1);
tr->Draw("nx1", "nx1<30000 && (tMWPC[0]*0.125-tF5[0]*0.125)>60 && (tMWPC[0]*0.125-tF5[0]*0.125)<77", "", drawEntries);
c5->cd(2);
tr->Draw("ny1", "ny1<30000 && (tMWPC[1]*0.125-tF5[0]*0.125)>60 && (tMWPC[1]*0.125-tF5[0]*0.125)<80", "", drawEntries);
c5->cd(3);
tr->Draw("nx2", "nx2<30000 && (tMWPC[2]*0.125-tF5[0]*0.125)>70 && (tMWPC[2]*0.125-tF5[0]*0.125)<90", "", drawEntries);
c5->cd(4);
tr->Draw("ny2", "ny2<30000 && (tMWPC[3]*0.125-tF5[0]*0.125)>60 && (tMWPC[3]*0.125-tF5[0]*0.125)<80", "", drawEntries);
c5->Update();
/////////////////////////////////////////////////////////////////////
// c6
TCanvas *c6 = new TCanvas("c6", "Cluster multiplicity", 1500, 1000);
c6->Divide(3,2);
c6->cd(1);
trCal->Draw("x1MultC", "x1MultC>0", "", drawEntries);
c6->cd(2);
trCal->Draw("y1MultC", "y1MultC>0", "", drawEntries);
c6->cd(4);
trCal->Draw("x2MultC", "x2MultC>0", "", drawEntries);
c6->cd(5);
trCal->Draw("y2MultC", "y2MultC>0", "", drawEntries);
c6->cd(3);
tr->Draw("nx1", "ny2==1 && nx2==1 && ny1==1 && nx1==1", "", drawEntries);
c6->cd(6);
trCal->Draw("x1MultC", "x1MultC==1 && y1MultC==1 && x2MultC==1 && y2MultC==1", "", drawEntries);
// tr->Draw("x1", "nx1<1", "", drawEntries);
c6->Update();
/////////////////////////////////////////////////////////////////////
// c1
TCanvas *c7 = new TCanvas("c7", "beam info - clusters", 1200, 1200);
c7->Divide(2,2);
c7->cd(1);
trCal->Draw("y1p:x1p", "y1p>-50. && x1p>-50.", "col", drawEntries);
c7->cd(3);
trCal->Draw("y2p:x2p", "y2p>-50. && x2p>-50.", "col", drawEntries);
c7->cd(2);
trCal->Draw("y1c:x1c", "y1c>-50. && x1c>-50.", "col", drawEntries);
c7->cd(4);
trCal->Draw("y2c:x2c", "y2c>-50. && x2c>-50.", "col", drawEntries);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment