Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:09

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiOuterTracker
0004 // Class:      SiOuterTracker
0005 //
0006 /**\class SiOuterTracker OuterTrackerMonitorTTStub.cc
0007  DQM/SiOuterTracker/plugins/OuterTrackerMonitorTTStub.cc
0008 
0009  Description: [one line class summary]
0010 
0011  Implementation:
0012      [Notes on implementation]
0013 */
0014 //
0015 // Original Author:  Isis Marina Van Parijs
0016 //         Created:  Fri, 24 Oct 2014 12:31:31 GMT
0017 //
0018 //
0019 
0020 // system include files
0021 #include <memory>
0022 #include <numeric>
0023 #include <vector>
0024 
0025 // user include files
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/Frameworkfwd.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "FWCore/ServiceRegistry/interface/Service.h"
0033 #include "FWCore/Utilities/interface/EDGetToken.h"
0034 
0035 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0036 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0037 #include "DataFormats/L1TrackTrigger/interface/TTStub.h"
0038 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0039 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0040 
0041 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0042 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0043 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0044 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0045 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0046 
0047 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0048 #include "DQMServices/Core/interface/DQMStore.h"
0049 
0050 class OuterTrackerMonitorTTStub : public DQMEDAnalyzer {
0051 public:
0052   explicit OuterTrackerMonitorTTStub(const edm::ParameterSet &);
0053   ~OuterTrackerMonitorTTStub() override;
0054   void analyze(const edm::Event &, const edm::EventSetup &) override;
0055   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0056   void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override;
0057 
0058   // TTStub stacks
0059   // Global position of the stubs
0060   MonitorElement *Stub_Barrel_XY = nullptr;     // TTStub barrel y vs x
0061   MonitorElement *Stub_Endcap_Fw_XY = nullptr;  // TTStub Forward Endcap y vs. x
0062   MonitorElement *Stub_Endcap_Bw_XY = nullptr;  // TTStub Backward Endcap y vs. x
0063   MonitorElement *Stub_RZ = nullptr;            // TTStub #rho vs. z
0064 
0065   // Number of stubs
0066   MonitorElement *Stub_Barrel = nullptr;                                                   // TTStub per layer
0067   MonitorElement *Stub_Endcap_Disc = nullptr;                                              // TTStubs per disc
0068   MonitorElement *Stub_Endcap_Disc_Fw = nullptr;                                           // TTStub per disc
0069   MonitorElement *Stub_Endcap_Disc_Bw = nullptr;                                           // TTStub per disc
0070   MonitorElement *Stub_Endcap_Ring = nullptr;                                              // TTStubs per ring
0071   MonitorElement *Stub_Endcap_Ring_Fw[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};  // TTStubs per EC ring
0072   MonitorElement *Stub_Endcap_Ring_Bw[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};  // TTStub per EC ring
0073 
0074   // Stub distribution
0075   MonitorElement *Stub_Eta = nullptr;     // TTstub eta distribution
0076   MonitorElement *Stub_Phi = nullptr;     // TTstub phi distribution
0077   MonitorElement *Stub_R = nullptr;       // TTstub r distribution
0078   MonitorElement *Stub_bendFE = nullptr;  // TTstub trigger bend
0079   MonitorElement *Stub_bendBE = nullptr;  // TTstub hardware bend
0080   MonitorElement *Stub_isPS = nullptr;    // is this stub a PS module?
0081 
0082   // STUB Displacement - offset
0083   MonitorElement *Stub_Barrel_W = nullptr;       // TTstub Pos-Corr Displacement (layer)
0084   MonitorElement *Stub_Barrel_O = nullptr;       // TTStub Offset (layer)
0085   MonitorElement *Stub_Endcap_Disc_W = nullptr;  // TTstub Pos-Corr Displacement (disc)
0086   MonitorElement *Stub_Endcap_Disc_O = nullptr;  // TTStub Offset (disc)
0087   MonitorElement *Stub_Endcap_Ring_W = nullptr;  // TTstub Pos-Corr Displacement (EC ring)
0088   MonitorElement *Stub_Endcap_Ring_O = nullptr;  // TTStub Offset (EC ring)
0089   MonitorElement *Stub_Endcap_Ring_W_Fw[5] = {
0090       nullptr, nullptr, nullptr, nullptr, nullptr};  // TTstub Pos-Corr Displacement (EC ring)
0091   MonitorElement *Stub_Endcap_Ring_O_Fw[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};  // TTStub Offset (EC ring)
0092   MonitorElement *Stub_Endcap_Ring_W_Bw[5] = {
0093       nullptr, nullptr, nullptr, nullptr, nullptr};  // TTstub Pos-Corr Displacement (EC ring)
0094   MonitorElement *Stub_Endcap_Ring_O_Bw[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};  // TTStub Offset (EC ring)
0095 
0096 private:
0097   edm::ParameterSet conf_;
0098   edm::EDGetTokenT<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>> tagTTStubsToken_;
0099   std::string topFolderName_;
0100   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0101   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0102   const TrackerGeometry *tkGeom_ = nullptr;
0103   const TrackerTopology *tTopo_ = nullptr;
0104 };
0105 
0106 // constructors and destructor
0107 OuterTrackerMonitorTTStub::OuterTrackerMonitorTTStub(const edm::ParameterSet &iConfig)
0108     : conf_(iConfig),
0109       geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
0110       topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
0111   // now do what ever initialization is needed
0112   topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
0113   tagTTStubsToken_ =
0114       consumes<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>>(conf_.getParameter<edm::InputTag>("TTStubs"));
0115 }
0116 
0117 OuterTrackerMonitorTTStub::~OuterTrackerMonitorTTStub() {
0118   // do anything here that needs to be done at desctruction time
0119   // (e.g. close files, deallocate resources etc.)
0120 }
0121 
0122 void OuterTrackerMonitorTTStub::dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) {
0123   tkGeom_ = &(iSetup.getData(geomToken_));
0124   tTopo_ = &(iSetup.getData(topoToken_));
0125 }
0126 // member functions
0127 
0128 // ------------ method called for each event  ------------
0129 void OuterTrackerMonitorTTStub::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0130   /// Track Trigger Stubs
0131   edm::Handle<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>> Phase2TrackerDigiTTStubHandle;
0132   iEvent.getByToken(tagTTStubsToken_, Phase2TrackerDigiTTStubHandle);
0133 
0134   /// Loop over input Stubs
0135   typename edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>::const_iterator inputIter;
0136   typename edmNew::DetSet<TTStub<Ref_Phase2TrackerDigi_>>::const_iterator contentIter;
0137   // Adding protection
0138   if (!Phase2TrackerDigiTTStubHandle.isValid())
0139     return;
0140 
0141   for (inputIter = Phase2TrackerDigiTTStubHandle->begin(); inputIter != Phase2TrackerDigiTTStubHandle->end();
0142        ++inputIter) {
0143     for (contentIter = inputIter->begin(); contentIter != inputIter->end(); ++contentIter) {
0144       /// Make reference stub
0145       edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>> tempStubRef =
0146           edmNew::makeRefTo(Phase2TrackerDigiTTStubHandle, contentIter);
0147 
0148       /// Get det ID (place of the stub)
0149       //  tempStubRef->getDetId() gives the stackDetId, not rawId
0150       DetId detIdStub = tkGeom_->idToDet((tempStubRef->clusterRef(0))->getDetId())->geographicalId();
0151 
0152       /// Get trigger displacement/offset
0153       double rawBend = tempStubRef->rawBend();
0154       double bendOffset = tempStubRef->bendOffset();
0155 
0156       /// Define position stub by position inner cluster
0157       MeasurementPoint mp = (tempStubRef->clusterRef(0))->findAverageLocalCoordinates();
0158       const GeomDet *theGeomDet = tkGeom_->idToDet(detIdStub);
0159       Global3DPoint posStub = theGeomDet->surface().toGlobal(theGeomDet->topology().localPosition(mp));
0160 
0161       Stub_Eta->Fill(posStub.eta());
0162       Stub_Phi->Fill(posStub.phi());
0163       Stub_R->Fill(posStub.perp());
0164       Stub_RZ->Fill(posStub.z(), posStub.perp());
0165       Stub_bendFE->Fill(tempStubRef->bendFE());
0166       Stub_bendBE->Fill(tempStubRef->bendBE());
0167       Stub_isPS->Fill(tempStubRef->moduleTypePS());
0168 
0169       if (detIdStub.subdetId() == static_cast<int>(StripSubdetector::TOB)) {  // Phase 2 Outer Tracker Barrel
0170         Stub_Barrel->Fill(tTopo_->layer(detIdStub));
0171         Stub_Barrel_XY->Fill(posStub.x(), posStub.y());
0172         Stub_Barrel_W->Fill(tTopo_->layer(detIdStub), rawBend - bendOffset);
0173         Stub_Barrel_O->Fill(tTopo_->layer(detIdStub), bendOffset);
0174       } else if (detIdStub.subdetId() == static_cast<int>(StripSubdetector::TID)) {  // Phase 2 Outer Tracker Endcap
0175         int disc = tTopo_->layer(detIdStub);                                         // returns wheel
0176         int ring = tTopo_->tidRing(detIdStub);
0177         Stub_Endcap_Disc->Fill(disc);
0178         Stub_Endcap_Ring->Fill(ring);
0179         Stub_Endcap_Disc_W->Fill(disc, rawBend - bendOffset);
0180         Stub_Endcap_Ring_W->Fill(ring, rawBend - bendOffset);
0181         Stub_Endcap_Disc_O->Fill(disc, bendOffset);
0182         Stub_Endcap_Ring_O->Fill(ring, bendOffset);
0183 
0184         if (posStub.z() > 0) {
0185           Stub_Endcap_Fw_XY->Fill(posStub.x(), posStub.y());
0186           Stub_Endcap_Disc_Fw->Fill(disc);
0187           Stub_Endcap_Ring_Fw[disc - 1]->Fill(ring);
0188           Stub_Endcap_Ring_W_Fw[disc - 1]->Fill(ring, rawBend - bendOffset);
0189           Stub_Endcap_Ring_O_Fw[disc - 1]->Fill(ring, bendOffset);
0190         } else {
0191           Stub_Endcap_Bw_XY->Fill(posStub.x(), posStub.y());
0192           Stub_Endcap_Disc_Bw->Fill(disc);
0193           Stub_Endcap_Ring_Bw[disc - 1]->Fill(ring);
0194           Stub_Endcap_Ring_W_Bw[disc - 1]->Fill(ring, rawBend - bendOffset);
0195           Stub_Endcap_Ring_O_Bw[disc - 1]->Fill(ring, bendOffset);
0196         }
0197       }
0198     }
0199   }
0200 }  // end of method
0201 
0202 // ------------ method called when starting to processes a run  ------------
0203 void OuterTrackerMonitorTTStub::bookHistograms(DQMStore::IBooker &iBooker,
0204                                                edm::Run const &run,
0205                                                edm::EventSetup const &es) {
0206   std::string HistoName;
0207   const int numDiscs = 5;
0208   iBooker.setCurrentFolder(topFolderName_ + "/Stubs/Position");
0209 
0210   edm::ParameterSet psTTStub_Barrel_XY = conf_.getParameter<edm::ParameterSet>("TH2TTStub_Position");
0211   HistoName = "Stub_Barrel_XY";
0212   Stub_Barrel_XY = iBooker.book2D(HistoName,
0213                                   HistoName,
0214                                   psTTStub_Barrel_XY.getParameter<int32_t>("Nbinsx"),
0215                                   psTTStub_Barrel_XY.getParameter<double>("xmin"),
0216                                   psTTStub_Barrel_XY.getParameter<double>("xmax"),
0217                                   psTTStub_Barrel_XY.getParameter<int32_t>("Nbinsy"),
0218                                   psTTStub_Barrel_XY.getParameter<double>("ymin"),
0219                                   psTTStub_Barrel_XY.getParameter<double>("ymax"));
0220   Stub_Barrel_XY->setAxisTitle("L1 Stub Barrel position x [cm]", 1);
0221   Stub_Barrel_XY->setAxisTitle("L1 Stub Barrel position y [cm]", 2);
0222 
0223   edm::ParameterSet psTTStub_Endcap_Fw_XY = conf_.getParameter<edm::ParameterSet>("TH2TTStub_Position");
0224   HistoName = "Stub_Endcap_Fw_XY";
0225   Stub_Endcap_Fw_XY = iBooker.book2D(HistoName,
0226                                      HistoName,
0227                                      psTTStub_Endcap_Fw_XY.getParameter<int32_t>("Nbinsx"),
0228                                      psTTStub_Endcap_Fw_XY.getParameter<double>("xmin"),
0229                                      psTTStub_Endcap_Fw_XY.getParameter<double>("xmax"),
0230                                      psTTStub_Endcap_Fw_XY.getParameter<int32_t>("Nbinsy"),
0231                                      psTTStub_Endcap_Fw_XY.getParameter<double>("ymin"),
0232                                      psTTStub_Endcap_Fw_XY.getParameter<double>("ymax"));
0233   Stub_Endcap_Fw_XY->setAxisTitle("L1 Stub Endcap position x [cm]", 1);
0234   Stub_Endcap_Fw_XY->setAxisTitle("L1 Stub Endcap position y [cm]", 2);
0235 
0236   edm::ParameterSet psTTStub_Endcap_Bw_XY = conf_.getParameter<edm::ParameterSet>("TH2TTStub_Position");
0237   HistoName = "Stub_Endcap_Bw_XY";
0238   Stub_Endcap_Bw_XY = iBooker.book2D(HistoName,
0239                                      HistoName,
0240                                      psTTStub_Endcap_Bw_XY.getParameter<int32_t>("Nbinsx"),
0241                                      psTTStub_Endcap_Bw_XY.getParameter<double>("xmin"),
0242                                      psTTStub_Endcap_Bw_XY.getParameter<double>("xmax"),
0243                                      psTTStub_Endcap_Bw_XY.getParameter<int32_t>("Nbinsy"),
0244                                      psTTStub_Endcap_Bw_XY.getParameter<double>("ymin"),
0245                                      psTTStub_Endcap_Bw_XY.getParameter<double>("ymax"));
0246   Stub_Endcap_Bw_XY->setAxisTitle("L1 Stub Endcap position x [cm]", 1);
0247   Stub_Endcap_Bw_XY->setAxisTitle("L1 Stub Endcap position y [cm]", 2);
0248 
0249   // TTStub #rho vs. z
0250   edm::ParameterSet psTTStub_RZ = conf_.getParameter<edm::ParameterSet>("TH2TTStub_RZ");
0251   HistoName = "Stub_RZ";
0252   Stub_RZ = iBooker.book2D(HistoName,
0253                            HistoName,
0254                            psTTStub_RZ.getParameter<int32_t>("Nbinsx"),
0255                            psTTStub_RZ.getParameter<double>("xmin"),
0256                            psTTStub_RZ.getParameter<double>("xmax"),
0257                            psTTStub_RZ.getParameter<int32_t>("Nbinsy"),
0258                            psTTStub_RZ.getParameter<double>("ymin"),
0259                            psTTStub_RZ.getParameter<double>("ymax"));
0260   Stub_RZ->setAxisTitle("L1 Stub position z [cm]", 1);
0261   Stub_RZ->setAxisTitle("L1 Stub position #rho [cm]", 2);
0262 
0263   iBooker.setCurrentFolder(topFolderName_ + "/Stubs");
0264   // TTStub eta
0265   edm::ParameterSet psTTStub_Eta = conf_.getParameter<edm::ParameterSet>("TH1TTStub_Eta");
0266   HistoName = "Stub_Eta";
0267   Stub_Eta = iBooker.book1D(HistoName,
0268                             HistoName,
0269                             psTTStub_Eta.getParameter<int32_t>("Nbinsx"),
0270                             psTTStub_Eta.getParameter<double>("xmin"),
0271                             psTTStub_Eta.getParameter<double>("xmax"));
0272   Stub_Eta->setAxisTitle("#eta", 1);
0273   Stub_Eta->setAxisTitle("# L1 Stubs ", 2);
0274 
0275   // TTStub phi
0276   edm::ParameterSet psTTStub_Phi = conf_.getParameter<edm::ParameterSet>("TH1TTStub_Phi");
0277   HistoName = "Stub_Phi";
0278   Stub_Phi = iBooker.book1D(HistoName,
0279                             HistoName,
0280                             psTTStub_Phi.getParameter<int32_t>("Nbinsx"),
0281                             psTTStub_Phi.getParameter<double>("xmin"),
0282                             psTTStub_Phi.getParameter<double>("xmax"));
0283   Stub_Phi->setAxisTitle("#phi", 1);
0284   Stub_Phi->setAxisTitle("# L1 Stubs ", 2);
0285 
0286   // TTStub R
0287   edm::ParameterSet psTTStub_R = conf_.getParameter<edm::ParameterSet>("TH1TTStub_R");
0288   HistoName = "Stub_R";
0289   Stub_R = iBooker.book1D(HistoName,
0290                           HistoName,
0291                           psTTStub_R.getParameter<int32_t>("Nbinsx"),
0292                           psTTStub_R.getParameter<double>("xmin"),
0293                           psTTStub_R.getParameter<double>("xmax"));
0294   Stub_R->setAxisTitle("R", 1);
0295   Stub_R->setAxisTitle("# L1 Stubs ", 2);
0296 
0297   // TTStub trigger bend
0298   edm::ParameterSet psTTStub_bend = conf_.getParameter<edm::ParameterSet>("TH1TTStub_bend");
0299   HistoName = "Stub_bendFE";
0300   Stub_bendFE = iBooker.book1D(HistoName,
0301                                HistoName,
0302                                psTTStub_bend.getParameter<int32_t>("Nbinsx"),
0303                                psTTStub_bend.getParameter<double>("xmin"),
0304                                psTTStub_bend.getParameter<double>("xmax"));
0305   Stub_bendFE->setAxisTitle("Trigger bend", 1);
0306   Stub_bendFE->setAxisTitle("# L1 Stubs ", 2);
0307 
0308   // TTStub hardware bend
0309   HistoName = "Stub_bendBE";
0310   Stub_bendBE = iBooker.book1D(HistoName,
0311                                HistoName,
0312                                psTTStub_bend.getParameter<int32_t>("Nbinsx"),
0313                                psTTStub_bend.getParameter<double>("xmin"),
0314                                psTTStub_bend.getParameter<double>("xmax"));
0315   Stub_bendBE->setAxisTitle("Hardware bend", 1);
0316   Stub_bendBE->setAxisTitle("# L1 Stubs ", 2);
0317 
0318   // TTStub, is PS?
0319   edm::ParameterSet psTTStub_isPS = conf_.getParameter<edm::ParameterSet>("TH1TTStub_isPS");
0320   HistoName = "Stub_isPS";
0321   Stub_isPS = iBooker.book1D(HistoName,
0322                              HistoName,
0323                              psTTStub_isPS.getParameter<int32_t>("Nbinsx"),
0324                              psTTStub_isPS.getParameter<double>("xmin"),
0325                              psTTStub_isPS.getParameter<double>("xmax"));
0326   Stub_isPS->setAxisTitle("Is PS?", 1);
0327   Stub_isPS->setAxisTitle("# L1 Stubs ", 2);
0328 
0329   iBooker.setCurrentFolder(topFolderName_ + "/Stubs/NStubs");
0330   // TTStub barrel stack
0331   edm::ParameterSet psTTStub_Barrel = conf_.getParameter<edm::ParameterSet>("TH1TTStub_Layers");
0332   HistoName = "NStubs_Barrel";
0333   Stub_Barrel = iBooker.book1D(HistoName,
0334                                HistoName,
0335                                psTTStub_Barrel.getParameter<int32_t>("Nbinsx"),
0336                                psTTStub_Barrel.getParameter<double>("xmin"),
0337                                psTTStub_Barrel.getParameter<double>("xmax"));
0338   Stub_Barrel->setAxisTitle("Barrel Layer", 1);
0339   Stub_Barrel->setAxisTitle("# L1 Stubs ", 2);
0340 
0341   // TTStub Endcap stack
0342   edm::ParameterSet psTTStub_ECDisc = conf_.getParameter<edm::ParameterSet>("TH1TTStub_Discs");
0343   HistoName = "NStubs_Endcap_Disc";
0344   Stub_Endcap_Disc = iBooker.book1D(HistoName,
0345                                     HistoName,
0346                                     psTTStub_ECDisc.getParameter<int32_t>("Nbinsx"),
0347                                     psTTStub_ECDisc.getParameter<double>("xmin"),
0348                                     psTTStub_ECDisc.getParameter<double>("xmax"));
0349   Stub_Endcap_Disc->setAxisTitle("Endcap Disc", 1);
0350   Stub_Endcap_Disc->setAxisTitle("# L1 Stubs ", 2);
0351 
0352   // TTStub Endcap stack
0353   HistoName = "NStubs_Endcap_Disc_Fw";
0354   Stub_Endcap_Disc_Fw = iBooker.book1D(HistoName,
0355                                        HistoName,
0356                                        psTTStub_ECDisc.getParameter<int32_t>("Nbinsx"),
0357                                        psTTStub_ECDisc.getParameter<double>("xmin"),
0358                                        psTTStub_ECDisc.getParameter<double>("xmax"));
0359   Stub_Endcap_Disc_Fw->setAxisTitle("Forward Endcap Disc", 1);
0360   Stub_Endcap_Disc_Fw->setAxisTitle("# L1 Stubs ", 2);
0361 
0362   // TTStub Endcap stack
0363   HistoName = "NStubs_Endcap_Disc_Bw";
0364   Stub_Endcap_Disc_Bw = iBooker.book1D(HistoName,
0365                                        HistoName,
0366                                        psTTStub_ECDisc.getParameter<int32_t>("Nbinsx"),
0367                                        psTTStub_ECDisc.getParameter<double>("xmin"),
0368                                        psTTStub_ECDisc.getParameter<double>("xmax"));
0369   Stub_Endcap_Disc_Bw->setAxisTitle("Backward Endcap Disc", 1);
0370   Stub_Endcap_Disc_Bw->setAxisTitle("# L1 Stubs ", 2);
0371 
0372   edm::ParameterSet psTTStub_ECRing = conf_.getParameter<edm::ParameterSet>("TH1TTStub_Rings");
0373   HistoName = "NStubs_Endcap_Ring";
0374   Stub_Endcap_Ring = iBooker.book1D(HistoName,
0375                                     HistoName,
0376                                     psTTStub_ECRing.getParameter<int32_t>("Nbinsx"),
0377                                     psTTStub_ECRing.getParameter<double>("xmin"),
0378                                     psTTStub_ECRing.getParameter<double>("xmax"));
0379   Stub_Endcap_Ring->setAxisTitle("Endcap Ring", 1);
0380   Stub_Endcap_Ring->setAxisTitle("# L1 Stubs ", 2);
0381 
0382   for (int i = 0; i < numDiscs; i++) {
0383     HistoName = "NStubs_Disc+" + std::to_string(i + 1);
0384     // TTStub Endcap stack
0385     Stub_Endcap_Ring_Fw[i] = iBooker.book1D(HistoName,
0386                                             HistoName,
0387                                             psTTStub_ECRing.getParameter<int32_t>("Nbinsx"),
0388                                             psTTStub_ECRing.getParameter<double>("xmin"),
0389                                             psTTStub_ECRing.getParameter<double>("xmax"));
0390     Stub_Endcap_Ring_Fw[i]->setAxisTitle("Endcap Ring", 1);
0391     Stub_Endcap_Ring_Fw[i]->setAxisTitle("# L1 Stubs ", 2);
0392   }
0393 
0394   for (int i = 0; i < numDiscs; i++) {
0395     HistoName = "NStubs_Disc-" + std::to_string(i + 1);
0396     // TTStub Endcap stack
0397     Stub_Endcap_Ring_Bw[i] = iBooker.book1D(HistoName,
0398                                             HistoName,
0399                                             psTTStub_ECRing.getParameter<int32_t>("Nbinsx"),
0400                                             psTTStub_ECRing.getParameter<double>("xmin"),
0401                                             psTTStub_ECRing.getParameter<double>("xmax"));
0402     Stub_Endcap_Ring_Bw[i]->setAxisTitle("Endcap Ring", 1);
0403     Stub_Endcap_Ring_Bw[i]->setAxisTitle("# L1 Stubs ", 2);
0404   }
0405 
0406   // TTStub displ/offset
0407   edm::ParameterSet psTTStub_Barrel_2D = conf_.getParameter<edm::ParameterSet>("TH2TTStub_DisOf_Layer");
0408   edm::ParameterSet psTTStub_ECDisc_2D = conf_.getParameter<edm::ParameterSet>("TH2TTStub_DisOf_Disc");
0409   edm::ParameterSet psTTStub_ECRing_2D = conf_.getParameter<edm::ParameterSet>("TH2TTStub_DisOf_Ring");
0410 
0411   iBooker.setCurrentFolder(topFolderName_ + "/Stubs/Width");
0412   HistoName = "Stub_Width_Barrel";
0413   Stub_Barrel_W = iBooker.book2D(HistoName,
0414                                  HistoName,
0415                                  psTTStub_Barrel_2D.getParameter<int32_t>("Nbinsx"),
0416                                  psTTStub_Barrel_2D.getParameter<double>("xmin"),
0417                                  psTTStub_Barrel_2D.getParameter<double>("xmax"),
0418                                  psTTStub_Barrel_2D.getParameter<int32_t>("Nbinsy"),
0419                                  psTTStub_Barrel_2D.getParameter<double>("ymin"),
0420                                  psTTStub_Barrel_2D.getParameter<double>("ymax"));
0421   Stub_Barrel_W->setAxisTitle("Barrel Layer", 1);
0422   Stub_Barrel_W->setAxisTitle("Displacement - Offset", 2);
0423 
0424   HistoName = "Stub_Width_Endcap_Disc";
0425   Stub_Endcap_Disc_W = iBooker.book2D(HistoName,
0426                                       HistoName,
0427                                       psTTStub_ECDisc_2D.getParameter<int32_t>("Nbinsx"),
0428                                       psTTStub_ECDisc_2D.getParameter<double>("xmin"),
0429                                       psTTStub_ECDisc_2D.getParameter<double>("xmax"),
0430                                       psTTStub_ECDisc_2D.getParameter<int32_t>("Nbinsy"),
0431                                       psTTStub_ECDisc_2D.getParameter<double>("ymin"),
0432                                       psTTStub_ECDisc_2D.getParameter<double>("ymax"));
0433   Stub_Endcap_Disc_W->setAxisTitle("Endcap Disc", 1);
0434   Stub_Endcap_Disc_W->setAxisTitle("Displacement - Offset", 2);
0435 
0436   HistoName = "Stub_Width_Endcap_Ring";
0437   Stub_Endcap_Ring_W = iBooker.book2D(HistoName,
0438                                       HistoName,
0439                                       psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0440                                       psTTStub_ECRing_2D.getParameter<double>("xmin"),
0441                                       psTTStub_ECRing_2D.getParameter<double>("xmax"),
0442                                       psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0443                                       psTTStub_ECRing_2D.getParameter<double>("ymin"),
0444                                       psTTStub_ECRing_2D.getParameter<double>("ymax"));
0445   Stub_Endcap_Ring_W->setAxisTitle("Endcap Ring", 1);
0446   Stub_Endcap_Ring_W->setAxisTitle("Trigger Offset", 2);
0447 
0448   for (int i = 0; i < numDiscs; i++) {
0449     HistoName = "Stub_Width_Disc+" + std::to_string(i + 1);
0450     Stub_Endcap_Ring_W_Fw[i] = iBooker.book2D(HistoName,
0451                                               HistoName,
0452                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0453                                               psTTStub_ECRing_2D.getParameter<double>("xmin"),
0454                                               psTTStub_ECRing_2D.getParameter<double>("xmax"),
0455                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0456                                               psTTStub_ECRing_2D.getParameter<double>("ymin"),
0457                                               psTTStub_ECRing_2D.getParameter<double>("ymax"));
0458     Stub_Endcap_Ring_W_Fw[i]->setAxisTitle("Endcap Ring", 1);
0459     Stub_Endcap_Ring_W_Fw[i]->setAxisTitle("Displacement - Offset", 2);
0460   }
0461 
0462   for (int i = 0; i < numDiscs; i++) {
0463     HistoName = "Stub_Width_Disc-" + std::to_string(i + 1);
0464     Stub_Endcap_Ring_W_Bw[i] = iBooker.book2D(HistoName,
0465                                               HistoName,
0466                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0467                                               psTTStub_ECRing_2D.getParameter<double>("xmin"),
0468                                               psTTStub_ECRing_2D.getParameter<double>("xmax"),
0469                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0470                                               psTTStub_ECRing_2D.getParameter<double>("ymin"),
0471                                               psTTStub_ECRing_2D.getParameter<double>("ymax"));
0472     Stub_Endcap_Ring_W_Bw[i]->setAxisTitle("Endcap Ring", 1);
0473     Stub_Endcap_Ring_W_Bw[i]->setAxisTitle("Displacement - Offset", 2);
0474   }
0475 
0476   iBooker.setCurrentFolder(topFolderName_ + "/Stubs/Offset");
0477   HistoName = "Stub_Offset_Barrel";
0478   Stub_Barrel_O = iBooker.book2D(HistoName,
0479                                  HistoName,
0480                                  psTTStub_Barrel_2D.getParameter<int32_t>("Nbinsx"),
0481                                  psTTStub_Barrel_2D.getParameter<double>("xmin"),
0482                                  psTTStub_Barrel_2D.getParameter<double>("xmax"),
0483                                  psTTStub_Barrel_2D.getParameter<int32_t>("Nbinsy"),
0484                                  psTTStub_Barrel_2D.getParameter<double>("ymin"),
0485                                  psTTStub_Barrel_2D.getParameter<double>("ymax"));
0486   Stub_Barrel_O->setAxisTitle("Barrel Layer", 1);
0487   Stub_Barrel_O->setAxisTitle("Trigger Offset", 2);
0488 
0489   HistoName = "Stub_Offset_Endcap_Disc";
0490   Stub_Endcap_Disc_O = iBooker.book2D(HistoName,
0491                                       HistoName,
0492                                       psTTStub_ECDisc_2D.getParameter<int32_t>("Nbinsx"),
0493                                       psTTStub_ECDisc_2D.getParameter<double>("xmin"),
0494                                       psTTStub_ECDisc_2D.getParameter<double>("xmax"),
0495                                       psTTStub_ECDisc_2D.getParameter<int32_t>("Nbinsy"),
0496                                       psTTStub_ECDisc_2D.getParameter<double>("ymin"),
0497                                       psTTStub_ECDisc_2D.getParameter<double>("ymax"));
0498   Stub_Endcap_Disc_O->setAxisTitle("Endcap Disc", 1);
0499   Stub_Endcap_Disc_O->setAxisTitle("Trigger Offset", 2);
0500 
0501   HistoName = "Stub_Offset_Endcap_Ring";
0502   Stub_Endcap_Ring_O = iBooker.book2D(HistoName,
0503                                       HistoName,
0504                                       psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0505                                       psTTStub_ECRing_2D.getParameter<double>("xmin"),
0506                                       psTTStub_ECRing_2D.getParameter<double>("xmax"),
0507                                       psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0508                                       psTTStub_ECRing_2D.getParameter<double>("ymin"),
0509                                       psTTStub_ECRing_2D.getParameter<double>("ymax"));
0510   Stub_Endcap_Ring_O->setAxisTitle("Endcap Ring", 1);
0511   Stub_Endcap_Ring_O->setAxisTitle("Trigger Offset", 2);
0512 
0513   for (int i = 0; i < numDiscs; i++) {
0514     HistoName = "Stub_Offset_Disc+" + std::to_string(i + 1);
0515     Stub_Endcap_Ring_O_Fw[i] = iBooker.book2D(HistoName,
0516                                               HistoName,
0517                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0518                                               psTTStub_ECRing_2D.getParameter<double>("xmin"),
0519                                               psTTStub_ECRing_2D.getParameter<double>("xmax"),
0520                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0521                                               psTTStub_ECRing_2D.getParameter<double>("ymin"),
0522                                               psTTStub_ECRing_2D.getParameter<double>("ymax"));
0523     Stub_Endcap_Ring_O_Fw[i]->setAxisTitle("Endcap Ring", 1);
0524     Stub_Endcap_Ring_O_Fw[i]->setAxisTitle("Trigger Offset", 2);
0525   }
0526 
0527   for (int i = 0; i < numDiscs; i++) {
0528     HistoName = "Stub_Offset_Disc-" + std::to_string(i + 1);
0529     Stub_Endcap_Ring_O_Bw[i] = iBooker.book2D(HistoName,
0530                                               HistoName,
0531                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsx"),
0532                                               psTTStub_ECRing_2D.getParameter<double>("xmin"),
0533                                               psTTStub_ECRing_2D.getParameter<double>("xmax"),
0534                                               psTTStub_ECRing_2D.getParameter<int32_t>("Nbinsy"),
0535                                               psTTStub_ECRing_2D.getParameter<double>("ymin"),
0536                                               psTTStub_ECRing_2D.getParameter<double>("ymax"));
0537     Stub_Endcap_Ring_O_Bw[i]->setAxisTitle("Endcap Ring", 1);
0538     Stub_Endcap_Ring_O_Bw[i]->setAxisTitle("Trigger Offset", 2);
0539   }
0540 }
0541 
0542 DEFINE_FWK_MODULE(OuterTrackerMonitorTTStub);