Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-04-29 02:41:21

0001 /*
0002 
0003   Class definition for ScoutingMuonTagProbeAnalyzer.cc. Declares each
0004   histogram (MonitorElement), numerator and denominator histogram structure
0005   (kProbeKinematicMuonHistos), and any functions used in
0006   ScoutingMuonTagProbeAnalyzer.cc. Also declares the token to read the
0007   scouting muon and scouting vertex collections.
0008 
0009   Author: Javier Garcia de Castro, email:javigdc@bu.edu
0010 */
0011 
0012 // system includes
0013 #include <cmath>
0014 #include <iostream>
0015 #include <iostream>
0016 #include <string>
0017 #include <vector>
0018 
0019 // user includes
0020 #include "DQMServices/Core/interface/DQMGlobalEDAnalyzer.h"
0021 #include "DataFormats/PatCandidates/interface/Muon.h"
0022 #include "DataFormats/Scouting/interface/Run3ScoutingMuon.h"
0023 #include "DataFormats/Scouting/interface/Run3ScoutingVertex.h"
0024 #include "FWCore/Framework/interface/Event.h"
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026 #include "FWCore/Framework/interface/MakerMacros.h"
0027 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0028 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0029 
0030 struct kProbeKinematicMuonHistos {
0031   dqm::reco::MonitorElement* hPt;
0032   dqm::reco::MonitorElement* hEta;
0033   dqm::reco::MonitorElement* hPhi;
0034   dqm::reco::MonitorElement* hInvMass;
0035   dqm::reco::MonitorElement* hNormChisq;
0036   dqm::reco::MonitorElement* hTrk_dxy;
0037   dqm::reco::MonitorElement* hTrk_dz;
0038   dqm::reco::MonitorElement* hnPixel;
0039   dqm::reco::MonitorElement* hnTracker;
0040   dqm::reco::MonitorElement* htrk_qoverp;
0041   dqm::reco::MonitorElement* htype;
0042   dqm::reco::MonitorElement* hcharge;
0043   dqm::reco::MonitorElement* hecalIso;
0044   dqm::reco::MonitorElement* hhcalIso;
0045   dqm::reco::MonitorElement* htrackIso;
0046   dqm::reco::MonitorElement* hnValidStandAloneMuonHits;
0047   dqm::reco::MonitorElement* hnStandAloneMuonMatchedStations;
0048   dqm::reco::MonitorElement* hnValidRecoMuonHits;
0049   dqm::reco::MonitorElement* hnRecoMuonChambers;
0050   dqm::reco::MonitorElement* hnRecoMuonChambersCSCorDT;
0051   dqm::reco::MonitorElement* hnRecoMuonMatches;
0052   dqm::reco::MonitorElement* hnRecoMuonMatchedStations;
0053   dqm::reco::MonitorElement* hnRecoMuonExpectedMatchedStations;
0054   dqm::reco::MonitorElement* hnValidPixelHits;
0055   dqm::reco::MonitorElement* hnValidStripHits;
0056   dqm::reco::MonitorElement* hnPixelLayersWithMeasurement;
0057   dqm::reco::MonitorElement* hnTrackerLayersWithMeasurement;
0058   dqm::reco::MonitorElement* htrk_chi2;
0059   dqm::reco::MonitorElement* htrk_ndof;
0060   dqm::reco::MonitorElement* htrk_lambda;
0061   dqm::reco::MonitorElement* htrk_pt;
0062   dqm::reco::MonitorElement* htrk_eta;
0063   dqm::reco::MonitorElement* htrk_dxyError;
0064   dqm::reco::MonitorElement* htrk_dzError;
0065   dqm::reco::MonitorElement* htrk_qoverpError;
0066   dqm::reco::MonitorElement* htrk_lambdaError;
0067   dqm::reco::MonitorElement* htrk_phiError;
0068   dqm::reco::MonitorElement* htrk_dsz;
0069   dqm::reco::MonitorElement* htrk_dszError;
0070   dqm::reco::MonitorElement* htrk_vx;
0071   dqm::reco::MonitorElement* htrk_vy;
0072   dqm::reco::MonitorElement* htrk_vz;
0073   dqm::reco::MonitorElement* hLxy;
0074   dqm::reco::MonitorElement* hXError;
0075   dqm::reco::MonitorElement* hYError;
0076   dqm::reco::MonitorElement* hChi2;
0077   dqm::reco::MonitorElement* hZ;
0078   dqm::reco::MonitorElement* hx;
0079   dqm::reco::MonitorElement* hy;
0080   dqm::reco::MonitorElement* hZerror;
0081   dqm::reco::MonitorElement* htracksSize;
0082 };
0083 
0084 struct kTagProbeMuonHistos {
0085   kProbeKinematicMuonHistos resonanceJ_numerator;
0086   kProbeKinematicMuonHistos resonanceJ_denominator;
0087   kProbeKinematicMuonHistos resonanceZ_numerator;
0088   kProbeKinematicMuonHistos resonanceZ_denominator;
0089 };
0090 
0091 class ScoutingMuonTagProbeAnalyzer : public DQMGlobalEDAnalyzer<kTagProbeMuonHistos> {
0092 public:
0093   explicit ScoutingMuonTagProbeAnalyzer(const edm::ParameterSet& conf);
0094   ~ScoutingMuonTagProbeAnalyzer() override = default;
0095   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0096 
0097 private:
0098   void dqmAnalyze(const edm::Event& e, const edm::EventSetup& c, kTagProbeMuonHistos const&) const override;
0099   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&, kTagProbeMuonHistos&) const override;
0100   void bookHistograms_resonance(DQMStore::IBooker&,
0101                                 edm::Run const&,
0102                                 edm::EventSetup const&,
0103                                 kProbeKinematicMuonHistos&,
0104                                 const std::string&) const;
0105   void fillHistograms_resonance(const kProbeKinematicMuonHistos histos,
0106                                 const Run3ScoutingMuon& mu,
0107                                 const Run3ScoutingVertex& vertex,
0108                                 const float inv_mass,
0109                                 const float lxy) const;
0110   bool scoutingMuonID(const Run3ScoutingMuon mu) const;
0111 
0112   const std::string outputInternalPath_;
0113   const edm::EDGetTokenT<std::vector<Run3ScoutingMuon>> scoutingMuonCollection_;
0114   const edm::EDGetTokenT<std::vector<Run3ScoutingVertex>> scoutingVtxCollection_;
0115   const bool runWithoutVtx_;
0116 };
0117 
0118 /*
0119   This code does the following:
0120      1) Reads muon collection, scouting muon collection and scouting vertex
0121 collection 
0122      2) Tag and Probe method: For each event, check whether one of the
0123      muons passes a tight ID (tag), and pair it with another muon in the event
0124      (probe). If this dimuon system is within the mass range of the J/Psi, monitor
0125      distributions of the probe and the efficiency of the probe to pass certain IDs.
0126      For now we are measuring the efficiency of the probe passing the tag ID (If the
0127      dimuon system is within J/Psi, add it to the denominator distributions, and if
0128      the probe passes the tag ID, add it to the numerator distributions as well.) 
0129      3) Fills histograms
0130 */
0131 
0132 ScoutingMuonTagProbeAnalyzer::ScoutingMuonTagProbeAnalyzer(const edm::ParameterSet& iConfig)
0133     : outputInternalPath_(iConfig.getParameter<std::string>("OutputInternalPath")),
0134       scoutingMuonCollection_(
0135           consumes<std::vector<Run3ScoutingMuon>>(iConfig.getParameter<edm::InputTag>("ScoutingMuonCollection"))),
0136       scoutingVtxCollection_(
0137           consumes<std::vector<Run3ScoutingVertex>>(iConfig.getParameter<edm::InputTag>("ScoutingVtxCollection"))),
0138       runWithoutVtx_(iConfig.getParameter<bool>("runWithoutVertex")) {}
0139 
0140 void ScoutingMuonTagProbeAnalyzer::dqmAnalyze(edm::Event const& iEvent,
0141                                               edm::EventSetup const& iSetup,
0142                                               kTagProbeMuonHistos const& histos) const {
0143   // Read scouting muon collection
0144   edm::Handle<std::vector<Run3ScoutingMuon>> sctMuons;
0145   iEvent.getByToken(scoutingMuonCollection_, sctMuons);
0146   if (sctMuons.failedToGet()) {
0147     edm::LogWarning("ScoutingMonitoring") << "Run3ScoutingMuon collection not found.";
0148     return;
0149   }
0150 
0151   // Read scouting vertex collection
0152   edm::Handle<std::vector<Run3ScoutingVertex>> sctVertex;
0153   iEvent.getByToken(scoutingVtxCollection_, sctVertex);
0154   if (sctVertex.failedToGet()) {
0155     edm::LogWarning("ScoutingMonitoring") << "Run3ScoutingVertex collection not found.";
0156     return;
0157   }
0158 
0159   edm::LogInfo("ScoutingMonitoring") << "Process Run3ScoutingMuons: " << sctMuons->size();
0160 
0161   edm::LogInfo("ScoutingMonitoring") << "Process Run3ScoutingVertex: " << sctVertex->size();
0162 
0163   // Core of Tag and Probe implementation
0164   bool foundTag = false;
0165   // First find the tag
0166   for (const auto& sct_mu : *sctMuons) {
0167     if (!scoutingMuonID(sct_mu))
0168       continue;
0169     if (foundTag)
0170       continue;
0171     math::PtEtaPhiMLorentzVector tag_sct_mu(sct_mu.pt(), sct_mu.eta(), sct_mu.phi(), sct_mu.m());
0172     const std::vector<int> vtxIndx_tag = sct_mu.vtxIndx();
0173 
0174     // Then pair the tag with the probe
0175     for (const auto& sct_mu_second : *sctMuons) {
0176       if (&sct_mu_second == &sct_mu)
0177         continue;
0178       math::PtEtaPhiMLorentzVector probe_sct_mu(
0179           sct_mu_second.pt(), sct_mu_second.eta(), sct_mu_second.phi(), sct_mu_second.m());
0180       if (sct_mu_second.pt() < 1)
0181         continue;
0182       const std::vector<int> vtxIndx_probe = sct_mu_second.vtxIndx();
0183 
0184       float invMass = (tag_sct_mu + probe_sct_mu).mass();
0185       edm::LogInfo("ScoutingMonitoring") << "Inv Mass: " << invMass;
0186       // If dimuon system comes from J/Psi, process event
0187       if ((2.4 < invMass && invMass < 3.8)) {
0188         // Boolean added because hltScoutingMuonPackerVtx collection doesn't
0189         // have vertices for the moment
0190         if (runWithoutVtx_) {
0191           Run3ScoutingVertex vertex;
0192           // If probe passes tag ID, add it to the numerator
0193           if (scoutingMuonID(sct_mu_second)) {
0194             fillHistograms_resonance(histos.resonanceJ_numerator, sct_mu_second, vertex, invMass, -99.);
0195           }
0196           // Add all events to the denominator
0197           fillHistograms_resonance(histos.resonanceJ_denominator, sct_mu_second, vertex, invMass, -99.);
0198         } else {
0199           if (vtxIndx_tag.empty() || vtxIndx_probe.empty())
0200             continue;
0201           for (const auto& commonIdx : vtxIndx_tag) {
0202             if (std::find(vtxIndx_probe.begin(), vtxIndx_probe.end(), commonIdx) != vtxIndx_probe.end()) {
0203               const auto& vertex = (*sctVertex)[commonIdx];
0204               float lxy = sqrt(vertex.x() * vertex.x() + vertex.y() * vertex.y());
0205               if (scoutingMuonID(sct_mu_second)) {
0206                 fillHistograms_resonance(histos.resonanceJ_numerator, sct_mu_second, vertex, invMass, lxy);
0207               }
0208               fillHistograms_resonance(histos.resonanceJ_denominator, sct_mu_second, vertex, invMass, lxy);
0209             }
0210           }
0211         }
0212       } else if ((75.0 < invMass && invMass < 107.0)) {
0213         //Boolean added because hltScoutingMuonPackerVtx collection doesn't have vertices for the moment
0214         if (runWithoutVtx_) {
0215           Run3ScoutingVertex vertex;
0216           //If probe passes tag ID, add it to the numerator
0217           if (scoutingMuonID(sct_mu_second)) {
0218             fillHistograms_resonance(histos.resonanceZ_numerator, sct_mu_second, vertex, invMass, -99.);
0219           }
0220           //Add all events to the denominator
0221           fillHistograms_resonance(histos.resonanceZ_denominator, sct_mu_second, vertex, invMass, -99.);
0222         } else {
0223           if (vtxIndx_tag.empty() || vtxIndx_probe.empty())
0224             continue;
0225           for (const auto& commonIdx : vtxIndx_tag) {
0226             if (std::find(vtxIndx_probe.begin(), vtxIndx_probe.end(), commonIdx) != vtxIndx_probe.end()) {
0227               const auto& vertex = (*sctVertex)[commonIdx];
0228               float lxy = sqrt(vertex.x() * vertex.x() + vertex.y() * vertex.y());
0229               if (scoutingMuonID(sct_mu_second)) {
0230                 fillHistograms_resonance(histos.resonanceZ_numerator, sct_mu_second, vertex, invMass, lxy);
0231               }
0232               fillHistograms_resonance(histos.resonanceZ_denominator, sct_mu_second, vertex, invMass, lxy);
0233             }
0234           }
0235         }
0236       }
0237     }
0238     foundTag = true;
0239   }
0240 }
0241 
0242 // Tag ID
0243 bool ScoutingMuonTagProbeAnalyzer::scoutingMuonID(const Run3ScoutingMuon mu) const {
0244   math::PtEtaPhiMLorentzVector particle(mu.pt(), mu.eta(), mu.phi(), 0.10566);
0245   double normchisq_threshold = 3.0;
0246   double pt_threshold = 3.0;
0247   double eta_threshold = 2.4;
0248   int layer_threshold = 4;
0249 
0250   if (mu.pt() > pt_threshold && fabs(mu.eta()) < eta_threshold && mu.normalizedChi2() < normchisq_threshold &&
0251       mu.isGlobalMuon() && mu.nTrackerLayersWithMeasurement() > layer_threshold) {
0252     return true;
0253   }
0254   return false;
0255 }
0256 
0257 // Fill histograms
0258 void ScoutingMuonTagProbeAnalyzer::fillHistograms_resonance(const kProbeKinematicMuonHistos histos,
0259                                                             const Run3ScoutingMuon& mu,
0260                                                             const Run3ScoutingVertex& vertex,
0261                                                             const float inv_mass,
0262                                                             const float lxy) const {
0263   histos.hPt->Fill(mu.pt());
0264   histos.hEta->Fill(mu.eta());
0265   histos.hPhi->Fill(mu.phi());
0266   histos.hInvMass->Fill(inv_mass);
0267   histos.hNormChisq->Fill(mu.normalizedChi2());
0268   histos.hTrk_dxy->Fill(mu.trk_dxy());
0269   histos.hTrk_dz->Fill(mu.trk_dz());
0270   histos.htype->Fill(mu.type());
0271   histos.hcharge->Fill(mu.charge());
0272   histos.hecalIso->Fill(mu.ecalIso());
0273   histos.hhcalIso->Fill(mu.hcalIso());
0274   histos.htrackIso->Fill(mu.trackIso());
0275   histos.hnValidStandAloneMuonHits->Fill(mu.nValidStandAloneMuonHits());
0276   histos.hnStandAloneMuonMatchedStations->Fill(mu.nStandAloneMuonMatchedStations());
0277   histos.hnValidRecoMuonHits->Fill(mu.nValidRecoMuonHits());
0278   histos.hnRecoMuonChambers->Fill(mu.nRecoMuonChambers());
0279   histos.hnRecoMuonChambersCSCorDT->Fill(mu.nRecoMuonChambersCSCorDT());
0280   histos.hnRecoMuonMatches->Fill(mu.nRecoMuonMatches());
0281   histos.hnRecoMuonMatchedStations->Fill(mu.nRecoMuonMatchedStations());
0282   histos.hnRecoMuonExpectedMatchedStations->Fill(mu.nRecoMuonExpectedMatchedStations());
0283   histos.hnValidPixelHits->Fill(mu.nValidPixelHits());
0284   histos.hnValidStripHits->Fill(mu.nValidStripHits());
0285   histos.htrk_chi2->Fill(mu.trk_chi2());
0286   histos.htrk_ndof->Fill(mu.trk_ndof());
0287   histos.htrk_lambda->Fill(mu.trk_lambda());
0288   histos.htrk_pt->Fill(mu.trk_pt());
0289   histos.htrk_eta->Fill(mu.trk_eta());
0290   histos.htrk_dxyError->Fill(mu.trk_dxyError());
0291   histos.htrk_dzError->Fill(mu.trk_dzError());
0292   histos.htrk_qoverpError->Fill(mu.trk_qoverpError());
0293   histos.htrk_lambdaError->Fill(mu.trk_lambdaError());
0294   histos.htrk_phiError->Fill(mu.trk_phiError());
0295   histos.htrk_dsz->Fill(mu.trk_dsz());
0296   histos.htrk_dszError->Fill(mu.trk_dszError());
0297   histos.htrk_vx->Fill(mu.trk_vx());
0298   histos.htrk_vy->Fill(mu.trk_vy());
0299   histos.htrk_vz->Fill(mu.trk_vz());
0300   histos.hnPixel->Fill(mu.nPixelLayersWithMeasurement());
0301   histos.hnTracker->Fill(mu.nTrackerLayersWithMeasurement());
0302   histos.htrk_qoverp->Fill(mu.trk_qoverp());
0303 
0304   if (!runWithoutVtx_) {
0305     histos.hLxy->Fill(lxy);
0306     histos.hXError->Fill(vertex.xError());
0307     histos.hYError->Fill(vertex.yError());
0308     histos.hChi2->Fill(vertex.chi2());
0309     histos.hZ->Fill(vertex.z());
0310     histos.hx->Fill(vertex.x());
0311     histos.hy->Fill(vertex.y());
0312     histos.hZerror->Fill(vertex.zError());
0313     histos.htracksSize->Fill(vertex.tracksSize());
0314   }
0315 }
0316 
0317 // Save histograms
0318 void ScoutingMuonTagProbeAnalyzer::bookHistograms(DQMStore::IBooker& ibook,
0319                                                   edm::Run const& run,
0320                                                   edm::EventSetup const& iSetup,
0321                                                   kTagProbeMuonHistos& histos) const {
0322   ibook.setCurrentFolder(outputInternalPath_);
0323   bookHistograms_resonance(ibook, run, iSetup, histos.resonanceJ_numerator, "resonanceJ_numerator");
0324   bookHistograms_resonance(ibook, run, iSetup, histos.resonanceJ_denominator, "resonanceJ_denominator");
0325   bookHistograms_resonance(ibook, run, iSetup, histos.resonanceZ_numerator, "resonanceZ_numerator");
0326   bookHistograms_resonance(ibook, run, iSetup, histos.resonanceZ_denominator, "resonanceZ_denominator");
0327 }
0328 
0329 // Set axes labels and range
0330 void ScoutingMuonTagProbeAnalyzer::bookHistograms_resonance(DQMStore::IBooker& ibook,
0331                                                             edm::Run const& run,
0332                                                             edm::EventSetup const& iSetup,
0333                                                             kProbeKinematicMuonHistos& histos,
0334                                                             const std::string& name) const {
0335   ibook.setCurrentFolder(outputInternalPath_);
0336 
0337   histos.hPt = ibook.book1D(name + "_Probe_sctMuon_Pt", name + "_Probe_sctMuon_Pt;Muon pt (GeV); Muons", 60, 0, 50.0);
0338   histos.hEta = ibook.book1D(name + "_Probe_sctMuon_Eta", name + "_Probe_sctMuon_Eta; Muon eta; Muons", 60, -5.0, 5.0);
0339   histos.hPhi = ibook.book1D(name + "_Probe_sctMuon_Phi", name + "_Probe_sctMuon_Phi; Muon phi; Muons", 60, -3.3, 3.3);
0340   histos.hInvMass = ibook.book1D(
0341       name + "_sctMuon_Invariant_Mass", name + "_sctMuon_Invariant_Mass;Muon Inv mass (GeV); Muons", 100, 0, 100);
0342   histos.hNormChisq = ibook.book1D(
0343       name + "_Probe_sctMuon_NormChisq", name + "_Probe_sctMuon_NormChisq; Muon normChi2; Muons", 60, 0, 5.0);
0344   histos.hTrk_dxy =
0345       ibook.book1D(name + "_Probe_sctMuon_Trk_dxy", name + "_Probe_sctMuon_Trk_dxy; Track dxy; Muons", 60, 0, 5.0);
0346   histos.hTrk_dz =
0347       ibook.book1D(name + "_Probe_sctMuon_Trk_dz", name + "_Probe_sctMuon_Trk_dz; Track dz; Muons", 60, 0, 20.0);
0348   histos.htype = ibook.book1D(name + "_Probe_sctMuon_type", name + "_Probe_sctMuon_type;Muon type; Muons", 15, 0, 15);
0349   histos.hcharge =
0350       ibook.book1D(name + "_Probe_sctMuon_charge", name + "_Probe_sctMuon_charge; Muon charge; Muons", 3, -1, 2);
0351   histos.hecalIso = ibook.book1D(
0352       name + "_Probe_sctMuon_ecalIso", name + "_Probe_sctMuon_ecalIso; Muon ecalIso; Muons", 60, 0.0, 20.0);
0353   histos.hhcalIso = ibook.book1D(
0354       name + "_Probe_sctMuon_hcalIso", name + "_Probe_sctMuon_hcalIso; Muon hcalIso; Muons", 60, 0.0, 20.0);
0355   histos.htrackIso =
0356       ibook.book1D(name + "_sctMuon_trackIso", name + "_sctMuon_trackIso;Muon trackIso; Muons", 100, 0, 7);
0357   histos.hnValidStandAloneMuonHits = ibook.book1D(name + "_Probe_sctMuon_nValidStandAloneMuonHits",
0358                                                   name +
0359                                                       "_Probe_sctMuon_nValidStandAloneMuonHits;"
0360                                                       "nValidStandAloneMuonHits; Muons",
0361                                                   25,
0362                                                   0,
0363                                                   25);
0364   histos.hnValidRecoMuonHits = ibook.book1D(name + "_Probe_sctMuon_nValidRecoMuonHits",
0365                                             name + "_Probe_sctMuon_nValidRecoMuonHits;nValidRecoMuonHits; Muons",
0366                                             25,
0367                                             0,
0368                                             25);
0369   histos.hnRecoMuonChambers = ibook.book1D(name + "_Probe_sctMuon_nRecoMuonChambers",
0370                                            name + "_Probe_sctMuon_nRecoMuonChambers; nRecoMuonChambers; Muons",
0371                                            10,
0372                                            0,
0373                                            10.0);
0374   histos.hnStandAloneMuonMatchedStations = ibook.book1D(name + "_Probe_sctMuon_nStandAloneMuonMatchedStations",
0375                                                         name +
0376                                                             "_Probe_sctMuon_nStandAloneMuonMatchedStations; "
0377                                                             "nStandAloneMuonMatchedStations; Muons",
0378                                                         5,
0379                                                         0,
0380                                                         5.0);
0381   histos.hnRecoMuonChambersCSCorDT = ibook.book1D(name + "_Probe_sctMuon_nRecoMuonChambersCSCorDT",
0382                                                   name +
0383                                                       "_Probe_sctMuon_nRecoMuonChambersCSCorDT;"
0384                                                       "nRecoMuonChambersCSCorDT; Muons",
0385                                                   10,
0386                                                   0,
0387                                                   10.0);
0388   histos.hnRecoMuonMatches = ibook.book1D(name + "_Probe_sctMuon_nRecoMuonMatches",
0389                                           name + "_Probe_sctMuon_nRecoMuonMatches; nRecoMuonMatches; Muons",
0390                                           6,
0391                                           0,
0392                                           6);
0393   histos.hnRecoMuonMatchedStations = ibook.book1D(name + "_Probe_sctMuon_nRecoMuonMatchedStations",
0394                                                   name +
0395                                                       "_Probe_sctMuon_nRecoMuonMatchedStations; "
0396                                                       "nRecoMuonMatchedStations; Muons",
0397                                                   5,
0398                                                   0.0,
0399                                                   5.0);
0400   histos.hnRecoMuonExpectedMatchedStations = ibook.book1D(name + "_sctMuon_nRecoMuonExpectedMatchedStations",
0401                                                           name +
0402                                                               "_sctMuon_nRecoMuonExpectedMatchedStations;"
0403                                                               "nRecoMuonExpectedMatchedStations; Muons",
0404                                                           6,
0405                                                           0,
0406                                                           6.0);
0407   histos.hnValidPixelHits = ibook.book1D(name + "_Probe_sctMuon_nValidPixelHits",
0408                                          name + "_Probe_sctMuon_nValidPixelHits;nValidPixelHits; Muons",
0409                                          14,
0410                                          0,
0411                                          14.0);
0412   histos.hnValidStripHits = ibook.book1D(name + "_Probe_sctMuon_nValidStripHits",
0413                                          name + "_Probe_sctMuon_nValidStripHits; nValidStripHits; Muons",
0414                                          25,
0415                                          0,
0416                                          25);
0417   histos.htrk_chi2 =
0418       ibook.book1D(name + "_Probe_sctMuon_trk_chi2", name + "_Probe_sctMuon_trk_chi2; trk_chi2; Muons", 60, 0.0, 20);
0419   histos.htrk_ndof = ibook.book1D(name + "_sctMuon_trk_ndof", name + "_sctMuon_trk_ndof;trk_ndof; Muons", 100, 0, 50);
0420   histos.htrk_lambda = ibook.book1D(
0421       name + "_Probe_sctMuon_trk_lambda", name + "_Probe_sctMuon_trk_lambda; trk_lambda; Muons", 60, -5, 5);
0422   histos.htrk_pt =
0423       ibook.book1D(name + "_Probe_sctMuon_trk_pt", name + "_Probe_sctMuon_trk_pt; trk_pt; Muons", 60, 0, 50.0);
0424   histos.htrk_eta =
0425       ibook.book1D(name + "_Probe_sctMuon_trk_eta", name + "_Probe_sctMuon_trk_eta;trk_eta; Muons", 60, -3.3, 3.3);
0426   histos.htrk_dxyError = ibook.book1D(
0427       name + "_Probe_sctMuon_trk_dxyError", name + "_Probe_sctMuon_trk_dxyError; trk_dxyError; Muons", 60, 0.0, 0.8);
0428   histos.htrk_dzError = ibook.book1D(
0429       name + "_Probe_sctMuon_trk_dzError", name + "_Probe_sctMuon_trk_dzError; trk_dzError; Muons", 60, 0.0, 2);
0430   histos.htrk_qoverpError = ibook.book1D(
0431       name + "_sctMuon_trk_qoverpError", name + "_sctMuon_trk_qoverpError;trk_qoverpError; Muons", 100, 0, 0.05);
0432   histos.htrk_lambdaError = ibook.book1D(name + "_Probe_sctMuon_trk_lambdaError",
0433                                          name + "_Probe_sctMuon_trk_lambdaError; trk_lambdaError; Muons",
0434                                          60,
0435                                          0,
0436                                          0.2);
0437   histos.htrk_phiError = ibook.book1D(
0438       name + "_Probe_sctMuon_trk_phiError", name + "_Probe_sctMuon_trk_phiError; trk_phiError; Muons", 60, 0, 0.2);
0439   histos.htrk_dsz =
0440       ibook.book1D(name + "_Probe_sctMuon_trk_dsz", name + "_Probe_sctMuon_trk_dsz; trk_dsz; Muons", 60, -20.0, 20.0);
0441   histos.htrk_dszError = ibook.book1D(
0442       name + "_Probe_sctMuon_trk_dszError", name + "_Probe_sctMuon_trk_dszError; trk_dszError; Muons", 60, 0, 0.8);
0443   histos.htrk_vx =
0444       ibook.book1D(name + "_Probe_sctMuon_trk_vx", name + "_Probe_sctMuon_trk_vx; trk_vx; Muons", 60, -1, 1);
0445   histos.htrk_vy =
0446       ibook.book1D(name + "_Probe_sctMuon_trk_vy", name + "_Probe_sctMuon_trk_vy; trk_vy; Muons", 60, -1, 1);
0447   histos.htrk_vz =
0448       ibook.book1D(name + "_Probe_sctMuon_trk_vz", name + "_Probe_sctMuon_trk_vz; trk_vz; Muons", 60, -20, 20);
0449   histos.hnPixel =
0450       ibook.book1D(name + "_Probe_sctMuon_nPixel", name + "_Probe_sctMuon_nPixel; n Pixel Layers; Muons", 6, 0, 6);
0451   histos.hnTracker = ibook.book1D(
0452       name + "_Probe_sctMuon_nTracker", name + "_Probe_sctMuon_nTracker; n Tracker Layers; Muons", 14, 0, 25);
0453   histos.htrk_qoverp = ibook.book1D(
0454       name + "_Probe_sctMuon_trk_qoverp", name + "_Probe_sctMuon_trk_qoverp; n Track q/p; Muons", 40, -1, 1);
0455   histos.hLxy = ibook.book1D(name + "_Vertex_Lxy", name + "_Vertex_Lxy; lxy; Muons", 60, 0, 20);
0456   histos.hXError = ibook.book1D(name + "_Vertex_Xerror", name + "_Vertex_Xerror; vertex x error; Muons", 60, 0, 1);
0457   histos.hYError = ibook.book1D(name + "_Vertex_Yerror", name + "_Vertex_Yerror; vertex y error; Muons", 60, 0, 1);
0458   histos.hChi2 = ibook.book1D(name + "_Vertex_chi2", name + "_Vertex_chi2; vertex chi2; Muons", 60, 0, 15);
0459   histos.hZ = ibook.book1D(name + "_Vertex_z", name + "_Vertex_z; vertex z; Muons", 60, 0, 15);
0460   histos.hx = ibook.book1D(name + "_Vertex_x", name + "_Vertex_x; vertex x; Muons", 60, -1, 1);
0461   histos.hy = ibook.book1D(name + "_Vertex_y", name + "_Vertex_y; vertex y; Muons", 60, -1, 1);
0462   histos.hZerror = ibook.book1D(name + "_Vertex_z error", name + "_Vertex_z_error; vertex z error; Muons", 60, 0, 3);
0463   histos.htracksSize =
0464       ibook.book1D(name + "_Vertex_tracksSize", name + "_Vertex_tracksSize; vertex tracksSize; Muons", 60, 0, 10);
0465 }
0466 
0467 // Descriptions to read the collections
0468 void ScoutingMuonTagProbeAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0469   edm::ParameterSetDescription desc;
0470   desc.add<std::string>("OutputInternalPath", "MY_FOLDER");
0471   desc.add<edm::InputTag>("ScoutingMuonCollection", edm::InputTag("Run3ScoutingMuons"));
0472   desc.add<edm::InputTag>("ScoutingVtxCollection", edm::InputTag("hltScoutingMuonPackerNoVtx"));
0473   desc.add<bool>("runWithoutVertex", true);
0474   descriptions.addWithDefaultLabel(desc);
0475 }
0476 
0477 DEFINE_FWK_MODULE(ScoutingMuonTagProbeAnalyzer);