CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Validation/GlobalHits/interface/GlobalHitsAnalyzer.h

Go to the documentation of this file.
00001 #ifndef GlobalHitsAnalyzer_h
00002 #define GlobalHitsAnalyzer_h
00003 
00013 // framework & common header files
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "FWCore/Framework/interface/Frameworkfwd.h"
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 #include "DataFormats/Common/interface/Handle.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020 #include "DataFormats/Provenance/interface/Provenance.h"
00021 #include "FWCore/Framework/interface/MakerMacros.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00024 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00025 #include "DataFormats/DetId/interface/DetId.h"
00026 
00027 //DQM services
00028 #include "DQMServices/Core/interface/DQMStore.h"
00029 #include "FWCore/ServiceRegistry/interface/Service.h"
00030 
00031 // tracker info
00032 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00033 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00034 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00035 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00036 
00037 // muon info
00038 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00039 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
00040 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00041 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00042 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
00043 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00044 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00045 
00046 // calorimeter info
00047 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00048 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00049 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00050 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00051 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00052 
00053 // data in edm::event
00054 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00055 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00056 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00057 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00058 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00059 
00060 // helper files
00061 //#include <CLHEP/Vector/LorentzVector.h>
00062 #include "DataFormats/Math/interface/LorentzVector.h"
00063 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00064 
00065 #include <iostream>
00066 #include <stdlib.h>
00067 #include <string>
00068 #include <memory>
00069 #include <vector>
00070 
00071 #include "TString.h"
00072 #include "DQMServices/Core/interface/MonitorElement.h"
00073 
00074 class GlobalHitsAnalyzer : public edm::EDAnalyzer
00075 {
00076   
00077  public:
00078 
00079   //typedef std::vector<float> FloatVector;
00080 
00081   explicit GlobalHitsAnalyzer(const edm::ParameterSet&);
00082   virtual ~GlobalHitsAnalyzer();
00083   virtual void beginJob( void );
00084   virtual void endJob();  
00085   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00086   
00087  private:
00088 
00089   // production related methods
00090   void fillG4MC(const edm::Event&);
00091   void fillTrk(const edm::Event&, const edm::EventSetup&);
00092   void fillMuon(const edm::Event&, const edm::EventSetup&);
00093   void fillECal(const edm::Event&, const edm::EventSetup&);
00094   void fillHCal(const edm::Event&, const edm::EventSetup&);
00095 
00096 
00097  private:
00098 
00099   //  parameter information
00100   std::string fName;
00101   int verbosity;
00102   int frequency;
00103   int vtxunit;
00104   std::string label;
00105   bool getAllProvenances;
00106   bool printProvenanceInfo;
00107 
00108   bool validHepMCevt;
00109   bool validG4VtxContainer;
00110   bool validG4trkContainer;
00111   bool validPxlBrlLow;
00112   bool validPxlBrlHigh;
00113   bool validPxlFwdLow;
00114   bool validPxlFwdHigh;
00115   bool validSiTIBLow;
00116   bool validSiTIBHigh;
00117   bool validSiTOBLow;
00118   bool validSiTOBHigh;
00119   bool validSiTIDLow;
00120   bool validSiTIDHigh;
00121   bool validSiTECLow;
00122   bool validSiTECHigh;
00123   bool validMuonCSC;
00124   bool validMuonDt;
00125   bool validMuonRPC;
00126   bool validEB;
00127   bool validEE;
00128   bool validPresh;
00129   bool validHcal;
00130 
00131   DQMStore *dbe;
00132 
00133   // G4MC info
00134   MonitorElement *meMCRGP[2];
00135   MonitorElement *meMCG4Vtx[2];
00136   MonitorElement *meGeantVtxX[2];
00137   MonitorElement *meGeantVtxY[2];  
00138   MonitorElement *meGeantVtxZ[2];  
00139   MonitorElement *meMCG4Trk[2];
00140   MonitorElement *meGeantTrkPt;
00141   MonitorElement *meGeantTrkE;
00142   MonitorElement *meGeantVtxEta;
00143   MonitorElement *meGeantVtxPhi;
00144   MonitorElement *meGeantVtxRad[2];
00145   MonitorElement *meGeantVtxMulti;
00146   int nRawGenPart;  
00147 
00148   // Electromagnetic info
00149   // ECal info
00150   MonitorElement *meCaloEcal[2];
00151   MonitorElement *meCaloEcalE[2];
00152   MonitorElement *meCaloEcalToF[2];
00153   MonitorElement *meCaloEcalPhi;
00154   MonitorElement *meCaloEcalEta;  
00155   edm::InputTag ECalEBSrc_;
00156   edm::InputTag ECalEESrc_;
00157 
00158   // Preshower info
00159   MonitorElement *meCaloPreSh[2];
00160   MonitorElement *meCaloPreShE[2];
00161   MonitorElement *meCaloPreShToF[2];
00162   MonitorElement *meCaloPreShPhi;
00163   MonitorElement *meCaloPreShEta;
00164   edm::InputTag ECalESSrc_;
00165 
00166   // Hadronic info
00167   // HCal info
00168   MonitorElement *meCaloHcal[2];
00169   MonitorElement *meCaloHcalE[2];
00170   MonitorElement *meCaloHcalToF[2];
00171   MonitorElement *meCaloHcalPhi;
00172   MonitorElement *meCaloHcalEta;  
00173   edm::InputTag HCalSrc_;
00174 
00175   // Tracker info
00176   // Pixel info
00177   int nPxlHits;
00178   MonitorElement *meTrackerPx[2];
00179   MonitorElement *meTrackerPxPhi;
00180   MonitorElement *meTrackerPxEta;
00181   MonitorElement *meTrackerPxBToF;
00182   MonitorElement *meTrackerPxBR;
00183   MonitorElement *meTrackerPxFToF;
00184   MonitorElement *meTrackerPxFZ;
00185   edm::InputTag PxlBrlLowSrc_;
00186   edm::InputTag PxlBrlHighSrc_;
00187   edm::InputTag PxlFwdLowSrc_;
00188   edm::InputTag PxlFwdHighSrc_;
00189 
00190   // Strip info
00191   int nSiHits;
00192   MonitorElement *meTrackerSi[2];
00193   MonitorElement *meTrackerSiPhi;
00194   MonitorElement *meTrackerSiEta;
00195   MonitorElement *meTrackerSiBToF;
00196   MonitorElement *meTrackerSiBR;
00197   MonitorElement *meTrackerSiFToF;
00198   MonitorElement *meTrackerSiFZ;
00199   edm::InputTag SiTIBLowSrc_;
00200   edm::InputTag SiTIBHighSrc_;
00201   edm::InputTag SiTOBLowSrc_;
00202   edm::InputTag SiTOBHighSrc_;
00203   edm::InputTag SiTIDLowSrc_;
00204   edm::InputTag SiTIDHighSrc_;
00205   edm::InputTag SiTECLowSrc_;
00206   edm::InputTag SiTECHighSrc_;
00207 
00208   // Muon info
00209   MonitorElement *meMuon[2];
00210   MonitorElement *meMuonPhi;
00211   MonitorElement *meMuonEta;
00212   int nMuonHits;
00213 
00214   // DT info
00215   MonitorElement *meMuonDtToF[2];
00216   MonitorElement *meMuonDtR;
00217   edm::InputTag MuonDtSrc_;
00218   // CSC info
00219   MonitorElement *meMuonCscToF[2];
00220   MonitorElement *meMuonCscZ;
00221   edm::InputTag MuonCscSrc_;
00222   // RPC info
00223   MonitorElement *meMuonRpcFToF[2];
00224   MonitorElement *meMuonRpcFZ;
00225   MonitorElement *meMuonRpcBToF[2];
00226   MonitorElement *meMuonRpcBR;
00227   edm::InputTag MuonRpcSrc_;
00228 
00229   // private statistics information
00230   unsigned int count;
00231 
00232 }; // end class declaration
00233   
00234 #endif
00235 
00236 #ifndef GlobalHitMap
00237 #define GlobalHitMap
00238 // geometry mapping
00239 static const int dTrk             = 1;
00240 static const int sdPxlBrl         = 1;
00241 static const int sdPxlFwd         = 2;
00242 static const int sdSiTIB          = 3;
00243 static const int sdSiTID          = 4;
00244 static const int sdSiTOB          = 5;
00245 static const int sdSiTEC          = 6;
00246 
00247 static const int dMuon            = 2;
00248 static const int sdMuonDT         = 1;
00249 static const int sdMuonCSC        = 2;
00250 static const int sdMuonRPC        = 3;
00251 static const int sdMuonRPCRgnBrl  = 0;
00252 static const int sdMuonRPCRgnFwdp = 1;
00253 static const int sdMuonRPCRgnFwdn = -1;
00254 
00255 static const int dEcal            = 3;
00256 static const int sdEcalBrl        = 1;
00257 static const int sdEcalFwd        = 2;
00258 static const int sdEcalPS         = 3;
00259 static const int sdEcalTT         = 4;
00260 static const int sdEcalLPnD       = 5;
00261 
00262 static const int dHcal            = 4;
00263 static const int sdHcalEmpty      = 0;
00264 static const int sdHcalBrl        = 1;
00265 static const int sdHcalEC         = 2;
00266 static const int sdHcalOut        = 3;
00267 static const int sdHcalFwd        = 4;
00268 static const int sdHcalTT         = 5;
00269 static const int sdHcalCalib      = 6;
00270 static const int sdHcalCompst     = 7;
00271 
00272 #endif