Skip to content

Commit 2d536c5

Browse files
authored
Merge pull request cms-sw#33894 from civanch/geant4_for_tests
Use better interfaces to Geant4
2 parents a34ab38 + 56a4ba9 commit 2d536c5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

SimG4CMS/CherenkovAnalysis/interface/DreamSD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "FWCore/MessageLogger/interface/MessageLogger.h"
55
#include "SimG4CMS/Calo/interface/CaloSD.h"
66

7-
#include "G4PhysicsOrderedFreeVector.hh"
7+
#include "G4PhysicsFreeVector.hh"
88

99
#include <DD4hep/DD4hepUnits.h>
1010

@@ -62,7 +62,7 @@ class DreamSD : public CaloSD {
6262
int side_;
6363

6464
/// Table of Cherenkov angle integrals vs photon momentum
65-
std::unique_ptr<G4PhysicsOrderedFreeVector> chAngleIntegrals_;
65+
std::unique_ptr<G4PhysicsFreeVector> chAngleIntegrals_;
6666
G4MaterialPropertiesTable *materialPropertiesTable_;
6767

6868
int nphotons_;

SimG4CMS/CherenkovAnalysis/src/DreamSD.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ double DreamSD::getAverageNumberOfPhotons_(const double charge,
398398
double nMax = (*Rindex)[Rlength];
399399

400400
// Max Cerenkov Angle Integral
401-
double CAImax = chAngleIntegrals_.get()->GetMaxValue();
401+
double CAImax = chAngleIntegrals_.get()->GetMaxEnergy();
402402

403403
double dp = 0., ge = 0., CAImin = 0.;
404404

@@ -483,13 +483,13 @@ bool DreamSD::setPbWO2MaterialProperties_(G4Material *aMaterial) {
483483

484484
// Calculate Cherenkov angle integrals:
485485
// This is an ad-hoc solution (we hold it in the class, not in the material)
486-
chAngleIntegrals_ = std::make_unique<G4PhysicsOrderedFreeVector>();
486+
chAngleIntegrals_ = std::make_unique<G4PhysicsFreeVector>();
487487

488488
int index = 0;
489489
double currentRI = RefractiveIndex[index];
490490
double currentPM = PhotonEnergy[index];
491491
double currentCAI = 0.0;
492-
chAngleIntegrals_.get()->InsertValues(currentPM, currentCAI);
492+
chAngleIntegrals_.get()->PutValue(0, currentPM, currentCAI);
493493
double prevPM = currentPM;
494494
double prevCAI = currentCAI;
495495
double prevRI = currentRI;
@@ -499,7 +499,7 @@ bool DreamSD::setPbWO2MaterialProperties_(G4Material *aMaterial) {
499499
currentCAI = 0.5 * (1.0 / (prevRI * prevRI) + 1.0 / (currentRI * currentRI));
500500
currentCAI = prevCAI + (currentPM - prevPM) * currentCAI;
501501

502-
chAngleIntegrals_.get()->InsertValues(currentPM, currentCAI);
502+
chAngleIntegrals_.get()->PutValue(index, currentPM, currentCAI);
503503

504504
prevPM = currentPM;
505505
prevCAI = currentCAI;

SimG4Core/Application/src/ElectronLimiter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ G4double ElectronLimiter::PostStepGetPhysicalInteractionLength(const G4Track &aT
8080
if (!killTrack_ && rangeCheckFlag_) {
8181
G4double safety = aTrack.GetStep()->GetPreStepPoint()->GetSafety();
8282
if (safety > std::min(minStepLimit_, previousLimit)) {
83-
G4double range = ionisation_->GetRangeForLoss(kinEnergy, aTrack.GetMaterialCutsCouple());
83+
G4double range = ionisation_->GetRange(kinEnergy, aTrack.GetMaterialCutsCouple());
8484
if (safety >= range) {
8585
killTrack_ = true;
8686
limit = 0.0;

0 commit comments

Comments
 (0)