00001 #ifndef GlobalHitsProducer_h 00002 #define GlobalHitsProducer_h 00003 00015 // framework & common header files 00016 #include "FWCore/Framework/interface/EDProducer.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 #include "FWCore/Utilities/interface/InputTag.h" 00027 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h" 00028 #include "DataFormats/DetId/interface/DetId.h" 00029 00030 // tracker info 00031 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" 00032 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00033 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" 00034 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" 00035 00036 // muon info 00037 #include "Geometry/Records/interface/MuonGeometryRecord.h" 00038 #include "Geometry/CSCGeometry/interface/CSCGeometry.h" 00039 #include "Geometry/DTGeometry/interface/DTGeometry.h" 00040 #include "Geometry/RPCGeometry/interface/RPCGeometry.h" 00041 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h" 00042 #include "DataFormats/MuonDetId/interface/RPCDetId.h" 00043 #include "DataFormats/MuonDetId/interface/DTWireId.h" 00044 00045 // calorimeter info 00046 #include "Geometry/CaloGeometry/interface/CaloGeometry.h" 00047 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00048 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" 00049 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" 00050 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" 00051 00052 // data in edm::event 00053 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h" 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 //#include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h" 00060 //#include "SimDataFormats/CrossingFrame/interface/MixCollection.h" 00061 00062 // helper files 00063 //#include <CLHEP/Vector/LorentzVector.h> 00064 #include "DataFormats/Math/interface/LorentzVector.h" 00065 #include "CLHEP/Units/GlobalSystemOfUnits.h" 00066 00067 #include <iostream> 00068 #include <stdlib.h> 00069 #include <string> 00070 #include <memory> 00071 #include <vector> 00072 00073 #include "TString.h" 00074 00075 class PGlobalSimHit; 00076 00077 class GlobalHitsProducer : public edm::EDProducer 00078 { 00079 00080 public: 00081 00082 typedef std::vector<float> FloatVector; 00083 00084 explicit GlobalHitsProducer(const edm::ParameterSet&); 00085 virtual ~GlobalHitsProducer(); 00086 virtual void beginJob( void ); 00087 virtual void endJob(); 00088 virtual void produce(edm::Event&, const edm::EventSetup&); 00089 00090 private: 00091 00092 //GlobalValidation(const GlobalValidation&); 00093 //const GlobalValidation& operator=(const GlobalValidation&); 00094 00095 // production related methods 00096 void fillG4MC(edm::Event&); 00097 void storeG4MC(PGlobalSimHit&); 00098 void fillTrk(edm::Event&, const edm::EventSetup&); 00099 void storeTrk(PGlobalSimHit&); 00100 void fillMuon(edm::Event&, const edm::EventSetup&); 00101 void storeMuon(PGlobalSimHit&); 00102 void fillECal(edm::Event&, const edm::EventSetup&); 00103 void storeECal(PGlobalSimHit&); 00104 void fillHCal(edm::Event&, const edm::EventSetup&); 00105 void storeHCal(PGlobalSimHit&); 00106 00107 void clear(); 00108 00109 private: 00110 00111 // parameter information 00112 std::string fName; 00113 int verbosity; 00114 int frequency; 00115 int vtxunit; 00116 std::string label; 00117 bool getAllProvenances; 00118 bool printProvenanceInfo; 00119 00120 // G4MC info 00121 int nRawGenPart; 00122 FloatVector G4VtxX; 00123 FloatVector G4VtxY; 00124 FloatVector G4VtxZ; 00125 FloatVector G4TrkPt; 00126 FloatVector G4TrkE; 00127 00128 edm::InputTag G4VtxSrc_; 00129 edm::InputTag G4TrkSrc_; 00130 00131 // Electromagnetic info 00132 // ECal info 00133 FloatVector ECalE; 00134 FloatVector ECalToF; 00135 FloatVector ECalPhi; 00136 FloatVector ECalEta; 00137 edm::InputTag ECalEBSrc_; 00138 edm::InputTag ECalEESrc_; 00139 00140 // Preshower info 00141 FloatVector PreShE; 00142 FloatVector PreShToF; 00143 FloatVector PreShPhi; 00144 FloatVector PreShEta; 00145 edm::InputTag ECalESSrc_; 00146 00147 // Hadronic info 00148 // HCal info 00149 FloatVector HCalE; 00150 FloatVector HCalToF; 00151 FloatVector HCalPhi; 00152 FloatVector HCalEta; 00153 edm::InputTag HCalSrc_; 00154 00155 // Tracker info 00156 // Pixel info 00157 FloatVector PxlBrlToF; 00158 FloatVector PxlBrlR; 00159 FloatVector PxlBrlPhi; 00160 FloatVector PxlBrlEta; 00161 FloatVector PxlFwdToF; 00162 FloatVector PxlFwdZ; 00163 FloatVector PxlFwdPhi; 00164 FloatVector PxlFwdEta; 00165 edm::InputTag PxlBrlLowSrc_; 00166 edm::InputTag PxlBrlHighSrc_; 00167 edm::InputTag PxlFwdLowSrc_; 00168 edm::InputTag PxlFwdHighSrc_; 00169 00170 // Strip info 00171 FloatVector SiBrlToF; 00172 FloatVector SiBrlR; 00173 FloatVector SiBrlPhi; 00174 FloatVector SiBrlEta; 00175 FloatVector SiFwdToF; 00176 FloatVector SiFwdZ; 00177 FloatVector SiFwdPhi; 00178 FloatVector SiFwdEta; 00179 edm::InputTag SiTIBLowSrc_; 00180 edm::InputTag SiTIBHighSrc_; 00181 edm::InputTag SiTOBLowSrc_; 00182 edm::InputTag SiTOBHighSrc_; 00183 edm::InputTag SiTIDLowSrc_; 00184 edm::InputTag SiTIDHighSrc_; 00185 edm::InputTag SiTECLowSrc_; 00186 edm::InputTag SiTECHighSrc_; 00187 00188 // Muon info 00189 // DT info 00190 FloatVector MuonDtToF; 00191 FloatVector MuonDtR; 00192 FloatVector MuonDtPhi; 00193 FloatVector MuonDtEta; 00194 edm::InputTag MuonDtSrc_; 00195 // CSC info 00196 FloatVector MuonCscToF; 00197 FloatVector MuonCscZ; 00198 FloatVector MuonCscPhi; 00199 FloatVector MuonCscEta; 00200 edm::InputTag MuonCscSrc_; 00201 // RPC info 00202 FloatVector MuonRpcBrlToF; 00203 FloatVector MuonRpcBrlR; 00204 FloatVector MuonRpcBrlPhi; 00205 FloatVector MuonRpcBrlEta; 00206 FloatVector MuonRpcFwdToF; 00207 FloatVector MuonRpcFwdZ; 00208 FloatVector MuonRpcFwdPhi; 00209 FloatVector MuonRpcFwdEta; 00210 edm::InputTag MuonRpcSrc_; 00211 00212 // private statistics information 00213 unsigned int count; 00214 00215 }; // end class declaration 00216 00217 #endif 00218 00219 #ifndef GlobalHitMap 00220 #define GlobalHitMap 00221 // geometry mapping 00222 static const int dTrk = 1; 00223 static const int sdPxlBrl = 1; 00224 static const int sdPxlFwd = 2; 00225 static const int sdSiTIB = 3; 00226 static const int sdSiTID = 4; 00227 static const int sdSiTOB = 5; 00228 static const int sdSiTEC = 6; 00229 00230 static const int dMuon = 2; 00231 static const int sdMuonDT = 1; 00232 static const int sdMuonCSC = 2; 00233 static const int sdMuonRPC = 3; 00234 static const int sdMuonRPCRgnBrl = 0; 00235 static const int sdMuonRPCRgnFwdp = 1; 00236 static const int sdMuonRPCRgnFwdn = -1; 00237 00238 static const int dEcal = 3; 00239 static const int sdEcalBrl = 1; 00240 static const int sdEcalFwd = 2; 00241 static const int sdEcalPS = 3; 00242 static const int sdEcalTT = 4; 00243 static const int sdEcalLPnD = 5; 00244 00245 static const int dHcal = 4; 00246 static const int sdHcalEmpty = 0; 00247 static const int sdHcalBrl = 1; 00248 static const int sdHcalEC = 2; 00249 static const int sdHcalOut = 3; 00250 static const int sdHcalFwd = 4; 00251 static const int sdHcalTT = 5; 00252 static const int sdHcalCalib = 6; 00253 static const int sdHcalCompst = 7; 00254 00255 #endif