Skip to content
Closed
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
32 changes: 24 additions & 8 deletions Alignment/Geners/interface/GenericIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ namespace gs {
inline static bool process(T &s, Stream &is, State *st, const bool processClassId) {
typedef IOTraits<T> M;
T *ps = &s;
return GenericReader<Stream, State, T, Int2Type<M::Signature &(M::ISPLACEREADABLE | M::ISHEAPREADABLE)>>::
return GenericReader<Stream,
State,
T,
Int2Type<static_cast<int>(M::Signature) &
(static_cast<int>(M::ISPLACEREADABLE) | static_cast<int>(M::ISHEAPREADABLE))>>::
readIntoPtr(ps, is, st, processClassId);
}
};
Expand All @@ -334,7 +338,9 @@ namespace gs {
// decision which simplifies things considerably.
typedef typename IOPointeeType<Ptr>::type Pointee;
typedef IOTraits<Pointee> M;
static_assert((M::Signature & (M::ISPOINTER | M::ISSHAREDPTR)) == 0, "can not write pointers to pointers");
static_assert(
(static_cast<int>(M::Signature) & (static_cast<int>(M::ISPOINTER) | static_cast<int>(M::ISSHAREDPTR))) == 0,
"can not write pointers to pointers");

// Can't have NULL pointers either. But this
// can be checked at run time only.
Expand All @@ -351,14 +357,19 @@ namespace gs {
// Note that the pointee itself can not be a pointer.
typedef typename IOPointeeType<Ptr>::type Pointee;
typedef IOTraits<Pointee> M;
static_assert((M::Signature & (M::ISPOINTER | M::ISSHAREDPTR)) == 0, "can not read pointers to pointers");
static_assert(
(static_cast<int>(M::Signature) & (static_cast<int>(M::ISPOINTER) | static_cast<int>(M::ISSHAREDPTR))) == 0,
"can not read pointers to pointers");

return GenericReader<
Stream,
State,
Pointee,
Int2Type<M::Signature &(M::ISPOD | M::ISSTDCONTAINER | M::ISHEAPREADABLE | M::ISPLACEREADABLE | M::ISPAIR |
M::ISTUPLE | M::ISEXTERNAL | M::ISSTRING)>>::readIntoPtr(ptr, str, s, processClassId);
Int2Type<static_cast<int>(M::Signature) &
(static_cast<int>(M::ISPOD) | static_cast<int>(M::ISSTDCONTAINER) |
static_cast<int>(M::ISHEAPREADABLE) | static_cast<int>(M::ISPLACEREADABLE) |
static_cast<int>(M::ISPAIR) | static_cast<int>(M::ISTUPLE) | static_cast<int>(M::ISEXTERNAL) |
static_cast<int>(M::ISSTRING))>>::readIntoPtr(ptr, str, s, processClassId);
}
};

Expand All @@ -370,14 +381,19 @@ namespace gs {
// Note that the pointee itself can not be a pointer.
typedef typename IOPointeeType<Ptr>::type Pointee;
typedef IOTraits<Pointee> M;
static_assert((M::Signature & (M::ISNULLPOINTER | M::ISSHAREDPTR)) == 0, "can not read pointers to pointers");
static_assert((static_cast<int>(M::Signature) &
(static_cast<int>(M::ISNULLPOINTER) | static_cast<int>(M::ISSHAREDPTR))) == 0,
"can not read pointers to pointers");

return GenericReader<
Stream,
State,
Pointee,
Int2Type<M::Signature &(M::ISPOD | M::ISSTDCONTAINER | M::ISPUREHEAPREADABLE | M::ISPLACEREADABLE | M::ISPAIR |
M::ISTUPLE | M::ISEXTERNAL | M::ISSTRING)>>::readIntoPtr(ptr, str, s, processClassId);
Int2Type<static_cast<int>(M::Signature) &
(static_cast<int>(M::ISPOD) | static_cast<int>(M::ISSTDCONTAINER) |
static_cast<int>(M::ISPUREHEAPREADABLE) | static_cast<int>(M::ISPLACEREADABLE) |
static_cast<int>(M::ISPAIR) | static_cast<int>(M::ISTUPLE) | static_cast<int>(M::ISEXTERNAL) |
static_cast<int>(M::ISSTRING))>>::readIntoPtr(ptr, str, s, processClassId);
}
};

