CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LaserPrimaryGeneratorAction Class Reference

#include <LaserPrimaryGeneratorAction.h>

Inheritance diagram for LaserPrimaryGeneratorAction:

Public Member Functions

void GeneratePrimaries (G4Event *myEvent)
 call the corresponding GeneratePrimaries routines for both TEC's and the Barrel More...
 
 LaserPrimaryGeneratorAction (edm::ParameterSet const &theConf)
 constructor More...
 
void setGeneratorId (G4PrimaryParticle *aParticle, int ID) const
 set Id of the optical photons More...
 
 ~LaserPrimaryGeneratorAction ()
 destructor More...
 

Private Attributes

LaserBeamsTEC1theLaserBeamsInTEC1
 
LaserBeamsTEC2theLaserBeamsInTEC2
 
LaserBeamsBarreltheLaserBeamsInTECTIBTOBTEC
 
G4int thenParticle
 
G4int thenParticleInGun
 
G4double thePhotonEnergy
 

Detailed Description

Primary Generator Action for the Laser Events

Date
2007/03/20 12:00:59
Revision
1.2
Author
Maarten Thomas

Definition at line 26 of file LaserPrimaryGeneratorAction.h.

Constructor & Destructor Documentation

LaserPrimaryGeneratorAction::LaserPrimaryGeneratorAction ( edm::ParameterSet const &  theConf)

constructor

Definition at line 16 of file LaserPrimaryGeneratorAction.cc.

References edm::ParameterSet::getUntrackedParameter(), theLaserBeamsInTEC1, theLaserBeamsInTEC2, theLaserBeamsInTECTIBTOBTEC, thenParticle, thenParticleInGun, and thePhotonEnergy.

17  : thePhotonEnergy(0),
19  thenParticle(0),
23 {
24  // {{{ LaserPrimaryGeneratorAction constructor
25 
26  // get the PhotonEnergy from the parameter set
27  thePhotonEnergy = theConf.getUntrackedParameter<double>("PhotonEnergy",1.15) * eV;
28 
29  // number of particles in the Laser beam
30  thenParticleInGun = theConf.getUntrackedParameter<int>("NumberOfPhotonsInParticleGun",1);
31 
32  // number of particles in one beam. ATTENTION: each beam contains nParticleInGun with the same
33  // startpoint and direction. nParticle gives the number of particles in the beam with a different
34  // startpoint. They are used to simulate the gaussian beamprofile of the Laser Beams.
35  thenParticle = theConf.getUntrackedParameter<int>("NumberOfPhotonsInEachBeam",1);
36 
37  // create a messenger for this class
38 // theGunMessenger = new LaserPrimaryGeneratorMessenger(this);
39 
40  // create the beams in the right endcap
42 
43  // create the beams in the left endcap
45 
46  // create the beams to connect the TECs with TOB and TIB
48  // }}}
49 }
LaserPrimaryGeneratorAction::~LaserPrimaryGeneratorAction ( )

destructor

Definition at line 51 of file LaserPrimaryGeneratorAction.cc.

References theLaserBeamsInTEC1, theLaserBeamsInTEC2, and theLaserBeamsInTECTIBTOBTEC.

52 {
53  // {{{ LaserPrimaryGeneratorAction destructor
54 
55  if ( theLaserBeamsInTEC1 != 0 ) { delete theLaserBeamsInTEC1; }
56  if ( theLaserBeamsInTEC2 != 0 ) { delete theLaserBeamsInTEC2; }
58  // }}}
59 }

Member Function Documentation

void LaserPrimaryGeneratorAction::GeneratePrimaries ( G4Event *  myEvent)

call the corresponding GeneratePrimaries routines for both TEC's and the Barrel

Definition at line 61 of file LaserPrimaryGeneratorAction.cc.

References LaserBeamsTEC1::GeneratePrimaries(), LaserBeamsTEC2::GeneratePrimaries(), LaserBeamsBarrel::GeneratePrimaries(), mps_fire::i, LogDebug, setGeneratorId(), theLaserBeamsInTEC1, theLaserBeamsInTEC2, and theLaserBeamsInTECTIBTOBTEC.

Referenced by LaserAlignmentSimulation::update().

62 {
63  // {{{ GeneratePrimaries (G4Event * myEvent)
64 
65  // this function is called at the beginning of an Event in LaserAlignment::upDate(const BeginOfEvent * myEvent)
66  LogDebug("LaserPrimaryGeneratorAction") << "<LaserPrimaryGeneratorAction::GeneratePrimaries(G4Event*)>: create a new Laser Event";
67 
68  // shoot in the right endcap
70 
71  // shoot in the left endcap
73 
74  // shoot in the barrel
76 
77  // loop over all the generated vertices, get the primaries and set the user information
78  int theID = 0;
79 
80  for (int i = 1; i < myEvent->GetNumberOfPrimaryVertex(); i++)
81  {
82  G4PrimaryVertex * theVertex = myEvent->GetPrimaryVertex(i);
83 
84  for (int j = 0; j < theVertex->GetNumberOfParticle(); j++)
85  {
86  G4PrimaryParticle * thePrimary = theVertex->GetPrimary(j);
87 
88  setGeneratorId(thePrimary, theID);
89  theID++;
90  }
91  }
92  // }}}
93 }
#define LogDebug(id)
void GeneratePrimaries(G4Event *myEvent)
shoot optical photons into the detector at the beginning of an event
void GeneratePrimaries(G4Event *myEvent)
shoot optical photons into the detector at the beginning of an event
void GeneratePrimaries(G4Event *myEvent)
shoot optical photons into the detector at the beginning of an event
void setGeneratorId(G4PrimaryParticle *aParticle, int ID) const
set Id of the optical photons
void LaserPrimaryGeneratorAction::setGeneratorId ( G4PrimaryParticle *  aParticle,
int  ID 
) const

set Id of the optical photons

Definition at line 95 of file LaserPrimaryGeneratorAction.cc.

Referenced by GeneratePrimaries().

96 {
97  // {{{ SetGeneratorId(G4PrimaryParticle * aParticle, int ID) const
98 
99  /* *********************************************************************** */
100  /* OSCAR expacts each G4PrimaryParticle to have some User Information *
101  * therefore this function have been implemented */
102  /* *********************************************************************** */
103 
104  aParticle->SetUserInformation(new GenParticleInfo(ID));
105  // }}}
106 }
uint32_t ID
Definition: Definitions.h:26

Member Data Documentation

LaserBeamsTEC1* LaserPrimaryGeneratorAction::theLaserBeamsInTEC1
private
LaserBeamsTEC2* LaserPrimaryGeneratorAction::theLaserBeamsInTEC2
private
LaserBeamsBarrel* LaserPrimaryGeneratorAction::theLaserBeamsInTECTIBTOBTEC
private
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().