Skip to content

Commit

Permalink
Fix compiler error and warnings (clang).
Browse files Browse the repository at this point in the history
  • Loading branch information
kresan committed Dec 19, 2019
1 parent ca16a66 commit ed50d2f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
19 changes: 9 additions & 10 deletions psp/R3BPspxCal2Hit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ R3BPspxCal2Hit::~R3BPspxCal2Hit() {}
void R3BPspxCal2Hit::SetParameters()
{

LOG(INFO) << "In R3BPspxCal2Hit::SetParameters()" << FairLogger::endl;
LOG(INFO) << "In R3BPspxCal2Hit::SetParameters()";
//--- Parameter Container ---
Int_t nDet = fHitPar->GetNumDetectors(); // Number of Detectors/Faces
orientation.resize(nDet);
detSize.resize(nDet);
posOffset.resize(nDet);
posSlope.resize(nDet);
LOG(INFO) << "Position Parameters" << FairLogger::endl;
LOG(INFO) << "Position Parameters";
for (Int_t d = 0; d < nDet; d++)
{
Int_t parOffset = 1; // 1 "header" parameter.
Expand All @@ -70,13 +70,13 @@ void R3BPspxCal2Hit::SetParameters()
posSlope[d] = par.At(parOffset + 5);
parOffset += 6; // move to next line in parameter file.
LOG(INFO) << "Det: " << d << "\torientation: " << orientation[d] << "\tdetSize: " << detSize[d]
<< "\toffset: " << posOffset[d] << "\tslope: " << posSlope[d] << FairLogger::endl;
<< "\toffset: " << posOffset[d] << "\tslope: " << posSlope[d];
}

eOffset.resize(nDet);
eGain.resize(nDet);
eRange.resize(nDet);
LOG(INFO) << "Energy Parameters" << FairLogger::endl;
LOG(INFO) << "Energy Parameters";
for (Int_t d = 0; d < nDet; d++)
{
Int_t parOffset = 1; // 1 "header" parameter.
Expand All @@ -85,8 +85,7 @@ void R3BPspxCal2Hit::SetParameters()
eGain[d] = par.At(parOffset + 3);
eRange[d] = par.At(parOffset + 4);
parOffset += 5; // move to next line in parameter file.
LOG(INFO) << "Det: " << d << "\toffset: " << eOffset[d] << "\tslope: " << eGain[d] << "\trange: " << eRange[d]
<< FairLogger::endl;
LOG(INFO) << "Det: " << d << "\toffset: " << eOffset[d] << "\tslope: " << eGain[d] << "\trange: " << eRange[d];
}
}

Expand Down Expand Up @@ -134,13 +133,13 @@ InitStatus R3BPspxCal2Hit::Init()
// -- Initialize/Read parameter file for conversion.
void R3BPspxCal2Hit::SetParContainers()
{
LOG(INFO) << "R3BPspxCal2Hit :: SetParContainers() " << FairLogger::endl;
LOG(INFO) << "R3BPspxCal2Hit :: SetParContainers() ";

fHitPar = (R3BPspxHitPar*)FairRuntimeDb::instance()->getContainer("R3BPspxHitPar");

if (!fHitPar)
{
LOG(ERROR) << "Could not get access to R3BPspxHitPar-Container." << FairLogger::endl;
LOG(ERROR) << "Could not get access to R3BPspxHitPar-Container.";
return;
}

Expand All @@ -152,13 +151,13 @@ void R3BPspxCal2Hit::SetParContainers()
// -- Initialize/Read parameter file for conversion.
InitStatus R3BPspxCal2Hit::ReInit()
{
LOG(INFO) << " R3BPspxCal2Hit :: ReInit() " << FairLogger::endl;
LOG(INFO) << " R3BPspxCal2Hit :: ReInit() ";

fHitPar = (R3BPspxHitPar*)FairRuntimeDb::instance()->getContainer("R3BPspxHitPar");

if (!fHitPar)
{
LOG(ERROR) << "Could not get access to R3BPspxHitPar-Container." << FairLogger::endl;
LOG(ERROR) << "Could not get access to R3BPspxHitPar-Container.";
return kFATAL;
}

Expand Down
6 changes: 3 additions & 3 deletions psp/R3BPspxMapped2Precal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ R3BPspxMapped2Precal::~R3BPspxMapped2Precal() {}
void R3BPspxMapped2Precal::SetParameters()
{

LOG(INFO) << "In R3BPspxMapped2Precal::SetParameters()" << FairLogger::endl;
LOG(INFO) << "In R3BPspxMapped2Precal::SetParameters()";
//--- Parameter Container ---
Int_t nDet = fPrecalPar->GetNumDetectors(); // Number of Detectors/Faces
gain.resize(nDet);
Expand All @@ -73,7 +73,7 @@ void R3BPspxMapped2Precal::SetParameters()
threshold2[d][s] = par.At(parOffset + 3);
parOffset += 4; // move to next line in parameter file.
LOG(INFO) << "Det: " << d << "\tstr: " << s << "\tgain: " << gain[d][s] << "\tthr1: " << threshold1[d][s]
<< "\tthr2: " << threshold2[d][s] << FairLogger::endl;
<< "\tthr2: " << threshold2[d][s];
}
}
}
Expand All @@ -86,7 +86,7 @@ InitStatus R3BPspxMapped2Precal::Init()
* Print parameters, if verbosity is set to INFO.
*/

