Skip to content

Commit

Permalink
Merge pull request #27356 from cms-sw/code-format-dqm-dc1567
Browse files Browse the repository at this point in the history
Running code-format for dqm
  • Loading branch information
cmsbuild committed Jun 27, 2019
2 parents a6a5dff + c63eff3 commit 8bd29e3
Show file tree
Hide file tree
Showing 12 changed files with 5,789 additions and 4,955 deletions.
68 changes: 34 additions & 34 deletions Validation/RecoTrack/interface/MultiTrackValidator.h
Expand Up @@ -25,19 +25,19 @@
#include "DataFormats/Common/interface/ValueMap.h"
#include "DataFormats/Candidate/interface/Candidate.h"


class PileupSummaryInfo;
namespace reco {
class DeDxData;
class DeDxData;
}

struct MultiTrackValidatorHistograms {
MTVHistoProducerAlgoForTrackerHistograms histoProducerAlgo;
std::vector<ConcurrentMonitorElement> h_reco_coll, h_assoc_coll, h_assoc2_coll, h_simul_coll, h_looper_coll, h_pileup_coll;
std::vector<ConcurrentMonitorElement> h_reco_coll, h_assoc_coll, h_assoc2_coll, h_simul_coll, h_looper_coll,
h_pileup_coll;
};

class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistograms> {
public:
public:
using Histograms = MultiTrackValidatorHistograms;

/// Constructor
Expand All @@ -46,14 +46,12 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistog
/// Destructor
~MultiTrackValidator() override;


/// Method called once per event
void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms& ) const override;
void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms&) const override;
/// Method called to book the DQM histograms
void bookHistograms(DQMStore::ConcurrentBooker&, edm::Run const&, edm::EventSetup const&, Histograms&) const override;


protected:
protected:
//these are used by MTVGenPs
// MTV-specific data members
std::vector<edm::InputTag> associators;
Expand All @@ -62,17 +60,17 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistog
edm::EDGetTokenT<TrackingParticleRefVector> label_tp_effic_refvector;
edm::EDGetTokenT<TrackingParticleRefVector> label_tp_fake_refvector;
edm::EDGetTokenT<TrackingVertexCollection> label_tv;
edm::EDGetTokenT<std::vector<PileupSummaryInfo> > label_pileupinfo;
edm::EDGetTokenT<std::vector<PileupSummaryInfo>> label_pileupinfo;

std::vector<edm::EDGetTokenT<std::vector<PSimHit> > > simHitTokens_;
std::vector<edm::EDGetTokenT<std::vector<PSimHit>>> simHitTokens_;

std::vector<edm::InputTag> label;
std::vector<edm::EDGetTokenT<edm::View<reco::Track> > > labelToken;
std::vector<edm::EDGetTokenT<edm::View<TrajectorySeed> > > labelTokenSeed;
edm::EDGetTokenT<reco::BeamSpot> bsSrc;
std::vector<edm::EDGetTokenT<edm::View<reco::Track>>> labelToken;
std::vector<edm::EDGetTokenT<edm::View<TrajectorySeed>>> labelTokenSeed;
edm::EDGetTokenT<reco::BeamSpot> bsSrc;

edm::EDGetTokenT<edm::ValueMap<reco::DeDxData> > m_dEdx1Tag;
edm::EDGetTokenT<edm::ValueMap<reco::DeDxData> > m_dEdx2Tag;
edm::EDGetTokenT<edm::ValueMap<reco::DeDxData>> m_dEdx1Tag;
edm::EDGetTokenT<edm::ValueMap<reco::DeDxData>> m_dEdx2Tag;

std::string parametersDefiner;

Expand All @@ -94,16 +92,19 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistog

std::unique_ptr<MTVHistoProducerAlgoForTracker> histoProducerAlgo_;

