Skip to content

Commit 2a42d11

Browse files
Cleanup if whitespaces and indentation
1 parent eaae860 commit 2a42d11

11 files changed

+144
-144
lines changed

interface/HadTauTFCrystalBall.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef TauAnalysis_SVfitTF_HadTauTFCrystalBall_h
22
#define TauAnalysis_SVfitTF_HadTauTFCrystalBall_h
33

4-
// This class returns the CrystalBall probability
5-
// value for parameters produced with the JetMET packadge.
4+
// This class returns the CrystalBall probability
5+
// value for parameters produced with the JetMET packadge.
66
// Author: Betty Calpas, Christian Veelken
77
88

@@ -24,7 +24,7 @@ class HadTauTFCrystalBall : public HadTauTFBase
2424

2525
void setDecayMode(int decayMode) const;
2626

27-
const HadTauTFCrystalBallPar* getPar(int par);
27+
const HadTauTFCrystalBallPar* getPar(int par);
2828

2929
virtual HadTauTFCrystalBall* Clone(const std::string& label) const;
3030

@@ -34,7 +34,7 @@ class HadTauTFCrystalBall : public HadTauTFBase
3434
enum { kAll, kOneProng0Pi0, kOneProng1Pi0, kOneProng2Pi0, kThreeProng0Pi0 };
3535
mutable int decayMode_; // reconstructed decay mode of given tau (to be set for each event by calling "setDecayMode" function)
3636
mutable double* xx_;
37-
mutable double* pp_; // point to the 7 parameter function value
37+
mutable double* pp_; // point to the 7 parameter function value
3838
typedef std::vector<HadTauTFCrystalBallPar*> vHadTauTFCrystalBallParPtr;
3939
mutable vHadTauTFCrystalBallParPtr thePar_;
4040
std::map<int, vHadTauTFCrystalBallParPtr> mapPar_; // <decayMode, parametersVec>

interface/HadTauTFCrystalBall2.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef TauAnalysis_SVfitTF_HadTauTFCrystalBall2_h
22
#define TauAnalysis_SVfitTF_HadTauTFCrystalBall2_h
33

4-
// This class returns the CrystalBall probability
5-
// value for parameters produced with the JetMET packadge.
4+
// This class returns the CrystalBall probability
5+
// value for parameters produced with the JetMET packadge.
66
// Author: Betty Calpas, Christian Veelken
77
88

