Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use int8_t rather than char #2386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Modules/PHOS/src/CalibQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void CalibQcTask::monitorData(o2::framework::ProcessingContext& ctx)
if (mMode == 0) { // Bad map
if (hasCalibDiff) {
auto diff = ctx.inputs().get<gsl::span<short>>("calibdiff");
char relid[3];
int8_t relid[3];
for (short absId = o2::phos::Mapping::NCHANNELS; absId > 1792; absId--) {
o2::phos::Geometry::absToRelNumbering(absId, relid);
mHist2D[kChangeHGM1 + relid[0] - 1]->SetBinContent(relid[1], relid[2], diff[absId]);
Expand All @@ -272,7 +272,7 @@ void CalibQcTask::monitorData(o2::framework::ProcessingContext& ctx)
} else if (mMode == 1) { // Pedestal
if (hasCalibDiff) {
auto diff = ctx.inputs().get<gsl::span<short>>("calibdiff");
char relid[3];
int8_t relid[3];
for (short absId = o2::phos::Mapping::NCHANNELS; absId > 1792; absId--) {
o2::phos::Geometry::absToRelNumbering(absId, relid);
mHist2D[kChangeHGM1 + relid[0] - 1]->SetBinContent(relid[1], relid[2], diff[absId]);
Expand All @@ -281,7 +281,7 @@ void CalibQcTask::monitorData(o2::framework::ProcessingContext& ctx)
}
if (hasPedestals) {
auto peds = o2::framework::DataRefUtils::as<o2::framework::CCDBSerialized<o2::phos::Pedestals>>(ctx.inputs().get<o2::framework::DataRef>("peds"));
char relid[3];
int8_t relid[3];
for (short absId = o2::phos::Mapping::NCHANNELS; absId > 1792; absId--) {
o2::phos::Geometry::absToRelNumbering(absId, relid);
mHist2D[kValueHGM1 + relid[0] - 1]->SetBinContent(relid[1], relid[2], peds->getHGPedestal(absId));
Expand All @@ -293,15 +293,15 @@ void CalibQcTask::monitorData(o2::framework::ProcessingContext& ctx)
} else if (mMode == 2) { // LED
if (hasCalibDiff) {
auto diff = ctx.inputs().get<gsl::span<float>>("calibdiff");
char relid[3];
int8_t relid[3];
for (short absId = o2::phos::Mapping::NCHANNELS; absId > 1792; absId--) {
o2::phos::Geometry::absToRelNumbering(absId, relid);
mHist2D[kChangeHGM1 + relid[0] - 1]->SetBinContent(relid[1], relid[2], diff[absId]);
}
}
if (hasCalibPars) {
auto calibParams = o2::framework::DataRefUtils::as<o2::framework::CCDBSerialized<o2::phos::CalibParams>>(ctx.inputs().get<o2::framework::DataRef>("calibpars"));
char relid[3];
int8_t relid[3];
for (short absId = o2::phos::Mapping::NCHANNELS; absId > 1792; absId--) {
o2::phos::Geometry::absToRelNumbering(absId, relid);
mHist2D[kValueHGM1 + relid[0] - 1]->SetBinContent(relid[1], relid[2], calibParams->getHGLGRatio(absId));
Expand Down
2 changes: 1 addition & 1 deletion Modules/PHOS/src/ClusterCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Quality ClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>
for (int ix = 1; ix <= 64; ix++) {
for (int iz = 1; iz <= 56; iz++) {
float cont = h->GetBinContent(ix, iz);
char relid[3] = { char(m), char(ix), char(iz) };
int8_t relid[3] = { int8_t(m), int8_t(ix), int8_t(iz) };
short absId;
o2::phos::Geometry::relToAbsNumbering(relid, absId);
if (cont > 0) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/PHOS/src/ClusterQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void ClusterQcTask::monitorData(o2::framework::ProcessingContext& ctx)
// Fill occupancy and time-E histos
float posX, posZ;
clu.getLocalPosition(posX, posZ);
char relid[3];
int8_t relid[3];
mGeom->relPosToRelId(mod, posX, posZ, relid);

if (e > mOccCut) {
Expand Down
10 changes: 5 additions & 5 deletions Modules/PHOS/src/RawQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void RawQcTask::monitorData(o2::framework::ProcessingContext& ctx)
address &= ~(1 << 14); // remove HG/LG bit 14
float chi = 0.2 * (*it);
it++;
char relid[3];
int8_t relid[3];
o2::phos::Geometry::absToRelNumbering(address, relid);
mHist2D[kChi2M1 + relid[0] - 1]->Fill(relid[1] - 0.5, relid[2] - 0.5, chi);
mHist2D[kChi2NormM1 + relid[0] - 1]->Fill(relid[1] - 0.5, relid[2] - 0.5);
Expand Down Expand Up @@ -393,7 +393,7 @@ void RawQcTask::endOfCycle()
ILOG(Info, Support) << " Caclulating number of peaks" << ENDM;
for (unsigned int absId = 1793; absId <= o2::phos::Mapping::NCHANNELS; absId++) {
int npeaks = mSpSearcher->Search(&(mSpectra[absId - 1793]), 2, "goff", 0.1);
char relid[3];
int8_t relid[3];
o2::phos::Geometry::absToRelNumbering(absId, relid);
short mod = relid[0] - 1;
int ibin = mHist2DMean[kLEDNpeaksM1 + mod]->FindBin(relid[1] - 0.5, relid[2] - 0.5);
Expand Down Expand Up @@ -446,7 +446,7 @@ void RawQcTask::FillTRUHistograms(const gsl::span<const o2::phos::Cell>& cells,
{
std::vector<int> triggerSTTiles;
std::vector<int> triggerDGTiles;
char relId[3] = { 0 };
int8_t relId[3] = { 0 };
for (const auto tr : cellsTR) {
triggerSTTiles.clear();
triggerDGTiles.clear();
Expand Down Expand Up @@ -534,7 +534,7 @@ void RawQcTask::FillPhysicsHistograms(const gsl::span<const o2::phos::Cell>& cel
// relid[0] = PHOS Module number 1,...4:module
// relid[1] = Row number inside a PHOS module (Phi coordinate)
// relid[2] = Column number inside a PHOS module (Z coordinate)
char relid[3];
int8_t relid[3];
o2::phos::Geometry::absToRelNumbering(address, relid);
short mod = relid[0] - 1;
int ibin = 0;
Expand Down Expand Up @@ -575,7 +575,7 @@ void RawQcTask::FillPedestalHistograms(const gsl::span<const o2::phos::Cell>& ce
for (int i = firstCellInEvent; i < lastCellInEvent; i++) {
const o2::phos::Cell c = cells[i];
short address = c.getAbsId();
char relid[3];
int8_t relid[3];
o2::phos::Geometry::absToRelNumbering(address, relid);
short mod = relid[0] - 1;
if (c.getHighGain()) {
Expand Down
Loading