private:
const TrackingVertex::LorentzVector *getSimPVPosition(const edm::Handle<TrackingVertexCollection>& htv) const;
const reco::Vertex::Point *getRecoPVPosition(const edm::Event& event, const edm::Handle<TrackingVertexCollection>& htv) const;
void tpParametersAndSelection(const Histograms& histograms,
const TrackingParticleRefVector& tPCeff,
const ParametersDefinerForTP& parametersDefinerTP,
const edm::Event& event, const edm::EventSetup& setup,
const reco::BeamSpot& bs,
std::vector<std::tuple<TrackingParticle::Vector, TrackingParticle::Point> >& momVert_tPCeff,
std::vector<size_t>& selected_tPCeff) const;
private:
const TrackingVertex::LorentzVector* getSimPVPosition(const edm::Handle<TrackingVertexCollection>& htv) const;
const reco::Vertex::Point* getRecoPVPosition(const edm::Event& event,
const edm::Handle<TrackingVertexCollection>& htv) const;
void tpParametersAndSelection(
const Histograms& histograms,
const TrackingParticleRefVector& tPCeff,
const ParametersDefinerForTP& parametersDefinerTP,
const edm::Event& event,
const edm::EventSetup& setup,
const reco::BeamSpot& bs,
std::vector<std::tuple<TrackingParticle::Vector, TrackingParticle::Point>>& momVert_tPCeff,
std::vector<size_t>& selected_tPCeff) const;
size_t tpDR(const TrackingParticleRefVector& tPCeff,
const std::vector<size_t>& selected_tPCeff,
DynArray<float>& dR_tPCeff,
Expand All @@ -119,21 +120,21 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistog
std::vector<edm::EDGetTokenT<reco::SimToRecoCollection>> associatormapStRs;
std::vector<edm::EDGetTokenT<reco::RecoToSimCollection>> associatormapRtSs;

edm::EDGetTokenT<edm::ValueMap<unsigned int> > tpNLayersToken_;
edm::EDGetTokenT<edm::ValueMap<unsigned int> > tpNPixelLayersToken_;
edm::EDGetTokenT<edm::ValueMap<unsigned int> > tpNStripStereoLayersToken_;

edm::EDGetTokenT<edm::ValueMap<unsigned int>> tpNLayersToken_;
edm::EDGetTokenT<edm::ValueMap<unsigned int>> tpNPixelLayersToken_;
edm::EDGetTokenT<edm::ValueMap<unsigned int>> tpNStripStereoLayersToken_;

using MVACollection = std::vector<float>;
using QualityMaskCollection = std::vector<unsigned char>;
std::vector<std::vector<std::tuple<edm::EDGetTokenT<MVACollection>, edm::EDGetTokenT<QualityMaskCollection> > > > mvaQualityCollectionTokens_;
std::vector<std::vector<std::tuple<edm::EDGetTokenT<MVACollection>, edm::EDGetTokenT<QualityMaskCollection>>>>
mvaQualityCollectionTokens_;

std::string dirName_;

bool useGsf;
const double simPVMaxZ_;

edm::EDGetTokenT<edm::View<reco::Candidate> > cores_;
edm::EDGetTokenT<edm::View<reco::Candidate>> cores_;
double ptMinJet_;
// select tracking particles
//(i.e. "denominator" of the efficiency ratio)
Expand All @@ -143,10 +144,9 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer<MultiTrackValidatorHistog
std::unique_ptr<RecoTrackSelectorBase> dRTrackSelector;

edm::EDGetTokenT<SimHitTPAssociationProducer::SimHitTPAssociationList> _simHitTpMapTag;
edm::EDGetTokenT<edm::View<reco::Track> > labelTokenForDrCalculation;
edm::EDGetTokenT<edm::View<reco::Vertex> > recoVertexToken_;
edm::EDGetTokenT<edm::View<reco::Track>> labelTokenForDrCalculation;
edm::EDGetTokenT<edm::View<reco::Vertex>> recoVertexToken_;
edm::EDGetTokenT<reco::VertexToTrackingVertexAssociator> vertexAssociatorToken_;
};


#endif
11 changes: 4 additions & 7 deletions Validation/RecoTrack/interface/MultiTrackValidatorGenPs.h
Expand Up @@ -12,24 +12,21 @@
#include "SimDataFormats/Associations/interface/TrackToGenParticleAssociator.h"

