Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-01 22:41:17

0001 #include "Validation/MuonCSCDigis/plugins/CSCDigiValidation.h"
0002 #include "FWCore/ServiceRegistry/interface/Service.h"
0003 #include "Validation/MuonCSCDigis/interface/CSCALCTDigiValidation.h"
0004 #include "Validation/MuonCSCDigis/interface/CSCCLCTDigiValidation.h"
0005 #include "Validation/MuonCSCDigis/interface/CSCCLCTPreTriggerDigiValidation.h"
0006 #include "Validation/MuonCSCDigis/interface/CSCCorrelatedLCTDigiValidation.h"
0007 #include "Validation/MuonCSCDigis/interface/CSCComparatorDigiValidation.h"
0008 #include "Validation/MuonCSCDigis/interface/CSCStripDigiValidation.h"
0009 #include "Validation/MuonCSCDigis/interface/CSCWireDigiValidation.h"
0010 #include "Validation/MuonCSCDigis/interface/CSCStubEfficiencyValidation.h"
0011 #include "Validation/MuonCSCDigis/interface/CSCStubResolutionValidation.h"
0012 #include <iostream>
0013 #include <memory>
0014 
0015 CSCDigiValidation::CSCDigiValidation(const edm::ParameterSet &ps)
0016     : doSim_(ps.getParameter<bool>("doSim")), theSimHitMap(nullptr), theCSCGeometry(nullptr) {
0017   // instantiatethe validation modules
0018   theStripDigiValidation = std::make_unique<CSCStripDigiValidation>(ps, consumesCollector());
0019   theWireDigiValidation = std::make_unique<CSCWireDigiValidation>(ps, consumesCollector());
0020   theComparatorDigiValidation = std::make_unique<CSCComparatorDigiValidation>(ps, consumesCollector());
0021   theALCTDigiValidation = std::make_unique<CSCALCTDigiValidation>(ps, consumesCollector());
0022   theCLCTDigiValidation = std::make_unique<CSCCLCTDigiValidation>(ps, consumesCollector());
0023   theCLCTPreTriggerDigiValidation = std::make_unique<CSCCLCTPreTriggerDigiValidation>(ps, consumesCollector());
0024   theCorrelatedLCTDigiValidation = std::make_unique<CSCCorrelatedLCTDigiValidation>(ps, consumesCollector());
0025   // set the simhit map for resolution studies
0026   if (doSim_) {
0027     theSimHitMap = new PSimHitMap(ps.getParameter<edm::InputTag>("simHitsTag"), consumesCollector());
0028     theStripDigiValidation->setSimHitMap(theSimHitMap);
0029     theWireDigiValidation->setSimHitMap(theSimHitMap);
0030     theComparatorDigiValidation->setSimHitMap(theSimHitMap);
0031     theStubEfficiencyValidation = std::make_unique<CSCStubEfficiencyValidation>(ps, consumesCollector());
0032     theStubResolutionValidation = std::make_unique<CSCStubResolutionValidation>(ps, consumesCollector());
0033   }
0034   geomToken_ = esConsumes<CSCGeometry, MuonGeometryRecord>();
0035 }
0036 
0037 CSCDigiValidation::~CSCDigiValidation() {}
0038 
0039 void CSCDigiValidation::bookHistograms(DQMStore::IBooker &iBooker,
0040                                        edm::Run const &iRun,
0041                                        edm::EventSetup const & /* iSetup */) {
0042   // plot directory is set for each submodule
0043   theStripDigiValidation->bookHistograms(iBooker);
0044   theWireDigiValidation->bookHistograms(iBooker);
0045   theComparatorDigiValidation->bookHistograms(iBooker);
0046   theALCTDigiValidation->bookHistograms(iBooker);
0047   theCLCTDigiValidation->bookHistograms(iBooker);
0048   theCLCTPreTriggerDigiValidation->bookHistograms(iBooker);
0049   theCorrelatedLCTDigiValidation->bookHistograms(iBooker);
0050   if (doSim_) {
0051     // these plots are split over ALCT, CLCT and LCT
0052     theStubEfficiencyValidation->bookHistograms(iBooker);
0053     theStubResolutionValidation->bookHistograms(iBooker);
0054   }
0055 }
0056 
0057 void CSCDigiValidation::analyze(const edm::Event &e, const edm::EventSetup &eventSetup) {
0058   // find the geometry & conditions for this event
0059   const CSCGeometry *pGeom = &eventSetup.getData(geomToken_);
0060 
0061   theStripDigiValidation->setGeometry(pGeom);
0062   theWireDigiValidation->setGeometry(pGeom);
0063   theComparatorDigiValidation->setGeometry(pGeom);
0064   theALCTDigiValidation->setGeometry(pGeom);
0065   theCLCTDigiValidation->setGeometry(pGeom);
0066   theCLCTPreTriggerDigiValidation->setGeometry(pGeom);
0067   theCorrelatedLCTDigiValidation->setGeometry(pGeom);
0068   if (doSim_) {
0069     theSimHitMap->fill(e);
0070     theStubEfficiencyValidation->setGeometry(pGeom);
0071     theStubResolutionValidation->setGeometry(pGeom);
0072   }
0073 
0074   theStripDigiValidation->analyze(e, eventSetup);
0075   theWireDigiValidation->analyze(e, eventSetup);
0076   theComparatorDigiValidation->analyze(e, eventSetup);
0077   theALCTDigiValidation->analyze(e, eventSetup);
0078   theCLCTDigiValidation->analyze(e, eventSetup);
0079   theCLCTPreTriggerDigiValidation->analyze(e, eventSetup);
0080   theCorrelatedLCTDigiValidation->analyze(e, eventSetup);
0081   if (doSim_) {
0082     theStubEfficiencyValidation->analyze(e, eventSetup);
0083     theStubResolutionValidation->analyze(e, eventSetup);
0084   }
0085 }