10 #include <arich/modules/arichRateCal/ARICHRateCalModule.h>
11 #include <arich/dataobjects/ARICHThParam.h>
12 #include <arich/dataobjects/ARICHRawDigit.h>
13 #include <arich/dataobjects/ARICHInfo.h>
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <framework/datastore/StoreArray.h>
18 #include <framework/datastore/StoreObjPtr.h>
53 addParam(
"nrun", m_nrun,
"# of scan runs", 100);
54 addParam(
"nevents", m_nevents,
"# of events per run", 1000);
58 addParam(
"debug", m_debugmode,
"debug mode",
false);
59 addParam(
"internal", m_internalmode,
"Internal thscan mode",
false);
60 addParam(
"daqdb", m_daqdb,
"daqdb config name", std::string(
""));
88 B2WARNING(
"dth is set to 0");
90 for (
int i = 0; i < 100; i++) {
91 h_rate2D[i] =
new TH2F(Form(
"h_rate2D_%d", i), Form(
"MRG#%d;Channel ID; Vth [mV]", i), 144 * 6, -0.5, -0.5 + 144 * 6,
92 m_nrun, (m_th0 - 0.5 * m_dth) * 1000, (m_th0 + (m_nrun - 0.5)*m_dth) * 1000);
110 int runno = evtmetadata->getRun();
111 if (runno == 100 && !m_internalmode) {
120 if (!arichinfo->getthscan_mode())
return;
121 double vth_thscan = arichinfo->getvth_thscan();
125 int runno = evtmetadata->getRun();
130 for (
auto& rawdigit : rawdigits) {
131 const int mrgid = rawdigit.getBoardId();
134 std::vector<ARICHRawDigit::FEBDigit>& febs(rawdigit.getFEBs());
135 for (
auto& feb : febs) {
136 const int febno = feb.febno;
137 std::vector<ARICHRawDigit::FEBDigit::ChannelDigit>& channels(feb());
138 for (
auto& channel : channels) {
139 if (channel.val > 0) {
141 double vth = m_internalmode ? vth_thscan * 1000 : param.getVth() * 1000 ;
142 h_rate2D[mrgid]->Fill(channel.chno + febno * 144, vth);
150 if (m_evt_count == m_nevents) {
ARICHThParam class for storing photon hit information.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
virtual ~ARICHRateCalModule()
Destructor.
virtual void defineHisto() override
Function to define histograms.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.