CMS 3D CMS Logo

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

#include <ElectronLimiter.h>

Inheritance diagram for ElectronLimiter:

Public Member Functions

 ElectronLimiter (const edm::ParameterSet &, const G4ParticleDefinition *)
 
void InitialiseProcess (const G4ParticleDefinition *) override
 
G4bool IsApplicable (const G4ParticleDefinition &) override
 
G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &) override
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
void SetFieldCheckFlag (G4bool)
 
void SetRangeCheckFlag (G4bool)
 
void SetTrackingCutPerRegion (std::vector< const G4Region * > &, std::vector< G4double > &, std::vector< G4double > &, std::vector< G4double > &)
 
void StartTracking (G4Track *) override
 
 ~ElectronLimiter () override
 

Private Attributes

std::vector< G4double > energyLimits_
 
std::vector< G4double > factors_
 
G4bool fieldCheckFlag_
 
G4VEnergyLossProcess * ionisation_
 
G4bool killTrack_
 
G4double minStepLimit_
 
G4int nRegions_
 
const G4ParticleDefinition * particle_
 
G4bool rangeCheckFlag_
 
std::vector< const G4Region * > regions_
 
std::vector< G4double > rms_
 
CMSTrackingCutModeltrcut_
 

Detailed Description

Definition at line 23 of file ElectronLimiter.h.

Constructor & Destructor Documentation

◆ ElectronLimiter()

ElectronLimiter::ElectronLimiter ( const edm::ParameterSet p,
const G4ParticleDefinition *  part 
)
explicit

Definition at line 19 of file ElectronLimiter.cc.

20  : G4VEmProcess("eLimiter", fGeneral),
21  ionisation_(nullptr),
22  particle_(part),
23  nRegions_(0),
24  rangeCheckFlag_(false),
25  fieldCheckFlag_(false),
26  killTrack_(false) {
27  // set Process Sub Type
28  SetProcessSubType(static_cast<int>(STEP_LIMITER));
29  minStepLimit_ = p.getParameter<double>("MinStepLimit") * CLHEP::mm;
31 }

References minStepLimit_, AlCaHLTBitMon_ParallelJobs::p, and trcut_.

◆ ~ElectronLimiter()

ElectronLimiter::~ElectronLimiter ( )
override

Definition at line 33 of file ElectronLimiter.cc.

33 { delete trcut_; }

References trcut_.

Member Function Documentation

◆ InitialiseProcess()

void ElectronLimiter::InitialiseProcess ( const G4ParticleDefinition *  )
override

Definition at line 35 of file ElectronLimiter.cc.

35  {
36  G4LossTableManager *lManager = G4LossTableManager::Instance();
37  if (rangeCheckFlag_) {
38  ionisation_ = lManager->GetEnergyLossProcess(particle_);
39  if (!ionisation_) {
40  rangeCheckFlag_ = false;
41  }
42  }
43  AddEmModel(0, new G4DummyModel());
44 
45  if (lManager->IsMaster()) {
46  edm::LogVerbatim("SimG4CoreApplication")
47  << "ElectronLimiter::BuildPhysicsTable for " << particle_->GetParticleName() << " ioni: " << ionisation_
48  << " rangeCheckFlag: " << rangeCheckFlag_ << " fieldCheckFlag: " << fieldCheckFlag_ << " " << nRegions_
49  << " regions for tracking cuts\n";
50  }
51 }

References fieldCheckFlag_, ionisation_, nRegions_, particle_, and rangeCheckFlag_.

◆ IsApplicable()

G4bool ElectronLimiter::IsApplicable ( const G4ParticleDefinition &  )
override

Definition at line 107 of file ElectronLimiter.cc.

107 { return true; }

◆ PostStepDoIt()

G4VParticleChange * ElectronLimiter::PostStepDoIt ( const G4Track &  aTrack,
const G4Step &   
)
override

Definition at line 96 of file ElectronLimiter.cc.

