CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/DQM/TrackingMonitor/interface/TrackAnalyzer.h

Go to the documentation of this file.
00001 #ifndef TrackAnalyzer_H
00002 #define TrackAnalyzer_H
00003 // -*- C++ -*-
00004 //
00005 // 
00009 // Original Author:  Suchandra Dutta, Giorgia Mila
00010 //         Created:  Thu 28 22:45:30 CEST 2008
00011 // $Id: TrackAnalyzer.h,v 1.11 2011/10/25 09:11:42 borrell Exp $
00012 
00013 #include <memory>
00014 #include <fstream>
00015 #include "FWCore/Framework/interface/Frameworkfwd.h"
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "FWCore/Framework/interface/MakerMacros.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "FWCore/ServiceRegistry/interface/Service.h"
00021 #include "DQMServices/Core/interface/MonitorElement.h"
00022 
00023 
00024 class DQMStore;
00025 
00026 class TrackAnalyzer 
00027 {
00028     public:
00029         TrackAnalyzer(const edm::ParameterSet&);
00030         virtual ~TrackAnalyzer();
00031         virtual void beginJob(DQMStore * dqmStore_);
00032 
00033         virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track);
00034 
00035         void doSoftReset(DQMStore * dqmStore_);
00036         void undoSoftReset(DQMStore * dqmStore_);
00037         void setLumiFlag();
00038 
00039     private:
00040 
00041         void fillHistosForState(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
00042         void bookHistosForState(std::string sname, DQMStore * dqmStore_);
00043         void doTrackerSpecificInitialization(DQMStore * dqmStore_);
00044         void doTrackerSpecificFillHists(const reco::Track & track);
00045 
00046         // ----------member data ---------------------------
00047 
00048         edm::ParameterSet conf_;
00049 
00050         bool doTrackerSpecific_;
00051         bool doAllPlots_;
00052         bool doBSPlots_;
00053         bool doGoodTrackPlots_;
00054         bool doDCAPlots_;
00055         bool doGeneralPropertiesPlots_;
00056         bool doMeasurementStatePlots_;
00057         bool doHitPropertiesPlots_;
00058         bool doRecHitVsPhiVsEtaPerTrack_;
00059         bool doGoodTrackRecHitVsPhiVsEtaPerTrack_;
00060 
00061         MonitorElement* NumberOfRecHitsPerTrack;
00062         MonitorElement* NumberOfRecHitsFoundPerTrack;
00063         MonitorElement* NumberOfRecHitsLostPerTrack;
00064         MonitorElement* NumberOfLayersPerTrack;
00065         MonitorElement* NumberOfRecHitVsPhiVsEtaPerTrack;
00066         MonitorElement* GoodTrackNumberOfRecHitVsPhiVsEtaPerTrack;
00067         MonitorElement* Chi2;
00068         MonitorElement* Chi2Prob;
00069         MonitorElement* Chi2oNDF;
00070         MonitorElement* DistanceOfClosestApproach;
00071         MonitorElement* DistanceOfClosestApproachToBS;
00072         MonitorElement* DistanceOfClosestApproachVsTheta;
00073         MonitorElement* DistanceOfClosestApproachVsPhi;
00074         MonitorElement* DistanceOfClosestApproachToBSVsPhi;
00075         MonitorElement* DistanceOfClosestApproachVsEta;
00076         MonitorElement* xPointOfClosestApproach;
00077         MonitorElement* xPointOfClosestApproachVsZ0;
00078         MonitorElement* yPointOfClosestApproach;
00079         MonitorElement* yPointOfClosestApproachVsZ0;
00080         MonitorElement* zPointOfClosestApproach;
00081         MonitorElement* algorithm;
00082 
00083         MonitorElement* NumberOfTOBRecHitsPerTrack;
00084         MonitorElement* NumberOfTOBRecHitsPerTrackVsPhiProfile;
00085         MonitorElement* NumberOfTOBRecHitsPerTrackVsEtaProfile;
00086         MonitorElement* NumberOfTOBLayersPerTrack;
00087         MonitorElement* NumberOfTOBLayersPerTrackVsPhiProfile;
00088         MonitorElement* NumberOfTOBLayersPerTrackVsEtaProfile;
00089 
00090         MonitorElement* NumberOfTIBRecHitsPerTrack;
00091         MonitorElement* NumberOfTIBRecHitsPerTrackVsPhiProfile;
00092         MonitorElement* NumberOfTIBRecHitsPerTrackVsEtaProfile;
00093         MonitorElement* NumberOfTIBLayersPerTrack;
00094         MonitorElement* NumberOfTIBLayersPerTrackVsPhiProfile;
00095         MonitorElement* NumberOfTIBLayersPerTrackVsEtaProfile;
00096 
00097         MonitorElement* NumberOfTIDRecHitsPerTrack;
00098         MonitorElement* NumberOfTIDRecHitsPerTrackVsPhiProfile;
00099         MonitorElement* NumberOfTIDRecHitsPerTrackVsEtaProfile;
00100         MonitorElement* NumberOfTIDLayersPerTrack;
00101         MonitorElement* NumberOfTIDLayersPerTrackVsPhiProfile;
00102         MonitorElement* NumberOfTIDLayersPerTrackVsEtaProfile;
00103 
00104         MonitorElement* NumberOfTECRecHitsPerTrack;
00105         MonitorElement* NumberOfTECRecHitsPerTrackVsPhiProfile;
00106         MonitorElement* NumberOfTECRecHitsPerTrackVsEtaProfile;
00107         MonitorElement* NumberOfTECLayersPerTrack;
00108         MonitorElement* NumberOfTECLayersPerTrackVsPhiProfile;
00109         MonitorElement* NumberOfTECLayersPerTrackVsEtaProfile;
00110 
00111         MonitorElement* NumberOfPixBarrelRecHitsPerTrack;
00112         MonitorElement* NumberOfPixBarrelRecHitsPerTrackVsPhiProfile;
00113         MonitorElement* NumberOfPixBarrelRecHitsPerTrackVsEtaProfile;
00114         MonitorElement* NumberOfPixBarrelLayersPerTrack;
00115         MonitorElement* NumberOfPixBarrelLayersPerTrackVsPhiProfile;
00116         MonitorElement* NumberOfPixBarrelLayersPerTrackVsEtaProfile;
00117 
00118         MonitorElement* NumberOfPixEndcapRecHitsPerTrack;
00119         MonitorElement* NumberOfPixEndcapRecHitsPerTrackVsPhiProfile;
00120         MonitorElement* NumberOfPixEndcapRecHitsPerTrackVsEtaProfile;
00121         MonitorElement* NumberOfPixEndcapLayersPerTrack;
00122         MonitorElement* NumberOfPixEndcapLayersPerTrackVsPhiProfile;
00123         MonitorElement* NumberOfPixEndcapLayersPerTrackVsEtaProfile;
00124 
00125         MonitorElement* GoodTrackChi2oNDF;
00126         MonitorElement* GoodTrackNumberOfRecHitsPerTrack;
00127 
00128         struct TkParameterMEs 
00129         {
00130             TkParameterMEs()
00131                 : TrackP(NULL)
00132                 , TrackPx(NULL)
00133                 , TrackPy(NULL)
00134                 , TrackPz(NULL)
00135                 , TrackPt(NULL)
00136 
00137                 , TrackPxErr(NULL)
00138                 , TrackPyErr(NULL)
00139                 , TrackPzErr(NULL)
00140                 , TrackPtErr(NULL)
00141                 , TrackPErr(NULL)
00142 
00143                 , TrackQ(NULL)
00144 
00145                 , TrackPhi(NULL)
00146                 , TrackEta(NULL)
00147                 , TrackTheta(NULL)
00148 
00149                 , TrackPhiErr(NULL)
00150                 , TrackEtaErr(NULL)
00151                 , TrackThetaErr(NULL)
00152 
00153                 , NumberOfRecHitsPerTrackVsPhi(NULL)
00154                 , NumberOfRecHitsPerTrackVsTheta(NULL)
00155                 , NumberOfRecHitsPerTrackVsEta(NULL)
00156                 , NumberOfRecHitsPerTrackVsPhiProfile(NULL)
00157                 , NumberOfRecHitsPerTrackVsThetaProfile(NULL)
00158                 , NumberOfRecHitsPerTrackVsEtaProfile(NULL)
00159                 , NumberOfLayersPerTrackVsPhi(NULL)
00160                 , NumberOfLayersPerTrackVsTheta(NULL)
00161                 , NumberOfLayersPerTrackVsEta(NULL)
00162                 , NumberOfLayersPerTrackVsPhiProfile(NULL)
00163                 , NumberOfLayersPerTrackVsThetaProfile(NULL)
00164                 , NumberOfLayersPerTrackVsEtaProfile(NULL)
00165 
00166                 , Chi2oNDFVsTheta(NULL)
00167                 , Chi2oNDFVsPhi(NULL)
00168                 , Chi2oNDFVsEta(NULL)
00169                 , Chi2oNDFVsThetaProfile(NULL)
00170                 , Chi2oNDFVsPhiProfile(NULL)
00171                 , Chi2oNDFVsEtaProfile(NULL)
00172 
00173                 , GoodTrackPt(NULL)
00174                 , GoodTrackEta(NULL)
00175                 , GoodTrackPhi(NULL)
00176             {}
00177 
00178             MonitorElement* TrackP;
00179             MonitorElement* TrackPx;
00180             MonitorElement* TrackPy;
00181             MonitorElement* TrackPz;
00182             MonitorElement* TrackPt;
00183 
00184             MonitorElement* TrackPxErr;
00185             MonitorElement* TrackPyErr;
00186             MonitorElement* TrackPzErr;
00187             MonitorElement* TrackPtErr;
00188             MonitorElement* TrackPErr;
00189 
00190             MonitorElement* TrackQ;
00191 
00192             MonitorElement* TrackPhi;
00193             MonitorElement* TrackEta;
00194             MonitorElement* TrackTheta;
00195 
00196             MonitorElement* TrackPhiErr;
00197             MonitorElement* TrackEtaErr;
00198             MonitorElement* TrackThetaErr;
00199 
00200             MonitorElement* NumberOfRecHitsPerTrackVsPhi;
00201             MonitorElement* NumberOfRecHitsPerTrackVsTheta;
00202             MonitorElement* NumberOfRecHitsPerTrackVsEta;
00203             MonitorElement* NumberOfRecHitsPerTrackVsPhiProfile;
00204             MonitorElement* NumberOfRecHitsPerTrackVsThetaProfile;
00205             MonitorElement* NumberOfRecHitsPerTrackVsEtaProfile;
00206             MonitorElement* NumberOfLayersPerTrackVsPhi;
00207             MonitorElement* NumberOfLayersPerTrackVsTheta;
00208             MonitorElement* NumberOfLayersPerTrackVsEta;
00209             MonitorElement* NumberOfLayersPerTrackVsPhiProfile;
00210             MonitorElement* NumberOfLayersPerTrackVsThetaProfile;
00211             MonitorElement* NumberOfLayersPerTrackVsEtaProfile;
00212 
00213             MonitorElement* Chi2oNDFVsTheta;
00214             MonitorElement* Chi2oNDFVsPhi;
00215             MonitorElement* Chi2oNDFVsEta;
00216             MonitorElement* Chi2oNDFVsThetaProfile;
00217             MonitorElement* Chi2oNDFVsPhiProfile;
00218             MonitorElement* Chi2oNDFVsEtaProfile;
00219 
00220             MonitorElement* GoodTrackPt;
00221             MonitorElement* GoodTrackEta;
00222             MonitorElement* GoodTrackPhi;
00223         };
00224 
00225         std::map<std::string, TkParameterMEs> TkParameterMEMap;
00226 
00227         std::string histname;  //for naming the histograms according to algorithm used
00228 };
00229 #endif