Skip to content

Commit

Permalink
Merge pull request #1 from mmasciov/mmasciovScoutingMuonRun3
Browse files Browse the repository at this point in the history
Scouting muon producer and class update
  • Loading branch information
jsalfeld committed Nov 3, 2020
2 parents a66ccc6 + 47bbb97 commit 87f3a41
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 123 deletions.
1 change: 1 addition & 0 deletions DataFormats/Scouting/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/Common"/>
<export>
<lib name="1"/>
Expand Down
206 changes: 141 additions & 65 deletions DataFormats/Scouting/interface/ScoutingMuon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define DataFormats_ScoutingMuon_h

#include <vector>
#include "DataFormats/TrackReco/interface/Track.h"

// Class for holding muon information, for use in data scouting
// IMPORTANT: the content of this class should be changed only in backwards compatible ways!
Expand All @@ -12,33 +13,43 @@ class ScoutingMuon {
float eta,
float phi,
float m,
unsigned int type,
int charge,
float normalizedChi2,
float ecalIso,
float hcalIso,
float trackIso,
float chi2,
float ndof,
int charge,
float dxy,
float dz,
int nValidMuonHits,
int nValidStandAloneMuonHits,
int nStandAloneMuonMatchedStations,
int nValidRecoMuonHits,
int nRecoMuonChambers,
int nRecoMuonChambersCSCorDT,
int nRecoMuonMatches,
int nRecoMuonMatchedStations,
unsigned int nRecoMuonExpectedMatchedStations,
unsigned int recoMuonStationMask,
int nRecoMuonMatchedRPCLayers,
unsigned int recoMuonRPClayerMask,
int nValidPixelHits,
int nMatchedStations,
int nTrackerLayersWithMeasurement,
int type,
int nValidStripHits,
int nPixelLayersWithMeasurement,
int nTrackerLayersWithMeasurement,
float trk_chi2,
float trk_ndof,
float trk_dxy,
float trk_dz,
float trk_qoverp,
float trk_lambda,
float trk_pt,
float trk_phi,
float trk_eta,
float dxyError,
float dzError,
float trk_dxyError,
float trk_dzError,
float trk_qoverpError,
float trk_lambdaError,
float trk_phiError,
float trk_dsz,
float trk_dszError,
std::vector<int> vtxIndx,
float trk_qoverp_lambda_cov,
float trk_qoverp_phi_cov,
float trk_qoverp_dxy_cov,
Expand All @@ -48,38 +59,53 @@ class ScoutingMuon {
float trk_lambda_dsz_cov,
float trk_phi_dxy_cov,
float trk_phi_dsz_cov,
float trk_dxy_dsz_cov)
float trk_dxy_dsz_cov,
float trk_vx,
float trk_vy,
float trk_vz,
reco::HitPattern trk_hitPattern,
std::vector<int> vtxIndx)
: pt_(pt),
eta_(eta),
phi_(phi),
m_(m),
type_(type),
charge_(charge),
normalizedChi2_(normalizedChi2),
ecalIso_(ecalIso),
hcalIso_(hcalIso),
trackIso_(trackIso),
chi2_(chi2),
ndof_(ndof),
charge_(charge),
dxy_(dxy),
dz_(dz),
nValidMuonHits_(nValidMuonHits),
nValidStandAloneMuonHits_(nValidStandAloneMuonHits),
nStandAloneMuonMatchedStations_(nStandAloneMuonMatchedStations),
nValidRecoMuonHits_(nValidRecoMuonHits),
nRecoMuonChambers_(nRecoMuonChambers),
nRecoMuonChambersCSCorDT_(nRecoMuonChambersCSCorDT),
nRecoMuonMatches_(nRecoMuonMatches),
nRecoMuonMatchedStations_(nRecoMuonMatchedStations),
nRecoMuonExpectedMatchedStations_(nRecoMuonExpectedMatchedStations),
recoMuonStationMask_(recoMuonStationMask),
nRecoMuonMatchedRPCLayers_(nRecoMuonMatchedRPCLayers),
recoMuonRPClayerMask_(recoMuonRPClayerMask),
nValidPixelHits_(nValidPixelHits),
nMatchedStations_(nMatchedStations),
nTrackerLayersWithMeasurement_(nTrackerLayersWithMeasurement),
type_(type),
nValidStripHits_(nValidStripHits),
nPixelLayersWithMeasurement_(nPixelLayersWithMeasurement),
nTrackerLayersWithMeasurement_(nTrackerLayersWithMeasurement),
trk_chi2_(trk_chi2),
trk_ndof_(trk_ndof),
trk_dxy_(trk_dxy),
trk_dz_(trk_dz),
trk_qoverp_(trk_qoverp),
trk_lambda_(trk_lambda),
trk_pt_(trk_pt),
trk_phi_(trk_phi),
trk_eta_(trk_eta),
dxyError_(dxyError),
dzError_(dzError),
trk_dxyError_(trk_dxyError),
trk_dzError_(trk_dzError),
trk_qoverpError_(trk_qoverpError),
trk_lambdaError_(trk_lambdaError),
trk_phiError_(trk_phiError),
trk_dsz_(trk_dsz),
trk_dszError_(trk_dszError),
vtxIndx_(std::move(vtxIndx)),
trk_qoverp_lambda_cov_(trk_qoverp_lambda_cov),
trk_qoverp_phi_cov_(trk_qoverp_phi_cov),
trk_qoverp_dxy_cov_(trk_qoverp_dxy_cov),
Expand All @@ -89,40 +115,55 @@ class ScoutingMuon {
trk_lambda_dsz_cov_(trk_lambda_dsz_cov),
trk_phi_dxy_cov_(trk_phi_dxy_cov),
trk_phi_dsz_cov_(trk_phi_dsz_cov),
trk_dxy_dsz_cov_(trk_dxy_dsz_cov) {}
trk_dxy_dsz_cov_(trk_dxy_dsz_cov),
trk_vx_(trk_vx),
trk_vy_(trk_vy),
trk_vz_(trk_vz),
trk_hitPattern_(trk_hitPattern),
vtxIndx_(std::move(vtxIndx)) {}
//default constructor
ScoutingMuon()
: pt_(0),
eta_(0),
phi_(0),
m_(0),
type_(0),
charge_(0),
normalizedChi2_(0),
ecalIso_(0),
hcalIso_(0),
trackIso_(0),
chi2_(0),
ndof_(0),
charge_(0),
dxy_(0),
dz_(0),
nValidMuonHits_(0),
nValidStandAloneMuonHits_(0),
nStandAloneMuonMatchedStations_(0),
nValidRecoMuonHits_(0),
nRecoMuonChambers_(0),
nRecoMuonChambersCSCorDT_(0),
nRecoMuonMatches_(0),
nRecoMuonMatchedStations_(0),
nRecoMuonExpectedMatchedStations_(0),
recoMuonStationMask_(0),
nRecoMuonMatchedRPCLayers_(0),
recoMuonRPClayerMask_(0),
nValidPixelHits_(0),
nMatchedStations_(0),
nTrackerLayersWithMeasurement_(0),
type_(0),
nValidStripHits_(0),
nPixelLayersWithMeasurement_(0),
nTrackerLayersWithMeasurement_(0),
trk_chi2_(0),
trk_ndof_(0),
trk_dxy_(0),
trk_dz_(0),
trk_qoverp_(0),
trk_lambda_(0),
trk_pt_(0),
trk_phi_(0),
trk_eta_(0),
dxyError_(0),
dzError_(0),
trk_dxyError_(0),
trk_dzError_(0),
trk_qoverpError_(0),
trk_lambdaError_(0),
trk_phiError_(0),
trk_dsz_(0),
trk_dszError_(0),
vtxIndx_(0),
trk_qoverp_lambda_cov_(0),
trk_qoverp_phi_cov_(0),
trk_qoverp_dxy_cov_(0),
Expand All @@ -132,42 +173,57 @@ class ScoutingMuon {
trk_lambda_dsz_cov_(0),
trk_phi_dxy_cov_(0),
trk_phi_dsz_cov_(0),
trk_dxy_dsz_cov_(0) {}
trk_dxy_dsz_cov_(0),
trk_vx_(0),
trk_vy_(0),
trk_vz_(0),
trk_hitPattern_(reco::HitPattern()),
vtxIndx_(0) {}

//accessor functions
float pt() const { return pt_; }
float eta() const { return eta_; }
float phi() const { return phi_; }
float m() const { return m_; }
unsigned int type() const { return type_; }
bool isGlobalMuon() const { return type_ & 1 << 1; }
bool isTrackerMuon() const { return type_ & 1 << 2; }
int charge() const { return charge_; }
float normalizedChi2() const { return normalizedChi2_; }
float ecalIso() const { return ecalIso_; }
float hcalIso() const { return hcalIso_; }
float trackIso() const { return trackIso_; }
float chi2() const { return chi2_; }
float ndof() const { return ndof_; }
int charge() const { return charge_; }
float dxy() const { return dxy_; }
float dz() const { return dz_; }
int nValidMuonHits() const { return nValidMuonHits_; }
int nValidStandAloneMuonHits() const { return nValidStandAloneMuonHits_; }
int nStandAloneMuonMatchedStations() const { return nStandAloneMuonMatchedStations_; }
int nValidRecoMuonHits() const { return nValidRecoMuonHits_; }
int nRecoMuonChambers() const { return nRecoMuonChambers_; }
int nRecoMuonChambersCSCorDT() const { return nRecoMuonChambersCSCorDT_; }
int nRecoMuonMatches() const { return nRecoMuonMatches_; }
int nRecoMuonMatchedStations() const { return nRecoMuonMatchedStations_; }
unsigned int nRecoMuonExpectedMatchedStations() const { return nRecoMuonExpectedMatchedStations_; }
unsigned int recoMuonStationMask() const { return recoMuonStationMask_; }
int nRecoMuonMatchedRPCLayers() const { return nRecoMuonMatchedRPCLayers_; }
unsigned int recoMuonRPClayerMask() const { return recoMuonRPClayerMask_; }
int nValidPixelHits() const { return nValidPixelHits_; }
int nMatchedStations() const { return nMatchedStations_; }
int nTrackerLayersWithMeasurement() const { return nTrackerLayersWithMeasurement_; }
int type() const { return type_; }
bool isGlobalMuon() const { return type_ & 1 << 1; }
bool isTrackerMuon() const { return type_ & 1 << 2; }
int nValidStripHits() const { return nValidStripHits_; }
int nPixelLayersWithMeasurement() const { return nPixelLayersWithMeasurement_; }
int nTrackerLayersWithMeasurement() const { return nTrackerLayersWithMeasurement_; }
float trk_chi2() const { return trk_chi2_; }
float trk_ndof() const { return trk_ndof_; }
float trk_dxy() const { return trk_dxy_; }
float trk_dz() const { return trk_dz_; }
float trk_qoverp() const { return trk_qoverp_; }
float trk_lambda() const { return trk_lambda_; }
float trk_pt() const { return trk_pt_; }
float trk_phi() const { return trk_phi_; }
float trk_eta() const { return trk_eta_; }
float dxyError() const { return dxyError_; }
float dzError() const { return dzError_; }
float trk_dxyError() const { return trk_dxyError_; }
float trk_dzError() const { return trk_dzError_; }
float trk_qoverpError() const { return trk_qoverpError_; }
float trk_lambdaError() const { return trk_lambdaError_; }
float trk_phiError() const { return trk_phiError_; }
float trk_dsz() const { return trk_dsz_; }
float trk_dszError() const { return trk_dszError_; }
std::vector<int> vtxIndx() const { return vtxIndx_; }
//add off-diagonal covariance matrix parameter, the above "Error" variables correspond to the diagonal, enum for Cov matrix (qoverp, lambda, phi, dxy, dsz), see https://github.com/cms-sw/cmssw/blob/CMSSW_11_2_X/DataFormats/TrackReco/src/TrackBase.cc for details
float trk_qoverp_lambda_cov() const { return trk_qoverp_lambda_cov_; }
float trk_qoverp_phi_cov() const { return trk_qoverp_phi_cov_; }
Expand All @@ -179,39 +235,54 @@ class ScoutingMuon {
float trk_phi_dxy_cov() const { return trk_phi_dxy_cov_; }
float trk_phi_dsz_cov() const { return trk_phi_dsz_cov_; }
float trk_dxy_dsz_cov() const { return trk_dxy_dsz_cov_; }
float trk_vx() const { return trk_vx_; }
float trk_vy() const { return trk_vy_; }
float trk_vz() const { return trk_vz_; }
reco::HitPattern trk_hitPattern() const { return trk_hitPattern_; }
std::vector<int> vtxIndx() const { return vtxIndx_; }

private:
float pt_;
float eta_;
float phi_;
float m_;
unsigned int type_;
int charge_;
float normalizedChi2_;
float ecalIso_;
float hcalIso_;
float trackIso_;
float chi2_;
float ndof_;
int charge_;
float dxy_;
float dz_;
int nValidMuonHits_;
int nValidStandAloneMuonHits_;
int nStandAloneMuonMatchedStations_;
int nValidRecoMuonHits_;
int nRecoMuonChambers_;
int nRecoMuonChambersCSCorDT_;
int nRecoMuonMatches_;
int nRecoMuonMatchedStations_;
unsigned int nRecoMuonExpectedMatchedStations_;
unsigned int recoMuonStationMask_;
int nRecoMuonMatchedRPCLayers_;
unsigned int recoMuonRPClayerMask_;
int nValidPixelHits_;
int nMatchedStations_;
int nTrackerLayersWithMeasurement_;
int type_;
int nValidStripHits_;
int nPixelLayersWithMeasurement_;
int nTrackerLayersWithMeasurement_;
float trk_chi2_;
float trk_ndof_;
float trk_dxy_;
float trk_dz_;
float trk_qoverp_;
float trk_lambda_;
float trk_pt_;
float trk_phi_;
float trk_eta_;
float dxyError_;
float dzError_;
float trk_dxyError_;
float trk_dzError_;
float trk_qoverpError_;
float trk_lambdaError_;
float trk_phiError_;
float trk_dsz_;
float trk_dszError_;
std::vector<int> vtxIndx_;
float trk_qoverp_lambda_cov_;
float trk_qoverp_phi_cov_;
float trk_qoverp_dxy_cov_;
Expand All @@ -222,6 +293,11 @@ class ScoutingMuon {
float trk_phi_dxy_cov_;
float trk_phi_dsz_cov_;
float trk_dxy_dsz_cov_;
float trk_vx_;
float trk_vy_;
float trk_vz_;
reco::HitPattern trk_hitPattern_;
std::vector<int> vtxIndx_;
};

typedef std::vector<ScoutingMuon> ScoutingMuonCollection;
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/Scouting/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
<version ClassVersion="2" checksum="1190461538"/>
<version ClassVersion="3" checksum="213189975"/>
</class>
<class name="ScoutingMuon" ClassVersion="4">
<class name="ScoutingMuon" ClassVersion="5">
<version ClassVersion="2" checksum="9151"/>
<version ClassVersion="3" checksum="3167554832"/>
<version ClassVersion="4" checksum="2090828742"/>
<version ClassVersion="5" checksum="2821723317"/>
</class>
<class name="ScoutingPhoton" ClassVersion="3">
<version ClassVersion="2" checksum="2797410539"/>
Expand Down
Loading

0 comments on commit 87f3a41

Please sign in to comment.