CMS 3D CMS Logo

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

#include <LowEnergyFastSimModel.h>

Inheritance diagram for LowEnergyFastSimModel:

Public Member Functions

void DoIt (const G4FastTrack &fastTrack, G4FastStep &fastStep) override
 
G4bool IsApplicable (const G4ParticleDefinition &particle) override
 
 LowEnergyFastSimModel (const G4String &name, G4Region *region, const edm::ParameterSet &parSet)
 
G4bool ModelTrigger (const G4FastTrack &fastTrack) override
 

Private Attributes

const G4double fEmax
 
GFlashHitMaker fHitMaker
 
const G4Envelope *const fRegion
 
LowEnergyFastSimParam param
 

Detailed Description

Definition at line 13 of file LowEnergyFastSimModel.h.

Constructor & Destructor Documentation

◆ LowEnergyFastSimModel()

LowEnergyFastSimModel::LowEnergyFastSimModel ( const G4String &  name,
G4Region *  region,
const edm::ParameterSet parSet 
)

Definition at line 14 of file LowEnergyFastSimModel.cc.

15  : G4VFastSimulationModel(name, region),
16  fEmax(parSet.getParameter<double>("LowEnergyGflashEcalEmax")),
17  fRegion(region) {}

Member Function Documentation

◆ DoIt()

void LowEnergyFastSimModel::DoIt ( const G4FastTrack &  fastTrack,
G4FastStep &  fastStep 
)
override

Definition at line 28 of file LowEnergyFastSimModel.cc.

28  {
29  fastStep.KillPrimaryTrack();
30  fastStep.SetPrimaryTrackPathLength(0.0);
31  double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
32 
33  const G4ThreeVector& pos = fastTrack.GetPrimaryTrack()->GetPosition();
34 
35  G4double inPointEnergy = param.GetInPointEnergyFraction(energy) * energy;
36 
37  // take into account positron annihilation (not included in in-point)
38  if (-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding())
39  energy += twomass;
40 
41  const G4ThreeVector& momDir = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
42  const G4ThreeVector& ortho = momDir.orthogonal();
43  const G4ThreeVector& cross = momDir.cross(ortho);
44 
45  // in point energy deposition
46  GFlashEnergySpot spot;
47  spot.SetEnergy(inPointEnergy);
48  spot.SetPosition(pos);
49  fHitMaker.make(&spot, &fastTrack);
50 
51  // tail energy deposition
52  G4double etail = energy - inPointEnergy;
53  const G4int nspots = int(etail) + 1;
54  const G4double tailEnergy = etail / (G4double)nspots;
55  for (G4int i = 0; i < nspots; ++i) {
56  const G4double radius = param.GetRadius(energy);
57  const G4double z = param.GetZ();
58 
59  const G4double phi = CLHEP::twopi * G4UniformRand();
60  const G4ThreeVector tailPos = pos + z * momDir + radius * std::cos(phi) * ortho + radius * std::sin(phi) * cross;
61 
62  spot.SetEnergy(tailEnergy);
63  spot.SetPosition(tailPos);
64  fHitMaker.make(&spot, &fastTrack);
65  }
66 }

References funct::cos(), Basic3DVector< T >::cross(), cross(), HCALHighEnergyHPDFilter_cfi::energy, fHitMaker, LowEnergyFastSimParam::GetInPointEnergyFraction(), LowEnergyFastSimParam::GetRadius(), LowEnergyFastSimParam::GetZ(), mps_fire::i, createfilelist::int, param, phi, CosmicsPD_Skims::radius, funct::sin(), twomass, and z.

◆ IsApplicable()

G4bool LowEnergyFastSimModel::IsApplicable ( const G4ParticleDefinition &  particle)
override

Definition at line 19 of file LowEnergyFastSimModel.cc.

19  {
20  return (11 == std::abs(particle.GetPDGEncoding()));
21 }

References funct::abs().

◆ ModelTrigger()

G4bool LowEnergyFastSimModel::ModelTrigger ( const G4FastTrack &  fastTrack)
override

Definition at line 23 of file LowEnergyFastSimModel.cc.

23  {
24  G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
25  return energy < fEmax && fRegion == fastTrack.GetEnvelope();
26 }

References HCALHighEnergyHPDFilter_cfi::energy, fEmax, and fRegion.

Member Data Documentation

◆ fEmax

const G4double LowEnergyFastSimModel::fEmax
private

Definition at line 22 of file LowEnergyFastSimModel.h.

Referenced by ModelTrigger().

◆ fHitMaker

GFlashHitMaker LowEnergyFastSimModel::fHitMaker
private

Definition at line 24 of file LowEnergyFastSimModel.h.

Referenced by DoIt().

◆ fRegion

const G4Envelope* const LowEnergyFastSimModel::fRegion
private

Definition at line 23 of file LowEnergyFastSimModel.h.

Referenced by ModelTrigger().

◆ param

LowEnergyFastSimParam LowEnergyFastSimModel::param
private

Definition at line 25 of file LowEnergyFastSimModel.h.

Referenced by DoIt().

mps_fire.i
i
Definition: mps_fire.py:428
twomass
constexpr double twomass
Definition: LowEnergyFastSimModel.cc:12
pos
Definition: PixelAliasList.h:18
LowEnergyFastSimParam::GetInPointEnergyFraction
G4double GetInPointEnergyFraction(G4double energy) const
Definition: LowEnergyFastSimParam.h:9
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Basic3DVector::cross
Basic3DVector cross(const Basic3DVector &lh) const
Vector product, or "cross" product, with a vector of same type.
Definition: extBasic3DVector.h:203
DDAxes::z
LowEnergyFastSimParam::GetRadius
G4double GetRadius(G4double energy) const
Definition: LowEnergyFastSimParam.h:15
LowEnergyFastSimModel::fEmax
const G4double fEmax
Definition: LowEnergyFastSimModel.h:22
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
cross
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Definition: Basic3DVectorLD.h:225
LowEnergyFastSimModel::param
LowEnergyFastSimParam param
Definition: LowEnergyFastSimModel.h:25
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
createfilelist.int
int
Definition: createfilelist.py:10
LowEnergyFastSimParam::GetZ
G4double GetZ() const
Definition: LowEnergyFastSimParam.h:24
DDAxes::phi
LowEnergyFastSimModel::fHitMaker
GFlashHitMaker fHitMaker
Definition: LowEnergyFastSimModel.h:24
LowEnergyFastSimModel::fRegion
const G4Envelope *const fRegion
Definition: LowEnergyFastSimModel.h:23
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22