15 std::string MsgLoggerCat =
"GlobalHitsHistogrammer_GlobalHitsHistogrammer";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
43 <<
"\n===============================\n" 44 <<
"Initialized as EDAnalyzer with parameter values:\n" 45 <<
" Name = " <<
fName <<
"\n" 46 <<
" Verbosity = " << verbosity <<
"\n" 47 <<
" Frequency = " << frequency <<
"\n" 48 <<
" VtxUnit = " << vtxunit <<
"\n" 49 <<
" OutputFile = " << outputfile <<
"\n" 50 <<
" DoOutput = " << doOutput <<
"\n" 51 <<
" GetProv = " << getAllProvenances <<
"\n" 52 <<
" PrintProv = " << printProvenanceInfo <<
"\n" 53 <<
" GlobalHitSrc = " << GlobalHitSrc_.label()
54 <<
":" << GlobalHitSrc_.instance() <<
"\n" 55 <<
"===============================\n";
64 for (Int_t
i = 0;
i < 2; ++
i) {
121 sprintf(hname,
"hMCRGP1");
122 sprintf(htitle,
"RawGenParticles");
124 sprintf(hname,
"hMCRGP2");
126 for (Int_t
i = 0;
i < 2; ++
i) {
131 sprintf(hname,
"hMCG4Vtx1");
132 sprintf(htitle,
"G4 Vertices");
134 sprintf(hname,
"hMCG4Vtx2");
136 for (Int_t
i = 0;
i < 2; ++
i) {
141 sprintf(hname,
"hMCG4Trk1");
142 sprintf(htitle,
"G4 Tracks");
144 sprintf(hname,
"hMCG4Trk2");
146 for (Int_t
i = 0;
i < 2; ++
i) {
151 sprintf(hname,
"hGeantVtxX1");
152 sprintf(htitle,
"Geant vertex x/micrometer");
154 sprintf(hname,
"hGeantVtxX2");
156 for (Int_t
i = 0;
i < 2; ++
i) {
161 sprintf(hname,
"hGeantVtxY1");
162 sprintf(htitle,
"Geant vertex y/micrometer");
164 sprintf(hname,
"hGeantVtxY2");
166 for (Int_t
i = 0;
i < 2; ++
i) {
171 sprintf(hname,
"hGeantVtxZ1");
172 sprintf(htitle,
"Geant vertex z/millimeter");
174 sprintf(hname,
"hGeantVtxZ2");
176 for (Int_t
i = 0;
i < 2; ++
i) {
181 sprintf(hname,
"hGeantTrkPt");
182 sprintf(htitle,
"Geant track pt/GeV");
187 sprintf(hname,
"hGeantTrkE");
188 sprintf(htitle,
"Geant track E/GeV");
196 sprintf(hname,
"hCaloEcal1");
197 sprintf(htitle,
"Ecal hits");
199 sprintf(hname,
"hCaloEcal2");
202 sprintf(hname,
"hCaloEcalE1");
203 sprintf(htitle,
"Ecal hits, energy/GeV");
205 sprintf(hname,
"hCaloEcalE2");
208 sprintf(hname,
"hCaloEcalToF1");
209 sprintf(htitle,
"Ecal hits, ToF/ns");
211 sprintf(hname,
"hCaloEcalToF2");
214 for (Int_t
i = 0;
i < 2; ++
i) {
223 sprintf(hname,
"hCaloEcalPhi");
224 sprintf(htitle,
"Ecal hits, phi/rad");
229 sprintf(hname,
"hCaloEcalEta");
230 sprintf(htitle,
"Ecal hits, eta");
235 sprintf(hname,
"hCaloPreSh1");
236 sprintf(htitle,
"PreSh hits");
238 sprintf(hname,
"hCaloPreSh2");
241 sprintf(hname,
"hCaloPreShE1");
242 sprintf(htitle,
"PreSh hits, energy/GeV");
244 sprintf(hname,
"hCaloPreShE2");
247 sprintf(hname,
"hCaloPreShToF1");
248 sprintf(htitle,
"PreSh hits, ToF/ns");
250 sprintf(hname,
"hCaloPreShToF2");
253 for (Int_t
i = 0;
i < 2; ++
i) {
262 sprintf(hname,
"hCaloPreShPhi");
263 sprintf(htitle,
"PreSh hits, phi/rad");
268 sprintf(hname,
"hCaloPreShEta");
269 sprintf(htitle,
"PreSh hits, eta");
276 sprintf(hname,
"hCaloHcal1");
277 sprintf(htitle,
"Hcal hits");
279 sprintf(hname,
"hCaloHcal2");
282 sprintf(hname,
"hCaloHcalE1");
283 sprintf(htitle,
"Hcal hits, energy/GeV");
285 sprintf(hname,
"hCaloHcalE2");
288 sprintf(hname,
"hCaloHcalToF1");
289 sprintf(htitle,
"Hcal hits, ToF/ns");
291 sprintf(hname,
"hCaloHcalToF2");
294 for (Int_t
i = 0;
i < 2; ++
i) {
303 sprintf(hname,
"hCaloHcalPhi");
304 sprintf(htitle,
"Hcal hits, phi/rad");
309 sprintf(hname,
"hCaloHcalEta");
310 sprintf(htitle,
"Hcal hits, eta");
317 sprintf(hname,
"hTrackerPx1");
318 sprintf(htitle,
"Pixel hits");
320 sprintf(hname,
"hTrackerPx2");
322 for (Int_t
i = 0;
i < 2; ++
i) {
327 sprintf(hname,
"hTrackerPxPhi");
328 sprintf(htitle,
"Pixel hits phi/rad");
333 sprintf(hname,
"hTrackerPxEta");
334 sprintf(htitle,
"Pixel hits eta");
339 sprintf(hname,
"hTrackerPxBToF");
340 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
345 sprintf(hname,
"hTrackerPxBR");
346 sprintf(htitle,
"Pixel barrel hits, R/cm");
351 sprintf(hname,
"hTrackerPxFToF");
352 sprintf(htitle,
"Pixel forward hits, ToF/ns");
357 sprintf(hname,
"hTrackerPxFZ");
358 sprintf(htitle,
"Pixel forward hits, Z/cm");
365 sprintf(hname,
"hTrackerSi1");
366 sprintf(htitle,
"Silicon hits");
368 sprintf(hname,
"hTrackerSi2");
370 for (Int_t
i = 0;
i < 2; ++
i) {
375 sprintf(hname,
"hTrackerSiPhi");
376 sprintf(htitle,
"Silicon hits phi/rad");
381 sprintf(hname,
"hTrackerSiEta");
382 sprintf(htitle,
"Silicon hits eta");
387 sprintf(hname,
"hTrackerSiBToF");
388 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
393 sprintf(hname,
"hTrackerSiBR");
394 sprintf(htitle,
"Silicon barrel hits, R/cm");
399 sprintf(hname,
"hTrackerSiFToF");
400 sprintf(htitle,
"Silicon forward hits, ToF/ns");
405 sprintf(hname,
"hTrackerSiFZ");
406 sprintf(htitle,
"Silicon forward hits, Z/cm");
413 sprintf(hname,
"hMuon1");
414 sprintf(htitle,
"Muon hits");
415 meMuon[0] = ibooker.
book1D(hname, htitle, 100, 0., 10000.);
416 sprintf(hname,
"hMuon2");
417 meMuon[1] = ibooker.
book1D(hname, htitle, 100, -0.5, 99.5);
418 for (Int_t
i = 0;
i < 2; ++
i) {
423 sprintf(hname,
"hMuonPhi");
424 sprintf(htitle,
"Muon hits phi/rad");
429 sprintf(hname,
"hMuonEta");
430 sprintf(htitle,
"Muon hits eta");
435 sprintf(hname,
"hMuonCscToF1");
436 sprintf(htitle,
"Muon CSC hits, ToF/ns");
438 sprintf(hname,
"hMuonCscToF2");
440 for (Int_t
i = 0;
i < 2; ++
i) {
445 sprintf(hname,
"hMuonCscZ");
446 sprintf(htitle,
"Muon CSC hits, Z/cm");
451 sprintf(hname,
"hMuonDtToF1");
452 sprintf(htitle,
"Muon DT hits, ToF/ns");
454 sprintf(hname,
"hMuonDtToF2");
456 for (Int_t
i = 0;
i < 2; ++
i) {
461 sprintf(hname,
"hMuonDtR");
462 sprintf(htitle,
"Muon DT hits, R/cm");
467 sprintf(hname,
"hMuonRpcFToF1");
468 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
470 sprintf(hname,
"hMuonRpcFToF2_4305");
472 for (Int_t
i = 0;
i < 2; ++
i) {
477 sprintf(hname,
"hMuonRpcFZ");
478 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
483 sprintf(hname,
"hMuonRpcBToF1");
484 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
486 sprintf(hname,
"hMuonRpcBToF2");
488 for (Int_t
i = 0;
i < 2; ++
i) {
493 sprintf(hname,
"hMuonRpcBR");
494 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
509 std::string MsgLoggerCat =
"GlobalHitsHistogrammer_analyze";
520 <<
"Processing run " << nrun <<
", event " << nevt
521 <<
" (" <<
count <<
" events total)";
525 <<
"Processing run " << nrun <<
", event " << nevt
526 <<
" (" <<
count <<
" events total)";
533 std::vector<const edm::StableProvenance*> AllProv;
538 <<
"Number of Provenances = " << AllProv.size();
541 TString eventout(
"\nProvenance info:\n");
543 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
544 eventout +=
"\n ******************************";
545 eventout +=
"\n Module : ";
546 eventout += AllProv[
i]->moduleLabel();
547 eventout +=
"\n ProductID : ";
548 eventout += AllProv[
i]->productID().id();
549 eventout +=
"\n ClassName : ";
550 eventout += AllProv[
i]->className();
551 eventout +=
"\n InstanceName : ";
552 eventout += AllProv[
i]->productInstanceName();
553 eventout +=
"\n BranchName : ";
554 eventout += AllProv[
i]->branchName();
556 eventout +=
"\n ******************************\n";
566 if (!srcGlobalHits.
isValid()) {
568 <<
"Unable to find PGlobalSimHit in event!";
584 for (Int_t
i = 0;
i < 2; ++
i) {
597 std::vector<PGlobalSimHit::Vtx> G4Vtx = srcGlobalHits->
getG4Vtx();
598 for (
unsigned int i = 0;
i < G4Vtx.size(); ++
i) {
599 for (
int j = 0; j < 2; ++j) {
607 std::vector<PGlobalSimHit::Trk> G4Trk = srcGlobalHits->
getG4Trk();
608 for (
unsigned int i = 0;
i < G4Trk.size(); ++
i) {
614 std::vector<PGlobalSimHit::CalHit> ECalHits =
616 for (
unsigned int i = 0;
i < ECalHits.size(); ++
i) {
617 for (Int_t j = 0; j < 2; ++j) {
626 std::vector<PGlobalSimHit::CalHit> PreShHits =
628 for (
unsigned int i = 0;
i < PreShHits.size(); ++
i) {
629 for (Int_t j = 0; j < 2; ++j) {
638 std::vector<PGlobalSimHit::CalHit> HCalHits =
640 for (
unsigned int i = 0;
i < HCalHits.size(); ++
i) {
641 for (Int_t j = 0; j < 2; ++j) {
650 std::vector<PGlobalSimHit::BrlHit> PxlBrlHits =
652 for (
unsigned int i = 0;
i < PxlBrlHits.size(); ++
i) {
660 std::vector<PGlobalSimHit::FwdHit> PxlFwdHits =
662 for (
unsigned int i = 0;
i < PxlFwdHits.size(); ++
i) {
670 std::vector<PGlobalSimHit::BrlHit> SiBrlHits =
672 for (
unsigned int i = 0;
i < SiBrlHits.size(); ++
i) {
680 std::vector<PGlobalSimHit::FwdHit> SiFwdHits =
682 for (
unsigned int i = 0;
i < SiFwdHits.size(); ++
i) {
690 std::vector<PGlobalSimHit::FwdHit> MuonCscHits =
692 for (
unsigned int i = 0;
i < MuonCscHits.size(); ++
i) {
695 for (Int_t j = 0; j < 2; ++j) {
702 std::vector<PGlobalSimHit::BrlHit> MuonDtHits =
704 for (
unsigned int i = 0;
i < MuonDtHits.size(); ++
i) {
707 for (Int_t j = 0; j < 2; ++j) {
714 std::vector<PGlobalSimHit::FwdHit> MuonRpcFwdHits =
716 for (
unsigned int i = 0;
i < MuonRpcFwdHits.size(); ++
i) {
719 for (Int_t j = 0; j < 2; ++j) {
726 std::vector<PGlobalSimHit::BrlHit> MuonRpcBrlHits =
728 for (
unsigned int i = 0;
i < MuonRpcBrlHits.size(); ++
i) {
731 for (Int_t j = 0; j < 2; ++j) {
CalVector getPreShHits() const
MonitorElement * meCaloEcalPhi
BrlVector getPxlBrlHits() const
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meTrackerPxBR
MonitorElement * meCaloHcalPhi
edm::InputTag GlobalHitSrc_
MonitorElement * meMCG4Vtx[2]
FwdVector getMuonCscHits() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meCaloPreShPhi
MonitorElement * meCaloHcal[2]
MonitorElement * meMuonRpcFZ
GlobalHitsHistogrammer(const edm::ParameterSet &)
MonitorElement * meCaloEcalE[2]
int getnRawGenPart() const
unsigned long long EventNumber_t
int getnSiFwdHits() const
MonitorElement * meTrackerSiFToF
int getnMuonCscHits() const
FwdVector getPxlFwdHits() const
MonitorElement * meMuonRpcBToF[2]
int getnMuonRpcFwdHits() const
MonitorElement * meCaloPreSh[2]
int getnMuonDtHits() const
int getnPreShHits() const
~GlobalHitsHistogrammer() override
MonitorElement * meMuonCscToF[2]
MonitorElement * meTrackerSiEta
MonitorElement * meGeantVtxY[2]
MonitorElement * meMuonDtToF[2]
void setCurrentFolder(std::string const &fullpath)
FwdVector getSiFwdHits() const
MonitorElement * meMuonPhi
MonitorElement * meMuonDtR
MonitorElement * meCaloPreShE[2]
MonitorElement * meMCRGP[2]
TrkVector getG4Trk() const
MonitorElement * meTrackerSiBToF
MonitorElement * meTrackerSiBR
MonitorElement * book1D(Args &&...args)
MonitorElement * meMuonRpcBR
MonitorElement * meCaloPreShEta
int getnPxlFwdHits() const
MonitorElement * meTrackerSiFZ
MonitorElement * meTrackerPxFZ
MonitorElement * meCaloHcalE[2]
BrlVector getMuonDtHits() const
MonitorElement * meCaloEcalEta
MonitorElement * meTrackerSi[2]
MonitorElement * meTrackerPxPhi
VtxVector getG4Vtx() const
MonitorElement * meMCG4Trk[2]
MonitorElement * meTrackerPxFToF
MonitorElement * meCaloEcal[2]
MonitorElement * meCaloPreShToF[2]
int getnMuonRpcBrlHits() const
MonitorElement * meTrackerPxEta
edm::EDGetTokenT< PGlobalSimHit > GlobalHitSrc_Token_
MonitorElement * meGeantTrkPt
MonitorElement * meCaloEcalToF[2]
MonitorElement * meMuonRpcFToF[2]
MonitorElement * meMuonCscZ
CalVector getHCalHits() const
MonitorElement * meTrackerPx[2]
CalVector getECalHits() const
int getnSiBrlHits() const
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meGeantVtxZ[2]
MonitorElement * meTrackerPxBToF
MonitorElement * meMuonEta
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meGeantTrkE
MonitorElement * meCaloHcalEta
MonitorElement * meTrackerSiPhi
BrlVector getMuonRpcBrlHits() const
MonitorElement * meGeantVtxX[2]
BrlVector getSiBrlHits() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meCaloHcalToF[2]
int getnPxlBrlHits() const
FwdVector getMuonRpcFwdHits() const
MonitorElement * meMuon[2]
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const