@@ -16,9 +16,9 @@ class HadTauTFCrystalBall2 : public HadTauTFBase
1616
{
1717
public:
1818

19-
HadTauTFCrystalBall2(const std::string& = "TauAnalysis/SVfitTF/data/L2L3Corr/");
19+
HadTauTFCrystalBall2(const std::string& = "TauAnalysis/SVfitTF/data/L2L3Corr/");
2020

21-
virtual ~HadTauTFCrystalBall2();
21+
virtual ~HadTauTFCrystalBall2();
2222

2323
double operator()(double recPt, double genPt, double genEta) const; // return CB probability
2424

@@ -28,19 +28,19 @@ class HadTauTFCrystalBall2 : public HadTauTFBase
2828

2929
virtual HadTauTFCrystalBall2* Clone(const std::string& label) const;
3030

31-
const HadTauTFCrystalBallPar2* getPar(int par);
31+
const HadTauTFCrystalBallPar2* getPar(int par);
3232

3333
private:
3434

3535
bool calibrated_; // calibrated or uncalibrated
3636

37-
int cbParSize_;
37+
int cbParSize_;
3838

3939
int nDecayMode_;
4040

4141
enum { kAll, kOneProng0Pi0, kOneProng1Pi0, kTwoProng0Pi0, kTwoProng1Pi0, kThreeProng0Pi0, kThreeProng1Pi0 };
4242

43-
mutable int decayMode_;
43+
mutable int decayMode_;
4444

4545
mutable double *xx_; // response
4646

interface/HadTauTFCrystalBallPar2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class HadTauTFCrystalBallPar2
1010
{
1111
public:
12-
HadTauTFCrystalBallPar2(int decayMode, int parNumber, const std::string& jetParFileName);
12+
HadTauTFCrystalBallPar2(int decayMode, int parNumber, const std::string& jetParFileName);
1313
HadTauTFCrystalBallPar2(const HadTauTFCrystalBallPar2& cbPar);
1414
virtual ~HadTauTFCrystalBallPar2();
1515
double operator()(double genPt, double genEta) const; // return CB parameters vs (pt, eta)

interface/HadTauTFfromTGraph.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ class HadTauTFfromTGraph : public HadTauTFBase
3636
{
3737
ResolutionMapEntry(const TGraph* resolution)
3838
: resolution_(0),
39-
cdf_(0)
39+
cdf_(0)
4040
{
4141
assert(resolution);
4242
resolution_ = (TGraph*)resolution->Clone(Form("%s_cloned", resolution->GetName()));
4343
int numPoints = resolution_->GetN();
4444
cdf_ = new TGraph(numPoints);
4545
double integral = 0.;
4646
for ( int idxPoint = 0; idxPoint < numPoints; ++idxPoint ) {
47-
double x, y;
48-
resolution_->GetPoint(idxPoint, x, y);
49-
integral += y;
50-
cdf_->SetPoint(idxPoint, x, integral);
47+
double x, y;
48+
resolution_->GetPoint(idxPoint, x, y);
49+
integral += y;
50+
cdf_->SetPoint(idxPoint, x, integral);
5151
}
5252
}
5353
~ResolutionMapEntry()

interface/crystalBall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CRYSTALBALL_HH
22
#define CRYSTALBALL_HH
33

4-
double crystalBall(double *xx, double *pp);
5-
double normalizedCrystalBall(double *pp);
4+
double crystalBall(double *xx, double *pp);
5+
double normalizedCrystalBall(double *pp);
66

77
#endif

src/HadTauTFCrystalBall.cc

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <iostream>
77
#include <string>
8-
#include <assert.h>
8+
#include <assert.h>
99
#include <math.h>
1010
#include <cmath>
1111

@@ -30,7 +30,7 @@ HadTauTFCrystalBall::HadTauTFCrystalBall(const std::string& inputFilePath)
3030
pp_(0),
3131
genPt_cache_(-1.),
3232
genEta_cache_(0.)
33-
{
33+
{
3434
//std::cout << "<HadTauTFCrystalBall::HadTauTFCrystalBall>:" << std::endl;
3535

3636
xx_ = new double[1];
@@ -45,7 +45,7 @@ HadTauTFCrystalBall::HadTauTFCrystalBall(const std::string& inputFilePath)
4545
parDir[5] = inputFilePath + "/par5/";
4646
parDir[6] = inputFilePath + "/par6/";
4747
parDir[7] = inputFilePath + "/par7/";
48-
48+
4949
std::map<int, std::string> fileL2;
5050
fileL2[kAll] = "TauJec11V1_L2Relative_AK5tauHPSlooseCombDBcorrAll.txt";
5151
fileL2[kOneProng0Pi0] = "TauJec11V1_L2Relative_AK5tauHPSlooseCombDBcorrOneProng0Pi0.txt";
@@ -85,19 +85,19 @@ HadTauTFCrystalBall::~HadTauTFCrystalBall()
8585
delete mapPar_[decayMode][par];
8686
}
8787
}
88-
}
88+
}
8989

9090
void HadTauTFCrystalBall::setDecayMode(int decayMode) const
91-
{
92-
decayMode_ = decayMode;
91+
{
92+
decayMode_ = decayMode;
9393

94-
int idxDecayMode = -1;
94+
int idxDecayMode = -1;
9595
if ( decayMode_ == reco::PFTau::kOneProng0PiZero ) idxDecayMode = kOneProng0Pi0;
9696
else if ( decayMode_ == reco::PFTau::kOneProng1PiZero ) idxDecayMode = kOneProng1Pi0;
9797
else if ( decayMode_ == reco::PFTau::kOneProng2PiZero ) idxDecayMode = kOneProng2Pi0;
9898
else if ( decayMode_ == reco::PFTau::kThreeProng0PiZero ) idxDecayMode = kThreeProng0Pi0;
9999
else {
100-
std::cerr << "Warning: No transfer function defined for decay mode = " << decayMode_ << " !!";
100+
std::cerr << "Warning: No transfer function defined for decay mode = " << decayMode_ << " !!";
101101
idxDecayMode = kAll;
102102
}
103103
assert(mapPar_.find(idxDecayMode) != mapPar_.end());
@@ -110,8 +110,8 @@ void HadTauTFCrystalBall::setDecayMode(int decayMode) const
110110

111111
namespace
112112
{
113-
double fnc_dscb(double* xx, double* pp)
114-
{
113+
double fnc_dscb(double* xx, double* pp)
114+
{
115115
//std::cout << "<fnc_dscb>:" << std::endl;
116116
double x = xx[0];
117117
// gaussian core
@@ -154,8 +154,8 @@ namespace
154154
//std::cout << "A2 = " << A2 << ", a2 + B2 = " << a2_plus_B2 << ", 2. - mu + B2*sig = " << (2. - mu + B2*sig) << ", -1 + p2 = " << (-1. + p2) << std::endl;
155155
term3 = A2*TMath::Power(a2_plus_B2, -p2)*(a2_plus_B2*sig - TMath::Power(a2_plus_B2*sig, p2)*TMath::Power(TMath::Min(2., 2. - mu + B2*sig), 1. - p2))/((-1. + p2)*sig);
156156
if ( !std::isfinite(term3) ) term3 = 0.;
157-
}
158-
//std::cout << "term1 = " << term1 << ", term2 = " << term2 << ", term3 = " << term3 << ", sig = " << sig << std::endl;
157+
}
158+
//std::cout << "term1 = " << term1 << ", term2 = " << term2 << ", term3 = " << term3 << ", sig = " << sig << std::endl;
159159
double one_over_N = term1 + term2 + term3;
160160
one_over_N *= sig; // CV: multiply result obtained from Mathematica by Jacobi factor dx/du = sig for variable transformation from x to u
161161
//std::cout << "1/N = " << one_over_N << std::endl;
@@ -167,7 +167,7 @@ namespace
167167
result = N*A1*TMath::Power(B1 - u, -p1);
168168
} else if ( u < a2 ) {
169169
double arg = -0.5*u*u;
170-
//std::cout << "N = " << N << ", u = " << u << ", arg = " << arg << std::endl;
170+
//std::cout << "N = " << N << ", u = " << u << ", arg = " << arg << std::endl;
171171
result = N*TMath::Exp(arg);
172172
} else {
173173
//std::cout << "N = " << N << ", A2 = " << A2 << ", B2 + u = " << (B2 + u) << std::endl;
@@ -179,26 +179,26 @@ namespace
179179
}
180180

181181
double HadTauTFCrystalBall::operator()(double recPt, double genPt, double genEta) const
182-
{
182+
{
183183
//std::cout << "<HadTauTFCrystalBall::operator()>:" << std::endl;
184184
//std::cout << " pT: rec = " << recPt << ", gen = " << genPt << std::endl;
185185
//std::cout << " eta = " << genEta << std::endl;
186186

187-
xx_[0] = recPt/genPt;
187+
xx_[0] = recPt/genPt;
188188
//std::cout << " xx = " << xx_[0] << std::endl;
189189

190190
if ( genPt != genPt_cache_ || genEta != genEta_cache_ ) {
191191
for ( int iPar = 1; iPar < cbParSize_; ++iPar ) {
192192
pp_[iPar] = (*thePar_[iPar])(genPt, genEta);
193-
pp_[iPar] = 1./(*thePar_[iPar])(genPt, genEta); // CV: temporary fix
193+
pp_[iPar] = 1./(*thePar_[iPar])(genPt, genEta); // CV: temporary fix
194194
//std::cout << " pp(" << iPar << ") = " << pp_[iPar] << std::endl;
195-
}
195+
}
196196
genPt_cache_ = genPt;
197197
genEta_cache_ = genEta;
198198
}
199199

200200
double retVal = fnc_dscb(xx_, pp_);
201-
//std::cout << "--> returning retVal = " << retVal << std::endl;
201+
//std::cout << "--> returning retVal = " << retVal << std::endl;
202202
return retVal;
203203
}
204204

@@ -207,23 +207,23 @@ double HadTauTFCrystalBall::integral(double recPt_low, double recPt_up, double g
207207
//std::cout << "<HadTauTFCrystalBall::integral()>:" << std::endl;
208208
//std::cout << " pT: rec = " << recPt_low << ".." << recPt_up << ", gen = " << genPt << std::endl;
209209
//std::cout << " eta = " << genEta << std::endl;
210-
210+
211211
if ( !(recPt_low < recPt_up) ) return 0.;
212212

213-
double x_low = recPt_low/genPt;
214-
double x_up = recPt_up/genPt;
213+
double x_low = recPt_low/genPt;
214+
double x_up = recPt_up/genPt;
215215
//std::cout << " x = " << x_low << ".." << x_up << std::endl;
216-
216+
217217
if ( genPt != genPt_cache_ || genEta != genEta_cache_ ) {
218218
for ( int iPar = 1; iPar < cbParSize_; ++iPar ) {
219219
pp_[iPar] = (*thePar_[iPar])(genPt, genEta);
220-
pp_[iPar] = 1./(*thePar_[iPar])(genPt, genEta); // CV: temporary fix
220+
pp_[iPar] = 1./(*thePar_[iPar])(genPt, genEta); // CV: temporary fix
221221
//std::cout << " pp(" << iPar << ") = " << pp_[iPar] << std::endl;
222-
}
222+
}
223223
genPt_cache_ = genPt;
224224
genEta_cache_ = genEta;
225225
}
226-
226+
227227
//-----------------------------------------------------------------------------
228228
// Warning: this code needs to be identical to code in fnc_dscb function !!
229229
double mu = pp_[1]; // mean
@@ -281,7 +281,7 @@ double HadTauTFCrystalBall::integral(double recPt_low, double recPt_up, double g
281281
double term3 = A2*TMath::Power(B2_plus_u5*B2_plus_u6, -p2)*(B2_plus_u5*TMath::Power(B2_plus_u6, p2) - TMath::Power(B2_plus_u5, p2)*B2_plus_u6)/(-one_minus_p2);
282282
if ( !std::isfinite(term3) ) term3 = 0.;
283283
integral += term3;
284-
}
284+
}
285285
return integral;
286286
}
287287

@@ -298,10 +298,10 @@ HadTauTFCrystalBall* HadTauTFCrystalBall::Clone(const std::string& label) const
298298
clone->pp_[iPar] = pp_[iPar];
299299
}
300300
for ( std::map<int, vHadTauTFCrystalBallParPtr>::const_iterator entryPar = mapPar_.begin();
301-
entryPar != mapPar_.end(); ++entryPar ) {
301+
entryPar != mapPar_.end(); ++entryPar ) {
302302
const vHadTauTFCrystalBallParPtr& cbPars = entryPar->second;
303303
vHadTauTFCrystalBallParPtr cbPars_cloned;
304-
for ( int iPar = 1; iPar < cbParSize_; ++iPar ) {
304+
for ( int iPar = 1; iPar < cbParSize_; ++iPar ) {
305305
const HadTauTFCrystalBallPar* cbPar = cbPars[iPar];
306306
cbPars_cloned.push_back(new HadTauTFCrystalBallPar(*cbPar));
307307
}

0 commit comments

Comments
 (0)