Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a55239e
adding new charge digitization for varying sensor thicknesses and MS …
Sep 12, 2025
8107ee0
ms update
Sep 23, 2025
7cecaf8
timing resolution update
Oct 29, 2025
da8f722
updating timing resolution + MS
Dec 2, 2025
e320775
Final MS update
Jan 28, 2026
a259b5e
MS update for 5 micron slices
Mar 5, 2026
21a549e
Multiple Scattering Implementation + Realistic Timing Implementation …
Mar 11, 2026
594d788
Updated TimeSmearer to allow parameter changes for realistic timing d…
Mar 24, 2026
d1391ef
Cleaning up commented out lines and debug statements
Aug 20, 2026
41e2a14
Fixing pointer-related seg faults at the end, removing unused variables
Aug 20, 2026
33fcade
Memory-related fixes
Aug 21, 2026
fc6bb38
Removing optional timing resolution parameters to be provided by user…
Aug 21, 2026
dd081a8
Merge pull request #2 from spg-berkeleylab/jules_mcUpdate
spagangriso Aug 21, 2026
fe250ba
Removing compiler-directive ZSEGMENTED instead adding user configurab…
Aug 21, 2026
432b921
Following convention for new variables name, adding them to documenta…
Aug 21, 2026
48c8ac0
fix unit conversion
madbaron Sep 1, 2026
c08a0be
guard hit debug and fix abs/atan
madbaron Sep 1, 2026
3cb63dd
avoid double>float roundtrips, fix sentinel
madbaron Sep 1, 2026
32a4b3f
Unify naming to MuonCVXDRealDigitiser
madbaron Sep 1, 2026
243ee62
indentation and cleanup
madbaron Sep 1, 2026
1c3cf6d
get rid of c
madbaron Sep 1, 2026
e6d5eac
default init dettypes
madbaron Sep 1, 2026
43678ea
match init order to decl order
madbaron Sep 1, 2026
896ba25
make zsegmented tri-state defaulting to geo behaviour
madbaron Sep 1, 2026
8ad7347
add selector for timesmearingmodel
madbaron Sep 1, 2026
4abe0e1
derive barrel/vertex flags from SubDetectorName
madbaron Sep 1, 2026
d9f886b
select digi bins by sensor thickness
madbaron Sep 1, 2026
d9f3ee4
use randgauss to ensure reproducibility
madbaron Sep 1, 2026
a53470b
use mcpart q instead of 1
madbaron Sep 1, 2026
45ec86c
make slice thickness configurable
madbaron Sep 1, 2026
fd0c504
take local direction instead of MC vertex
madbaron Sep 1, 2026
48a225c
build ionisation trail from G4 path length
madbaron Sep 1, 2026
44772ab
anchor mean edep to G4
madbaron Sep 1, 2026
31bb9e2
gating re-sim path
madbaron Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SET( ${PROJECT_NAME}_VERSION_PATCH 0 )

set(PACKAGE_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(PACKAGE_INSTALL_INC_DIR include CACHE PATH "Installation directory for headers")
option(ZSEGMENTED "Sensitives are segmented along z" ON)

### DEPENDENCIES ############################################################

Expand Down Expand Up @@ -66,10 +65,6 @@ ENDIF()

# definitions to pass to the compiler
ADD_DEFINITIONS( "-Wno-long-long -Wno-effc++ -Wno-unused-parameter -Wno-narrowing" )
if( ZSEGMENTED )
message ( STATUS "Enabled sensor segmentation" )
add_compile_definitions( "ZSEGMENTED" )
endif()

# include directories
INCLUDE_DIRECTORIES( ./include )
Expand Down
6 changes: 5 additions & 1 deletion include/DetElemSlidingWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class DetElemSlidingWindow
double electronicNoise,
double maxTrkLen,
double maxEnergyDelta,
const SurfaceMap* s_map);
const SurfaceMap* s_map,
bool zSegmented,
bool isBarrel);
virtual ~DetElemSlidingWindow();
bool active();
int process();
Expand Down Expand Up @@ -75,6 +77,8 @@ class DetElemSlidingWindow
const SurfaceMap* surf_map;
CellIDDecoder<SimTrackerHit> cell_decoder;
G4UniversalFluctuation* _fluctuate;
bool _zSegmented;
bool _isBarrel;
};


