9#include "reconstruction/modules/detectorOccupanciesDQM/DetectorOccupanciesDQMModule.h"
13#include <framework/dataobjects/EventMetaData.h>
14#include <ecl/dataobjects/ECLCalDigit.h>
15#include <ecl/dataobjects/ECLElementNumbers.h>
16#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
17#include <klm/dataobjects/KLMDigit.h>
18#include <arich/dataobjects/ARICHHit.h>
19#include <top/dataobjects/TOPDigit.h>
21#include <TDirectory.h>
43 std::string(
"DetectorOccupancies"));
46 "Min time for BKLM time histogram.",
double(-6500));
48 "Max time for BKLM time histogram.",
double(5000));
50 "Min time for EKLM time histogram.",
double(-5100));
52 "Max time for EKLM time histogram.",
double(-4500));
54 "Offset to center BKLM Scint. times at 0",
double(-4705.));
56 "Offset to center BKLM RPC times at 0",
double(-4300.5));
61DetectorOccupanciesDQMModule::~DetectorOccupanciesDQMModule()
73 TDirectory* oldDir = gDirectory;
81 const std::string tag[2] = {
"OUT",
"IN"};
82 const std::string title[2] = {
"[Outside Active Veto Window]",
"[Inside Active Veto Window]"};
87 std::string histoName =
"bklm_plane_occupancy";
88 std::string histoTitle =
"BKLM plane occupancy";
90 (histoTitle +
" " + title[0]).c_str(),
105 histoName =
"bklm_plane_trg_occupancy";
106 histoTitle =
"BKLM plane occupancy (w/ trgs)";
108 (histoTitle +
" " + title[0]).c_str(),
122 histoName =
"eklm_plane_occupancy";
123 histoTitle =
"EKLM plane occupancy";
125 (histoTitle +
" " + title[0]).c_str(),
138 histoName =
"eklm_plane_trg_occupancy";
139 histoTitle =
"EKLM plane occupancy (w/ trgs)";
141 (histoTitle +
" " + title[0]).c_str(),
156 histoName =
"arich_occupancy";
157 histoTitle =
"ARICH Occupancy";
159 (histoTitle +
" " + title[0]).c_str(),
169 histoName =
"top_occupancy";
170 histoTitle =
"TOP Occupancy for good hits";
171 for (
int i = 0; i < 2; i++) {
173 (histoTitle +
" " + title[i]).c_str(),
180 histoName =
"ecl_occupancy";
181 histoTitle =
"ECL occupancy (for hits with E > " + std::to_string((
int)
m_eclEnergyThr) +
" MeV)";
182 for (
int i = 0; i < 2; i++) {
184 (histoTitle +
" " + title[i]).c_str(),
212 for (
int i = 0; i < 2; i++) {
249 }
catch (
const std::exception&) {
253 bool backBooleanFlag = std::any_of(
257 return trg->getTimType() == trgBit;
271 int section = digit.getSection();
272 int layer = digit.getLayer();
273 int sector = digit.getSector();
274 int plane = digit.getPlane();
279 int section = digit.getSection();
280 int layer = digit.getLayer();
281 int sector = digit.getSector();
283 section, sector, layer);
285 float rawTime = (digit.inRPC()) ? digit.getRevo9DCArrivalTime() *
m_klmTime->getCTimePeriod() : digit.getTime();
286 float time = rawTime - offset;
288 bool goodHit = (rawTime > -11000 && rawTime < 0);
304 if (digit.getHitQuality() != TOPDigit::c_Junk) topGoodHits++;
310 std::bitset<ECLElementNumbers::c_NCrystals> crystal_hit;
314 if (digit.getEnergy() > thresholdGeV)
315 crystal_hit.set(digit.getCellId() - 1);
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.
HistoModule()
Constructor.
KLM digit (class representing a digitized hit in RPCs or scintillators).
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.