Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TurnOnHistos
/// \param bitset with channels fired in event
void fillFiredMap(const std::bitset<NCHANNELS>& bs)
{
for (short i = NCHANNELS; --i;) {
for (size_t i = 0; i < NCHANNELS; ++i) {
if (bs[i]) {
mGoodMap[i]++;
}
Expand All @@ -87,7 +87,7 @@ class TurnOnHistos
/// \param bitset with channels fired in event
void fillNoisyMap(const std::bitset<NCHANNELS>& bs)
{
for (short i = NCHANNELS; --i;) {
for (size_t i = 0; i < NCHANNELS; ++i) {
if (bs[i]) {
mNoisyMap[i]++;
}
Expand Down
6 changes: 3 additions & 3 deletions Detectors/PHOS/calib/src/PHOSRunbyrunCalibrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ bool PHOSRunbyrunSlot::checkCluster(const Cluster& clu)
return false;
}
// First check BadMap
float posX, posZ;
float posX{0}, posZ{0};
clu.getLocalPosition(posX, posZ);
short absId;
short absId{0};
Geometry::relPosToAbsId(clu.module(), posX, posZ, absId);
if (!mBadMap->isChannelGood(absId)) {
if (mBadMap && absId >= 0 && !mBadMap->isChannelGood(absId)) {
return false;
}
return (clu.getEnergy() > 0.3 && clu.getMultiplicity() > 1);
Expand Down
16 changes: 9 additions & 7 deletions Detectors/PHOS/calib/src/PHOSTurnonCalibrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PHOSTurnonSlot::PHOSTurnonSlot(bool useCCDB) : mUseCCDB(useCCDB)
PHOSTurnonSlot::PHOSTurnonSlot(const PHOSTurnonSlot& other)
{
mUseCCDB = other.mUseCCDB;
mRunStartTime = other.mUseCCDB;
mRunStartTime = other.mRunStartTime;
mFiredTiles.reset();
mNoisyTiles.reset();
mTurnOnHistos = std::make_unique<TurnOnHistos>();
Expand Down Expand Up @@ -91,23 +91,25 @@ void PHOSTurnonSlot::scanClusters(const gsl::span<const Cell>& cells, const Trig
for (int i = firstCellInEvent; i < lastCellInEvent; i++) {
const Cell& c = cells[i];
if (c.getTRU()) {
mNoisyTiles.set(c.getTRUId() - Geometry::getTotalNCells() - 1);
auto channel = c.getTRUId() - Geometry::getTotalNCells() - 1;
if (channel >= 0) {
mNoisyTiles.set(channel);
}
}
}

// Copy to have good and noisy map
mFiredTiles.reset();
char mod;
float x, z;
short ddl;
float x{0}, z{0};
short ddl{0};
int firstCluInEvent = clutr.getFirstEntry();
int lastCluInEvent = firstCluInEvent + clutr.getNumberOfObjects();
for (int i = firstCluInEvent; i < lastCluInEvent; i++) {
const Cluster& clu = clusters[i];
if (clu.getEnergy() < 1.e-4) {
continue;
}
mod = clu.module();
char mod = clu.module();
clu.getLocalPosition(x, z);
// TODO: do we need separate 2x2 and 4x4 spectra? Switch?
// short truId2x2 = Geometry::relPosToTruId(mod, x, z, 0);
Expand All @@ -123,7 +125,7 @@ void PHOSTurnonSlot::scanClusters(const gsl::span<const Cell>& cells, const Trig
// Fill final good and noisy maps
mTurnOnHistos->fillFiredMap(mFiredTiles);
mNoisyTiles ^= mFiredTiles;
mTurnOnHistos->fillNoisyMap(mFiredTiles);
mTurnOnHistos->fillNoisyMap(mNoisyTiles);
}
//==============================================

Expand Down