#include <Alignment/LaserAlignmentSimulation/plugins/LaserAlignmentSimulation.h>
Public Member Functions | |
LaserAlignmentSimulation (edm::ParameterSet const &theConf) | |
constructor | |
void | update (const EndOfTrack *myTrack) |
observer for EndOfTrack | |
void | update (const BeginOfTrack *myTrack) |
observer for BeginOfTrack | |
void | update (const EndOfRun *myRun) |
observer for EndOfRun | |
void | update (const EndOfEvent *myEvent) |
observer for EndOfEvent | |
void | update (const G4Step *myStep) |
observer for G4Step | |
void | update (const BeginOfEvent *myEvent) |
observer for BeginOfEvent | |
void | update (const BeginOfRun *myRun) |
observer for BeginOfRun | |
virtual | ~LaserAlignmentSimulation () |
destructor | |
Private Attributes | |
int | theBarrelHits |
int | theDebugLevel |
int | theEndcapHits |
double | theEnergyLossScalingFactor |
MaterialProperties * | theMaterialProperties |
int | theMPDebug |
edm::ParameterSet | theParameterSet |
LaserPrimaryGeneratorAction * | thePrimaryGenerator |
double | theSiAbsLengthScale |
LaserSteppingAction * | theSteppingAction |
G4Timer * | theTimer |
Definition at line 42 of file LaserAlignmentSimulation.h.
LaserAlignmentSimulation::LaserAlignmentSimulation | ( | edm::ParameterSet const & | theConf | ) | [explicit] |
constructor
Definition at line 29 of file LaserAlignmentSimulation.cc.
References theDebugLevel, theEnergyLossScalingFactor, theMPDebug, theSiAbsLengthScale, and theTimer.
00030 : theDebugLevel(theConf.getUntrackedParameter<int>("DebugLevel",0)), 00031 theEnergyLossScalingFactor(theConf.getUntrackedParameter<double>("EnergyLossScalingFactor",1.0)), 00032 theMPDebug(theConf.getUntrackedParameter<int>("MaterialPropertiesDebugLevel",0)), 00033 theSiAbsLengthScale(theConf.getUntrackedParameter<double>("SiAbsorptionLengthScalingFactor",1.0)), 00034 theTimer(), 00035 theMaterialProperties(), 00036 thePrimaryGenerator(), theSteppingAction(), 00037 theBarrelHits(0), theEndcapHits(0), 00038 theParameterSet(theConf) 00039 { 00040 00041 // make some noise 00042 edm::LogInfo("SimLaserAlignmentSimulation") << " ***** AC1CMS: Configuration from ParameterSet ***** " 00043 << "\n AC1CMS: theDebugLevel = " << theDebugLevel 00044 << "\n AC1CMS: theEnergyLossScalingFactor = " << theEnergyLossScalingFactor 00045 << "\n AC1CMS: theMPDebugLevel = " << theMPDebug 00046 << "\n AC1CMS: theSiAbsLengthScalingFactor = " << theSiAbsLengthScale; 00047 00048 // declare timer 00049 theTimer = new G4Timer; 00050 }
LaserAlignmentSimulation::~LaserAlignmentSimulation | ( | ) | [virtual] |
destructor
Definition at line 52 of file LaserAlignmentSimulation.cc.
References theMaterialProperties, thePrimaryGenerator, theSteppingAction, and theTimer.
00053 { 00054 if ( theMaterialProperties != 0 ) { delete theMaterialProperties; } 00055 if ( theSteppingAction != 0 ) { delete theSteppingAction; } 00056 if ( thePrimaryGenerator != 0 ) { delete thePrimaryGenerator; } 00057 if ( theTimer != 0 ) { delete theTimer; } 00058 }
void LaserAlignmentSimulation::update | ( | const EndOfTrack * | myTrack | ) | [virtual] |
observer for EndOfTrack
Implements Observer< const EndOfTrack * >.
Definition at line 159 of file LaserAlignmentSimulation.cc.
void LaserAlignmentSimulation::update | ( | const BeginOfTrack * | myTrack | ) | [virtual] |
observer for BeginOfTrack
Implements Observer< const BeginOfTrack * >.
Definition at line 99 of file LaserAlignmentSimulation.cc.
observer for EndOfRun
Implements Observer< const EndOfRun * >.
Definition at line 173 of file LaserAlignmentSimulation.cc.
References LogDebug, and theTimer.
00174 { 00175 LogDebug("SimLaserAlignmentSimulation") << "<LaserAlignmentSimulation::update(const EndOfRun * myRun)>"; 00176 00177 // stop timer 00178 theTimer->Stop(); 00179 edm::LogInfo("SimLaserAlignmentSimulation") << " AC1CMS: Number of Events = " << (*myRun)()->GetNumberOfEventToBeProcessed() 00180 << " " << *theTimer 00181 << " ***** AC1CMS: End of Run: " << (*myRun)()->GetRunID() << " ***** "; 00182 }
void LaserAlignmentSimulation::update | ( | const EndOfEvent * | myEvent | ) | [virtual] |
observer for EndOfEvent
Implements Observer< const EndOfEvent * >.
Definition at line 163 of file LaserAlignmentSimulation.cc.
References LogDebug, theBarrelHits, and theEndcapHits.
00164 { 00165 LogDebug("SimLaserAlignmentSimulation") << "<LaserAlignmentSimulation::update(const EndOfEvent * myEvent)>" 00166 << "\n AC1CMS: End of Event " << (*myEvent)()->GetEventID(); 00167 00168 // some statistics for this event 00169 edm::LogInfo("SimLaserAlignmentSimulation") << " *** Number of Hits: " << theBarrelHits << " / " << theEndcapHits 00170 << " (Barrel / Endcaps) *** "; 00171 }
void LaserAlignmentSimulation::update | ( | const G4Step * | myStep | ) | [virtual] |
observer for G4Step
Implements Observer< const G4Step * >.
Definition at line 103 of file LaserAlignmentSimulation.cc.
References LogDebug, TkAccumulatingSensitiveDetector::ProcessHits(), theBarrelHits, theEndcapHits, theSteppingAction, and LaserSteppingAction::UserSteppingAction().
00104 { 00105 LogDebug("SimLaserAlignmentSimulationStepping") << "<LaserAlignmentSimulation::update(const G4Step * myStep)>"; 00106 00107 G4Step * theStep = const_cast<G4Step*>(myStep); 00108 00109 // do the LaserSteppingAction 00110 theSteppingAction->UserSteppingAction(theStep); 00111 00112 // Trigger sensitive detector manually since photon is absorbed 00113 if ( ( theStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()== "OpAbsorption" ) ) 00114 { 00115 LogDebug("SimLaserAlignmentSimulationStepping") << "<LaserAlignmentSimulation::update(const G4Step*)>: Photon was absorbed! "; 00116 00117 00118 if ( theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector() ) 00119 { 00120 LogDebug("SimLaserAlignmentSimulationStepping") << " AC1CMS: Setting the EnergyLoss to " << theStep->GetTotalEnergyDeposit() 00121 << "\n AC1CMS: The z position is " << theStep->GetPreStepPoint()->GetPosition().z() 00122 << "\n AC1CMS: the Sensitive Detector: " 00123 << theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector()->GetName() 00124 << "\n AC1CMS: the Material: " << theStep->GetPreStepPoint()->GetMaterial()->GetName() 00125 << "\n AC1CMS: the Logical Volume: " 00126 << theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName(); 00127 00128 if (theStep->GetTotalEnergyDeposit() > 0.0) 00129 { 00130 // process a hit 00131 TkAccumulatingSensitiveDetector * theSD = (TkAccumulatingSensitiveDetector*) 00132 (theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector()); 00133 00134 theSD->ProcessHits(theStep, ((G4TouchableHistory *)(theStep->GetPreStepPoint()->GetTouchable()))); 00135 00136 00137 // some statistics for this event 00138 if ( ( theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() == "TECModule3RphiActive" ) || 00139 ( theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() == "TECModule5RphiActive" ) ) 00140 { 00141 theEndcapHits++; 00142 } 00143 else if ( ( theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() == "TOBActiveSter0" ) || 00144 ( theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() == "TOBActiveRphi0" ) || 00145 ( theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() == "TIBActiveRphi2" ) ) 00146 { 00147 theBarrelHits++; 00148 } 00149 } 00150 } 00151 else 00152 { 00153 LogDebug("SimLaserAlignmentSimulationStepping") << " AC1CMS: No SensitiveDetector available for this Step ... No Hit created :-( " 00154 << "\n AC1CMS: The Material was: " << theStep->GetPreStepPoint()->GetMaterial()->GetName(); 00155 } 00156 } 00157 }
void LaserAlignmentSimulation::update | ( | const BeginOfEvent * | myEvent | ) | [virtual] |
observer for BeginOfEvent
Implements Observer< const BeginOfEvent * >.
Definition at line 86 of file LaserAlignmentSimulation.cc.
References LaserPrimaryGeneratorAction::GeneratePrimaries(), LogDebug, theBarrelHits, theEndcapHits, and thePrimaryGenerator.
00087 { 00088 LogDebug("SimLaserAlignmentSimulation") << "<LaserAlignmentSimulation::update(const BeginOfEvent * myEvent)>" 00089 << "\n AC1CMS: Event number = " << (*myEvent)()->GetEventID(); 00090 00091 // some statistics for this event 00092 theBarrelHits = 0; 00093 theEndcapHits = 0; 00094 00095 // generate the Primaries 00096 thePrimaryGenerator->GeneratePrimaries((G4Event*)(*myEvent)()); 00097 }
void LaserAlignmentSimulation::update | ( | const BeginOfRun * | myRun | ) | [virtual] |
observer for BeginOfRun
Implements Observer< const BeginOfRun * >.
Definition at line 60 of file LaserAlignmentSimulation.cc.
References LogDebug, theDebugLevel, theMaterialProperties, theMPDebug, theParameterSet, thePrimaryGenerator, theSiAbsLengthScale, theSteppingAction, and theTimer.
00061 { 00062 LogDebug("SimLaserAlignmentSimulation") << "<LaserAlignmentSimulation::update(const BeginOfRun * myRun)>" 00063 << "\n ***** AC1CMS: Start of Run: " << (*myRun)()->GetRunID() << " ***** "; 00064 00065 // start timer 00066 theTimer->Start(); 00067 00068 00069 // the PrimaryGeneratorAction: defines the used particlegun for the Laser events 00070 thePrimaryGenerator = new LaserPrimaryGeneratorAction(theParameterSet); 00071 00072 // the UserSteppingAction: at the moment this prints only some information 00073 theSteppingAction = new LaserSteppingAction(theParameterSet); 00074 00075 // construct your own material properties for setting refractionindex and so on 00076 theMaterialProperties = new MaterialProperties(theMPDebug, theSiAbsLengthScale); 00077 00078 // list the tree of sensitive detectors 00079 if (theDebugLevel >= 1) 00080 { 00081 G4SDManager * theSDManager = G4SDManager::GetSDMpointer(); 00082 theSDManager->ListTree(); 00083 } 00084 }
int LaserAlignmentSimulation::theBarrelHits [private] |
int LaserAlignmentSimulation::theDebugLevel [private] |
Definition at line 74 of file LaserAlignmentSimulation.h.
Referenced by LaserAlignmentSimulation(), and update().
int LaserAlignmentSimulation::theEndcapHits [private] |
double LaserAlignmentSimulation::theEnergyLossScalingFactor [private] |
Definition at line 81 of file LaserAlignmentSimulation.h.
Referenced by update(), and ~LaserAlignmentSimulation().
int LaserAlignmentSimulation::theMPDebug [private] |
Definition at line 76 of file LaserAlignmentSimulation.h.
Referenced by LaserAlignmentSimulation(), and update().
Definition at line 82 of file LaserAlignmentSimulation.h.
Referenced by update(), and ~LaserAlignmentSimulation().
double LaserAlignmentSimulation::theSiAbsLengthScale [private] |
Definition at line 77 of file LaserAlignmentSimulation.h.
Referenced by LaserAlignmentSimulation(), and update().
Definition at line 83 of file LaserAlignmentSimulation.h.
Referenced by update(), and ~LaserAlignmentSimulation().
G4Timer* LaserAlignmentSimulation::theTimer [private] |
Definition at line 80 of file LaserAlignmentSimulation.h.
Referenced by LaserAlignmentSimulation(), update(), and ~LaserAlignmentSimulation().