Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:42:59

0001 // Package:    SiOuterTracker
0002 // Class:      SiOuterTracker
0003 //
0004 // Original Author:  Isis Marina Van Parijs
0005 // Modified by: Emily MacDonald (emily.kaelyn.macdonald@cern.ch)
0006 
0007 // system include files
0008 #include <memory>
0009 #include <numeric>
0010 #include <string>
0011 #include <vector>
0012 #include <bitset>
0013 
0014 // user include files
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/Framework/interface/Frameworkfwd.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Utilities/interface/EDGetToken.h"
0022 #include "FWCore/ServiceRegistry/interface/Service.h"
0023 
0024 #include "CommonTools/Statistics/interface/ChiSquaredProbability.h"
0025 #include "DataFormats/Common/interface/DetSetVector.h"
0026 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0027 #include "DataFormats/Common/interface/Ptr.h"
0028 #include "DataFormats/Common/interface/Ref.h"
0029 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0030 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0031 #include "DataFormats/L1TrackTrigger/interface/TTCluster.h"
0032 #include "DataFormats/L1TrackTrigger/interface/TTStub.h"
0033 #include "DataFormats/L1TrackTrigger/interface/TTTrack.h"
0034 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0035 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0036 
0037 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0038 #include "DQMServices/Core/interface/DQMStore.h"
0039 
0040 class OuterTrackerMonitorTTTrack : public DQMEDAnalyzer {
0041 public:
0042   explicit OuterTrackerMonitorTTTrack(const edm::ParameterSet &);
0043   ~OuterTrackerMonitorTTTrack() override;
0044   void analyze(const edm::Event &, const edm::EventSetup &) override;
0045   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0046   /// Low-quality TTTracks (All tracks)
0047   MonitorElement *Track_All_N = nullptr;                 // Number of tracks per event
0048   MonitorElement *Track_All_NStubs = nullptr;            // Number of stubs per track
0049   MonitorElement *Track_All_NLayersMissed = nullptr;     // Number of layers missed per track
0050   MonitorElement *Track_All_Eta_NStubs = nullptr;        // Number of stubs per track vs eta
0051   MonitorElement *Track_All_Pt = nullptr;                // pT distrubtion for tracks
0052   MonitorElement *Track_All_Eta = nullptr;               // eta distrubtion for tracks
0053   MonitorElement *Track_All_Phi = nullptr;               // phi distrubtion for tracks
0054   MonitorElement *Track_All_D0 = nullptr;                // d0 distrubtion for tracks
0055   MonitorElement *Track_All_VtxZ = nullptr;              // z0 distrubtion for tracks
0056   MonitorElement *Track_All_BendChi2 = nullptr;          // Bendchi2 distrubtion for tracks
0057   MonitorElement *Track_All_Chi2 = nullptr;              // chi2 distrubtion for tracks
0058   MonitorElement *Track_All_Chi2Red = nullptr;           // chi2/dof distrubtion for tracks
0059   MonitorElement *Track_All_Chi2RZ = nullptr;            // chi2 r-phi distrubtion for tracks
0060   MonitorElement *Track_All_Chi2RPhi = nullptr;          // chi2 r-z distrubtion for tracks
0061   MonitorElement *Track_All_Chi2Red_NStubs = nullptr;    // chi2/dof vs number of stubs
0062   MonitorElement *Track_All_Chi2Red_Eta = nullptr;       // chi2/dof vs eta of track
0063   MonitorElement *Track_All_Eta_BarrelStubs = nullptr;   // eta vs number of stubs in barrel
0064   MonitorElement *Track_All_Eta_ECStubs = nullptr;       // eta vs number of stubs in end caps
0065   MonitorElement *Track_All_Chi2_Probability = nullptr;  // chi2 probability
0066   MonitorElement *Track_All_MVA1 = nullptr;              // MVA1 (prompt quality) distribution
0067 
0068   /// High-quality TTTracks; different depending on prompt vs displaced tracks
0069   // Quality cuts: chi2/dof<10, bendchi2<2.2 (Prompt), default in config
0070   // Quality cuts: chi2/dof<40, bendchi2<2.4 (Extended/Displaced tracks)
0071   MonitorElement *Track_HQ_N = nullptr;                 // Number of tracks per event
0072   MonitorElement *Track_HQ_NStubs = nullptr;            // Number of stubs per track
0073   MonitorElement *Track_HQ_NLayersMissed = nullptr;     // Number of layers missed per track
0074   MonitorElement *Track_HQ_Eta_NStubs = nullptr;        // Number of stubs per track vs eta
0075   MonitorElement *Track_HQ_Pt = nullptr;                // pT distrubtion for tracks
0076   MonitorElement *Track_HQ_Eta = nullptr;               // eta distrubtion for tracks
0077   MonitorElement *Track_HQ_Phi = nullptr;               // phi distrubtion for tracks
0078   MonitorElement *Track_HQ_D0 = nullptr;                // d0 distrubtion for tracks
0079   MonitorElement *Track_HQ_VtxZ = nullptr;              // z0 distrubtion for tracks
0080   MonitorElement *Track_HQ_BendChi2 = nullptr;          // Bendchi2 distrubtion for tracks
0081   MonitorElement *Track_HQ_Chi2 = nullptr;              // chi2 distrubtion for tracks
0082   MonitorElement *Track_HQ_Chi2Red = nullptr;           // chi2/dof distrubtion for tracks
0083   MonitorElement *Track_HQ_Chi2RZ = nullptr;            // chi2 r-z distrubtion for tracks
0084   MonitorElement *Track_HQ_Chi2RPhi = nullptr;          // chi2 r-phi distrubtion for tracks
0085   MonitorElement *Track_HQ_Chi2Red_NStubs = nullptr;    // chi2/dof vs number of stubs
0086   MonitorElement *Track_HQ_Chi2Red_Eta = nullptr;       // chi2/dof vs eta of track
0087   MonitorElement *Track_HQ_Eta_BarrelStubs = nullptr;   // eta vs number of stubs in barrel
0088   MonitorElement *Track_HQ_Eta_ECStubs = nullptr;       // eta vs number of stubs in end caps
0089   MonitorElement *Track_HQ_Chi2_Probability = nullptr;  // chi2 probability
0090   MonitorElement *Track_HQ_MVA1 = nullptr;              // MVA1 (prompt quality) distribution
0091 
0092 private:
0093   edm::ParameterSet conf_;
0094   edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> ttTrackToken_;
0095 
0096   unsigned int HQNStubs_;
0097   double HQChi2dof_;
0098   double HQBendChi2_;
0099   std::string topFolderName_;
0100 };
0101 
0102 // constructors and destructor
0103 OuterTrackerMonitorTTTrack::OuterTrackerMonitorTTTrack(const edm::ParameterSet &iConfig) : conf_(iConfig) {
0104   topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
0105   ttTrackToken_ =
0106       consumes<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>>(conf_.getParameter<edm::InputTag>("TTTracksTag"));
0107   HQNStubs_ = conf_.getParameter<int>("HQNStubs");
0108   HQChi2dof_ = conf_.getParameter<double>("HQChi2dof");
0109   HQBendChi2_ = conf_.getParameter<double>("HQBendChi2");
0110 }
0111 
0112 OuterTrackerMonitorTTTrack::~OuterTrackerMonitorTTTrack() {
0113   // do anything here that needs to be done at desctruction time
0114   // (e.g. close files, deallocate resources etc.)
0115 }
0116 
0117 // ------------ method called for each event  ------------
0118 void OuterTrackerMonitorTTTrack::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0119   // L1 Primaries
0120   edm::Handle<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> TTTrackHandle;
0121   iEvent.getByToken(ttTrackToken_, TTTrackHandle);
0122 
0123   /// Track Trigger Tracks
0124   unsigned int numAllTracks = 0;
0125   unsigned int numHQTracks = 0;
0126 
0127   // Adding protection
0128   if (!TTTrackHandle.isValid())
0129     return;
0130 
0131   /// Loop over TTTracks
0132   unsigned int tkCnt = 0;
0133   for (const auto &iterTTTrack : *TTTrackHandle) {
0134     edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>> tempTrackPtr(TTTrackHandle, tkCnt++);  /// Make the pointer
0135 
0136     unsigned int nStubs = tempTrackPtr->getStubRefs().size();
0137     int nBarrelStubs = 0;
0138     int nECStubs = 0;
0139 
0140     float track_eta = tempTrackPtr->momentum().eta();
0141     float track_d0 = tempTrackPtr->d0();
0142     float track_bendchi2 = tempTrackPtr->stubPtConsistency();
0143     float track_chi2 = tempTrackPtr->chi2();
0144     float track_chi2dof = tempTrackPtr->chi2Red();
0145     float track_chi2rz = tempTrackPtr->chi2Z();
0146     float track_chi2rphi = tempTrackPtr->chi2XY();
0147     float track_MVA1 = tempTrackPtr->trkMVA1();
0148     int nLayersMissed = 0;
0149     unsigned int hitPattern_ = (unsigned int)tempTrackPtr->hitPattern();
0150 
0151     int nbits = floor(log2(hitPattern_)) + 1;
0152     int lay_i = 0;
0153     bool seq = false;
0154     for (int i = 0; i < nbits; i++) {
0155       lay_i = ((1 << i) & hitPattern_) >> i;  //0 or 1 in ith bit (right to left)
0156       if (lay_i && !seq)
0157         seq = true;  //sequence starts when first 1 found
0158       if (!lay_i && seq)
0159         nLayersMissed++;
0160     }
0161 
0162     std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
0163         theStubs = iterTTTrack.getStubRefs();
0164     for (const auto &istub : theStubs) {
0165       bool inBarrel = false;
0166       bool inEC = false;
0167 
0168       if (istub->getDetId().subdetId() == StripSubdetector::TOB)
0169         inBarrel = true;
0170       else if (istub->getDetId().subdetId() == StripSubdetector::TID)
0171         inEC = true;
0172       if (inBarrel)
0173         nBarrelStubs++;
0174       else if (inEC)
0175         nECStubs++;
0176     }  // end loop over stubs
0177 
0178     // HQ tracks: bendchi2<2.2 and chi2/dof<10
0179     if (nStubs >= HQNStubs_ && track_chi2dof <= HQChi2dof_ && track_bendchi2 <= HQBendChi2_) {
0180       numHQTracks++;
0181 
0182       Track_HQ_NStubs->Fill(nStubs);
0183       Track_HQ_NLayersMissed->Fill(nLayersMissed);
0184       Track_HQ_Eta_NStubs->Fill(track_eta, nStubs);
0185       Track_HQ_Pt->Fill(tempTrackPtr->momentum().perp());
0186       Track_HQ_Eta->Fill(track_eta);
0187       Track_HQ_Phi->Fill(tempTrackPtr->momentum().phi());
0188       Track_HQ_D0->Fill(track_d0);
0189       Track_HQ_VtxZ->Fill(tempTrackPtr->z0());
0190       Track_HQ_BendChi2->Fill(track_bendchi2);
0191       Track_HQ_Chi2->Fill(track_chi2);
0192       Track_HQ_Chi2RZ->Fill(track_chi2rz);
0193       Track_HQ_Chi2RPhi->Fill(track_chi2rphi);
0194       Track_HQ_Chi2Red->Fill(track_chi2dof);
0195       Track_HQ_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
0196       Track_HQ_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
0197       Track_HQ_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
0198       Track_HQ_Eta_ECStubs->Fill(track_eta, nECStubs);
0199       Track_HQ_Chi2_Probability->Fill(ChiSquaredProbability(track_chi2, nStubs));
0200       Track_HQ_MVA1->Fill(track_MVA1);
0201     }
0202 
0203     // All tracks (including HQ tracks)
0204     numAllTracks++;
0205     Track_All_NStubs->Fill(nStubs);
0206     Track_All_NLayersMissed->Fill(nLayersMissed);
0207     Track_All_Eta_NStubs->Fill(track_eta, nStubs);
0208     Track_All_Pt->Fill(tempTrackPtr->momentum().perp());
0209     Track_All_Eta->Fill(track_eta);
0210     Track_All_Phi->Fill(tempTrackPtr->momentum().phi());
0211     Track_All_D0->Fill(track_d0);
0212     Track_All_VtxZ->Fill(tempTrackPtr->z0());
0213     Track_All_BendChi2->Fill(track_bendchi2);
0214     Track_All_Chi2->Fill(track_chi2);
0215     Track_All_Chi2RZ->Fill(track_chi2rz);
0216     Track_All_Chi2RPhi->Fill(track_chi2rphi);
0217     Track_All_Chi2Red->Fill(track_chi2dof);
0218     Track_All_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
0219     Track_All_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
0220     Track_All_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
0221     Track_All_Eta_ECStubs->Fill(track_eta, nECStubs);
0222     Track_All_Chi2_Probability->Fill(ChiSquaredProbability(track_chi2, nStubs));
0223     Track_All_MVA1->Fill(track_MVA1);
0224   }  // End of loop over TTTracks
0225 
0226   Track_HQ_N->Fill(numHQTracks);
0227   Track_All_N->Fill(numAllTracks);
0228 }  // end of method
0229 
0230 // ------------ method called once each job just before starting event loop
0231 // ------------
0232 // Creating all histograms for DQM file output
0233 void OuterTrackerMonitorTTTrack::bookHistograms(DQMStore::IBooker &iBooker,
0234                                                 edm::Run const &run,
0235                                                 edm::EventSetup const &es) {
0236   std::string HistoName;
0237 
0238   /// Low-quality tracks (All tracks, including HQ tracks)
0239   iBooker.setCurrentFolder(topFolderName_ + "/Tracks/All");
0240   // Nb of L1Tracks
0241   HistoName = "Track_All_N";
0242   edm::ParameterSet psTrack_N = conf_.getParameter<edm::ParameterSet>("TH1_NTracks");
0243   Track_All_N = iBooker.book1D(HistoName,
0244                                HistoName,
0245                                psTrack_N.getParameter<int32_t>("Nbinsx"),
0246                                psTrack_N.getParameter<double>("xmin"),
0247                                psTrack_N.getParameter<double>("xmax"));
0248   Track_All_N->setAxisTitle("# L1 Tracks", 1);
0249   Track_All_N->setAxisTitle("# Events", 2);
0250 
0251   // Number of stubs
0252   edm::ParameterSet psTrack_NStubs = conf_.getParameter<edm::ParameterSet>("TH1_NStubs");
0253   HistoName = "Track_All_NStubs";
0254   Track_All_NStubs = iBooker.book1D(HistoName,
0255                                     HistoName,
0256                                     psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
0257                                     psTrack_NStubs.getParameter<double>("xmin"),
0258                                     psTrack_NStubs.getParameter<double>("xmax"));
0259   Track_All_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
0260   Track_All_NStubs->setAxisTitle("# L1 Tracks", 2);
0261 
0262   // Number of layers missed
0263   HistoName = "Track_All_NLayersMissed";
0264   Track_All_NLayersMissed = iBooker.book1D(HistoName,
0265                                            HistoName,
0266                                            psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
0267                                            psTrack_NStubs.getParameter<double>("xmin"),
0268                                            psTrack_NStubs.getParameter<double>("xmax"));
0269   Track_All_NLayersMissed->setAxisTitle("# Layers missed", 1);
0270   Track_All_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
0271 
0272   edm::ParameterSet psTrack_Eta_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Eta_NStubs");
0273   HistoName = "Track_All_Eta_NStubs";
0274   Track_All_Eta_NStubs = iBooker.book2D(HistoName,
0275                                         HistoName,
0276                                         psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0277                                         psTrack_Eta_NStubs.getParameter<double>("xmin"),
0278                                         psTrack_Eta_NStubs.getParameter<double>("xmax"),
0279                                         psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0280                                         psTrack_Eta_NStubs.getParameter<double>("ymin"),
0281                                         psTrack_Eta_NStubs.getParameter<double>("ymax"));
0282   Track_All_Eta_NStubs->setAxisTitle("#eta", 1);
0283   Track_All_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
0284 
0285   // Pt of the tracks
0286   edm::ParameterSet psTrack_Pt = conf_.getParameter<edm::ParameterSet>("TH1_Track_Pt");
0287   HistoName = "Track_All_Pt";
0288   Track_All_Pt = iBooker.book1D(HistoName,
0289                                 HistoName,
0290                                 psTrack_Pt.getParameter<int32_t>("Nbinsx"),
0291                                 psTrack_Pt.getParameter<double>("xmin"),
0292                                 psTrack_Pt.getParameter<double>("xmax"));
0293   Track_All_Pt->setAxisTitle("p_{T} [GeV]", 1);
0294   Track_All_Pt->setAxisTitle("# L1 Tracks", 2);
0295 
0296   // Phi
0297   edm::ParameterSet psTrack_Phi = conf_.getParameter<edm::ParameterSet>("TH1_Track_Phi");
0298   HistoName = "Track_All_Phi";
0299   Track_All_Phi = iBooker.book1D(HistoName,
0300                                  HistoName,
0301                                  psTrack_Phi.getParameter<int32_t>("Nbinsx"),
0302                                  psTrack_Phi.getParameter<double>("xmin"),
0303                                  psTrack_Phi.getParameter<double>("xmax"));
0304   Track_All_Phi->setAxisTitle("#phi", 1);
0305   Track_All_Phi->setAxisTitle("# L1 Tracks", 2);
0306 
0307   // D0
0308   edm::ParameterSet psTrack_D0 = conf_.getParameter<edm::ParameterSet>("TH1_Track_D0");
0309   HistoName = "Track_All_D0";
0310   Track_All_D0 = iBooker.book1D(HistoName,
0311                                 HistoName,
0312                                 psTrack_D0.getParameter<int32_t>("Nbinsx"),
0313                                 psTrack_D0.getParameter<double>("xmin"),
0314                                 psTrack_D0.getParameter<double>("xmax"));
0315   Track_All_D0->setAxisTitle("Track D0", 1);
0316   Track_All_D0->setAxisTitle("# L1 Tracks", 2);
0317 
0318   // Eta
0319   edm::ParameterSet psTrack_Eta = conf_.getParameter<edm::ParameterSet>("TH1_Track_Eta");
0320   HistoName = "Track_All_Eta";
0321   Track_All_Eta = iBooker.book1D(HistoName,
0322                                  HistoName,
0323                                  psTrack_Eta.getParameter<int32_t>("Nbinsx"),
0324                                  psTrack_Eta.getParameter<double>("xmin"),
0325                                  psTrack_Eta.getParameter<double>("xmax"));
0326   Track_All_Eta->setAxisTitle("#eta", 1);
0327   Track_All_Eta->setAxisTitle("# L1 Tracks", 2);
0328 
0329   // VtxZ
0330   edm::ParameterSet psTrack_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1_Track_VtxZ");
0331   HistoName = "Track_All_VtxZ";
0332   Track_All_VtxZ = iBooker.book1D(HistoName,
0333                                   HistoName,
0334                                   psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
0335                                   psTrack_VtxZ.getParameter<double>("xmin"),
0336                                   psTrack_VtxZ.getParameter<double>("xmax"));
0337   Track_All_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
0338   Track_All_VtxZ->setAxisTitle("# L1 Tracks", 2);
0339 
0340   // chi2
0341   edm::ParameterSet psTrack_Chi2 = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2");
0342   HistoName = "Track_All_Chi2";
0343   Track_All_Chi2 = iBooker.book1D(HistoName,
0344                                   HistoName,
0345                                   psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0346                                   psTrack_Chi2.getParameter<double>("xmin"),
0347                                   psTrack_Chi2.getParameter<double>("xmax"));
0348   Track_All_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
0349   Track_All_Chi2->setAxisTitle("# L1 Tracks", 2);
0350 
0351   // chi2 r-z
0352   HistoName = "Track_All_Chi2RZ";
0353   Track_All_Chi2RZ = iBooker.book1D(HistoName,
0354                                     HistoName,
0355                                     psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0356                                     psTrack_Chi2.getParameter<double>("xmin"),
0357                                     psTrack_Chi2.getParameter<double>("xmax"));
0358   Track_All_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
0359   Track_All_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
0360 
0361   // chi2 r-phi
0362   HistoName = "Track_All_Chi2RPhi";
0363   Track_All_Chi2RPhi = iBooker.book1D(HistoName,
0364                                       HistoName,
0365                                       psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0366                                       psTrack_Chi2.getParameter<double>("xmin"),
0367                                       psTrack_Chi2.getParameter<double>("xmax"));
0368   Track_All_Chi2RPhi->setAxisTitle("L1 Track #chi^{2}", 1);
0369   Track_All_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
0370 
0371   // Bendchi2
0372   edm::ParameterSet psTrack_Chi2R = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
0373   HistoName = "Track_All_BendChi2";
0374   Track_All_BendChi2 = iBooker.book1D(HistoName,
0375                                       HistoName,
0376                                       psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
0377                                       psTrack_Chi2R.getParameter<double>("xmin"),
0378                                       psTrack_Chi2R.getParameter<double>("xmax"));
0379   Track_All_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
0380   Track_All_BendChi2->setAxisTitle("# L1 Tracks", 2);
0381 
0382   // chi2Red
0383   edm::ParameterSet psTrack_Chi2Red = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
0384   HistoName = "Track_All_Chi2Red";
0385   Track_All_Chi2Red = iBooker.book1D(HistoName,
0386                                      HistoName,
0387                                      psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
0388                                      psTrack_Chi2R.getParameter<double>("xmin"),
0389                                      psTrack_Chi2R.getParameter<double>("xmax"));
0390   Track_All_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
0391   Track_All_Chi2Red->setAxisTitle("# L1 Tracks", 2);
0392 
0393   // Chi2 prob
0394   edm::ParameterSet psTrack_Chi2_Probability = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2_Probability");
0395   HistoName = "Track_All_Chi2_Probability";
0396   Track_All_Chi2_Probability = iBooker.book1D(HistoName,
0397                                               HistoName,
0398                                               psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
0399                                               psTrack_Chi2_Probability.getParameter<double>("xmin"),
0400                                               psTrack_Chi2_Probability.getParameter<double>("xmax"));
0401   Track_All_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
0402   Track_All_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
0403 
0404   // MVA1 (prompt quality)
0405   edm::ParameterSet psTrack_MVA1 = conf_.getParameter<edm::ParameterSet>("TH1_Track_MVA1");
0406   HistoName = "Track_All_MVA1";
0407   Track_All_MVA1 = iBooker.book1D(HistoName,
0408                                   HistoName,
0409                                   psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
0410                                   psTrack_MVA1.getParameter<double>("xmin"),
0411                                   psTrack_MVA1.getParameter<double>("xmax"));
0412   Track_All_MVA1->setAxisTitle("MVA1", 1);
0413   Track_All_MVA1->setAxisTitle("# L1 Tracks", 2);
0414 
0415   // Reduced chi2 vs #stubs
0416   edm::ParameterSet psTrack_Chi2R_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_NStubs");
0417   HistoName = "Track_All_Chi2Red_NStubs";
0418   Track_All_Chi2Red_NStubs = iBooker.book2D(HistoName,
0419                                             HistoName,
0420                                             psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
0421                                             psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
0422                                             psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
0423                                             psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
0424                                             psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
0425                                             psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
0426   Track_All_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
0427   Track_All_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
0428 
0429   // chi2/dof vs eta
0430   edm::ParameterSet psTrack_Chi2R_Eta = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_Eta");
0431   HistoName = "Track_All_Chi2Red_Eta";
0432   Track_All_Chi2Red_Eta = iBooker.book2D(HistoName,
0433                                          HistoName,
0434                                          psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
0435                                          psTrack_Chi2R_Eta.getParameter<double>("xmin"),
0436                                          psTrack_Chi2R_Eta.getParameter<double>("xmax"),
0437                                          psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
0438                                          psTrack_Chi2R_Eta.getParameter<double>("ymin"),
0439                                          psTrack_Chi2R_Eta.getParameter<double>("ymax"));
0440   Track_All_Chi2Red_Eta->setAxisTitle("#eta", 1);
0441   Track_All_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
0442 
0443   // Eta vs #stubs in barrel
0444   HistoName = "Track_All_Eta_BarrelStubs";
0445   Track_All_Eta_BarrelStubs = iBooker.book2D(HistoName,
0446                                              HistoName,
0447                                              psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0448                                              psTrack_Eta_NStubs.getParameter<double>("xmin"),
0449                                              psTrack_Eta_NStubs.getParameter<double>("xmax"),
0450                                              psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0451                                              psTrack_Eta_NStubs.getParameter<double>("ymin"),
0452                                              psTrack_Eta_NStubs.getParameter<double>("ymax"));
0453   Track_All_Eta_BarrelStubs->setAxisTitle("#eta", 1);
0454   Track_All_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
0455 
0456   // Eta vs #stubs in EC
0457   HistoName = "Track_LQ_Eta_ECStubs";
0458   Track_All_Eta_ECStubs = iBooker.book2D(HistoName,
0459                                          HistoName,
0460                                          psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0461                                          psTrack_Eta_NStubs.getParameter<double>("xmin"),
0462                                          psTrack_Eta_NStubs.getParameter<double>("xmax"),
0463                                          psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0464                                          psTrack_Eta_NStubs.getParameter<double>("ymin"),
0465                                          psTrack_Eta_NStubs.getParameter<double>("ymax"));
0466   Track_All_Eta_ECStubs->setAxisTitle("#eta", 1);
0467   Track_All_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
0468 
0469   /// High-quality tracks (Bendchi2 < 2.2 and chi2/dof < 10)
0470   iBooker.setCurrentFolder(topFolderName_ + "/Tracks/HQ");
0471   // Nb of L1Tracks
0472   HistoName = "Track_HQ_N";
0473   Track_HQ_N = iBooker.book1D(HistoName,
0474                               HistoName,
0475                               psTrack_N.getParameter<int32_t>("Nbinsx"),
0476                               psTrack_N.getParameter<double>("xmin"),
0477                               psTrack_N.getParameter<double>("xmax"));
0478   Track_HQ_N->setAxisTitle("# L1 Tracks", 1);
0479   Track_HQ_N->setAxisTitle("# Events", 2);
0480 
0481   // Number of stubs
0482   HistoName = "Track_HQ_NStubs";
0483   Track_HQ_NStubs = iBooker.book1D(HistoName,
0484                                    HistoName,
0485                                    psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
0486                                    psTrack_NStubs.getParameter<double>("xmin"),
0487                                    psTrack_NStubs.getParameter<double>("xmax"));
0488   Track_HQ_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
0489   Track_HQ_NStubs->setAxisTitle("# L1 Tracks", 2);
0490 
0491   // Number of layers missed
0492   HistoName = "Track_HQ_NLayersMissed";
0493   Track_HQ_NLayersMissed = iBooker.book1D(HistoName,
0494                                           HistoName,
0495                                           psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
0496                                           psTrack_NStubs.getParameter<double>("xmin"),
0497                                           psTrack_NStubs.getParameter<double>("xmax"));
0498   Track_HQ_NLayersMissed->setAxisTitle("# Layers missed", 1);
0499   Track_HQ_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
0500 
0501   // Track eta vs #stubs
0502   HistoName = "Track_HQ_Eta_NStubs";
0503   Track_HQ_Eta_NStubs = iBooker.book2D(HistoName,
0504                                        HistoName,
0505                                        psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0506                                        psTrack_Eta_NStubs.getParameter<double>("xmin"),
0507                                        psTrack_Eta_NStubs.getParameter<double>("xmax"),
0508                                        psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0509                                        psTrack_Eta_NStubs.getParameter<double>("ymin"),
0510                                        psTrack_Eta_NStubs.getParameter<double>("ymax"));
0511   Track_HQ_Eta_NStubs->setAxisTitle("#eta", 1);
0512   Track_HQ_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
0513 
0514   // Pt of the tracks
0515   HistoName = "Track_HQ_Pt";
0516   Track_HQ_Pt = iBooker.book1D(HistoName,
0517                                HistoName,
0518                                psTrack_Pt.getParameter<int32_t>("Nbinsx"),
0519                                psTrack_Pt.getParameter<double>("xmin"),
0520                                psTrack_Pt.getParameter<double>("xmax"));
0521   Track_HQ_Pt->setAxisTitle("p_{T} [GeV]", 1);
0522   Track_HQ_Pt->setAxisTitle("# L1 Tracks", 2);
0523 
0524   // Phi
0525   HistoName = "Track_HQ_Phi";
0526   Track_HQ_Phi = iBooker.book1D(HistoName,
0527                                 HistoName,
0528                                 psTrack_Phi.getParameter<int32_t>("Nbinsx"),
0529                                 psTrack_Phi.getParameter<double>("xmin"),
0530                                 psTrack_Phi.getParameter<double>("xmax"));
0531   Track_HQ_Phi->setAxisTitle("#phi", 1);
0532   Track_HQ_Phi->setAxisTitle("# L1 Tracks", 2);
0533 
0534   // D0
0535   HistoName = "Track_HQ_D0";
0536   Track_HQ_D0 = iBooker.book1D(HistoName,
0537                                HistoName,
0538                                psTrack_D0.getParameter<int32_t>("Nbinsx"),
0539                                psTrack_D0.getParameter<double>("xmin"),
0540                                psTrack_D0.getParameter<double>("xmax"));
0541   Track_HQ_D0->setAxisTitle("Track D0", 1);
0542   Track_HQ_D0->setAxisTitle("# L1 Tracks", 2);
0543 
0544   // Eta
0545   HistoName = "Track_HQ_Eta";
0546   Track_HQ_Eta = iBooker.book1D(HistoName,
0547                                 HistoName,
0548                                 psTrack_Eta.getParameter<int32_t>("Nbinsx"),
0549                                 psTrack_Eta.getParameter<double>("xmin"),
0550                                 psTrack_Eta.getParameter<double>("xmax"));
0551   Track_HQ_Eta->setAxisTitle("#eta", 1);
0552   Track_HQ_Eta->setAxisTitle("# L1 Tracks", 2);
0553 
0554   // VtxZ
0555   HistoName = "Track_HQ_VtxZ";
0556   Track_HQ_VtxZ = iBooker.book1D(HistoName,
0557                                  HistoName,
0558                                  psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
0559                                  psTrack_VtxZ.getParameter<double>("xmin"),
0560                                  psTrack_VtxZ.getParameter<double>("xmax"));
0561   Track_HQ_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
0562   Track_HQ_VtxZ->setAxisTitle("# L1 Tracks", 2);
0563 
0564   // chi2
0565   HistoName = "Track_HQ_Chi2";
0566   Track_HQ_Chi2 = iBooker.book1D(HistoName,
0567                                  HistoName,
0568                                  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0569                                  psTrack_Chi2.getParameter<double>("xmin"),
0570                                  psTrack_Chi2.getParameter<double>("xmax"));
0571   Track_HQ_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
0572   Track_HQ_Chi2->setAxisTitle("# L1 Tracks", 2);
0573 
0574   // Bendchi2
0575   HistoName = "Track_HQ_BendChi2";
0576   Track_HQ_BendChi2 = iBooker.book1D(HistoName,
0577                                      HistoName,
0578                                      psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
0579                                      psTrack_Chi2R.getParameter<double>("xmin"),
0580                                      psTrack_Chi2R.getParameter<double>("xmax"));
0581   Track_HQ_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
0582   Track_HQ_BendChi2->setAxisTitle("# L1 Tracks", 2);
0583 
0584   // chi2 r-z
0585   HistoName = "Track_HQ_Chi2RZ";
0586   Track_HQ_Chi2RZ = iBooker.book1D(HistoName,
0587                                    HistoName,
0588                                    psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0589                                    psTrack_Chi2.getParameter<double>("xmin"),
0590                                    psTrack_Chi2.getParameter<double>("xmax"));
0591   Track_HQ_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
0592   Track_HQ_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
0593 
0594   HistoName = "Track_HQ_Chi2RPhi";
0595   Track_HQ_Chi2RPhi = iBooker.book1D(HistoName,
0596                                      HistoName,
0597                                      psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
0598                                      psTrack_Chi2.getParameter<double>("xmin"),
0599                                      psTrack_Chi2.getParameter<double>("xmax"));
0600   Track_HQ_Chi2RPhi->setAxisTitle("L1 Track #chi^{2} r-phi", 1);
0601   Track_HQ_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
0602 
0603   // chi2Red
0604   HistoName = "Track_HQ_Chi2Red";
0605   Track_HQ_Chi2Red = iBooker.book1D(HistoName,
0606                                     HistoName,
0607                                     psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
0608                                     psTrack_Chi2R.getParameter<double>("xmin"),
0609                                     psTrack_Chi2R.getParameter<double>("xmax"));
0610   Track_HQ_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
0611   Track_HQ_Chi2Red->setAxisTitle("# L1 Tracks", 2);
0612 
0613   // Chi2 prob
0614   HistoName = "Track_HQ_Chi2_Probability";
0615   Track_HQ_Chi2_Probability = iBooker.book1D(HistoName,
0616                                              HistoName,
0617                                              psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
0618                                              psTrack_Chi2_Probability.getParameter<double>("xmin"),
0619                                              psTrack_Chi2_Probability.getParameter<double>("xmax"));
0620   Track_HQ_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
0621   Track_HQ_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
0622 
0623   // MVA1 (prompt quality)
0624   HistoName = "Track_HQ_MVA1";
0625   Track_HQ_MVA1 = iBooker.book1D(HistoName,
0626                                  HistoName,
0627                                  psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
0628                                  psTrack_MVA1.getParameter<double>("xmin"),
0629                                  psTrack_MVA1.getParameter<double>("xmax"));
0630   Track_HQ_MVA1->setAxisTitle("MVA1", 1);
0631   Track_HQ_MVA1->setAxisTitle("# L1 Tracks", 2);
0632 
0633   // Reduced chi2 vs #stubs
0634   HistoName = "Track_HQ_Chi2Red_NStubs";
0635   Track_HQ_Chi2Red_NStubs = iBooker.book2D(HistoName,
0636                                            HistoName,
0637                                            psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
0638                                            psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
0639                                            psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
0640                                            psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
0641                                            psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
0642                                            psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
0643   Track_HQ_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
0644   Track_HQ_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
0645 
0646   // chi2/dof vs eta
0647   HistoName = "Track_HQ_Chi2Red_Eta";
0648   Track_HQ_Chi2Red_Eta = iBooker.book2D(HistoName,
0649                                         HistoName,
0650                                         psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
0651                                         psTrack_Chi2R_Eta.getParameter<double>("xmin"),
0652                                         psTrack_Chi2R_Eta.getParameter<double>("xmax"),
0653                                         psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
0654                                         psTrack_Chi2R_Eta.getParameter<double>("ymin"),
0655                                         psTrack_Chi2R_Eta.getParameter<double>("ymax"));
0656   Track_HQ_Chi2Red_Eta->setAxisTitle("#eta", 1);
0657   Track_HQ_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
0658 
0659   // eta vs #stubs in barrel
0660   HistoName = "Track_HQ_Eta_BarrelStubs";
0661   Track_HQ_Eta_BarrelStubs = iBooker.book2D(HistoName,
0662                                             HistoName,
0663                                             psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0664                                             psTrack_Eta_NStubs.getParameter<double>("xmin"),
0665                                             psTrack_Eta_NStubs.getParameter<double>("xmax"),
0666                                             psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0667                                             psTrack_Eta_NStubs.getParameter<double>("ymin"),
0668                                             psTrack_Eta_NStubs.getParameter<double>("ymax"));
0669   Track_HQ_Eta_BarrelStubs->setAxisTitle("#eta", 1);
0670   Track_HQ_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
0671 
0672   // eta vs #stubs in EC
0673   HistoName = "Track_HQ_Eta_ECStubs";
0674   Track_HQ_Eta_ECStubs = iBooker.book2D(HistoName,
0675                                         HistoName,
0676                                         psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
0677                                         psTrack_Eta_NStubs.getParameter<double>("xmin"),
0678                                         psTrack_Eta_NStubs.getParameter<double>("xmax"),
0679                                         psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
0680                                         psTrack_Eta_NStubs.getParameter<double>("ymin"),
0681                                         psTrack_Eta_NStubs.getParameter<double>("ymax"));
0682   Track_HQ_Eta_ECStubs->setAxisTitle("#eta", 1);
0683   Track_HQ_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
0684 
0685 }  // end of method
0686 
0687 DEFINE_FWK_MODULE(OuterTrackerMonitorTTTrack);