CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h

Go to the documentation of this file.
00001 #ifndef SiStripMonitorCluster_SiStripMonitorCluster_h
00002 #define SiStripMonitorCluster_SiStripMonitorCluster_h
00003 // -*- C++ -*-
00004 // Package:     SiStripMonitorCluster
00005 // Class  :     SiStripMonitorCluster
00009 // Original Author:  dkcira
00010 //         Created:  Wed Feb  1 16:47:14 CET 2006
00011 // $Id: SiStripMonitorCluster.h,v 1.40 2012/04/17 18:50:29 threus Exp $
00012 #include <memory>
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/MakerMacros.h"
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019 #include "DataFormats/Common/interface/DetSetVector.h"
00020 #include "DQMServices/Core/interface/MonitorElement.h"
00021 #include "DQM/SiStripCommon/interface/TkHistoMap.h"
00022 
00023 #include <vector>
00024 
00025 class DQMStore;
00026 class SiStripDetCabling;
00027 class SiStripCluster;
00028 class SiStripDCSStatus;
00029 
00030 class SiStripMonitorCluster : public edm::EDAnalyzer {
00031  public:
00032   explicit SiStripMonitorCluster(const edm::ParameterSet&);
00033   ~SiStripMonitorCluster();
00034   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00035   //virtual void beginJob() ;
00036   virtual void endJob() ;
00037   virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00038 
00039   struct ModMEs{ // MEs for one single detector module
00040 
00041     MonitorElement* NumberOfClusters;
00042     MonitorElement* ClusterPosition;
00043     MonitorElement* ClusterDigiPosition;
00044     MonitorElement* ClusterWidth;
00045     MonitorElement* ClusterCharge;
00046     MonitorElement* ClusterNoise;
00047     MonitorElement* ClusterSignalOverNoise;
00048     MonitorElement* ClusterSignalOverNoiseVsPos;
00049     MonitorElement* ModuleLocalOccupancy;
00050     MonitorElement* NrOfClusterizedStrips; // can be used at client level for occupancy calculations
00051   };
00052 
00053   struct LayerMEs{ // MEs for Layer Level
00054     MonitorElement* LayerClusterStoN;
00055     MonitorElement* LayerClusterStoNTrend;
00056     MonitorElement* LayerClusterCharge;
00057     MonitorElement* LayerClusterChargeTrend;
00058     MonitorElement* LayerClusterNoise;
00059     MonitorElement* LayerClusterNoiseTrend;
00060     MonitorElement* LayerClusterWidth;
00061     MonitorElement* LayerClusterWidthTrend;
00062     MonitorElement* LayerLocalOccupancy;
00063     MonitorElement* LayerLocalOccupancyTrend;
00064     MonitorElement* LayerNumberOfClusterProfile;
00065     MonitorElement* LayerClusterWidthProfile;
00066 
00067   };
00068 
00069   struct SubDetMEs{ // MEs for Subdetector Level
00070     int totNClusters; 
00071     MonitorElement* SubDetTotClusterTH1;
00072     MonitorElement* SubDetTotClusterProf;
00073     MonitorElement* SubDetClusterApvProf;
00074     MonitorElement* SubDetClusterApvTH2;
00075     MonitorElement* SubDetClusterDBxCycleProf;
00076     MonitorElement* SubDetApvDBxProf2;
00077   };
00078 
00079   struct ClusterProperties { // Cluster Properties
00080     float charge;
00081     float position;
00082     short start;
00083     short width;
00084     float noise;
00085   };
00086 
00087   MonitorElement* GlobalApvCycleDBxTH2; 
00088   MonitorElement* GlobalCStripVsCpix;
00089   MonitorElement* PixVsStripMultiplicityRegions;
00090   MonitorElement* GlobalMainDiagonalPosition;
00091   MonitorElement* StripNoise2Cycle;
00092   MonitorElement* StripNoise3Cycle;
00093   MonitorElement* NumberOfPixelClus;
00094   MonitorElement* NumberOfStripClus;
00095 
00096  private:
00097 
00098   void createMEs(const edm::EventSetup& es);
00099   void createLayerMEs(std::string label, int ndets);
00100   void createModuleMEs(ModMEs& mod_single, uint32_t detid);
00101   void createSubDetMEs(std::string label);
00102   int FindRegion(int nstrip,int npixel);
00103   void fillModuleMEs(ModMEs& mod_mes, ClusterProperties& cluster);
00104   void fillLayerMEs(LayerMEs&, ClusterProperties& cluster, float timeinorbit);
00105 
00106   void ResetModuleMEs(uint32_t idet);
00107 
00108   inline void fillME(MonitorElement* ME,float value1){if (ME!=0)ME->Fill(value1);}
00109   inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=0)ME->Fill(value1,value2);}
00110   inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=0)ME->Fill(value1,value2,value3);}
00111   inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);}
00112   MonitorElement * bookMETrend(const char*, const char*);
00113   MonitorElement* bookME1D(const char* ParameterSetLabel, const char* HistoName);
00114 
00115  private:
00116   DQMStore* dqmStore_;
00117   edm::ParameterSet conf_;
00118   std::map<uint32_t, ModMEs> ModuleMEsMap;
00119   std::map<std::string, LayerMEs> LayerMEsMap;
00120   std::map<std::string, std::vector< uint32_t > > LayerDetMap;
00121   std::map<std::string, SubDetMEs> SubDetMEsMap;
00122   std::map<std::string, std::string> SubDetPhasePartMap;
00123 
00124   // flags
00125   bool show_mechanical_structure_view, show_readout_view, show_control_view, select_all_detectors, reset_each_run;
00126   unsigned long long m_cacheID_;
00127 
00128   edm::ESHandle<SiStripDetCabling> SiStripDetCabling_;
00129   std::vector<uint32_t> ModulesToBeExcluded_;
00130 
00131   edm::ParameterSet Parameters;
00132 
00133   // TkHistoMap added
00134   TkHistoMap* tkmapcluster; 
00135 
00136   int runNb, eventNb;
00137   int firstEvent;
00138 
00139   bool layerswitchncluson;
00140   bool layerswitchcluschargeon;
00141   bool layerswitchclusstonon;
00142   bool layerswitchclusstonVsposon;
00143   bool layerswitchclusposon;
00144   bool layerswitchclusdigiposon;
00145   bool layerswitchclusnoiseon;
00146   bool layerswitchcluswidthon;
00147   bool layerswitchlocaloccupancy;
00148   bool layerswitchnrclusterizedstrip;
00149   bool layerswitchnumclusterprofon;
00150   bool layerswitchclusterwidthprofon;
00151   
00152   bool globalswitchstripnoise2apvcycle;
00153   bool globalswitchstripnoise3apvcycle;
00154   bool globalswitchmaindiagonalposition;
00155 
00156   bool moduleswitchncluson;
00157   bool moduleswitchcluschargeon;
00158   bool moduleswitchclusstonon;
00159   bool moduleswitchclusstonVsposon;
00160   bool moduleswitchclusposon;
00161   bool moduleswitchclusdigiposon;
00162   bool moduleswitchclusnoiseon;
00163   bool moduleswitchcluswidthon;
00164   bool moduleswitchlocaloccupancy;
00165   bool moduleswitchnrclusterizedstrip;
00166   bool subdetswitchtotclusprofon;
00167   bool subdetswitchapvcycleprofon;
00168   bool subdetswitchapvcycleth2on;
00169   bool subdetswitchapvcycledbxprof2on;
00170   bool subdetswitchdbxcycleprofon;
00171   bool subdetswitchtotclusth1on;
00172   bool globalswitchapvcycledbxth2on;
00173   bool globalswitchcstripvscpix;
00174   bool globalswitchMultiRegions;
00175   bool clustertkhistomapon;
00176   bool createTrendMEs;
00177 
00178   bool Mod_On_;
00179   bool ClusterHisto_;
00180 
00181   std::string topFolderName_;
00182   std::string qualityLabel_;
00183 
00184   edm::InputTag clusterProducerStrip_;
00185   edm::InputTag clusterProducerPix_;
00186   edm::InputTag historyProducer_;  
00187   edm::InputTag apvPhaseProducer_;
00188 
00189   bool   applyClusterQuality_;
00190   double sToNLowerLimit_;  
00191   double sToNUpperLimit_;  
00192   double widthLowerLimit_;
00193   double widthUpperLimit_;
00194 
00195   double k0;
00196   double q0;
00197   double dk0;
00198   double maxClus;
00199   double minPix;
00200 
00201   SiStripDCSStatus* dcsStatus_;
00202 };
00203 #endif