BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnZdcAnalyzer.cxx
Go to the documentation of this file.
1/*
2 * File: BmnZdcAnalyzer.cxx
3 * Author: pnaleks
4 *
5 * Created on 5 июня 2020 г., 18:58
6 */
7
8#include "BmnZdcAnalyzer.h"
9
10#include "FairLogger.h"
11#include "FairRootManager.h"
12
13#include <TStopwatch.h>
14
15using namespace std;
16static Float_t workTime = 0.0;
17
19 : FairTask("BmnZdcAnalyzer")
20 ,
21
22 fArrayOfZdcDigits(nullptr)
23 , fBmnZDCEventData(nullptr)
24 ,
25
26 fModuleScale(nullptr)
27 , fModuleThreshold(nullptr)
28{}
29
31
33{
34 FairRootManager* ioman = FairRootManager::Instance();
35 fArrayOfZdcDigits = (TClonesArray*)ioman->GetObject("ZdcDigit");
36 if (fArrayOfZdcDigits == nullptr) {
37 // check if there is an old name of the branch ("ZDC")
38 fArrayOfZdcDigits = (TClonesArray*)ioman->GetObject("ZDC");
39 if (fArrayOfZdcDigits == nullptr) {
40 LOG(error) << "BmnZdcAnalyzer::Init() branch 'ZdcDigit' or old 'ZDC' not found! Task will be deactivated";
41 SetActive(kFALSE);
42 return kERROR;
43 }
44 }
45
47 ioman->Register("ZDCEventData.", "Zdc", fBmnZDCEventData, kTRUE);
48
49 Info(__func__, "ZDC analyzer ready");
50 return kSUCCESS;
51}
52
54{
55
56 TStopwatch sw;
57 sw.Start();
58
59 if (!IsActive())
60 return;
61
63
64 sw.Stop();
65 workTime += sw.RealTime();
66}
67
69{
70 printf("Work time of BmnZdcAnalyzer: %4.2f sec.\n", workTime);
71}
float Float_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
const char Option_t
void Info(const char *location, const char *msgfmt,...)
Float_t * fModuleThreshold
BmnZDCEventData * fBmnZDCEventData
TClonesArray * fArrayOfZdcDigits
virtual void Finish()
virtual InitStatus Init()
virtual ~BmnZdcAnalyzer()
virtual void Exec(Option_t *opt)
Float_t * fModuleScale
Double_t RealTime()
void Start(Bool_t reset=kTRUE)
void Stop()