9#include "reconstruction/modules/detectorOccupanciesDQM/DetectorOccupanciesDQMModule.h"
11#include <framework/dataobjects/EventMetaData.h>
12#include <ecl/dataobjects/ECLCalDigit.h>
13#include <ecl/dataobjects/ECLElementNumbers.h>
14#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
15#include <klm/dataobjects/KLMDigit.h>
16#include <arich/dataobjects/ARICHHit.h>
17#include <top/dataobjects/TOPDigit.h>
19#include <TDirectory.h>
41 std::string(
"DetectorOccupancies"));
44 "Min time for BKLM time histogram.",
double(-6500));
46 "Max time for BKLM time histogram.",
double(5000));
48 "Min time for EKLM time histogram.",
double(-5100));
50 "Max time for EKLM time histogram.",
double(-4500));
52 "Offset to center BKLM Scint. times at 0",
double(-4705.));
54 "Offset to center BKLM RPC times at 0",
double(-4300.5));
59DetectorOccupanciesDQMModule::~DetectorOccupanciesDQMModule()
71 TDirectory* oldDir = gDirectory;
79 const std::string tag[2] = {
"OUT",
"IN"};
80 const std::string title[2] = {
"[Outside Active Veto Window]",
"[Inside Active Veto Window]"};
85 std::string histoName =
"bklm_plane_occupancy";
86 std::string histoTitle =
"BKLM plane occupancy";
88 (histoTitle +
" " + title[0]).c_str(),
103 histoName =
"bklm_plane_trg_occupancy";
104 histoTitle =
"BKLM plane occupancy (w/ trgs)";
106 (histoTitle +
" " + title[0]).c_str(),
120 histoName =
"eklm_plane_occupancy";
121 histoTitle =
"EKLM plane occupancy";
123 (histoTitle +
" " + title[0]).c_str(),
136 histoName =
"eklm_plane_trg_occupancy";
137 histoTitle =
"EKLM plane occupancy (w/ trgs)";
139 (histoTitle +
" " + title[0]).c_str(),
154 histoName =
"arich_occupancy";
155 histoTitle =
"ARICH Occupancy";
157 (histoTitle +
" " + title[0]).c_str(),
167 histoName =
"top_occupancy";
168 histoTitle =
"TOP Occupancy for good hits";
169 for (
int i = 0; i < 2; i++) {
171 (histoTitle +
" " + title[i]).c_str(),
178 histoName =
"ecl_occupancy";
179 histoTitle =
"ECL occupancy (for hits with E > " + std::to_string((
int)
m_eclEnergyThr) +
" MeV)";
180 for (
int i = 0; i < 2; i++) {
182 (histoTitle +
" " + title[i]).c_str(),
210 for (
int i = 0; i < 2; i++) {
247 }
catch (
const std::exception&) {
251 bool backBooleanFlag = std::any_of(
255 return trg->testInput(trgBit);
269 int section = digit.getSection();
270 int layer = digit.getLayer();
271 int sector = digit.getSector();
272 int plane = digit.getPlane();
277 int section = digit.getSection();
278 int layer = digit.getLayer();
279 int sector = digit.getSector();
281 section, sector, layer);
283 float rawTime = (digit.inRPC()) ? digit.getRevo9DCArrivalTime() *
m_klmTime->
getCTimePeriod() : digit.getTime();
284 float time = rawTime - offset;
286 bool goodHit = (rawTime > -11000 && rawTime < 0);
302 if (digit.getHitQuality() != TOPDigit::c_Junk) topGoodHits++;
306 std::array<bool, ECLElementNumbers::c_NCrystals> crystal_hit;
310 if (digit.getEnergy() > thresholdGeV)
311 crystal_hit.at(digit.getCellId() - 1) =
true;
static int layerGlobalNumber(int section, int sector, int layer)
Get layer global number.
void initialize() override final
Module function initialize.
TH2F * m_EKLM_Plane_Occupancy[2]
EKLM plane integrated occupancy.
TH2F * m_BKLM_PlaneTrg_Occupancy[2]
BKLM plane integrated occupancy w/ trgs.
TH2F * m_EKLM_PlaneTrg_Occupancy[2]
EKLM plane integrated occupancy w/ trgs.
double m_EKLMTimeMax
Max time for EKLM Scint.
DetectorOccupanciesDQMModule()
Constructor.
TH1F * m_TOP_Occupancy[2]
TOP occupancy (good hits only)
StoreArray< KLMDigit > m_KLMDigits
KLM digits.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM Element numbers.
void defineHisto() override final
Defines Histograms.
StoreObjPtr< TRGSummary > m_trgSummary
trg summary
double m_BKLMScintOffset
Min time for RPC.
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data
double m_BKLMTimeMax
Max time for BKLM time.
const TRGSummary::ETimingType m_klmBackTriggers[1]
Background Trigger bit(s) of interest.
void event() override final
Module function event.
double m_EKLMTimeMin
Min time for EKLM Scint.
double m_BKLMRPCOffset
Max time for RPC.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
double m_eclEnergyThr
Energy threshold (in MeV) for ECL occupancy histogram.
void beginRun() override final
Module function beginRun.
TH1F * m_ARICH_Occupancy[2]
ARICH Digit Occupancy.
double m_BKLMTimeMin
Min time for BKLM time.
StoreArray< ARICHHit > m_ARICHHits
ARICH hits.
KLMTime * m_klmTime
KLM Time conversion.
TProfile * m_ECL_Occupancy[2]
ECL occupancy (hits above 5 MeV)
StoreArray< TOPDigit > m_topDigits
collection of TOP digits
StoreArray< ECLCalDigit > m_eclCalDigits
collection of ECL digits
TH2F * m_BKLM_Plane_Occupancy[2]
BKLM plane integrated occupancy.
int planeNumber(int section, int layer, int sector, int plane) const
Get plane number.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
KLM digit (class representing a digitized hit in RPCs or scintillators).
double getCTimePeriod() const
Get CTIME period.
void updateConstants()
Update constants from database objects.
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...
ETimingType
types of trigger timing source defined in b2tt firmware
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.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.