LOG(INFO) << "R3BPspxMapped2Precal :: Init() " << FairLogger::endl;
LOG(INFO) << "R3BPspxMapped2Precal :: Init() ";
FairRootManager* fMan = FairRootManager::Instance();
fHeader = (R3BEventHeader*)fMan->GetObject("R3BEventHeader");
const char xy[2] = { 'x', 'y' }; // orientation of detector face
Expand Down
8 changes: 4 additions & 4 deletions psp/R3BPspxOnlineSpectra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ InitStatus R3BPspxOnlineSpectra::Init()

FairRootManager* mgr = FairRootManager::Instance();
if (NULL == mgr)
LOG(fatal) << "FairRootManager not found" << FairLogger::endl;
LOG(fatal) << "FairRootManager not found";
header = (R3BEventHeader*)mgr->GetObject("R3BEventHeader");

FairRunOnline* run = FairRunOnline::Instance();
Expand Down Expand Up @@ -119,7 +119,7 @@ InitStatus R3BPspxOnlineSpectra::Init()

Int_t Emax = 500000;

// LOG(INFO) << "Init MappedPspx" << FairLogger::endl;
// LOG(INFO) << "Init MappedPspx";

std::string xy[2] = { "x", "y" };
// std::string ep[2] = {"Energy","Position"};
Expand Down Expand Up @@ -247,7 +247,7 @@ void R3BPspxOnlineSpectra::Exec(Option_t* option)
{
FairRootManager* mgr = FairRootManager::Instance();
if (NULL == mgr)
LOG(FATAL) << "R3BPspxOnlineSpectra::Exec FairRootManager not found" << FairLogger::endl;
LOG(FATAL) << "R3BPspxOnlineSpectra::Exec FairRootManager not found";
// check for requested trigger (Todo: should be done globablly / somewhere else)
if ((fTrigger >= 0) && (header) && (header->GetTrigger() != fTrigger))
return;
Expand Down Expand Up @@ -299,7 +299,7 @@ void R3BPspxOnlineSpectra::FinishEvent()
void R3BPspxOnlineSpectra::FinishTask()
{

// LOG(INFO) << "Finish MappedPspx" << FairLogger::endl;
// LOG(INFO) << "Finish MappedPspx";

for (UInt_t i = 0; i < fMappedItemsPspx.size(); i++)
{
Expand Down
8 changes: 4 additions & 4 deletions psp/R3BPspxPrecal2Cal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ R3BPspxPrecal2Cal::~R3BPspxPrecal2Cal() {}
void R3BPspxPrecal2Cal::SetParameters()
{

LOG(INFO) << "In R3BPspxPrecal2Cal::SetParameters()" << FairLogger::endl;
LOG(INFO) << "In R3BPspxPrecal2Cal::SetParameters()";
//--- Parameter Container ---
Int_t nDet = fCalPar->GetNumDetectors(); // Number of Detectors/Faces
gain.resize(nDet);
Expand All @@ -66,7 +66,7 @@ void R3BPspxPrecal2Cal::SetParameters()
TArrayF par = fCalPar->GetCalPar(); // Array with the parameters
gain[d][s] = par.At(parOffset + 1);
parOffset += 2; // move to next line in parameter file.
LOG(INFO) << "Det: " << d << "\tstr: " << s << "\tgain: " << gain[d][s] << FairLogger::endl;
LOG(INFO) << "Det: " << d << "\tstr: " << s << "\tgain: " << gain[d][s];
}
}
}
Expand Down Expand Up @@ -126,7 +126,7 @@ void R3BPspxPrecal2Cal::SetParContainers()

if (!fCalPar)
{
LOG(ERROR) << "Could not get access to R3BPspxCalPar-Container." << FairLogger::endl;
LOG(ERROR) << "Could not get access to R3BPspxCalPar-Container.";
return;
}

Expand All @@ -145,7 +145,7 @@ InitStatus R3BPspxPrecal2Cal::ReInit()

if (!fCalPar)
{
LOG(ERROR) << "Could not get access to R3BPspxCalPar-Container." << FairLogger::endl;
LOG(ERROR) << "Could not get access to R3BPspxCalPar-Container.";
return kFATAL;
}

Expand Down
8 changes: 4 additions & 4 deletions r3bsource/R3BPspxReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ R3BPspxReader::R3BPspxReader(EXT_STR_h101_PSP* data, UInt_t offset)
{
fMappedItems[d] = new TClonesArray("R3BPspxMappedData");
}
printf("Length: %d\n", LENGTH(data_o->PSPX));
LOG(INFO) << "R3BPspxReader: Created " << 2 * LENGTH(data_o->PSPX) << " detectors." << FairLogger::endl;
printf("Length: %lu\n", LENGTH(data_o->PSPX));
LOG(INFO) << "R3BPspxReader: Created " << 2 * LENGTH(data_o->PSPX) << " detectors.";
}

