Commit ef5416cb authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'charge-creation-fix' into 'master'

Fix type conversion for deposits causing peak shifts (GH PR 43)

See merge request allpix-squared/allpix-squared!982
parents 67b5f68b 89cdbfc1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ The following authors, in alphabetical order, have developed or contributed to A
* Thomas Billoud, Université de Montréal, [tbilloud](https://gitlab.cern.ch/tbilloud)
* Tobias Bisanz, CERN, [tbisanz](https://gitlab.cern.ch/tbisanz)
* Bogdan-Mihail Blidaru, Heidelberg University, [mblidaru](https://gitlab.cern.ch/mblidaru)
* Sebbe Blokhuizen, Stockholm University, Sioux Technologies, [SBlokhuizen](https://github.com/SBlokhuizen)
* Marco Bomben, Université de Paris, [mbomben](https://gitlab.cern.ch/mbomben)
* Koen van den Brandt, Nikhef, [kvandenb](https://gitlab.cern.ch/kvandenb)
* Ben Bruers, DESY, [bbrueers](https://gitlab.cern.ch/bbrueers)
+1 −1
Original line number Diff line number Diff line
@@ -35,4 +35,4 @@ propagate_holes = true
log_level = DEBUG
threshold = 600e

#PASS (Event 20) [R:DefaultDigitizer:mydetector] Passed threshold: 35408.8e > 631.069e
#PASS (Event 20) [R:DefaultDigitizer:mydetector] Passed threshold: 35516.9e > 560.183e
+1 −2
Original line number Diff line number Diff line
@@ -38,5 +38,4 @@ threshold = 600e
[ROOTObjectWriter]
log_level = DEBUG


#PASS (STATUS) [F:ROOTObjectWriter] Wrote 45400 objects to 8 branches in file
#PASS (STATUS) [F:ROOTObjectWriter] Wrote 46070 objects to 8 branches in file
+1 −1
Original line number Diff line number Diff line
@@ -36,4 +36,4 @@ propagate_holes = true
log_level = DEBUG
threshold = 600e

#PASS (DEBUG) (Event 20) [R:DefaultDigitizer:mydetector] Passed threshold: 35408.8e > 631.069e
#PASS (DEBUG) (Event 20) [R:DefaultDigitizer:mydetector] Passed threshold: 35516.9e > 560.183e
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ G4bool SensitiveDetectorActionG4::ProcessHits(G4Step* step, G4TouchableHistory*)
    // excitations via the Fano factor. We assume Gaussian statistics here.
    auto mean_charge = edep / charge_creation_energy_;
    allpix::normal_distribution<double> charge_fluctuation(mean_charge, std::sqrt(mean_charge * fano_factor_));
    auto charge = static_cast<unsigned int>(std::max(charge_fluctuation(random_generator_), 0.));
    auto charge = static_cast<unsigned int>(std::max(charge_fluctuation(random_generator_), 0.) + 0.5);

    const auto* userTrackInfo = dynamic_cast<TrackInfoG4*>(track->GetUserInformation());
    if(userTrackInfo == nullptr) {
Loading