11 #include "G4SDManager.hh"
14 #include "G4VProcess.hh"
22 #include "G4StepPoint.hh"
26 : theDebugLevel(theConf.getUntrackedParameter<int>(
"DebugLevel", 0)),
27 theEnergyLossScalingFactor(theConf.getUntrackedParameter<double>(
"EnergyLossScalingFactor", 1.0)),
28 theMPDebug(theConf.getUntrackedParameter<int>(
"MaterialPropertiesDebugLevel", 0)),
29 theSiAbsLengthScale(theConf.getUntrackedParameter<double>(
"SiAbsorptionLengthScalingFactor", 1.0)),
31 theMaterialProperties(),
32 thePrimaryGenerator(),
36 theParameterSet(theConf) {
39 <<
" ***** AC1CMS: Configuration from ParameterSet ***** "
42 <<
"\n AC1CMS: theMPDebugLevel = " <<
theMPDebug
65 LogDebug(
"SimLaserAlignmentSimulation")
66 <<
"<LaserAlignmentSimulation::update(const BeginOfRun * myRun)>"
67 <<
"\n ***** AC1CMS: Start of Run: " << (*myRun)()->GetRunID() <<
" ***** ";
85 G4SDManager *theSDManager = G4SDManager::GetSDMpointer();
86 theSDManager->ListTree();
91 LogDebug(
"SimLaserAlignmentSimulation") <<
"<LaserAlignmentSimulation::update(const BeginOfEvent * myEvent)>"
92 <<
"\n AC1CMS: Event number = " << (*myEvent)()->GetEventID();
105 LogDebug(
"SimLaserAlignmentSimulationStepping") <<
"<LaserAlignmentSimulation::update(const G4Step * myStep)>";
107 G4Step *theStep =
const_cast<G4Step *
>(myStep);
113 if ((theStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() ==
"OpAbsorption")) {
114 LogDebug(
"SimLaserAlignmentSimulationStepping") <<
"<LaserAlignmentSimulation::update(const G4Step*)>: Photon was "
117 if (theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector()) {
118 LogDebug(
"SimLaserAlignmentSimulationStepping")
119 <<
" AC1CMS: Setting the EnergyLoss to " << theStep->GetTotalEnergyDeposit()
120 <<
"\n AC1CMS: The z position is " << theStep->GetPreStepPoint()->GetPosition().z()
121 <<
"\n AC1CMS: the Sensitive Detector: "
122 << theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector()->GetName()
123 <<
"\n AC1CMS: the Material: " << theStep->GetPreStepPoint()->GetMaterial()->GetName()
124 <<
"\n AC1CMS: the Logical Volume: "
125 << theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName();
127 if (theStep->GetTotalEnergyDeposit() > 0.0) {
131 *)(theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector());
133 theSD->
ProcessHits(theStep, ((G4TouchableHistory *)(theStep->GetPreStepPoint()->GetTouchable())));
136 if ((theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() ==
137 "TECModule3RphiActive") ||
138 (theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() ==
139 "TECModule5RphiActive")) {
141 }
else if ((theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() ==
143 (theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() ==
145 (theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() ==
151 LogDebug(
"SimLaserAlignmentSimulationStepping")
152 <<
" AC1CMS: No SensitiveDetector available for this Step ... No Hit "
154 <<
"\n AC1CMS: The Material was: " << theStep->GetPreStepPoint()->GetMaterial()->GetName();
162 LogDebug(
"SimLaserAlignmentSimulation") <<
"<LaserAlignmentSimulation::update(const EndOfEvent * myEvent)>"
163 <<
"\n AC1CMS: End of Event " << (*myEvent)()->GetEventID();
171 LogDebug(
"SimLaserAlignmentSimulation") <<
"<LaserAlignmentSimulation::update(const EndOfRun * myRun)>";
176 <<
" AC1CMS: Number of Events = " << (*myRun)()->GetNumberOfEventToBeProcessed() <<
" " << *
theTimer
177 <<
" ***** AC1CMS: End of Run: " << (*myRun)()->GetRunID() <<
" ***** ";
#define DEFINE_SIMWATCHER(type)
double theSiAbsLengthScale
bool ProcessHits(G4Step *, G4TouchableHistory *) override
double theEnergyLossScalingFactor
~LaserAlignmentSimulation() override
destructor
void GeneratePrimaries(G4Event *myEvent) override
Log< level::Info, false > LogInfo
LaserAlignmentSimulation(edm::ParameterSet const &theConf)
constructor
LaserPrimaryGeneratorAction * thePrimaryGenerator
MaterialProperties * theMaterialProperties
LaserSteppingAction * theSteppingAction
edm::ParameterSet theParameterSet
void UserSteppingAction(const G4Step *myStep) override
void update(const BeginOfRun *myRun) override
observer for BeginOfRun