Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:17

0001 #include "DQMServices/Core/interface/DQMStore.h"
0002 #include "FWCore/ServiceRegistry/interface/Service.h"
0003 #include "Validation/DTRecHits/interface/utils.h"
0004 
0005 #include "DTRecHitClients.h"
0006 #include "Histograms.h"
0007 
0008 using namespace std;
0009 using namespace edm;
0010 
0011 DTRecHitClients::DTRecHitClients(edm::ParameterSet const &pset) {
0012   // Switches for analysis at various steps
0013   doStep1_ = pset.getUntrackedParameter<bool>("doStep1", false);
0014   doStep2_ = pset.getUntrackedParameter<bool>("doStep2", false);
0015   doStep3_ = pset.getUntrackedParameter<bool>("doStep3", false);
0016   doall_ = pset.getUntrackedParameter<bool>("doall", false);
0017   local_ = pset.getUntrackedParameter<bool>("local", true);
0018 }
0019 
0020 DTRecHitClients::~DTRecHitClients() {}
0021 
0022 void DTRecHitClients::dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) {
0023   MonitorElement *hRes_S3RPhi = getter.get("DT/1DRecHits/Res/1D_S3RPhi_hRes");
0024   MonitorElement *hRes_S3RZ = getter.get("DT/1DRecHits/Res/1D_S3RZ_hRes");
0025   MonitorElement *hRes_S3RZ_W0 = getter.get("DT/1DRecHits/Res/1D_S3RZ_W0_hRes");
0026   MonitorElement *hRes_S3RZ_W1 = getter.get("DT/1DRecHits/Res/1D_S3RZ_W1_hRes");
0027   MonitorElement *hRes_S3RZ_W2 = getter.get("DT/1DRecHits/Res/1D_S3RZ_W2_hRes");
0028 
0029   MonitorElement *hPull_S3RPhi = getter.get("DT/1DRecHits/Pull/1D_S3RPhi_hPull");
0030   MonitorElement *hPull_S3RZ = getter.get("DT/1DRecHits/Pull/1D_S3RZ_hPull");
0031   MonitorElement *hPull_S3RZ_W0 = getter.get("DT/1DRecHits/Pull/1D_S3RZ_W0_hPull");
0032   MonitorElement *hPull_S3RZ_W1 = getter.get("DT/1DRecHits/Pull/1D_S3RZ_W1_hPull");
0033   MonitorElement *hPull_S3RZ_W2 = getter.get("DT/1DRecHits/Pull/1D_S3RZ_W2_hPull");
0034 
0035   Tutils util;
0036   util.drawGFit(hRes_S3RPhi->getTH1(), -0.2, 0.2, -0.1, 0.1);
0037   util.drawGFit(hRes_S3RZ->getTH1(), -0.2, 0.2, -0.1, 0.1);
0038   util.drawGFit(hRes_S3RZ_W0->getTH1(), -0.2, 0.2, -0.1, 0.1);
0039   util.drawGFit(hRes_S3RZ_W1->getTH1(), -0.2, 0.2, -0.1, 0.1);
0040   util.drawGFit(hRes_S3RZ_W2->getTH1(), -0.2, 0.2, -0.1, 0.1);
0041 
0042   util.drawGFit(hPull_S3RPhi->getTH1(), -5, 5, -5, 5);
0043   util.drawGFit(hPull_S3RZ->getTH1(), -5, 5, -5, 5);
0044   util.drawGFit(hPull_S3RZ_W0->getTH1(), -5, 5, -5, 5);
0045   util.drawGFit(hPull_S3RZ_W1->getTH1(), -5, 5, -5, 5);
0046   util.drawGFit(hPull_S3RZ_W2->getTH1(), -5, 5, -5, 5);
0047 
0048   if (doall_) {
0049     HEff1DHitHarvest hEff_S3RPhi("S3RPhi", booker, getter);
0050     HEff1DHitHarvest hEff_S3RZ("S3RZ", booker, getter);
0051     HEff1DHitHarvest hEff_S3RZ_W0("S3RZ_W0", booker, getter);
0052     HEff1DHitHarvest hEff_S3RZ_W1("S3RZ_W1", booker, getter);
0053     HEff1DHitHarvest hEff_S3RZ_W2("S3RZ_W2", booker, getter);
0054 
0055     if (doStep1_) {
0056       HEff1DHitHarvest hEff_S1RPhi("S1RPhi", booker, getter);
0057       HEff1DHitHarvest hEff_S1RZ("S1RZ", booker, getter);
0058       HEff1DHitHarvest hEff_S1RZ_W0("S1RZ_W0", booker, getter);
0059       HEff1DHitHarvest hEff_S1RZ_W1("S1RZ_W1", booker, getter);
0060       HEff1DHitHarvest hEff_S1RZ_W2("S1RZ_W2", booker, getter);
0061     }
0062 
0063     if (doStep2_) {
0064       HEff1DHitHarvest hEff_S2RPhi("S2RPhi", booker, getter);
0065       HEff1DHitHarvest hEff_S2RZ_W0("S2RZ_W0", booker, getter);
0066       HEff1DHitHarvest hEff_S2RZ_W1("S2RZ_W1", booker, getter);
0067       HEff1DHitHarvest hEff_S2RZ_W2("S2RZ_W2", booker, getter);
0068       HEff1DHitHarvest hEff_S2RZ("S2RZ", booker, getter);
0069     }
0070   }
0071 
0072   if (local_) {
0073     // Plots with finer granularity, not to be included in DQM
0074     TString name1 = "RPhi_W";
0075     TString name2 = "RZ_W";
0076     for (long w = 0; w <= 2; ++w) {
0077       for (long s = 1; s <= 4; ++s) {
0078         HEff1DHitHarvest hEff_S1RPhiWS(("S1" + name1 + w + "_St" + s).Data(), booker, getter);
0079         HEff1DHitHarvest hEff_S3RPhiWS(("S3" + name1 + w + "_St" + s).Data(), booker, getter);
0080         if (s != 4) {
0081           HEff1DHitHarvest hEff_S1RZWS(("S1" + name2 + w + "_St" + s).Data(), booker, getter);
0082           HEff1DHitHarvest hEff_S3RZWS(("S3" + name2 + w + "_St" + s).Data(), booker, getter);
0083         }
0084       }
0085     }
0086   }
0087 }
0088 
0089 // declare this as a framework plugin
0090 #include "FWCore/Framework/interface/MakerMacros.h"
0091 DEFINE_FWK_MODULE(DTRecHitClients);