00001 #ifndef GlobalHitsProdHist_h 00002 #define GlobalHitsProdHist_h 00003 00013 // framework & common header files 00014 #include "FWCore/Framework/interface/EDProducer.h" 00015 #include "FWCore/Framework/interface/Frameworkfwd.h" 00016 #include "FWCore/Framework/interface/Event.h" 00017 #include "FWCore/Framework/interface/Run.h" 00018 #include "FWCore/Framework/interface/EventSetup.h" 00019 #include "DataFormats/Common/interface/Handle.h" 00020 #include "FWCore/Framework/interface/ESHandle.h" 00021 #include "DataFormats/Provenance/interface/Provenance.h" 00022 #include "FWCore/Framework/interface/MakerMacros.h" 00023 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00024 #include "FWCore/MessageLogger/interface/MessageLogger.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 "TH1F.h" 00074 00075 class GlobalHitsProdHist : public edm::EDProducer 00076 { 00077 00078 public: 00079 00080 //typedef std::vector<float> FloatVector; 00081 00082 explicit GlobalHitsProdHist(const edm::ParameterSet&); 00083 virtual ~GlobalHitsProdHist(); 00084 virtual void beginJob( void ); 00085 virtual void endJob(); 00086 virtual void produce(edm::Event&, const edm::EventSetup&); 00087 virtual void endRun(edm::Run&, const edm::EventSetup&); 00088 00089 private: 00090 00091 // production related methods 00092 void fillG4MC(edm::Event&); 00093 void fillTrk(edm::Event&, const edm::EventSetup&); 00094 void fillMuon(edm::Event&, const edm::EventSetup&); 00095 void fillECal(edm::Event&, const edm::EventSetup&); 00096 void fillHCal(edm::Event&, const edm::EventSetup&); 00097 00098 private: 00099 00100 // parameter information 00101 std::string fName; 00102 int verbosity; 00103 int frequency; 00104 int vtxunit; 00105 bool getAllProvenances; 00106 bool printProvenanceInfo; 00107 00108 //DQMStore *dbe; 00109 //std::string outputfile; 00110 00111 std::vector<std::string> histName_; 00112 std::map<std::string, TH1F*> histMap_; 00113 00114 // G4MC info 00115 TH1F *hMCRGP[2]; 00116 TH1F *hMCG4Vtx[2]; 00117 TH1F *hGeantVtxX[2]; 00118 TH1F *hGeantVtxY[2]; 00119 TH1F *hGeantVtxZ[2]; 00120 TH1F *hMCG4Trk[2]; 00121 TH1F *hGeantTrkPt; 00122 TH1F *hGeantTrkE; 00123 int nRawGenPart; 00124 00125 // Electromagnetic info 00126 // ECal info 00127 TH1F *hCaloEcal[2]; 00128 TH1F *hCaloEcalE[2]; 00129 TH1F *hCaloEcalToF[2]; 00130 TH1F *hCaloEcalPhi; 00131 TH1F *hCaloEcalEta; 00132 edm::InputTag ECalEBSrc_; 00133 edm::InputTag ECalEESrc_; 00134 00135 // Preshower info 00136 TH1F *hCaloPreSh[2]; 00137 TH1F *hCaloPreShE[2]; 00138 TH1F *hCaloPreShToF[2]; 00139 TH1F *hCaloPreShPhi; 00140 TH1F *hCaloPreShEta; 00141 edm::InputTag ECalESSrc_; 00142 00143 // Hadronic info 00144 // HCal info 00145 TH1F *hCaloHcal[2]; 00146 TH1F *hCaloHcalE[2]; 00147 TH1F *hCaloHcalToF[2]; 00148 TH1F *hCaloHcalPhi; 00149 TH1F *hCaloHcalEta; 00150 edm::InputTag HCalSrc_; 00151 00152 // Tracker info 00153 // Pixel info 00154 int nPxlHits; 00155 TH1F *hTrackerPx[2]; 00156 TH1F *hTrackerPxPhi; 00157 TH1F *hTrackerPxEta; 00158 TH1F *hTrackerPxBToF; 00159 TH1F *hTrackerPxBR; 00160 TH1F *hTrackerPxFToF; 00161 TH1F *hTrackerPxFZ; 00162 edm::InputTag PxlBrlLowSrc_; 00163 edm::InputTag PxlBrlHighSrc_; 00164 edm::InputTag PxlFwdLowSrc_; 00165 edm::InputTag PxlFwdHighSrc_; 00166 00167 // Strip info 00168 int nSiHits; 00169 TH1F *hTrackerSi[2]; 00170 TH1F *hTrackerSiPhi; 00171 TH1F *hTrackerSiEta; 00172 TH1F *hTrackerSiBToF; 00173 TH1F *hTrackerSiBR; 00174 TH1F *hTrackerSiFToF; 00175 TH1F *hTrackerSiFZ; 00176 edm::InputTag SiTIBLowSrc_; 00177 edm::InputTag SiTIBHighSrc_; 00178 edm::InputTag SiTOBLowSrc_; 00179 edm::InputTag SiTOBHighSrc_; 00180 edm::InputTag SiTIDLowSrc_; 00181 edm::InputTag SiTIDHighSrc_; 00182 edm::InputTag SiTECLowSrc_; 00183 edm::InputTag SiTECHighSrc_; 00184 00185 // Muon info 00186 TH1F *hMuon[2]; 00187 TH1F *hMuonPhi; 00188 TH1F *hMuonEta; 00189 int nMuonHits; 00190 00191 // DT info 00192 TH1F *hMuonDtToF[2]; 00193 TH1F *hMuonDtR; 00194 edm::InputTag MuonDtSrc_; 00195 // CSC info 00196 TH1F *hMuonCscToF[2]; 00197 TH1F *hMuonCscZ; 00198 edm::InputTag MuonCscSrc_; 00199 // RPC info 00200 TH1F *hMuonRpcFToF[2]; 00201 TH1F *hMuonRpcFZ; 00202 TH1F *hMuonRpcBToF[2]; 00203 TH1F *hMuonRpcBR; 00204 edm::InputTag MuonRpcSrc_; 00205 00206 // private statistics information 00207 unsigned int count; 00208 00209 }; // end class declaration 00210 00211 #endif 00212 00213 #ifndef GlobalHitMap 00214 #define GlobalHitMap 00215 // geometry mapping 00216 static const int dTrk = 1; 00217 static const int sdPxlBrl = 1; 00218 static const int sdPxlFwd = 2; 00219 static const int sdSiTIB = 3; 00220 static const int sdSiTID = 4; 00221 static const int sdSiTOB = 5; 00222 static const int sdSiTEC = 6; 00223 00224 static const int dMuon = 2; 00225 static const int sdMuonDT = 1; 00226 static const int sdMuonCSC = 2; 00227 static const int sdMuonRPC = 3; 00228 static const int sdMuonRPCRgnBrl = 0; 00229 static const int sdMuonRPCRgnFwdp = 1; 00230 static const int sdMuonRPCRgnFwdn = -1; 00231 00232 static const int dEcal = 3; 00233 static const int sdEcalBrl = 1; 00234 static const int sdEcalFwd = 2; 00235 static const int sdEcalPS = 3; 00236 static const int sdEcalTT = 4; 00237 static const int sdEcalLPnD = 5; 00238 00239 static const int dHcal = 4; 00240 static const int sdHcalEmpty = 0; 00241 static const int sdHcalBrl = 1; 00242 static const int sdHcalEC = 2; 00243 static const int sdHcalOut = 3; 00244 static const int sdHcalFwd = 4; 00245 static const int sdHcalTT = 5; 00246 static const int sdHcalCalib = 6; 00247 static const int sdHcalCompst = 7; 00248 00249 #endif