9#define TRGECLBGTCHit_SHORT_NAMES
12#include <framework/logging/Logger.h>
15#include "trg/ecl/modules/trgeclBGOverlay/TRGECLBGTCHitModule.h"
36 return string(
"TRGECLBGTCHitModule 1.00");
48 string desc =
"TRGECLBGTCHitModule(" +
version() +
")";
54 "TC energy cut: TC(E)<X (GeV), X=",
58 "TC Timing cut low: TC(T)>X (ns), X=",
62 "TC Timing cut high: TC(T)<X (ns), X=",
71 B2DEBUG(100,
"TRGECLBGTCHitModule ... created");
78 B2DEBUG(100,
"TRGECLBGTCHitModule ... destructed ");
86 B2DEBUG(100,
"TRGECLBGTCHitModule::initialize>");
88 B2INFO(
"[TRGECLBGTCHitModule] TCEnergyCut : TC(E) GeV = "
90 B2INFO(
"[TRGECLBGTCHitModule] TCTimingCutLow : TC(T) ns = "
92 B2INFO(
"[TRGECLBGTCHitModule] TCTimingCutHigh : TC(T) ns = "
105 B2DEBUG(200,
"TRGECLBGTCHitModule ... beginRun called ");
113 B2DEBUG(200,
"TRGECLBGTCHitMoudle ... event called");
127 B2DEBUG(200,
"TRGECLBGTCHitModule ... endRun called ");
135 B2DEBUG(100,
"TRGECLBGTCHitModule ... terminate called ");
144 struct hit_t {
double e, t; };
148 double txtal = t.getTimeAve();
150 if (txtal >= 8000.0 || txtal < -8000.0)
continue;
151 double edep = t.getEnergyDep();
152 int TimeIndex = (txtal + 8000.0) * (1. / 100);
153 int cellId = t.getCellId() - 1;
154 int iTCIdm =
m_TCMap->getTCIdFromXtalId(cellId + 1) - 1;
156 int key = iTCIdm * 160 + TimeIndex;
158 double old_edep = h.e, old_txtal = h.t;
159 double new_edep = old_edep + edep;
161 h.t = (old_edep * old_txtal + edep * txtal) / new_edep;
164 for (pair<int, hit_t> t : a) {
166 int tcid = key / 160;
167 const hit_t& h = t.second;
185 int tcID = ttt.getTCId();
187 double tcEnergyADC = (double) ttt.getTCEnergy();
189 double tcTime = (double) ttt.getTCTime();
190 if (tcID <= 0) {
continue;}
192 double adc2energy = 5.231;
194 double tcEnergy = tcEnergyADC * (adc2energy / 1000);
Class to store simulated hits which equate to average of ECLSImHit on crystals input for digitization...
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...
double m_TCTimingCutHigh
TC timing cut (ns) for high timing.
int m_debugLevel
Debug level.
double m_TCTimingCutLow
TC timing cut (ns) for lower timing.
StoreArray< TRGECLUnpackerStore > m_trgeclUnpackerStores
ecl trigger ETM dataobject
StoreArray< TRGECLBGTCHit > m_trgeclBGTCHits
ecl trigger BG TC dataobject
double m_TCEnergyCut
TC energy cut (GeV)
StoreArray< ECLHit > m_eclHits
ECL data object.
TrgEclMapping * m_TCMap
hardware configuration
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.
virtual void initialize() override
Initializes TRGECLBGTCHitModule.
virtual void event() override
Called event by event.
virtual void endRun() override
Called when run ended.
TRGECLBGTCHitModule()
Constructor.
virtual void terminate() override
Called when processing ended.
void genRandomTrgObj()
generate random trigger data TCHit data objection
void genSimulationObj()
Parameters.
virtual void beginRun() override
Called when new run started.
virtual ~TRGECLBGTCHitModule()
Destructor.
std::string version(void) const
returns version of TRGECLBGTCHitModule.
Abstract base class for different kinds of events.