Expand Down
14 changes: 10 additions & 4 deletions Alignment/Geners/interface/ProcessItem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ namespace gs {
T,
Arg1,
Arg2,
M::Signature &(M::ISPOD | M::ISSTDCONTAINER | M::ISWRITABLE | M::ISPOINTER | M::ISSHAREDPTR | M::ISIOPTR |
M::ISPAIR | M::ISSTRING | M::ISTUPLE | M::ISEXTERNAL)>::process(obj, a1, p2, processClassId);
static_cast<int>(M::Signature) &
(static_cast<int>(M::ISPOD) | static_cast<int>(M::ISSTDCONTAINER) | static_cast<int>(M::ISWRITABLE) |
static_cast<int>(M::ISPOINTER) | static_cast<int>(M::ISSHAREDPTR) | static_cast<int>(M::ISIOPTR) |
static_cast<int>(M::ISPAIR) | static_cast<int>(M::ISSTRING) | static_cast<int>(M::ISTUPLE) |
static_cast<int>(M::ISEXTERNAL))>::process(obj, a1, p2, processClassId);
}
} // namespace gs

Expand Down Expand Up @@ -332,8 +335,11 @@ namespace gs {
T,
Arg1,
Arg2,
M::Signature &(M::ISPOD | M::ISSTDCONTAINER | M::ISWRITABLE | M::ISPOINTER | M::ISSHAREDPTR | M::ISIOPTR |
M::ISPAIR | M::ISSTRING | M::ISTUPLE | M::ISEXTERNAL)>::process(obj, a1, p2, processClassId);
static_cast<int>(M::Signature) &
(static_cast<int>(M::ISPOD) | static_cast<int>(M::ISSTDCONTAINER) | static_cast<int>(M::ISWRITABLE) |
static_cast<int>(M::ISPOINTER) | static_cast<int>(M::ISSHAREDPTR) | static_cast<int>(M::ISIOPTR) |
static_cast<int>(M::ISPAIR) | static_cast<int>(M::ISSTRING) | static_cast<int>(M::ISTUPLE) |
static_cast<int>(M::ISEXTERNAL))>::process(obj, a1, p2, processClassId);
}
} // namespace gs

Expand Down
12 changes: 8 additions & 4 deletions CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ inline const uint32_t SiStripRegionCabling::region(const PositionIndex index) co
inline const uint32_t SiStripRegionCabling::elementIndex(const uint32_t region,
const SubDet subdet,
const uint32_t layer) {
return region * ALLSUBDETS * ALLLAYERS + subdet * ALLLAYERS + layer;
return region * static_cast<int>(ALLSUBDETS) * static_cast<int>(ALLLAYERS) + subdet * static_cast<int>(ALLLAYERS) +
layer;
}

