Skip to content

Commit 1a6eba4

Browse files
authored
Merge pull request #47498 from iarspider/iarspider-patches-20250304-1
[ALCA-DB] Fix static analyzer warnings
2 parents 7d36b67 + f44769d commit 1a6eba4

File tree

23 files changed

+113
-135
lines changed

23 files changed

+113
-135
lines changed

Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "Alignment/CocoaModel/interface/DeviationsFromFileSensor2D.h"
99
#include "Alignment/CocoaUtilities/interface/ALIFileIn.h"
1010
#include "Alignment/CocoaUtilities/interface/ALIUtils.h"
11+
#include <cassert>
1112
#include <cstdlib>
1213
#include <cmath> // include floating-point std::abs functions
1314
#include <memory>
@@ -188,6 +189,7 @@ std::pair<ALIdouble, ALIdouble> DeviationsFromFileSensor2D::getDevis(ALIdouble i
188189
}
189190
ii++;
190191
}
192+
assert(ii == theNPoints);
191193
if (insideMatrix == 0) {
192194
std::cerr << "!!EXITING intersection in Y outside matrix of deviations from file " << intersY << std::endl;
193195
exit(1);

Alignment/CocoaModel/src/Measurement.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ void Measurement::copyMeas(Measurement* meas, const std::string& subsstr1, const
627627
theValueSimulated = new ALIdouble[theDim];
628628
theValueSimulated_orig = new ALIdouble[theDim];
629629
theValueIsSimulated = new ALIbool[theDim];
630-
theValue = const_cast<ALIdouble*>(meas->value());
631-
theSigma = const_cast<ALIdouble*>(meas->sigma());
630+
[[clang::suppress]] theValue = const_cast<ALIdouble*>(meas->value());
631+
[[clang::suppress]] theSigma = const_cast<ALIdouble*>(meas->sigma());
632632

633633
unsigned int ii;
634634
for (ii = 0; ii < theDim; ii++) {

Alignment/OfflineValidation/bin/haddws.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void haddws() {
170170

171171
void MergeRootfile(TDirectory *target, const vector<pair<TFile *, double> > &vFileList) {
172172
//cout << "Target path: " << target->GetPath() << endl;
173-
TString path((char *)strstr(target->GetPath(), ":"));
173+
TString path(strstr(target->GetPath(), ":"));
174174
path.Remove(0, 2);
175175

176176
vec_pair_it it = vFileList.begin();

Alignment/OfflineValidation/macros/loopAndPlot.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void recurseOverKeys(TDirectory *target1, const std::vector<TString> &labels, bo
8888
fullPath.Remove(0, prefixToRemove.Length());
8989
}
9090

91-
TString path((char *)strstr(fullPath.Data(), ":"));
91+
TString path(strstr(fullPath.Data(), ":"));
9292
path.Remove(0, 2);
9393

9494
sourceFiles[0]->cd(path);

CalibCalorimetry/CastorCalib/src/CastorDbHardcode.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ void CastorDbHardcode::makeHardcodeMap(CastorElectronicsMap& emap) {
368368
/* three channels per fiber */
369369
for (ifc = 0; ifc < EMAP_NFCH; ifc++) {
370370
icrate = hocrate[ic];
371-
idepth = 1;
372371
ieta = ihoetasidephi[ih][itb][ifb][ifc][0];
373372
iside = ihoetasidephi[ih][itb][ifb][ifc][1];
374373
iphi_loc = ihoetasidephi[ih][itb][ifb][ifc][2];

CalibCalorimetry/CastorCalib/src/CastorPedestalAnalysis.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ void CastorPedestalAnalysis::Trendings(std::map<HcalDetId, std::map<int, PEDBUNC
672672
_meot->second[i].second.second[4]->GetYaxis()->SetTitle("Distant correlation");
673673
_meot->second[i].second.second[4]->Write(); */
674674
// chi2
675-
j = 0;
676675
for (sample_it = _meot->second[i].second.first[4].begin(); sample_it != _meot->second[i].second.first[4].end();
677676
++sample_it) {
678677
Chi2->Fill(*sample_it);

CalibCalorimetry/EcalLaserAnalyzer/src/MELaserPrim.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ void MELaserPrim::fillHistograms() {
611611
nentries = pn_tree->GetEntriesFast();
612612
assert(nentries % 2 == 0);
613613
int module_(0);
614-
id1_ = _sm;
615-
id2_ = 0;
616614

617615
Long64_t jentry = 0;
618616

CalibFormats/SiPixelObjects/interface/PixelConfigBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace pos {
6868
void setAuthor(std::string author) { creator_ = author; }
6969
void setComment(std::string comment) { comment_ = comment; }
7070
std::string getAuthor() const { return creator_; }
71-
std::string getComment() const { return base64_encode((unsigned char *)comment_.c_str(), comment_.length()); }
71+
std::string getComment() const { return base64_encode((unsigned char const *)comment_.c_str(), comment_.length()); }
7272

7373
private:
7474
std::string description_;

CalibFormats/SiPixelObjects/src/PixelFEDCard.cc

Lines changed: 103 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ PixelFEDCard::PixelFEDCard(vector<vector<string> > &tableMat) : PixelConfigBase(
2424
vector<string> ins = tableMat[0];
2525
map<string, int> colM;
2626
vector<string> colNames;
27-
bool first = true;
2827
/**
2928
EXTENSION_TABLE_NAME: FED_CONFIGURATION (VIEW: CONF_KEY_FED_CONFIGURATION_V)
3029
@@ -252,111 +251,109 @@ PixelFEDCard::PixelFEDCard(vector<vector<string> > &tableMat) : PixelConfigBase(
252251
}
253252

254253
// Read below quantities pertaining to a single FED that are equal accross 36 channels
255-
if (first) {
256-
first = false;
257-
//VME base address
258-
//Fed Base Address
259-
sscanf(tableMat[1][colM["VME_ADDRS_HEX"]].c_str(), "%lx", &FEDBASE_0);
260-
// sscanf(tableMat[1][colM["PIXEL_FED"]].c_str(), "PxlFED_%ld",&fedNumber);
261-
fedNumber = atoi(tableMat[1][colM["PIXEL_FED"]].c_str());
262-
//Settable optical input parameters (one for each 12-receiver)
263-
opt_cap[0] = atoi(tableMat[1][colM["OPT1_CAP"]].c_str());
264-
opt_cap[1] = atoi(tableMat[1][colM["OPT2_CAP"]].c_str());
265-
opt_cap[2] = atoi(tableMat[1][colM["OPT3_CAP"]].c_str());
266-
opt_inadj[0] = atoi(tableMat[1][colM["OPT1_INP"]].c_str());
267-
opt_inadj[1] = atoi(tableMat[1][colM["OPT2_INP"]].c_str());
268-
opt_inadj[2] = atoi(tableMat[1][colM["OPT3_INP"]].c_str());
269-
opt_ouadj[0] = atoi(tableMat[1][colM["OPT1_OUT"]].c_str());
270-
opt_ouadj[1] = atoi(tableMat[1][colM["OPT2_OUT"]].c_str());
271-
opt_ouadj[2] = atoi(tableMat[1][colM["OPT3_OUT"]].c_str());
272-
273-
//clock phases, use bits 0-8, select the clock edged
274-
clkphs1_9 = atoi(tableMat[1][colM["NORTH_CLKPHB"]].c_str()); // TO BE VERIFIED
275-
clkphs10_18 = atoi(tableMat[1][colM["NORTHCENTER_CLKPHB"]].c_str()); // TO BE VERIFIED
276-
clkphs19_27 = atoi(tableMat[1][colM["SOUTHCENTER_CLKPHB"]].c_str()); // TO BE VERIFIED
277-
clkphs28_36 = atoi(tableMat[1][colM["SOUTH_CLKPHB"]].c_str()); // TO BE VERIFIED
278-
279-
// Control register and delays for the TTCrx
280-
FineDes1Del = atoi(tableMat[1][colM["REG0_TTCRX_FDLA"]].c_str());
281-
FineDes2Del = atoi(tableMat[1][colM["REG1_TTCRX_FDLA"]].c_str());
282-
CoarseDel = atoi(tableMat[1][colM["REG2_TTCRX_CDLA"]].c_str());
283-
ClkDes2 = atoi(tableMat[1][colM["REG3_TTCRX_CLKD2"]].c_str());
284-
285-
Ccntrl = atoi(tableMat[1][colM["CENTER_CTRL"]].c_str());
286-
modeRegister = atoi(tableMat[1][colM["CENTER_MODE"]].c_str());
287-
288-
//data Regs adjustable fifo Almost Full levels
289-
Nfifo1Bzlvl = atoi(tableMat[1][colM["NORTH_FIFO1_BZ_LVL"]].c_str());
290-
NCfifo1Bzlvl = atoi(tableMat[1][colM["NORTHCENTER_FIFO1_BZ_LVL"]].c_str());
291-
SCfifo1Bzlvl = atoi(tableMat[1][colM["SOUTHCENTER_FIFO1_BZ_LVL"]].c_str());
292-
Sfifo1Bzlvl = atoi(tableMat[1][colM["SOUTH_FIFO1_BZ_LVL"]].c_str());
293-
294-
//Bits (1st 8) used to mask TBM trailer bits
295-
N_TBMmask = atoi(tableMat[1][colM["NORTH_TBMMASK"]].c_str());
296-
NC_TBMmask = atoi(tableMat[1][colM["NORTHCENTER_TBMMASK"]].c_str());
297-
SC_TBMmask = atoi(tableMat[1][colM["SOUTHCENTER_TBMMASK"]].c_str());
298-
S_TBMmask = atoi(tableMat[1][colM["SOUTH_TBMMASK"]].c_str());
299-
300-
//Bits (1st 8) used to set the Private Word in the gap and filler words
301-
N_Pword = atoi(tableMat[1][colM["NORTH_PWORD"]].c_str());
302-
NC_Pword = atoi(tableMat[1][colM["NORTHCENTER_PWORD"]].c_str());
303-
SC_Pword = atoi(tableMat[1][colM["SOUTHCENTER_PWORD"]].c_str());
304-
S_Pword = atoi(tableMat[1][colM["SOUTH_PWORD"]].c_str());
305-
306-
Nbaseln = atoi(tableMat[1][colM["NORTH_BADJ"]].c_str());
307-
NCbaseln = atoi(tableMat[1][colM["NORTHCENTER_BADJ"]].c_str());
308-
SCbaseln = atoi(tableMat[1][colM["SOUTHCENTER_BADJ"]].c_str());
309-
Sbaseln = atoi(tableMat[1][colM["SOUTH_BADJ"]].c_str());
310-
311-
Ncntrl = atoi(tableMat[1][colM["NORTH_CTRL"]].c_str());
312-
NCcntrl = atoi(tableMat[1][colM["NORTHCENTER_CTRL"]].c_str());
313-
SCcntrl = atoi(tableMat[1][colM["SOUTHCENTER_CTRL"]].c_str());
314-
Scntrl = atoi(tableMat[1][colM["SOUTH_CTRL"]].c_str());
315-
316-
//These bit sets the special dac mode for random triggers
317-
SpecialDac = atoi(tableMat[1][colM["SPECDAC"]].c_str());
318-
319-
//These bits set the number of Out of consecutive out of sync events until a TTs OOs
320-
Ooslvl = atoi(tableMat[1][colM["OOS_LVL"]].c_str());
321-
//These bits set the number of Empty events until a TTs Error
322-
Errlvl = atoi(tableMat[1][colM["ERR_LVL"]].c_str());
323-
324-
//Control Regs for setting ADC 1Vpp and 2Vpp
325-
Nadcg = atoi(tableMat[1][colM["B1_ADCGN"]].c_str());
326-
NCadcg = atoi(tableMat[1][colM["B2_ADCGN"]].c_str());
327-
SCadcg = atoi(tableMat[1][colM["B3_ADCGN"]].c_str());
328-
Sadcg = atoi(tableMat[1][colM["B4_ADCGN"]].c_str());
329-
fifo3Wrnlvl = atoi(tableMat[1][colM["FIFO3_WRN_LVL"]].c_str());
330-
FedTTCDelay = atoi(tableMat[1][colM["FED_MASTER_DELAY"]].c_str());
331-
N_hitlimit = atoi(tableMat[1][colM["NO_HITLIMIT"]].c_str());
332-
NC_hitlimit = atoi(tableMat[1][colM["NC_HITLIMIT"]].c_str());
333-
SC_hitlimit = atoi(tableMat[1][colM["SC_HITLIMIT"]].c_str());
334-
S_hitlimit = atoi(tableMat[1][colM["SO_HITLIMIT"]].c_str());
335-
N_testreg = atoi(tableMat[1][colM["NO_TESTREG"]].c_str());
336-
NC_testreg = atoi(tableMat[1][colM["NC_TESTREG"]].c_str());
337-
SC_testreg = atoi(tableMat[1][colM["SC_TESTREG"]].c_str());
338-
S_testreg = atoi(tableMat[1][colM["SO_TESTREG"]].c_str());
339-
BusyHoldMin = atoi(tableMat[1][colM["BUSYHOLDMIN"]].c_str());
340-
BusyWhenBehind = atoi(tableMat[1][colM["BUSYWHENBEHIND"]].c_str());
341-
FeatureRegister = atoi(tableMat[1][colM["FEATUREREGISTER"]].c_str());
342-
FIFO2Limit = atoi(tableMat[1][colM["FIFO2LIMIT"]].c_str());
343-
LastDacOff = atoi(tableMat[1][colM["LASTDACOFF"]].c_str());
344-
SimHitsPerRoc = atoi(tableMat[1][colM["SIMHITSPERROC"]].c_str());
345-
TimeoutOROOSLimit = atoi(tableMat[1][colM["TIMEOUTOROOSLIMIT"]].c_str());
346-
TriggerHoldoff = atoi(tableMat[1][colM["TRIGGERHOLDOFF"]].c_str());
347-
348-
SPARE1 = atoi(tableMat[1][colM["SPARE1"]].c_str());
349-
SPARE2 = atoi(tableMat[1][colM["SPARE2"]].c_str());
350-
SPARE3 = atoi(tableMat[1][colM["SPARE3"]].c_str());
351-
SPARE4 = atoi(tableMat[1][colM["SPARE4"]].c_str());
352-
SPARE5 = atoi(tableMat[1][colM["SPARE5"]].c_str());
353-
SPARE6 = atoi(tableMat[1][colM["SPARE6"]].c_str());
354-
SPARE7 = atoi(tableMat[1][colM["SPARE7"]].c_str());
355-
SPARE8 = atoi(tableMat[1][colM["SPARE8"]].c_str());
356-
SPARE9 = atoi(tableMat[1][colM["SPARE9"]].c_str());
357-
SPARE10 = atoi(tableMat[1][colM["SPARE10"]].c_str());
358-
359-
} // end of 'first' condition
254+
255+
//VME base address
256+
//Fed Base Address
257+
sscanf(tableMat[1][colM["VME_ADDRS_HEX"]].c_str(), "%lx", &FEDBASE_0);
258+
// sscanf(tableMat[1][colM["PIXEL_FED"]].c_str(), "PxlFED_%ld",&fedNumber);
259+
fedNumber = atoi(tableMat[1][colM["PIXEL_FED"]].c_str());
260+
//Settable optical input parameters (one for each 12-receiver)
261+
opt_cap[0] = atoi(tableMat[1][colM["OPT1_CAP"]].c_str());
262+
opt_cap[1] = atoi(tableMat[1][colM["OPT2_CAP"]].c_str());
263+
opt_cap[2] = atoi(tableMat[1][colM["OPT3_CAP"]].c_str());
264+
opt_inadj[0] = atoi(tableMat[1][colM["OPT1_INP"]].c_str());
265+
opt_inadj[1] = atoi(tableMat[1][colM["OPT2_INP"]].c_str());
266+
opt_inadj[2] = atoi(tableMat[1][colM["OPT3_INP"]].c_str());
267+
opt_ouadj[0] = atoi(tableMat[1][colM["OPT1_OUT"]].c_str());
268+
opt_ouadj[1] = atoi(tableMat[1][colM["OPT2_OUT"]].c_str());
269+
opt_ouadj[2] = atoi(tableMat[1][colM["OPT3_OUT"]].c_str());
270+
271+
//clock phases, use bits 0-8, select the clock edged
272+
clkphs1_9 = atoi(tableMat[1][colM["NORTH_CLKPHB"]].c_str()); // TO BE VERIFIED
273+
clkphs10_18 = atoi(tableMat[1][colM["NORTHCENTER_CLKPHB"]].c_str()); // TO BE VERIFIED
274+
clkphs19_27 = atoi(tableMat[1][colM["SOUTHCENTER_CLKPHB"]].c_str()); // TO BE VERIFIED
275+
clkphs28_36 = atoi(tableMat[1][colM["SOUTH_CLKPHB"]].c_str()); // TO BE VERIFIED
276+
277+
// Control register and delays for the TTCrx
278+
FineDes1Del = atoi(tableMat[1][colM["REG0_TTCRX_FDLA"]].c_str());
279+
FineDes2Del = atoi(tableMat[1][colM["REG1_TTCRX_FDLA"]].c_str());
280+
CoarseDel = atoi(tableMat[1][colM["REG2_TTCRX_CDLA"]].c_str());
281+
ClkDes2 = atoi(tableMat[1][colM["REG3_TTCRX_CLKD2"]].c_str());
282+
283+
Ccntrl = atoi(tableMat[1][colM["CENTER_CTRL"]].c_str());
284+
modeRegister = atoi(tableMat[1][colM["CENTER_MODE"]].c_str());
285+
286+
//data Regs adjustable fifo Almost Full levels
287+
Nfifo1Bzlvl = atoi(tableMat[1][colM["NORTH_FIFO1_BZ_LVL"]].c_str());
288+
NCfifo1Bzlvl = atoi(tableMat[1][colM["NORTHCENTER_FIFO1_BZ_LVL"]].c_str());
289+
SCfifo1Bzlvl = atoi(tableMat[1][colM["SOUTHCENTER_FIFO1_BZ_LVL"]].c_str());
290+
Sfifo1Bzlvl = atoi(tableMat[1][colM["SOUTH_FIFO1_BZ_LVL"]].c_str());
291+
292+
//Bits (1st 8) used to mask TBM trailer bits
293+
N_TBMmask = atoi(tableMat[1][colM["NORTH_TBMMASK"]].c_str());
294+
NC_TBMmask = atoi(tableMat[1][colM["NORTHCENTER_TBMMASK"]].c_str());
295+
SC_TBMmask = atoi(tableMat[1][colM["SOUTHCENTER_TBMMASK"]].c_str());
296+
S_TBMmask = atoi(tableMat[1][colM["SOUTH_TBMMASK"]].c_str());
297+
298+
//Bits (1st 8) used to set the Private Word in the gap and filler words
299+
N_Pword = atoi(tableMat[1][colM["NORTH_PWORD"]].c_str());
300+
NC_Pword = atoi(tableMat[1][colM["NORTHCENTER_PWORD"]].c_str());
301+
SC_Pword = atoi(tableMat[1][colM["SOUTHCENTER_PWORD"]].c_str());
302+
S_Pword = atoi(tableMat[1][colM["SOUTH_PWORD"]].c_str());
303+
304+
Nbaseln = atoi(tableMat[1][colM["NORTH_BADJ"]].c_str());
305+
NCbaseln = atoi(tableMat[1][colM["NORTHCENTER_BADJ"]].c_str());
306+
SCbaseln = atoi(tableMat[1][colM["SOUTHCENTER_BADJ"]].c_str());
307+
Sbaseln = atoi(tableMat[1][colM["SOUTH_BADJ"]].c_str());
308+
309+
Ncntrl = atoi(tableMat[1][colM["NORTH_CTRL"]].c_str());
310+
NCcntrl = atoi(tableMat[1][colM["NORTHCENTER_CTRL"]].c_str());
311+
SCcntrl = atoi(tableMat[1][colM["SOUTHCENTER_CTRL"]].c_str());
312+
Scntrl = atoi(tableMat[1][colM["SOUTH_CTRL"]].c_str());
313+
314+
//These bit sets the special dac mode for random triggers
315+
SpecialDac = atoi(tableMat[1][colM["SPECDAC"]].c_str());
316+
317+
//These bits set the number of Out of consecutive out of sync events until a TTs OOs
318+
Ooslvl = atoi(tableMat[1][colM["OOS_LVL"]].c_str());
319+
//These bits set the number of Empty events until a TTs Error
320+
Errlvl = atoi(tableMat[1][colM["ERR_LVL"]].c_str());
321+
322+
//Control Regs for setting ADC 1Vpp and 2Vpp
323+
Nadcg = atoi(tableMat[1][colM["B1_ADCGN"]].c_str());
324+
NCadcg = atoi(tableMat[1][colM["B2_ADCGN"]].c_str());
325+
SCadcg = atoi(tableMat[1][colM["B3_ADCGN"]].c_str());
326+
Sadcg = atoi(tableMat[1][colM["B4_ADCGN"]].c_str());
327+
fifo3Wrnlvl = atoi(tableMat[1][colM["FIFO3_WRN_LVL"]].c_str());
328+
FedTTCDelay = atoi(tableMat[1][colM["FED_MASTER_DELAY"]].c_str());
329+
N_hitlimit = atoi(tableMat[1][colM["NO_HITLIMIT"]].c_str());
330+
NC_hitlimit = atoi(tableMat[1][colM["NC_HITLIMIT"]].c_str());
331+
SC_hitlimit = atoi(tableMat[1][colM["SC_HITLIMIT"]].c_str());
332+
S_hitlimit = atoi(tableMat[1][colM["SO_HITLIMIT"]].c_str());
333+
N_testreg = atoi(tableMat[1][colM["NO_TESTREG"]].c_str());
334+
NC_testreg = atoi(tableMat[1][colM["NC_TESTREG"]].c_str());
335+
SC_testreg = atoi(tableMat[1][colM["SC_TESTREG"]].c_str());
336+
S_testreg = atoi(tableMat[1][colM["SO_TESTREG"]].c_str());
337+
BusyHoldMin = atoi(tableMat[1][colM["BUSYHOLDMIN"]].c_str());
338+
BusyWhenBehind = atoi(tableMat[1][colM["BUSYWHENBEHIND"]].c_str());
339+
FeatureRegister = atoi(tableMat[1][colM["FEATUREREGISTER"]].c_str());
340+
FIFO2Limit = atoi(tableMat[1][colM["FIFO2LIMIT"]].c_str());
341+
LastDacOff = atoi(tableMat[1][colM["LASTDACOFF"]].c_str());
342+
SimHitsPerRoc = atoi(tableMat[1][colM["SIMHITSPERROC"]].c_str());
343+
TimeoutOROOSLimit = atoi(tableMat[1][colM["TIMEOUTOROOSLIMIT"]].c_str());
344+
TriggerHoldoff = atoi(tableMat[1][colM["TRIGGERHOLDOFF"]].c_str());
345+
346+
SPARE1 = atoi(tableMat[1][colM["SPARE1"]].c_str());
347+
SPARE2 = atoi(tableMat[1][colM["SPARE2"]].c_str());
348+
SPARE3 = atoi(tableMat[1][colM["SPARE3"]].c_str());
349+
SPARE4 = atoi(tableMat[1][colM["SPARE4"]].c_str());
350+
SPARE5 = atoi(tableMat[1][colM["SPARE5"]].c_str());
351+
SPARE6 = atoi(tableMat[1][colM["SPARE6"]].c_str());
352+
SPARE7 = atoi(tableMat[1][colM["SPARE7"]].c_str());
353+
SPARE8 = atoi(tableMat[1][colM["SPARE8"]].c_str());
354+
SPARE9 = atoi(tableMat[1][colM["SPARE9"]].c_str());
355+
SPARE10 = atoi(tableMat[1][colM["SPARE10"]].c_str());
356+
360357
[[clang::suppress]]
361358
for (int r = 1; r < size[0]; r++) //Goes to every row of the FIRST Matrix (MUST BE 36, one for each FED channel)
362359
{

CalibTracker/SiPixelGainCalibration/plugins/SiPixelGainCalibrationAnalysis.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Description: <one line class summary>
2323
#include <cmath>
2424
#include "TGraphErrors.h"
2525
#include "TMath.h"
26+
#include "FWCore/Utilities/interface/isFinite.h"
2627

2728
using std::cout;
2829
using std::endl;
@@ -209,7 +210,6 @@ bool SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelC
209210
for (uint32_t ii = 0; ii < ipix->getnpoints() && ii < 200; ii++) {
210211
// std::cout << ipix->getsum(ii) << " " << ipix->getnentries(ii) << " " << ipix->getsumsquares(ii) << std::endl;
211212
nallpoints++;
212-
use_point = true;
213213
if (useVcalHigh_) {
214214
xvalsall[ii] = vCalValues_[ii] * scalarVcalHigh_VcalLow_;
215215
} else
@@ -276,7 +276,6 @@ bool SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelC
276276
use_point = false;
277277
if (ii > 1 && fabs(yvalsall[ii] - yvalsall[ii - 1]) < 5. && yvalsall[ii] > 0.8 * maxgoodvalinfit &&
278278
reject_plateaupoints_) {
279-
use_point = false;
280279
break;
281280
}
282281

@@ -289,8 +288,6 @@ bool SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelC
289288
}
290289

291290
float chi2, slope, intercept, prob, slopeerror, intercepterror;
292-
prob = chi2 = -1;
293-
slope = intercept = slopeerror = intercepterror = 0;
294291

295292
// now check on number of points. If bad just start taking the first 4:
296293

@@ -344,7 +341,7 @@ bool SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelC
344341
chi2 = func_->GetChisquare() / ((float)npoints - func_->GetNpar());
345342
prob = TMath::Prob(func_->GetChisquare(), npoints - func_->GetNpar());
346343
size_t ntimes = 0;
347-
while ((std::isnan(slope) || std::isnan(intercept)) && ntimes < 10) {
344+
while ((edm::isNotFinite(slope) || edm::isNotFinite(intercept)) && ntimes < 10) {
348345
ntimes++;
349346
makehistopersistent = true;
350347
// std::cout << slope << " " << intercept << " " << prob << std::endl;
@@ -368,7 +365,7 @@ bool SiPixelGainCalibrationAnalysis::doFits(uint32_t detid, std::vector<SiPixelC
368365
status = 0;
369366
if (slope != 0)
370367
slope = 1. / slope;
371-
if (std::isnan(slope) || std::isnan(intercept)) {
368+
if (edm::isNotFinite(slope) || edm::isNotFinite(intercept)) {
372369
status = -6;
373370
bookkeeper_[detid]["status_2d"]->setBinContent(ipix->col() + 1, ipix->row() + 1, status);
374371
if (writeSummary_) {

0 commit comments

Comments
 (0)