10#include <ecl/modules/eclHitDebug/ECLHitDebugModule.h>
13#include <ecl/dataobjects/ECLDebugHit.h>
14#include <ecl/dataobjects/ECLElementNumbers.h>
15#include <ecl/dataobjects/ECLSimHit.h>
16#include <ecl/geometry/ECLGeometryPar.h>
19#include <framework/gearbox/Unit.h>
22#include <Math/Vector3D.h>
71 int const interval = 8000 / Nbin;
80 for (
int iHits = 0; iHits <
m_eclSimArray.getEntries(); iHits++) {
85 int hitCellId = aECLSimHit->
getCellId() - 1;
88 G4ThreeVector t = aECLSimHit->
getPosIn();
89 ROOT::Math::XYZVector HitInPos(t.x(), t.y(), t.z());
91 const ROOT::Math::XYZVector& PosCell = eclp->
GetCrystalPos(hitCellId);
92 const ROOT::Math::XYZVector& VecCell = eclp->
GetCrystalVec(hitCellId);
93 double local_pos = (15. - (HitInPos - PosCell).Dot(VecCell));
95 int iECLCell = hitCellId;
97 int TimeIndex = (int) hitTOF / interval;
98 E_cell[iECLCell][TimeIndex] = E_cell[iECLCell][TimeIndex] + hitE;
99 Tof_ave[iECLCell][TimeIndex] += (6.05 + 0.0749 * local_pos - 0.00112 * local_pos * local_pos + hitTOF) * hitE ;
106 for (
int TimeIndex = 0; TimeIndex < Nbin; TimeIndex++) {
108 if (E_cell[iECLCell][TimeIndex] > 0) {
StoreArray< ECLDebugHit > m_eclDebugHits
ECLDebugHit datastore object.
virtual void initialize() override
Initialize variables, print info, and start CPU clock.
ECLHitDebugModule()
Constructor.
StoreArray< ECLSimHit > m_eclSimArray
StoreArray ECLSimHit.
int m_hitNum
The current number of created hits in an event.
virtual void event() override
Actual digitization of all hits in the ECL.
virtual void endRun() override
Nothing so far.
virtual void terminate() override
Stopping of CPU clock.
int m_nEvent
Event number.
virtual void beginRun() override
Nothing so far.
virtual ~ECLHitDebugModule()
Destructor.
ClassECLSimHit - Geant4 simulated hit for the ECL.
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
G4ThreeVector getPosIn() const
Get Position.
The Class for ECL Geometry Parameters.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
ROOT::Math::XYZVector GetCrystalPos(int cid)
The Position of crystal.
ROOT::Math::XYZVector GetCrystalVec(int cid)
The direction of crystal.
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...
static const double us
[microsecond]
static const double ns
Standard of [time].
static const double GeV
Standard of [energy, momentum, mass].
#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.