Skip to content

Commit fe5a4e7

Browse files
committed
Code format
1 parent 35d4448 commit fe5a4e7

File tree

4 files changed

+34
-27
lines changed

4 files changed

+34
-27
lines changed

SimG4Core/Application/interface/RunManagerMT.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ class RunManagerMT {
9090

9191
void addRegions();
9292

93-
void addG4Region(const std::vector<G4LogicalVolume*>&, const std::string& regName,
94-
double cutg, double cute, double cutp, double cuti);
93+
void addG4Region(const std::vector<G4LogicalVolume*>&,
94+
const std::string& regName,
95+
double cutg,
96+
double cute,
97+
double cutp,
98+
double cuti);
9599

96100
G4MTRunManagerKernel* m_kernel;
97101

SimG4Core/Application/src/Phase2StackingAction.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "G4LossTableManager.hh"
2020

2121
Phase2StackingAction::Phase2StackingAction(const edm::ParameterSet& p, const CMSSteppingVerbose* sv)
22-
: steppingVerbose(sv) {
22+
: steppingVerbose(sv) {
2323
trackNeutrino = p.getParameter<bool>("TrackNeutrino");
2424
killHeavy = p.getParameter<bool>("KillHeavy");
2525
killGamma = p.getParameter<bool>("KillGamma");
@@ -377,7 +377,7 @@ void Phase2StackingAction::initPointer() {
377377
// Russian roulette
378378
const std::vector<G4Region*>* rs = G4RegionStore::GetInstance();
379379

380-
for (auto const & reg : *rs) {
380+
for (auto const& reg : *rs) {
381381
const G4String& rname = reg->GetName();
382382
if ((gRusRoEcal < 1.0 || nRusRoEcal < 1.0) && rname == "EcalRegion") {
383383
regionEcal = reg;

SimG4Core/Application/src/RunManagerMT.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void RunManagerMT::initG4(const DDCompactView* pDD,
220220
throw cms::Exception("LogicError") << "G4RunManagerKernel initialization failed!";
221221
}
222222

223-
if (m_check) {
223+
if (m_check) {
224224
checkVoxels();
225225
}
226226

@@ -367,15 +367,20 @@ void RunManagerMT::runForPhase2() {
367367
// This method should be extended in order to add new regions via names of logical volume
368368
// and to add a new production cuts for these regions
369369
void RunManagerMT::addRegions() {
370-
371370
CMSG4RegionReporter rep;
372371
rep.ReportRegions("g4region.txt");
373372
}
374373

375374
// This is a utility method to add a G4Region
376-
void RunManagerMT::addG4Region(const std::vector<G4LogicalVolume*>& v, const std::string& rName,
377-
double cutg, double cute, double cutp, double cuti) {
378-
if (v.empty()) { return; }
375+
void RunManagerMT::addG4Region(const std::vector<G4LogicalVolume*>& v,
376+
const std::string& rName,
377+
double cutg,
378+
double cute,
379+
double cutp,
380+
double cuti) {
381+
if (v.empty()) {
382+
return;
383+
}
379384
auto reg = new G4Region((G4String)rName);
380385
for (auto const& lv : v) {
381386
reg->AddRootLogicalVolume(lv, true);

SimG4Core/Application/src/RunManagerMTWorker.cc

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -748,42 +748,40 @@ void RunManagerMTWorker::DumpMagneticField(const G4Field* field, const std::stri
748748

749749
double dr = 2 * CLHEP::cm;
750750
double dz = 10 * CLHEP::cm;
751-
double dphi = phimax/32.;
751+
double dphi = phimax / 32.;
752752

753753
int nr = G4lrint(rmax / dr);
754754
int nz = G4lrint(2 * zmax / dz);
755755
int nphi = G4lrint(phimax / dphi);
756-
757756

758757
double point[4] = {0.0, 0.0, 0.0, 0.0};
759758
double bfield[3] = {0.0, 0.0, 0.0};
760759

761760
double z;
762-
double d1 = 1./CLHEP::rad;
763-
double d2 = 1./CLHEP::mm;
764-
double d3 = 1./CLHEP::tesla;
761+
double d1 = 1. / CLHEP::rad;
762+
double d2 = 1. / CLHEP::mm;
763+
double d3 = 1. / CLHEP::tesla;
765764

766765
fout << std::setprecision(6);
767766
fout << "### " << file << " CMS magnetic field: phi(rad) R(mm) Z(mm) Bx(tesla) By(tesla) Bz(tesla) ###" << G4endl;
768767
for (int k = 0; k <= nphi; ++k) {
769-
double phi = k*dphi;
768+
double phi = k * dphi;
770769
double cosf = cos(phi);
771770
double sinf = sin(phi);
772771
double r = 0.0;
773772
double z0 = -zmax;
774773
for (int i = 0; i <= nr; ++i) {
775-
z = z0;
776-
for (int j = 0; j <= nz; ++j) {
777-
point[0] = r * cosf;
778-
point[1] = r * sinf;
779-
point[2] = z;
780-
field->GetFieldValue(point, bfield);
781-
fout << phi*d1 << " " << r*d2 << " " << z*d2
782-
<< " " << bfield[0]*d3 << " " << bfield[1]*d3
783-
<< " " << bfield[2]*d3 << G4endl;
784-
z += dz;
785-
}
786-
r += dr;
774+
z = z0;
775+
for (int j = 0; j <= nz; ++j) {
776+
point[0] = r * cosf;
777+
point[1] = r * sinf;
778+
point[2] = z;
779+
field->GetFieldValue(point, bfield);
780+
fout << phi * d1 << " " << r * d2 << " " << z * d2 << " " << bfield[0] * d3 << " " << bfield[1] * d3 << " "
781+
<< bfield[2] * d3 << G4endl;
782+
z += dz;
783+
}
784+
r += dr;
787785
}
788786
}
789787
fout.close();

0 commit comments

Comments
 (0)