Skip to content
Snippets Groups Projects
Commit 709e7213 authored by Vardan Tadevosyan's avatar Vardan Tadevosyan
Browse files

Added total and Preshower energy depositions in the cluster associated to the 1-st track

parent c1ece4f4
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ hcal_slop = 7.5
;Turn on HMS cal. fiducial volume cut. 0="no cut"
;Default hcal_fv_test=0
hcal_fv_test = 1
hcal_fv_test = 0
hcal_pos_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001
......
......@@ -17,3 +17,6 @@ hdc_plane_names = "1x1 1y1 1u1 1v1 1y2 1x2 2x1 2y1 2u1 2v1 2y2 2x2"
hcal_layer_names = "1pr 2ta 3ta 4ta"
hhodo_plane_names = "1x 1y 2x 2y"
hpcentral=0.811
void comptrackedep(Int_t run)
{
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH1F* h = tre;
TFile* f1 = new TFile(Form("%d_hbk.root",run));
cout << "Engine root file " << Form("%d_hbk.root",run) << endl;
TH1F* h1;
switch (run) {
case 50017 :
// h1 = h212; //A+
break;
default :
h1 = h420; //edep
}
TCanvas *c1 = new TCanvas("c1", "Shower 1 track cluster Edep", 1000, 667);
// gPad->SetLogy();
h1->SetFillColor(kGreen);
h1->SetLineColor(kGreen);
h1->Draw();
h->SetLineColor(kBlue);
h->SetFillStyle(0);
h->SetLineWidth(2);
h->Draw("same");
TLatex l;
l.SetTextSize(0.04);
Float_t maxy = h1->GetBinContent(h1->GetMaximumBin());
Float_t xmin = h1->GetXaxis()->GetXmin();
Float_t xmax = h1->GetXaxis()->GetXmax();
Float_t xt = xmin + 0.67*(xmax-xmin);
l.SetTextColor(kGreen);
l.DrawLatex(xt,0.65*maxy,"Engine");
l.SetTextColor(kBlue);
l.DrawLatex(xt,0.75*maxy,"hcana");
// Difference between the histograms.
TCanvas *c2 = new TCanvas("c2", "Edep differences", 1000, 667);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
dif->SetTitle("Edep Difference");
dif->SetFillColor(kRed);
dif->SetLineColor(kRed);
dif->SetLineWidth(1);
dif->SetFillStyle(1111);
dif->Draw();
}
void comptrackepr(Int_t run)
{
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH1F* h = trepr;
TFile* f1 = new TFile(Form("%d_hbk.root",run));
cout << "Engine root file " << Form("%d_hbk.root",run) << endl;
TH1F* h1;
switch (run) {
case 50017 :
// h1 = h212; //A+
break;
default :
h1 = h421; //epr
}
TCanvas *c1 = new TCanvas("c1", "Shower Largest cluster Edep", 1000, 667);
// gPad->SetLogy();
h1->SetFillColor(kGreen);
h1->SetLineColor(kGreen);
h1->Draw();
h->SetLineColor(kBlue);
h->SetFillStyle(0);
h->SetLineWidth(2);
h->Draw("same");
TLatex l;
l.SetTextSize(0.04);
Float_t maxy = h1->GetBinContent(h1->GetMaximumBin());
Float_t xmin = h1->GetXaxis()->GetXmin();
Float_t xmax = h1->GetXaxis()->GetXmax();
Float_t xt = xmin + 0.75*(xmax-xmin);
l.SetTextColor(kGreen);
l.DrawLatex(xt,0.65*maxy,"Engine");
l.SetTextColor(kBlue);
l.DrawLatex(xt,0.75*maxy,"hcana");
// Difference between the histograms.
TCanvas *c2 = new TCanvas("c2", "Epr differences", 1000, 667);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
dif->SetTitle("Epr Difference");
dif->SetFillColor(kRed);
dif->SetLineColor(kRed);
dif->SetLineWidth(1);
dif->SetFillStyle(1111);
dif->Draw();
}
void comptrackx(Int_t run)
{
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH1F* h = trx;
TFile* f1 = new TFile(Form("%d_hbk.root",run));
cout << "Engine root file " << Form("%d_hbk.root",run) << endl;
TH1F* h1;
switch (run) {
case 50017 :
// h1 = h212; //A+
break;
default :
h1 = h417; //X
}
TCanvas *c1 = new TCanvas("c1", "Shower Largest cluster X", 1000, 667);
// gPad->SetLogy();
h1->SetFillColor(kGreen);
h1->SetLineColor(kGreen);
h1->Draw();
h->SetLineColor(kBlue);
h->SetFillStyle(0);
h->SetLineWidth(2);
h->Draw("same");
TLatex l;
l.SetTextSize(0.04);
Float_t maxy = h1->GetBinContent(h1->GetMaximumBin());
Float_t xmin = h1->GetXaxis()->GetXmin();
Float_t xmax = h1->GetXaxis()->GetXmax();
Float_t xt = xmin + 0.67*(xmax-xmin);
l.SetTextColor(kGreen);
l.DrawLatex(xt,0.65*maxy,"Engine");
l.SetTextColor(kBlue);
l.DrawLatex(xt,0.75*maxy,"hcana");
// Difference between the histograms.
TCanvas *c2 = new TCanvas("c2", "Track X differences", 1000, 667);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
dif->SetTitle("Hcal track X Difference");
dif->SetFillColor(kRed);
dif->SetLineColor(kRed);
dif->SetLineWidth(1);
dif->SetFillStyle(1111);
dif->Draw();
}
void comptrackxy(Int_t run)
{
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH2F* h = trx_vs_try;
TFile* f1 = new TFile(Form("%d_hbk.root",run));
cout << "Engine root file " << Form("%d_hbk.root",run) << endl;
TH2F* h1;
switch (run) {
case 50017 :
// h1 = h212; //A+
break;
default :
h1 = h419; //Y vs Y
}
TCanvas *c1 = new TCanvas("c1", "Shower Largest cluster X", 1000, 667);
// gPad->SetLogy();
h1->SetMarkerColor(kGreen);
// h1->SetLineColor(kGreen);
h1->Draw();
h->SetMarkerColor(kBlue);
// h->SetFillStyle(0);
// h->SetLineWidth(2);
h->Draw("same");
/*
TLatex l;
l.SetTextSize(0.04);
Float_t maxy = h1->GetBinContent(h1->GetMaximumBin());
Float_t xmin = h1->GetXaxis()->GetXmin();
Float_t xmax = h1->GetXaxis()->GetXmax();
Float_t xt = xmin + 0.67*(xmax-xmin);
l.SetTextColor(kGreen);
l.DrawLatex(xt,0.095*maxy,"Engine");
l.SetTextColor(kBlue);
l.DrawLatex(xt,0.045*maxy,"hcana");
*/
// Difference between the histograms.
TCanvas *c2 = new TCanvas("c2", "X differences", 1000, 667);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
// dif->SetTitle("X Difference");
// dif->SetFillColor(kRed);
// dif->SetLineColor(kRed);
// dif->SetLineWidth(1);
// dif->SetFillStyle(1111);
dif->Draw("LEGO2");
}
void comptracky(Int_t run)
{
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH1F* h = try;
TFile* f1 = new TFile(Form("%d_hbk.root",run));
cout << "Engine root file " << Form("%d_hbk.root",run) << endl;
TH1F* h1;
switch (run) {
case 50017 :
// h1 = h212; //A+
break;
default :
h1 = h418; //Y
}
TCanvas *c1 = new TCanvas("c1", "Shower track Y", 1000, 667);
// gPad->SetLogy();
h1->SetFillColor(kGreen);
h1->SetLineColor(kGreen);
h1->Draw();
h->SetLineColor(kBlue);
h->SetFillStyle(0);
h->SetLineWidth(2);
h->Draw("same");
TLatex l;
l.SetTextSize(0.04);
Float_t maxy = h1->GetBinContent(h1->GetMaximumBin());
Float_t xmin = h1->GetXaxis()->GetXmin();
Float_t xmax = h1->GetXaxis()->GetXmax();
Float_t xt = xmin + 0.67*(xmax-xmin);
l.SetTextColor(kGreen);
l.DrawLatex(xt,0.65*maxy,"Engine");
l.SetTextColor(kBlue);
l.DrawLatex(xt,0.755*maxy,"hcana");
// Difference between the histograms.
TCanvas *c2 = new TCanvas("c2", "Hcal Y differences", 1000, 667);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
dif->SetTitle("Y Difference");
dif->SetFillColor(kRed);
dif->SetLineColor(kRed);
dif->SetLineWidth(1);
dif->SetFillStyle(1111);
dif->Draw();
}
......@@ -63,6 +63,17 @@ TH1F eprmax 'HMS PrSh Max Clust. Edep' H.cal.eprmax 100 -0.1 0.811
# X coordinate the largest cluster.
TH1F xmax 'HMS Cal Max Clust. X' H.cal.xmax 150 -75. 75.
# Track coordinates at the front of calorimeter
TH2F trx_vs_try 'HMS Track X vs Y at calor.' H.cal.try H.cal.trx 80 -40. 40. 150 -75. 75. H.dc.ntrack==1
TH1F trx 'HMS Track X at calorimeter' H.cal.trx 150 -75. 75. H.dc.ntrack==1
TH1F try 'HMS Track Y at calorimeter' H.cal.try 80 -40. 40. H.dc.ntrack==1
# Energy of the cluster associated to the main (currently first) track
TH1F tre 'HMS Cal Track Clust. Edep' H.cal.tre 200 -0.1 1.622 H.dc.ntrack==1
# Preshower Energy of the cluster associated to the main (currently 1st) track
TH1F trepr 'HMS PrSh Track Clust. Edep' H.cal.trepr 100 -0.1 0.811 H.dc.ntrack==1
#Calorimeter ADC channels
TH1F hcaladc_A1p 'HMS Cal ADC A1p - PED' H.cal.1pr.apos_p[0] 150 50 500
TH1F hcaladc_A2p 'HMS Cal ADC A2p - PED' H.cal.1pr.apos_p[1] 150 50 500
......
......@@ -444,8 +444,10 @@ Int_t THcShower::DefineVariables( EMode mode )
{ "mult", "Multiplicity of largest cluster", "fMult" },
// { "nblk", "Numbers of blocks in main cluster", "fNblk" },
// { "eblk", "Energies of blocks in main cluster", "fEblk" },
// { "trx", "track x-position in det plane", "fTRX" },
// { "try", "track y-position in det plane", "fTRY" },
{ "trx", "track x-position in det plane (1st track)", "fTRX" },
{ "try", "track y-position in det plane (1st track)", "fTRY" },
{ "tre", "track energy in the calorimeter (1st track)", "fTRE" },
{ "trepr", "track energy in the preshower (1st track)", "fTREpr" },
{ 0 }
};
return DefineVarsFromList( vars, mode );
......@@ -500,7 +502,11 @@ void THcShower::Clear(Option_t* opt)
fMult = 0;
fE = 0.;
fEpr = 0.;
fX = -75.; //out of acceptance
fX = -75.; //out of acceptance
fTRX = -75.; //out of acceptance
fTRY = -40.; //out of acceptance
fTRE = -1.;
fTREpr = -1.;
}
//_____________________________________________________________________________
......@@ -707,9 +713,25 @@ Int_t THcShower::CoarseProcess( TClonesArray& tracks)
// << " Phi = " << theTrack->GetPhi()
// << endl;
MatchCluster(theTrack, ClusterList);
Double_t Xtr;
Double_t Ytr;
Int_t mclust = MatchCluster(theTrack, ClusterList, Xtr, Ytr);
if (i==0) {
fTRX = Xtr;
fTRY = Ytr;
if (mclust >= 0) {
THcShowerCluster* cluster = (*ClusterList).ListedCluster(mclust);
fTRE = (*cluster).clE();
fTREpr = (*cluster).clEpr();
}
}
}
cout << " fTRX = " << fTRX << " fTRY = " << fTRY << endl;
if (fdbg_clusters_cal)
cout << "THcShower::CoarseProcess return ---------------------------" <<endl;
......@@ -719,7 +741,8 @@ Int_t THcShower::CoarseProcess( TClonesArray& tracks)
//-----------------------------------------------------------------------------
Int_t THcShower::MatchCluster(THaTrack* Track,
THcShowerClusterList* ClusterList)
THcShowerClusterList* ClusterList,
Double_t& XTrFront, Double_t& YTrFront)
{
// Match a cluster to a given track.
......@@ -730,8 +753,8 @@ Int_t THcShower::MatchCluster(THaTrack* Track,
<< " Phi = " << Track->GetPhi()
<< endl;
Double_t XTrFront = kBig;
Double_t YTrFront = kBig;
XTrFront = kBig;
YTrFront = kBig;
Double_t pathl = kBig;
// Track interception with face of the calorimeter. The coordinates are
......
......@@ -107,10 +107,12 @@ public:
Double_t fX; // x-position (cm) of the largest cluster
Double_t fZ; // z-position (cm) of the largest cluster
Int_t fMult; // # of hits in the largest cluster
// Int_t fNblk; // Number of blocks in main cluster
// Double_t* fEblk; // Energies of blocks in main cluster
// Double_t fTRX; // track x-position in det plane"
// Double_t fTRY; // track y-position in det plane",
// Int_t fNblk; // Number of blocks in main cluster
// Double_t* fEblk; // Energies of blocks in main cluster
Double_t fTRX; // track x-position in det plane (1st track)
Double_t fTRY; // track y-position in det plane (1st track)
Double_t fTRE; // Energy (MeV) of the cluster associated to track
Double_t fTREpr; // Preshower Energy (MeV) of the track's cluster
// Potential Hall C parameters. Mostly here for demonstration
......@@ -146,7 +148,7 @@ public:
void Setup(const char* name, const char* description);
Int_t MatchCluster(THaTrack*, THcShowerClusterList*);
Int_t MatchCluster(THaTrack*, THcShowerClusterList*, Double_t&, Double_t&);
ClassDef(THcShower,0) // Generic class
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment