CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
Primary4DVertexValidation Class Reference
Inheritance diagram for Primary4DVertexValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

struct  recoPrimaryVertex
 
struct  simPrimaryVertex
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 Primary4DVertexValidation (const edm::ParameterSet &)
 
 ~Primary4DVertexValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 

Private Types

typedef math::XYZTLorentzVector LorentzVector
 

Private Member Functions

const edm::Ref< std::vector
< TrackingParticle > > * 
getMatchedTP (const reco::TrackBaseRef &, const TrackingVertexRef &)
 
std::vector
< Primary4DVertexValidation::recoPrimaryVertex
getRecoPVs (const edm::Handle< edm::View< reco::Vertex >> &)
 
std::vector
< Primary4DVertexValidation::simPrimaryVertex
getSimPVs (const edm::Handle< TrackingVertexCollection > &)
 
void matchReco2Sim (std::vector< recoPrimaryVertex > &, std::vector< simPrimaryVertex > &, const edm::ValueMap< float > &, const edm::ValueMap< float > &, const edm::Handle< reco::BeamSpot > &)
 
bool matchRecoTrack2SimSignal (const reco::TrackBaseRef &)
 
const bool mvaRecSel (const reco::TrackBase &, const reco::Vertex &, const double &, const double &)
 
const bool mvaTPSel (const TrackingParticle &)
 
bool select (const reco::Vertex &, int level=0)
 
double timeFromTrueMass (double, double, double, double)
 

Private Attributes

bool debug_
 
const std::string folder_
 
const std::vector< double > lineDensityPar_
 
MonitorElementmeDeltaTfakefake_
 
MonitorElementmeDeltaTfakereal_
 
MonitorElementmeDeltaTrealreal_
 
MonitorElementmeDeltaZfakefake_
 
MonitorElementmeDeltaZfakereal_
 
MonitorElementmeDeltaZrealreal_
 
MonitorElementmeMatchQual_
 
MonitorElementmeMVATrackEffEtaTot_
 
MonitorElementmeMVATrackEffPtTot_
 
MonitorElementmeMVATrackMatchedEffEtaMtd_
 
MonitorElementmeMVATrackMatchedEffEtaTot_
 
MonitorElementmeMVATrackMatchedEffPtMtd_
 
MonitorElementmeMVATrackMatchedEffPtTot_
 
MonitorElementmeMVATrackPullTot_
 
MonitorElementmeMVATrackResTot_
 
MonitorElementmeMVATrackZposResTot_
 
MonitorElementmePUvsOtherFakeV_
 
MonitorElementmePUvsRealV_
 
MonitorElementmePUvsSplitV_
 
MonitorElementmeRecoPosInRecoOrigCollection_
 
MonitorElementmeRecoPosInSimCollection_
 
MonitorElementmeRecoPVPosSignal_
 
MonitorElementmeRecoPVPosSignalNotHighestPt_
 
MonitorElementmeRecoVtxVsLineDensity_
 
MonitorElementmeRecPVT_
 
MonitorElementmeRecPVZ_
 
MonitorElementmeRecVerNumber_
 
MonitorElementmeSimPosInSimOrigCollection_
 
MonitorElementmeSimPVZ_
 
MonitorElementmeTimePull_
 
MonitorElementmeTimeRes_
 
MonitorElementmeTimeSignalPull_
 
MonitorElementmeTimeSignalRes_
 
MonitorElementmeTrack3DposRes_ [3]
 
MonitorElementmeTrackPull_ [3]
 
MonitorElementmeTrackPullHighP_ [3]
 
MonitorElementmeTrackPullHighPTot_
 
MonitorElementmeTrackPullLowP_ [3]
 
MonitorElementmeTrackPullLowPTot_
 
MonitorElementmeTrackPullTot_
 
MonitorElementmeTrackRes_ [3]
 
MonitorElementmeTrackResHighP_ [3]
 
MonitorElementmeTrackResHighPTot_
 
MonitorElementmeTrackResLowP_ [3]
 
MonitorElementmeTrackResLowPTot_
 
MonitorElementmeTrackResMass_ [3]
 
MonitorElementmeTrackResMassPions_ [3]
 
MonitorElementmeTrackResMassProtons_ [3]
 
MonitorElementmeTrackResMassTrue_ [3]
 
MonitorElementmeTrackResMassTruePions_ [3]
 
MonitorElementmeTrackResMassTrueProtons_ [3]
 
MonitorElementmeTrackResTot_
 
MonitorElementmeTrackZposRes_ [3]
 
MonitorElementmeTrackZposResTot_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
momentumToken_
 
const double mvaTh_
 
bool optionalPlots_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
pathLengthToken_
 
const reco::RecoToSimCollectionr2s_
 
edm::EDGetTokenT< edm::View
< reco::Vertex > > 
Rec4DVerToken_
 
edm::EDGetTokenT< reco::BeamSpotRecBeamSpotToken_
 
edm::EDGetTokenT
< reco::RecoToSimCollection
recoToSimAssociationToken_
 
edm::EDGetTokenT
< reco::TrackCollection
RecTrackToken_
 
const reco::SimToRecoCollections2r_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
sigmat0SafePidToken_
 
edm::EDGetTokenT
< reco::SimToRecoCollection
simToRecoAssociationToken_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
t0SafePidToken_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
timeToken_
 
edm::EDGetTokenT
< edm::ValueMap< int > > 
trackAssocToken_
 
edm::EDGetTokenT
< TrackingParticleCollection
trackingParticleCollectionToken_
 
edm::EDGetTokenT
< TrackingVertexCollection
trackingVertexCollectionToken_
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
trackMVAQualToken_
 
const double trackweightTh_
 
bool use_only_charged_tracks_
 
edm::EDGetTokenT< std::vector
< PileupSummaryInfo > > 
vecPileupSummaryInfoToken_
 

Static Private Attributes

static constexpr double c_ = 2.99792458e1
 
static constexpr double deltaZcut_ = 0.1
 
static constexpr double etacutGEN_ = 4.
 
static constexpr double etacutREC_ = 3.
 
static constexpr double maxRank_ = 8.
 
static constexpr double maxTry_ = 10.
 
static constexpr double mvaH_ = 0.8
 
static constexpr double mvaL_ = 0.5
 
static constexpr unsigned int NOT_MATCHED = 66666
 
static constexpr double pTcut_ = 0.7
 
static constexpr double selNdof_ = 4.
 
static constexpr double simUnit_ = 1e9
 
static constexpr double zWosMatchMax_ = 1.
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 52 of file Primary4DVertexValidation.cc.

Member Typedef Documentation

Definition at line 53 of file Primary4DVertexValidation.cc.

Constructor & Destructor Documentation

Primary4DVertexValidation::Primary4DVertexValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 315 of file Primary4DVertexValidation.cc.

References edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, momentumToken_, pathLengthToken_, Rec4DVerToken_, RecBeamSpotToken_, recoToSimAssociationToken_, RecTrackToken_, sigmat0SafePidToken_, simToRecoAssociationToken_, AlCaHLTBitMon_QueryRunRegistry::string, t0SafePidToken_, timeToken_, trackAssocToken_, trackingParticleCollectionToken_, trackingVertexCollectionToken_, trackMVAQualToken_, and vecPileupSummaryInfoToken_.

316  : folder_(iConfig.getParameter<std::string>("folder")),
317  trackweightTh_(iConfig.getParameter<double>("trackweightTh")),
318  mvaTh_(iConfig.getParameter<double>("mvaTh")),
319  lineDensityPar_(iConfig.getParameter<std::vector<double>>("lineDensityPar")),
320  use_only_charged_tracks_(iConfig.getParameter<bool>("useOnlyChargedTracks")),
321  debug_(iConfig.getUntrackedParameter<bool>("debug")),
322  optionalPlots_(iConfig.getUntrackedParameter<bool>("optionalPlots")) {
323  vecPileupSummaryInfoToken_ = consumes<std::vector<PileupSummaryInfo>>(edm::InputTag(std::string("addPileupInfo")));
325  consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("SimTag"));
326  trackingVertexCollectionToken_ = consumes<TrackingVertexCollection>(iConfig.getParameter<edm::InputTag>("SimTag"));
328  consumes<reco::SimToRecoCollection>(iConfig.getParameter<edm::InputTag>("TPtoRecoTrackAssoc"));
330  consumes<reco::RecoToSimCollection>(iConfig.getParameter<edm::InputTag>("TPtoRecoTrackAssoc"));
331  RecTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("mtdTracks"));
332  RecBeamSpotToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("offlineBS"));
333  Rec4DVerToken_ = consumes<edm::View<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("offline4DPV"));
334  trackAssocToken_ = consumes<edm::ValueMap<int>>(iConfig.getParameter<edm::InputTag>("trackAssocSrc"));
335  pathLengthToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("pathLengthSrc"));
336  momentumToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("momentumSrc"));
337  timeToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("timeSrc"));
338  t0SafePidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0SafePID"));
339  sigmat0SafePidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0SafePID"));
340  trackMVAQualToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("trackMVAQual"));
341 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< reco::Vertex > > Rec4DVerToken_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollectionToken_
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmat0SafePidToken_
edm::EDGetTokenT< reco::BeamSpot > RecBeamSpotToken_
edm::EDGetTokenT< edm::ValueMap< float > > timeToken_
edm::EDGetTokenT< edm::ValueMap< float > > momentumToken_
edm::EDGetTokenT< reco::TrackCollection > RecTrackToken_
const std::vector< double > lineDensityPar_
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > vecPileupSummaryInfoToken_
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoAssociationToken_
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimAssociationToken_
edm::EDGetTokenT< edm::ValueMap< float > > t0SafePidToken_
edm::EDGetTokenT< edm::ValueMap< float > > trackMVAQualToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
Primary4DVertexValidation::~Primary4DVertexValidation ( )
override

Definition at line 343 of file Primary4DVertexValidation.cc.

343 {}

Member Function Documentation

void Primary4DVertexValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 1042 of file Primary4DVertexValidation.cc.

References funct::abs(), gather_cfg::cout, PVValHelper::d3D, debug_, deltaZcut_, dt, PVValHelper::dz, funct::exp(), dqm::impl::MonitorElement::Fill(), edm::Event::get(), edm::Event::getByToken(), getMatchedTP(), getRecoPVs(), getSimPVs(), iev, gpuVertexFinder::iv, lineDensityPar_, LogTrace, ResonanceBuilder::mass, matchReco2Sim(), meDeltaTfakefake_, meDeltaTfakereal_, meDeltaTrealreal_, meDeltaZfakefake_, meDeltaZfakereal_, meDeltaZrealreal_, meMatchQual_, meMVATrackEffEtaTot_, meMVATrackEffPtTot_, meMVATrackMatchedEffEtaMtd_, meMVATrackMatchedEffEtaTot_, meMVATrackMatchedEffPtMtd_, meMVATrackMatchedEffPtTot_, meMVATrackPullTot_, meMVATrackResTot_, meMVATrackZposResTot_, mePUvsOtherFakeV_, mePUvsRealV_, mePUvsSplitV_, meRecoPosInRecoOrigCollection_, meRecoPosInSimCollection_, meRecoPVPosSignal_, meRecoPVPosSignalNotHighestPt_, meRecoVtxVsLineDensity_, meRecPVT_, meRecPVZ_, meRecVerNumber_, meSimPosInSimOrigCollection_, meSimPVZ_, meTimePull_, meTimeRes_, meTimeSignalPull_, meTimeSignalRes_, meTrack3DposRes_, meTrackPull_, meTrackPullHighP_, meTrackPullHighPTot_, meTrackPullLowP_, meTrackPullLowPTot_, meTrackPullTot_, meTrackRes_, meTrackResHighP_, meTrackResHighPTot_, meTrackResLowP_, meTrackResLowPTot_, meTrackResMass_, meTrackResMassPions_, meTrackResMassProtons_, meTrackResMassTrue_, meTrackResMassTruePions_, meTrackResMassTrueProtons_, meTrackResTot_, meTrackZposRes_, meTrackZposResTot_, momentumToken_, mvaH_, mvaL_, mvaRecSel(), mvaTPSel(), NOT_MATCHED, optionalPlots_, pathLengthToken_, r2s_, Rec4DVerToken_, RecBeamSpotToken_, dt_dqm_sourceclient_common_cff::reco, recoToSimAssociationToken_, s2r_, select(), selNdof_, sigmat0SafePidToken_, simToRecoAssociationToken_, simUnit_, submitPVValidationJobs::split(), mathSSE::sqrt(), t0SafePidToken_, timeFromTrueMass(), timeToken_, trackAssocToken_, trackingParticleCollectionToken_, trackingVertexCollectionToken_, trackMVAQualToken_, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::trackWeight(), trackweightTh_, vecPileupSummaryInfoToken_, trackerHitRTTI::vector, and z.

