Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
civanch committed Dec 6, 2022
1 parent 457f95d commit a01cb49
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
41 changes: 23 additions & 18 deletions SimG4Core/Application/src/StackingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,14 @@ G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack(const G4Track* aTrac

if (creatorProc == nullptr && aTrack->GetParentID() != 0) {
edm::LogWarning("StackingAction::ClassifyNewTrack")
<< " TrackID=" << aTrack->GetTrackID() << " ParentID=" << aTrack->GetParentID() << " " << aTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)=" << aTrack->GetKineticEnergy();
<< " TrackID=" << aTrack->GetTrackID() << " ParentID=" << aTrack->GetParentID() << " "
<< aTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)=" << aTrack->GetKineticEnergy();
}
if (aTrack->GetKineticEnergy() < 0.0) {
edm::LogWarning("StackingAction::ClassifyNewTrack")
<< " TrackID=" << aTrack->GetTrackID() << " ParentID=" << aTrack->GetParentID() << " " << aTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)=" << aTrack->GetKineticEnergy() << " creator " << creatorProc->GetProcessName();
<< " TrackID=" << aTrack->GetTrackID() << " ParentID=" << aTrack->GetParentID() << " "
<< aTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)=" << aTrack->GetKineticEnergy() << " creator "
<< creatorProc->GetProcessName();
}
// primary
if (creatorProc == nullptr || aTrack->GetParentID() == 0) {
Expand Down Expand Up @@ -217,24 +220,26 @@ G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack(const G4Track* aTrac
if (nullptr != ptr) {
creatorProc = ptr->GetSelectedProcess();
if (nullptr == creatorProc) {
if(nullptr == m_Compton) {
auto vp = G4LossTableManager::Instance()->GetEmProcessVector();
for(auto & p : vp) {
if(fComptonScattering == p->GetProcessSubType()) {
m_Compton = p;
break;
}
}
}
creatorProc = m_Compton;
}
subType = creatorProc->GetProcessSubType();
if (nullptr == m_Compton) {
auto vp = G4LossTableManager::Instance()->GetEmProcessVector();
for (auto& p : vp) {
if (fComptonScattering == p->GetProcessSubType()) {
m_Compton = p;
break;
}
}
}
creatorProc = m_Compton;
}
subType = creatorProc->GetProcessSubType();
track->SetCreatorProcess(creatorProc);
}
if(creatorProc == nullptr) {
edm::LogWarning("StackingAction::ClassifyNewTrack")
<< " SubType=16 and no creatorProc; TrackID=" << aTrack->GetTrackID() << " ParentID=" << aTrack->GetParentID() << " " << aTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)=" << ke << " SubType=" << subType;
}
if (creatorProc == nullptr) {
edm::LogWarning("StackingAction::ClassifyNewTrack")
<< " SubType=16 and no creatorProc; TrackID=" << aTrack->GetTrackID()
<< " ParentID=" << aTrack->GetParentID() << " " << aTrack->GetDefinition()->GetParticleName()
<< " Ekin(MeV)=" << ke << " SubType=" << subType;
}
}
// VI - end
LogDebug("SimG4CoreApplication") << "##StackingAction:Classify Track " << aTrack->GetTrackID() << " Parent "
Expand Down
6 changes: 2 additions & 4 deletions SimG4Core/Application/src/SteppingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep) {
if (nWarnings < 2) {
++nWarnings;
edm::LogWarning("SimG4CoreApplication")
<< "SteppingAction::UserSteppingAction: Track #"
<< theTrack->GetTrackID() << " "
<< theTrack->GetDefinition()->GetParticleName()
<< " Ekin(MeV)= " << theTrack->GetKineticEnergy() / MeV;
<< "SteppingAction::UserSteppingAction: Track #" << theTrack->GetTrackID() << " "
<< theTrack->GetDefinition()->GetParticleName() << " Ekin(MeV)= " << theTrack->GetKineticEnergy() / MeV;
}
theTrack->SetKineticEnergy(0.0);
}
Expand Down

0 comments on commit a01cb49

Please sign in to comment.