inline const uint32_t SiStripRegionCabling::elementIndex(const PositionIndex index,
Expand All @@ -161,12 +162,15 @@ inline const uint32_t SiStripRegionCabling::elementIndex(const Position position
return elementIndex(region(position), subdet, layer);
}

inline const uint32_t SiStripRegionCabling::layer(const uint32_t index) { return index % ALLLAYERS; }
inline const uint32_t SiStripRegionCabling::layer(const uint32_t index) { return index % static_cast<int>(ALLLAYERS); }

inline const SiStripRegionCabling::SubDet SiStripRegionCabling::subdet(const uint32_t index) {
return static_cast<SiStripRegionCabling::SubDet>((index / ALLLAYERS) % ALLSUBDETS);
return static_cast<SiStripRegionCabling::SubDet>((index / static_cast<int>(ALLLAYERS)) %
static_cast<int>(ALLSUBDETS));
}

inline const uint32_t SiStripRegionCabling::region(const uint32_t index) { return index / (ALLSUBDETS * ALLLAYERS); }
inline const uint32_t SiStripRegionCabling::region(const uint32_t index) {
return index / (static_cast<int>(ALLSUBDETS) * static_cast<int>(ALLLAYERS));
}

#endif
4 changes: 2 additions & 2 deletions Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ bool ECALpedestalPCLHarvester::checkVariation(const EcalPedestalsMap& oldPedesta
nAnomaliesEE++;
}

if (nAnomaliesEB > thresholdAnomalies_ * EBDetId::kSizeForDenseIndexing ||
nAnomaliesEE > thresholdAnomalies_ * EEDetId::kSizeForDenseIndexing)
if (nAnomaliesEB > thresholdAnomalies_ * static_cast<int>(EBDetId::kSizeForDenseIndexing) ||
nAnomaliesEE > thresholdAnomalies_ * static_cast<int>(EEDetId::kSizeForDenseIndexing))
return true;

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace {
t1.DrawLatex(0.5, 0.96, Form("EB Channel Status Masks, IOV %i", run));

char txt[80];
Double_t prop = (Double_t)ebcount / kEBChannels * 100.;
Double_t prop = (Double_t)ebcount / static_cast<int>(kEBChannels) * 100.;
sprintf(txt, "%d/61200 (%4.3f%%)", ebcount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace {
t1.DrawLatex(0.5, 0.96, Form("EE Channel Status Masks, IOV %i", run));

char txt[80];
Double_t prop = (Double_t)eecount / kEEChannels * 100.;
Double_t prop = (Double_t)eecount / static_cast<int>(kEEChannels) * 100.;
sprintf(txt, "%d/14648 (%4.3f%%)", eecount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace {
t1.DrawLatex(0.5, 0.96, Form("EB DQM Channel Status, IOV %i", run));

char txt[80];
Double_t prop = (Double_t)ebcount / kEBChannels * 100.;
Double_t prop = (Double_t)ebcount / static_cast<int>(kEBChannels) * 100.;
sprintf(txt, "%d/61200 (%4.3f%%)", ebcount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
Expand Down Expand Up @@ -263,7 +263,7 @@ namespace {
t1.DrawLatex(0.5, 0.96, Form("EE DQM Channel Status, IOV %i", run));

char txt[80];
Double_t prop = (Double_t)eecount / kEEChannels * 100.;
Double_t prop = (Double_t)eecount / static_cast<int>(kEEChannels) * 100.;
sprintf(txt, "%d/14648 (%4.3f%%)", eecount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ namespace {
EBrms = sqrt(EBrms);
if (EBrms == 0.)
EBrms = 0.001;
double pEBmin = EBmean - kRMS * EBrms;
double pEBmax = EBmean + kRMS * EBrms;
double pEBmin = EBmean - static_cast<int>(kRMS) * EBrms;
double pEBmax = EBmean + static_cast<int>(kRMS) * EBrms;
// std::cout << " mean " << EBmean << " rms " << EBrms << " entries " << EBtot << " min " << pEBmin << " max " << pEBmax << std::endl;
vt = (double)EEtot;
EEmean = EEmean / vt;
EErms = EErms / vt - (EEmean * EEmean);
EErms = sqrt(EErms);
if (EErms == 0.)
EErms = 0.001;
double pEEmin = EEmean - kRMS * EErms;
double pEEmax = EEmean + kRMS * EErms;
double pEEmin = EEmean - static_cast<int>(kRMS) * EErms;
double pEEmax = EEmean + static_cast<int>(kRMS) * EErms;
// std::cout << " mean " << EEmean << " rms " << EErms << " entries " << EEtot << " min " << pEEmin << " max " << pEEmax << std::endl;

gStyle->SetPalette(1);
Expand Down Expand Up @@ -232,17 +232,17 @@ namespace {
EBrms = sqrt(EBrms);
if (EBrms == 0.)
EBrms = 0.001;
double pEBmin = EBmean - kRMS * EBrms;
double pEBmax = EBmean + kRMS * EBrms;
double pEBmin = EBmean - static_cast<int>(kRMS) * EBrms;
double pEBmax = EBmean + static_cast<int>(kRMS) * EBrms;
// std::cout << " mean " << EBmean << " rms " << EBrms << " entries " << EBtot << " min " << pEBmin << " max " << pEBmax << std::endl;
vt = (double)EEtot;
EEmean = EEmean / vt;
EErms = EErms / vt - (EEmean * EEmean);
EErms = sqrt(EErms);
if (EErms == 0.)
EErms = 0.001;
double pEEmin = EEmean - kRMS * EErms;
double pEEmax = EEmean + kRMS * EErms;
double pEEmin = EEmean - static_cast<int>(kRMS) * EErms;
double pEEmax = EEmean + static_cast<int>(kRMS) * EErms;
// std::cout << " mean " << EEmean << " rms " << EErms << " entries " << EEtot << " min " << pEEmin << " max " << pEEmax << std::endl;

gStyle->SetPalette(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ namespace {
EBrms[valId] = sqrt(EBrms[valId]);
if (EBrms[valId] == 0.)
EBrms[valId] = 0.001;
pEBmin[valId] = EBmean[valId] - kRMS * EBrms[valId];
pEBmax[valId] = EBmean[valId] + kRMS * EBrms[valId];
pEBmin[valId] = EBmean[valId] - static_cast<int>(kRMS) * EBrms[valId];
pEBmax[valId] = EBmean[valId] + static_cast<int>(kRMS) * EBrms[valId];
// std::cout << " mean " << EBmean[valId] << " rms " << EBrms[valId] << " entries " << EBtot[valId] << " min " << pEBmin[valId]
// << " max " << pEBmax[valId] << std::endl;
vt = (double)EEtot[valId];
Expand All @@ -180,8 +180,8 @@ namespace {
EErms[valId] = sqrt(EErms[valId]);
if (EErms[valId] == 0.)
EErms[valId] = 0.001;
pEEmin[valId] = EEmean[valId] - kRMS * EErms[valId];
pEEmax[valId] = EEmean[valId] + kRMS * EErms[valId];
pEEmin[valId] = EEmean[valId] - static_cast<int>(kRMS) * EErms[valId];
pEEmax[valId] = EEmean[valId] + static_cast<int>(kRMS) * EErms[valId];
// std::cout << " mean " << EEmean[valId] << " rms " << EErms[valId] << " entries " << EEtot[valId] << " min " << pEEmin[valId]
// << " max " << pEEmax[valId] << std::endl;
}
Expand Down Expand Up @@ -424,8 +424,8 @@ namespace {
EBrms[valId] = sqrt(EBrms[valId]);
if (EBrms[valId] == 0.)
EBrms[valId] = 0.001;
pEBmin[valId] = EBmean[valId] - kRMS * EBrms[valId];
pEBmax[valId] = EBmean[valId] + kRMS * EBrms[valId];
pEBmin[valId] = EBmean[valId] - static_cast<int>(kRMS) * EBrms[valId];
pEBmax[valId] = EBmean[valId] + static_cast<int>(kRMS) * EBrms[valId];
// std::cout << " mean " << EBmean[valId] << " rms " << EBrms[valId] << " entries " << EBtot[valId] << " min " << pEBmin[valId]
// << " max " << pEBmax[valId] << std::endl;
vt = (double)EEtot[valId];
Expand All @@ -434,8 +434,8 @@ namespace {
EErms[valId] = sqrt(EErms[valId]);
if (EErms[valId] == 0.)
EErms[valId] = 0.001;
pEEmin[valId] = EEmean[valId] - kRMS * EErms[valId];
pEEmax[valId] = EEmean[valId] + kRMS * EErms[valId];
pEEmin[valId] = EEmean[valId] - static_cast<int>(kRMS) * EErms[valId];
pEEmax[valId] = EEmean[valId] + static_cast<int>(kRMS) * EErms[valId];
// std::cout << " mean " << EEmean[valId] << " rms " << EErms[valId] << " entries " << EEtot[valId] << " min " << pEEmin[valId]
// << " max " << pEEmax[valId] << std::endl;
}
Expand Down
Loading