96  {
97  fParticleChange.Initialize(aTrack);
98  if (killTrack_) {
99  fParticleChange.ProposeTrackStatus(fStopAndKill);
100  G4double edep = trcut_->SampleEnergyDepositEcal(aTrack.GetKineticEnergy());
101  fParticleChange.ProposeLocalEnergyDeposit(edep);
102  fParticleChange.SetProposedKineticEnergy(0.0);
103  }
104  return &fParticleChange;
105 }

References killTrack_, CMSTrackingCutModel::SampleEnergyDepositEcal(), and trcut_.

◆ PostStepGetPhysicalInteractionLength()

G4double ElectronLimiter::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
override

Definition at line 53 of file ElectronLimiter.cc.

55  {
56  *condition = NotForced;
57  G4double limit = DBL_MAX;
58  killTrack_ = false;
59 
60  G4double kinEnergy = aTrack.GetKineticEnergy();
61  if (0 < nRegions_) {
62  if (regions_[0] == nullptr) {
63  if (kinEnergy < energyLimits_[0]) {
64  killTrack_ = true;
66  limit = 0.0;
67  }
68  } else {
69  const G4Region *reg = aTrack.GetVolume()->GetLogicalVolume()->GetRegion();
70  for (G4int i = 0; i < nRegions_; ++i) {
71  if (reg == regions_[i] && kinEnergy < energyLimits_[i]) {
72  killTrack_ = true;
74  limit = 0.0;
75  break;
76  }
77  }
78  }
79  }
80  if (!killTrack_ && rangeCheckFlag_) {
81  G4double safety = aTrack.GetStep()->GetPreStepPoint()->GetSafety();
82  if (safety > std::min(minStepLimit_, previousLimit)) {
83  G4double range = ionisation_->GetRangeForLoss(kinEnergy, aTrack.GetMaterialCutsCouple());
84  if (safety >= range) {
85  killTrack_ = true;
86  limit = 0.0;
87  }
88  }
89  }
90  if (!killTrack_ && fieldCheckFlag_) {
92  }
93  return limit;
94 }

References goodZToMuMu_cfi::condition, energyLimits_, factors_, fieldCheckFlag_, mps_fire::i, CMSTrackingCutModel::InitialiseForStep(), ionisation_, killTrack_, remoteMonitoring_LED_IterMethod_cfg::limit, min(), minStepLimit_, nRegions_, FastTimerService_cff::range, rangeCheckFlag_, regions_, rms_, and trcut_.

◆ SetFieldCheckFlag()

void ElectronLimiter::SetFieldCheckFlag ( G4bool  val)
inline

Definition at line 70 of file ElectronLimiter.h.

70 { fieldCheckFlag_ = val; }

References fieldCheckFlag_, and heppy_batch::val.

Referenced by ParametrisedEMPhysics::ConstructProcess().

◆ SetRangeCheckFlag()

void ElectronLimiter::SetRangeCheckFlag ( G4bool  val)
inline

Definition at line 68 of file ElectronLimiter.h.

68 { rangeCheckFlag_ = val; }

References rangeCheckFlag_, and heppy_batch::val.

Referenced by ParametrisedEMPhysics::ConstructProcess().

◆ SetTrackingCutPerRegion()

void ElectronLimiter::SetTrackingCutPerRegion ( std::vector< const G4Region * > &  reg,
std::vector< G4double > &  cut,
std::vector< G4double > &  fac,
std::vector< G4double > &  rms 
)

Definition at line 111 of file ElectronLimiter.cc.

114  {
115  nRegions_ = reg.size();
116  if (nRegions_ > 0) {
117  regions_ = reg;
118  energyLimits_ = cut;
119  factors_ = fac;
120  rms_ = rms;
121  }
122 }

References TkAlMuonSelectors_cfi::cut, energyLimits_, factors_, nRegions_, regions_, SiStripPI::rms, and rms_.

Referenced by ParametrisedEMPhysics::ConstructProcess().

◆ StartTracking()