class MultiTrackValidatorGenPs : public MultiTrackValidator {
public:
public:
/// Constructor
MultiTrackValidatorGenPs(const edm::ParameterSet& pset);

/// Destructor
~MultiTrackValidatorGenPs() override;

/// Method called once per event
void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms& ) const override;
void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms&) const override;

private:

GenParticleCustomSelector gpSelector;
GenParticleCustomSelector gpSelector;
edm::EDGetTokenT<reco::TrackToGenParticleAssociator> label_gen_associator;
edm::EDGetTokenT<reco::GenToRecoCollection> associatormapGtR;
edm::EDGetTokenT<reco::RecoToGenCollection> associatormapRtG;

};


#endif
116 changes: 57 additions & 59 deletions Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h
Expand Up @@ -30,7 +30,7 @@
#include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
#include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h"
#include "TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h"
#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
Expand All @@ -49,12 +49,12 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"

//--- for SimHit association
#include "SimDataFormats/TrackingHit/interface/PSimHit.h"
#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
#include "SimDataFormats/TrackingHit/interface/PSimHit.h"
#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
#include "Geometry/CommonTopologies/interface/PixelTopology.h"
#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GluedGeomDet.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
Expand All @@ -66,24 +66,23 @@
class TTree;
class TFile;

class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer
{
public:

class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer {
public:
explicit SiPixelTrackingRecHitsValid(const edm::ParameterSet& conf);

~SiPixelTrackingRecHitsValid() override;

void analyze(const edm::Event& e, const edm::EventSetup& c) override;
void bookHistograms(DQMStore::IBooker & ibooker,const edm::Run& run, const edm::EventSetup& es) override;
void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) override;
void beginJob() override;
void endJob() override;

//xt std::pair<LocalPoint,LocalVector> projectHit( const PSimHit& hit, const StripGeomDetUnit* stripDet,const BoundPlane& plane);
std::pair<LocalPoint,LocalVector> projectHit( const PSimHit& hit, const PixelGeomDetUnit* pixelDet,const BoundPlane& plane);

private:
std::pair<LocalPoint, LocalVector> projectHit(const PSimHit& hit,
const PixelGeomDetUnit* pixelDet,
const BoundPlane& plane);

private:
TrackerHitAssociator::Config trackerHitAssociatorConfig_;
//TrackLocalAngle *anglefinder_;
DQMStore* dbe_;
Expand All @@ -95,11 +94,11 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer
edm::EDGetTokenT<reco::TrackCollection> recoTrackCollectionToken_;
bool MTCCtrack_;

bool checkType_; // do we check that the simHit associated with recHit is of the expected particle type ?
int genType_; // the type of particle that the simHit associated with recHits should be
bool checkType_; // do we check that the simHit associated with recHit is of the expected particle type ?
int genType_; // the type of particle that the simHit associated with recHits should be

// Pixel barrel detector has 3 layers and 8 modules; book histograms for each module = (layer, ring) pair

MonitorElement* mePosxBarrelLayerModule[3][8];
MonitorElement* mePosyBarrelLayerModule[3][8];
MonitorElement* meErrxBarrelLayerModule[3][8];
Expand All @@ -124,7 +123,7 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer
MonitorElement* mePullYvsPhiBarrelLayerModule[3][8];
MonitorElement* mePullXvsEtaBarrelLayerModule[3][8];
MonitorElement* mePullYvsEtaBarrelLayerModule[3][8];

// All layers and modules together
MonitorElement* mePosxBarrel;
MonitorElement* mePosyBarrel;
Expand Down Expand Up @@ -195,7 +194,7 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer
MonitorElement* meWPullXvsBetaBarrelNonFlippedLadders;
MonitorElement* meWPullYvsBetaBarrelNonFlippedLadders;

// Split barrel x/y residuals and pulls in 3 layers
// Split barrel x/y residuals and pulls in 3 layers
MonitorElement* meResxBarrelLayer[3];
MonitorElement* meResyBarrelLayer[3];
MonitorElement* mePullxBarrelLayer[3];
Expand Down Expand Up @@ -447,71 +446,70 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer
MonitorElement* meWPullXvsBetaZpPanel2;
MonitorElement* meWPullYvsBetaZpPanel2;

// all hits (not only from tracks)
// all hits (not only from tracks)
MonitorElement* mePosxBarrel_all_hits;
MonitorElement* mePosyBarrel_all_hits;

MonitorElement* mePosxZmPanel1_all_hits;
MonitorElement* mePosyZmPanel1_all_hits;
MonitorElement* mePosxZmPanel2_all_hits;
MonitorElement* mePosyZmPanel2_all_hits;

MonitorElement* mePosxZpPanel1_all_hits;
MonitorElement* mePosyZpPanel1_all_hits;
MonitorElement* mePosxZpPanel2_all_hits;
MonitorElement* mePosyZpPanel2_all_hits;

// control histograms
MonitorElement* meTracksPerEvent;
MonitorElement* mePixRecHitsPerTrack;


// variables that go in the output tree
float rechitx; // x position of hit
float rechity; // y position of hit
float rechitz; // z position of hit
float rechiterrx; // x position error of hit (error not squared)
float rechiterry; // y position error of hit (error not squared)
float rechitx; // x position of hit
float rechity; // y position of hit
float rechitz; // z position of hit
float rechiterrx; // x position error of hit (error not squared)
float rechiterry; // y position error of hit (error not squared)

float rechitresx; // difference between reconstructed hit x position and 'true' x position
float rechitresy; // difference between reconstructed hit y position and 'true' y position
float rechitpullx; // x residual divideded by error
float rechitpully; // y residual divideded by error
float rechitresx; // difference between reconstructed hit x position and 'true' x position
float rechitresy; // difference between reconstructed hit y position and 'true' y position
float rechitpullx; // x residual divideded by error
float rechitpully; // y residual divideded by error

int npix; // number of pixel in the cluster
int nxpix; // size of cluster (number of pixels) along x direction
int nypix; // size of cluster (number of pixels) along y direction
float charge; // total charge in cluster
int npix; // number of pixel in the cluster
int nxpix; // size of cluster (number of pixels) along x direction
int nypix; // size of cluster (number of pixels) along y direction
float charge; // total charge in cluster

float alpha; // track angle in the xz plane of the module local coordinate system
float beta; // track angle in the yz plane of the module local coordinate system
float alpha; // track angle in the xz plane of the module local coordinate system
float beta; // track angle in the yz plane of the module local coordinate system

float phi; // polar track angle
float eta; // pseudo-rapidity (function of theta, the azimuthal angle)
float phi; // polar track angle
float eta; // pseudo-rapidity (function of theta, the azimuthal angle)

int subdetId;
int layer;
int ladder;
int mod;
int side;
int disk;
int blade;
int panel;
int plaq;
int half; // half = 1 if the barrel module is half size and 0 if it is full size (only defined for barrel)
int flipped; // flipped = 1 if the module is flipped and 0 if non-flipped (only defined for barrel)

int nsimhit; // number of simhits associated with a rechit
int pidhit; // PID of the particle that produced the simHit associated with the recHit

float simhitx; // true x position of hit
float simhity; // true y position of hit
int layer;
int ladder;
int mod;
int side;
int disk;
int blade;
int panel;
int plaq;
int half; // half = 1 if the barrel module is half size and 0 if it is full size (only defined for barrel)
int flipped; // flipped = 1 if the module is flipped and 0 if non-flipped (only defined for barrel)

int nsimhit; // number of simhits associated with a rechit
int pidhit; // PID of the particle that produced the simHit associated with the recHit

float simhitx; // true x position of hit
float simhity; // true y position of hit

edm::EventNumber_t evt;
edm::RunNumber_t run;

TFile * tfile_;
TTree * t_;
TFile* tfile_;
TTree* t_;
};

#endif

0 comments on commit 8bd29e3

Please sign in to comment.