CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/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 
00073   MonitorElement* dttf_nTracks_integ;
00074   MonitorElement* dttf_occupancySummary;
00075   MonitorElement* dttf_bx_summary;
00076   MonitorElement* dttf_bx_integ;
00077   MonitorElement* dttf_eta_fine_integ;
00078   MonitorElement* dttf_quality_integ;
00079   MonitorElement* dttf_quality_summary;
00080   MonitorElement* dttf_highQual_Summary;
00081   MonitorElement* dttf_phi_eta_coarse_integ;
00082   MonitorElement* dttf_phi_eta_fine_integ;
00083   MonitorElement* dttf_phi_eta_integ;
00084   MonitorElement* dttf_eta_fine_fraction;
00085   MonitorElement* dttf_phi_integ;
00086   MonitorElement* dttf_pt_integ;
00087   MonitorElement* dttf_eta_integ;
00088   MonitorElement* dttf_q_integ;
00089 
00090   MonitorElement* dttf_gmt_matching;
00091   MonitorElement* dttf_2ndTrack_Summary;
00092 
00093 
00094   MonitorElement* dttf_nTracks_integ_2ndTrack;
00095   MonitorElement* dttf_occupancySummary_2ndTrack;
00096   MonitorElement* dttf_bx_summary_2ndTrack;
00097   MonitorElement* dttf_bx_integ_2ndTrack;
00098   MonitorElement* dttf_quality_integ_2ndTrack;
00099   MonitorElement* dttf_quality_summary_2ndTrack;
00100   MonitorElement* dttf_highQual_Summary_2ndTrack;
00101   MonitorElement* dttf_phi_eta_integ_2ndTrack;
00102   MonitorElement* dttf_eta_integ_2ndTrack;
00103   MonitorElement* dttf_phi_integ_2ndTrack;
00104   MonitorElement* dttf_pt_integ_2ndTrack;
00105   MonitorElement* dttf_q_integ_2ndTrack;
00106 
00107   MonitorElement* dttf_nTracks_wheel[6];
00108   MonitorElement* dttf_bx_wheel_summary[6];
00109   MonitorElement* dttf_bx_wheel_integ[6];
00110   MonitorElement* dttf_quality_wheel[6];
00111   MonitorElement* dttf_quality_summary_wheel[6];
00112   MonitorElement* dttf_fine_fraction_wh[6];
00113   MonitorElement* dttf_eta_wheel[6];
00114   MonitorElement* dttf_phi_wheel[6];
00115   MonitorElement* dttf_pt_wheel[6];
00116   MonitorElement* dttf_q_wheel[6];
00117 
00118   MonitorElement* dttf_nTracks_wheel_2ndTrack[6];
00119   MonitorElement* dttf_bx_wheel_summary_2ndTrack[6];
00120   MonitorElement* dttf_bx_wheel_integ_2ndTrack[6];
00121 
00122   TH1F * getTH1F(const char * hname);
00123   TH2F * getTH2F(const char * hname);
00124 
00125   void setMapLabel(MonitorElement *me);
00126 
00127   void buildHighQualityPlot( TH2F * occupancySummary,
00128                              MonitorElement * highQual_Summary,
00129                              const std::string & path );
00130 
00131   void buildPhiEtaPlotOFC( MonitorElement * phi_eta_fine_integ,
00132                            MonitorElement * phi_eta_coarse_integ,
00133                            MonitorElement * phi_eta_integ,
00134                            const std::string & path_fine,
00135                            const std::string & path_coarse,
00136                            int wh );
00137 
00138   void buildPhiEtaPlotO( MonitorElement * phi_eta_integ,
00139                          const std::string & path,
00140                          int wh );
00141 
00142 /*  void buildPhiEtaPlot( MonitorElement * phi_eta_integ, */
00143 /*                      const std::string & path, */
00144 /*                      int wh ); */
00145 
00146 /*   void buildPhiEtaPlotFC( MonitorElement * phi_eta_fine_integ, */
00147 /*                        MonitorElement * phi_eta_coarse_integ, */
00148 /*                        MonitorElement * phi_eta_integ, */
00149 /*                        const std::string & path_fine, */
00150 /*                        const std::string & path_coarse, */
00151 /*                        int wh ); */
00152 
00153   void buildSummaries();
00154   void setGMTsummary();
00155 
00156   void setWheelLabel(MonitorElement *me);
00157   void setQualLabel(MonitorElement *me, int axis);
00158 
00159   template<typename T>
00160     void normalize( T * me )
00161     {
00162       double scale = me->Integral();
00163       if ( scale > 0 ) {
00164         normalize( me, 1./scale, scale );
00165       }
00166     }
00167 
00168   template<typename T>
00169     void normalize( T * me, const double & scale )
00170     {
00171       normalize( me, scale, me->Integral() );
00172     }
00173 
00174 
00175   template<typename T>
00176     void normalize( T * me, const double & scale, const double & entries )
00177     {
00178       me->SetEntries( entries );
00179       me->Scale( scale );
00180     }
00181 
00182 
00183 
00184 };
00185 
00186 #endif