Commit ed98465c authored by Jochen Meyer's avatar Jochen Meyer Committed by Graeme Stewart
Browse files

addressing coverity defects (MuonLayerHough-00-00-25)

        * addressing coverity defects 13778, 13976, 14007, 14490-1, 14547, 14772, 29022
        * Tagged as MuonLayerHough-00-00-25
parent ad0f662c
......@@ -25,14 +25,15 @@ namespace MuonHough {
TH2F* Unmatched;
TH1F* Efficiency;
TH1F* FakeEfficiency;
TH2F* Diff;
TH2F* Diff;
};
class LayerAnalysis {
public:
LayerAnalysis( TTree& tree ) : m_tree(&tree) {
LayerAnalysis( TTree& tree ) : m_tree(&tree), m_ncalls(0) {
m_ntuple.reset();
m_ntuple.initForRead(tree);
}
......
......@@ -44,7 +44,8 @@ namespace MuonHough {
/// struct representing the maximum in the hough space
struct Maximum {
Maximum() : hough(0) {}
Maximum() : max(0.), pos(0.), theta(0.), binpos(-1), binposmin(-1),
binposmax(-1), bintheta(-1), triggerConfirmed(0), hough(0) {}
float max; // value of the maximum
float pos; // spacial position
......@@ -126,7 +127,7 @@ namespace MuonHough {
float m_binsize; /// binsize
float m_invbinsize; /// inverse binsize
unsigned int m_nthetasamples;
// unsigned int m_nthetasamples;
int m_nbins;
unsigned int max;
......
......@@ -18,7 +18,7 @@ namespace MuonHough {
struct MuonPhiLayerHough {
struct Maximum {
Maximum() : hough(0) {}
Maximum() : max(0.), pos(0.), binpos(-1), binposmin(-1), binposmax(-1), sector(-1), hough(nullptr) {}
float max;
float pos;
......@@ -97,6 +97,12 @@ namespace MuonHough {
int m_nbins;
bool m_debug;
unsigned int* m_histo;
private:
// fake copy constructor and assignment operator
MuonPhiLayerHough(const MuonPhiLayerHough&);
MuonPhiLayerHough & operator=(const MuonPhiLayerHough &right);
};
}
......
......@@ -331,8 +331,11 @@ namespace MuonHough {
}
Hit* hit = new Hit(lay[i],x[i],ymin[i],ymax[i],w[i],debug);
DataIndex index(debug->sector,debug->region,debug->layer,debug->type);
HitList& hitList = event.sectors[debug->sector][index];
DataIndex index(sector[i],
static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region[i]),
static_cast<Muon::MuonStationIndex::LayerIndex>(layer[i]),
type[i]);
HitList& hitList = event.sectors[sector[i]][index];
hitList.push_back( hit );
}
......
......@@ -178,7 +178,7 @@ namespace MuonHough {
}
void LayerAnalysis::drawSector( int region, int sector, SectorData& data, MuonDetectorHough& detectorHough, MuonDetectorHough& detectorHoughTruth ) {
void LayerAnalysis::drawSector( int region, int sector, SectorData& /*data*/, MuonDetectorHough& detectorHough, MuonDetectorHough& detectorHoughTruth ) {
TString canvasName = Form("event_%i_sector_%i,_display_%i", m_ncalls, sector, region);
// TCanvas canvas(canvasName,canvasName,1500,1100);
......@@ -335,7 +335,7 @@ namespace MuonHough {
hists[pos]->SetFillStyle(3244);
hists[pos]->SetFillColor(1);
hists[pos]->Draw();
int chIndex = hough.m_descriptor.chIndex;
// int chIndex = hough.m_descriptor.chIndex;
histsTruth[pos]->SetLineColor(2);
histsTruth[pos]->Draw("SAME");
// float maxPos = fabs(hists[pos]->GetXaxis()->GetBinCenter(hists[pos]->GetMaximumBin()));
......
......@@ -32,7 +32,7 @@ namespace MuonHough {
{
if (cut.first < pos) return cut.second;
}
return m_cutValues.end()->second;
return m_cutValues.back().second;
}
float MuonLayerHoughSelector::getMinCutValue() const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment