Skip to content

Commit f6fe0fd

Browse files
author
Sunanda
committed
Code check
1 parent 415c635 commit f6fe0fd

File tree

3 files changed

+42
-40
lines changed

3 files changed

+42
-40
lines changed

SimG4CMS/Calo/src/HFFibre.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ HFFibre::HFFibre(const std::string& name,
1818
const HcalSimulationParameters* hps,
1919
edm::ParameterSet const& p)
2020
: hcalConstant_(hcons), hcalsimpar_(hps) {
21-
edm::ParameterSet m_HF = (p.getParameter<edm::ParameterSet>("HFShower")).getParameter<edm::ParameterSet>("HFShowerBlock");
21+
edm::ParameterSet m_HF =
22+
(p.getParameter<edm::ParameterSet>("HFShower")).getParameter<edm::ParameterSet>("HFShowerBlock");
2223
cFibre = c_light * (m_HF.getParameter<double>("CFibre"));
23-
24+
#ifdef EDM_ML_DEBUG
2425
edm::LogVerbatim("HFShower") << "HFFibre:: Speed of light in fibre " << cFibre << " m/ns";
25-
26+
#endif
2627
// Attenuation length
2728
attL = hcalsimpar_->attenuationLength_;
2829
nBinAtt = static_cast<int>(attL.size());
@@ -118,21 +119,21 @@ double HFFibre::zShift(const G4ThreeVector& point, int depth, int fromEndAbs) {
118119
int ieta = 0;
119120
double length = 250 * CLHEP::cm;
120121
if (fromEndAbs < 0) {
121-
zFibre = 0.5 * gpar[1] - point.z(); //
122+
zFibre = 0.5 * gpar[1] - point.z(); //
122123
} else {
123124
// Defines the Radius bin by radial subdivision
124125
for (int i = nBinR - 1; i > 0; --i)
125126
if (hR < radius[i])
126127
ieta = nBinR - i - 1;
127128
// Defines the full length of the fibre (For onlyLong)
128129
if (static_cast<int>(longFL.size()) > ieta)
129-
length = longFL[ieta];
130-
zFibre = length; // from beginning of abs (full length)
130+
length = longFL[ieta];
131+
zFibre = length; // from beginning of abs (full length)
131132
if (fromEndAbs > 0) {
132-
zFibre -= gpar[1]; // length from end of HF
133+
zFibre -= gpar[1]; // length from end of HF
133134
} else {
134-
double zz = 0.5 * gpar[1] + point.z(); // depth of point of photon emission (from beginning of HF)
135-
zFibre -= zz; // length of fiber from point of photon emission
135+
double zz = 0.5 * gpar[1] + point.z(); // depth of point of photon emission (from beginning of HF)
136+
zFibre -= zz; // length of fiber from point of photon emission
136137
}
137138
}
138139

SimG4CMS/Calo/src/HFShower.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ std::vector<HFShower::Hit> HFShower::getHits(const G4Step *aStep, double weight)
144144
if (applyFidCut_ || chkFibre_ < 0 || (r1 <= exp(-p * zFibre) && r2 <= probMax_)) {
145145
hit.depth = depth;
146146
hit.time = tSlice + time;
147-
// Temporary fix
147+
// Temporary fix
148148
if (!applyFidCut_) {
149149
hit.wavelength = wavelength[i];
150150
hit.momentum = momz[i];
@@ -200,8 +200,8 @@ std::vector<HFShower::Hit> HFShower::getHits(const G4Step *aStep, bool forLibrar
200200
G4StepPoint *preStepPoint = aStep->GetPreStepPoint();
201201
const G4ThreeVector &globalPos = preStepPoint->GetPosition();
202202
G4String name = preStepPoint->GetTouchable()->GetSolid(0)->GetName();
203-
double zb = std::abs(globalPos.z()-zoffset); // from beginning of HF
204-
double zv = zb - .5*gpar_[1]; // from center of HF
203+
double zb = std::abs(globalPos.z() - zoffset); // from beginning of HF
204+
double zv = zb - .5 * gpar_[1]; // from center of HF
205205
G4ThreeVector localPos = G4ThreeVector(globalPos.x(), globalPos.y(), zv);
206206
G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->GetTopTransform().TransformAxis(momentumDir);
207207
bool ok = true;
@@ -235,10 +235,10 @@ std::vector<HFShower::Hit> HFShower::getHits(const G4Step *aStep, bool forLibrar
235235
if (ok && npe > 0) {
236236
for (int i = 0; i < npe; ++i) {
237237
hit.depth = depth;
238-
// hit.time = tSlice + time;
239-
hit.time = tSlice; // only shower time, fiber propagation time to be set on reading library
240-
hit.wavelength = wavelength[i];
241-
hit.momentum = momz[i];
238+
// hit.time = tSlice + time;
239+
hit.time = tSlice; // only shower time, fiber propagation time to be set on reading library
240+
hit.wavelength = wavelength[i];
241+
hit.momentum = momz[i];
242242
hit.position = globalPos;
243243
hits.push_back(hit);
244244
nHit++;

SimG4CMS/ShowerLibraryProducer/src/HcalForwardAnalysis.cc

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ HcalForwardAnalysis::~HcalForwardAnalysis() {}
5151
//
5252

5353
void HcalForwardAnalysis::produce(edm::Event& iEvent, const edm::EventSetup&) {
54-
if(fillt) fillEvent();
54+
if (fillt)
55+
fillEvent();
5556
}
5657

5758
void HcalForwardAnalysis::init() {
@@ -190,17 +191,17 @@ void HcalForwardAnalysis::setPhotons(const EndOfEvent* evt) {
190191
}
191192
} else {
192193
edm::LogVerbatim("HcalForwardLib") << "HcalForwardAnalysis::setPhotons(): No Chamber hits are stored";
193-
fillt=false;
194+
fillt = false;
194195
return;
195196
}
196197
primX = primPosOnSurf.x();
197198
primY = primPosOnSurf.y();
198199
primZ = primPosOnSurf.z();
199-
if (primZ < 990) { // there were interactions before HF
200+
if (primZ < 990) { // there were interactions before HF
200201
edm::LogVerbatim("HcalForwardLib") << "HcalForwardAnalysis::setPhotons(): First interaction before HF";
201-
fillt=false;
202+
fillt = false;
202203
return;
203-
}
204+
}
204205
primT = primTimeOnSurf;
205206
primMomX = primMomDirOnSurf.x();
206207
primMomY = primMomDirOnSurf.y();
@@ -209,44 +210,44 @@ void HcalForwardAnalysis::setPhotons(const EndOfEvent* evt) {
209210
double theta = primMomDirOnSurf.theta();
210211
double phi = primMomDirOnSurf.phi();
211212

212-
// my insert ----------------------------------------------------------------
213-
double sphi = sin(phi);
214-
double cphi = cos(phi);
213+
// my insert ----------------------------------------------------------------
214+
double sphi = sin(phi);
215+
double cphi = cos(phi);
215216
double ctheta = cos(theta);
216217
double stheta = sin(theta);
217218

218-
double pex = 0, pey = 0,zv = 0;
219-
double xx,yy,zz ;
219+
double pex = 0, pey = 0, zv = 0;
220+
double xx, yy, zz;
220221

221222
for (unsigned int k = 0; k < LongFiberPhotons.size(); ++k) {
222223
HFShowerPhoton aPhoton = LongFiberPhotons[k];
223224
// global coordinates
224-
xx =aPhoton.x();
225-
yy =aPhoton.y();
226-
zz =aPhoton.z();
225+
xx = aPhoton.x();
226+
yy = aPhoton.y();
227+
zz = aPhoton.z();
227228

228229
// local coordinates in rotated to shower axis system and vs shower origin
229-
pex = xx*ctheta*cphi + yy*ctheta*sphi - zz*stheta;
230-
pey = -xx*sphi + yy*cphi;
231-
zv = xx*stheta*cphi + yy*stheta*sphi + zz*ctheta-primZ/ctheta;
230+
pex = xx * ctheta * cphi + yy * ctheta * sphi - zz * stheta;
231+
pey = -xx * sphi + yy * cphi;
232+
zv = xx * stheta * cphi + yy * stheta * sphi + zz * ctheta - primZ / ctheta;
232233

233234
double photonProdTime = aPhoton.t() - primTimeOnSurf;
234-
thePhotons.push_back(Photon(1, pex,pey,zv, photonProdTime, aPhoton.lambda()));
235+
thePhotons.push_back(Photon(1, pex, pey, zv, photonProdTime, aPhoton.lambda()));
235236
}
236237
for (unsigned int k = 0; k < ShortFiberPhotons.size(); ++k) {
237238
HFShowerPhoton aPhoton = ShortFiberPhotons[k];
238239
// global coordinates
239-
xx =aPhoton.x();
240-
yy =aPhoton.y();
241-
zz =aPhoton.z();
240+
xx = aPhoton.x();
241+
yy = aPhoton.y();
242+
zz = aPhoton.z();
242243

243244
// local coordinates in rotated to shower axis system and vs shower origin
244-
pex = xx*ctheta*cphi + yy*ctheta*sphi - zz*stheta;
245-
pey = -xx*sphi + yy*cphi;
246-
zv = xx*stheta*cphi + yy*stheta*sphi + zz*ctheta-primZ/ctheta;
245+
pex = xx * ctheta * cphi + yy * ctheta * sphi - zz * stheta;
246+
pey = -xx * sphi + yy * cphi;
247+
zv = xx * stheta * cphi + yy * stheta * sphi + zz * ctheta - primZ / ctheta;
247248

248249
double photonProdTime = aPhoton.t() - primTimeOnSurf;
249-
thePhotons.push_back(Photon(2, pex,pey,zv, photonProdTime, aPhoton.lambda()));
250+
thePhotons.push_back(Photon(2, pex, pey, zv, photonProdTime, aPhoton.lambda()));
250251
}
251252
}
252253

0 commit comments

Comments
 (0)