Skip to content

Commit

Permalink
Merge pull request #17443 from davidlt/fix-align-gcc7
Browse files Browse the repository at this point in the history
Fix GCC 7 errors (inc. buffer size and fix TString conversion)
  • Loading branch information
cmsbuild committed Feb 10, 2017
2 parents b5bc9b2 + bbebe5a commit 9eda6f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Alignment/CocoaModel/src/CocoaDaqReaderRoot.cc
Expand Up @@ -8,6 +8,7 @@
#include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h"

#include <iostream>
#include <string>

#include "TClonesArray.h"

Expand Down Expand Up @@ -128,7 +129,7 @@ OpticalAlignMeasurementInfo CocoaDaqReaderRoot::GetMeasFromPosition2D( AliDaqPos
OpticalAlignMeasurementInfo meas;

meas.type_ = "SENSOR2D";
meas.name_ = pos2D->GetID();
meas.name_ = std::string(pos2D->GetID().Data());
//- std::vector<std::string> measObjectNames_;
std::vector<bool> isSimu;
for( size_t jj = 0; jj < 2; jj++ ){
Expand Down Expand Up @@ -160,7 +161,7 @@ OpticalAlignMeasurementInfo CocoaDaqReaderRoot::GetMeasFromPositionCOPS( AliDaqP
OpticalAlignMeasurementInfo meas;

meas.type_ = "COPS";
meas.name_ = posCOPS->GetID();
meas.name_ = std::string(posCOPS->GetID().Data());
//- std::vector<std::string> measObjectNames_;
std::vector<bool> isSimu;
for( size_t jj = 0; jj < 4; jj++ ){
Expand Down Expand Up @@ -205,7 +206,7 @@ OpticalAlignMeasurementInfo CocoaDaqReaderRoot::GetMeasFromTilt( AliDaqTilt* til
OpticalAlignMeasurementInfo meas;

meas.type_ = "TILTMETER";
meas.name_ = tilt->GetID();
meas.name_ = std::string(tilt->GetID().Data());
//- std::vector<std::string> measObjectNames_;
std::vector<bool> isSimu;
for( size_t jj = 0; jj < 2; jj++ ){
Expand All @@ -232,7 +233,7 @@ OpticalAlignMeasurementInfo CocoaDaqReaderRoot::GetMeasFromDist( AliDaqDistance*
OpticalAlignMeasurementInfo meas;

meas.type_ = "DISTANCEMETER";
meas.name_ = dist->GetID();
meas.name_ = std::string(dist->GetID().Data());
//- std::vector<std::string> measObjectNames_;
std::vector<bool> isSimu;
for( size_t jj = 0; jj < 2; jj++ ){
Expand Down
Expand Up @@ -55,7 +55,7 @@ void AlignmentMonitorGeneric::book()
alignableObjectId.idToString(type),
id, DetId(id).subdetId());

hists[n] = book1D(std::string("/iterN/") + std::string(name) + std::string("/"), std::string(histName), std::string(histTitle), nBin_, -5., 5.);
hists[n] = book1D(std::string("/iterN/") + std::string(name) + std::string("/"), std::string(histName.Data()), std::string(histTitle.Data()), nBin_, -5., 5.);
}
}

Expand Down
Expand Up @@ -1090,7 +1090,7 @@ HIPAlignmentAlgorithm::calcAPE(double* par, int iter, double function)
void HIPAlignmentAlgorithm::bookRoot(void)
{
TString tname="T1";
char iterString[5];
char iterString[15];
snprintf(iterString, sizeof(iterString), "%i",theIteration);
tname.Append("_");
tname.Append(iterString);
Expand Down
Expand Up @@ -837,7 +837,7 @@ void MuonAlignmentAnalyzer::endJob(){



char binLabel[15];
char binLabel[40];

for(unsigned int i=0 ; i<unitsLocalX.size() ; i++)
{
Expand Down

0 comments on commit 9eda6f6

Please sign in to comment.