CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/Validation/GlobalDigis/interface/GlobalDigisAnalyzer.h

Go to the documentation of this file.
00001 #ifndef GlobalDigisAnalyzer_h
00002 #define GlobalDigisAnalyzer_h
00003 
00015 // framework & common header files
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 #include "DataFormats/Common/interface/Handle.h"
00021 #include "FWCore/Framework/interface/ESHandle.h"
00022 #include "DataFormats/Provenance/interface/Provenance.h"
00023 #include "FWCore/Framework/interface/MakerMacros.h" 
00024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00025 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00026 
00027 //DQM services
00028 #include "DQMServices/Core/interface/DQMStore.h"
00029 #include "FWCore/ServiceRegistry/interface/Service.h"
00030 
00031 // ecal calorimeter info
00032 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00033 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00034 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
00035 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00036 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00037 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00038 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00039 #include "CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialConditionRetriever.h"
00040 
00041 // hcal calorimeter info
00042 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00043 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00044 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00045 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00046 #include "DataFormats/HcalDigi/interface/HcalQIESample.h"
00047 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00048 #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h"
00049 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
00050 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
00051 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
00052 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
00053 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00054 
00055 // silicon strip info
00056 #include "DataFormats/Common/interface/DetSetVector.h"
00057 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00058 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00059 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00060 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00061 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00062 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00063 
00064 // silicon pixel info
00065 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00066 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00067 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00068 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00069 
00070 // muon DT info
00071 #include "DataFormats/DTDigi/interface/DTDigi.h"
00072 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
00073 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00074 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00075 
00076 // muon CSC Strip info
00077 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
00078 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00079 
00080 // muon CSC Wire info
00081 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h"
00082 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
00083 
00084 // muon RPC info
00085 #include "DataFormats/RPCDigi/interface/RPCDigi.h"
00086 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00087 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00088 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
00089 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00090 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00091 
00092 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
00093 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
00094 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00095 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00096 
00097 // event info
00098 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
00099 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00100 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
00101 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00102 
00103 #include <iostream>
00104 #include <stdlib.h>
00105 #include <string>
00106 #include <memory>
00107 #include <vector>
00108 #include <map>
00109 
00110 #include "TString.h"
00111 #include "DQMServices/Core/interface/MonitorElement.h"
00112 
00113 class PGlobalDigi;
00114 
00115 class GlobalDigisAnalyzer : public edm::EDAnalyzer
00116 {
00117 
00118  public:
00119   typedef std::vector<float> FloatVector;
00120   typedef std::vector<double> DoubleVector;
00121   typedef std::vector<int> IntVector;
00122   typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
00123 
00124   explicit GlobalDigisAnalyzer(const edm::ParameterSet&);
00125   virtual ~GlobalDigisAnalyzer();
00126   virtual void beginJob( void );
00127   virtual void endJob();  
00128   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00129   
00130  private:
00131 
00132   // production related methods
00133   void fillECal(const edm::Event&, const edm::EventSetup&);
00134   //void storeECal(PGlobalDigi&);
00135   void fillHCal(const edm::Event&, const edm::EventSetup&);
00136   //void storeHCal(PGlobalDigi&);
00137   void fillTrk(const edm::Event&, const edm::EventSetup&);
00138   //void storeTrk(PGlobalDigi&);
00139   void fillMuon(const edm::Event&, const edm::EventSetup&);
00140   //void storeMuon(PGlobalDigi&);  
00141 
00142   //void clear();
00143 
00144  private:
00145 
00146   //  parameter information
00147   std::string fName;
00148   int verbosity;
00149   int frequency;
00150   std::string label;
00151   bool getAllProvenances;
00152   bool printProvenanceInfo;
00153   std::string hitsProducer;
00154 
00155   DQMStore *dbe;
00156 
00157   // Electromagnetic info
00158   // ECal info
00159  
00160   MonitorElement *mehEcaln[2];
00161   MonitorElement *mehEScaln;
00162   MonitorElement *mehEcalAEE[2];
00163   MonitorElement *mehEcalSHE[2];
00164   MonitorElement *mehEcalMaxPos[2];
00165   MonitorElement *mehEcalMultvAEE[2];
00166   MonitorElement *mehEcalSHEvAEESHE[2];
00167   MonitorElement *mehEScalADC[3];
00168 
00169   edm::InputTag ECalEBSrc_;
00170   edm::InputTag ECalEESrc_;
00171   edm::InputTag ECalESSrc_;
00172 
00173   std::map<int, double, std::less<int> > ECalgainConv_;
00174   double ECalbarrelADCtoGeV_;
00175   double ECalendcapADCtoGeV_;
00176 
00177   // HCal info
00178 
00179   MonitorElement *mehHcaln[4];
00180   MonitorElement *mehHcalAEE[4];
00181   MonitorElement *mehHcalSHE[4];
00182   MonitorElement *mehHcalAEESHE[4];
00183   MonitorElement *mehHcalSHEvAEE[4];
00184 
00185   edm::InputTag HCalSrc_;
00186   edm::InputTag HCalDigi_;
00187 
00188   // Tracker info
00189   // SiStrip
00190   
00191   MonitorElement *mehSiStripn[19];
00192   MonitorElement *mehSiStripADC[19];
00193   MonitorElement *mehSiStripStrip[19];
00194 
00195   edm::InputTag SiStripSrc_;
00196 
00197   // SiPxl
00198 
00199   MonitorElement *mehSiPixeln[7];
00200   MonitorElement *mehSiPixelADC[7];
00201   MonitorElement *mehSiPixelRow[7];
00202   MonitorElement *mehSiPixelCol[7];
00203   
00204   edm::InputTag SiPxlSrc_;
00205   
00206   // Muon info
00207   // DT
00208 
00209   MonitorElement *mehDtMuonn[4];
00210   MonitorElement *mehDtMuonLayer[4];
00211   MonitorElement *mehDtMuonTime[4];
00212   MonitorElement *mehDtMuonTimevLayer[4];
00213 
00214   edm::InputTag MuDTSrc_;
00215 
00216   // CSC
00217 
00218   MonitorElement *mehCSCStripn;
00219   MonitorElement *mehCSCStripADC;
00220   MonitorElement *mehCSCWiren;
00221   MonitorElement *mehCSCWireTime;
00222 
00223   edm::InputTag MuCSCStripSrc_;
00224   float theCSCStripPedestalSum;
00225   int theCSCStripPedestalCount;
00226 
00227   edm::InputTag MuCSCWireSrc_;
00228 
00229   // RPC
00230   MonitorElement *mehRPCMuonn;
00231   MonitorElement *mehRPCRes[5];
00232 
00233   edm::InputTag MuRPCSrc_;
00234 
00235   // private statistics information
00236   unsigned int count;
00237 
00238 }; // end class declaration
00239 
00240 #endif
00241 
00242 #ifndef GlobalHitMap
00243 #define GlobalHitMap
00244 
00245 // geometry mapping
00246 static const int dTrk             = 1;
00247 static const int sdPxlBrl         = 1;
00248 static const int sdPxlFwd         = 2;
00249 static const int sdSiTIB          = 3;
00250 static const int sdSiTID          = 4;
00251 static const int sdSiTOB          = 5;
00252 static const int sdSiTEC          = 6;
00253 
00254 static const int dMuon            = 2;
00255 static const int sdMuonDT         = 1;
00256 static const int sdMuonCSC        = 2;
00257 static const int sdMuonRPC        = 3;
00258 static const int sdMuonRPCRgnBrl  = 0;
00259 static const int sdMuonRPCRgnFwdp = 1;
00260 static const int sdMuonRPCRgnFwdn = -1;
00261 
00262 static const int dEcal            = 3;
00263 static const int sdEcalBrl        = 1;
00264 static const int sdEcalFwd        = 2;
00265 static const int sdEcalPS         = 3;
00266 static const int sdEcalTT         = 4;
00267 static const int sdEcalLPnD       = 5;
00268 
00269 static const int dHcal            = 4;
00270 static const int sdHcalEmpty      = 0;
00271 static const int sdHcalBrl        = 1;
00272 static const int sdHcalEC         = 2;
00273 static const int sdHcalOut        = 3;
00274 static const int sdHcalFwd        = 4;
00275 static const int sdHcalTT         = 5;
00276 static const int sdHcalCalib      = 6;
00277 static const int sdHcalCompst     = 7;
00278 
00279 #endif //PGlobalDigisAnalyzer_h