CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/Validation/GlobalHits/interface/GlobalHitsProducer.h

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