3#include "BmnGlobalTrack.h"
6static Double_t fWorkTime = 0.0;
10 fGlobalTracks =
nullptr;
12 fTof400Hits =
nullptr;
22 FairRootManager* ioman = FairRootManager::Instance();
24 Fatal(
"Init",
"FairRootManager is not instantiated");
26 fTof400Hits = (TClonesArray*)ioman->GetObject(
"BmnTof400Hit");
27 fStsTracks = (TClonesArray*)ioman->GetObject(
"StsVector");
28 fGlobalTracks = (TClonesArray*)ioman->GetObject(
"BmnGlobalTrack");
30 fHistoManager->
Create1 <TH1F>(
"TOF400_ResidX_total",
"Total residuals in X coordinate; dX, cm; N", 100, -5.0, 5.0);
31 fHistoManager->
Create1 <TH1F>(
"TOF400_ResidY_total",
"Total residuals in Y coordinate; dY, cm; N", 100, -5.0, 5.0);
32 fHistoManager->
Create2 <TH2F>(
"TOF400_Banan_total",
"Total #beta vs rigidity; rigidity, GeV/c/Q; #beta", 400, -5.0, 10.0, 400, 0.2, 1.1);
33 fHistoManager->
Create2 <TH2F>(
"TOF400_Mass2_total",
"Total m^{2} vs rigidity; rigidity, GeV/c/Q; m^{2}", 400, -5.0, 10.0, 400, -0.5, 10.0);
35 for (Int_t
i = 0;
i < nModules; ++
i) {
36 fHistoManager->
Create1 <TH1F>(Form(
"TOF400_ResidX_%d",
i), Form(
"Residuals in X coordinate for module %d; dX, cm; N",
i), 100, -5.0, 5.0);
37 fHistoManager->
Create1 <TH1F>(Form(
"TOF400_ResidY_%d",
i), Form(
"Residuals in Y coordinate for module %d; dY, cm; N",
i), 100, -5.0, 5.0);
40 tof400Dir = gFile->mkdir(
"TOF400");
43 fWorkTime += sw.RealTime();
53 if (!IsActive())
return;
54 for (Int_t iTr = 0; iTr < fGlobalTracks->GetEntriesFast(); ++iTr) {
58 fHistoManager->
H1(
"TOF400_ResidX_total")->Fill(hit->
GetResX());
59 fHistoManager->
H1(
"TOF400_ResidY_total")->Fill(hit->
GetResY());
60 Int_t mod = ((hit->GetDetectorID() & 0x0000FF00) >> 8) - 1;
61 fHistoManager->
H1(Form(
"TOF400_ResidX_%d", mod))->Fill(hit->
GetResX());
62 fHistoManager->
H1(Form(
"TOF400_ResidY_%d", mod))->Fill(hit->
GetResY());
63 fHistoManager->
H2(
"TOF400_Banan_total")->Fill(track->
GetP(), track->
GetBeta(1));
64 fHistoManager->
H2(
"TOF400_Mass2_total")->Fill(track->
GetP(), track->
GetMass2(1));
68 fWorkTime += sw.RealTime();
77 for (Int_t
i = 0;
i < nModules; ++
i) {
78 fHistoManager->
H1(Form(
"TOF400_ResidX_%d",
i))->Fit(
"gaus",
"QSR",
"", -2, 2);
79 fHistoManager->
H1(Form(
"TOF400_ResidY_%d",
i))->Fit(
"gaus",
"QSR",
"", -2, 2);
86 fWorkTime += sw.RealTime();
88 printf(
"Work time of BmnTof400Qa: %4.2f sec.\n", fWorkTime);
Double_t GetMass2(Int_t tofID)
Double_t GetBeta(Int_t tofID) const
Int_t GetTof1HitIndex() const
TH2 * H2(const TString &name) const
Return pointer to TH2 histogram.
void WriteToFile()
Write all histograms to current opened file.
void Create2(const TString &name, const TString &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
void Create1(const TString &name, const TString &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
TH1 * H1(const TString &name) const
Return pointer to TH1 histogram.
virtual InitStatus Init()
virtual void Exec(Option_t *opt)