11#include <framework/core/Module.h>
12#include <pxd/dataobjects/PXDSimHit.h>
13#include <pxd/dataobjects/PXDInjectionBGTiming.h>
14#include <pxd/geometry/SensorInfo.h>
15#include <framework/dataobjects/RelationElement.h>
16#include <framework/datastore/StoreObjPtr.h>
34 bool operator<(
const Digit& b)
const {
return v() < b.v() || (
v() == b.v() &&
u() < b.u()); }
38 unsigned short u()
const {
return m_u; }
40 unsigned short v()
const {
return m_v; }
52 typedef std::map<RelationElement::index_type, RelationElement::weight_type>
relations_map;
60 void add(
double charge,
int particle = -1,
int truehit = -1)
82 typedef std::map<Digit, DigitValue>
Sensor;
106 void driftCharge(
const ROOT::Math::XYZVector& position,
double electrons);
124 void event()
override final;
Class PXDSimHit - Geant4 simulated hit for the PXD.
Class representing the charge and particle contributions for one pixel.
relations_map m_truehits
truehit contributions to the charge
const relations_map & truehits() const
Return the map containing all truehit contributions to the pixel charge.
relations_map m_particles
particle contributions to the charge
void add(double charge, int particle=-1, int truehit=-1)
Add charge to the pixel.
const relations_map & particles() const
Return the map containing all particle contributions to the pixel charge.
double m_charge
charge of the pixel
double charge() const
Return the charge collected in the pixel.
std::map< RelationElement::index_type, RelationElement::weight_type > relations_map
Type to store contributions to pixel charge by different particles.
Class to represent the coordinates of one pixel.
bool operator<(const Digit &b) const
Comparison operator to provide unique ordering.
bool operator==(const Digit &b) const
Equality operator to check for equality.
unsigned short v() const
Return v (row) ID.
Digit(unsigned short u=0, unsigned short v=0)
Constructor.
unsigned short m_u
u (column) ID
unsigned short u() const
Return u (column) ID.
unsigned short m_v
v (row) ID
The PXD Digitizer module.
double m_pedestalRMS
RMS pedestal in ADU.
void processHit()
Process one PXDSimHit by dividing the step in smaller steps and drifting the charge.
double m_pxdIntegrationTime
Integration time for each gate of the PXD in ns.
double m_pedestalMean
Mean pedestal in ADU.
bool m_gatingWithoutReadout
Digits from gated rows not sent to DHH.
void initialize() override final
Initialize the module and check the parameters.
std::string m_relTrueHitSimHitName
Name of the relation between PXDTrueHits and PXDSimHits.
void saveDigits()
Save all digits to the datastore.
int m_currentParticle
Index of the particle which caused the current hit.
double m_ADCUnit
Slope of the linear ADC transfer curve in nA/ADU.
Sensors m_sensors
Structure containing all existing sensors.
double m_elStepTime
Timeframe for one random walk step.
std::string m_relDigitMCParticleName
Name of the relation between PXDDigits and MCParticles.
PXDDigitizerModule()
Constructor.
int m_triggerGate
PXD triggergate.
int m_elMaxSteps
Maximum number of random walks before abort.
bool m_applyWindow
Wether or not to apply a time window cut.
std::string m_storeTrueHitsName
Name of the collection for the PXDTrueHits.
double m_timePerGate
Time needed to sample and clear a readout gate
double m_gatingWithoutReadoutTime
Time window during which digits from gated rows are not sent to DHH.
void driftCharge(const ROOT::Math::XYZVector &position, double electrons)
Drift the charge inside the silicon.
const PXDSimHit * m_currentHit
Pointer to the PXDSimhit currently digitized.
std::vector< float > m_gatingStartTimes
Vector of start times for gating.
std::string m_storeMCParticlesName
Name of the collection for the MCParticles.
double m_noiseFraction
Fraction of noisy pixels per sensor.
bool m_applyNoise
Wether or not to apply noise.
void addNoiseDigits()
Add pure noise digits to the Sensors.
void event() override final
Digitize one event.
int m_nGates
Number of readout gates (or total number of Switcher channels)
double m_chargeThreshold
Zero-suppression threshold in ADU.
bool m_applyPoisson
Wether or not to apply poission fluctuation of charge.
Sensor * m_currentSensor
Pointer to the sensor in which the current hit occured.
double m_chargeThresholdElectrons
... and its equivalent in electrons
std::vector< std::pair< int, int > > m_gatedChannelIntervals
Vector of gated readout channels
ROOT::Math::XYZVector m_currentBField
Current magnetic field.
double m_elNoise
Amount of noise to apply.
std::string m_storeDigitsName
Name of the collection for the PXDDigits.
const SensorInfo * m_currentSensorInfo
Pointer to the SensorInfo of the current sensor.
std::string m_relDigitTrueHitName
Name of the relation between PXDDigits and PXDTrueHits.
double m_gatingTime
Time window during which the PXD is not collecting charge.
void beginRun() override final
Initialize the list of existing PXD Sensors.
double m_eToADU
ENC equivalent of 1 ADU.
bool checkIfGated(int gate)
Check if gate was read while in gated mode.
double m_gq
g_q of a pixel in nA/electrons.
StoreObjPtr< PXDInjectionBGTiming > m_storePXDTiming
Input array for timings.
double m_hwdelay
Hardware delay between time of bunch crossing and switching on triggergate in ns.
int m_elGroupSize
Max number of electrons per random walk.
bool m_gated
Gated mode flag.
int m_currentTrueHit
Index of the TrueHit the current hit belongs to.
std::string m_relMCParticleSimHitName
Name of the relation between MCParticles and PXDSimHits.
double addNoise(double charge)
Calculate the noise contribution to one pixel with given charge.
double m_segmentLength
Max.
std::string m_storeSimHitsName
Name of the collection for the PXDSimhits.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
Type-safe access to single objects in the data store.
std::map< Digit, DigitValue > Sensor
Map of all hits in one Sensor.
std::map< VxdID, Sensor > Sensors
Map of all hits in all Sensors.
Abstract base class for different kinds of events.