CMS 3D CMS Logo

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