#include <Alignment/LaserAlignmentSimulation/interface/LaserPrimaryGeneratorAction.h>
Public Member Functions | |
void | GeneratePrimaries (G4Event *myEvent) |
call the corresponding GeneratePrimaries routines for both TEC's and the Barrel | |
LaserPrimaryGeneratorAction (edm::ParameterSet const &theConf) | |
constructor | |
void | setGeneratorId (G4PrimaryParticle *aParticle, int ID) const |
set Id of the optical photons | |
~LaserPrimaryGeneratorAction () | |
destructor | |
Private Attributes | |
LaserBeamsTEC1 * | theLaserBeamsInTEC1 |
LaserBeamsTEC2 * | theLaserBeamsInTEC2 |
LaserBeamsBarrel * | theLaserBeamsInTECTIBTOBTEC |
G4int | thenParticle |
G4int | thenParticleInGun |
G4double | thePhotonEnergy |
Definition at line 26 of file LaserPrimaryGeneratorAction.h.
LaserPrimaryGeneratorAction::LaserPrimaryGeneratorAction | ( | edm::ParameterSet const & | theConf | ) |
constructor
Definition at line 14 of file LaserPrimaryGeneratorAction.cc.
References edm::ParameterSet::getUntrackedParameter(), theLaserBeamsInTEC1, theLaserBeamsInTEC2, theLaserBeamsInTECTIBTOBTEC, thenParticle, thenParticleInGun, and thePhotonEnergy.
00015 : thePhotonEnergy(0), 00016 thenParticleInGun(0), 00017 thenParticle(0), 00018 theLaserBeamsInTEC1(), 00019 theLaserBeamsInTEC2(), 00020 theLaserBeamsInTECTIBTOBTEC() 00021 { 00022 // {{{ LaserPrimaryGeneratorAction constructor 00023 00024 // get the PhotonEnergy from the parameter set 00025 thePhotonEnergy = theConf.getUntrackedParameter<double>("PhotonEnergy",1.15) * eV; 00026 00027 // number of particles in the Laser beam 00028 thenParticleInGun = theConf.getUntrackedParameter<int>("NumberOfPhotonsInParticleGun",1); 00029 00030 // number of particles in one beam. ATTENTION: each beam contains nParticleInGun with the same 00031 // startpoint and direction. nParticle gives the number of particles in the beam with a different 00032 // startpoint. They are used to simulate the gaussian beamprofile of the Laser Beams. 00033 thenParticle = theConf.getUntrackedParameter<int>("NumberOfPhotonsInEachBeam",1); 00034 00035 // create a messenger for this class 00036 // theGunMessenger = new LaserPrimaryGeneratorMessenger(this); 00037 00038 // create the beams in the right endcap 00039 theLaserBeamsInTEC1 = new LaserBeamsTEC1(thenParticleInGun, thenParticle, thePhotonEnergy); 00040 00041 // create the beams in the left endcap 00042 theLaserBeamsInTEC2 = new LaserBeamsTEC2(thenParticleInGun, thenParticle, thePhotonEnergy); 00043 00044 // create the beams to connect the TECs with TOB and TIB 00045 theLaserBeamsInTECTIBTOBTEC = new LaserBeamsBarrel(thenParticleInGun, thenParticle, thePhotonEnergy); 00046 // }}} 00047 }
LaserPrimaryGeneratorAction::~LaserPrimaryGeneratorAction | ( | ) |
destructor
Definition at line 49 of file LaserPrimaryGeneratorAction.cc.
References theLaserBeamsInTEC1, theLaserBeamsInTEC2, and theLaserBeamsInTECTIBTOBTEC.
00050 { 00051 // {{{ LaserPrimaryGeneratorAction destructor 00052 00053 if ( theLaserBeamsInTEC1 != 0 ) { delete theLaserBeamsInTEC1; } 00054 if ( theLaserBeamsInTEC2 != 0 ) { delete theLaserBeamsInTEC2; } 00055 if ( theLaserBeamsInTECTIBTOBTEC != 0 ) { delete theLaserBeamsInTECTIBTOBTEC; } 00056 // }}} 00057 }
void LaserPrimaryGeneratorAction::GeneratePrimaries | ( | G4Event * | myEvent | ) |
call the corresponding GeneratePrimaries routines for both TEC's and the Barrel
Definition at line 59 of file LaserPrimaryGeneratorAction.cc.
References LaserBeamsBarrel::GeneratePrimaries(), LaserBeamsTEC1::GeneratePrimaries(), LaserBeamsTEC2::GeneratePrimaries(), i, j, LogDebug, setGeneratorId(), theLaserBeamsInTEC1, theLaserBeamsInTEC2, and theLaserBeamsInTECTIBTOBTEC.
Referenced by LaserAlignmentSimulation::update().
00060 { 00061 // {{{ GeneratePrimaries (G4Event * myEvent) 00062 00063 // this function is called at the beginning of an Event in LaserAlignment::upDate(const BeginOfEvent * myEvent) 00064 LogDebug("LaserPrimaryGeneratorAction") << "<LaserPrimaryGeneratorAction::GeneratePrimaries(G4Event*)>: create a new Laser Event"; 00065 00066 // shoot in the right endcap 00067 theLaserBeamsInTEC1->GeneratePrimaries(myEvent); 00068 00069 // shoot in the left endcap 00070 theLaserBeamsInTEC2->GeneratePrimaries(myEvent); 00071 00072 // shoot in the barrel 00073 theLaserBeamsInTECTIBTOBTEC->GeneratePrimaries(myEvent); 00074 00075 // loop over all the generated vertices, get the primaries and set the user information 00076 int theID = 0; 00077 00078 for (int i = 1; i < myEvent->GetNumberOfPrimaryVertex(); i++) 00079 { 00080 G4PrimaryVertex * theVertex = myEvent->GetPrimaryVertex(i); 00081 00082 for (int j = 0; j < theVertex->GetNumberOfParticle(); j++) 00083 { 00084 G4PrimaryParticle * thePrimary = theVertex->GetPrimary(j); 00085 00086 setGeneratorId(thePrimary, theID); 00087 theID++; 00088 } 00089 } 00090 // }}} 00091 }
set Id of the optical photons
Definition at line 93 of file LaserPrimaryGeneratorAction.cc.
Referenced by GeneratePrimaries().
00094 { 00095 // {{{ SetGeneratorId(G4PrimaryParticle * aParticle, int ID) const 00096 00097 /* *********************************************************************** */ 00098 /* OSCAR expacts each G4PrimaryParticle to have some User Information * 00099 * therefore this function have been implemented */ 00100 /* *********************************************************************** */ 00101 00102 aParticle->SetUserInformation(new GenParticleInfo(ID)); 00103 // }}} 00104 }
Definition at line 46 of file LaserPrimaryGeneratorAction.h.
Referenced by GeneratePrimaries(), LaserPrimaryGeneratorAction(), and ~LaserPrimaryGeneratorAction().
Definition at line 47 of file LaserPrimaryGeneratorAction.h.
Referenced by GeneratePrimaries(), LaserPrimaryGeneratorAction(), and ~LaserPrimaryGeneratorAction().
Definition at line 48 of file LaserPrimaryGeneratorAction.h.
Referenced by GeneratePrimaries(), LaserPrimaryGeneratorAction(), and ~LaserPrimaryGeneratorAction().
G4int LaserPrimaryGeneratorAction::thenParticle [private] |
Definition at line 43 of file LaserPrimaryGeneratorAction.h.
Referenced by LaserPrimaryGeneratorAction().
G4int LaserPrimaryGeneratorAction::thenParticleInGun [private] |
Definition at line 42 of file LaserPrimaryGeneratorAction.h.
Referenced by LaserPrimaryGeneratorAction().
G4double LaserPrimaryGeneratorAction::thePhotonEnergy [private] |
Definition at line 41 of file LaserPrimaryGeneratorAction.h.
Referenced by LaserPrimaryGeneratorAction().