00001 #ifndef SiStripMonitorCluster_SiStripMonitorCluster_h
00002 #define SiStripMonitorCluster_SiStripMonitorCluster_h
00003
00004
00005
00009
00010
00011
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
00022 #include <vector>
00023
00024 class DQMStore;
00025 class SiStripDetCabling;
00026 class SiStripCluster;
00027
00028 class SiStripMonitorCluster : public edm::EDAnalyzer {
00029 public:
00030 explicit SiStripMonitorCluster(const edm::ParameterSet&);
00031 ~SiStripMonitorCluster();
00032 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00033
00034 virtual void endJob() ;
00035 virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00036
00037 struct ModMEs{
00038
00039 MonitorElement* NumberOfClusters;
00040 MonitorElement* ClusterPosition;
00041 MonitorElement* ClusterWidth;
00042 MonitorElement* ClusterCharge;
00043 MonitorElement* ClusterNoise;
00044 MonitorElement* ClusterSignalOverNoise;
00045 MonitorElement* ClusterSignalOverNoiseVsPos;
00046 MonitorElement* ModuleLocalOccupancy;
00047 MonitorElement* NrOfClusterizedStrips;
00048 };
00049
00050 struct LayerMEs{
00051
00052 MonitorElement* LayerClusterStoN;
00053 MonitorElement* LayerClusterStoNTrend;
00054 MonitorElement* LayerClusterCharge;
00055 MonitorElement* LayerClusterChargeTrend;
00056 MonitorElement* LayerClusterNoise;
00057 MonitorElement* LayerClusterNoiseTrend;
00058 MonitorElement* LayerClusterWidth;
00059 MonitorElement* LayerClusterWidthTrend;
00060 MonitorElement* LayerLocalOccupancy;
00061 MonitorElement* LayerLocalOccupancyTrend;
00062 MonitorElement* LayerNumberOfClusterProfile;
00063 MonitorElement* LayerClusterWidthProfile;
00064
00065 };
00066
00067 struct ClusterProperties {
00068 float charge;
00069 float position;
00070 short width;
00071 float noise;
00072 };
00073
00074 private:
00075
00076 void createMEs(const edm::EventSetup& es);
00077 void createLayerMEs(std::string label, int ndets);
00078 void createModuleMEs(ModMEs& mod_single, uint32_t detid);
00079 void createSubDetMEs(std::string label);
00080
00081 void fillModuleMEs(ModMEs& mod_mes, ClusterProperties& cluster);
00082 void fillLayerMEs(LayerMEs&, ClusterProperties& cluster);
00083
00084 void ResetModuleMEs(uint32_t idet);
00085
00086 void fillTrend(MonitorElement* me ,float value);
00087
00088 void getLayerLabel(uint32_t idetid, std::string& label);
00089
00090 inline void fillME(MonitorElement* ME,float value1){if (ME!=0)ME->Fill(value1);}
00091 inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=0)ME->Fill(value1,value2);}
00092 inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=0)ME->Fill(value1,value2,value3);}
00093 inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);}
00094 MonitorElement * bookMETrend(const char*, const char*);
00095 MonitorElement* bookME1D(const char* ParameterSetLabel, const char* HistoName);
00096
00097 private:
00098 DQMStore* dqmStore_;
00099 edm::ParameterSet conf_;
00100 std::map<uint32_t, ModMEs> ModuleMEMap;
00101 std::map<std::string, LayerMEs> LayerMEMap;
00102 std::map<std::string, std::vector< uint32_t > > LayerDetMap;
00103 std::map<std::string, MonitorElement* > SubDetMEsMap;
00104
00105
00106 bool show_mechanical_structure_view, show_readout_view, show_control_view, select_all_detectors, reset_each_run;
00107 unsigned long long m_cacheID_;
00108
00109 edm::ESHandle<SiStripDetCabling> SiStripDetCabling_;
00110 std::vector<uint32_t> ModulesToBeExcluded_;
00111
00112 edm::ParameterSet Parameters;
00113
00114 std::map<std::pair<std::string,int32_t>,bool> DetectedLayers;
00115
00116 int runNb, eventNb;
00117 int firstEvent;
00118
00119 bool layerswitchncluson;
00120 bool layerswitchcluschargeon;
00121 bool layerswitchclusstonon;
00122 bool layerswitchclusposon;
00123 bool layerswitchclusnoiseon;
00124 bool layerswitchcluswidthon;
00125 bool layerswitchlocaloccupancy;
00126 bool layerswitchnrclusterizedstrip;
00127 bool layerswitchnumclusterprofon;
00128 bool layerswitchclusterwidthprofon;
00129
00130 bool moduleswitchncluson;
00131 bool moduleswitchcluschargeon;
00132 bool moduleswitchclusstonon;
00133 bool moduleswitchclusstonVsposon;
00134 bool moduleswitchclusposon;
00135 bool moduleswitchclusnoiseon;
00136 bool moduleswitchcluswidthon;
00137 bool moduleswitchlocaloccupancy;
00138 bool moduleswitchnrclusterizedstrip;
00139 bool subdetswitchtotclusterprofon;
00140
00141
00142 bool tibon;
00143 bool tidon;
00144 bool tobon;
00145 bool tecon;
00146
00147 bool createTrendMEs;
00148
00149 bool Mod_On_;
00150 };
00151 #endif