1042  {
1043  using edm::Handle;
1044  using edm::View;
1045  using std::cout;
1046  using std::endl;
1047  using std::vector;
1048  using namespace reco;
1049 
1050  std::vector<float> pileUpInfo_z;
1051 
1052  // get the pileup information
1054  if (iEvent.getByToken(vecPileupSummaryInfoToken_, puinfoH)) {
1055  for (auto const& pu_info : *puinfoH.product()) {
1056  if (pu_info.getBunchCrossing() == 0) {
1057  pileUpInfo_z = pu_info.getPU_zpositions();
1058  break;
1059  }
1060  }
1061  }
1062 
1064  iEvent.getByToken(trackingParticleCollectionToken_, TPCollectionH);
1065  if (!TPCollectionH.isValid())
1066  edm::LogWarning("Primary4DVertexValidation") << "TPCollectionH is not valid";
1067 
1069  iEvent.getByToken(trackingVertexCollectionToken_, TVCollectionH);
1070  if (!TVCollectionH.isValid())
1071  edm::LogWarning("Primary4DVertexValidation") << "TVCollectionH is not valid";
1072 
1074  iEvent.getByToken(simToRecoAssociationToken_, simToRecoH);
1075  if (simToRecoH.isValid())
1076  s2r_ = simToRecoH.product();
1077  else
1078  edm::LogWarning("Primary4DVertexValidation") << "simToRecoH is not valid";
1079 
1081  iEvent.getByToken(recoToSimAssociationToken_, recoToSimH);
1082  if (recoToSimH.isValid())
1083  r2s_ = recoToSimH.product();
1084  else
1085  edm::LogWarning("Primary4DVertexValidation") << "recoToSimH is not valid";
1086 
1087  edm::Handle<reco::BeamSpot> BeamSpotH;
1088  iEvent.getByToken(RecBeamSpotToken_, BeamSpotH);
1089  if (!BeamSpotH.isValid())
1090  edm::LogWarning("Primary4DVertexValidation") << "BeamSpotH is not valid";
1091 
1092  std::vector<simPrimaryVertex> simpv; // a list of simulated primary MC vertices
1093  simpv = getSimPVs(TVCollectionH);
1094  //this bool check if first vertex in that with highest pT
1095  bool signal_is_highest_pt =
1096  std::max_element(simpv.begin(), simpv.end(), [](const simPrimaryVertex& lhs, const simPrimaryVertex& rhs) {
1097  return lhs.ptsq < rhs.ptsq;
1098  }) == simpv.begin();
1099 
1100  std::vector<recoPrimaryVertex> recopv; // a list of reconstructed primary MC vertices
1102  iEvent.getByToken(Rec4DVerToken_, recVtxs);
1103  if (!recVtxs.isValid())
1104  edm::LogWarning("Primary4DVertexValidation") << "recVtxs is not valid";
1105  recopv = getRecoPVs(recVtxs);
1106 
1107  const auto& trackAssoc = iEvent.get(trackAssocToken_);
1108  const auto& pathLength = iEvent.get(pathLengthToken_);
1109  const auto& momentum = iEvent.get(momentumToken_);
1110  const auto& time = iEvent.get(timeToken_);
1111  const auto& t0Safe = iEvent.get(t0SafePidToken_);
1112  const auto& sigmat0Safe = iEvent.get(sigmat0SafePidToken_);
1113  const auto& mtdQualMVA = iEvent.get(trackMVAQualToken_);
1114 
1115  //I have simPV and recoPV collections
1116  matchReco2Sim(recopv, simpv, sigmat0Safe, mtdQualMVA, BeamSpotH);
1117 
1118  //Loop on tracks
1119  for (unsigned int iv = 0; iv < recopv.size(); iv++) {
1120  const reco::Vertex* vertex = recopv.at(iv).recVtx;
1121 
1122  for (unsigned int iev = 0; iev < simpv.size(); iev++) {
1123  auto vsim = simpv.at(iev).sim_vertex;
1124 
1125  bool selectedVtxMatching = recopv.at(iv).sim == iev && simpv.at(iev).rec == iv &&
1126  simpv.at(iev).eventId.bunchCrossing() == 0 && simpv.at(iev).eventId.event() == 0 &&
1127  recopv.at(iv).OriginalIndex == 0;
1128  if (selectedVtxMatching && !recopv.at(iv).is_signal()) {
1129  edm::LogWarning("Primary4DVertexValidation")
1130  << "Reco vtx leading match inconsistent: BX/ID " << simpv.at(iev).eventId.bunchCrossing() << " "
1131  << simpv.at(iev).eventId.event();
1132  }
1133  double vzsim = simpv.at(iev).z;
1134  double vtsim = simpv.at(iev).t * simUnit_;
1135 
1136  for (auto iTrack = vertex->tracks_begin(); iTrack != vertex->tracks_end(); ++iTrack) {
1137  if (trackAssoc[*iTrack] == -1) {
1138  LogTrace("mtdTracks") << "Extended track not associated";
1139  continue;
1140  }
1141 
1142  if (vertex->trackWeight(*iTrack) < trackweightTh_)
1143  continue;
1144 
1145  bool selectRecoTrk = mvaRecSel(**iTrack, *vertex, t0Safe[*iTrack], sigmat0Safe[*iTrack]);
1146  if (selectedVtxMatching && selectRecoTrk) {
1147  meMVATrackEffPtTot_->Fill((*iTrack)->pt());
1148  meMVATrackEffEtaTot_->Fill(std::abs((*iTrack)->eta()));
1149  }
1150 
1151  auto tp_info = getMatchedTP(*iTrack, vsim);
1152  if (tp_info != nullptr) {
1153  double mass = (*tp_info)->mass();
1154  double tsim = (*tp_info)->parentVertex()->position().t() * simUnit_;
1155  double tEst = timeFromTrueMass(mass, pathLength[*iTrack], momentum[*iTrack], time[*iTrack]);
1156 
1157  double xsim = (*tp_info)->parentVertex()->position().x();
1158  double ysim = (*tp_info)->parentVertex()->position().y();
1159  double zsim = (*tp_info)->parentVertex()->position().z();
1160  double xPCA = (*iTrack)->vx();
1161  double yPCA = (*iTrack)->vy();
1162  double zPCA = (*iTrack)->vz();
1163 
1164  double dZ = zPCA - zsim;
1165  double d3D = std::sqrt((xPCA - xsim) * (xPCA - xsim) + (yPCA - ysim) * (yPCA - ysim) + dZ * dZ);
1166  // orient d3D according to the projection of RECO - SIM onto simulated momentum
1167  if ((xPCA - xsim) * ((*tp_info)->px()) + (yPCA - ysim) * ((*tp_info)->py()) + dZ * ((*tp_info)->pz()) < 0.) {
1168  d3D = -d3D;
1169  }
1170 
1171  bool selectTP = mvaTPSel(**tp_info);
1172 
1173  if (selectedVtxMatching && selectRecoTrk && selectTP) {
1174  meMVATrackZposResTot_->Fill((*iTrack)->vz() - vzsim);
1175  meMVATrackMatchedEffPtTot_->Fill((*iTrack)->pt());
1176  meMVATrackMatchedEffEtaTot_->Fill(std::abs((*iTrack)->eta()));
1177  }
1178 
1179  if (sigmat0Safe[*iTrack] == -1)
1180  continue;
1181 
1182  if (selectedVtxMatching && selectRecoTrk && selectTP) {
1183  meMVATrackResTot_->Fill(t0Safe[*iTrack] - vtsim);
1184  meMVATrackPullTot_->Fill((t0Safe[*iTrack] - vtsim) / sigmat0Safe[*iTrack]);
1185  meMVATrackMatchedEffPtMtd_->Fill((*iTrack)->pt());
1186  meMVATrackMatchedEffEtaMtd_->Fill(std::abs((*iTrack)->eta()));
1187  }
1188  meTrackResTot_->Fill(t0Safe[*iTrack] - tsim);
1189  meTrackPullTot_->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1190  meTrackZposResTot_->Fill(dZ);
1191  if ((*iTrack)->p() <= 2) {
1192  meTrackResLowPTot_->Fill(t0Safe[*iTrack] - tsim);
1193  meTrackPullLowPTot_->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1194  } else {
1195  meTrackResHighPTot_->Fill(t0Safe[*iTrack] - tsim);
1196  meTrackPullHighPTot_->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1197  }
1198 
1199  if (mtdQualMVA[(*iTrack)] < mvaL_) {
1200  meTrackZposRes_[0]->Fill(dZ);
1201  meTrack3DposRes_[0]->Fill(d3D);
1202  meTrackRes_[0]->Fill(t0Safe[*iTrack] - tsim);
1203  meTrackPull_[0]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1204 
1205  if (optionalPlots_) {
1206  meTrackResMass_[0]->Fill(t0Safe[*iTrack] - tEst);
1207  meTrackResMassTrue_[0]->Fill(tEst - tsim);
1208  }
1209 
1210  if ((*iTrack)->p() <= 2) {
1211  meTrackResLowP_[0]->Fill(t0Safe[*iTrack] - tsim);
1212  meTrackPullLowP_[0]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1213  } else if ((*iTrack)->p() > 2) {
1214  meTrackResHighP_[0]->Fill(t0Safe[*iTrack] - tsim);
1215  meTrackPullHighP_[0]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1216  }
1217 
1218  if (optionalPlots_) {
1219  if (std::abs((*tp_info)->pdgId()) == 2212) {
1220  meTrackResMassProtons_[0]->Fill(t0Safe[*iTrack] - tEst);
1221  meTrackResMassTrueProtons_[0]->Fill(tEst - tsim);
1222  } else if (std::abs((*tp_info)->pdgId()) == 211) {
1223  meTrackResMassPions_[0]->Fill(t0Safe[*iTrack] - tEst);
1224  meTrackResMassTruePions_[0]->Fill(tEst - tsim);
1225  }
1226  }
1227 
1228  } else if (mtdQualMVA[(*iTrack)] > mvaL_ && mtdQualMVA[(*iTrack)] < mvaH_) {
1229  meTrackZposRes_[1]->Fill(dZ);
1230  meTrack3DposRes_[1]->Fill(d3D);
1231  meTrackRes_[1]->Fill(t0Safe[*iTrack] - tsim);
1232  meTrackPull_[1]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1233 
1234  if (optionalPlots_) {
1235  meTrackResMass_[1]->Fill(t0Safe[*iTrack] - tEst);
1236  meTrackResMassTrue_[1]->Fill(tEst - tsim);
1237  }
1238 
1239  if ((*iTrack)->p() <= 2) {
1240  meTrackResLowP_[1]->Fill(t0Safe[*iTrack] - tsim);
1241  meTrackPullLowP_[1]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1242  } else if ((*iTrack)->p() > 2) {
1243  meTrackResHighP_[1]->Fill(t0Safe[*iTrack] - tsim);
1244  meTrackPullHighP_[1]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1245  }
1246 
1247  if (optionalPlots_) {
1248  if (std::abs((*tp_info)->pdgId()) == 2212) {
1249  meTrackResMassProtons_[1]->Fill(t0Safe[*iTrack] - tEst);
1250  meTrackResMassTrueProtons_[1]->Fill(tEst - tsim);
1251  } else if (std::abs((*tp_info)->pdgId()) == 211) {
1252  meTrackResMassPions_[1]->Fill(t0Safe[*iTrack] - tEst);
1253  meTrackResMassTruePions_[1]->Fill(tEst - tsim);
1254  }
1255  }
1256 
1257  } else if (mtdQualMVA[(*iTrack)] > mvaH_) {
1258  meTrackZposRes_[2]->Fill(dZ);
1259  meTrack3DposRes_[2]->Fill(d3D);
1260  meTrackRes_[2]->Fill(t0Safe[*iTrack] - tsim);
1261  meTrackPull_[2]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1262 
1263  if (optionalPlots_) {
1264  meTrackResMass_[2]->Fill(t0Safe[*iTrack] - tEst);
1265  meTrackResMassTrue_[2]->Fill(tEst - tsim);
1266  }
1267 
1268  if ((*iTrack)->p() <= 2) {
1269  meTrackResLowP_[2]->Fill(t0Safe[*iTrack] - tsim);
1270  meTrackPullLowP_[2]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1271  } else if ((*iTrack)->p() > 2) {
1272  meTrackResHighP_[2]->Fill(t0Safe[*iTrack] - tsim);
1273  meTrackPullHighP_[2]->Fill((t0Safe[*iTrack] - tsim) / sigmat0Safe[*iTrack]);
1274  }
1275 
1276  if (optionalPlots_) {
1277  if (std::abs((*tp_info)->pdgId()) == 2212) {
1278  meTrackResMassProtons_[2]->Fill(t0Safe[*iTrack] - tEst);
1279  meTrackResMassTrueProtons_[2]->Fill(tEst - tsim);
1280  } else if (std::abs((*tp_info)->pdgId()) == 211) {
1281  meTrackResMassPions_[2]->Fill(t0Safe[*iTrack] - tEst);
1282  meTrackResMassTruePions_[2]->Fill(tEst - tsim);
1283  }
1284  }
1285  }
1286  } //if tp_info != nullptr
1287  }
1288  }
1289  }
1290 
1291  int real = 0;
1292  int fake = 0;
1293  int other_fake = 0;
1294  int split = 0;
1295 
1296  auto puLineDensity = [&](double z) {
1297  // gaussian parameterization of line density vs z, z in cm, parameters in mm
1298  double argl = (z * 10. - lineDensityPar_[1]) / lineDensityPar_[2];
1299  return lineDensityPar_[0] * exp(-0.5 * argl * argl);
1300  };
1301 
1302  meRecVerNumber_->Fill(recopv.size());
1303  for (unsigned int ir = 0; ir < recopv.size(); ir++) {
1304  meRecoVtxVsLineDensity_->Fill(puLineDensity(recopv.at(ir).z));
1305  meRecPVZ_->Fill(recopv.at(ir).z, 1. / puLineDensity(recopv.at(ir).z));
1306  if (recopv.at(ir).recVtx->tError() > 0.) {
1307  meRecPVT_->Fill(recopv.at(ir).recVtx->t());
1308  }
1309  if (debug_) {
1310  edm::LogPrint("Primary4DVertexValidation") << "************* IR: " << ir;
1311  edm::LogPrint("Primary4DVertexValidation")
1312  << "z: " << recopv.at(ir).z << " corresponding to line density: " << puLineDensity(recopv.at(ir).z);
1313  edm::LogPrint("Primary4DVertexValidation") << "is_real: " << recopv.at(ir).is_real();
1314  edm::LogPrint("Primary4DVertexValidation") << "is_fake: " << recopv.at(ir).is_fake();
1315  edm::LogPrint("Primary4DVertexValidation") << "is_signal: " << recopv.at(ir).is_signal();
1316  edm::LogPrint("Primary4DVertexValidation") << "split_from: " << recopv.at(ir).split_from();
1317  edm::LogPrint("Primary4DVertexValidation") << "other fake: " << recopv.at(ir).other_fake();
1318  }
1319  if (recopv.at(ir).is_real())
1320  real++;
1321  if (recopv.at(ir).is_fake())
1322  fake++;
1323  if (recopv.at(ir).other_fake())
1324  other_fake++;
1325  if (recopv.at(ir).split_from() != -1) {
1326  split++;
1327  }
1328  }
1329 
1330  if (debug_) {
1331  edm::LogPrint("Primary4DVertexValidation") << "is_real: " << real;
1332  edm::LogPrint("Primary4DVertexValidation") << "is_fake: " << fake;
1333  edm::LogPrint("Primary4DVertexValidation") << "split_from: " << split;
1334  edm::LogPrint("Primary4DVertexValidation") << "other fake: " << other_fake;
1335  }
1336 
1337  //fill vertices histograms here in a new loop
1338  for (unsigned int is = 0; is < simpv.size(); is++) {
1339  meSimPVZ_->Fill(simpv.at(is).z, 1. / puLineDensity(simpv.at(is).z));
1340  if (is == 0 && optionalPlots_) {
1341  meSimPosInSimOrigCollection_->Fill(simpv.at(is).OriginalIndex);
1342  }
1343 
1344  if (simpv.at(is).rec == NOT_MATCHED) {
1345  if (debug_) {
1346  edm::LogPrint("Primary4DVertexValidation") << "sim vertex: " << is << " is not matched with any reco";
1347  }
1348  continue;
1349  }
1350 
1351  for (unsigned int ir = 0; ir < recopv.size(); ir++) {
1352  if (recopv.at(ir).sim == is && simpv.at(is).rec == ir) {
1353  meTimeRes_->Fill(recopv.at(ir).recVtx->t() - simpv.at(is).t * simUnit_);
1354  meTimePull_->Fill((recopv.at(ir).recVtx->t() - simpv.at(is).t * simUnit_) / recopv.at(ir).recVtx->tError());
1355  mePUvsRealV_->Fill(simpv.size(), real);
1356  mePUvsOtherFakeV_->Fill(simpv.size(), other_fake);
1357  mePUvsSplitV_->Fill(simpv.size(), split);
1358  meMatchQual_->Fill(recopv.at(ir).matchQuality - 0.5);
1359  if (ir == 0) { //signal vertex plots
1360  meTimeSignalRes_->Fill(recopv.at(ir).recVtx->t() - simpv.at(is).t * simUnit_);
1361  meTimeSignalPull_->Fill((recopv.at(ir).recVtx->t() - simpv.at(is).t * simUnit_) /
1362  recopv.at(ir).recVtx->tError());
1363  if (optionalPlots_) {
1364  meRecoPosInSimCollection_->Fill(recopv.at(ir).sim);
1365  meRecoPosInRecoOrigCollection_->Fill(recopv.at(ir).OriginalIndex);
1366  }
1367  }
1368  if (simpv.at(is).eventId.bunchCrossing() == 0 && simpv.at(is).eventId.event() == 0) {
1369  if (!recopv.at(ir).is_signal()) {
1370  edm::LogWarning("Primary4DVertexValidation")
1371  << "Reco vtx leading match inconsistent: BX/ID " << simpv.at(is).eventId.bunchCrossing() << " "
1372  << simpv.at(is).eventId.event();
1373  }
1375  recopv.at(ir).OriginalIndex); // position in reco vtx correction associated to sim signal
1376  if (!signal_is_highest_pt) {
1378  recopv.at(ir).OriginalIndex); // position in reco vtx correction associated to sim signal
1379  }
1380  }
1381 
1382  if (debug_) {
1383  edm::LogPrint("Primary4DVertexValidation") << "*** Matching RECO: " << ir << "with SIM: " << is << " ***";
1384  edm::LogPrint("Primary4DVertexValidation") << "Match Quality is " << recopv.at(ir).matchQuality;
1385  edm::LogPrint("Primary4DVertexValidation") << "****";
1386  }
1387  }
1388  }
1389  }
1390 
1391  //dz histos
1392  for (unsigned int iv = 0; iv < recVtxs->size() - 1; iv++) {
1393  if (recVtxs->at(iv).ndof() > selNdof_) {
1394  double mindistance_realreal = 1e10;
1395 
1396  for (unsigned int jv = iv; jv < recVtxs->size(); jv++) {
1397  if ((!(jv == iv)) && select(recVtxs->at(jv))) {
1398  double dz = recVtxs->at(iv).z() - recVtxs->at(jv).z();
1399  double dtsigma = std::sqrt(recVtxs->at(iv).covariance(3, 3) + recVtxs->at(jv).covariance(3, 3));
1400  double dt = (std::abs(dz) <= deltaZcut_ && dtsigma > 0.)
1401  ? (recVtxs->at(iv).t() - recVtxs->at(jv).t()) / dtsigma
1402  : -9999.;
1403  if (recopv.at(iv).is_real() && recopv.at(jv).is_real()) {
1405  if (dt != -9999.) {
1407  }
1408  if (std::abs(dz) < std::abs(mindistance_realreal)) {
1409  mindistance_realreal = dz;
1410  }
1411  } else if (recopv.at(iv).is_fake() && recopv.at(jv).is_fake()) {
1413  if (dt != -9999.) {
1415  }
1416  }
1417  }
1418  }
1419 
1420  double mindistance_fakereal = 1e10;
1421  double mindistance_realfake = 1e10;
1422  for (unsigned int jv = 0; jv < recVtxs->size(); jv++) {
1423  if ((!(jv == iv)) && select(recVtxs->at(jv))) {
1424  double dz = recVtxs->at(iv).z() - recVtxs->at(jv).z();
1425  double dtsigma = std::sqrt(recVtxs->at(iv).covariance(3, 3) + recVtxs->at(jv).covariance(3, 3));
1426  double dt = (std::abs(dz) <= deltaZcut_ && dtsigma > 0.)
1427  ? (recVtxs->at(iv).t() - recVtxs->at(jv).t()) / dtsigma
1428  : -9999.;
1429  if (recopv.at(iv).is_fake() && recopv.at(jv).is_real()) {
1431  if (dt != -9999.) {
1433  }
1434  if (std::abs(dz) < std::abs(mindistance_fakereal)) {
1435  mindistance_fakereal = dz;
1436  }
1437  }
1438 
1439  if (recopv.at(iv).is_real() && recopv.at(jv).is_fake() && (std::abs(dz) < std::abs(mindistance_realfake))) {
1440  mindistance_realfake = dz;
1441  }
1442  }
1443  }
1444  } //ndof
1445  }
1446 
1447 } // end of analyze
float dt
Definition: AMPTWrapper.h:136
edm::EDGetTokenT< edm::View< reco::Vertex > > Rec4DVerToken_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollectionToken_
const bool mvaTPSel(const TrackingParticle &)
int32_t *__restrict__ iv
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmat0SafePidToken_
std::vector< Primary4DVertexValidation::simPrimaryVertex > getSimPVs(const edm::Handle< TrackingVertexCollection > &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< reco::BeamSpot > RecBeamSpotToken_
bool select(const reco::Vertex &, int level=0)
void matchReco2Sim(std::vector< recoPrimaryVertex > &, std::vector< simPrimaryVertex > &, const edm::ValueMap< float > &, const edm::ValueMap< float > &, const edm::Handle< reco::BeamSpot > &)
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
edm::EDGetTokenT< edm::ValueMap< float > > timeToken_
std::vector< Primary4DVertexValidation::recoPrimaryVertex > getRecoPVs(const edm::Handle< edm::View< reco::Vertex >> &)
#define LogTrace(id)
MonitorElement * meTrackResMassProtons_[3]
MonitorElement * meTrackResMassTrueProtons_[3]
void Fill(long long x)
double timeFromTrueMass(double, double, double, double)
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.h:110
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
edm::EDGetTokenT< edm::ValueMap< float > > momentumToken_
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:96
MonitorElement * meTrackResMassTruePions_[3]
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.h:108
const std::vector< double > lineDensityPar_
Log< level::Warning, true > LogPrint
const reco::RecoToSimCollection * r2s_
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > vecPileupSummaryInfoToken_
static constexpr double deltaZcut_
const bool mvaRecSel(const reco::TrackBase &, const reco::Vertex &, const double &, const double &)
static constexpr unsigned int NOT_MATCHED
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoAssociationToken_
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
const edm::Ref< std::vector< TrackingParticle > > * getMatchedTP(const reco::TrackBaseRef &, const TrackingVertexRef &)
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int32_t int iev
const reco::SimToRecoCollection * s2r_
tuple cout
Definition: gather_cfg.py:144
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimAssociationToken_
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< edm::ValueMap< float > > t0SafePidToken_
edm::EDGetTokenT< edm::ValueMap< float > > trackMVAQualToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
void Primary4DVertexValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 348 of file Primary4DVertexValidation.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), folder_, meDeltaTfakefake_, meDeltaTfakereal_, meDeltaTrealreal_, meDeltaZfakefake_, meDeltaZfakereal_, meDeltaZrealreal_, meMatchQual_, meMVATrackEffEtaTot_, meMVATrackEffPtTot_, meMVATrackMatchedEffEtaMtd_, meMVATrackMatchedEffEtaTot_, meMVATrackMatchedEffPtMtd_, meMVATrackMatchedEffPtTot_, meMVATrackPullTot_, meMVATrackResTot_, meMVATrackZposResTot_, mePUvsOtherFakeV_, mePUvsRealV_, mePUvsSplitV_, meRecoPosInRecoOrigCollection_, meRecoPosInSimCollection_, meRecoPVPosSignal_, meRecoPVPosSignalNotHighestPt_, meRecoVtxVsLineDensity_, meRecPVT_, meRecPVZ_, meRecVerNumber_, meSimPosInSimOrigCollection_, meSimPVZ_, meTimePull_, meTimeRes_, meTimeSignalPull_, meTimeSignalRes_, meTrack3DposRes_, meTrackPull_, meTrackPullHighP_, meTrackPullHighPTot_, meTrackPullLowP_, meTrackPullLowPTot_, meTrackPullTot_, meTrackRes_, meTrackResHighP_, meTrackResHighPTot_, meTrackResLowP_, meTrackResLowPTot_, meTrackResMass_, meTrackResMassPions_, meTrackResMassProtons_, meTrackResMassTrue_, meTrackResMassTruePions_, meTrackResMassTrueProtons_, meTrackResTot_, meTrackZposRes_, meTrackZposResTot_, optionalPlots_, and dqm::implementation::NavigatorBase::setCurrentFolder().

