Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions CaloMC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
cet_make_library(
SOURCE
src/CaloNoiseSimGenerator.cc
src/CaloPhotonPropagation.cc
src/CaloWFExtractor.cc
src/ShowerStepUtil.cc
src/CaloDigiWrapper.cc
src/CaloDigiWrapperCollection.cc
LIBRARIES PUBLIC

Offline::ConfigTools
Offline::CalorimeterGeom
Offline::GeometryService
Offline::Mu2eUtilities
Expand Down
43 changes: 7 additions & 36 deletions CaloMC/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,20 @@

BEGIN_PROLOG

CaloMC : {

#See doc-db 35519 for noise level discussion
NoiseGenerator :
{
noiseWFSize : 10000
pulseFileName : @local::pulseFileName
pulseHistName : @local::pulseHistName
elecNphotPerNs : 0.18
rinNphotPerNs : 0.25
darkNphotPerNs : 0.00
# Run2 values
# rinNphotPerNs : 0.36
# darkNphotPerNs : 0.60
digiSampling : @local::HitMakerDigiSampling
nMaxFragment : 1000
minPeakADC : @local::HitMakerMinPeakADC
readoutPEPerMeV : 30
MeVToADC : 16
diagLevel : 0
}
}

CaloMC : {

CaloMC : { @table::CaloMC
CaloShowerStepMaker :
{
module_type : CaloShowerStepMaker
numZSlices : 20
deltaTime : 0.2
caloStepPointCollection : ["g4run:calorimeter"]
physVolInfoInput : "g4run"
caloMaterial : ["G4_CESIUM_IODIDE", "Polyethylene092","CarbonFiber"]
compressData : true
eDepThreshold : 0
diagLevel : 0
}


CaloShowerROMaker :
{
module_type : CaloShowerROMaker
Expand All @@ -70,19 +45,16 @@ CaloMC : { @table::CaloMC
caloShowerROCollection : CaloShowerROMaker
eventWindowMarker : EWMProducer
protonBunchTimeMC : EWMProducer
pulseFileName : @local::pulseFileName
pulseHistName : @local::pulseHistName
pulseCache : @local::CaloPulseCache
noiseCache : @local::CaloNoiseCache
addNoise : true
digitizationStart : @local::HitMakerDigitizationStart
digitizationEnd : @local::HitMakerDigitizationEnd
addNoise : true
addRandomNoise : false
NoiseGenerator : { @table::CaloMC.NoiseGenerator }
digiSampling : @local::HitMakerDigiSampling
bufferDigi : 16
nBits : 12
minPeakADC : @local::HitMakerMinPeakADC
minNoiseAmp : 2
nBinsPeak : 2
bufferDigi : 16
minNoiseAmplitude : 2
diagLevel : 0
}

Expand All @@ -92,8 +64,7 @@ CaloMC : { @table::CaloMC
caloShowerSimCollection : CaloShowerROMaker
caloHitCollection : CaloHitMaker
primaryParticle : FindMCPrimary
pulseFileName : @local::pulseFileName
pulseHistName : @local::pulseHistName
pulseCache : @local::CaloPulseCache
digiSampling : @local::HitMakerDigiSampling
minAmplitude : 2
fillDetailedMC : false
Expand Down
82 changes: 0 additions & 82 deletions CaloMC/inc/CaloNoiseSimGenerator.hh

This file was deleted.

44 changes: 24 additions & 20 deletions CaloMC/inc/CaloPhotonPropagation.hh
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
#ifndef CaloPhotonPropagation_HH
#define CaloPhotonPropagation_HH

// Calculate the propagation time from the location in the crystal
// Input based on detail Geant4 simulation of crystal

#ifndef CaloMC_CaloPhotonPropagation_hh
#define CaloMC_CaloPhotonPropagation_hh
//
// Sample the scintillation-photon propagation time from a location in the crystal.
// The time distribution vs. depth is taken from a detailed Geant4 simulation, stored
// as a 2D histogram (z on X, propagation time on Y) and turned into a per-depth CDF.
//
#include "CLHEP/Random/RandomEngine.h"
#include "CLHEP/Random/RandFlat.h"

#include <string>
#include <vector>

namespace mu2e {

class CaloPhotonPropagation
{
public:
CaloPhotonPropagation(const std::string& fileName, const std::string& histName, CLHEP::HepRandomEngine& engine);
CaloPhotonPropagation(const std::string& fileName, const std::string& histName,
CLHEP::HepRandomEngine& engine);

void buildTable ();
float propTimeSimu(float z);
float propTimeLine(float z);
void buildTable();
float propTimeSimu(float z); // sampled from the CDF (consumes a random number)
float propTimeLine(float z) const; // straight-line n*z/c estimate

private:
std::vector<float> timeProp_;
std::vector<float> cdf_;
unsigned nTimeDiv_;
unsigned nZDiv_;
float dzTime_;
CLHEP::RandFlat randFlat_;
std::string fileName_;
std::string histName_;
float lightSpeed_;
private:
std::vector<float> timeProp_; // Y-bin centers: candidate propagation times
std::vector<float> cdf_; // per-depth cumulative distribution, row-major [iz][itime]
unsigned nTimeDiv_{0}; // number of time bins (histogram Y)
unsigned nZDiv_{0}; // number of depth bins (histogram X)
float dz_{0.f}; // depth-bin width
CLHEP::RandFlat randFlat_;
std::string fileName_;
std::string histName_;
float lightSpeed_{300.f}; // mm/ns, overwritten with c/n in buildTable
};

}
Expand Down
28 changes: 0 additions & 28 deletions CaloMC/inc/CaloWFExtractor.hh

This file was deleted.

4 changes: 3 additions & 1 deletion CaloMC/inc/ShowerStepUtil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace mu2e {
imax_(imax),type_(type),n_(imax,0),eDepG4_(imax,0),eDepVis_(imax,0),
pIn_(imax,0),time_(imax,0),t0_(imax,0),x_(imax,0),y_(imax,0),z_(imax,0),
w_(imax,0),pos_(0,0,0)
{};
{}

void add(unsigned i, double eDepG4, double eDepVis, double time, double momentum, const CLHEP::Hep3Vector& pos);
void reset(unsigned i);
Expand All @@ -34,6 +34,8 @@ namespace mu2e {


private:
void rangeCheck(unsigned i) const;

unsigned imax_;
weight_type type_;
std::vector<unsigned> n_;
Expand Down
Loading