void ElectronLimiter::StartTracking ( G4Track *  )
override

Definition at line 109 of file ElectronLimiter.cc.

109 {}

Member Data Documentation

◆ energyLimits_

std::vector<G4double> ElectronLimiter::energyLimits_
private

◆ factors_

std::vector<G4double> ElectronLimiter::factors_
private

◆ fieldCheckFlag_

G4bool ElectronLimiter::fieldCheckFlag_
private

◆ ionisation_

G4VEnergyLossProcess* ElectronLimiter::ionisation_
private

Definition at line 51 of file ElectronLimiter.h.

Referenced by InitialiseProcess(), and PostStepGetPhysicalInteractionLength().

◆ killTrack_

G4bool ElectronLimiter::killTrack_
private

Definition at line 65 of file ElectronLimiter.h.

Referenced by PostStepDoIt(), and PostStepGetPhysicalInteractionLength().

◆ minStepLimit_

G4double ElectronLimiter::minStepLimit_
private

Definition at line 60 of file ElectronLimiter.h.

Referenced by ElectronLimiter(), and PostStepGetPhysicalInteractionLength().

◆ nRegions_

G4int ElectronLimiter::nRegions_
private

◆ particle_

const G4ParticleDefinition* ElectronLimiter::particle_
private

Definition at line 53 of file ElectronLimiter.h.

Referenced by InitialiseProcess().

◆ rangeCheckFlag_

G4bool ElectronLimiter::rangeCheckFlag_
private

◆ regions_

std::vector<const G4Region *> ElectronLimiter::regions_
private

◆ rms_

std::vector<G4double> ElectronLimiter::rms_
private

◆ trcut_

CMSTrackingCutModel* ElectronLimiter::trcut_
private
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
CMSTrackingCutModel
Definition: CMSTrackingCutModel.h:14
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
min
T min(T a, T b)
Definition: MathUtil.h:58
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CMSTrackingCutModel::SampleEnergyDepositEcal
virtual G4double SampleEnergyDepositEcal(G4double kinEnergy)
Definition: CMSTrackingCutModel.cc:18
ElectronLimiter::rms_
std::vector< G4double > rms_
Definition: ElectronLimiter.h:58
ElectronLimiter::regions_
std::vector< const G4Region * > regions_
Definition: ElectronLimiter.h:55
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
ElectronLimiter::rangeCheckFlag_
G4bool rangeCheckFlag_
Definition: ElectronLimiter.h:63
ElectronLimiter::minStepLimit_
G4double minStepLimit_
Definition: ElectronLimiter.h:60
ElectronLimiter::energyLimits_
std::vector< G4double > energyLimits_
Definition: ElectronLimiter.h:56
part
part
Definition: HCALResponse.h:20
ElectronLimiter::trcut_
CMSTrackingCutModel * trcut_
Definition: ElectronLimiter.h:52
ElectronLimiter::factors_
std::vector< G4double > factors_
Definition: ElectronLimiter.h:57
edm::LogVerbatim
Definition: MessageLogger.h:297
goodZToMuMu_cfi.condition
condition
Definition: goodZToMuMu_cfi.py:37
CMSTrackingCutModel::InitialiseForStep
void InitialiseForStep(G4double fac, G4double rms)
Definition: CMSTrackingCutModel.h:31
heppy_batch.val
val
Definition: heppy_batch.py:351
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
ElectronLimiter::ionisation_
G4VEnergyLossProcess * ionisation_
Definition: ElectronLimiter.h:51
ElectronLimiter::particle_
const G4ParticleDefinition * particle_
Definition: ElectronLimiter.h:53
ElectronLimiter::killTrack_
G4bool killTrack_
Definition: ElectronLimiter.h:65
ElectronLimiter::nRegions_
G4int nRegions_
Definition: ElectronLimiter.h:62
ElectronLimiter::fieldCheckFlag_
G4bool fieldCheckFlag_
Definition: ElectronLimiter.h:64