BmnRoot
26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnTof400Qa.cxx
Go to the documentation of this file.
1
#include "
BmnTof400Qa.h
"
2
3
#include "
BmnGlobalTrack.h
"
4
5
#include <
TFile.h
>
6
#include <
TStopwatch.h
>
7
8
static
Double_t
fWorkTime
= 0.0;
9
10
BmnTof400Qa::BmnTof400Qa
()
11
{
12
fStsTracks
=
nullptr
;
13
fGlobalTracks
=
nullptr
;
14
fKalman
=
nullptr
;
15
fTof400Hits
=
nullptr
;
16
fHistoManager
=
new
BmnQaHistoManager
();
17
}
18
19
InitStatus
BmnTof400Qa::Init
()
20
{
21
22
TStopwatch
sw;
23
sw.
Start
();
24
fKalman
=
new
BmnKalmanFilter
();
25
26
FairRootManager* ioman = FairRootManager::Instance();
27
if
(!ioman)
28
Fatal
(
"Init"
,
"FairRootManager is not instantiated"
);
29
30
fTof400Hits
= (
TClonesArray
*)ioman->GetObject(
"BmnTof400Hit"
);
31
fStsTracks
= (
TClonesArray
*)ioman->GetObject(
"StsVector"
);
32
fGlobalTracks
= (
TClonesArray
*)ioman->GetObject(
"BmnGlobalTrack"
);
33
34
fHistoManager
->Create1<
TH1F
>(
"TOF400_ResidX_total"
,
"Total residuals in X coordinate; dX, cm; N"
, 100, -5.0, 5.0);
35
fHistoManager
->Create1<
TH1F
>(
"TOF400_ResidY_total"
,
"Total residuals in Y coordinate; dY, cm; N"
, 100, -5.0, 5.0);
36
fHistoManager
->Create2<
TH2F
>(
"TOF400_Banan_total"
,
"Total #beta vs rigidity; rigidity, GeV/c/Q; #beta"
, 400, -5.0,
37
10.0, 400, 0.2, 1.1);
38
fHistoManager
->Create2<
TH2F
>(
"TOF400_Mass2_total"
,
"Total m^{2} vs rigidity; rigidity, GeV/c/Q; m^{2}"
, 400, -5.0,
39
10.0, 400, -0.5, 10.0);
40
41
for
(
Int_t
i
= 0;
i
<
nModules
; ++
i
) {
42
fHistoManager
->Create1<
TH1F
>(
Form
(
"TOF400_ResidX_%d"
,
i
),
43
Form
(
"Residuals in X coordinate for module %d; dX, cm; N"
,
i
), 100, -5.0, 5.0);
44
fHistoManager
->Create1<
TH1F
>(
Form
(
"TOF400_ResidY_%d"
,
i
),
45
Form
(
"Residuals in Y coordinate for module %d; dY, cm; N"
,
i
), 100, -5.0, 5.0);
46
}
47
48
tof400Dir
=
gFile
->mkdir(
"TOF400"
);
49
50
sw.
Stop
();
51
fWorkTime
+= sw.
RealTime
();
52
53
return
kSUCCESS;
54
}
55
56
void
BmnTof400Qa::Exec
(
Option_t
* opt)
57
{
58
59
TStopwatch
sw;
60
sw.
Start
();
61
62
if
(!IsActive())
63
return
;
64
for
(
Int_t
iTr = 0; iTr <
fGlobalTracks
->GetEntriesFast(); ++iTr) {
65
BmnGlobalTrack
* track = (
BmnGlobalTrack
*)
fGlobalTracks
->At(iTr);
66
if
(track->
GetTof1HitIndex
() == -1)
67
continue
;
68
BmnTofHit
* hit = (
BmnTofHit
*)
fTof400Hits
->At(track->
GetTof1HitIndex
());
69
fHistoManager
->H1(
"TOF400_ResidX_total"
)->Fill(hit->
GetResX
());
70
fHistoManager
->H1(
"TOF400_ResidY_total"
)->Fill(hit->
GetResY
());
71
Int_t
mod = ((hit->GetDetectorID() & 0x0000FF00) >> 8) - 1;
72
fHistoManager
->H1(
Form
(
"TOF400_ResidX_%d"
, mod))->Fill(hit->
GetResX
());
73
fHistoManager
->H1(
Form
(
"TOF400_ResidY_%d"
, mod))->Fill(hit->
GetResY
());
74
// fHistoManager->H2("TOF400_Banan_total")->Fill(track->GetP(), track->GetBeta(1));
75
fHistoManager
->H2(
"TOF400_Mass2_total"
)->Fill(track->
GetP
(), track->
GetMass2
(1));
76
}
77
78
sw.
Stop
();
79
fWorkTime
+= sw.
RealTime
();
80
}
81
82
void
BmnTof400Qa::Finish
()
83
{
84
85
TStopwatch
sw;
86
sw.
Start
();
87
88
for
(
Int_t
i
= 0;
i
<
nModules
; ++
i
) {
89
fHistoManager
->H1(
Form
(
"TOF400_ResidX_%d"
,
i
))->Fit(
"gaus"
,
"QSR"
,
""
, -2, 2);
90
fHistoManager
->H1(
Form
(
"TOF400_ResidY_%d"
,
i
))->Fit(
"gaus"
,
"QSR"
,
""
, -2, 2);
91
}
92
93
tof400Dir
->cd();
94
fHistoManager
->WriteToFile();
95
96
sw.
Stop
();
97
fWorkTime
+= sw.
RealTime
();
98
99
printf(
"Work time of BmnTof400Qa: %4.2f sec.\n"
,
fWorkTime
);
100
}
BmnGlobalTrack.h
fWorkTime
static Double_t fWorkTime
Definition
BmnTof400Qa.cxx:8
BmnTof400Qa.h
i
int i
Definition
P4_F32vec4.h:22
Int_t
int Int_t
Double_t
double Double_t
Option_t
const char Option_t
Fatal
void Fatal(const char *location, const char *msgfmt,...)
TFile.h
gFile
#define gFile
TStopwatch.h
Form
char * Form(const char *fmt,...)
BmnGlobalTrack
BmnGlobalTrack.h.
Definition
BmnGlobalTrack.h:14
BmnGlobalTrack::GetTof1HitIndex
Int_t GetTof1HitIndex() const
Definition
BmnGlobalTrack.h:36
BmnGlobalTrack::GetMass2
Float_t GetMass2(Int_t tofID) const
Definition
BmnGlobalTrack.h:43
BmnHit::GetResX
Double_t GetResX()
Definition
BmnHit.h:40
BmnHit::GetResY
Double_t GetResY()
Definition
BmnHit.h:41
BmnKalmanFilter
Definition
BmnKalmanFilter.h:28
BmnQaHistoManager
Definition
BmnQaHistoManager.h:10
BmnTof400Qa::Init
virtual InitStatus Init()
Definition
BmnTof400Qa.cxx:19
BmnTof400Qa::fKalman
BmnKalmanFilter * fKalman
Definition
BmnTof400Qa.h:33
BmnTof400Qa::tof400Dir
TDirectory * tof400Dir
Definition
BmnTof400Qa.h:39
BmnTof400Qa::nModules
const Int_t nModules
Definition
BmnTof400Qa.h:41
BmnTof400Qa::fStsTracks
TClonesArray * fStsTracks
Definition
BmnTof400Qa.h:35
BmnTof400Qa::fTof400Hits
TClonesArray * fTof400Hits
Definition
BmnTof400Qa.h:34
BmnTof400Qa::BmnTof400Qa
BmnTof400Qa()
Default constructor.
Definition
BmnTof400Qa.cxx:10
BmnTof400Qa::Finish
virtual void Finish()
Definition
BmnTof400Qa.cxx:82
BmnTof400Qa::Exec
virtual void Exec(Option_t *opt)
Definition
BmnTof400Qa.cxx:56
BmnTof400Qa::fGlobalTracks
TClonesArray * fGlobalTracks
Definition
BmnTof400Qa.h:36
BmnTof400Qa::fHistoManager
BmnQaHistoManager * fHistoManager
Definition
BmnTof400Qa.h:38
BmnTofHit
Definition
BmnTofHit.h:22
BmnTrack::GetP
Double_t GetP()
Definition
BmnTrack.h:67
TClonesArray
TH1F
TH2F
TStopwatch
TStopwatch::RealTime
Double_t RealTime()
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::Stop
void Stop()
QA
offline
BmnTof400Qa.cxx
Generated on
for BmnRoot by
1.17.0