From f4c3daad8fa9d649d667b61919ced4e29513741a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 09:36:35 +0000 Subject: [PATCH] style: pre-commit fixes --- .gitignore | 2 +- include/RMGGeneratorMUSUNCosmicMuons.hh | 2 +- src/RMGGeneratorMUSUNCosmicMuons.cc | 41 +++++++++++-------------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 88c2c51a..6a3549d9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ __pycache__ *.dat # python -.venv \ No newline at end of file +.venv diff --git a/include/RMGGeneratorMUSUNCosmicMuons.hh b/include/RMGGeneratorMUSUNCosmicMuons.hh index de4ac701..90259014 100644 --- a/include/RMGGeneratorMUSUNCosmicMuons.hh +++ b/include/RMGGeneratorMUSUNCosmicMuons.hh @@ -31,7 +31,7 @@ class RMGGeneratorMUSUNCosmicMuons : public RMGVGenerator { void GeneratePrimaries(G4Event* event); void GeneratePrimariesKinematics(G4Event* event) override { this->GeneratePrimaries(event); } - virtual void SetParticlePosition(G4ThreeVector vec) override{}; + virtual void SetParticlePosition(G4ThreeVector vec) override {}; void BeginOfRunAction(const G4Run*); inline void EndOfRunAction(const G4Run*) {} diff --git a/src/RMGGeneratorMUSUNCosmicMuons.cc b/src/RMGGeneratorMUSUNCosmicMuons.cc index e62a6ac4..4bd7e733 100644 --- a/src/RMGGeneratorMUSUNCosmicMuons.cc +++ b/src/RMGGeneratorMUSUNCosmicMuons.cc @@ -32,22 +32,19 @@ void RMGGeneratorMUSUNCosmicMuons::BeginOfRunAction(const G4Run*) { analysisReader->SetVerboseLevel(1); analysisReader->SetFileName(fFileName); G4int ntupleId = analysisReader->GetNtuple("MUSUN"); - if(ntupleId < 0) - RMGLog::Out(RMGLog::fatal, - "MUSUN file not found!"); - - analysisReader->SetNtupleIColumn(0,"ID", fID ); - analysisReader->SetNtupleIColumn(0,"type", fType ); - analysisReader->SetNtupleDColumn(0,"Ekin", fEkin ); - analysisReader->SetNtupleDColumn(0,"x", fX ); - analysisReader->SetNtupleDColumn(0,"y", fY ); - analysisReader->SetNtupleDColumn(0,"z", fZ ); - analysisReader->SetNtupleDColumn(0,"theta", fTheta ); - analysisReader->SetNtupleDColumn(0,"phi", fPhi ); - analysisReader->SetNtupleDColumn(0,"px", fPx ); - analysisReader->SetNtupleDColumn(0,"py", fPy ); - analysisReader->SetNtupleDColumn(0,"pz", fPz ); - + if (ntupleId < 0) RMGLog::Out(RMGLog::fatal, "MUSUN file not found!"); + + analysisReader->SetNtupleIColumn(0, "ID", fID); + analysisReader->SetNtupleIColumn(0, "type", fType); + analysisReader->SetNtupleDColumn(0, "Ekin", fEkin); + analysisReader->SetNtupleDColumn(0, "x", fX); + analysisReader->SetNtupleDColumn(0, "y", fY); + analysisReader->SetNtupleDColumn(0, "z", fZ); + analysisReader->SetNtupleDColumn(0, "theta", fTheta); + analysisReader->SetNtupleDColumn(0, "phi", fPhi); + analysisReader->SetNtupleDColumn(0, "px", fPx); + analysisReader->SetNtupleDColumn(0, "py", fPy); + analysisReader->SetNtupleDColumn(0, "pz", fPz); } @@ -63,7 +60,7 @@ void RMGGeneratorMUSUNCosmicMuons::GeneratePrimaries(G4Event* event) { fY * u::cm / u::m, fZ * u::cm / u::m); fGun->SetParticlePosition({fX * u::cm, fY * u::cm, fZ * u::cm}); - if(fTheta != 0 && fPhi != 0){ + if (fTheta != 0 && fPhi != 0) { G4ThreeVector d_cart(1, 1, 1); d_cart.setTheta(fTheta); // in rad d_cart.setPhi(fPhi); // in rad @@ -71,11 +68,11 @@ void RMGGeneratorMUSUNCosmicMuons::GeneratePrimaries(G4Event* event) { fGun->SetParticleMomentumDirection(d_cart); RMGLog::OutFormat(RMGLog::debug, "...direction (θ,φ) = ({:.4g}, {:.4g}) deg", fTheta / u::deg, fPhi / u::deg); - } - else{ + } else { G4ThreeVector d_cart(fPx, fPy, fPz); fGun->SetParticleMomentumDirection(d_cart); - RMGLog::OutFormat(RMGLog::debug, "...direction (px,py,pz) = ({:.4g}, {:.4g}, {:.4g}) deg", fPx, fPy, fPz); + RMGLog::OutFormat(RMGLog::debug, "...direction (px,py,pz) = ({:.4g}, {:.4g}, {:.4g}) deg", fPx, + fPy, fPz); } @@ -85,9 +82,7 @@ void RMGGeneratorMUSUNCosmicMuons::GeneratePrimaries(G4Event* event) { fGun->GeneratePrimaryVertex(event); } -void RMGGeneratorMUSUNCosmicMuons::SetMUSUNFile(G4String fileName) { - fFileName = fileName; -} +void RMGGeneratorMUSUNCosmicMuons::SetMUSUNFile(G4String fileName) { fFileName = fileName; } void RMGGeneratorMUSUNCosmicMuons::DefineCommands() {