R3BPspxReader::~R3BPspxReader()
Expand All @@ -61,7 +61,7 @@ R3BPspxReader::~R3BPspxReader()
Bool_t R3BPspxReader::Init(ext_data_struct_info* a_struct_info)
{
Int_t ok;
LOG(INFO) << "R3BPspxReader::Init" << FairLogger::endl;
LOG(INFO) << "R3BPspxReader::Init";
EXT_STR_h101_PSP_ITEMS_INFO(ok, *a_struct_info, fOffset, EXT_STR_h101_PSP, 0);

if (!ok)
Expand All @@ -79,7 +79,7 @@ Bool_t R3BPspxReader::Init(ext_data_struct_info* a_struct_info)
{
FairRootManager::Instance()->Register(
Form("Pspx%d_%cMapped", d + 1, xy[f]), Form("Pspx%d_%c", d + 1, xy[f]), fMappedItems[2 * d + f], kTRUE);
LOG(INFO) << "Registered Pspx" << d + 1 << "_" << xy[f] << FairLogger::endl;
LOG(INFO) << "Registered Pspx" << d + 1 << "_" << xy[f];
}
}
return kTRUE;
Expand Down
8 changes: 7 additions & 1 deletion tracker/unpackams/R3BAmsMapped2StripCalPar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ void R3BAmsMapped2StripCalPar::PrintParamsDaq()

// sam+gtb+siderem+20000
// Int_t detID[fNumDets] = { 40120000, 40220000, 41120000, 50120000, 50220000, 51120000 };
Int_t detID[fNumDets] = { 51120000, 50120000, 50220000, 41120000, 40120000, 40220000 };
Int_t detID[fNumDets];
detID[0] = 51120000;
detID[1] = 50120000;
detID[2] = 50220000;
detID[3] = 41120000;
detID[4] = 40120000;
detID[5] = 40220000;

for (Int_t d = 0; d < fNumDets; d++)
{
Expand Down

0 comments on commit ed50d2f

Please sign in to comment.