Skip to content

Commit

Permalink
Cond* -- changes for large object passed by value found by clang stat…
Browse files Browse the repository at this point in the history
…ic analyzer cms.ArgSizeChecker
  • Loading branch information
gartung committed Aug 26, 2013
1 parent e448454 commit 02e6aa4
Show file tree
Hide file tree
Showing 30 changed files with 69 additions and 62 deletions.
2 changes: 1 addition & 1 deletion CondCore/ESSources/bin/CondDataProxy_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace {

class CondGetterFromTag : public cond::CondGetter {
public:
CondGetterFromTag( cond::CondDB db, std::string tag ) :
CondGetterFromTag( const cond::CondDB& db, std::string tag ) :
m_db(db), m_tag(tag){}
virtual ~CondGetterFromTag(){}

Expand Down
4 changes: 2 additions & 2 deletions CondCore/PopCon/interface/PopConSourceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ namespace popcon {
cond::LogDBEntry const & logDBEntry() const { return *m_logDBEntry; }


void initialize (cond::DbSession dbSession,
void initialize (const cond::DbSession& dbSession,
cond::TagInfo const & tagInfo, cond::LogDBEntry const & logDBEntry) {
m_session = dbSession;
m_tagInfo = &tagInfo;
m_logDBEntry = &logDBEntry;
}

// this is the only mandatory interface
std::pair<Container const *, std::string const> operator()(cond::DbSession session,
std::pair<Container const *, std::string const> operator()(const cond::DbSession& session,
cond::TagInfo const & tagInfo,
cond::LogDBEntry const & logDBEntry) const {
const_cast<self*>(this)->initialize(session, tagInfo, logDBEntry);
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/CSCObjects/interface/CSCBadChambers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CSCBadChambers{
typedef uint16_t IndexType;

CSCBadChambers() : numberOfBadChambers( 0 ), chambers( std::vector<int>() ) {};
CSCBadChambers(int nch, std::vector<int> ch ) : numberOfBadChambers( nch ), chambers( ch ) {};
CSCBadChambers(int nch, const std::vector<int>& ch ) : numberOfBadChambers( nch ), chambers( ch ) {};
~CSCBadChambers(){};

/// How many bad chambers are there>
Expand Down
4 changes: 2 additions & 2 deletions CondFormats/DQMObjects/interface/HDQMSummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class HDQMSummary {
//

// returns a vector of selected infos related to a given detId
std::vector<float> getSummaryObj(uint32_t& detID, std::vector<std::string> list) const;
std::vector<float> getSummaryObj(uint32_t& detID, const std::vector<std::string>& list) const;

// returns a vector filled with "info elementName" for each detId
// The order is SORTED according to the one used in getDetIds() !
Expand All @@ -104,7 +104,7 @@ class HDQMSummary {

// INLINE METHODS ABOUT RUN, TIME VALUE...
//
inline void setUserDBContent(std::vector<std::string> userDBContent) { userDBContent_ = userDBContent;}
inline void setUserDBContent(const std::vector<std::string>& userDBContent) { userDBContent_ = userDBContent;}
inline void setRunNr(int inputRunNr) { runNr_ = inputRunNr; }
inline void setTimeValue(unsigned long long inputTimeValue){ timeValue_=inputTimeValue;}

Expand Down
3 changes: 2 additions & 1 deletion CondFormats/DQMObjects/src/HDQMSummary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ void HDQMSummary::setObj(const uint32_t& detID, std::string elementName, float
}


std::vector<float> HDQMSummary::getSummaryObj(uint32_t& detID, std::vector<std::string> list) const
std::vector<float> HDQMSummary::getSummaryObj(uint32_t& detID, const std::vector<std::string>& _list) const
{
std::vector<std::string> list = _list;
std::vector<float> SummaryObj;
const HDQMSummary::Range range = getRange(detID);
if (range.first != range.second ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HcalFlagHFDigiTimeParam{
unsigned int fSamplesToAdd,
unsigned int fExpectedPeak,
double fminEThreshold,
std::vector<double> fcoef):
const std::vector<double>& fcoef):
mId(fId),
mHFdigiflagFirstSample(fFirstSample),
mHFdigiflagSamplesToAdd(fSamplesToAdd),
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/HcalObjects/interface/HcalLongRecoParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HcalLongRecoParam {
public:
HcalLongRecoParam():mId(0) {}

HcalLongRecoParam(unsigned long fId, std::vector<unsigned int> fSignalTS, std::vector<unsigned int> fNoiseTS):
HcalLongRecoParam(unsigned long fId, const std::vector<unsigned int>& fSignalTS, const std::vector<unsigned int>& fNoiseTS):
mId(fId), mSignalTS(fSignalTS), mNoiseTS(fNoiseTS) {}

uint32_t rawId () const {return mId;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class PerformancePayload
PerformancePayload(){}
virtual ~PerformancePayload() {};

virtual float getResult(PerformanceResult::ResultType,BinningPointByMap) const = 0; // gets from the full payload
virtual bool isInPayload(PerformanceResult::ResultType,BinningPointByMap) const = 0;
virtual float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const = 0; // gets from the full payload
virtual bool isInPayload(PerformanceResult::ResultType,const BinningPointByMap&) const = 0;
protected:

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ class PerformancePayloadFromBinnedTFormula : public PerformancePayload {

static int InvalidPos;

PerformancePayloadFromBinnedTFormula(std::vector<PerformanceResult::ResultType> r, std::vector<BinningVariables::BinningVariablesType> b , std::vector<PhysicsTFormulaPayload> in) : pls(in), results_(r), variables_(b) {}
PerformancePayloadFromBinnedTFormula(const std::vector<PerformanceResult::ResultType>& r, const std::vector<BinningVariables::BinningVariablesType>& b , const std::vector<PhysicsTFormulaPayload>& in) : pls(in), results_(r), variables_(b) {}

PerformancePayloadFromBinnedTFormula(){}
virtual ~PerformancePayloadFromBinnedTFormula(){
compiledFormulas_.clear();
}

float getResult(PerformanceResult::ResultType,BinningPointByMap) const ; // gets from the full payload
float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const ; // gets from the full payload

virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const {
return (limitPos(p) != PerformancePayloadFromBinnedTFormula::InvalidPos);
}

virtual bool isInPayload(PerformanceResult::ResultType,BinningPointByMap) const ;
virtual bool isInPayload(PerformanceResult::ResultType,const BinningPointByMap&) const ;

const std::vector<PhysicsTFormulaPayload> & formulaPayloads() const {return pls;}

void printFormula(PerformanceResult::ResultType res, BinningPointByMap) const;
void printFormula(PerformanceResult::ResultType res, const BinningPointByMap&) const;


protected:
Expand All @@ -57,9 +57,9 @@ class PerformancePayloadFromBinnedTFormula : public PerformancePayload {
}


bool isOk(BinningPointByMap p, unsigned int & ) const;
bool isOk(const BinningPointByMap& p, unsigned int & ) const;

TFormula * getFormula(PerformanceResult::ResultType,BinningPointByMap) const;
TFormula * getFormula(PerformanceResult::ResultType,const BinningPointByMap&) const;

void check() const;
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class PerformancePayloadFromTFormula : public PerformancePayload {

static int InvalidPos;

PerformancePayloadFromTFormula(std::vector<PerformanceResult::ResultType> r, std::vector<BinningVariables::BinningVariablesType> b , PhysicsTFormulaPayload& in) : pl(in), results_(r), variables_(b) {}
PerformancePayloadFromTFormula(const std::vector<PerformanceResult::ResultType>& r, const std::vector<BinningVariables::BinningVariablesType>& b , PhysicsTFormulaPayload& in) : pl(in), results_(r), variables_(b) {}

PerformancePayloadFromTFormula(){}
virtual ~PerformancePayloadFromTFormula(){
Expand All @@ -27,13 +27,13 @@ class PerformancePayloadFromTFormula : public PerformancePayload {
compiledFormulas_.clear();
}

float getResult(PerformanceResult::ResultType,BinningPointByMap) const ; // gets from the full payload
float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const ; // gets from the full payload

virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const {
return (limitPos(p) != PerformancePayloadFromTFormula::InvalidPos);
}

virtual bool isInPayload(PerformanceResult::ResultType,BinningPointByMap) const ;
virtual bool isInPayload(PerformanceResult::ResultType,const BinningPointByMap&) const ;

const PhysicsTFormulaPayload & formulaPayload() const {return pl;}

Expand All @@ -60,7 +60,7 @@ class PerformancePayloadFromTFormula : public PerformancePayload {
}


bool isOk(BinningPointByMap p) const;
bool isOk(const BinningPointByMap& p) const;

void check() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ class PerformancePayloadFromTable : public PerformancePayload {

//PerformancePayloadFromTable(int stride_, std::string columns_,std::vector<float> table) : PerformancePayload(stride_, columns_, table) {}

PerformancePayloadFromTable(std::vector<PerformanceResult::ResultType> r, std::vector<BinningVariables::BinningVariablesType> b , int stride_,std::vector<float> table) :
PerformancePayloadFromTable(const std::vector<PerformanceResult::ResultType>& r, const std::vector<BinningVariables::BinningVariablesType>& b , int stride_,const std::vector<float>& table) :
pl(stride_, table),
results_(r), binning_(b) {}

PerformancePayloadFromTable(){}
virtual ~PerformancePayloadFromTable(){}

float getResult(PerformanceResult::ResultType,BinningPointByMap) const ; // gets from the full payload
float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const ; // gets from the full payload

virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const {
return (minPos(p) != PerformancePayloadFromTable::InvalidPos);
}

virtual bool isInPayload(PerformanceResult::ResultType,BinningPointByMap) const ;
virtual bool isInPayload(PerformanceResult::ResultType,const BinningPointByMap&) const ;

const PhysicsPerformancePayload & payLoad() const {return pl;}

Expand Down Expand Up @@ -61,7 +61,7 @@ const PhysicsPerformancePayload & payLoad() const {return pl;}

}

bool matches(BinningPointByMap, PhysicsPerformancePayload::Row &) const;
bool matches(const BinningPointByMap&, PhysicsPerformancePayload::Row &) const;

PhysicsPerformancePayload pl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PhysicsPerformancePayload
{
public:
PhysicsPerformancePayload(){}
PhysicsPerformancePayload(int stride, std::vector<float> table);
PhysicsPerformancePayload(int stride, const std::vector<float>& table);
int stride(){return stride_;}

typedef std::vector<float> Row;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int PerformancePayloadFromBinnedTFormula::InvalidPos=-1;
using namespace std;


TFormula * PerformancePayloadFromBinnedTFormula::getFormula(PerformanceResult::ResultType r ,BinningPointByMap p ) const {
TFormula * PerformancePayloadFromBinnedTFormula::getFormula(PerformanceResult::ResultType r ,const BinningPointByMap& p ) const {
//
// chooses the correct rectangular region
//
Expand All @@ -19,8 +19,9 @@ TFormula * PerformancePayloadFromBinnedTFormula::getFormula(PerformanceResult::R

}

float PerformancePayloadFromBinnedTFormula::getResult(PerformanceResult::ResultType r ,BinningPointByMap p) const {
float PerformancePayloadFromBinnedTFormula::getResult(PerformanceResult::ResultType r ,const BinningPointByMap& _p) const {
check();
BinningPointByMap p = _p;
//
// which formula to use?
//
Expand All @@ -47,8 +48,9 @@ float PerformancePayloadFromBinnedTFormula::getResult(PerformanceResult::ResultT
return formula->EvalPar(values);
}

bool PerformancePayloadFromBinnedTFormula::isOk(BinningPointByMap p,unsigned int& whichone) const {
bool PerformancePayloadFromBinnedTFormula::isOk(const BinningPointByMap& _p,unsigned int& whichone) const {

BinningPointByMap p = _p;
//
// change: look on whether a single rectangularr region matches
//
Expand All @@ -74,7 +76,7 @@ bool PerformancePayloadFromBinnedTFormula::isOk(BinningPointByMap p,unsigned int
return false;
}

bool PerformancePayloadFromBinnedTFormula::isInPayload(PerformanceResult::ResultType res,BinningPointByMap point) const {
bool PerformancePayloadFromBinnedTFormula::isInPayload(PerformanceResult::ResultType res,const BinningPointByMap& point) const {
check();
// first, let's see if it is available at all
if (resultPos(res) == PerformancePayloadFromBinnedTFormula::InvalidPos) return false;
Expand Down Expand Up @@ -105,7 +107,7 @@ void PerformancePayloadFromBinnedTFormula::check() const {



void PerformancePayloadFromBinnedTFormula::printFormula(PerformanceResult::ResultType res,BinningPointByMap point) const {
void PerformancePayloadFromBinnedTFormula::printFormula(PerformanceResult::ResultType res,const BinningPointByMap& point) const {
check();
//
// which formula to use?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ int PerformancePayloadFromTFormula::InvalidPos=-1;
#include <iostream>
using namespace std;

float PerformancePayloadFromTFormula::getResult(PerformanceResult::ResultType r ,BinningPointByMap p) const {
float PerformancePayloadFromTFormula::getResult(PerformanceResult::ResultType r ,const BinningPointByMap& _p) const {
check();
BinningPointByMap p = _p;
//
// which formula to use?
//
Expand All @@ -30,8 +31,8 @@ float PerformancePayloadFromTFormula::getResult(PerformanceResult::ResultType r
return formula->EvalPar(values);
}

bool PerformancePayloadFromTFormula::isOk(BinningPointByMap p) const {

bool PerformancePayloadFromTFormula::isOk(const BinningPointByMap& _p) const {
BinningPointByMap p = _p;
std::vector<BinningVariables::BinningVariablesType> t = myBinning();

for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){
Expand All @@ -44,7 +45,7 @@ bool PerformancePayloadFromTFormula::isOk(BinningPointByMap p) const {
return true;
}

bool PerformancePayloadFromTFormula::isInPayload(PerformanceResult::ResultType res,BinningPointByMap point) const {
bool PerformancePayloadFromTFormula::isInPayload(PerformanceResult::ResultType res,const BinningPointByMap& point) const {
check();
// first, let's see if it is available at all
if (resultPos(res) == PerformancePayloadFromTFormula::InvalidPos) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int PerformancePayloadFromTable::InvalidPos=-1;
#include <iostream>


float PerformancePayloadFromTable::getResult(PerformanceResult::ResultType r ,BinningPointByMap p) const {
float PerformancePayloadFromTable::getResult(PerformanceResult::ResultType r ,const BinningPointByMap& p) const {

if (! isInPayload(r,p)) return PerformancePayload::InvalidResult;

Expand All @@ -21,13 +21,13 @@ float PerformancePayloadFromTable::getResult(PerformanceResult::ResultType r ,Bi
return PerformancePayload::InvalidResult;
}

bool PerformancePayloadFromTable::matches(BinningPointByMap p, PhysicsPerformancePayload::Row & row) const {
bool PerformancePayloadFromTable::matches(const BinningPointByMap& _p, PhysicsPerformancePayload::Row & row) const {
//
// this is the smart function which does not take into account the fields not present
//

// I can do it via a loop!

BinningPointByMap p = _p;
std::vector<BinningVariables::BinningVariablesType> t = myBinning();


Expand All @@ -42,7 +42,8 @@ bool PerformancePayloadFromTable::matches(BinningPointByMap p, PhysicsPerformanc
return true;
}

bool PerformancePayloadFromTable::isInPayload(PerformanceResult::ResultType res,BinningPointByMap point) const {
bool PerformancePayloadFromTable::isInPayload(PerformanceResult::ResultType res,const BinningPointByMap& _point) const {
BinningPointByMap point = _point;
// first, let's see if it is available at all
if (resultPos(res) == PerformancePayloadFromTable::InvalidPos) return false;
// now look whther the binning point contains all the info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PhysicsPerformancePayload::Row PhysicsPerformancePayload::getRow(int n) const{
return temp;
}

PhysicsPerformancePayload::PhysicsPerformancePayload(int stride, std::vector<float> table) : stride_(stride),
PhysicsPerformancePayload::PhysicsPerformancePayload(int stride, const std::vector<float>& table) : stride_(stride),
table_(table)
{}

Expand Down
6 changes: 3 additions & 3 deletions CondFormats/SiPixelObjects/interface/SiPixelDisabledModules.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SiPixelDisabledModules {
SiPixelDisabledModules() {;}

// constructor from a list of disabled modules
SiPixelDisabledModules(disabledModuleListType disabledModules) : theDisabledModules(disabledModules) {;}
SiPixelDisabledModules(const disabledModuleListType& disabledModules) : theDisabledModules(disabledModules) {;}

virtual ~SiPixelDisabledModules() {;}

Expand All @@ -31,15 +31,15 @@ class SiPixelDisabledModules {
{ return theDisabledModules; }

// set the list of disabled modules (current list is lost)
void setDisabledModuleList(disabledModuleListType disabledModules)
void setDisabledModuleList(const disabledModuleListType& disabledModules)
{ theDisabledModules = disabledModules; }

// add a single module to the vector of disabled modules
void addDisabledModule(disabledModuleType module)
{ theDisabledModules.push_back(module); }

// add a vector of modules to the vector of disabled modules
void addDisabledModule(disabledModuleListType idVector);
void addDisabledModule(const disabledModuleListType& idVector);

// remove disabled module from the list
// returns false if id not in disable list, true otherwise
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/SiPixelObjects/src/SiPixelDisabledModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <algorithm>

// add a list of modules to the vector of disabled modules
void SiPixelDisabledModules::addDisabledModule(disabledModuleListType idVector) {
void SiPixelDisabledModules::addDisabledModule(const disabledModuleListType& idVector) {
theDisabledModules.insert(theDisabledModules.end(),
idVector.begin(),
idVector.end());
Expand Down
2 changes: 1 addition & 1 deletion CondTools/Ecal/interface/EcalChannelStatusHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace popcon {
void physicsMasking();

// to read the daq configuration
void daqOut(RunIOV myRun);
void daqOut(const RunIOV& myRun);

// real analysis
void pedAnalysis( std::map<EcalLogicID, MonPedestalsDat> dataset_mon, std::map<EcalLogicID, MonCrystalConsistencyDat> wrongGain_mon );
Expand Down
2 changes: 1 addition & 1 deletion CondTools/Ecal/interface/EcalDCSHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace popcon
uint16_t updateHV( RunDCSHVDat* hv, uint16_t dbStatus, int modo=0) const ;
uint16_t updateLV( RunDCSLVDat* lv, uint16_t dbStatus) const ;
bool insertHVDataSetToOffline( const std::map<EcalLogicID, RunDCSHVDat>* dataset, EcalDCSTowerStatus* dcs_temp ) const;
bool insertLVDataSetToOffline( const std::map<EcalLogicID, RunDCSLVDat>* dataset, EcalDCSTowerStatus* dcs_temp, std::vector<EcalLogicID> ) const;
bool insertLVDataSetToOffline( const std::map<EcalLogicID, RunDCSLVDat>* dataset, EcalDCSTowerStatus* dcs_temp, const std::vector<EcalLogicID>& ) const;

void getNewObjects();
std::string id() const { return m_name;}
Expand Down
4 changes: 2 additions & 2 deletions CondTools/Ecal/src/EcalChannelStatusHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ void popcon::EcalChannelStatusHandler::physicsMasking() {

// ----------------------------------------------------------
// START DAQ EXCLUDED FEDs ROUTINES
void popcon::EcalChannelStatusHandler::daqOut(RunIOV myRun) {

void popcon::EcalChannelStatusHandler::daqOut(const RunIOV& _myRun) {
RunIOV myRun = _myRun;
std::map<EcalLogicID, RunFEConfigDat> feconfig;
econn->fetchDataSet(&feconfig, &myRun);

Expand Down
Loading

0 comments on commit 02e6aa4

Please sign in to comment.