@@ -94,6 +94,7 @@ class ScoutingCollectionMonitor : public DQMEDAnalyzer {
9494 const edm::EDGetTokenT<std::vector<Run3ScoutingElectron>> electronsToken_;
9595 const edm::EDGetTokenT<std::vector<Run3ScoutingVertex>> primaryVerticesToken_;
9696 const edm::EDGetTokenT<std::vector<Run3ScoutingVertex>> verticesToken_;
97+ const edm::EDGetTokenT<std::vector<Run3ScoutingVertex>> verticesNoVtxToken_;
9798 const edm::EDGetTokenT<std::vector<Run3ScoutingPhoton>> photonsToken_;
9899 const edm::EDGetTokenT<double > rhoToken_;
99100 const edm::EDGetTokenT<double > pfMetPhiToken_;
@@ -236,7 +237,7 @@ class ScoutingCollectionMonitor : public DQMEDAnalyzer {
236237 dqm::reco::MonitorElement* sMin_ele_hist ;
237238 dqm::reco::MonitorElement* sMaj_ele_hist ;
238239
239- // muon histograms (index 0: noVtx, index1: Vtx
240+ // muon histograms (index 0: noVtx, index1: Vtx)
240241 dqm::reco::MonitorElement* pt_mu_hist[2 ];
241242 dqm::reco::MonitorElement* eta_mu_hist[2 ];
242243 dqm::reco::MonitorElement* phi_mu_hist[2 ];
@@ -329,20 +330,20 @@ class ScoutingCollectionMonitor : public DQMEDAnalyzer {
329330 dqm::reco::MonitorElement* xzCov_pv_hist;
330331 dqm::reco::MonitorElement* yzCov_pv_hist;
331332
332- // displaced vertex histograms
333- dqm::reco::MonitorElement* x_vtx_hist;
334- dqm::reco::MonitorElement* y_vtx_hist;
335- dqm::reco::MonitorElement* z_vtx_hist;
336- dqm::reco::MonitorElement* zError_vtx_hist;
337- dqm::reco::MonitorElement* xError_vtx_hist;
338- dqm::reco::MonitorElement* yError_vtx_hist;
339- dqm::reco::MonitorElement* tracksSize_vtx_hist;
340- dqm::reco::MonitorElement* chi2_vtx_hist;
341- dqm::reco::MonitorElement* ndof_vtx_hist;
342- dqm::reco::MonitorElement* isValidVtx_vtx_hist;
343- dqm::reco::MonitorElement* xyCov_vtx_hist;
344- dqm::reco::MonitorElement* xzCov_vtx_hist;
345- dqm::reco::MonitorElement* yzCov_vtx_hist;
333+ // displaced vertex histograms (index 0: Vtx, index1: NoVtx)
334+ dqm::reco::MonitorElement* x_vtx_hist[ 2 ] ;
335+ dqm::reco::MonitorElement* y_vtx_hist[ 2 ] ;
336+ dqm::reco::MonitorElement* z_vtx_hist[ 2 ] ;
337+ dqm::reco::MonitorElement* zError_vtx_hist[ 2 ] ;
338+ dqm::reco::MonitorElement* xError_vtx_hist[ 2 ] ;
339+ dqm::reco::MonitorElement* yError_vtx_hist[ 2 ] ;
340+ dqm::reco::MonitorElement* tracksSize_vtx_hist[ 2 ] ;
341+ dqm::reco::MonitorElement* chi2_vtx_hist[ 2 ] ;
342+ dqm::reco::MonitorElement* ndof_vtx_hist[ 2 ] ;
343+ dqm::reco::MonitorElement* isValidVtx_vtx_hist[ 2 ] ;
344+ dqm::reco::MonitorElement* xyCov_vtx_hist[ 2 ] ;
345+ dqm::reco::MonitorElement* xzCov_vtx_hist[ 2 ] ;
346+ dqm::reco::MonitorElement* yzCov_vtx_hist[ 2 ] ;
346347
347348 // general tracking histograms
348349 dqm::reco::MonitorElement* tk_pt_tk_hist;
@@ -397,6 +398,8 @@ ScoutingCollectionMonitor::ScoutingCollectionMonitor(const edm::ParameterSet& iC
397398 consumes<std::vector<Run3ScoutingVertex>>(iConfig.getParameter<edm::InputTag>(" primaryVertices" ))),
398399 verticesToken_(
399400 consumes<std::vector<Run3ScoutingVertex>>(iConfig.getParameter<edm::InputTag>(" displacedVertices" ))),
401+ verticesNoVtxToken_(
402+ consumes<std::vector<Run3ScoutingVertex>>(iConfig.getParameter<edm::InputTag>(" displacedVertices" ))),
400403 photonsToken_(consumes<std::vector<Run3ScoutingPhoton>>(iConfig.getParameter<edm::InputTag>(" photons" ))),
401404 rhoToken_(consumes<double >(iConfig.getParameter<edm::InputTag>(" rho" ))),
402405 pfMetPhiToken_(consumes<double >(iConfig.getParameter<edm::InputTag>(" pfMetPhi" ))),
@@ -440,6 +443,7 @@ void ScoutingCollectionMonitor::analyze(const edm::Event& iEvent, const edm::Eve
440443 edm::Handle<std::vector<Run3ScoutingMuon>> muonsVtxH;
441444 edm::Handle<std::vector<Run3ScoutingPFJet>> PFjetsH;
442445 edm::Handle<std::vector<Run3ScoutingVertex>> verticesH;
446+ edm::Handle<std::vector<Run3ScoutingVertex>> verticesNoVtxH;
443447 edm::Handle<std::vector<Run3ScoutingVertex>> primaryVerticesH;
444448 edm::Handle<std::vector<Run3ScoutingTrack>> tracksH;
445449 edm::Handle<OnlineLuminosityRecord> onlineMetaDataDigisHandle;
@@ -454,6 +458,7 @@ void ScoutingCollectionMonitor::analyze(const edm::Event& iEvent, const edm::Eve
454458 !getValidHandle (iEvent, muonsVtxToken_, muonsVtxH, " muonsVtx" ) ||
455459 !getValidHandle (iEvent, pfjetsToken_, PFjetsH, " PF jets" ) ||
456460 !getValidHandle (iEvent, verticesToken_, verticesH, " vertices" ) ||
461+ !getValidHandle (iEvent, verticesNoVtxToken_, verticesNoVtxH, " verticesNoVtx" ) ||
457462 !getValidHandle (iEvent, primaryVerticesToken_, primaryVerticesH, " primary vertices" ) ||
458463 !getValidHandle (iEvent, tracksToken_, tracksH, " tracks" )) {
459464 return ;
@@ -725,21 +730,29 @@ void ScoutingCollectionMonitor::analyze(const edm::Event& iEvent, const edm::Eve
725730 }
726731
727732 // fill all the displaced vertices histograms
728- for (const auto & vtx : *verticesH) {
729- x_vtx_hist->Fill (vtx.x ());
730- y_vtx_hist->Fill (vtx.y ());
731- z_vtx_hist->Fill (vtx.z ());
732- zError_vtx_hist->Fill (vtx.zError ());
733- xError_vtx_hist->Fill (vtx.xError ());
734- yError_vtx_hist->Fill (vtx.yError ());
735- tracksSize_vtx_hist->Fill (vtx.tracksSize ());
736- chi2_vtx_hist->Fill (vtx.chi2 ());
737- ndof_vtx_hist->Fill (vtx.ndof ());
738- isValidVtx_vtx_hist->Fill (vtx.isValidVtx ());
739- xyCov_vtx_hist->Fill (vtx.xyCov ());
740- xzCov_vtx_hist->Fill (vtx.xzCov ());
741- yzCov_vtx_hist->Fill (vtx.yzCov ());
742- }
733+ auto fillVtxHistograms = [&](const auto & vtx, size_t idx) {
734+ x_vtx_hist[idx]->Fill (vtx.x ());
735+ y_vtx_hist[idx]->Fill (vtx.y ());
736+ z_vtx_hist[idx]->Fill (vtx.z ());
737+ zError_vtx_hist[idx]->Fill (vtx.zError ());
738+ xError_vtx_hist[idx]->Fill (vtx.xError ());
739+ yError_vtx_hist[idx]->Fill (vtx.yError ());
740+ tracksSize_vtx_hist[idx]->Fill (vtx.tracksSize ());
741+ chi2_vtx_hist[idx]->Fill (vtx.chi2 ());
742+ ndof_vtx_hist[idx]->Fill (vtx.ndof ());
743+ isValidVtx_vtx_hist[idx]->Fill (vtx.isValidVtx ());
744+ xyCov_vtx_hist[idx]->Fill (vtx.xyCov ());
745+ xzCov_vtx_hist[idx]->Fill (vtx.xzCov ());
746+ yzCov_vtx_hist[idx]->Fill (vtx.yzCov ());
747+ };
748+
749+ // displaced vertex histograms with MuonVtx (index 0: Vtx)
750+ for (const auto & vtx : *verticesH)
751+ fillVtxHistograms (vtx, 0 );
752+
753+ // displaced vertex histograms with MuonNoVtx (index1: NoVtx)
754+ for (const auto & vtx : *verticesNoVtxH)
755+ fillVtxHistograms (vtx, 1 );
743756
744757 // fill tracks histograms
745758 for (const auto & tk : *tracksH) {
@@ -1123,20 +1136,39 @@ void ScoutingCollectionMonitor::bookHistograms(DQMStore::IBooker& ibook,
11231136 xzCov_pv_hist = ibook.book1D (" xzCov_pv" , " Primary Vertex XZ Covariance; Cov(x,z); Entries" , 100 , -0.01 , 0.01 );
11241137 yzCov_pv_hist = ibook.book1D (" yzCov_pv" , " Primary Vertex YZ Covariance; Cov(y,z); Entries" , 100 , -0.01 , 0.01 );
11251138
1126- ibook.setCurrentFolder (topfoldername_ + " /DisplacedVertex" );
1127- x_vtx_hist = ibook.book1D (" x_vtx" , " Vertex X Position; x (cm); Entries" , 100 , -0.5 , 0.5 );
1128- y_vtx_hist = ibook.book1D (" y_vtx" , " Vertex Y Position; y (cm); Entries" , 100 , -0.5 , 0.5 );
1129- z_vtx_hist = ibook.book1D (" z_vtx" , " Vertex Z Position; z (cm); Entries" , 100 , -20.0 , 20.0 );
1130- zError_vtx_hist = ibook.book1D (" zError_vtx" , " Vertex Z Error; z Error (cm); Entries" , 100 , 0.0 , 0.2 );
1131- xError_vtx_hist = ibook.book1D (" xError_vtx" , " Vertex X Error; x Error (cm); Entries" , 100 , 0.0 , 0.2 );
1132- yError_vtx_hist = ibook.book1D (" yError_vtx" , " Vertex Y Error; y Error (cm); Entries" , 100 , 0.0 , 0.2 );
1133- tracksSize_vtx_hist = ibook.book1D (" tracksSize_vtx" , " Number of Tracks at Vertex; Tracks; Entries" , 100 , 0 , 100 );
1134- chi2_vtx_hist = ibook.book1D (" chi2_vtx" , " Vertex #chi^{2}; #chi^{2}; Entries" , 100 , 0.0 , 5.0 );
1135- ndof_vtx_hist = ibook.book1D (" ndof_vtx" , " Vertex Ndof; Ndof; Entries" , 100 , 0 , 5 );
1136- isValidVtx_vtx_hist = ibook.book1D (" isValidVtx_vtx" , " Is Valid Vertex?; 0 = False, 1 = True; Entries" , 2 , 0 , 2 );
1137- xyCov_vtx_hist = ibook.book1D (" xyCov_vtx" , " Vertex XY Covariance; Cov(x,y); Entries" , 100 , -0.01 , 0.01 );
1138- xzCov_vtx_hist = ibook.book1D (" xzCov_vtx" , " Vertex XZ Covariance; Cov(x,z); Entries" , 100 , -0.01 , 0.01 );
1139- yzCov_vtx_hist = ibook.book1D (" yzCov_vtx" , " Vertex YZ Covariance; Cov(y,z); Entries" , 100 , -0.01 , 0.01 );
1139+ // book the displaced vertex histograms (Vtx and noVtx collections)
1140+ const std::array<std::string, 2 > vertexLabels = {{" displacedVertices" , " displacedVerticesNoVtx" }};
1141+ const std::array<std::string, 2 > suffixesVtx = {{" _Vtx" , " _noVtx" }};
1142+
1143+ for (int i = 0 ; i < 2 ; ++i) {
1144+ const std::string& sfx = suffixesVtx[i];
1145+ const std::string& lbl = vertexLabels[i];
1146+
1147+ ibook.setCurrentFolder (topfoldername_ + " /" + vertexLabels[i]);
1148+
1149+ x_vtx_hist[i] = ibook.book1D (" x_vtx" + sfx, " Vertex X Position (" + lbl + " ); x (cm); Entries" , 100 , -0.5 , 0.5 );
1150+ y_vtx_hist[i] = ibook.book1D (" y_vtx" + sfx, " Vertex Y Position (" + lbl + " ); y (cm); Entries" , 100 , -0.5 , 0.5 );
1151+ z_vtx_hist[i] = ibook.book1D (" z_vtx" + sfx, " Vertex Z Position (" + lbl + " ); z (cm); Entries" , 100 , -20.0 , 20.0 );
1152+ xError_vtx_hist[i] =
1153+ ibook.book1D (" xError_vtx" + sfx, " Vertex X Error (" + lbl + " ); x Error (cm); Entries" , 100 , 0.0 , 0.2 );
1154+ yError_vtx_hist[i] =
1155+ ibook.book1D (" yError_vtx" + sfx, " Vertex Y Error (" + lbl + " ); y Error (cm); Entries" , 100 , 0.0 , 0.2 );
1156+ zError_vtx_hist[i] =
1157+ ibook.book1D (" zError_vtx" + sfx, " Vertex Z Error (" + lbl + " ); z Error (cm); Entries" , 100 , 0.0 , 0.2 );
1158+ tracksSize_vtx_hist[i] =
1159+ ibook.book1D (" tracksSize_vtx" + sfx, " Number of Tracks at Vertex (" + lbl + " ); Tracks; Entries" , 100 , 0 , 100 );
1160+ chi2_vtx_hist[i] =
1161+ ibook.book1D (" chi2_vtx" + sfx, " Vertex #chi^{2} (" + lbl + " ); #chi^{2}; Entries" , 100 , 0.0 , 5.0 );
1162+ ndof_vtx_hist[i] = ibook.book1D (" ndof_vtx" + sfx, " Vertex Ndof (" + lbl + " ); Ndof; Entries" , 100 , 0 , 5 );
1163+ isValidVtx_vtx_hist[i] =
1164+ ibook.book1D (" isValidVtx_vtx" + sfx, " Is Valid Vertex? (" + lbl + " ); 0 = False, 1 = True; Entries" , 2 , 0 , 2 );
1165+ xyCov_vtx_hist[i] =
1166+ ibook.book1D (" xyCov_vtx" + sfx, " Vertex XY Covariance (" + lbl + " ); Cov(x,y); Entries" , 100 , -0.01 , 0.01 );
1167+ xzCov_vtx_hist[i] =
1168+ ibook.book1D (" xzCov_vtx" + sfx, " Vertex XZ Covariance (" + lbl + " ); Cov(x,z); Entries" , 100 , -0.01 , 0.01 );
1169+ yzCov_vtx_hist[i] =
1170+ ibook.book1D (" yzCov_vtx" + sfx, " Vertex YZ Covariance (" + lbl + " ); Cov(y,z); Entries" , 100 , -0.01 , 0.01 );
1171+ }
11401172
11411173 ibook.setCurrentFolder (topfoldername_ + " /Tracking" );
11421174 tk_pt_tk_hist = ibook.book1D (" tk_pt_tk" , " Track pT; p_{T} (GeV); Entries" , 100 , 0.0 , 30.0 );
@@ -1182,6 +1214,7 @@ void ScoutingCollectionMonitor::fillDescriptions(edm::ConfigurationDescriptions&
11821214 desc.add <edm::InputTag>(" pfjets" , edm::InputTag (" hltScoutingPFPacker" ));
11831215 desc.add <edm::InputTag>(" tracks" , edm::InputTag (" hltScoutingTrackPacker" ));
11841216 desc.add <edm::InputTag>(" displacedVertices" , edm::InputTag (" hltScoutingMuonPackerVtx" , " displacedVtx" ));
1217+ desc.add <edm::InputTag>(" displacedVerticesNoVtx" , edm::InputTag (" hltScoutingMuonPackerNoVtx" , " displacedVtx" ));
11851218 desc.add <edm::InputTag>(" primaryVertices" , edm::InputTag (" hltScoutingPrimaryVertexPacker" , " primaryVtx" ));
11861219 desc.add <edm::InputTag>(" pfMetPt" , edm::InputTag (" hltScoutingPFPacker" , " pfMetPt" ));
11871220 desc.add <edm::InputTag>(" pfMetPhi" , edm::InputTag (" hltScoutingPFPacker" , " pfMetPhi" ));
0 commit comments