BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnFHCalEvent.h
Go to the documentation of this file.
1/** \file BmnFHCalEvent.h
2 ** \author Nikolay Karpushkin <karpushkin@inr.ru>
3 ** \date 27.03.2022
4 **/
5
6/** \class BmnFHCalEvent
7 ** \brief Class for Bmn FHCal data container in event
8 ** \version 1.0
9 **/
10
11#ifndef BMNFHCALEVENT_H
12#define BMNFHCALEVENT_H
13
14#include "BmnFHCalModule.h"
15
16#include <TClonesArray.h>
17#include <TNamed.h>
18#include <vector>
19
20class BmnFHCalEvent : public TNamed
21{
22 public:
23 /** @brief Default constructor.
24 **/
26 : TNamed()
27 , fTotalEnergy()
28 , fModulesVec()
29 {}
30
31 /** Destructor **/
33
34 /** @brief Set TotalModules externally
35 ** @param TotalModules Total number of modules
36 **/
37 void SetTotalModules(int TotalModules) { fModulesVec.resize(TotalModules); }
38
39 /** @brief Set Deposited Energy
40 ** @return Set Deposited Energy in FHCal in event [mip]
41 **/
42 void SetTotalEnergy(float Energy) { fTotalEnergy = Energy; };
43
44 /** @brief Set ModulesArrtor
45 ** @return Set Vector of BmnFHCalModule objects
46 **/
47 void SetModule(uint8_t mod_id, BmnFHCalModule Module) { fModulesVec.at(mod_id - 1) = Module; };
48
49 /** @brief Zero all fiels
50 ** @return Set All fields to zero
51 **/
52 void reset()
53 {
54 fTotalEnergy = 0.;
55 fModulesVec.clear();
56 }
58 {
59 fTotalEnergy = 0.;
60 for (auto& it : fModulesVec) {
61 it.ResetSections();
62 it.ResetLinks();
63 }
64 }
65
66 void SummarizeEvent();
67 virtual void Print(Option_t* option = "") const {};
68
69 /** @brief Class name
70 ** @return BmnFHCalEvent
71 **/
72 virtual const char* GetClassName() { return "BmnFHCalEvent"; }
73
74 /** @brief Total number of modules
75 ** @return Total number of modules
76 **/
77 int GetTotalModules() const { return fModulesVec.size(); };
78
79 /** @brief Deposited Energy
80 ** @return Deposited Energy in FHCal in event [mip]
81 **/
82 float GetTotalEnergy() const { return fTotalEnergy; };
83
84 /** @brief Module info
85 ** @return BmnFHCalModule object with index mod_id = {1 to fgkTotalModules}
86 **/
87 BmnFHCalModule* GetModule(uint8_t mod_id) { return &fModulesVec.at(mod_id - 1); };
88
89 private:
91 std::vector<BmnFHCalModule> fModulesVec;
92
94};
95
96#endif /* BMNFHCALEVENT_H */
const char Option_t
#define ClassDef(name, id)
std::vector< BmnFHCalModule > fModulesVec
virtual void Print(Option_t *option="") const
void SetModule(uint8_t mod_id, BmnFHCalModule Module)
Set ModulesArrtor.
virtual const char * GetClassName()
Class name.
BmnFHCalModule * GetModule(uint8_t mod_id)
Module info.
~BmnFHCalEvent()
Destructor.
void ResetEnergies()
BmnFHCalEvent()
Default constructor.
void SetTotalModules(int TotalModules)
Set TotalModules externally.
void reset()
Zero all fiels.
void SetTotalEnergy(float Energy)
Set Deposited Energy.
float GetTotalEnergy() const
Deposited Energy.
int GetTotalModules() const
Total number of modules.
Class for Bmn FHCal module data container in event.