9#include <vxd/simulation/SensitiveDetectorDebugHelper.h>
10#include <framework/gearbox/Unit.h>
28 m_file =
new TFile(
"debug-vxdsensitivedetector.root",
"RECREATE");
29 m_tree =
new TTree(
"sensortraversal",
"Debug info for VXD Sensitive Detector implementation");
31#define ADDBRANCH__(name,var,type) m_tree->Branch(#name,&m_info.var,#type)
32#define ADDBARRAY__(name,var,n,type) ADDBRANCH__(name,var,name[n]/type)
33#define ADDBRANCH(x,type) ADDBRANCH__(x,x,x/type)
34#define ADDBARRAY(x,n,type) ADDBARRAY__(x,x,n,type)
36 ADDBRANCH(sensorID, I);
38 ADDBRANCH(contained, I);
39 ADDBRANCH(primary, I);
42 ADDBARRAY(stepInfo, stepN, D);
44 ADDBARRAY(trueInfo, trueN, D);
46 ADDBARRAY(edepInfo, edepN, D);
47 ADDBRANCH(simhitN, I);
48 ADDBARRAY(simhitInfo, simhitN, D);
Class to keep track of the traversal of the sensitive volume for one track.
int getPDGCode() const
get PDG code of the particle
bool isPrimary() const
return whether the track belongs to a primary particle
bool isContained() const
return whether the track was contained in the volume so far
double getLength() const
get flight length so far
static const double um
[micrometers]
Class VXDSimHit - Geant4 simulated hit for the VXD.
float getGlobalTime() const override
Return the time of the electron deposition.
ROOT::Math::XYZVector getPosOut() const
Return the end point of the electron deposition in local coordinates.
std::vector< std::pair< float, float > > getElectronsConstantDistance(double length) const
Get the electron deposition along constant stepsize.
std::vector< std::pair< float, float > > getElectronProfile() const
Get the decoded electron profile.
ROOT::Math::XYZVector getPosIn() const
Return the start point of the electron deposition in local coordinates.
std::vector< std::pair< float, float > > getElectronsConstantNumber(double electronsPerStep) const
Get the electron deposition with constant number of electrons between sampling points.
Class VXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
ROOT::Math::XYZVector getExitMomentum() const
Return momentum at the endpoint of the track.
float getV() const
Return local v coordinate of hit.
float getGlobalTime() const
Return the time when the track reached its midpoint.
float getEntryU() const
Return local u coordinate of hit when entering silicon.
float getEnergyDep() const
Return energy deposited during traversal of sensor.
float getExitW() const
Return local w coordinate of hit at the endpoint of the track.
float getEntryW() const
Return local w coordinate of the start point of the track.
float getW() const
Return local w coordinate of hit.
ROOT::Math::XYZVector getEntryMomentum() const
Return momentum at the start point of the track.
ROOT::Math::XYZVector getMomentum() const
Return momentum at the midpoint of the track.
float getU() const
Return local u coordinate of hit.
float getExitU() const
Return local u coordinate of hit at the endpoint of the track.
float getExitV() const
Return local v coordinate of hit at the endpoint of the track.
float getEntryV() const
Return local v coordinate of the start point of the track.
Small helper class to facilitate debugging of VXD::SensitiveDetector implementation.
static SensitiveDetectorDebugHelper & getInstance()
Singleton class: get instance.
TTree * m_tree
ROOT Tree to write information to.
void addSimHit(const VXDSimHit *simhit, int startPoint, int endPoint)
Write the information normally used when creating SimHits to the entry.
void startTraversal(VxdID sensorID, const SensorTraversal &traversal)
Start writing a new sensor traversal: Geant4 steps will be added to the ROOT entry.
struct Belle2::VXD::SensitiveDetectorDebugHelper::info m_info
object to store all variables
@ MAX_HITS
assume maximum number of simhits per sensor traversal
@ SIZE_TRUE
number of values per truehit
@ SIZE_STEP
number of values per step
@ SIZE_HITS
number of values per simhit
@ MAX_STEPS
assume maximum number of steps per sensor traversal
SensitiveDetectorDebugHelper()
Singleton class: private constructor.
void addTrueHit(const VXDTrueHit *truehit)
Write the information normally used when creating TrueHits to the entry.
TFile * m_file
ROOT File to write information to.
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.
double stepInfo[SIZE_STEP *MAX_STEPS]
values for the step points
int sensorID
id of the sensor for the current track
int pdg
pdg code for the current track
int trueN
number of values used in trueInfo
int primary
whether or not the track is from a primary particle
double trueInfo[SIZE_TRUE]
values for the truehit
int simhitN
number of values used in simhitInfo
double length
track length
int stepN
number of values used in stepInfo
double simhitInfo[SIZE_HITS *MAX_HITS]
values for the simhits
int contained
whether or not the track was contained in the senitive volume
double edepInfo[SIZE_EDEP *MAX_EDEP]
values for the energy deposition
int edepN
number of values used in edepInfo