CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/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.16 2012/04/27 15:56:48 tosi 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 doReset      (DQMStore * dqmStore_);
00037         void undoSoftReset(DQMStore * dqmStore_);
00038         void setLumiFlag();
00039 
00040     private:
00041 
00042         void fillHistosForState(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
00043         void bookHistosForState(std::string sname, DQMStore * dqmStore_);
00044         void doTrackerSpecificInitialization(DQMStore * dqmStore_);
00045         void doTrackerSpecificFillHists(const reco::Track & track);
00046 
00047         // ----------member data ---------------------------
00048 
00049         edm::ParameterSet conf_;
00050 
00051         bool doTrackerSpecific_;
00052         bool doAllPlots_;
00053         bool doBSPlots_;
00054         bool doGoodTrackPlots_;
00055         bool doDCAPlots_;
00056         bool doGeneralPropertiesPlots_;
00057         bool doMeasurementStatePlots_;
00058         bool doHitPropertiesPlots_;
00059         bool doRecHitVsPhiVsEtaPerTrack_;
00060         // ADD by Mia
00061         bool doLayersVsPhiVsEtaPerTrack_;
00062         bool doGoodTrackRecHitVsPhiVsEtaPerTrack_;
00063         bool doGoodTrackLayersVsPhiVsEtaPerTrack_;
00064         bool doGoodTrack2DChi2Plots_;
00065 
00066         // ADD by Mia in order to clean the tracking MEs
00067         // do not plot *Theta* and TrackPx* and TrackPy*
00068         bool doThetaPlots_;
00069         bool doTrackPxPyPlots_;
00070         // ADD by Mia in order to not plot DistanceOfClosestApproach w.r.t. (0,0,0)
00071         // the DistanceOfClosestApproach w.r.t. the beam-spot is already shown in DistanceOfClosestApproachToBS
00072         bool doDCAwrt000Plots_;
00073 
00074         bool doLumiAnalysis_;
00075 
00076         // ADD by Mia in order to turnON test MEs
00077         bool doTestPlots_;
00078 
00079         MonitorElement* NumberOfRecHitsPerTrack;
00080         MonitorElement* NumberOfRecHitsFoundPerTrack;
00081         MonitorElement* NumberOfRecHitsLostPerTrack;
00082         MonitorElement* NumberOfLayersPerTrack;
00083         MonitorElement* NumberOfRecHitVsPhiVsEtaPerTrack;
00084         MonitorElement* NumberOfLayersVsPhiVsEtaPerTrack;
00085         MonitorElement* Chi2;
00086         MonitorElement* Chi2Prob;
00087         MonitorElement* Chi2oNDF;
00088         MonitorElement* DistanceOfClosestApproach;
00089         MonitorElement* DistanceOfClosestApproachToBS;
00090         MonitorElement* DistanceOfClosestApproachVsTheta;
00091         MonitorElement* DistanceOfClosestApproachVsPhi;
00092         MonitorElement* DistanceOfClosestApproachToBSVsPhi;
00093         MonitorElement* DistanceOfClosestApproachVsEta;
00094         MonitorElement* xPointOfClosestApproach;
00095         MonitorElement* xPointOfClosestApproachVsZ0wrt000;
00096         MonitorElement* xPointOfClosestApproachVsZ0wrtBS;
00097         MonitorElement* yPointOfClosestApproach;
00098         MonitorElement* yPointOfClosestApproachVsZ0wrt000;
00099         MonitorElement* yPointOfClosestApproachVsZ0wrtBS;
00100         MonitorElement* zPointOfClosestApproach;
00101         MonitorElement* zPointOfClosestApproachVsPhi;
00102         MonitorElement* algorithm;
00103         // TESTING MEs
00104         MonitorElement* TESTDistanceOfClosestApproachToBS;
00105         MonitorElement* TESTDistanceOfClosestApproachToBSVsPhi;
00106 
00107         // add by Mia in order to deal w/ LS transitions
00108         MonitorElement* Chi2oNDF_lumiFlag;
00109         MonitorElement* NumberOfRecHitsPerTrack_lumiFlag;
00110         MonitorElement* GoodTrackChi2oNDF_lumiFlag;
00111         MonitorElement* GoodTrackNumberOfRecHitsPerTrack_lumiFlag;
00112 
00113         MonitorElement* NumberOfTOBRecHitsPerTrack;
00114         MonitorElement* NumberOfTOBRecHitsPerTrackVsPhiProfile;
00115         MonitorElement* NumberOfTOBRecHitsPerTrackVsEtaProfile;
00116         MonitorElement* NumberOfTOBLayersPerTrack;
00117         MonitorElement* NumberOfTOBLayersPerTrackVsPhiProfile;
00118         MonitorElement* NumberOfTOBLayersPerTrackVsEtaProfile;
00119 
00120         MonitorElement* NumberOfTIBRecHitsPerTrack;
00121         MonitorElement* NumberOfTIBRecHitsPerTrackVsPhiProfile;
00122         MonitorElement* NumberOfTIBRecHitsPerTrackVsEtaProfile;
00123         MonitorElement* NumberOfTIBLayersPerTrack;
00124         MonitorElement* NumberOfTIBLayersPerTrackVsPhiProfile;
00125         MonitorElement* NumberOfTIBLayersPerTrackVsEtaProfile;
00126 
00127         MonitorElement* NumberOfTIDRecHitsPerTrack;
00128         MonitorElement* NumberOfTIDRecHitsPerTrackVsPhiProfile;
00129         MonitorElement* NumberOfTIDRecHitsPerTrackVsEtaProfile;
00130         MonitorElement* NumberOfTIDLayersPerTrack;
00131         MonitorElement* NumberOfTIDLayersPerTrackVsPhiProfile;
00132         MonitorElement* NumberOfTIDLayersPerTrackVsEtaProfile;
00133 
00134         MonitorElement* NumberOfTECRecHitsPerTrack;
00135         MonitorElement* NumberOfTECRecHitsPerTrackVsPhiProfile;
00136         MonitorElement* NumberOfTECRecHitsPerTrackVsEtaProfile;
00137         MonitorElement* NumberOfTECLayersPerTrack;
00138         MonitorElement* NumberOfTECLayersPerTrackVsPhiProfile;
00139         MonitorElement* NumberOfTECLayersPerTrackVsEtaProfile;
00140 
00141         MonitorElement* NumberOfPixBarrelRecHitsPerTrack;
00142         MonitorElement* NumberOfPixBarrelRecHitsPerTrackVsPhiProfile;
00143         MonitorElement* NumberOfPixBarrelRecHitsPerTrackVsEtaProfile;
00144         MonitorElement* NumberOfPixBarrelLayersPerTrack;
00145         MonitorElement* NumberOfPixBarrelLayersPerTrackVsPhiProfile;
00146         MonitorElement* NumberOfPixBarrelLayersPerTrackVsEtaProfile;
00147 
00148         MonitorElement* NumberOfPixEndcapRecHitsPerTrack;
00149         MonitorElement* NumberOfPixEndcapRecHitsPerTrackVsPhiProfile;
00150         MonitorElement* NumberOfPixEndcapRecHitsPerTrackVsEtaProfile;
00151         MonitorElement* NumberOfPixEndcapLayersPerTrack;
00152         MonitorElement* NumberOfPixEndcapLayersPerTrackVsPhiProfile;
00153         MonitorElement* NumberOfPixEndcapLayersPerTrackVsEtaProfile;
00154 
00155         MonitorElement* GoodTrackNumberOfRecHitVsPhiVsEtaPerTrack;
00156         MonitorElement* GoodTrackNumberOfLayersVsPhiVsEtaPerTrack;
00157         MonitorElement* GoodTrackNumberOfRecHitsPerTrackVsPhiProfile;
00158         MonitorElement* GoodTrackNumberOfRecHitsPerTrackVsEtaProfile;
00159         MonitorElement* GoodTrackNumberOfFoundRecHitsPerTrackVsPhiProfile;
00160         MonitorElement* GoodTrackNumberOfFoundRecHitsPerTrackVsEtaProfile;
00161         MonitorElement* GoodTrackChi2oNDF;
00162         MonitorElement* GoodTrackChi2Prob;
00163         MonitorElement* GoodTrackChi2oNDFVsPhi;
00164         MonitorElement* GoodTrackChi2ProbVsPhi;
00165         MonitorElement* GoodTrackChi2oNDFVsEta;
00166         MonitorElement* GoodTrackChi2ProbVsEta;
00167         MonitorElement* GoodTrackNumberOfRecHitsPerTrack;
00168         MonitorElement* GoodTrackNumberOfFoundRecHitsPerTrack;
00169         MonitorElement* GoodTrackAlgorithm;
00170 
00171         struct TkParameterMEs 
00172         {
00173             TkParameterMEs()
00174                 : TrackP(NULL)
00175                 , TrackPx(NULL)
00176                 , TrackPy(NULL)
00177                 , TrackPz(NULL)
00178                 , TrackPt(NULL)
00179 
00180                 , TrackPxErr(NULL)
00181                 , TrackPyErr(NULL)
00182                 , TrackPzErr(NULL)
00183                 , TrackPtErr(NULL)
00184                 , TrackPErr(NULL)
00185 
00186                 , TrackPtErrVsEta(NULL)
00187 
00188                 , TrackQ(NULL)
00189 
00190                 , TrackPhi(NULL)
00191                 , TrackEta(NULL)
00192                 , TrackTheta(NULL)
00193 
00194                 , TrackPhiErr(NULL)
00195                 , TrackEtaErr(NULL)
00196                 , TrackThetaErr(NULL)
00197 
00198                 , NumberOfRecHitsPerTrackVsPhi(NULL)
00199                 , NumberOfRecHitsPerTrackVsTheta(NULL)
00200                 , NumberOfRecHitsPerTrackVsEta(NULL)
00201                 , NumberOfRecHitsPerTrackVsPhiProfile(NULL)
00202                 , NumberOfRecHitsPerTrackVsThetaProfile(NULL)
00203                 , NumberOfRecHitsPerTrackVsEtaProfile(NULL)
00204                 , NumberOfLayersPerTrackVsPhi(NULL)
00205                 , NumberOfLayersPerTrackVsTheta(NULL)
00206                 , NumberOfLayersPerTrackVsEta(NULL)
00207                 , NumberOfLayersPerTrackVsPhiProfile(NULL)
00208                 , NumberOfLayersPerTrackVsThetaProfile(NULL)
00209                 , NumberOfLayersPerTrackVsEtaProfile(NULL)
00210 
00211                 , Chi2oNDFVsTheta(NULL)
00212                 , Chi2oNDFVsPhi(NULL)
00213                 , Chi2oNDFVsEta(NULL)
00214                 , Chi2oNDFVsThetaProfile(NULL)
00215                 , Chi2oNDFVsPhiProfile(NULL)
00216                 , Chi2oNDFVsEtaProfile(NULL)
00217 
00218                 , GoodTrackPt(NULL)
00219                 , GoodTrackEta(NULL)
00220                 , GoodTrackPhi(NULL)
00221             {}
00222 
00223             MonitorElement* TrackP;
00224             MonitorElement* TrackPx;
00225             MonitorElement* TrackPy;
00226             MonitorElement* TrackPz;
00227             MonitorElement* TrackPt;
00228 
00229             MonitorElement* TrackPxErr;
00230             MonitorElement* TrackPyErr;
00231             MonitorElement* TrackPzErr;
00232             MonitorElement* TrackPtErr;
00233             MonitorElement* TrackPErr;
00234 
00235             MonitorElement* TrackPtErrVsEta;
00236 
00237             MonitorElement* TrackQ;
00238 
00239             MonitorElement* TrackPhi;
00240             MonitorElement* TrackEta;
00241             MonitorElement* TrackTheta;
00242 
00243             MonitorElement* TrackPhiErr;
00244             MonitorElement* TrackEtaErr;
00245             MonitorElement* TrackThetaErr;
00246 
00247             MonitorElement* NumberOfRecHitsPerTrackVsPhi;
00248             MonitorElement* NumberOfRecHitsPerTrackVsTheta;
00249             MonitorElement* NumberOfRecHitsPerTrackVsEta;
00250             MonitorElement* NumberOfRecHitsPerTrackVsPhiProfile;
00251             MonitorElement* NumberOfRecHitsPerTrackVsThetaProfile;
00252             MonitorElement* NumberOfRecHitsPerTrackVsEtaProfile;
00253             MonitorElement* NumberOfLayersPerTrackVsPhi;
00254             MonitorElement* NumberOfLayersPerTrackVsTheta;
00255             MonitorElement* NumberOfLayersPerTrackVsEta;
00256             MonitorElement* NumberOfLayersPerTrackVsPhiProfile;
00257             MonitorElement* NumberOfLayersPerTrackVsThetaProfile;
00258             MonitorElement* NumberOfLayersPerTrackVsEtaProfile;
00259 
00260             MonitorElement* Chi2oNDFVsTheta;
00261             MonitorElement* Chi2oNDFVsPhi;
00262             MonitorElement* Chi2oNDFVsEta;
00263             MonitorElement* Chi2oNDFVsThetaProfile;
00264             MonitorElement* Chi2oNDFVsPhiProfile;
00265             MonitorElement* Chi2oNDFVsEtaProfile;
00266 
00267             MonitorElement* GoodTrackPt;
00268             MonitorElement* GoodTrackEta;
00269             MonitorElement* GoodTrackPhi;
00270         };
00271 
00272         std::map<std::string, TkParameterMEs> TkParameterMEMap;
00273 
00274         std::string histname;  //for naming the histograms according to algorithm used
00275 };
00276 #endif