350  {
351  ibook.setCurrentFolder(folder_);
352  // --- histograms booking
353  meMVATrackEffPtTot_ = ibook.book1D("MVAEffPtTot", "Pt of tracks associated to LV; track pt [GeV] ", 110, 0., 11.);
354  meMVATrackEffEtaTot_ = ibook.book1D("MVAEffEtaTot", "Pt of tracks associated to LV; track eta ", 66, 0., 3.3);
356  ibook.book1D("MVAMatchedEffPtTot", "Pt of tracks associated to LV matched to TP; track pt [GeV] ", 110, 0., 11.);
357  meMVATrackMatchedEffPtMtd_ = ibook.book1D(
358  "MVAMatchedEffPtMtd", "Pt of tracks associated to LV matched to TP with time; track pt [GeV] ", 110, 0., 11.);
360  ibook.book1D("MVAMatchedEffEtaTot", "Pt of tracks associated to LV matched to TP; track eta ", 66, 0., 3.3);
361  meMVATrackMatchedEffEtaMtd_ = ibook.book1D(
362  "MVAMatchedEffEtaMtd", "Pt of tracks associated to LV matched to TP with time; track eta ", 66, 0., 3.3);
363  meMVATrackResTot_ = ibook.book1D(
364  "MVATrackRes", "t_{rec} - t_{sim} for tracks from LV MVA sel.; t_{rec} - t_{sim} [ns] ", 120, -0.15, 0.15);
365  meTrackResTot_ = ibook.book1D("TrackRes", "t_{rec} - t_{sim} for tracks; t_{rec} - t_{sim} [ns] ", 120, -0.15, 0.15);
366  meTrackRes_[0] = ibook.book1D(
367  "TrackRes-LowMVA", "t_{rec} - t_{sim} for tracks with MVA < 0.5; t_{rec} - t_{sim} [ns] ", 100, -1., 1.);
368  meTrackRes_[1] = ibook.book1D(
369  "TrackRes-MediumMVA", "t_{rec} - t_{sim} for tracks with 0.5 < MVA < 0.8; t_{rec} - t_{sim} [ns] ", 100, -1., 1.);
370  meTrackRes_[2] = ibook.book1D(
371  "TrackRes-HighMVA", "t_{rec} - t_{sim} for tracks with MVA > 0.8; t_{rec} - t_{sim} [ns] ", 100, -1., 1.);
372  if (optionalPlots_) {
373  meTrackResMass_[0] = ibook.book1D(
374  "TrackResMass-LowMVA", "t_{rec} - t_{est} for tracks with MVA < 0.5; t_{rec} - t_{est} [ns] ", 100, -1., 1.);
375  meTrackResMass_[1] = ibook.book1D("TrackResMass-MediumMVA",
376  "t_{rec} - t_{est} for tracks with 0.5 < MVA < 0.8; t_{rec} - t_{est} [ns] ",
377  100,
378  -1.,
379  1.);
380  meTrackResMass_[2] = ibook.book1D(
381  "TrackResMass-HighMVA", "t_{rec} - t_{est} for tracks with MVA > 0.8; t_{rec} - t_{est} [ns] ", 100, -1., 1.);
382  meTrackResMassTrue_[0] = ibook.book1D(
383  "TrackResMassTrue-LowMVA", "t_{est} - t_{sim} for tracks with MVA < 0.5; t_{est} - t_{sim} [ns] ", 100, -1., 1.);
384  meTrackResMassTrue_[1] = ibook.book1D("TrackResMassTrue-MediumMVA",
385  "t_{est} - t_{sim} for tracks with 0.5 < MVA < 0.8; t_{est} - t_{sim} [ns] ",
386  100,
387  -1.,
388  1.);
389  meTrackResMassTrue_[2] = ibook.book1D("TrackResMassTrue-HighMVA",
390  "t_{est} - t_{sim} for tracks with MVA > 0.8; t_{est} - t_{sim} [ns] ",
391  100,
392  -1.,
393  1.);
394  }
396  ibook.book1D("MVATrackPull", "Pull for tracks from LV MAV sel.; (t_{rec}-t_{sim})/#sigma_{t}", 50, -5., 5.);
397  meTrackPullTot_ = ibook.book1D("TrackPull", "Pull for tracks; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
398  meTrackPull_[0] =
399  ibook.book1D("TrackPull-LowMVA", "Pull for tracks with MVA < 0.5; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
400  meTrackPull_[1] = ibook.book1D(
401  "TrackPull-MediumMVA", "Pull for tracks with 0.5 < MVA < 0.8; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
402  meTrackPull_[2] =
403  ibook.book1D("TrackPull-HighMVA", "Pull for tracks with MVA > 0.8; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
404  meMVATrackZposResTot_ = ibook.book1D(
405  "MVATrackZposResTot", "Z_{PCA} - Z_{sim} for tracks from LV MVA sel.;Z_{PCA} - Z_{sim} [cm] ", 50, -0.1, 0.1);
407  ibook.book1D("TrackZposResTot", "Z_{PCA} - Z_{sim} for tracks;Z_{PCA} - Z_{sim} [cm] ", 50, -0.5, 0.5);
408  meTrackZposRes_[0] = ibook.book1D(
409  "TrackZposRes-LowMVA", "Z_{PCA} - Z_{sim} for tracks with MVA < 0.5;Z_{PCA} - Z_{sim} [cm] ", 50, -0.5, 0.5);
410  meTrackZposRes_[1] = ibook.book1D("TrackZposRes-MediumMVA",
411  "Z_{PCA} - Z_{sim} for tracks with 0.5 < MVA < 0.8 ;Z_{PCA} - Z_{sim} [cm] ",
412  50,
413  -0.5,
414  0.5);
415  meTrackZposRes_[2] = ibook.book1D(
416  "TrackZposRes-HighMVA", "Z_{PCA} - Z_{sim} for tracks with MVA > 0.8 ;Z_{PCA} - Z_{sim} [cm] ", 50, -0.5, 0.5);
417  meTrack3DposRes_[0] =
418  ibook.book1D("Track3DposRes-LowMVA",
419  "3dPos_{PCA} - 3dPos_{sim} for tracks with MVA < 0.5 ;3dPos_{PCA} - 3dPos_{sim} [cm] ",
420  50,
421  -0.5,
422  0.5);
423  meTrack3DposRes_[1] =
424  ibook.book1D("Track3DposRes-MediumMVA",
425  "3dPos_{PCA} - 3dPos_{sim} for tracks with 0.5 < MVA < 0.8 ;3dPos_{PCA} - 3dPos_{sim} [cm] ",
426  50,
427  -0.5,
428  0.5);
429  meTrack3DposRes_[2] =
430  ibook.book1D("Track3DposRes-HighMVA",
431  "3dPos_{PCA} - 3dPos_{sim} for tracks with MVA > 0.8;3dPos_{PCA} - 3dPos_{sim} [cm] ",
432  50,
433  -0.5,
434  0.5);
435  meTimeRes_ = ibook.book1D("TimeRes", "t_{rec} - t_{sim} ;t_{rec} - t_{sim} [ns] ", 40, -0.2, 0.2);
436  meTimePull_ = ibook.book1D("TimePull", "Pull; t_{rec} - t_{sim}/#sigma_{t rec}", 100, -10., 10.);
438  ibook.book1D("TimeSignalRes", "t_{rec} - t_{sim} for signal ;t_{rec} - t_{sim} [ns] ", 40, -0.2, 0.2);
440  ibook.book1D("TimeSignalPull", "Pull for signal; t_{rec} - t_{sim}/#sigma_{t rec}", 100, -10., 10.);
441  mePUvsRealV_ =
442  ibook.bookProfile("PUvsReal", "#PU vertices vs #real matched vertices;#PU;#real ", 100, 0, 300, 100, 0, 200);
443  mePUvsOtherFakeV_ = ibook.bookProfile(
444  "PUvsOtherFake", "#PU vertices vs #other fake matched vertices;#PU;#other fake ", 100, 0, 300, 100, 0, 20);
445  mePUvsSplitV_ =
446  ibook.bookProfile("PUvsSplit", "#PU vertices vs #split matched vertices;#PU;#split ", 100, 0, 300, 100, 0, 20);
447  meMatchQual_ = ibook.book1D("MatchQuality", "RECO-SIM vertex match quality; ", 8, 0, 8.);
448  meDeltaZrealreal_ = ibook.book1D("DeltaZrealreal", "#Delta Z real-real; |#Delta Z (r-r)| [cm]", 100, 0, 0.5);
449  meDeltaZfakefake_ = ibook.book1D("DeltaZfakefake", "#Delta Z fake-fake; |#Delta Z (f-f)| [cm]", 100, 0, 0.5);
450  meDeltaZfakereal_ = ibook.book1D("DeltaZfakereal", "#Delta Z fake-real; |#Delta Z (f-r)| [cm]", 100, 0, 0.5);
451  meDeltaTrealreal_ = ibook.book1D("DeltaTrealreal", "#Delta T real-real; |#Delta T (r-r)| [sigma]", 60, 0., 30.);
452  meDeltaTfakefake_ = ibook.book1D("DeltaTfakefake", "#Delta T fake-fake; |#Delta T (f-f)| [sigma]", 60, 0., 30.);
453  meDeltaTfakereal_ = ibook.book1D("DeltaTfakereal", "#Delta T fake-real; |#Delta T (f-r)| [sigma]", 60, 0., 30.);
454  if (optionalPlots_) {
455  meRecoPosInSimCollection_ = ibook.book1D(
456  "RecoPosInSimCollection", "Sim signal vertex index associated to Reco signal vertex; Sim PV index", 200, 0, 200);
458  ibook.book1D("RecoPosInRecoOrigCollection", "Reco signal index in OrigCollection; Reco index", 200, 0, 200);
460  ibook.book1D("SimPosInSimOrigCollection", "Sim signal index in OrigCollection; Sim index", 200, 0, 200);
461  }
463  ibook.book1D("RecoPVPosSignal", "Position in reco collection of PV associated to sim signal", 200, 0, 200);
465  ibook.book1D("RecoPVPosSignalNotHighestPt",
466  "Position in reco collection of PV associated to sim signal not highest Pt",
467  200,
468  0,
469  200);
471  ibook.book1D("RecoVtxVsLineDensity", "#Reco vertices/mm/event; line density [#vtx/mm/event]", 160, 0., 4.);
472  meRecVerNumber_ = ibook.book1D("RecVerNumber", "RECO Vertex Number: Number of vertices", 50, 0, 250);
473  meRecPVZ_ = ibook.book1D("recPVZ", "Weighted #Rec vertices/mm", 400, -20., 20.);
474  meRecPVT_ = ibook.book1D("recPVT", "#Rec vertices/10 ps", 200, -1., 1.);
475  meSimPVZ_ = ibook.book1D("simPVZ", "Weighted #Sim vertices/mm", 400, -20., 20.);
476 
477  //some tests
478  meTrackResLowPTot_ = ibook.book1D(
479  "TrackResLowP", "t_{rec} - t_{sim} for tracks with p < 2 GeV; t_{rec} - t_{sim} [ns] ", 70, -0.15, 0.15);
480  meTrackResLowP_[0] =
481  ibook.book1D("TrackResLowP-LowMVA",
482  "t_{rec} - t_{sim} for tracks with MVA < 0.5 and p < 2 GeV; t_{rec} - t_{sim} [ns] ",
483  100,
484  -1.,
485  1.);
486  meTrackResLowP_[1] =
487  ibook.book1D("TrackResLowP-MediumMVA",
488  "t_{rec} - t_{sim} for tracks with 0.5 < MVA < 0.8 and p < 2 GeV; t_{rec} - t_{sim} [ns] ",
489  100,
490  -1.,
491  1.);
492  meTrackResLowP_[2] =
493  ibook.book1D("TrackResLowP-HighMVA",
494  "t_{rec} - t_{sim} for tracks with MVA > 0.8 and p < 2 GeV; t_{rec} - t_{sim} [ns] ",
495  100,
496  -1.,
497  1.);
498  meTrackResHighPTot_ = ibook.book1D(
499  "TrackResHighP", "t_{rec} - t_{sim} for tracks with p > 2 GeV; t_{rec} - t_{sim} [ns] ", 70, -0.15, 0.15);
500  meTrackResHighP_[0] =
501  ibook.book1D("TrackResHighP-LowMVA",
502  "t_{rec} - t_{sim} for tracks with MVA < 0.5 and p > 2 GeV; t_{rec} - t_{sim} [ns] ",
503  100,
504  -1.,
505  1.);
506  meTrackResHighP_[1] =
507  ibook.book1D("TrackResHighP-MediumMVA",
508  "t_{rec} - t_{sim} for tracks with 0.5 < MVA < 0.8 and p > 2 GeV; t_{rec} - t_{sim} [ns] ",
509  100,
510  -1.,
511  1.);
512  meTrackResHighP_[2] =
513  ibook.book1D("TrackResHighP-HighMVA",
514  "t_{rec} - t_{sim} for tracks with MVA > 0.8 and p > 2 GeV; t_{rec} - t_{sim} [ns] ",
515  100,
516  -1.,
517  1.);
519  ibook.book1D("TrackPullLowP", "Pull for tracks with p < 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
520  meTrackPullLowP_[0] = ibook.book1D("TrackPullLowP-LowMVA",
521  "Pull for tracks with MVA < 0.5 and p < 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
522  100,
523  -10.,
524  10.);
525  meTrackPullLowP_[1] = ibook.book1D("TrackPullLowP-MediumMVA",
526  "Pull for tracks with 0.5 < MVA < 0.8 and p < 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
527  100,
528  -10.,
529  10.);
530  meTrackPullLowP_[2] = ibook.book1D("TrackPullLowP-HighMVA",
531  "Pull for tracks with MVA > 0.8 and p < 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
532  100,
533  -10.,
534  10.);
536  ibook.book1D("TrackPullHighP", "Pull for tracks with p > 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}", 100, -10., 10.);
537  meTrackPullHighP_[0] = ibook.book1D("TrackPullHighP-LowMVA",
538  "Pull for tracks with MVA < 0.5 and p > 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
539  100,
540  -10.,
541  10.);
542  meTrackPullHighP_[1] =
543  ibook.book1D("TrackPullHighP-MediumMVA",
544  "Pull for tracks with 0.5 < MVA < 0.8 and p > 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
545  100,
546  -10.,
547  10.);
548  meTrackPullHighP_[2] = ibook.book1D("TrackPullHighP-HighMVA",
549  "Pull for tracks with MVA > 0.8 and p > 2 GeV; (t_{rec}-t_{sim})/#sigma_{t}",
550  100,
551  -10.,
552  10.);
553  if (optionalPlots_) {
555  ibook.book1D("TrackResMass-Protons-LowMVA",
556  "t_{rec} - t_{est} for proton tracks with MVA < 0.5; t_{rec} - t_{est} [ns] ",
557  100,
558  -1.,
559  1.);
561  ibook.book1D("TrackResMass-Protons-MediumMVA",
562  "t_{rec} - t_{est} for proton tracks with 0.5 < MVA < 0.8; t_{rec} - t_{est} [ns] ",
563  100,
564  -1.,
565  1.);
567  ibook.book1D("TrackResMass-Protons-HighMVA",
568  "t_{rec} - t_{est} for proton tracks with MVA > 0.8; t_{rec} - t_{est} [ns] ",
569  100,
570  -1.,
571  1.);
573  ibook.book1D("TrackResMassTrue-Protons-LowMVA",
574  "t_{est} - t_{sim} for proton tracks with MVA < 0.5; t_{est} - t_{sim} [ns] ",
575  100,
576  -1.,
577  1.);
579  ibook.book1D("TrackResMassTrue-Protons-MediumMVA",
580  "t_{est} - t_{sim} for proton tracks with 0.5 < MVA < 0.8; t_{est} - t_{sim} [ns] ",
581  100,
582  -1.,
583  1.);
585  ibook.book1D("TrackResMassTrue-Protons-HighMVA",
586  "t_{est} - t_{sim} for proton tracks with MVA > 0.8; t_{est} - t_{sim} [ns] ",
587  100,
588  -1.,
589  1.);
590 
591  meTrackResMassPions_[0] = ibook.book1D("TrackResMass-Pions-LowMVA",
592  "t_{rec} - t_{est} for pion tracks with MVA < 0.5; t_{rec} - t_{est} [ns] ",
593  100,
594  -1.,
595  1.);
597  ibook.book1D("TrackResMass-Pions-MediumMVA",
598  "t_{rec} - t_{est} for pion tracks with 0.5 < MVA < 0.8; t_{rec} - t_{est} [ns] ",
599  100,
600  -1.,
601  1.);
602  meTrackResMassPions_[2] = ibook.book1D("TrackResMass-Pions-HighMVA",
603  "t_{rec} - t_{est} for pion tracks with MVA > 0.8; t_{rec} - t_{est} [ns] ",
604  100,
605  -1.,
606  1.);
608  ibook.book1D("TrackResMassTrue-Pions-LowMVA",
609  "t_{est} - t_{sim} for pion tracks with MVA < 0.5; t_{est} - t_{sim} [ns] ",
610  100,
611  -1.,
612  1.);
614  ibook.book1D("TrackResMassTrue-Pions-MediumMVA",
615  "t_{est} - t_{sim} for pion tracks with 0.5 < MVA < 0.8; t_{est} - t_{sim} [ns] ",
616  100,
617  -1.,
618  1.);
620  ibook.book1D("TrackResMassTrue-Pions-HighMVA",
621  "t_{est} - t_{sim} for pion tracks with MVA > 0.8; t_{est} - t_{sim} [ns] ",
622  100,
623  -1.,
624  1.);
625  }
626 }
MonitorElement * meTrackResMassProtons_[3]
MonitorElement * meTrackResMassTrueProtons_[3]
MonitorElement * meTrackResMassTruePions_[3]
void Primary4DVertexValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1449 of file Primary4DVertexValidation.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

1449  {
1451 
1452  desc.add<std::string>("folder", "MTD/Vertices");
1453  desc.add<edm::InputTag>("TPtoRecoTrackAssoc", edm::InputTag("trackingParticleRecoTrackAsssociation"));
1454  desc.add<edm::InputTag>("mtdTracks", edm::InputTag("trackExtenderWithMTD"));
1455  desc.add<edm::InputTag>("SimTag", edm::InputTag("mix", "MergedTrackTruth"));
1456  desc.add<edm::InputTag>("offlineBS", edm::InputTag("offlineBeamSpot"));
1457  desc.add<edm::InputTag>("offline4DPV", edm::InputTag("offlinePrimaryVertices4D"));
1458  desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD:generalTrackassoc"))
1459  ->setComment("Association between General and MTD Extended tracks");
1460  desc.add<edm::InputTag>("pathLengthSrc", edm::InputTag("trackExtenderWithMTD:generalTrackPathLength"));
1461  desc.add<edm::InputTag>("momentumSrc", edm::InputTag("trackExtenderWithMTD:generalTrackp"));
1462  desc.add<edm::InputTag>("timeSrc", edm::InputTag("trackExtenderWithMTD:generalTracktmtd"));
1463  desc.add<edm::InputTag>("sigmaSrc", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd"));
1464  desc.add<edm::InputTag>("t0SafePID", edm::InputTag("tofPID:t0safe"));
1465  desc.add<edm::InputTag>("sigmat0SafePID", edm::InputTag("tofPID:sigmat0safe"));
1466  desc.add<edm::InputTag>("trackMVAQual", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA"));
1467  desc.add<bool>("useOnlyChargedTracks", true);
1468  desc.addUntracked<bool>("debug", false);
1469  desc.addUntracked<bool>("optionalPlots", false);
1470  desc.add<double>("trackweightTh", 0.5);
1471  desc.add<double>("mvaTh", 0.01);
1472 
1473  //lineDensity parameters have been obtained by fitting the distribution of the z position of the vertices,
1474  //using a 200k single mu ptGun sample (gaussian fit)
1475  std::vector<double> lDP;
1476  lDP.push_back(1.87);
1477  lDP.push_back(0.);
1478  lDP.push_back(42.5);
1479  desc.add<std::vector<double>>("lineDensityPar", lDP);
1480  descriptions.add("vertices4DValid", desc);
1481 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::Ref< std::vector< TrackingParticle > > * Primary4DVertexValidation::getMatchedTP ( const reco::TrackBaseRef recoTrack,
const TrackingVertexRef vsim 
)
private

Definition at line 645 of file Primary4DVertexValidation.cc.

References edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), newFWLiteAna::found, r2s_, and cmsswSequenceInfo::tp.

Referenced by analyze(), and matchReco2Sim().

646  {
647  auto found = r2s_->find(recoTrack);
648 
649  // reco track not matched to any TP
650  if (found == r2s_->end())
651  return nullptr;
652 
653  //matched TP equal to any TP of sim vertex
654  for (const auto& tp : found->val) {
655  if (std::find_if(vsim->daughterTracks_begin(), vsim->daughterTracks_end(), [&](const TrackingParticleRef& vtp) {
656  return tp.first == vtp;
657  }) != vsim->daughterTracks_end())
658  return &tp.first;
659  }
660 
661  // reco track not matched to any TP from vertex
662  return nullptr;
663 }
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
const reco::RecoToSimCollection * r2s_
std::vector< Primary4DVertexValidation::recoPrimaryVertex > Primary4DVertexValidation::getRecoPVs ( const edm::Handle< edm::View< reco::Vertex >> &  tVC)
private

Definition at line 800 of file Primary4DVertexValidation.cc.

References funct::abs(), HLT_FULL_cff::distance, edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), SiStripPI::min, Primary4DVertexValidation::recoPrimaryVertex::nRecoTrk, Primary4DVertexValidation::recoPrimaryVertex::num_matched_sim_tracks, Primary4DVertexValidation::recoPrimaryVertex::pt, Primary4DVertexValidation::recoPrimaryVertex::ptsq, alignCSCRings::r, r2s_, Primary4DVertexValidation::recoPrimaryVertex::recVtx, mathSSE::sqrt(), and findQualityFiles::v.

Referenced by analyze().

801  {
802  std::vector<Primary4DVertexValidation::recoPrimaryVertex> recopv;
803  int r = -1;
804  for (auto v = tVC->begin(); v != tVC->end(); ++v) {
805  r++;
806  // Skip junk vertices
807  if (std::abs(v->z()) > 1000)
808  continue;
809  if (v->isFake() || !v->isValid())
810  continue;
811 
812  recoPrimaryVertex sv(v->position().x(), v->position().y(), v->position().z());
813  sv.recVtx = &(*v);
814  sv.recVtxRef = reco::VertexBaseRef(tVC, std::distance(tVC->begin(), v));
815 
816  sv.OriginalIndex = r;
817  // this is a new vertex, add it to the list of reco-vertices
818  recopv.push_back(sv);
820 
821  // Loop over daughter track(s)
822  for (auto iTrack = v->tracks_begin(); iTrack != v->tracks_end(); ++iTrack) {
823  auto momentum = (*(*iTrack)).innerMomentum();
824  if (momentum.mag2() == 0)
825  momentum = (*(*iTrack)).momentum();
826  vp->pt += std::sqrt(momentum.perp2());
827  vp->ptsq += (momentum.perp2());
828  vp->nRecoTrk++;
829 
830  auto matched = r2s_->find(*iTrack);
831  if (matched != r2s_->end()) {
833  }
834 
835  } // End of for loop on daughters reconstructed tracks
836  } // End of for loop on tracking vertices
837 
838  // In case of no reco vertices, break here
839  if (recopv.empty())
840  return recopv;
841 
842  // Now compute the closest distance in z between all reconstructed vertex
843  // first initialize
844  auto prev_z = recopv.back().z;
845  for (recoPrimaryVertex& vreco : recopv) {
846  vreco.closest_vertex_distance_z = std::abs(vreco.z - prev_z);
847  prev_z = vreco.z;
848  }
849  for (std::vector<recoPrimaryVertex>::iterator vreco = recopv.begin(); vreco != recopv.end(); vreco++) {
850  std::vector<recoPrimaryVertex>::iterator vreco2 = vreco;
851  vreco2++;
852  for (; vreco2 != recopv.end(); vreco2++) {
853  double distance = std::abs(vreco->z - vreco2->z);
854  // need both to be complete
855  vreco->closest_vertex_distance_z = std::min(vreco->closest_vertex_distance_z, distance);
856  vreco2->closest_vertex_distance_z = std::min(vreco2->closest_vertex_distance_z, distance);
857  }
858  }
859  return recopv;
860 }
const_iterator end() const
last iterator over the map (read only)
edm::RefToBase< reco::Vertex > VertexBaseRef
persistent reference to a Vertex, using views
Definition: VertexFwd.h:21
const_iterator find(const key_type &k) const
find element with specified reference key
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const reco::RecoToSimCollection * r2s_
std::vector< Primary4DVertexValidation::simPrimaryVertex > Primary4DVertexValidation::getSimPVs ( const edm::Handle< TrackingVertexCollection > &  tVC)
private

Definition at line 699 of file Primary4DVertexValidation.cc.

References funct::abs(), cms::cuda::assert(), Primary4DVertexValidation::simPrimaryVertex::average_match_quality, debug_, HLT_FULL_cff::distance, alignCSCRings::e, edm::AssociationMap< Tag >::end(), Primary4DVertexValidation::simPrimaryVertex::eventId, edm::AssociationMap< Tag >::find(), SiStripPI::min, Primary4DVertexValidation::simPrimaryVertex::nGenTrk, Primary4DVertexValidation::simPrimaryVertex::num_matched_reco_tracks, Primary4DVertexValidation::simPrimaryVertex::ptot, Primary4DVertexValidation::simPrimaryVertex::ptsq, alignCSCRings::s, s2r_, use_only_charged_tracks_, and findQualityFiles::v.

Referenced by analyze().

700  {
701  std::vector<Primary4DVertexValidation::simPrimaryVertex> simpv;
702  int current_event = -1;
703  int s = -1;
704  for (TrackingVertexCollection::const_iterator v = tVC->begin(); v != tVC->end(); ++v) {
705  //We keep only the first vertex from all the events at BX=0.
706  if (v->eventId().bunchCrossing() != 0)
707  continue;
708  if (v->eventId().event() != current_event) {
709  current_event = v->eventId().event();
710  } else {
711  continue;
712  }
713  s++;
714  if (std::abs(v->position().z()) > 1000)
715  continue; // skip junk vertices
716 
717  // could be a new vertex, check all primaries found so far to avoid multiple entries
718  simPrimaryVertex sv(v->position().x(), v->position().y(), v->position().z(), v->position().t());
719  sv.eventId = v->eventId();
720  sv.sim_vertex = TrackingVertexRef(tVC, std::distance(tVC->begin(), v));
721  sv.OriginalIndex = s;
722 
723  for (TrackingParticleRefVector::iterator iTrack = v->daughterTracks_begin(); iTrack != v->daughterTracks_end();
724  ++iTrack) {
725  assert((**iTrack).eventId().bunchCrossing() == 0);
726  }
727  simPrimaryVertex* vp = nullptr; // will become non-NULL if a vertex is found and then point to it
728  for (std::vector<simPrimaryVertex>::iterator v0 = simpv.begin(); v0 != simpv.end(); v0++) {
729  if ((sv.eventId == v0->eventId) && (std::abs(sv.x - v0->x) < 1e-5) && (std::abs(sv.y - v0->y) < 1e-5) &&
730  (std::abs(sv.z - v0->z) < 1e-5)) {
731  vp = &(*v0);
732  break;
733  }
734  }
735  if (!vp) {
736  // this is a new vertex, add it to the list of sim-vertices
737  simpv.push_back(sv);
738  vp = &simpv.back();
739  }
740 
741  // Loop over daughter track(s) as Tracking Particles
742  for (TrackingVertex::tp_iterator iTP = v->daughterTracks_begin(); iTP != v->daughterTracks_end(); ++iTP) {
743  auto momentum = (*(*iTP)).momentum();
744  const reco::Track* matched_best_reco_track = nullptr;
745  double match_quality = -1;
746  if (use_only_charged_tracks_ && (**iTP).charge() == 0)
747  continue;
748  if (s2r_->find(*iTP) != s2r_->end()) {
749  matched_best_reco_track = (*s2r_)[*iTP][0].first.get();
750  match_quality = (*s2r_)[*iTP][0].second;
751  }
752 
753  vp->ptot.setPx(vp->ptot.x() + momentum.x());
754  vp->ptot.setPy(vp->ptot.y() + momentum.y());
755  vp->ptot.setPz(vp->ptot.z() + momentum.z());
756  vp->ptot.setE(vp->ptot.e() + (**iTP).energy());
757  vp->ptsq += ((**iTP).pt() * (**iTP).pt());
758 
759  if (matched_best_reco_track) {
760  vp->num_matched_reco_tracks++;
761  vp->average_match_quality += match_quality;
762  }
763  } // End of for loop on daughters sim-particles
764  if (vp->num_matched_reco_tracks)
765  vp->average_match_quality /= static_cast<float>(vp->num_matched_reco_tracks);
766  if (debug_) {
767  edm::LogPrint("Primary4DVertexValidation")
768  << "average number of associated tracks: " << vp->num_matched_reco_tracks / static_cast<float>(vp->nGenTrk)
769  << " with average quality: " << vp->average_match_quality;
770  }
771  } // End of for loop on tracking vertices
772 
773  // In case of no simulated vertices, break here
774  if (simpv.empty())
775  return simpv;
776 
777  // Now compute the closest distance in z between all simulated vertex
778  // first initialize
779  auto prev_z = simpv.back().z;
780  for (simPrimaryVertex& vsim : simpv) {
781  vsim.closest_vertex_distance_z = std::abs(vsim.z - prev_z);
782  prev_z = vsim.z;
783  }
784  // then calculate
785  for (std::vector<simPrimaryVertex>::iterator vsim = simpv.begin(); vsim != simpv.end(); vsim++) {
786  std::vector<simPrimaryVertex>::iterator vsim2 = vsim;
787  vsim2++;
788  for (; vsim2 != simpv.end(); vsim2++) {
789  double distance = std::abs(vsim->z - vsim2->z);
790  // need both to be complete
791  vsim->closest_vertex_distance_z = std::min(vsim->closest_vertex_distance_z, distance);
792  vsim2->closest_vertex_distance_z = std::min(vsim2->closest_vertex_distance_z, distance);
793  }
794  }
795  return simpv;
796 }
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Warning, true > LogPrint
edm::Ref< TrackingVertexCollection > TrackingVertexRef
const reco::SimToRecoCollection * s2r_
void Primary4DVertexValidation::matchReco2Sim ( std::vector< recoPrimaryVertex > &  recopv,
std::vector< simPrimaryVertex > &  simpv,
const edm::ValueMap< float > &  sigmat0,
const edm::ValueMap< float > &  MVA,
const edm::Handle< reco::BeamSpot > &  BS 
)
private

Definition at line 863 of file Primary4DVertexValidation.cc.

References funct::abs(), c_, funct::cos(), debug_, getMatchedTP(), mps_fire::i, iev, gpuVertexFinder::iv, isotrackApplyRegressor::k, maxRank_, maxTry_, SiStripPI::min, mvaTh_, NOT_MATCHED, funct::pow(), DiDispStaMuonMonitor_cfi::pt, BeamSpotPI::sigmaZ, funct::sin(), funct::tan(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::trackWeight(), trackweightTh_, and zWosMatchMax_.

Referenced by analyze().

867  {
868  for (auto vv : simpv) {
869  vv.wnt.clear();
870  vv.wos.clear();
871  }
872  for (auto rv : recopv) {
873  rv.wnt.clear();
874  rv.wos.clear();
875  }
876 
877  for (unsigned int iv = 0; iv < recopv.size(); iv++) {
878  const reco::Vertex* vertex = recopv.at(iv).recVtx;
879 
880  for (unsigned int iev = 0; iev < simpv.size(); iev++) {
881  double wnt = 0;
882  double wos = 0;
883  double evwnt = 0;
884  double evwos = 0;
885  double evnt = 0;
886 
887  for (auto iTrack = vertex->tracks_begin(); iTrack != vertex->tracks_end(); ++iTrack) {
888  double pt = (*iTrack)->pt();
889 
890  if (vertex->trackWeight(*iTrack) < trackweightTh_)
891  continue;
892  if (MVA[(*iTrack)] < mvaTh_)
893  continue;
894 
895  auto tp_info = getMatchedTP(*iTrack, simpv.at(iev).sim_vertex);
896  if (tp_info != nullptr) {
897  double dz2_beam = pow((*BS).BeamWidthX() * cos((*iTrack)->phi()) / tan((*iTrack)->theta()), 2) +
898  pow((*BS).BeamWidthY() * sin((*iTrack)->phi()) / tan((*iTrack)->theta()), 2);
899  double dz2 = pow((*iTrack)->dzError(), 2) + dz2_beam +
900  pow(0.0020, 2); // added 20 um, some tracks have crazy small resolutions
901  wos = vertex->trackWeight(*iTrack) / dz2;
902  wnt = vertex->trackWeight(*iTrack) * std::min(pt, 1.0);
903 
904  if (sigmat0[(*iTrack)] > 0) {
905  double sigmaZ = (*BS).sigmaZ();
906  double sigmaT = sigmaZ / c_; // c in cm/ns
907  wos = wos / erf(sigmat0[(*iTrack)] / sigmaT);
908  }
909  simpv.at(iev).addTrack(iv, wos, wnt);
910  recopv.at(iv).addTrack(iev, wos, wnt);
911  evwos += wos;
912  evwnt += wnt;
913  evnt++;
914  }
915  } //RecoTracks loop
916 
917  // require 2 tracks for a wos-match
918  if ((evwos > 0) && (evwos > recopv.at(iv).maxwos) && (evnt > 1)) {
919  recopv.at(iv).wosmatch = iev;
920  recopv.at(iv).maxwos = evwos;
921  recopv.at(iv).maxwosnt = evnt;
922 
923  simpv.at(iev).wos_dominated_recv.push_back(iv);
924  simpv.at(iev).nwosmatch++;
925  }
926 
927  // weighted track counting match, require at least one track
928  if ((evnt > 0) && (evwnt > recopv.at(iv).maxwnt)) {
929  recopv.at(iv).wntmatch = iev;
930  recopv.at(iv).maxwnt = evwnt;
931  }
932  } //TrackingVertex loop
933 
934  } //RecoPrimaryVertex
935 
936  //after filling infos, goes for the sim-reco match
937  for (auto& vrec : recopv) {
938  vrec.sim = NOT_MATCHED;
939  vrec.matchQuality = 0;
940  }
941  unsigned int iev = 0;
942  for (auto& vv : simpv) {
943  if (debug_) {
944  edm::LogPrint("Primary4DVertexValidation") << "iev: " << iev;
945  edm::LogPrint("Primary4DVertexValidation") << "wos_dominated_recv.size: " << vv.wos_dominated_recv.size();
946  }
947  for (unsigned int i = 0; i < vv.wos_dominated_recv.size(); i++) {
948  auto recov = vv.wos_dominated_recv.at(i);
949  if (debug_) {
950  edm::LogPrint("Primary4DVertexValidation")
951  << "index of reco vertex: " << recov << " that has a wos: " << vv.wos.at(recov) << " at position " << i;
952  }
953  }
954  vv.rec = NOT_MATCHED;
955  vv.matchQuality = 0;
956  iev++;
957  }
958  //this tries a one-to-one match, taking simPV with highest wos if there are > 1 simPV candidates
959  for (unsigned int rank = 1; rank < maxRank_; rank++) {
960  for (unsigned int iev = 0; iev < simpv.size(); iev++) { //loop on SimPV
961  if (simpv.at(iev).rec != NOT_MATCHED)
962  continue;
963  if (simpv.at(iev).nwosmatch == 0)
964  continue;
965  if (simpv.at(iev).nwosmatch > rank)
966  continue;
967  unsigned int iv = NOT_MATCHED;
968  for (unsigned int k = 0; k < simpv.at(iev).wos_dominated_recv.size(); k++) {
969  unsigned int rec = simpv.at(iev).wos_dominated_recv.at(k);
970  auto vrec = recopv.at(rec);
971  if (vrec.sim != NOT_MATCHED)
972  continue; // already matched
973  if (std::abs(simpv.at(iev).z - vrec.z) > zWosMatchMax_)
974  continue; // insanely far away
975  if ((iv == NOT_MATCHED) || simpv.at(iev).wos.at(rec) > simpv.at(iev).wos.at(iv)) {
976  iv = rec;
977  }
978  }
979  if (iv !=
980  NOT_MATCHED) { //if the rec vertex has already been associated is possible that iv remains NOT_MATCHED at this point
981  recopv.at(iv).sim = iev;
982  simpv.at(iev).rec = iv;
983  recopv.at(iv).matchQuality = rank;
984  simpv.at(iev).matchQuality = rank;
985  }
986  }
987  }
988  //give vertices a chance that have a lot of overlap, but are still recognizably
989  //caused by a specific simvertex (without being classified as dominating)
990  //like a small peak sitting on the flank of a larger nearby peak
991  unsigned int ntry = 0;
992  while (ntry++ < maxTry_) {
993  unsigned nmatch = 0;
994  for (unsigned int iev = 0; iev < simpv.size(); iev++) {
995  if ((simpv.at(iev).rec != NOT_MATCHED) || (simpv.at(iev).wos.empty()))
996  continue;
997  // find a rec vertex for the NOT_MATCHED sim vertex
998  unsigned int rec = NOT_MATCHED;
999  for (auto rv : simpv.at(iev).wos) {
1000  if ((rec == NOT_MATCHED) || (rv.second > simpv.at(iev).wos.at(rec))) {
1001  rec = rv.first;
1002  }
1003  }
1004 
1005  if (rec == NOT_MATCHED) { //try with wnt match
1006  for (auto rv : simpv.at(iev).wnt) {
1007  if ((rec == NOT_MATCHED) || (rv.second > simpv.at(iev).wnt.at(rec))) {
1008  rec = rv.first;
1009  }
1010  }
1011  }
1012 
1013  if (rec == NOT_MATCHED)
1014  continue;
1015  if (recopv.at(rec).sim != NOT_MATCHED)
1016  continue; // already gone
1017 
1018  // check if the recvertex can be matched
1019  unsigned int rec2sim = NOT_MATCHED;
1020  for (auto sv : recopv.at(rec).wos) {
1021  if (simpv.at(sv.first).rec != NOT_MATCHED)
1022  continue; // already used
1023  if ((rec2sim == NOT_MATCHED) || (sv.second > recopv.at(rec).wos.at(rec2sim))) {
1024  rec2sim = sv.first;
1025  }
1026  }
1027  if (iev == rec2sim) {
1028  // do the match and assign lowest quality (i.e. max rank)
1029  recopv.at(rec).sim = iev;
1030  recopv.at(rec).matchQuality = maxRank_;
1031  simpv.at(iev).rec = rec;
1032  simpv.at(iev).matchQuality = maxRank_;
1033  nmatch++;
1034  }
1035  } //sim loop
1036  if (nmatch == 0) {
1037  break;
1038  }
1039  } // ntry
1040 }
int32_t *__restrict__ iv
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.h:110
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:96
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.h:108
Log< level::Warning, true > LogPrint
static constexpr unsigned int NOT_MATCHED
const edm::Ref< std::vector< TrackingParticle > > * getMatchedTP(const reco::TrackBaseRef &, const TrackingVertexRef &)
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int32_t int iev
static constexpr double zWosMatchMax_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
bool Primary4DVertexValidation::matchRecoTrack2SimSignal ( const reco::TrackBaseRef recoTrack)
private

Definition at line 628 of file Primary4DVertexValidation.cc.

References edm::AssociationMap< Tag >::end(), edm::AssociationMap< Tag >::find(), newFWLiteAna::found, r2s_, and cmsswSequenceInfo::tp.

628  {
629  auto found = r2s_->find(recoTrack);
630 
631  // reco track not matched to any TP
632  if (found == r2s_->end())
633  return false;
634 
636  for (const auto& tp : found->val) {
637  if (tp.first->eventId().bunchCrossing() == 0 && tp.first->eventId().event() == 0)
638  return true;
639  }
640 
641  // reco track not matched to any TP from signal vertex
642  return false;
643 }
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
const reco::RecoToSimCollection * r2s_
const bool Primary4DVertexValidation::mvaRecSel ( const reco::TrackBase trk,
const reco::Vertex vtx,
const double &  t0,
const double &  st0 
)
private

Definition at line 1492 of file Primary4DVertexValidation.cc.

References funct::abs(), deltaZcut_, reco::TrackBase::eta(), etacutREC_, match(), reco::TrackBase::pt(), pTcut_, reco::Vertex::t(), reco::TrackBase::vz(), and reco::Vertex::z().

Referenced by analyze().

1495  {
1496  bool match = false;
1497  match = trk.pt() > pTcut_ && std::abs(trk.eta()) < etacutREC_ && std::abs(trk.vz() - vtx.z()) <= deltaZcut_;
1498  if (st0 > 0.) {
1499  match = match && std::abs(t0 - vtx.t()) < 3. * st0;
1500  }
1501  return match;
1502 }
static constexpr double etacutREC_
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
double pt() const
track transverse momentum
Definition: TrackBase.h:637
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
z coordinate
Definition: Vertex.h:133
static constexpr double deltaZcut_
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:661
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
double t() const
t coordinate
Definition: Vertex.h:135
const bool Primary4DVertexValidation::mvaTPSel ( const TrackingParticle tp)
private

Definition at line 1483 of file Primary4DVertexValidation.cc.

References funct::abs(), TrackingParticle::charge(), TrackingParticle::eta(), etacutGEN_, match(), TrackingParticle::pt(), pTcut_, and TrackingParticle::status().

Referenced by analyze().

1483  {
1484  bool match = false;
1485  if (tp.status() != 1) {
1486  return match;
1487  }
1488  match = tp.charge() != 0 && tp.pt() > pTcut_ && std::abs(tp.eta()) < etacutGEN_;
1489  return match;
1490 }
double pt() const
Transverse momentum. Note this is taken from the first SimTrack only.
static constexpr double etacutGEN_
int status() const
Status word.
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double eta() const
Momentum pseudorapidity. Note this is taken from the first SimTrack only.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
bool Primary4DVertexValidation::select ( const reco::Vertex v,
int  level = 0 
)
private

Definition at line 677 of file Primary4DVertexValidation.cc.

References reco::Vertex::isFake(), reco::Vertex::ndof(), and selNdof_.

Referenced by analyze().

677  {
678  /* level
679  0 !isFake && ndof>4 (default)
680  1 !isFake && ndof>4 && prob > 0.01
681  2 !isFake && ndof>4 && prob > 0.01 && ptmax2 > 0.4
682  */
683  if (v.isFake())
684  return false;
685  if ((level == 0) && (v.ndof() > selNdof_))
686  return true;
687  /*if ((level == 1) && (v.ndof() > selNdof_) && (vertex_pxy(v) > 0.01))
688  return true;
689  if ((level == 2) && (v.ndof() > selNdof_) && (vertex_pxy(v) > 0.01) && (vertex_ptmax2(v) > 0.4))
690  return true;
691  if ((level == 3) && (v.ndof() > selNdof_) && (vertex_ptmax2(v) < 0.4))
692  return true;*/
693  return false;
694 }
double ndof() const
Definition: Vertex.h:123
bool isFake() const
Definition: Vertex.h:76
tuple level
Definition: testEve_cfg.py:47
double Primary4DVertexValidation::timeFromTrueMass ( double  mass,
double  pathlength,
double  momentum,
double  time 
)
private

Definition at line 665 of file Primary4DVertexValidation.cc.

References c_, ResonanceBuilder::mass, mathSSE::sqrt(), and findQualityFiles::v.

Referenced by analyze().

665  {
666  if (time > 0 && pathlength > 0 && mass > 0) {
667  double gammasq = 1. + momentum * momentum / (mass * mass);
668  double v = c_ * std::sqrt(1. - 1. / gammasq); // cm / ns
669  double t_est = time - (pathlength / v);
670 
671  return t_est;
672  } else {
673  return -1;
674  }
675 }
T sqrt(T t)
Definition: SSEVec.h:19

Member Data Documentation

constexpr double Primary4DVertexValidation::c_ = 2.99792458e1
staticprivate

Definition at line 211 of file Primary4DVertexValidation.cc.

Referenced by matchReco2Sim(), and timeFromTrueMass().

bool Primary4DVertexValidation::debug_
private

Definition at line 250 of file Primary4DVertexValidation.cc.

Referenced by analyze(), getSimPVs(), and matchReco2Sim().

constexpr double Primary4DVertexValidation::deltaZcut_ = 0.1
staticprivate

Definition at line 221 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and mvaRecSel().

constexpr double Primary4DVertexValidation::etacutGEN_ = 4.
staticprivate

Definition at line 218 of file Primary4DVertexValidation.cc.

Referenced by mvaTPSel().

constexpr double Primary4DVertexValidation::etacutREC_ = 3.
staticprivate

Definition at line 219 of file Primary4DVertexValidation.cc.

Referenced by mvaRecSel().

const std::string Primary4DVertexValidation::folder_
private

Definition at line 208 of file Primary4DVertexValidation.cc.

Referenced by bookHistograms().

const std::vector<double> Primary4DVertexValidation::lineDensityPar_
private

Definition at line 225 of file Primary4DVertexValidation.cc.

Referenced by analyze().

constexpr double Primary4DVertexValidation::maxRank_ = 8.
staticprivate

Definition at line 215 of file Primary4DVertexValidation.cc.

Referenced by matchReco2Sim().

constexpr double Primary4DVertexValidation::maxTry_ = 10.
staticprivate

Definition at line 216 of file Primary4DVertexValidation.cc.

Referenced by matchReco2Sim().

MonitorElement* Primary4DVertexValidation::meDeltaTfakefake_
private

Definition at line 284 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meDeltaTfakereal_
private

Definition at line 285 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meDeltaTrealreal_
private

Definition at line 283 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meDeltaZfakefake_
private

Definition at line 281 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meDeltaZfakereal_
private

Definition at line 282 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meDeltaZrealreal_
private

Definition at line 280 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMatchQual_
private

Definition at line 279 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackEffEtaTot_
private

Definition at line 257 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackEffPtTot_
private

Definition at line 254 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackMatchedEffEtaMtd_
private

Definition at line 259 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackMatchedEffEtaTot_
private

Definition at line 258 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackMatchedEffPtMtd_
private

Definition at line 256 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackMatchedEffPtTot_
private

Definition at line 255 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackPullTot_
private

Definition at line 261 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackResTot_
private

Definition at line 260 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meMVATrackZposResTot_
private

Definition at line 268 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::mePUvsOtherFakeV_
private

Definition at line 277 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::mePUvsRealV_
private

Definition at line 276 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::mePUvsSplitV_
private

Definition at line 278 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecoPosInRecoOrigCollection_
private

Definition at line 287 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecoPosInSimCollection_
private

Definition at line 286 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecoPVPosSignal_
private

Definition at line 289 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecoPVPosSignalNotHighestPt_
private

Definition at line 290 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecoVtxVsLineDensity_
private

Definition at line 291 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecPVT_
private

Definition at line 294 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecPVZ_
private

Definition at line 293 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meRecVerNumber_
private

Definition at line 292 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meSimPosInSimOrigCollection_
private

Definition at line 288 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meSimPVZ_
private

Definition at line 295 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTimePull_
private

Definition at line 273 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTimeRes_
private

Definition at line 272 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTimeSignalPull_
private

Definition at line 275 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTimeSignalRes_
private

Definition at line 274 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrack3DposRes_[3]
private

Definition at line 271 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPull_[3]
private

Definition at line 265 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPullHighP_[3]
private

Definition at line 306 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPullHighPTot_
private

Definition at line 301 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPullLowP_[3]
private

Definition at line 305 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPullLowPTot_
private

Definition at line 300 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackPullTot_
private

Definition at line 263 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackRes_[3]
private

Definition at line 264 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResHighP_[3]
private

Definition at line 304 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResHighPTot_
private

Definition at line 299 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResLowP_[3]
private

Definition at line 303 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResLowPTot_
private

Definition at line 298 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMass_[3]
private

Definition at line 266 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMassPions_[3]
private

Definition at line 310 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMassProtons_[3]
private

Definition at line 308 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMassTrue_[3]
private

Definition at line 267 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMassTruePions_[3]
private

Definition at line 311 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResMassTrueProtons_[3]
private

Definition at line 309 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackResTot_
private

Definition at line 262 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackZposRes_[3]
private

Definition at line 270 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* Primary4DVertexValidation::meTrackZposResTot_
private

Definition at line 269 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::momentumToken_
private

Definition at line 242 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

constexpr double Primary4DVertexValidation::mvaH_ = 0.8
staticprivate

Definition at line 213 of file Primary4DVertexValidation.cc.

Referenced by analyze().

constexpr double Primary4DVertexValidation::mvaL_ = 0.5
staticprivate

Definition at line 212 of file Primary4DVertexValidation.cc.

Referenced by analyze().

const double Primary4DVertexValidation::mvaTh_
private

Definition at line 224 of file Primary4DVertexValidation.cc.

Referenced by matchReco2Sim().

constexpr unsigned int Primary4DVertexValidation::NOT_MATCHED = 66666
staticprivate

Definition at line 209 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and matchReco2Sim().

bool Primary4DVertexValidation::optionalPlots_
private

Definition at line 251 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::pathLengthToken_
private

Definition at line 241 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

constexpr double Primary4DVertexValidation::pTcut_ = 0.7
staticprivate

Definition at line 220 of file Primary4DVertexValidation.cc.

Referenced by mvaRecSel(), and mvaTPSel().

const reco::RecoToSimCollection* Primary4DVertexValidation::r2s_
private
edm::EDGetTokenT<edm::View<reco::Vertex> > Primary4DVertexValidation::Rec4DVerToken_
private

Definition at line 238 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<reco::BeamSpot> Primary4DVertexValidation::RecBeamSpotToken_
private

Definition at line 237 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<reco::RecoToSimCollection> Primary4DVertexValidation::recoToSimAssociationToken_
private

Definition at line 236 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<reco::TrackCollection> Primary4DVertexValidation::RecTrackToken_
private

Definition at line 229 of file Primary4DVertexValidation.cc.

Referenced by Primary4DVertexValidation().

const reco::SimToRecoCollection* Primary4DVertexValidation::s2r_
private

Definition at line 227 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and getSimPVs().

constexpr double Primary4DVertexValidation::selNdof_ = 4.
staticprivate

Definition at line 214 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and select().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::sigmat0SafePidToken_
private

Definition at line 246 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<reco::SimToRecoCollection> Primary4DVertexValidation::simToRecoAssociationToken_
private

Definition at line 235 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

constexpr double Primary4DVertexValidation::simUnit_ = 1e9
staticprivate

Definition at line 210 of file Primary4DVertexValidation.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::t0SafePidToken_
private

Definition at line 245 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::timeToken_
private

Definition at line 243 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<edm::ValueMap<int> > Primary4DVertexValidation::trackAssocToken_
private

Definition at line 240 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<TrackingParticleCollection> Primary4DVertexValidation::trackingParticleCollectionToken_
private

Definition at line 233 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<TrackingVertexCollection> Primary4DVertexValidation::trackingVertexCollectionToken_
private

Definition at line 234 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

edm::EDGetTokenT<edm::ValueMap<float> > Primary4DVertexValidation::trackMVAQualToken_
private

Definition at line 247 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

const double Primary4DVertexValidation::trackweightTh_
private

Definition at line 223 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and matchReco2Sim().

bool Primary4DVertexValidation::use_only_charged_tracks_
private

Definition at line 249 of file Primary4DVertexValidation.cc.

Referenced by getSimPVs().

edm::EDGetTokenT<std::vector<PileupSummaryInfo> > Primary4DVertexValidation::vecPileupSummaryInfoToken_
private

Definition at line 231 of file Primary4DVertexValidation.cc.

Referenced by analyze(), and Primary4DVertexValidation().

constexpr double Primary4DVertexValidation::zWosMatchMax_ = 1.
staticprivate

Definition at line 217 of file Primary4DVertexValidation.cc.

Referenced by matchReco2Sim().