Skip to content

Commit 7eae51d

Browse files
author
Oz Amram
committed
Code style checks
1 parent f1c2e49 commit 7eae51d

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

IOMC/ParticleGuns/interface/CloseByParticleGunProducer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace edm {
2626
protected:
2727
// data members
2828
bool fControlledByEta, fControlledByREta;
29-
double fVarMin, fVarMax, fEtaMin, fEtaMax, fRMin, fRMax, fZMin, fZMax, fDelta, fPhiMin, fPhiMax, fTMin, fTMax,
29+
double fVarMin, fVarMax, fEtaMin, fEtaMax, fRMin, fRMax, fZMin, fZMax, fDelta, fPhiMin, fPhiMax, fTMin, fTMax,
3030
fOffsetFirst;
3131
double log_fVarMin = 0., log_fVarMax = 0.;
3232
int fNParticles;

IOMC/ParticleGuns/src/CloseByParticleGunProducer.cc

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ CloseByParticleGunProducer::CloseByParticleGunProducer(const ParameterSet& pset)
2727
ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters");
2828
fControlledByEta = pgun_params.getParameter<bool>("ControlledByEta");
2929
fControlledByREta = pgun_params.getParameter<bool>("ControlledByREta");
30-
if(fControlledByEta and fControlledByREta)
31-
throw cms::Exception("CloseByParticleGunProducer") << " Conflicting configuration, cannot have both ControlledByEta and ControlledByREta ";
30+
if (fControlledByEta and fControlledByREta)
31+
throw cms::Exception("CloseByParticleGunProducer")
32+
<< " Conflicting configuration, cannot have both ControlledByEta and ControlledByREta ";
3233

3334
fVarMax = pgun_params.getParameter<double>("VarMax");
3435
fVarMin = pgun_params.getParameter<double>("VarMin");
3536
fMaxVarSpread = pgun_params.getParameter<bool>("MaxVarSpread");
3637
fLogSpacedVar = pgun_params.getParameter<bool>("LogSpacedVar");
3738
fFlatPtGeneration = pgun_params.getParameter<bool>("FlatPtGeneration");
3839
if (fVarMin < 1 && !fFlatPtGeneration)
39-
throw cms::Exception("CloseByParticleGunProducer") << " Please choose a minimum energy greater than 1 GeV, otherwise time "
40-
"information may be invalid or not reliable";
40+
throw cms::Exception("CloseByParticleGunProducer")
41+
<< " Please choose a minimum energy greater than 1 GeV, otherwise time "
42+
"information may be invalid or not reliable";
4143
if (fVarMin < 0 && fLogSpacedVar)
4244
throw cms::Exception("CloseByParticleGunProducer") << " Minimum energy must be greater than zero for log spacing";
43-
else{
44-
log_fVarMin = std::log(fVarMin);
45-
log_fVarMax = std::log(fVarMax);
45+
else {
46+
log_fVarMin = std::log(fVarMin);
47+
log_fVarMax = std::log(fVarMax);
4648
}
4749

4850
if (fControlledByEta || fControlledByREta) {
@@ -56,12 +58,12 @@ CloseByParticleGunProducer::CloseByParticleGunProducer(const ParameterSet& pset)
5658
if (fRMax <= fRMin)
5759
throw cms::Exception("CloseByParticleGunProducer") << " Please fix RMin and RMax values in the configuration";
5860
}
59-
if(!fControlledByREta){
60-
fZMax = pgun_params.getParameter<double>("ZMax");
61-
fZMin = pgun_params.getParameter<double>("ZMin");
61+
if (!fControlledByREta) {
62+
fZMax = pgun_params.getParameter<double>("ZMax");
63+
fZMin = pgun_params.getParameter<double>("ZMin");
6264

63-
if (fZMax <= fZMin)
64-
throw cms::Exception("CloseByParticleGunProducer") << " Please fix ZMin and ZMax values in the configuration";
65+
if (fZMax <= fZMin)
66+
throw cms::Exception("CloseByParticleGunProducer") << " Please fix ZMin and ZMax values in the configuration";
6567
}
6668
fDelta = pgun_params.getParameter<double>("Delta");
6769
fPhiMin = pgun_params.getParameter<double>("MinPhi");
@@ -152,7 +154,7 @@ void CloseByParticleGunProducer::produce(Event& e, const EventSetup& es) {
152154
double fR, fEta;
153155
double fT;
154156

155-
if(!fControlledByREta){
157+
if (!fControlledByREta) {
156158
fZ = CLHEP::RandFlat::shoot(engine, fZMin, fZMax);
157159

158160
if (!fControlledByEta) {
@@ -162,14 +164,12 @@ void CloseByParticleGunProducer::produce(Event& e, const EventSetup& es) {
162164
fEta = CLHEP::RandFlat::shoot(engine, fEtaMin, fEtaMax);
163165
fR = (fZ / sinh(fEta));
164166
}
165-
}
166-
else{
167-
fR = CLHEP::RandFlat::shoot(engine, fRMin, fRMax);
168-
fEta = CLHEP::RandFlat::shoot(engine, fEtaMin, fEtaMax);
169-
fZ = sinh(fEta)/fR;
167+
} else {
168+
fR = CLHEP::RandFlat::shoot(engine, fRMin, fRMax);
169+
fEta = CLHEP::RandFlat::shoot(engine, fEtaMin, fEtaMax);
170+
fZ = sinh(fEta) / fR;
170171
}
171172

172-
173173
if (fUseDeltaT) {
174174
fT = CLHEP::RandFlat::shoot(engine, fTMin, fTMax);
175175
} else {
@@ -190,8 +190,7 @@ void CloseByParticleGunProducer::produce(Event& e, const EventSetup& es) {
190190
double fVar;
191191
if (numParticles > 1 && fMaxVarSpread)
192192
fVar = fVarMin + ip * (fVarMax - fVarMin) / (numParticles - 1);
193-
else if(fLogSpacedVar){
194-
193+
else if (fLogSpacedVar) {
195194
double fVar_log = CLHEP::RandFlat::shoot(engine, log_fVarMin, log_fVarMax);
196195
fVar = std::exp(fVar_log);
197196
}

0 commit comments

Comments
 (0)