BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnGemDigitQa.h
Go to the documentation of this file.
1// BmnGemDigitQa: example task for DIGI files - strip signal spectra of the GEM stations
2class BmnGemDigitQa : public FairTask
3{
4 public:
6 : FairTask("BmnGemDigitQa")
7 , fIsExp(isExp)
8 {}
9
10 InitStatus Init() override
11 {
12 // the GEM digits have different branch names in experimental and simulated files
13 FairRootManager* ioman = FairRootManager::Instance();
14 fDigits = (TClonesArray*)ioman->GetObject(fIsExp ? "GEM" : "BmnGemStripDigit");
15 if (!fDigits) {
16 LOG(error) << "BmnGemDigitQa::Init(): GEM digit branch not found, the task is deactivated";
17 return kERROR;
18 }
19 fHistSignal = new TH2D("hGemSignal", "GEM strip signal;station;signal, ADC counts", 8, 0, 8, 100, 0, 1000);
20 return kSUCCESS;
21 }
22
23 void Exec(Option_t* /*option*/) override
24 {
25 for (Int_t i = 0; i < fDigits->GetEntriesFast(); i++) {
26 BmnStripDigit* digit = (BmnStripDigit*)fDigits->UncheckedAt(i);
27 fHistSignal->Fill(digit->GetStation(), digit->GetStripSignal());
28 }
29 }
30
31 void Finish() override
32 {
33 // write the results to the output file of the macro
34 FairRootManager::Instance()->GetSink()->WriteObject(fHistSignal, "hGemSignal");
35 }
36
37 private:
39 TClonesArray* fDigits = nullptr;
40 TH2D* fHistSignal = nullptr;
41
43};
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
const char Option_t
#define ClassDefOverride(name, id)
void Finish() override
void Exec(Option_t *) override
TClonesArray * fDigits
BmnGemDigitQa(Bool_t isExp=kFALSE)
InitStatus Init() override
Class BmnStripDigit Base class for strip detector digits.
Int_t GetStation()
Double_t GetStripSignal()