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";
74 for (Int_t
i = 0;
i < 2; ++
i) {
132 sprintf(hname,
"hMCRGP1");
133 sprintf(htitle,
"RawGenParticles");
135 sprintf(hname,
"hMCRGP2");
137 for (Int_t
i = 0;
i < 2; ++
i) {
142 sprintf(hname,
"hMCG4Vtx1");
143 sprintf(htitle,
"G4 Vertices");
145 sprintf(hname,
"hMCG4Vtx2");
147 for (Int_t
i = 0;
i < 2; ++
i) {
152 sprintf(hname,
"hMCG4Trk1");
153 sprintf(htitle,
"G4 Tracks");
155 sprintf(hname,
"hMCG4Trk2");
157 for (Int_t
i = 0;
i < 2; ++
i) {
162 sprintf(hname,
"hGeantVtxX1");
163 sprintf(htitle,
"Geant vertex x/micrometer");
165 sprintf(hname,
"hGeantVtxX2");
167 for (Int_t
i = 0;
i < 2; ++
i) {
172 sprintf(hname,
"hGeantVtxY1");
173 sprintf(htitle,
"Geant vertex y/micrometer");
175 sprintf(hname,
"hGeantVtxY2");
177 for (Int_t
i = 0;
i < 2; ++
i) {
182 sprintf(hname,
"hGeantVtxZ1");
183 sprintf(htitle,
"Geant vertex z/millimeter");
185 sprintf(hname,
"hGeantVtxZ2");
187 for (Int_t
i = 0;
i < 2; ++
i) {
192 sprintf(hname,
"hGeantTrkPt");
193 sprintf(htitle,
"Geant track pt/GeV");
198 sprintf(hname,
"hGeantTrkE");
199 sprintf(htitle,
"Geant track E/GeV");
206 sprintf(hname,
"hCaloEcal1");
207 sprintf(htitle,
"Ecal hits");
209 sprintf(hname,
"hCaloEcal2");
212 sprintf(hname,
"hCaloEcalE1");
213 sprintf(htitle,
"Ecal hits, energy/GeV");
215 sprintf(hname,
"hCaloEcalE2");
218 sprintf(hname,
"hCaloEcalToF1");
219 sprintf(htitle,
"Ecal hits, ToF/ns");
221 sprintf(hname,
"hCaloEcalToF2");
224 for (Int_t
i = 0;
i < 2; ++
i) {
233 sprintf(hname,
"hCaloEcalPhi");
234 sprintf(htitle,
"Ecal hits, phi/rad");
239 sprintf(hname,
"hCaloEcalEta");
240 sprintf(htitle,
"Ecal hits, eta");
245 sprintf(hname,
"hCaloPreSh1");
246 sprintf(htitle,
"PreSh hits");
248 sprintf(hname,
"hCaloPreSh2");
251 sprintf(hname,
"hCaloPreShE1");
252 sprintf(htitle,
"PreSh hits, energy/GeV");
254 sprintf(hname,
"hCaloPreShE2");
257 sprintf(hname,
"hCaloPreShToF1");
258 sprintf(htitle,
"PreSh hits, ToF/ns");
260 sprintf(hname,
"hCaloPreShToF2");
263 for (Int_t
i = 0;
i < 2; ++
i) {
272 sprintf(hname,
"hCaloPreShPhi");
273 sprintf(htitle,
"PreSh hits, phi/rad");
278 sprintf(hname,
"hCaloPreShEta");
279 sprintf(htitle,
"PreSh hits, eta");
286 sprintf(hname,
"hCaloHcal1");
287 sprintf(htitle,
"Hcal hits");
289 sprintf(hname,
"hCaloHcal2");
292 sprintf(hname,
"hCaloHcalE1");
293 sprintf(htitle,
"Hcal hits, energy/GeV");
295 sprintf(hname,
"hCaloHcalE2");
298 sprintf(hname,
"hCaloHcalToF1");
299 sprintf(htitle,
"Hcal hits, ToF/ns");
301 sprintf(hname,
"hCaloHcalToF2");
304 for (Int_t
i = 0;
i < 2; ++
i) {
313 sprintf(hname,
"hCaloHcalPhi");
314 sprintf(htitle,
"Hcal hits, phi/rad");
319 sprintf(hname,
"hCaloHcalEta");
320 sprintf(htitle,
"Hcal hits, eta");
327 sprintf(hname,
"hTrackerPx1");
328 sprintf(htitle,
"Pixel hits");
330 sprintf(hname,
"hTrackerPx2");
332 for (Int_t
i = 0;
i < 2; ++
i) {
337 sprintf(hname,
"hTrackerPxPhi");
338 sprintf(htitle,
"Pixel hits phi/rad");
343 sprintf(hname,
"hTrackerPxEta");
344 sprintf(htitle,
"Pixel hits eta");
349 sprintf(hname,
"hTrackerPxBToF");
350 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
355 sprintf(hname,
"hTrackerPxBR");
356 sprintf(htitle,
"Pixel barrel hits, R/cm");
361 sprintf(hname,
"hTrackerPxFToF");
362 sprintf(htitle,
"Pixel forward hits, ToF/ns");
367 sprintf(hname,
"hTrackerPxFZ");
368 sprintf(htitle,
"Pixel forward hits, Z/cm");
375 sprintf(hname,
"hTrackerSi1");
376 sprintf(htitle,
"Silicon hits");
378 sprintf(hname,
"hTrackerSi2");
380 for (Int_t
i = 0;
i < 2; ++
i) {
385 sprintf(hname,
"hTrackerSiPhi");
386 sprintf(htitle,
"Silicon hits phi/rad");
391 sprintf(hname,
"hTrackerSiEta");
392 sprintf(htitle,
"Silicon hits eta");
397 sprintf(hname,
"hTrackerSiBToF");
398 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
403 sprintf(hname,
"hTrackerSiBR");
404 sprintf(htitle,
"Silicon barrel hits, R/cm");
409 sprintf(hname,
"hTrackerSiFToF");
410 sprintf(htitle,
"Silicon forward hits, ToF/ns");
415 sprintf(hname,
"hTrackerSiFZ");
416 sprintf(htitle,
"Silicon forward hits, Z/cm");
423 sprintf(hname,
"hMuon1");
424 sprintf(htitle,
"Muon hits");
426 sprintf(hname,
"hMuon2");
428 for (Int_t
i = 0;
i < 2; ++
i) {
433 sprintf(hname,
"hMuonPhi");
434 sprintf(htitle,
"Muon hits phi/rad");
439 sprintf(hname,
"hMuonEta");
440 sprintf(htitle,
"Muon hits eta");
445 sprintf(hname,
"hMuonCscToF1");
446 sprintf(htitle,
"Muon CSC hits, ToF/ns");
448 sprintf(hname,
"hMuonCscToF2");
450 for (Int_t
i = 0;
i < 2; ++
i) {
455 sprintf(hname,
"hMuonCscZ");
456 sprintf(htitle,
"Muon CSC hits, Z/cm");
461 sprintf(hname,
"hMuonDtToF1");
462 sprintf(htitle,
"Muon DT hits, ToF/ns");
464 sprintf(hname,
"hMuonDtToF2");
466 for (Int_t
i = 0;
i < 2; ++
i) {
471 sprintf(hname,
"hMuonDtR");
472 sprintf(htitle,
"Muon DT hits, R/cm");
477 sprintf(hname,
"hMuonRpcFToF1");
478 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
480 sprintf(hname,
"hMuonRpcFToF2_4305");
482 for (Int_t
i = 0;
i < 2; ++
i) {
487 sprintf(hname,
"hMuonRpcFZ");
488 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
493 sprintf(hname,
"hMuonRpcBToF1");
494 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
496 sprintf(hname,
"hMuonRpcBToF2");
498 for (Int_t
i = 0;
i < 2; ++
i) {
503 sprintf(hname,
"hMuonRpcBR");
504 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
524 std::string MsgLoggerCat =
"GlobalHitsHistogrammer_endJob";
527 <<
"Terminating having processed " <<
count <<
" events.";
534 std::string MsgLoggerCat =
"GlobalHitsHistogrammer_analyze";
540 int nrun = iEvent.
id().
run();
545 <<
"Processing run " << nrun <<
", event " << nevt
546 <<
" (" <<
count <<
" events total)";
550 <<
"Processing run " << nrun <<
", event " << nevt
551 <<
" (" <<
count <<
" events total)";
558 std::vector<const edm::Provenance*> AllProv;
563 <<
"Number of Provenances = " << AllProv.size();
566 TString eventout(
"\nProvenance info:\n");
568 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
569 eventout +=
"\n ******************************";
570 eventout +=
"\n Module : ";
571 eventout += AllProv[
i]->moduleLabel();
572 eventout +=
"\n ProductID : ";
573 eventout += AllProv[
i]->productID().id();
574 eventout +=
"\n ClassName : ";
575 eventout += AllProv[
i]->className();
576 eventout +=
"\n InstanceName : ";
577 eventout += AllProv[
i]->productInstanceName();
578 eventout +=
"\n BranchName : ";
579 eventout += AllProv[
i]->branchName();
581 eventout +=
"\n ******************************\n";
591 if (!srcGlobalHits.
isValid()) {
593 <<
"Unable to find PGlobalSimHit in event!";
609 for (Int_t
i = 0;
i < 2; ++
i) {
610 meMCRGP[
i]->
Fill((
float)srcGlobalHits->getnRawGenPart());
622 std::vector<PGlobalSimHit::Vtx> G4Vtx = srcGlobalHits->getG4Vtx();
623 for (
unsigned int i = 0;
i < G4Vtx.size(); ++
i) {
624 for (
int j = 0;
j < 2; ++
j) {
632 std::vector<PGlobalSimHit::Trk> G4Trk = srcGlobalHits->getG4Trk();
633 for (
unsigned int i = 0;
i < G4Trk.size(); ++
i) {
639 std::vector<PGlobalSimHit::CalHit> ECalHits =
640 srcGlobalHits->getECalHits();
641 for (
unsigned int i = 0;
i < ECalHits.size(); ++
i) {
642 for (Int_t
j = 0;
j < 2; ++
j) {
651 std::vector<PGlobalSimHit::CalHit> PreShHits =
652 srcGlobalHits->getPreShHits();
653 for (
unsigned int i = 0;
i < PreShHits.size(); ++
i) {
654 for (Int_t
j = 0;
j < 2; ++
j) {
663 std::vector<PGlobalSimHit::CalHit> HCalHits =
664 srcGlobalHits->getHCalHits();
665 for (
unsigned int i = 0;
i < HCalHits.size(); ++
i) {
666 for (Int_t
j = 0;
j < 2; ++
j) {
675 std::vector<PGlobalSimHit::BrlHit> PxlBrlHits =
676 srcGlobalHits->getPxlBrlHits();
677 for (
unsigned int i = 0;
i < PxlBrlHits.size(); ++
i) {
685 std::vector<PGlobalSimHit::FwdHit> PxlFwdHits =
686 srcGlobalHits->getPxlFwdHits();
687 for (
unsigned int i = 0;
i < PxlFwdHits.size(); ++
i) {
695 std::vector<PGlobalSimHit::BrlHit> SiBrlHits =
696 srcGlobalHits->getSiBrlHits();
697 for (
unsigned int i = 0;
i < SiBrlHits.size(); ++
i) {
705 std::vector<PGlobalSimHit::FwdHit> SiFwdHits =
706 srcGlobalHits->getSiFwdHits();
707 for (
unsigned int i = 0;
i < SiFwdHits.size(); ++
i) {
715 std::vector<PGlobalSimHit::FwdHit> MuonCscHits =
716 srcGlobalHits->getMuonCscHits();
717 for (
unsigned int i = 0;
i < MuonCscHits.size(); ++
i) {
720 for (Int_t
j = 0;
j < 2; ++
j) {
727 std::vector<PGlobalSimHit::BrlHit> MuonDtHits =
728 srcGlobalHits->getMuonDtHits();
729 for (
unsigned int i = 0;
i < MuonDtHits.size(); ++
i) {
732 for (Int_t
j = 0;
j < 2; ++
j) {
739 std::vector<PGlobalSimHit::FwdHit> MuonRpcFwdHits =
740 srcGlobalHits->getMuonRpcFwdHits();
741 for (
unsigned int i = 0;
i < MuonRpcFwdHits.size(); ++
i) {
744 for (Int_t
j = 0;
j < 2; ++
j) {
751 std::vector<PGlobalSimHit::BrlHit> MuonRpcBrlHits =
752 srcGlobalHits->getMuonRpcBrlHits();
753 for (
unsigned int i = 0;
i < MuonRpcBrlHits.size(); ++
i) {
756 for (Int_t
j = 0;
j < 2; ++
j) {
virtual ~GlobalHitsHistogrammer()
MonitorElement * meCaloEcalPhi
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
MonitorElement * meTrackerPxBR
MonitorElement * meCaloHcalPhi
edm::InputTag GlobalHitSrc_
MonitorElement * meMCG4Vtx[2]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meCaloPreShPhi
MonitorElement * meCaloHcal[2]
MonitorElement * meMuonRpcFZ
GlobalHitsHistogrammer(const edm::ParameterSet &)
MonitorElement * meCaloEcalE[2]
MonitorElement * meTrackerSiFToF
MonitorElement * meMuonRpcBToF[2]
MonitorElement * meCaloPreSh[2]
MonitorElement * meMuonCscToF[2]
virtual void beginJob(void)
MonitorElement * meTrackerSiEta
MonitorElement * meGeantVtxY[2]
MonitorElement * meMuonDtToF[2]
MonitorElement * meMuonPhi
MonitorElement * meMuonDtR
MonitorElement * meCaloPreShE[2]
MonitorElement * meMCRGP[2]
MonitorElement * meTrackerSiBToF
MonitorElement * meTrackerSiBR
MonitorElement * meMuonRpcBR
void setVerbose(unsigned level)
MonitorElement * meCaloPreShEta
MonitorElement * meTrackerSiFZ
MonitorElement * meTrackerPxFZ
MonitorElement * meCaloHcalE[2]
MonitorElement * meCaloEcalEta
MonitorElement * meTrackerSi[2]
MonitorElement * meTrackerPxPhi
MonitorElement * meMCG4Trk[2]
MonitorElement * meTrackerPxFToF
MonitorElement * meCaloEcal[2]
MonitorElement * meCaloPreShToF[2]
MonitorElement * meTrackerPxEta
edm::EDGetTokenT< PGlobalSimHit > GlobalHitSrc_Token_
MonitorElement * meGeantTrkPt
MonitorElement * meCaloEcalToF[2]
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * meMuonRpcFToF[2]
MonitorElement * meMuonCscZ
MonitorElement * meTrackerPx[2]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
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
MonitorElement * meGeantVtxX[2]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meCaloHcalToF[2]
MonitorElement * meMuon[2]