CMS 3D CMS Logo

GlobalHitsProdHist.h
Go to the documentation of this file.
1 #ifndef GlobalHitsProdHist_h
2 #define GlobalHitsProdHist_h
3 
11 // framework & common header files
26 
27 // DQM services
28 //#include "DQMServices/Core/interface/DQMStore.h"
29 //#include "FWCore/ServiceRegistry/interface/Service.h"
30 
31 // tracker info
36 
37 // muon info
45 
46 // calorimeter info
52 
53 // data in edm::event
59 
60 // helper files
61 //#include <CLHEP/Vector/LorentzVector.h>
62 #include "CLHEP/Units/GlobalSystemOfUnits.h"
64 
65 #include <cstdlib>
66 #include <iostream>
67 #include <memory>
68 #include <string>
69 #include <vector>
70 
71 #include "TH1F.h"
72 #include "TString.h"
73 
74 class GlobalHitsProdHist : public edm::one::EDProducer<edm::EndRunProducer> {
75 public:
76  // typedef std::vector<float> FloatVector;
77 
78  explicit GlobalHitsProdHist(const edm::ParameterSet &);
79  ~GlobalHitsProdHist() override;
80  void beginJob() override;
81  void endJob() override;
82  void produce(edm::Event &, const edm::EventSetup &) override;
83  void endRunProduce(edm::Run &, const edm::EventSetup &) override;
84 
85 private:
86  // production related methods
87  void fillG4MC(edm::Event &);
88  void fillTrk(edm::Event &, const edm::EventSetup &);
89  void fillMuon(edm::Event &, const edm::EventSetup &);
90  void fillECal(edm::Event &, const edm::EventSetup &);
91  void fillHCal(edm::Event &, const edm::EventSetup &);
92 
93 private:
94  // parameter information
96  int verbosity;
97  int frequency;
98  int vtxunit;
101 
102  // DQMStore *dbe;
103  // std::string outputfile;
104 
105  std::vector<std::string> histName_;
106  std::map<std::string, TH1F *> histMap_;
107 
108  // G4MC info
109  TH1F *hMCRGP[2];
110  TH1F *hMCG4Vtx[2];
111  TH1F *hGeantVtxX[2];
112  TH1F *hGeantVtxY[2];
113  TH1F *hGeantVtxZ[2];
114  TH1F *hMCG4Trk[2];
115  TH1F *hGeantTrkPt;
116  TH1F *hGeantTrkE;
118 
123 
129  // Electromagnetic info
130  // ECal info
131  TH1F *hCaloEcal[2];
132  TH1F *hCaloEcalE[2];
133  TH1F *hCaloEcalToF[2];
140 
141  // Preshower info
142  TH1F *hCaloPreSh[2];
143  TH1F *hCaloPreShE[2];
144  TH1F *hCaloPreShToF[2];
149 
150  // Hadronic info
151  // HCal info
152  TH1F *hCaloHcal[2];
153  TH1F *hCaloHcalE[2];
154  TH1F *hCaloHcalToF[2];
159 
160  // Tracker info
161  // Pixel info
162  int nPxlHits;
163  TH1F *hTrackerPx[2];
178 
179  // Strip info
180  int nSiHits;
181  TH1F *hTrackerSi[2];
204 
205  // Muon info
206  TH1F *hMuon[2];
207  TH1F *hMuonPhi;
208  TH1F *hMuonEta;
210 
211  // DT info
212  TH1F *hMuonDtToF[2];
213  TH1F *hMuonDtR;
216  // CSC info
217  TH1F *hMuonCscToF[2];
218  TH1F *hMuonCscZ;
221  // RPC info
222  TH1F *hMuonRpcFToF[2];
223  TH1F *hMuonRpcFZ;
224  TH1F *hMuonRpcBToF[2];
225  TH1F *hMuonRpcBR;
228 
229  // private statistics information
230  unsigned int count;
231 
232 }; // end class declaration
233 
234 #endif
235 
236 #ifndef GlobalHitMap
237 #define GlobalHitMap
238 // geometry mapping
239 static const int dTrk = 1;
240 static const int sdPxlBrl = 1;
241 static const int sdPxlFwd = 2;
242 static const int sdSiTIB = 3;
243 static const int sdSiTID = 4;
244 static const int sdSiTOB = 5;
245 static const int sdSiTEC = 6;
246 
247 static const int dMuon = 2;
248 static const int sdMuonDT = 1;
249 static const int sdMuonCSC = 2;
250 static const int sdMuonRPC = 3;
251 static const int sdMuonRPCRgnBrl = 0;
252 static const int sdMuonRPCRgnFwdp = 1;
253 static const int sdMuonRPCRgnFwdn = -1;
254 
255 static const int dEcal = 3;
256 static const int sdEcalBrl = 1;
257 static const int sdEcalFwd = 2;
258 static const int sdEcalPS = 3;
259 static const int sdEcalTT = 4;
260 static const int sdEcalLPnD = 5;
261 
262 static const int dHcal = 4;
263 static const int sdHcalEmpty = 0;
264 static const int sdHcalBrl = 1;
265 static const int sdHcalEC = 2;
266 static const int sdHcalOut = 3;
267 static const int sdHcalFwd = 4;
268 static const int sdHcalTT = 5;
269 static const int sdHcalCalib = 6;
270 static const int sdHcalCompst = 7;
271 
272 #endif
edm::InputTag SiTECHighSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
edm::InputTag SiTIDLowSrc_
void beginJob() override
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
static const int sdEcalFwd
static const int sdEcalPS
static const int sdMuonCSC
edm::InputTag SiTECLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
static const int sdSiTIB
edm::InputTag MuonRpcSrc_
static const int sdHcalCompst
static const int sdHcalOut
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
edm::InputTag MuonCscSrc_
static const int sdMuonRPC
static const int dTrk
void fillHCal(edm::Event &, const edm::EventSetup &)
static const int sdEcalBrl
edm::InputTag SiTIBLowSrc_
std::map< std::string, TH1F * > histMap_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalESSrc_Token_
std::vector< std::string > histName_
static const int sdEcalTT
void fillG4MC(edm::Event &)
edm::InputTag PxlFwdHighSrc_
edm::InputTag MuonDtSrc_
static const int sdSiTOB
static const int sdSiTID
static const int sdPxlBrl
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
edm::InputTag ECalEESrc_
void endRunProduce(edm::Run &, const edm::EventSetup &) override
static const int sdHcalEmpty
edm::InputTag SiTOBHighSrc_
void produce(edm::Event &, const edm::EventSetup &) override
static const int sdMuonDT
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
static const int sdHcalTT
void fillTrk(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBLowSrc_Token_
edm::InputTag ECalESSrc_
edm::InputTag SiTIBHighSrc_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEBSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEESrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBHighSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBLowSrc_Token_
static const int dMuon
edm::InputTag PxlFwdLowSrc_
static const int sdHcalFwd
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
static const int sdMuonRPCRgnBrl
void fillECal(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::PSimHitContainer > SiTECLowSrc_Token_
void endJob() override
edm::EDGetTokenT< edm::PSimHitContainer > MuonCscSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuonDtSrc_Token_
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
static const int sdSiTEC
edm::InputTag PxlBrlHighSrc_
static const int sdHcalBrl
void fillMuon(edm::Event &, const edm::EventSetup &)
edm::InputTag PxlBrlLowSrc_
static const int sdHcalEC
static const int sdEcalLPnD
static const int dEcal
static const int sdMuonRPCRgnFwdn
edm::InputTag SiTOBLowSrc_
static const int sdPxlFwd
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
GlobalHitsProdHist(const edm::ParameterSet &)
edm::InputTag ECalEBSrc_
static const int dHcal
edm::InputTag SiTIDHighSrc_
Definition: Run.h:45
static const int sdHcalCalib
static const int sdMuonRPCRgnFwdp