Skip to content
Snippets Groups Projects
Commit 4eb6c8ce authored by Vardan Tadevosyan's avatar Vardan Tadevosyan Committed by Stephen A. Wood
Browse files

Add access to the golden track proper in THaGolden Track class.

Access the energy of the golden track from THaGoldenTrack.

    Include THaTrack.h in THaGoldenTrack.h.
    Add GetEnergy method in THaGoldenTrack.h.
    Define variable name "e" for the energy of golden track in THaGoldenTrack.C.
parent 659b4773
No related branches found
No related tags found
No related merge requests found
void compgoldenenorm(Int_t run=52949)
{
//Comapare hsshtrk from Engine with gold.enorm from hcana.
TFile* f = new TFile(Form("hodtest_%d.root",run));
cout << "hcana root file " << Form("hodtest_%d.root",run) << endl;
TH1F* h = golden_enorm;
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 = h438; //hsshtrk, engine/replay/paw
h1 = h426; //hsshtrk, engine/replay_mkj/paw
}
TCanvas *c1 = new TCanvas("c1", "Golden track E/P", 800, 1000);
c1->Divide(1,2);
// gPad->SetLogy();
c1->cd(1);
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.
c1->cd(2);
TH1F* dif = h->Clone();
dif->Add(h,h1,1.,-1.);
dif->SetTitle("Enorm Difference");
dif->SetFillColor(kRed);
dif->SetLineColor(kRed);
dif->SetLineWidth(1);
dif->SetFillStyle(1111);
dif->Draw();
}
......@@ -45,6 +45,9 @@ void hodtest_mkj(Int_t RunNumber=50017, Int_t MaxEventToReplay=5000) {
THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov" );
HMS->AddDetector( aerogel );
// Add Golden Track
gHaPhysics->Add( new THaGoldenTrack( "H.gold", "HMS Golden Track", "H" ));
// Set up the analyzer - we use the standard one,
// but this could be an experiment-specific one as well.
// The Analyzer controls the reading of the data, executes
......
# See $ANALYZER/examples/output_example.def for examples
#
block H.dc.*
block H.hod.*
#block H.dc.*
#block H.hod.*
block H.cal.*
block H.aero.*
#block H.aero.*
block H.tr.*
block H.gold.*
block g.evtyp
# TDC spectra
......@@ -211,4 +212,8 @@ TH1F dtime_hdc2u1 'HDC 2U1 Drift Time' H.dc.2u1.time 200 -100 300
TH1F dtime_hdc2v1 'HDC 2V1 Drift Time' H.dc.2v1.time 200 -100 300
TH1F dtime_hdc2y2 'HDC 2Y2 Drift Time' H.dc.2y2.time 200 -100 300
TH1F dtime_hdc2x2 'HDC 2X2 Drift Time' H.dc.2x2.time 200 -100 300
#
# Golden Track momentum
TH1F golden_p 'HMS Golden P' H.gold.p 100 0.011 1.8 H.dc.ntrack!=0
TH1F golden_e 'HMS Golden E' H.gold.e 100 0.011 1.8 H.dc.ntrack!=0
TH1F golden_enorm 'HMS Golden E/P' H.gold.e/H.gold.p 100 0.01 1.8 H.gold.index>=0
......@@ -13,7 +13,7 @@ THcDetectorMap.cxx \
THcRawHit.cxx THcHitList.cxx \
THcSignalHit.cxx \
THcHodoscope.cxx THcScintillatorPlane.cxx \
THcHodoscopeHit.cxx \
THcRawHodoHit.cxx \
THcDC.cxx THcDriftChamberPlane.cxx \
THcDriftChamber.cxx \
THcRawDCHit.cxx THcDCHit.cxx \
......
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