Skip to content
Snippets Groups Projects
Commit c7a2fc35 authored by Tadej Novak's avatar Tadej Novak
Browse files

Fix FCS standalone compilation errors and warnings

Former-commit-id: e1ba202646d7933d69fd3a338615b57804e8d42c
parent 5fc4624b
No related branches found
No related tags found
No related merge requests found
......@@ -32,12 +32,12 @@ class TFCSExtrapolationState;
ALWAYS,
NUM_LEVELS
}; // enum Level
const char* LevelNames[NUM_LEVELS]={"NIL","VERBOSE","DEBUG","INFO","WARNING","ERROR","FATAL","ALWAYS"};
__attribute__ ((unused)) static const char* LevelNames[NUM_LEVELS]={"NIL","VERBOSE","DEBUG","INFO","WARNING","ERROR","FATAL","ALWAYS"};
} // end namespace MSG
// Needs a check despite the name, as stand alone mode is not using MsgStream, but just cout internally
#define ATH_MSG_LVL_NOCHK(lvl, x) \
do { \
if(this->msgLvl(lvl)) this->msg(lvl)<<setw(45)<<std::left<<this->GetName()<<" "<<MSG::LevelNames[lvl]<<" "<< x << endmsg; \
if(this->msgLvl(lvl)) this->msg(lvl) << std::setw(45) << std::left << this->GetName() << " " << MSG::LevelNames[lvl] << " " << x << endmsg; \
} while (0)
#define ATH_MSG_LVL(lvl, x) \
......@@ -46,16 +46,16 @@ class TFCSExtrapolationState;
} while (0)
#define ATH_MSG_VERBOSE(x) ATH_MSG_LVL(MSG::VERBOSE, x)
#define ATH_MSG_DEBUG(x) ATH_MSG_LVL(MSG::DEBUG, x)
#define ATH_MSG_DEBUG(x) ATH_MSG_LVL(MSG::DEBUG, x)
// note that we are using the _NOCHK variant here
#define ATH_MSG_INFO(x) ATH_MSG_LVL_NOCHK(MSG::INFO, x)
#define ATH_MSG_INFO(x) ATH_MSG_LVL_NOCHK(MSG::INFO, x)
#define ATH_MSG_WARNING(x) ATH_MSG_LVL_NOCHK(MSG::WARNING, x)
#define ATH_MSG_ERROR(x) ATH_MSG_LVL_NOCHK(MSG::ERROR, x)
#define ATH_MSG_FATAL(x) ATH_MSG_LVL_NOCHK(MSG::FATAL, x)
#define ATH_MSG_ERROR(x) ATH_MSG_LVL_NOCHK(MSG::ERROR, x)
#define ATH_MSG_FATAL(x) ATH_MSG_LVL_NOCHK(MSG::FATAL, x)
// can be used like so: ATH_MSG(INFO) << "hello" << endmsg;
#define ATH_MSG(lvl) \
if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl)<<setw(45)<<std::left<<this->GetName()<<" "<<MSG::LevelNames[MSG::lvl]<<" "
if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl) << std::setw(45) << std::left << this->GetName() << " " << MSG::LevelNames[MSG::lvl] << " "
#else
#include "AthenaKernel/MsgStreamMember.h"
......@@ -164,7 +164,7 @@ public:
/// Log a message using cout; a check of MSG::Level lvl is not possible!
MsgStream& msg() const {return *m_msg;}
MsgStream& msg( const MSG::Level lvl ) const {return *m_msg;}
MsgStream& msg( const MSG::Level ) const {return *m_msg;}
/// Check whether the logging system is active at the provided verbosity level
bool msgLvl( const MSG::Level lvl ) const {return m_level<=lvl;}
private:
......
......@@ -18,7 +18,10 @@ Athena::MsgStreamMember* TFCSParametrizationBase::s_msg(nullptr);
#endif
#if defined(__FastCaloSimStandAlone__)
TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* title):TNamed(name,title),m_msg(&std::cout),m_level(MSG::INFO)
TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* title)
: TNamed(name, title),
m_level(MSG::INFO),
m_msg(&std::cout)
{
}
#else
......@@ -85,5 +88,3 @@ void TFCSParametrizationBase::DoCleanup()
}
s_cleanup_list.resize(0);
}
......@@ -112,9 +112,6 @@ bool CaloGeometryFromFile::LoadGeometryFromFile(TString filename,TString treenam
const CaloDetDescrElement* pcell=new CaloDetDescrElement(cell);
int sampling = pcell->getSampling();
this->addcell(pcell);
if(jentry%25000==0) {
......@@ -174,21 +171,23 @@ void CaloGeometryFromFile::DrawFCalGraph(int isam,int color){
TString name = ss.str().c_str();
const int size=m_cells_in_sampling[isam].size();
double x[size];
double y[size];
std::vector<double> x;
std::vector<double> y;
x.reserve(size);
y.reserve(size);
//const CaloDetDescrElement* cell;
int i=0;
for(auto it=m_cells_in_sampling[isam].begin();it!=m_cells_in_sampling[isam].end();it++){
x[i]=it->second->x();
y[i]=it->second->y();
i++;
x.push_back(it->second->x());
y.push_back(it->second->y());
}
// cout << size << endl;
//TH2D* h = new TH2D("","",10,-0.5,0.5,10,-0.5,0.5);
//h->SetStats(0);
//h->Draw();
TGraph* graph = new TGraph(size,x,y);
TGraph* graph = new TGraph(size, &x[0], &y[0]);
graph->SetLineColor(color);
graph->SetTitle(name);
graph->SetMarkerStyle(21);
......@@ -196,11 +195,8 @@ void CaloGeometryFromFile::DrawFCalGraph(int isam,int color){
graph->SetMarkerSize(0.5);
graph->GetXaxis()->SetTitle("x [mm]");
graph->GetYaxis()->SetTitle("y [mm]");
graph->Draw("AP");
graph->Draw("AP");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment