Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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