10#include <ecl/modules/eclTimeShiftsPlottingCollector/eclTimeShiftsPlottingCollectorModule.h>
13#include <ecl/dbobjects/ECLCrystalCalib.h>
14#include <ecl/dbobjects/ECLReferenceCrystalPerCrateCalib.h>
15#include <ecl/mapper/ECLChannelMapper.h>
35 m_CrystalTimeDB(
"ECLCrystalTimeOffset"),
36 m_CrateTimeDB(
"ECLCrateTimeOffset"),
37 m_RefCrystalsCalibDB(
"ECLReferenceCrystalPerCrateCalib")
39 setDescription(
"This module reads the crystal and crate time offset information from the database");
56 B2INFO(
"eclTimeShiftsPlottingCollector: Experiment = " <<
m_evtMetaData->getExperiment() <<
62 string objectName =
"tree_perCrystal";
63 TTree* tree_crys =
new TTree(objectName.c_str(),
"");
64 tree_crys->Branch<
int>(
"run", &
m_run);
65 tree_crys->Branch<
int>(
"exp", &
m_exp);
71 tree_crys->Branch<
int>(
"crateID", &
m_crateID);
77 registerObject<TTree>(objectName, tree_crys);
96 crystalMapper->initFromDB();
108 B2DEBUG(29,
"Finished checking if previous crate time payload has changed");
109 B2DEBUG(29,
"m_CrateTime size = " <<
m_CrateTime.size());
113 B2DEBUG(29,
"Finished checking if previous crate time payload has changed");
117 B2DEBUG(29,
"Finished checking if reference crystal ids payload has changed");
120 B2DEBUG(25,
"eclTimeShiftsPlottingCollector:: loaded ECLCrystalTimeOffset from the database"
123 B2DEBUG(25,
"eclTimeShiftsPlottingCollector:: loaded ECLCrateTimeOffset from the database"
126 B2DEBUG(25,
"eclTimeShiftsPlottingCollector:: loaded ECLReferenceCrystalPerCrateCalib from the database"
130 string objectName =
"tree_perCrystal";
131 auto tree_perCrystal = getObjectPtr<TTree>(objectName);
135 for (
int crysID = 1; crysID <=
NUM_CRYSTALS; crysID++) {
141 int crateID_temp = crystalMapper->getCrateID(crysID);
144 tree_perCrystal->Fill();
Calibration collector module base class.
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
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...
eclTimeShiftsPlottingCollectorModule()
Module constructor.
std::vector< float > m_CrateTime
vector obtained from DB object
DBObjPtr< ECLCrystalCalib > m_CrateTimeDB
Time offset from crate time calibration (also this calibration) from database.
int m_previousRun
Previous run number, in case we run over several runs.
std::vector< float > m_CrystalTimeUnc
vector obtained from DB object
DBObjPtr< ECLCrystalCalib > m_CrystalTimeDB
Time offset from previous crystal time calibration (this calibration) from database.
int m_crystalID
crystal identification number
DBObjPtr< ECLReferenceCrystalPerCrateCalib > m_RefCrystalsCalibDB
Crystal IDs of the one reference crystal per crate from database.
double m_crateTimeConstUnc
crate time uncertainty in ticks
std::vector< short > m_RefCrystalsCalib
vector obtained from DB object
double m_crystalTimeConstUnc
crystal time uncertainty in ticks
void collect() override
Select events and crystals and accumulate histograms.
int m_crateID
crate identification number
std::vector< float > m_CrateTimeUnc
uncertainty vector obtained from DB object
StoreObjPtr< EventMetaData > m_evtMetaData
Event meta data.
int m_exp
Current experiment number.
int m_refCrystalID
reference crystal identification number
void prepare() override
Define histograms and read payloads from DB.
double m_crystalTimeConst
crystal time constants in ticks
double m_crateTimeConst
crate time constant in ticks
std::vector< float > m_CrystalTime
vector obtained from DB object
int m_previousExp
Previous experiment number, in case we run over several runs.
void inDefineHisto() override
Replacement for defineHisto() in CalibrationCollector modules.
virtual ~eclTimeShiftsPlottingCollectorModule()
Module destructor.
const int NUM_CRYSTALS
Number of crystals in the ECL.
int m_run
Current run number.
Class to store variables with their name which were sent to the logging service.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.