Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-06 04:26:46

0001 #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"
0002 #include "DQM/TrackingMonitor/interface/V0Monitor.h"
0003 #include "DataFormats/VertexReco/interface/Vertex.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 
0006 // -----------------------------
0007 //  constructors and destructor
0008 // -----------------------------
0009 
0010 // ------------ method fills 'descriptions' with the allowed parameters for the module  ------------
0011 void V0Monitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0012   edm::ParameterSetDescription desc;
0013   desc.add<std::string>("FolderName", "Tracking/V0Monitoring");
0014   desc.add<edm::InputTag>("v0", edm::InputTag("generalV0Candidates:Kshort"));
0015   desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
0016   desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
0017   desc.add<edm::InputTag>("lumiScalers", edm::InputTag("scalersRawToDigi"));
0018   desc.add<bool>("forceSCAL", true);
0019   desc.add<edm::InputTag>("metadata", edm::InputTag("onlineMetaDataDigis"));
0020   desc.add<int>("pvNDOF", 4);
0021 
0022   {
0023     edm::ParameterSetDescription psd0;
0024     {
0025       edm::ParameterSetDescription psd1;
0026       psd1.add<int>("nbins", 3700);
0027       psd1.add<double>("xmin", 0.);
0028       psd1.add<double>("xmax", 14000.);
0029       psd0.add<edm::ParameterSetDescription>("lumiPSet", psd1);
0030     }
0031     {
0032       edm::ParameterSetDescription psd2;
0033       psd2.add<int>("nbins", 100);
0034       psd2.add<double>("xmin", 0.400);
0035       psd2.add<double>("xmax", 0.600);
0036       psd0.add<edm::ParameterSetDescription>("massPSet", psd2);
0037     }
0038     {
0039       edm::ParameterSetDescription psd3;
0040       psd3.add<int>("nbins", 100);
0041       psd3.add<double>("xmin", 0.);
0042       psd3.add<double>("xmax", 50.);
0043       psd0.add<edm::ParameterSetDescription>("ptPSet", psd3);
0044     }
0045     {
0046       edm::ParameterSetDescription psd4;
0047       psd4.add<int>("nbins", 60);
0048       psd4.add<double>("xmin", -3.);
0049       psd4.add<double>("xmax", 3.);
0050       psd0.add<edm::ParameterSetDescription>("etaPSet", psd4);
0051     }
0052     {
0053       edm::ParameterSetDescription psd5;
0054       psd5.add<int>("nbins", 350);
0055       psd5.add<double>("xmin", 0.);
0056       psd5.add<double>("xmax", 70.);
0057       psd0.add<edm::ParameterSetDescription>("LxyPSet", psd5);
0058     }
0059     {
0060       edm::ParameterSetDescription psd6;
0061       psd6.add<int>("nbins", 100);
0062       psd6.add<double>("xmin", 0.);
0063       psd6.add<double>("xmax", 30.);
0064       psd0.add<edm::ParameterSetDescription>("chi2oNDFPSet", psd6);
0065     }
0066     {
0067       edm::ParameterSetDescription psd7;
0068       psd7.add<int>("nbins", 100);
0069       psd7.add<double>("xmin", -0.5);
0070       psd7.add<double>("xmax", 99.5);
0071       psd0.add<edm::ParameterSetDescription>("puPSet", psd7);
0072     }
0073     {
0074       edm::ParameterSetDescription psd8;
0075       psd8.add<int>("nbins", 2000);
0076       psd8.add<double>("xmin", 0.);
0077       psd8.add<double>("xmax", 2000.);
0078       psd0.add<edm::ParameterSetDescription>("lsPSet", psd8);
0079     }
0080     desc.add<edm::ParameterSetDescription>("histoPSet", psd0);
0081   }
0082 
0083   {
0084     edm::ParameterSetDescription genericTriggerEventPSet;
0085     GenericTriggerEventFlag::fillPSetDescription(genericTriggerEventPSet);
0086     desc.add<edm::ParameterSetDescription>("genericTriggerEventPSet", genericTriggerEventPSet);
0087   }
0088 
0089   descriptions.addWithDefaultLabel(desc);
0090 }
0091 
0092 V0Monitor::V0Monitor(const edm::ParameterSet& iConfig)
0093     : folderName_(iConfig.getParameter<std::string>("FolderName")),
0094       v0Token_(consumes<reco::VertexCompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("v0"))),
0095       bsToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
0096       pvToken_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryVertex"))),
0097       lumiscalersToken_(consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("lumiScalers"))),
0098       metaDataToken_(consumes<OnlineLuminosityRecord>(iConfig.getParameter<edm::InputTag>("metadata"))),
0099       forceSCAL_(iConfig.getParameter<bool>("forceSCAL")),
0100       pvNDOF_(iConfig.getParameter<int>("pvNDOF")),
0101       genTriggerEventFlag_(new GenericTriggerEventFlag(
0102           iConfig.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this)) {
0103   v0_N_ = nullptr;
0104   v0_mass_ = nullptr;
0105   v0_pt_ = nullptr;
0106   v0_eta_ = nullptr;
0107   v0_phi_ = nullptr;
0108   v0_Lxy_ = nullptr;
0109   v0_Lxy_wrtBS_ = nullptr;
0110   v0_chi2oNDF_ = nullptr;
0111   v0_mass_vs_p_ = nullptr;
0112   v0_mass_vs_pt_ = nullptr;
0113   v0_mass_vs_eta_ = nullptr;
0114   v0_deltaMass_ = nullptr;
0115   v0_deltaMass_vs_pt_ = nullptr;
0116   v0_deltaMass_vs_eta_ = nullptr;
0117 
0118   v0_Lxy_vs_deltaMass_ = nullptr;
0119   v0_Lxy_vs_pt_ = nullptr;
0120   v0_Lxy_vs_eta_ = nullptr;
0121 
0122   n_vs_BX_ = nullptr;
0123   v0_N_vs_BX_ = nullptr;
0124   v0_mass_vs_BX_ = nullptr;
0125   v0_Lxy_vs_BX_ = nullptr;
0126   v0_deltaMass_vs_BX_ = nullptr;
0127 
0128   n_vs_lumi_ = nullptr;
0129   v0_N_vs_lumi_ = nullptr;
0130   v0_mass_vs_lumi_ = nullptr;
0131   v0_Lxy_vs_lumi_ = nullptr;
0132   v0_deltaMass_vs_lumi_ = nullptr;
0133 
0134   n_vs_PU_ = nullptr;
0135   v0_N_vs_PU_ = nullptr;
0136   v0_mass_vs_PU_ = nullptr;
0137   v0_Lxy_vs_PU_ = nullptr;
0138   v0_deltaMass_vs_PU_ = nullptr;
0139 
0140   n_vs_LS_ = nullptr;
0141   v0_N_vs_LS_ = nullptr;
0142 
0143   edm::ParameterSet histoPSet = iConfig.getParameter<edm::ParameterSet>("histoPSet");
0144   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("massPSet"), mass_binning_);
0145   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("ptPSet"), pt_binning_);
0146   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("etaPSet"), eta_binning_);
0147   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("LxyPSet"), Lxy_binning_);
0148   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("chi2oNDFPSet"), chi2oNDF_binning_);
0149   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("lumiPSet"), lumi_binning_);
0150   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("puPSet"), pu_binning_);
0151   getHistoPSet(histoPSet.getParameter<edm::ParameterSet>("lsPSet"), ls_binning_);
0152 }
0153 
0154 V0Monitor::~V0Monitor() {
0155   if (genTriggerEventFlag_)
0156     delete genTriggerEventFlag_;
0157 }
0158 
0159 void V0Monitor::getHistoPSet(edm::ParameterSet pset, MEbinning& mebinning) {
0160   mebinning.nbins = pset.getParameter<int32_t>("nbins");
0161   mebinning.xmin = pset.getParameter<double>("xmin");
0162   mebinning.xmax = pset.getParameter<double>("xmax");
0163 }
0164 
0165 V0Monitor::MonitorElement* V0Monitor::bookHisto1D(DQMStore::IBooker& ibooker,
0166                                                   std::string name,
0167                                                   std::string title,
0168                                                   std::string xaxis,
0169                                                   std::string yaxis,
0170                                                   MEbinning binning) {
0171   std::string title_w_axes = title + ";" + xaxis + ";" + yaxis;
0172   return ibooker.book1D(name, title_w_axes, binning.nbins, binning.xmin, binning.xmax);
0173 }
0174 V0Monitor::MonitorElement* V0Monitor::bookHisto2D(DQMStore::IBooker& ibooker,
0175                                                   std::string name,
0176                                                   std::string title,
0177                                                   std::string xaxis,
0178                                                   std::string yaxis,
0179                                                   MEbinning xbinning,
0180                                                   MEbinning ybinning) {
0181   std::string title_w_axes = title + ";" + xaxis + ";" + yaxis;
0182   return ibooker.book2D(
0183       name, title_w_axes, xbinning.nbins, xbinning.xmin, xbinning.xmax, ybinning.nbins, ybinning.xmin, ybinning.xmax);
0184 }
0185 V0Monitor::MonitorElement* V0Monitor::bookProfile(DQMStore::IBooker& ibooker,
0186                                                   std::string name,
0187                                                   std::string title,
0188                                                   std::string xaxis,
0189                                                   std::string yaxis,
0190                                                   MEbinning xbinning,
0191                                                   MEbinning ybinning) {
0192   std::string title_w_axes = title + ";" + xaxis + ";" + yaxis;
0193   return ibooker.bookProfile(
0194       name, title_w_axes, xbinning.nbins, xbinning.xmin, xbinning.xmax, ybinning.xmin, ybinning.xmax);
0195 }
0196 
0197 void V0Monitor::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
0198   std::string histname, histtitle;
0199 
0200   std::string currentFolder = folderName_;
0201   ibooker.setCurrentFolder(currentFolder);
0202 
0203   MEbinning N_binning;
0204   N_binning.nbins = 15;
0205   N_binning.xmin = -0.5;
0206   N_binning.xmax = 14.5;
0207   v0_N_ = bookHisto1D(ibooker, "v0_N", "# v0", "# v0", "events", N_binning);
0208   v0_mass_ = bookHisto1D(ibooker, "v0_mass", "mass", "mass [GeV]", "events", mass_binning_);
0209   v0_pt_ = bookHisto1D(ibooker, "v0_pt", "pt", "p_{T} [GeV]", "events", pt_binning_);
0210   v0_eta_ = bookHisto1D(ibooker, "v0_eta", "eta", "#eta", "events", eta_binning_);
0211   MEbinning phi_binning;
0212   phi_binning.nbins = 34;
0213   phi_binning.xmin = -3.2;
0214   phi_binning.xmax = 3.2;
0215   v0_phi_ = bookHisto1D(ibooker, "v0_phi", "phi", "#phi [rad]", "events", phi_binning);
0216   v0_Lxy_ = bookHisto1D(ibooker, "v0_Lxy", "Lxy", "L_{xy} w.r.t. PV [cm]", "events", Lxy_binning_);
0217   v0_Lxy_wrtBS_ = bookHisto1D(ibooker, "v0_Lxy_wrtBS", "Lxy", "L_{xy} w.r.t. BS [cm]", "events", Lxy_binning_);
0218   v0_chi2oNDF_ =
0219       bookHisto1D(ibooker, "v0_chi2oNDF", "chi2oNDF", "vertex normalized #chi^{2}", "events", chi2oNDF_binning_);
0220 
0221   v0_mass_vs_p_ =
0222       bookProfile(ibooker, "v0_mass_vs_p", "mass vs p", "p [GeV]", "mass [GeV]", pt_binning_, mass_binning_);
0223   v0_mass_vs_pt_ =
0224       bookProfile(ibooker, "v0_mass_vs_pt", "mass vs pt", "p_{T} [GeV]", "mass [GeV]", pt_binning_, mass_binning_);
0225   v0_mass_vs_eta_ =
0226       bookProfile(ibooker, "v0_mass_vs_eta", "mass vs eta", "#eta", "mass [GeV]", eta_binning_, mass_binning_);
0227 
0228   MEbinning delta_binning;
0229   delta_binning.nbins = 150;
0230   delta_binning.xmin = -0.15;
0231   delta_binning.xmax = 0.15;
0232   v0_deltaMass_ = bookHisto1D(ibooker, "v0_deltaMass", "deltaMass", "m-m_{PDG}/m_{DPG}", "events", delta_binning);
0233   v0_deltaMass_vs_pt_ = bookProfile(
0234       ibooker, "v0_deltaMass_vs_pt", "deltaMass vs pt", "p_{T} [GeV]", "m-m_{PDG}/m_{DPG}", pt_binning_, delta_binning);
0235   v0_deltaMass_vs_eta_ = bookProfile(
0236       ibooker, "v0_deltaMass_vs_eta", "deltaMass vs eta", "#eta", "m-m_{PDG}/m_{DPG}", eta_binning_, delta_binning);
0237 
0238   v0_Lxy_vs_deltaMass_ = bookProfile(ibooker,
0239                                      "v0_Lxy_vs_deltaMass",
0240                                      "L_{xy} vs deltaMass",
0241                                      "m-m_{PDG}/m_{DPG}",
0242                                      "L_{xy} [cm]",
0243                                      delta_binning,
0244                                      Lxy_binning_);
0245   v0_Lxy_vs_pt_ =
0246       bookProfile(ibooker, "v0_Lxy_vs_pt", "L_{xy} vs p_{T}", "p_{T} [GeV]", "L_{xy} [cm]", pt_binning_, Lxy_binning_);
0247   v0_Lxy_vs_eta_ =
0248       bookProfile(ibooker, "v0_Lxy_vs_eta", "L_{xy} vs #eta", "#eta", "L_{xy} [cm]", eta_binning_, Lxy_binning_);
0249 
0250   MEbinning bx_binning;
0251   bx_binning.nbins = 3564;
0252   bx_binning.xmin = 0.5;
0253   bx_binning.xmax = 3564.5;
0254   n_vs_BX_ = bookHisto1D(ibooker, "n_vs_BX", "# events vs BX", "BX", "# events", bx_binning);
0255   v0_N_vs_BX_ = bookProfile(ibooker, "v0_N_vs_BX", "# v0 vs BX", "BX", "# v0", bx_binning, N_binning);
0256   v0_mass_vs_BX_ = bookProfile(ibooker, "v0_mass_vs_BX", "mass vs BX", "BX", "mass [GeV]", bx_binning, mass_binning_);
0257   v0_Lxy_vs_BX_ = bookProfile(ibooker, "v0_Lxy_vs_BX", "L_{xy} vs BX", "BX", "L_{xy} [cm]", bx_binning, Lxy_binning_);
0258   v0_deltaMass_vs_BX_ = bookProfile(
0259       ibooker, "v0_deltaMass_vs_BX", "deltaMass vs BX", "BX", "m-m_{PDG}/m_{DPG}", bx_binning, delta_binning);
0260 
0261   n_vs_lumi_ = bookHisto1D(
0262       ibooker, "n_vs_lumi", "# events vs lumi", "inst. lumi x10^{30} [Hz cm^{-2}]", "# events", lumi_binning_);
0263   v0_N_vs_lumi_ = bookProfile(
0264       ibooker, "v0_N_vs_lumi", "# v0 vs lumi", "inst. lumi x10^{30} [Hz cm^{-2}]", "# v0", lumi_binning_, N_binning);
0265   v0_mass_vs_lumi_ = bookProfile(ibooker,
0266                                  "v0_mass_vs_lumi",
0267                                  "mass vs lumi",
0268                                  "inst. lumi x10^{30} [Hz cm^{-2}]",
0269                                  "mass [GeV]",
0270                                  lumi_binning_,
0271                                  mass_binning_);
0272   v0_Lxy_vs_lumi_ = bookProfile(ibooker,
0273                                 "v0_Lxy_vs_lumi",
0274                                 "L_{xy} vs lumi",
0275                                 "inst. lumi x10^{30} [Hz cm^{-2}]",
0276                                 "L_{xy} [cm]",
0277                                 lumi_binning_,
0278                                 Lxy_binning_);
0279   v0_deltaMass_vs_lumi_ = bookProfile(ibooker,
0280                                       "v0_deltaMass_vs_lumi",
0281                                       "deltaMass vs lumi",
0282                                       "inst. lumi x10^{30} [Hz cm^{-2}]",
0283                                       "m-m_{PDG}/m_{DPG}",
0284                                       lumi_binning_,
0285                                       delta_binning);
0286 
0287   n_vs_PU_ = bookHisto1D(ibooker, "n_vs_PU", "# events vs PU", "# good PV", "# events", pu_binning_);
0288   v0_N_vs_PU_ = bookProfile(ibooker, "v0_N_vs_PU", "# v0 vs PU", "# good PV", "# v0", pu_binning_, N_binning);
0289   v0_mass_vs_PU_ =
0290       bookProfile(ibooker, "v0_mass_vs_PU", "mass vs PU", "# good PV", "mass [GeV]", pu_binning_, mass_binning_);
0291   v0_Lxy_vs_PU_ =
0292       bookProfile(ibooker, "v0_Lxy_vs_PU", "L_{xy} vs PU", "# good PV", "L_{xy} [cm]", pu_binning_, Lxy_binning_);
0293   v0_deltaMass_vs_PU_ = bookProfile(
0294       ibooker, "v0_deltaMass_vs_PU", "deltaMass vs PU", "# good PV", "m-m_{PDG}/m_{DPG}", pu_binning_, delta_binning);
0295 
0296   n_vs_LS_ = bookHisto1D(ibooker, "n_vs_LS", "# events vs LS", "LS", "# events", ls_binning_);
0297   v0_N_vs_LS_ = bookProfile(ibooker, "v0_N_vs_LS", "# v0 vs LS", "LS", "# v0", ls_binning_, N_binning);
0298   v0_N_vs_LS_->getTH1()->SetCanExtend(TH1::kAllAxes);
0299 
0300   // Initialize the GenericTriggerEventFlag
0301   if (genTriggerEventFlag_->on())
0302     genTriggerEventFlag_->initRun(iRun, iSetup);
0303 }
0304 
0305 void V0Monitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) {
0306   // Filter out events if Trigger Filtering is requested
0307   if (genTriggerEventFlag_->on() && !genTriggerEventFlag_->accept(iEvent, iSetup))
0308     return;
0309 
0310   //  int ls = iEvent.id().luminosityBlock();
0311 
0312   size_t bx = iEvent.bunchCrossing();
0313   n_vs_BX_->Fill(bx);
0314 
0315   float lumi = -1.;
0316   if (forceSCAL_) {
0317     edm::Handle<LumiScalersCollection> lumiScalers = iEvent.getHandle(lumiscalersToken_);
0318     if (lumiScalers.isValid() && !lumiScalers->empty()) {
0319       LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
0320       lumi = scalit->instantLumi();
0321     }
0322   } else {
0323     edm::Handle<OnlineLuminosityRecord> metaData = iEvent.getHandle(metaDataToken_);
0324     if (metaData.isValid())
0325       lumi = metaData->instLumi();
0326   }
0327 
0328   n_vs_lumi_->Fill(lumi);
0329 
0330   edm::Handle<reco::BeamSpot> beamspotHandle = iEvent.getHandle(bsToken_);
0331   reco::BeamSpot const* bs = nullptr;
0332   if (beamspotHandle.isValid())
0333     bs = &(*beamspotHandle);
0334 
0335   edm::Handle<reco::VertexCollection> pvHandle = iEvent.getHandle(pvToken_);
0336   reco::Vertex const* pv = nullptr;
0337   size_t nPV = 0;
0338   if (pvHandle.isValid()) {
0339     pv = &pvHandle->front();
0340     //--- pv fake (the pv collection should have size==1 and the pv==beam spot)
0341     if (pv->isFake() ||
0342         pv->tracksSize() == 0
0343         // definition of goodOfflinePrimaryVertex
0344         || pv->ndof() < pvNDOF_ || pv->z() > 24.)
0345       pv = nullptr;
0346 
0347     for (const auto& v : *pvHandle) {
0348       if (v.isFake())
0349         continue;
0350       if (v.ndof() < pvNDOF_)
0351         continue;
0352       if (v.z() > 24.)
0353         continue;
0354       ++nPV;
0355     }
0356   }
0357   n_vs_PU_->Fill(nPV);
0358 
0359   float nLS = static_cast<float>(iEvent.id().luminosityBlock());
0360   n_vs_LS_->Fill(nLS);
0361 
0362   edm::Handle<reco::VertexCompositeCandidateCollection> v0Handle = iEvent.getHandle(v0Token_);
0363   int n = (v0Handle.isValid() ? v0Handle->size() : -1);
0364   v0_N_->Fill(n);
0365   v0_N_vs_BX_->Fill(bx, n);
0366   v0_N_vs_lumi_->Fill(lumi, n);
0367   v0_N_vs_PU_->Fill(nPV, n);
0368   v0_N_vs_LS_->Fill(nLS, n);
0369 
0370   if (!v0Handle.isValid() or n == 0)
0371     return;
0372 
0373   reco::VertexCompositeCandidateCollection v0s = *v0Handle.product();
0374   for (const auto& v0 : v0s) {
0375     float mass = v0.mass();
0376     float pt = v0.pt();
0377     float p = v0.p();
0378     float eta = v0.eta();
0379     float phi = v0.phi();
0380     int pdgID = v0.pdgId();
0381     float chi2oNDF = v0.vertexNormalizedChi2();
0382     GlobalPoint displacementFromPV =
0383         (pv == nullptr ? GlobalPoint(-9., -9., 0) : GlobalPoint((pv->x() - v0.vx()), (pv->y() - v0.vy()), 0.));
0384     GlobalPoint displacementFromBS =
0385         (bs == nullptr
0386              ? GlobalPoint(-9., -9., 0.)
0387              : GlobalPoint(-1 * ((bs->position().x() - v0.vx()) + (v0.vz() - bs->position().z()) * bs->dxdz()),
0388                            -1 * ((bs->position().y() - v0.vy()) + (v0.vz() - bs->position().z()) * bs->dydz()),
0389                            0));
0390     float lxy = (pv == nullptr ? -9. : displacementFromPV.perp());
0391     float lxyWRTbs = (bs == nullptr ? -9. : displacementFromBS.perp());
0392 
0393     v0_mass_->Fill(mass);
0394     v0_pt_->Fill(pt);
0395     v0_eta_->Fill(eta);
0396     v0_phi_->Fill(phi);
0397     v0_Lxy_->Fill(lxy);
0398     v0_Lxy_wrtBS_->Fill(lxyWRTbs);
0399     v0_chi2oNDF_->Fill(chi2oNDF);
0400 
0401     v0_mass_vs_p_->Fill(p, mass);
0402     v0_mass_vs_pt_->Fill(pt, mass);
0403     v0_mass_vs_eta_->Fill(eta, mass);
0404     v0_mass_vs_BX_->Fill(bx, mass);
0405     v0_mass_vs_lumi_->Fill(lumi, mass);
0406     v0_mass_vs_PU_->Fill(nPV, mass);
0407 
0408     v0_Lxy_vs_BX_->Fill(bx, lxy);
0409     v0_Lxy_vs_lumi_->Fill(lumi, lxy);
0410     v0_Lxy_vs_PU_->Fill(nPV, lxy);
0411 
0412     float PDGmass = -9999.;
0413     switch (pdgID) {
0414       case 130:              // K_s
0415       case 310:              // K_L
0416         PDGmass = 0.497614;  // GeV
0417         break;
0418       case 3122:             // Lambda
0419       case -3122:            // Lambda
0420         PDGmass = 1.115683;  // GeV
0421         break;
0422       case 4122:   // Lambda_c
0423       case -4122:  // Lambda_c
0424       case 5122:   // Lambda_b
0425       case -5122:  // Lambda_b
0426       default:
0427         break;
0428     }
0429     float delta = (PDGmass > 0. ? (mass - PDGmass) / PDGmass : -9.);
0430     v0_deltaMass_->Fill(delta);
0431     v0_deltaMass_vs_pt_->Fill(pt, delta);
0432     v0_deltaMass_vs_eta_->Fill(eta, delta);
0433     v0_deltaMass_vs_BX_->Fill(bx, delta);
0434     v0_deltaMass_vs_lumi_->Fill(lumi, delta);
0435     v0_deltaMass_vs_PU_->Fill(nPV, delta);
0436 
0437     v0_Lxy_vs_deltaMass_->Fill(delta, lxy);
0438     v0_Lxy_vs_pt_->Fill(pt, lxy);
0439     v0_Lxy_vs_eta_->Fill(eta, lxy);
0440   }
0441 }
0442 
0443 // Define this as a plug-in
0444 #include "FWCore/Framework/interface/MakerMacros.h"
0445 DEFINE_FWK_MODULE(V0Monitor);