Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 9ca9ab6

Browse files
EinarElentomeichlersmith
authored andcommitted
Missing NULL->nullptrs
1 parent 299e73a commit 9ca9ab6

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/SimCore/Generators/LHEPrimaryGenerator.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LHEPrimaryGenerator::~LHEPrimaryGenerator() { delete reader_; }
3434
void LHEPrimaryGenerator::GeneratePrimaryVertex(G4Event* anEvent) {
3535
simcore::lhe::LHEEvent* lheEvent = reader_->readNextEvent();
3636

37-
if (lheEvent != NULL) {
37+
if (lheEvent != nullptr) {
3838
G4PrimaryVertex* vertex = new G4PrimaryVertex();
3939
vertex->SetPosition(lheEvent->getVertex()[0], lheEvent->getVertex()[1],
4040
lheEvent->getVertex()[2]);
@@ -53,7 +53,7 @@ void LHEPrimaryGenerator::GeneratePrimaryVertex(G4Event* anEvent) {
5353
if (particle->getIDUP() == -623) { /* Tungsten ion */
5454
G4ParticleDefinition* tungstenIonDef =
5555
G4IonTable::GetIonTable()->GetIon(74, 184, 0.);
56-
if (tungstenIonDef != NULL) {
56+
if (tungstenIonDef != nullptr) {
5757
primary->SetParticleDefinition(tungstenIonDef);
5858
} else {
5959
EXCEPTION_RAISE("EventGenerator",
@@ -79,10 +79,10 @@ void LHEPrimaryGenerator::GeneratePrimaryVertex(G4Event* anEvent) {
7979
* Assign primary as daughter but only if the mother is not a DOC
8080
* particle.
8181
*/
82-
if (particle->getMother(0) != NULL &&
82+
if (particle->getMother(0) != nullptr &&
8383
particle->getMother(0)->getISTUP() > 0) {
8484
G4PrimaryParticle* primaryMom = particleMap[particle->getMother(0)];
85-
if (primaryMom != NULL) {
85+
if (primaryMom != nullptr) {
8686
primaryMom->SetDaughter(primary);
8787
}
8888
} else {

src/SimCore/Geo/AuxInfoReader.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void AuxInfoReader::assignAuxInfoToVolumes() {
8181
G4String magFieldName = auxVal;
8282
G4MagneticField* magField =
8383
MagneticFieldStore::getInstance()->getMagneticField(magFieldName);
84-
if (magField != NULL) {
84+
if (magField != nullptr) {
8585
G4FieldManager* mgr = new G4FieldManager(magField);
8686
lv->SetFieldManager(mgr, true /* FIXME: hard-coded to force field manager to daughters */);
8787
// G4cout << "Assigned magnetic field " << magFieldName << " to
@@ -96,7 +96,7 @@ void AuxInfoReader::assignAuxInfoToVolumes() {
9696
G4String regionName = auxVal;
9797
G4Region* region =
9898
G4RegionStore::GetInstance()->GetRegion(regionName);
99-
if (region != NULL) {
99+
if (region != nullptr) {
100100
region->AddRootLogicalVolume(lv);
101101
// G4cout << "Added volume " << lv->GetName() << " to region " <<
102102
// regionName << G4endl;
@@ -109,7 +109,7 @@ void AuxInfoReader::assignAuxInfoToVolumes() {
109109
G4String visName = auxVal;
110110
G4VisAttributes* visAttributes =
111111
VisAttributesStore::getInstance()->getVisAttributes(visName);
112-
if (visAttributes != NULL) {
112+
if (visAttributes != nullptr) {
113113
lv->SetVisAttributes(visAttributes);
114114
// G4cout << "Assigned VisAttributes " << visName << " to volume "
115115
// << lv->GetName() << G4endl;
@@ -145,7 +145,7 @@ void AuxInfoReader::createMagneticField(G4String magFieldName,
145145
"Missing MagFieldType for magnetic field definition.");
146146
}
147147

148-
G4MagneticField* magField = NULL;
148+
G4MagneticField* magField = nullptr;
149149

150150
// Create a uniform mag field using the built-in Geant4 type.
151151
if (magFieldType == "G4UniformMagField") {

src/SimCore/TrackMap.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ void TrackMap::save(const G4Track* track) {
3737
particle.setGenStatus(0);
3838

3939
// Update the gen status from the primary particle.
40-
if (track->GetDynamicParticle()->GetPrimaryParticle() != NULL) {
40+
if (track->GetDynamicParticle()->GetPrimaryParticle() != nullptr) {
4141
G4VUserPrimaryParticleInformation* primaryInfo =
4242
track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation();
43-
if (primaryInfo != NULL) {
43+
if (primaryInfo != nullptr) {
4444
particle.setGenStatus(
4545
((UserPrimaryParticleInformation*)primaryInfo)->getHepEvtStatus());
4646
}

0 commit comments

Comments
 (0)