CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DQM/L1TMonitorClient/interface/L1TDTTFClient.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMONITORCLIENT_L1TDTTF_H
00002 #define DQM_L1TMONITORCLIENT_L1TDTTF_H
00003 
00004 // system include files
00005 #include <string>
00006 
00007 // user include files
00008 #include "FWCore/Framework/interface/EDAnalyzer.h"
00009 #include "FWCore/Framework/interface/Event.h"
00010 
00011 //
00012 // class declaration
00013 //
00014 
00015 class TH1F;
00016 class TH2F;
00017 class DQMStore;
00018 class MonitorElement;
00019 
00020 
00021 class L1TDTTFClient: public edm::EDAnalyzer {
00022 
00023 public:
00024 
00026   L1TDTTFClient(const edm::ParameterSet& ps);
00027   
00029   virtual ~L1TDTTFClient();
00030  
00031 protected:
00032 
00034   void beginJob(void);
00035 
00037   void beginRun(const edm::Run& r, const edm::EventSetup& c);
00038 
00040   void analyze(const edm::Event& e, const edm::EventSetup& c) ;
00041 
00042   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00043                             const edm::EventSetup& context) ;
00044 
00046   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00047                           const edm::EventSetup& c);
00048 
00050   void endRun(const edm::Run& r, const edm::EventSetup& c);
00051 
00053   void endJob();
00054 
00055   void makeSummary();
00056 
00057 private:
00058   
00059   std::string l1tdttffolder_;
00060   edm::InputTag dttfSource_;
00061   bool online_;
00062   bool verbose_;
00063   int resetafterlumi_;
00064   int counterLS_;      
00065   TH2F * occupancy_r_;
00066   DQMStore * dbe_;
00067 
00068   std::string wheel_[6];
00069   std::string wheelpath_[6];
00070   std::string inclusivepath_;
00071   std::string gmtpath_;
00072   std::string testpath_;
00073 
00074   MonitorElement* dttf_nTracks_integ;
00075   MonitorElement* dttf_occupancySummary;
00076   MonitorElement* dttf_bx_summary;
00077   MonitorElement* dttf_bx_integ;
00078   MonitorElement* dttf_eta_fine_integ;
00079   MonitorElement* dttf_quality_integ;
00080   MonitorElement* dttf_quality_summary;
00081   MonitorElement* dttf_highQual_Summary;
00082   MonitorElement* dttf_phi_eta_coarse_integ;
00083   MonitorElement* dttf_phi_eta_fine_integ;
00084   MonitorElement* dttf_phi_eta_integ;
00085   MonitorElement* dttf_eta_fine_fraction;
00086   MonitorElement* dttf_phi_integ;
00087   MonitorElement* dttf_pt_integ;
00088   MonitorElement* dttf_eta_integ;
00089   MonitorElement* dttf_q_integ;
00090 
00091   MonitorElement* dttf_gmt_matching;
00092   MonitorElement* dttf_2ndTrack_Summary;
00093 
00094   MonitorElement* dttf_occupancySummary_test;
00095 
00096   MonitorElement* dttf_nTracks_integ_2ndTrack;
00097   MonitorElement* dttf_occupancySummary_2ndTrack;
00098   MonitorElement* dttf_bx_summary_2ndTrack;
00099   MonitorElement* dttf_bx_integ_2ndTrack;
00100   MonitorElement* dttf_quality_integ_2ndTrack;
00101   MonitorElement* dttf_quality_summary_2ndTrack;
00102   MonitorElement* dttf_highQual_Summary_2ndTrack;
00103   MonitorElement* dttf_phi_eta_integ_2ndTrack;
00104   MonitorElement* dttf_eta_integ_2ndTrack;
00105   MonitorElement* dttf_phi_integ_2ndTrack;
00106   MonitorElement* dttf_pt_integ_2ndTrack;
00107   MonitorElement* dttf_q_integ_2ndTrack;
00108 
00109   MonitorElement* dttf_nTracks_wheel[6];
00110   MonitorElement* dttf_bx_wheel_summary[6];
00111   MonitorElement* dttf_bx_wheel_integ[6];
00112   MonitorElement* dttf_quality_wheel[6];
00113   MonitorElement* dttf_quality_summary_wheel[6];
00114   MonitorElement* dttf_fine_fraction_wh[6];
00115   MonitorElement* dttf_eta_wheel[6];
00116   MonitorElement* dttf_phi_wheel[6];
00117   MonitorElement* dttf_pt_wheel[6];
00118   MonitorElement* dttf_q_wheel[6];
00119 
00120   MonitorElement* dttf_nTracks_wheel_2ndTrack[6];
00121   MonitorElement* dttf_bx_wheel_summary_2ndTrack[6];
00122   MonitorElement* dttf_bx_wheel_integ_2ndTrack[6];
00123 
00124   TH1F * getTH1F(const char * hname);
00125   TH2F * getTH2F(const char * hname);
00126 
00127   void setMapLabel(MonitorElement *me);
00128 
00129   void buildHighQualityPlot( TH2F * occupancySummary,
00130                              MonitorElement * highQual_Summary,
00131                              const std::string & path );
00132 
00133   void buildPhiEtaPlotOFC( MonitorElement * phi_eta_fine_integ,
00134                            MonitorElement * phi_eta_coarse_integ,
00135                            MonitorElement * phi_eta_integ,
00136                            const std::string & path_fine,
00137                            const std::string & path_coarse,
00138                            int wh );
00139 
00140   void buildPhiEtaPlotO( MonitorElement * phi_eta_integ,
00141                          const std::string & path,
00142                          int wh );
00143 
00144 /*  void buildPhiEtaPlot( MonitorElement * phi_eta_integ, */
00145 /*                      const std::string & path, */
00146 /*                      int wh ); */
00147 
00148 /*   void buildPhiEtaPlotFC( MonitorElement * phi_eta_fine_integ, */
00149 /*                        MonitorElement * phi_eta_coarse_integ, */
00150 /*                        MonitorElement * phi_eta_integ, */
00151 /*                        const std::string & path_fine, */
00152 /*                        const std::string & path_coarse, */
00153 /*                        int wh ); */
00154 
00155   void buildSummaries();
00156   void setGMTsummary();
00157 
00158   void setWheelLabel(MonitorElement *me);
00159   void setQualLabel(MonitorElement *me, int axis);
00160 
00161   template<typename T>
00162     void normalize( T * me )
00163     {
00164       double scale = me->Integral();
00165       if ( scale > 0 ) {
00166         normalize( me, 1./scale, scale );
00167       }
00168     }
00169 
00170   template<typename T>
00171     void normalize( T * me, const double & scale )
00172     {
00173       normalize( me, scale, me->Integral() );
00174     }
00175 
00176 
00177   template<typename T>
00178     void normalize( T * me, const double & scale, const double & entries )
00179     {
00180       me->SetEntries( entries );
00181       me->Scale( scale );
00182     }
00183 
00184 
00185 
00186 };
00187 
00188 #endif