Skip to content

Commit

Permalink
Merge pull request #14876 from ghellwig/fix-clang-warnings-Alignment_80X
Browse files Browse the repository at this point in the history
Fix clang warnings alignment 80X (Backport of #14875)
  • Loading branch information
davidlange6 committed Jun 28, 2016
2 parents 470ab46 + fdec339 commit 319c999
Show file tree
Hide file tree
Showing 42 changed files with 5,489 additions and 5,493 deletions.
96 changes: 48 additions & 48 deletions Alignment/CocoaDDLObjects/interface/CocoaMaterialElementary.h
@@ -1,48 +1,48 @@
// COCOA class header file
//Id: CocoaMaterialElementary.h
//CAT: Model
//
// Class to manage the sets of fitted entries (one set per each measurement data set)
//
// History: v1.0
// Pedro Arce

#ifndef _CocoaMaterialElementary_HH
#define _CocoaMaterialElementary_HH

#include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"


class CocoaMaterialElementary
{

public:
//---------- Constructors / Destructor
CocoaMaterialElementary( ALIstring name, float density, ALIstring symbol, ALIint A, ALIint Z );
~CocoaMaterialElementary(){ };

ALIstring getName() const {
return theName; }
float getDensity() const {
return theDensity; }
ALIstring getSymbol() const {
return theSymbol; }
ALIint getA() const {
return theA; }
ALIint getZ() const {
return theZ; }

ALIbool operator==(const CocoaMaterialElementary& mate ) const;

private:

ALIstring theName;
float theDensity;
ALIstring theSymbol;
ALIint theA;
ALIint theZ;

};

#endif

// COCOA class header file
//Id: CocoaMaterialElementary.h
//CAT: Model
//
// Class to manage the sets of fitted entries (one set per each measurement data set)
//
// History: v1.0
// Pedro Arce

#ifndef _CocoaMaterialElementary_HH
#define _CocoaMaterialElementary_HH

#include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"


class CocoaMaterialElementary
{

public:
//---------- Constructors / Destructor
CocoaMaterialElementary( ALIstring name, float density, ALIstring symbol, float A, ALIint Z );
~CocoaMaterialElementary(){ };

ALIstring getName() const {
return theName; }
float getDensity() const {
return theDensity; }
ALIstring getSymbol() const {
return theSymbol; }
float getA() const {
return theA; }
ALIint getZ() const {
return theZ; }

ALIbool operator==(const CocoaMaterialElementary& mate ) const;

private:

ALIstring theName;
float theDensity;
ALIstring theSymbol;
float theA;
ALIint theZ;

};

#endif

70 changes: 34 additions & 36 deletions Alignment/CocoaDDLObjects/src/CocoaMaterialElementary.cc
@@ -1,36 +1,34 @@
// COCOA class implementation file
//Id: CocoaMaterialElementary.cc
//CAT: Model
//
// History: v1.0
// Pedro Arce
#include <map>
#include <fstream>

#include "Alignment/CocoaDDLObjects/interface/CocoaMaterialElementary.h"


CocoaMaterialElementary::CocoaMaterialElementary( ALIstring name, float density, ALIstring symbol, ALIint A, ALIint Z )
{

theName = name;
theDensity = density;
theSymbol = symbol;
theA = A;
theZ = Z;
}


ALIbool CocoaMaterialElementary::operator==(const CocoaMaterialElementary& mate ) const
{
float kTolerance = 1.E-9;
if( mate.getDensity() - theDensity < kTolerance
&& mate.getSymbol() == theSymbol
&& mate.getA() == theA
&& mate.getZ() == theZ ) {
return 1;
} else {
return 0;
}

}
// COCOA class implementation file
//Id: CocoaMaterialElementary.cc
//CAT: Model
//
// History: v1.0
// Pedro Arce
#include <map>
#include <fstream>
#include <cmath> // include floating-point std::abs functions

#include "Alignment/CocoaDDLObjects/interface/CocoaMaterialElementary.h"


CocoaMaterialElementary::CocoaMaterialElementary( ALIstring name, float density, ALIstring symbol, float A, ALIint Z ) :
theName(name),
theDensity(density),
theSymbol(symbol),
theA(A),
theZ(Z)
{
}


ALIbool CocoaMaterialElementary::operator==(const CocoaMaterialElementary& mate ) const
{
// GM: Using numeric_limits<float>::epsilon() might be better instead of a
// magic number 'kTolerance'. Not changing this to not break code
// potentially relying on this number.
const float kTolerance = 1.E-9;
return ( std::abs(mate.getDensity() - theDensity) < kTolerance
&& mate.getSymbol() == theSymbol
&& std::abs(mate.getA() - theA) < kTolerance
&& mate.getZ() == theZ );
}
22 changes: 11 additions & 11 deletions Alignment/CocoaFit/src/Fit.cc
Expand Up @@ -8,7 +8,7 @@

#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cmath> // among others include also floating-point std::abs functions
#include <ctime>
#include <set>

Expand Down Expand Up @@ -932,7 +932,7 @@ FitQuality Fit::getFitQuality( const ALIbool canBeGood )
// delete yfMatrix; //op

ALIdouble fit_quality_cut = (*DSMat)(0,0);
//- ALIdouble fit_quality_cut =fabs( (*DSMat)(0,0) );
//- ALIdouble fit_quality_cut =std::abs( (*DSMat)(0,0) );
delete DSMat;
if(ALIUtils::debug >= 0) std::cout << theNoFitIterations << " Fit quality predicted improvement in distance to minimum is = " << fit_quality_cut << std::endl;
if( ALIUtils::report >= 2 ) {
Expand Down Expand Up @@ -961,7 +961,7 @@ FitQuality Fit::getFitQuality( const ALIbool canBeGood )

//----- Chi2 is smaller, check if we make another iteration
} else {
ALIdouble rel_fit_quality = fabs(thePreviousIterationFitQuality - fit_quality)/fit_quality;
ALIdouble rel_fit_quality = std::abs(thePreviousIterationFitQuality - fit_quality)/fit_quality;
//----- Small chi2 change: end
if( (fit_quality_cut < theFitQualityCut || rel_fit_quality < theRelativeFitQualityCut ) && canBeGood ) {
if(ALIUtils::debug >= 2) std::cout << "$$ Fit::getFitQuality good " << fit_quality_cut << " <? " << theFitQualityCut
Expand Down Expand Up @@ -1348,7 +1348,7 @@ void Fit::dumpEntryAfterFit( ALIFileOut& fileout, const Entry* entry, double ent

if( ALIUtils::report >= 2) {
float dif = ( entry->value() + entry->valueDisplacementByFitting() ) / dimv - entry->value() / dimv;
if( fabs(dif) < 1.E-9 ) dif = 0.;
if( std::abs(dif) < 1.E-9 ) dif = 0.;
fileout << " DIFF= " << dif;
// << " == " << ( entry->value() + entry->valueDisplacementByFitting() ) / dimv - entryvalue << " @@ " << ( entry->value() + entry->valueDisplacementByFitting() ) / dimv << " @@ " << entryvalue;
} else {
Expand Down Expand Up @@ -1396,7 +1396,7 @@ void Fit::dumpEntryCorrelations( ALIFileOut& fileout )
ALIdouble corr = AtWAMatrix->Mat()->me[i1][i2];
ALIdouble corrf = corr / sqrt(AtWAMatrix->Mat()->me[i1][i1])
/ sqrt(AtWAMatrix->Mat()->me[i2][i2]);
if (fabs(corrf) >= minCorrel ) {
if (std::abs(corrf) >= minCorrel ) {
if(ALIUtils::debug >= 0) {
std::cout << "CORR:" << E1 << "" << E2 << " (" << i1 << ")" << " (" << i2 << ")" << " " << corrf << std::endl;
}
Expand Down Expand Up @@ -1559,7 +1559,7 @@ void Fit::CheckIfFitPossible()
for( ALIint ii = 0; ii < NolinMes; ii++ ) {
if( ALIUtils::debug >= 5 ) std::cout << " Derivative= (" << ii << "," << nCol << ") = " << (*AMatrix)(ii,nCol) << std::endl;

if( fabs((*AMatrix)(ii,nCol)) > ALI_DBL_MIN ) {
if( std::abs((*AMatrix)(ii,nCol)) > ALI_DBL_MIN ) {
if( ALIUtils::debug >= 5 ) std::cout << "Fit::CheckIfFitIsPossible " << nCol << " " << ii << " = " << (*AMatrix)(ii,nCol) << std::endl;
noDepend = FALSE;
break;
Expand Down Expand Up @@ -1591,8 +1591,8 @@ void Fit::CheckIfFitPossible()
ALIbool isProp = TRUE;
for( ALIint ii = 0; ii < nLin; ii++ ) {
if( ALIUtils::debug >= 5 ) std::cout << "Fit::CheckIfFitIsPossible " << ii << " : " << (*AMatrix)(ii,fitpos1) << " ?= " << (*AMatrix)(ii,fitpos2) << std::endl;
if( fabs((*AMatrix)(ii,fitpos1)) < derivPrec ) {
if( fabs((*AMatrix)(ii,fitpos2)) > derivPrec ) {
if( std::abs((*AMatrix)(ii,fitpos1)) < derivPrec ) {
if( std::abs((*AMatrix)(ii,fitpos2)) > derivPrec ) {
isProp = FALSE;
break;
}
Expand Down Expand Up @@ -1626,8 +1626,8 @@ int Fit::CheckIfMeasIsProportionalToAnother( ALIuint measNo )
ALIuint biggestColumn = 0;
ALIdouble biggest = 0.;
for (int ii = 0; ii < AMatrix->NoColumns(); ii++ ){
if( fabs((*AMatrix)(measNo,ii)) > biggest ) {
biggest = fabs((*AMatrix)(measNo,ii));
if( std::abs((*AMatrix)(measNo,ii)) > biggest ) {
biggest = std::abs((*AMatrix)(measNo,ii));
biggestColumn = ii;
}
columnsEqualSave.insert(ii);
Expand All @@ -1641,7 +1641,7 @@ int Fit::CheckIfMeasIsProportionalToAnother( ALIuint measNo )
// check if ratio of each column to 'biggestColumn' is the same as for the N measurement
for (int ii = 0; ii < AMatrix->NoColumns(); ii++ ){
div = (*AMatrix)(measNo,ii)/(*AMatrix)(measNo,biggestColumn);
if( fabs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && fabs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) {
if( std::abs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && std::abs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) {
if( ALIUtils::debug >= 3 ) std::cout << "CheckIfMeasIsProportionalToAnother 2 columns = " << ii << " in " << measNo << " & " << jj << std::endl;
} else {
if( ALIUtils::debug >= 3 ) std::cout << "CheckIfMeasIsProportionalToAnother 2 columns != " << ii << " in " << measNo << " & " << jj << std::endl;
Expand Down
72 changes: 36 additions & 36 deletions Alignment/CocoaModel/interface/OptOCameraDetector.h
@@ -1,36 +1,36 @@
// COCOA class header file
//Id: OptOCameraDetector.h
//CAT: Model
//
// Base class to describe Optical Objects of type sensor 2D
//
// History: v1.0
// Pedro Arce

#ifndef _OPTOCAMERADETECTOR_HH
#define _OPTOCAMERADETECTOR_HH

#include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
#include "Alignment/CocoaModel/interface/OpticalObject.h"
class Measurement;
class LightRay;

class OptOCameraDetector: public OpticalObject
{

public:
//---------- Constructors / Destructor
OptOCameraDetector(){ };
OptOCameraDetector(OpticalObject* parent, const ALIstring& type, const ALIstring& name, const ALIbool copy_data) :
OpticalObject( parent, type, name, copy_data){ };
~OptOCameraDetector(){ };

//---------- Propagate light for measurement meas
virtual void participateInMeasurement( LightRay& lightray, Measurement* meas, const ALIstring& behav );
void constructSolidShape();


};

#endif

// COCOA class header file
//Id: OptOCameraDetector.h
//CAT: Model
//
// Base class to describe Optical Objects of type sensor 2D
//
// History: v1.0
// Pedro Arce

#ifndef _OPTOCAMERADETECTOR_HH
#define _OPTOCAMERADETECTOR_HH

#include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
#include "Alignment/CocoaModel/interface/OpticalObject.h"
class Measurement;
class LightRay;

class OptOCameraDetector: public OpticalObject
{

public:
//---------- Constructors / Destructor
OptOCameraDetector(){ };
OptOCameraDetector(OpticalObject* parent, const ALIstring& type, const ALIstring& name, const ALIbool copy_data) :
OpticalObject( parent, type, name, copy_data){ };
~OptOCameraDetector(){ };

//---------- Propagate light for measurement meas
virtual void participateInMeasurement( LightRay& lightray, Measurement& meas, const ALIstring& behav ) override;
virtual void constructSolidShape() override;


};

#endif

0 comments on commit 319c999

Please sign in to comment.