Skip to content

Commit

Permalink
address remaining static analyzer complaints in Validation/RecoTrack …
Browse files Browse the repository at this point in the history
…and Validation/RecoVertex
  • Loading branch information
mmusich committed Mar 24, 2021
1 parent 28d9f7a commit 7e32cc1
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 16 deletions.
Expand Up @@ -344,7 +344,7 @@ const GeomDet* JetCoreMCtruthSeedGenerator::DetectorSelector(int llay,
auto localInter = det->specificSurface().toLocal((GlobalPoint)inter);
if ((minDist == 0.0 || std::abs(localInter.x()) < minDist) && std::abs(localInter.y()) < 3.35) {
minDist = std::abs(localInter.x());
output = (GeomDet*)det;
output = const_cast<GeomDet*>(det);
}
} //detset
return output;
Expand Down
16 changes: 16 additions & 0 deletions Validation/RecoTrack/src/SiStripTrackingRecHitsValid.cc
Expand Up @@ -1217,6 +1217,10 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir,
closest = &m;
}
}

if (!closest)
return;

float closestX = closest->localPosition().x();
rechitpro.resx = rechitpro.x - closestX;
rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
Expand All @@ -1232,6 +1236,10 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir,
closest = &m;
}
}

if (!closest)
return;

float closestX = closest->localPosition().x();
rechitpro.resx = rechitpro.x - closestX;
rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
Expand Down Expand Up @@ -1333,6 +1341,10 @@ void SiStripTrackingRecHitsValid::rechitanalysis(LocalVector ldir,
closest = &m;
}
}

if (!closest)
return;

float closestX = closest->localPosition().x();
rechitpro.resx = rechitpro.x - closestX;
rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
Expand All @@ -1349,6 +1361,10 @@ void SiStripTrackingRecHitsValid::rechitanalysis(LocalVector ldir,
closest = &m;
}
}

if (!closest)
return;

float closestX = closest->localPosition().x();
rechitpro.resx = rechitpro.x - closestX;
rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
Expand Down
4 changes: 2 additions & 2 deletions Validation/RecoVertex/interface/TrackParameterAnalyzer.h
Expand Up @@ -21,7 +21,7 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

// simulated vertex
Expand All @@ -43,7 +43,7 @@ class TH2;
//
typedef reco::TrackBase::ParameterVector ParameterVector;

class TrackParameterAnalyzer : public edm::EDAnalyzer {
class TrackParameterAnalyzer : public edm::one::EDAnalyzer<> {
public:
explicit TrackParameterAnalyzer(const edm::ParameterSet&);
~TrackParameterAnalyzer() override;
Expand Down
4 changes: 2 additions & 2 deletions Validation/RecoVertex/src/AnotherPrimaryVertexAnalyzer.cc
Expand Up @@ -27,7 +27,7 @@
#include <string>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -47,7 +47,7 @@
// class decleration
//

class AnotherPrimaryVertexAnalyzer : public edm::EDAnalyzer {
class AnotherPrimaryVertexAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit AnotherPrimaryVertexAnalyzer(const edm::ParameterSet&);
~AnotherPrimaryVertexAnalyzer() override;
Expand Down
4 changes: 2 additions & 2 deletions Validation/RecoVertex/src/BSvsPVAnalyzer.cc
Expand Up @@ -27,7 +27,7 @@
#include <string>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -46,7 +46,7 @@
// class decleration
//

class BSvsPVAnalyzer : public edm::EDAnalyzer {
class BSvsPVAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit BSvsPVAnalyzer(const edm::ParameterSet&);
~BSvsPVAnalyzer() override;
Expand Down
4 changes: 2 additions & 2 deletions Validation/RecoVertex/src/BeamSpotAnalyzer.cc
Expand Up @@ -26,7 +26,7 @@
#include <limits>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -43,7 +43,7 @@
// class decleration
//

class AnotherBeamSpotAnalyzer : public edm::EDAnalyzer {
class AnotherBeamSpotAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit AnotherBeamSpotAnalyzer(const edm::ParameterSet&);
~AnotherBeamSpotAnalyzer() override;
Expand Down
4 changes: 3 additions & 1 deletion Validation/RecoVertex/src/BeamSpotHistogramMaker.cc
Expand Up @@ -20,11 +20,13 @@ BeamSpotHistogramMaker::~BeamSpotHistogramMaker() { delete _currdir; }

void BeamSpotHistogramMaker::book(const std::string dirname) {
edm::Service<TFileService> tfserv;
TFileDirectory* currdir = &(tfserv->tFileDirectory());
TFileDirectory* currdir;

if (!dirname.empty()) {
currdir = new TFileDirectory(tfserv->mkdir(dirname));
_currdir = currdir;
} else {
currdir = &(tfserv->tFileDirectory());
}

edm::LogInfo("HistogramBooking") << "BeamSpot histogram booking in directory " << dirname;
Expand Down
6 changes: 0 additions & 6 deletions Validation/RecoVertex/src/V0Validator.cc
Expand Up @@ -385,12 +385,6 @@ void V0Validator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
using namespace edm;
using namespace std;

// Get event setup info, B-field and tracker geometry
ESHandle<MagneticField> bFieldHandle;
iSetup.get<IdealMagneticFieldRecord>().get(bFieldHandle);
ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
iSetup.get<GlobalTrackingGeometryRecord>().get(globTkGeomHandle);

// Make matching collections
Handle<reco::RecoToSimCollection> recotosimCollectionH;
iEvent.getByToken(recoRecoToSimCollectionToken_, recotosimCollectionH);
Expand Down

0 comments on commit 7e32cc1

Please sign in to comment.