Expand Down
34 changes: 30 additions & 4 deletions include/MuonCVXDDigitiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ typedef std::vector<SignalPoint> SignalPointVec;
* (default parameter value : 100) <br>
* @param MaxTrackLength Maximum values for track path length inside the ladder (in mm)", <br>
* (default parameter value : 10) <br>
* @param DoMultipleScattering Flag to enable multiple scattering of the track inside the sensor <br>
* (default parameter value : 0) <br>
* @param ZSegmented flag to enable Z-segmentation for barrel layers <br>
* (default parameter value : false) <br>
* @param SigmaLandau override for Landau sigma <br>
* (default parameter value : -1) <br>
* @param SigmaTimewalk override for timewalk sigma <br>
* (default parameter value : -1) <br>
* @param SigmaJitter override for jitter sigma <br>
* (default parameter value : -1) <br>
* @param SigmaTDC override for TDC sigma <br>
* (default parameter value : -1) <br>
* @param SigmaClock override for clock sigma <br>
* (default parameter value : -1) <br>
* @param TRise override for rise time <br>
* (default parameter value : -1) <br>
* @param LayerIDs list of layer IDs to process <br>
* (default parameter value : empty) <br>
* <br>
*/
class MuonCVXDDigitiser : public Processor
Expand All @@ -104,6 +122,7 @@ class MuonCVXDDigitiser : public Processor
virtual Processor* newProcessor() { return new MuonCVXDDigitiser ; }

MuonCVXDDigitiser();
~MuonCVXDDigitiser();

/** Called at the begin of the job before anything is read.
* Use to initialize the processor, e.g. book histograms.
Expand Down Expand Up @@ -168,19 +187,25 @@ class MuonCVXDDigitiser : public Processor
double _timeSmearingSigma;
int _electronicEffects;
int _produceFullPattern;
int _doMultipleScattering;
std::vector<int> _layerIDs;

MyG4UniversalFluctuationForSi *_fluctuate;

// time digitization overrides
double _t_riseOverride;
double _sigma_landauOverride;
double _sigma_timewalkOverride;
double _sigma_jitterOverride;
double _sigma_TDCOverride;
double _sigma_clockOverride;

// charge discretization
std::vector<double> _DigitizedBins{};

// geometry
int _numberOfLayers;
std::vector<int> _laddersInLayer{};
#ifdef ZSEGMENTED
bool _zSegmented;
std::vector<int> _sensorsPerLadder{};
#endif
std::vector<float> _layerRadius{};
std::vector<float> _layerThickness{};
std::vector<float> _layerHalfThickness{};
Expand Down Expand Up @@ -211,6 +236,7 @@ class MuonCVXDDigitiser : public Processor
double _currentExitPoint[3];
IonisationPointVec _ionisationPoints;
SignalPointVec _signalPoints;
MyG4UniversalFluctuationForSi *_fluctuate;

/* Charge digitization helpers */
void ProduceIonisationPoints(SimTrackerHit *hit);
Expand Down
2 changes: 2 additions & 0 deletions include/MuonCVXDRealDigitiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ class MuonCVXDRealDigitiser : public Processor
int _electronicEffects;
int _produceFullPattern;
int sensor_type;
bool _zSegmented;
bool _isBarrel;

// geometry
int _numberOfLayers;
Expand Down
10 changes: 7 additions & 3 deletions src/DetElemSlidingWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ DetElemSlidingWindow::DetElemSlidingWindow(HitTemporalIndexes& htable,
double electronicNoise,
double maxTrkLen,
double maxEnergyDelta,
const SurfaceMap* s_map):
const SurfaceMap* s_map,
bool zSegmented,
bool isBarrel):
curr_time(starttime + wsize / 2), // window centered in the middle
time_click(wsize),
_htable(htable),
Expand All @@ -58,6 +60,8 @@ DetElemSlidingWindow::DetElemSlidingWindow(HitTemporalIndexes& htable,
_deltaEne(maxEnergyDelta),
signals(),
surf_map(s_map),
_zSegmented(zSegmented),
_isBarrel(isBarrel),
cell_decoder(sensor.GetCellIDFormatStr())
{
_fluctuate = new G4UniversalFluctuation();
Expand Down Expand Up @@ -231,14 +235,14 @@ void DetElemSlidingWindow::StoreSignalPoints(SimTrackerHit* hit)
// Store local position in mm
pos[0] = lv[0] / dd4hep::mm;
pos[1] = lv[1] / dd4hep::mm;
#ifdef ZSEGMENTED
if (_isBarrel && _zSegmented) {
// See MuonCVXDDigitiser::processEvent
int segment_id = cell_decoder(hit)["sensor"];

float s_offset = _sensor.GetSensorCols() * _sensor.GetPixelSizeY() * (float(segment_id) + 0.5);
s_offset -= _sensor.GetHalfLength();
pos[1] += s_offset;
#endif
}

// Add also z ccordinate
Vector3D origin( surf->origin()[0], surf->origin()[1], surf->origin()[2]);
Expand Down
Loading