Public Member Functions | Private Member Functions | Private Attributes | List of all members
om::PlotClickHandler Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/OnlineMonitoring/viewer/PlotClickHandler.h"

Public Member Functions

 PlotClickHandler ()
 
 ~PlotClickHandler ()
 
void SingleClick (const PlotOptions &plotopt)
 
void DoubleClick (const PlotOptions &plotopt)
 

Private Member Functions

int DecodeClick ()
 
void DefaultHistogramInfo ()
 
void HwDetHistogramInfo ()
 
void HwDCMHistogramInfo ()
 
void HwPCHistogramInfoX ()
 
void HwPCHistogramInfoY ()
 
void FEButcInfo ()
 
void DCMutcInfo ()
 
void HwDetDoubleClick ()
 

Private Attributes

daqchannelmap::HardwareDisplayfHwMap
 
std::string fHistoName
 Name of Current Histogram. More...
 
TH1 * fH1
 1D histogram clicked on More...
 
TH2 * fH2
 2D histogram clicked on More...
 
double fX
 X position of click. More...
 
double fY
 Y position of click. More...
 
int fXbin
 X bin number of click. More...
 
int fYbin
 Y bin number of click. More...
 

Detailed Description

Handle clicks on the plot view histograms

Definition at line 14 of file PlotClickHandler.h.

Constructor & Destructor Documentation

PlotClickHandler::PlotClickHandler ( )

Definition at line 17 of file PlotClickHandler.cxx.

References fHwMap, om::GUIModel::Instance(), and daqchannelmap::HardwareDisplay::SetupDet().

17  :
19 {
20  fHwMap->SetupDet(GUIModel::Instance().Data().fDetector);
21 }
daqchannelmap::HardwareDisplay * fHwMap
static GUIModel & Instance()
Definition: GUIModel.cxx:11
PlotClickHandler::~PlotClickHandler ( )

Definition at line 25 of file PlotClickHandler.cxx.

References fHwMap.

25  {
26  if(fHwMap) {delete fHwMap; fHwMap = 0;}
27 }
daqchannelmap::HardwareDisplay * fHwMap

Member Function Documentation

void PlotClickHandler::DCMutcInfo ( )
private

Definition at line 617 of file PlotClickHandler.cxx.

References febshutoff_auto::dcm, geo2elec::diblock, fH2, fHistoName, fHwMap, daqchannelmap::HardwareDisplay::fNdcmSide, daqchannelmap::HardwareDisplay::fNdcmTop, fXbin, fYbin, om::GUIModel::Instance(), and om::GUIModel::SetHistogramInfoText().

Referenced by SingleClick().

618 {
619  char buff[256];
620 
621  unsigned int diblock, dcm;
622 
623  diblock = (fYbin-1)/(fHwMap->fNdcmTop + fHwMap->fNdcmSide) + 1;
624  dcm = (fYbin-1)%(fHwMap->fNdcmTop + fHwMap->fNdcmSide) + 1;
625 
626  sprintf(buff,
627  "%s: Contents = %e\n"
628  "[DB %.2d / DCM %.2d ]",
629  fHistoName.c_str(),
630  fH2->GetBinContent(fXbin,fYbin),
631  diblock,
632  dcm);
633 
635 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
unsigned int fNdcmSide
Number of DMC's per diblock on side of detector.
daqchannelmap::HardwareDisplay * fHwMap
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
unsigned int fNdcmTop
Number of DMC's per diblock on top of detector.
int fYbin
Y bin number of click.
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
int PlotClickHandler::DecodeClick ( )
private

Definition at line 66 of file PlotClickHandler.cxx.

References om::CurrentHistogram::Current(), om::GUIModel::Data(), om::GUIModelData::fCurrentHistogram, fH1, fH2, fHistoName, fX, fXbin, fY, fYbin, GetXaxis(), make_syst_table_plots::h, om::GUIModel::Instance(), xx, ymax, and ymin.

Referenced by DoubleClick(), and SingleClick().

67 {
68  //
69  // Get current histo name
70  //
72 
73  //
74  // Find out where the click occured
75  //
76  TObject* h = gPad->GetSelected();
77  if (h==0) return 0;
78 
79  fH1 = 0;
80  if (h->InheritsFrom(TH1::Class())) fH1 = (TH1*)h;
81  if (fH1==0) return 0;
82 
83  fH2 = 0;
84  if (h->InheritsFrom(TH2::Class())) fH2 = (TH2*)h;
85  if (fH2==0) return 0;
86 
87 
88  int px = gPad->GetEventX();
89  double xx = gPad->AbsPixeltoX(px);
90 
91  fX = gPad->PadtoX(xx);
92  if (fX<fH1->GetXaxis()->GetXmin()) return 0;
93  if (fX>fH1->GetXaxis()->GetXmax()) return 0;
94 
95  //
96  // Handle TH2s here. Do them first since ROOT defines TH2 as a
97  // subset of TH1's
98  //
99  fY = 0;
100  fYbin = 0;
101  if (fH2) {
102  int py = gPad->GetEventY();
103  double yy = gPad->AbsPixeltoY(py);
104 
105  fY = gPad->PadtoY(yy);
106 
107  double ymin = fH2->GetYaxis()->GetXmin();
108  if (fY<ymin) return 0;
109 
110  double ymax = fH2->GetYaxis()->GetXmax();
111  if (fY>ymax) return 0;
112 
113  fXbin = fH2->GetXaxis()->FindBin(fX);
114  fYbin = fH2->GetYaxis()->FindBin(fY);
115  return 1;
116  }
117  if (fH1) {
118  fXbin = fH1->GetXaxis()->FindBin(fX);
119  return 1;
120  }
121 
122  return 0;
123 }
Double_t xx
Definition: macro.C:12
Double_t ymax
Definition: plot.C:25
double fX
X position of click.
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
double fY
Y position of click.
correl_xv GetXaxis() -> SetDecimals()
int fYbin
Y bin number of click.
const char * Current() const
CurrentHistogram fCurrentHistogram
Definition: GUIModelData.h:37
TH2 * fH2
2D histogram clicked on
Double_t ymin
Definition: plot.C:24
const GUIModelData & Data() const
Definition: GUIModel.h:15
int fXbin
X bin number of click.
TH1 * fH1
1D histogram clicked on
void PlotClickHandler::DefaultHistogramInfo ( )
private

Definition at line 127 of file PlotClickHandler.cxx.

References fH1, fH2, fHistoName, fX, fXbin, fY, fYbin, om::GUIModel::Instance(), and om::GUIModel::SetHistogramInfoText().

Referenced by SingleClick().

128 {
129  if (fH2) {
130  char buff[256];
131  sprintf(buff, "Histogram %s: bin %d,%d (x=%.3f,y=%.3f) content=%.3f",
132  fHistoName.c_str(), fXbin, fYbin, fX, fY,
133  fH2->GetBinContent(fXbin,fYbin));
135  return;
136  }
137  if (fH1) {
138  char buff[256];
139  sprintf(buff, "Histogram %s: Bin %d (x=%.3f) content=%.3f",
140  fHistoName.c_str(), fXbin, fX, fH1->GetBinContent(fXbin));
142  return;
143  }
144 }
double fX
X position of click.
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
double fY
Y position of click.
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
TH1 * fH1
1D histogram clicked on
void PlotClickHandler::DoubleClick ( const PlotOptions plotopt)

Definition at line 52 of file PlotClickHandler.cxx.

References DecodeClick(), om::PlotOptions::fHwLblDet, and HwDetDoubleClick().

Referenced by om::PlotViewer::Exec().

53 {
54  int decoded = this->DecodeClick();
55  if (decoded==0) return;
56 
57  //
58  // Double clicks supported for detector view histograms. Other would
59  // be listed here...
60  //
61  if (plotopt.fHwLblDet) this->HwDetDoubleClick();
62 }
bool fHwLblDet
Apply hardware label to detector-wide plot.
Definition: PlotOptions.h:51
void PlotClickHandler::FEButcInfo ( )
private

Definition at line 534 of file PlotClickHandler.cxx.

References elec2geo::block, getBrightness::cell, om::cerr, daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), om::GUIModel::Data(), febshutoff_auto::dcm, geo2elec::diblock, allTimeWatchdog::endl, om::GUIModelData::fDetector, APDHVSetting::feb, fH2, fHistoName, fHwMap, fXbin, fYbin, om::GUIModel::Instance(), om::kNEARDET, getGoodRuns4SAM::n, Munits::nm, NDAPDHVSetting::plane, om::GUIModel::SetHistogramInfoText(), registry_explorer::v, POTSpillRate::view, daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

Referenced by SingleClick().

535 {
536  unsigned int diblock, dcm, feb, pix;
537  unsigned int block, plane, view, module, cell;
538 
539  //
540  // Figure out which diblock we are in. Histograms must conform
541  // to naming convention test_[db]
542  //
543  const char* nm = strchr(fHistoName.c_str(), '_');
544  if (nm!=NULL) {
545  ++nm;
546  unsigned int n = sscanf(nm,"%u",&diblock);
547  if (n!=1) {
548  std::cerr << "Bad histogram name decode " << fHistoName << std::endl;
549  diblock = 0;
550  }
551  }
552 
553  char buff[256];
554 
555  dcm = (fYbin-1)/64+1;
556  feb = (fYbin-1)%64;
557  pix = 0; // pix is not used here so just set it to a throw away value
558 
559  // For the NearDet we display global plane, for the FarDet & NDOS we
560  // display block and plane-in-block.
561 
563 
564  // For NearDet
565 
566  fHwMap->DAQToPlaneModCell(&block, &plane, &view, &module, &cell,
567  diblock, dcm, feb, pix);
568 
569  const char* v = "?";
570  if (view==daqchannelmap::X_VIEW) v = "V";
571  if (view==daqchannelmap::Y_VIEW) v = "H";
572  sprintf(buff,
573  "%s: Contents = %e\n"
574  "[Plane %d %s / Module %d] "
575  "[DB %.2d / DCM %.2d / FEB %2d ]",
576  fHistoName.c_str(),
577  fH2->GetBinContent(fXbin,fYbin),
578  plane,
579  v,
580  module,
581  diblock,
582  dcm,
583  feb);
584 
585  }
586  else {
587 
588  // For FarDet & NDOS
589 
590  fHwMap->DAQToPlaneInBlockModCell(&block, &plane, &view, &module, &cell,
591  diblock, dcm, feb, pix);
592 
593  const char* v = "?";
594  if (view==daqchannelmap::X_VIEW) v = "V";
595  if (view==daqchannelmap::Y_VIEW) v = "H";
596  sprintf(buff,
597  "%s: Contents = %e\n"
598  "[Block %.2d / Plane in block %d %s / Module %d] "
599  "[DB %.2d / DCM %.2d / FEB %2d ]",
600  fHistoName.c_str(),
601  fH2->GetBinContent(fXbin,fYbin),
602  block,
603  plane,
604  v,
605  module,
606  diblock,
607  dcm,
608  feb);
609 
610  }
611 
613 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
void DAQToPlaneInBlockModCell(unsigned int *block, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
Detector_t fDetector
Definition: GUIModelData.h:34
static constexpr Double_t nm
Definition: Munits.h:133
OStream cerr
Definition: OStream.cxx:7
daqchannelmap::HardwareDisplay * fHwMap
Identifier for the Y measuring view of the detector (side)
block
print "ROW IS " print row
Definition: elec2geo.py:31
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
Identifier for the X measuring view of the detector (top)
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
void DAQToPlaneModCell(unsigned int *block, unsigned int *plane, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
TH2 * fH2
2D histogram clicked on
const GUIModelData & Data() const
Definition: GUIModel.h:15
int fXbin
X bin number of click.
void PlotClickHandler::HwDCMHistogramInfo ( )
private

Definition at line 246 of file PlotClickHandler.cxx.

References elec2geo::block, getBrightness::cell, om::cerr, daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), febshutoff_auto::dcm, geo2elec::diblock, allTimeWatchdog::endl, APDHVSetting::feb, fH2, fHistoName, fHwMap, stan::math::floor(), fX, fXbin, fY, fYbin, om::GUIModel::Instance(), makeTrainCVSamples::int, om::kNEARDET, getGoodRuns4SAM::n, Munits::nm, NDAPDHVSetting::plane, om::GUIModel::SetHistogramInfoText(), registry_explorer::v, POTSpillRate::view, daqchannelmap::X_VIEW, daqchannelmap::HardwareDisplay::XYToDAQ(), and daqchannelmap::Y_VIEW.

Referenced by SingleClick().

247 {
248  char buff[256];
249 
250  int ix = (int)floor(fX);
251  int iy = (int)floor(fY);
252 
253  unsigned int diblock, dcm, feb, pix;
254  unsigned int block, plane, view, module, cell;
255 
256  fHwMap->XYToDAQ(&diblock, &dcm, &feb, &pix, ix, iy);
257 
258  //
259  // Figure out which diblock/dcm we are in. Histograms must conform
260  // to naming convention test_[db]_[dcm]
261  //
262  const char* nm = strchr(fHistoName.c_str(), '_');
263  if (nm!=NULL) {
264  ++nm;
265  unsigned int n = sscanf(nm,"%u_%u",&diblock,&dcm);
266  if (n!=2) {
267  std::cerr << "Bad histogram name decode " << fHistoName << std::endl;
268  diblock = 0;
269  dcm = 0;
270  }
271  }
272 
273  // For the NearDet we display global plane, for the FarDet & NDOS we
274  // display block and plane-in-block.
275 
276  if(GUIModel::Instance().Data().fDetector == kNEARDET) {
277 
278  // For NearDet
279  fHwMap->DAQToPlaneModCell(&block, &plane, &view, &module, &cell,
280  diblock, dcm, feb, pix);
281 
282  // Check that we are in an instrumented region
283  if (cell<=3*32) {
284  const char* v = "?";
285  if (view==daqchannelmap::X_VIEW) v = "V";
286  if (view==daqchannelmap::Y_VIEW) v = "H";
287  sprintf(buff,
288  "%s: Contents = %e\n"
289  "[Plane %d %s / Module %d / Cell %d] "
290  " [DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
291  fHistoName.c_str(),
292  fH2->GetBinContent(fXbin,fYbin),
293  plane,
294  v,
295  module,
296  cell,
297  diblock,
298  dcm,
299  feb,
300  pix);
301  }
302  else {
303  sprintf(buff,
304  "%s: Contents = %e"
305  "[Plane n/a / Module n/a / Cell n/a] "
306  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
307  fHistoName.c_str(),
308  fH2->GetBinContent(fXbin,fYbin),
309  diblock,
310  dcm,
311  feb,
312  pix);
313  }
314 
315  }
316  else {
317 
318  // For FarDet & NDOS
319  fHwMap->DAQToPlaneInBlockModCell(&block, &plane, &view, &module, &cell,
320  diblock, dcm, feb, pix);
321 
322  // Check that we are in an instrumented region
323  if (cell<=12*32) {
324  const char* v = "?";
325  if (view==daqchannelmap::X_VIEW) v = "V";
326  if (view==daqchannelmap::Y_VIEW) v = "H";
327  sprintf(buff,
328  "%s: Contents = %e\n"
329  "[Block %.2d / Plane in block %d %s / Module %d / Cell %d] "
330  " [DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
331  fHistoName.c_str(),
332  fH2->GetBinContent(fXbin,fYbin),
333  block,
334  plane,
335  v,
336  module,
337  cell,
338  diblock,
339  dcm,
340  feb,
341  pix);
342  }
343  else {
344  sprintf(buff,
345  "%s: Contents = %e"
346  "[Block %.2d / Plane n/a / Module n/a / Cell n/a] "
347  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
348  fHistoName.c_str(),
349  fH2->GetBinContent(fXbin,fYbin),
350  block,
351  diblock,
352  dcm,
353  feb,
354  pix);
355  }
356 
357  }
358 
360 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
void DAQToPlaneInBlockModCell(unsigned int *block, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
static constexpr Double_t nm
Definition: Munits.h:133
OStream cerr
Definition: OStream.cxx:7
void XYToDAQ(unsigned int *db, unsigned int *dcm, unsigned int *feb, unsigned int *pix, unsigned int ix, unsigned int iy)
daqchannelmap::HardwareDisplay * fHwMap
Identifier for the Y measuring view of the detector (side)
double fX
X position of click.
block
print "ROW IS " print row
Definition: elec2geo.py:31
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
double fY
Y position of click.
Identifier for the X measuring view of the detector (top)
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
void DAQToPlaneModCell(unsigned int *block, unsigned int *plane, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
fvar< T > floor(const fvar< T > &x)
Definition: floor.hpp:11
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
void PlotClickHandler::HwDetDoubleClick ( )
private
Todo:
: remove all of the hard-coded drill-down histos listed above

Definition at line 639 of file PlotClickHandler.cxx.

References febshutoff_auto::dcm, geo2elec::diblock, fHistoName, fHwMap, stan::math::floor(), fX, fY, analysePickle::hist, om::GUIModel::Instance(), makeTrainCVSamples::int, elec2geo::pos, om::GUIModel::SetCurrentHistogram(), string, APDHVSetting::temp, daqchannelmap::HardwareDisplay::XYDCM(), and daqchannelmap::HardwareDisplay::XYDiblock().

Referenced by DoubleClick().

640 {
641  int ix = (int)floor(fX);
642  int iy = (int)floor(fY);
643 
644  unsigned int diblock, dcm;
645  fHwMap->XYDiblock(&diblock, ix);
646  fHwMap->XYDCM (&dcm, iy);
647 
648  //
649  // Histograms which drill down to pixel views
650  //
651  const std::string DCMHitRateMap ("DCMHitRateMap");
652  const std::string DCMHitRateMapHighADC("DCMHitRateMapHighADC");
653  const std::string DCMHitRateMapLowADC ("DCMHitRateMapLowADC");
654  const std::string DCMHitRateMapMipADC ("DCMHitRateMapMipADC");
655  const std::string FEBHitRateMap ("FEBHitRateMap");
656  const std::string FEBHitRateMapHighADC("FEBHitRateMapHighADC");
657  const std::string FEBHitRateMapLowADC ("FEBHitRateMapLowADC");
658  const std::string FEBHitRateMapMipADC ("FEBHitRateMapMipADC");
659  const std::string PixelHitRateMap ("PixelHitRateMap");
660 
661  const std::string DCMHitMap ("DCMHitMap");
662  const std::string DCMHitMapHighADC("DCMHitMapHighADC");
663  const std::string DCMHitMapLowADC ("DCMHitMapLowADC");
664  const std::string DCMHitMapMipADC ("DCMHitMapMipADC");
665  const std::string FEBHitMap ("FEBHitMap");
666  const std::string FEBHitMapHighADC("FEBHitMapHighADC");
667  const std::string FEBHitMapLowADC ("FEBHitMapLowADC");
668  const std::string FEBHitMapMipADC ("FEBHitMapMipADC");
669  const std::string PixelHitMap ("PixelHitMap");
670 
671  const std::string TotADCFEBHitMap ("TotADCFEBHitMap");
672 
673  const std::string DPEbyPixelDCM ("DPEbyPixelDCM");
674  const std::string LSEbyPixelDCM ("LSEbyPixelDCM");
675  const std::string DbMbyPixelDCM ("DbMbyPixelDCM");
676  const std::string FEBFbyPixelDCM("FEBFbyPixelDCM");
677  const std::string FEBEbyPixelDCM("FEBEbyPixelDCM");
678  const std::string FIFObyPixelDCM("FIFObyPixelDCM");
679  const std::string TECCEnblbyPixelDCM("TECCEnblbyPixelDCM");
680  const std::string EDAQbyPixelDCM("EDAQbyPixelDCM");
681  const std::string DDEbyPixelDCM("DDEbyPixelDCM");
682  const std::string TECCErrbyPixelDCM("TECCErrbyPixelDCM");
683  const std::string ADCEbyPixelDCM("ADCEbyPixelDCM");
684  const std::string OFEbyPixelDCM ("OFEbyPixelDCM");
685  const std::string PEbyPixelDCM ("PEbyPixelDCM");
686  const std::string CEbyPixelDCM ("CEbyPixelDCM");
687 
688  const std::string BCbyDCM ("BCbyDCM");
689 
690 
691 
692  ///\todo: remove all of the hard-coded drill-down histos listed above
693  // and rename them according to the general scheme outlined below
694 
695  //
696  // Determine if histo is a drilldown histo from the name and set the
697  // current histogram to the appropriate DCM histo.
698  //
699 
700  bool drilldown = fHistoName.find("DET_dd") < fHistoName.length();
701 
702  if(drilldown) {
703  unsigned int pos = fHistoName.find("DET_dd");
704  std::string name = fHistoName.substr(0,pos);
705  char temp[256];
706  sprintf(temp, "DCM_%.2d_%.2d",diblock,dcm);
707  name += temp;
708  GUIModel::Instance().SetCurrentHistogram(name.c_str());
709  }
710 
711 
712  if (DCMHitMap == fHistoName ||
713  FEBHitMap == fHistoName ||
714  PixelHitMap == fHistoName) {
715  char hist[256];
716  sprintf(hist, "PixelsDCM_%.2d_%.2d",diblock,dcm);
718  return;
719  }
720  if (DCMHitMapHighADC == fHistoName ||
721  FEBHitMapHighADC == fHistoName) {
722  char hist[256];
723  sprintf(hist, "HighADCPixelsDCM_%.2d_%.2d",diblock,dcm);
725  return;
726  }
727  if (DCMHitMapLowADC == fHistoName ||
728  FEBHitMapLowADC == fHistoName) {
729  char hist[256];
730  sprintf(hist, "LowADCPixelsDCM_%.2d_%.2d",diblock,dcm);
732  return;
733  }
734  if (DCMHitMapMipADC == fHistoName ||
735  FEBHitMapMipADC == fHistoName) {
736  char hist[256];
737  sprintf(hist, "MipADCPixelsDCM_%.2d_%.2d",diblock,dcm);
739  return;
740  }
741  if (DCMHitRateMap == fHistoName ||
742  FEBHitRateMap == fHistoName ||
743  PixelHitRateMap == fHistoName) {
744  char hist[256];
745  sprintf(hist, "PixelsRateDCM_%.2d_%.2d",diblock,dcm);
747  return;
748  }
749  if (DCMHitRateMapHighADC == fHistoName ||
750  FEBHitRateMapHighADC == fHistoName) {
751  char hist[256];
752  sprintf(hist, "HighADCPixelsRateDCM_%.2d_%.2d",diblock,dcm);
754  return;
755  }
756  if (DCMHitRateMapLowADC == fHistoName ||
757  FEBHitRateMapLowADC == fHistoName) {
758  char hist[256];
759  sprintf(hist, "LowADCPixelsRateDCM_%.2d_%.2d",diblock,dcm);
761  return;
762  }
763  if (DCMHitRateMapMipADC == fHistoName ||
764  FEBHitRateMapMipADC == fHistoName) {
765  char hist[256];
766  sprintf(hist, "MipADCPixelsRateDCM_%.2d_%.2d",diblock,dcm);
768  return;
769  }
770 
771 
772  if (TotADCFEBHitMap == fHistoName) {
773  char hist[256];
774  sprintf(hist, "TotADCPixelsDCM_%.2d_%.2d",diblock,dcm);
776  return;
777  }
778 
779 
780  if (DPEbyPixelDCM == fHistoName) {
781  char hist[256];
782  sprintf(hist, "DPEperDCM_%.2d_%.2d",diblock,dcm);
784  return;
785  }
786  if (LSEbyPixelDCM == fHistoName) {
787  char hist[256];
788  sprintf(hist, "LSEperDCM_%.2d_%.2d",diblock,dcm);
790  return;
791  }
792  if (DbMbyPixelDCM == fHistoName) {
793  char hist[256];
794  sprintf(hist, "DbMperDCM_%.2d_%.2d",diblock,dcm);
796  return;
797  }
798  if (FEBFbyPixelDCM == fHistoName) {
799  char hist[256];
800  sprintf(hist, "FEBFperDCM_%.2d_%.2d",diblock,dcm);
802  return;
803  }
804  if (FEBEbyPixelDCM == fHistoName) {
805  char hist[256];
806  sprintf(hist, "FEBEperDCM_%.2d_%.2d",diblock,dcm);
808  return;
809  }
810  if (FIFObyPixelDCM == fHistoName) {
811  char hist[256];
812  sprintf(hist, "FIFOperDCM_%.2d_%.2d",diblock,dcm);
814  return;
815  }
816  if (TECCEnblbyPixelDCM == fHistoName) {
817  char hist[256];
818  sprintf(hist, "TECCEnblperDCM_%.2d_%.2d",diblock,dcm);
820  return;
821  }
822  if (EDAQbyPixelDCM == fHistoName) {
823  char hist[256];
824  sprintf(hist, "EDAQperDCM_%.2d_%.2d",diblock,dcm);
826  return;
827  }
828  if (DDEbyPixelDCM == fHistoName) {
829  char hist[256];
830  sprintf(hist, "DDEperDCM_%.2d_%.2d",diblock,dcm);
832  return;
833  }
834  if (TECCErrbyPixelDCM == fHistoName) {
835  char hist[256];
836  sprintf(hist, "TECCErrperDCM_%.2d_%.2d",diblock,dcm);
838  return;
839  }
840  if (ADCEbyPixelDCM == fHistoName) {
841  char hist[256];
842  sprintf(hist, "ADCEperDCM_%.2d_%.2d",diblock,dcm);
844  return;
845  }
846  if (OFEbyPixelDCM == fHistoName) {
847  char hist[256];
848  sprintf(hist, "OFEperDCM_%.2d_%.2d",diblock,dcm);
850  return;
851  }
852  if (PEbyPixelDCM == fHistoName) {
853  char hist[256];
854  sprintf(hist, "PEperDCM_%.2d_%.2d",diblock,dcm);
856  return;
857  }
858  if (CEbyPixelDCM == fHistoName) {
859  char hist[256];
860  sprintf(hist, "CEperDCM_%.2d_%.2d",diblock,dcm);
862  return;
863  }
864  if (BCbyDCM == fHistoName) {
865  char hist[256];
866  sprintf(hist, "BCperDCM_%.2d_%.2d",diblock,dcm);
868  return;
869  }
870 }
const XML_Char * name
Definition: expat.h:151
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
void XYDCM(unsigned int *dcm, unsigned int iy)
daqchannelmap::HardwareDisplay * fHwMap
double fX
X position of click.
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
double fY
Y position of click.
void SetCurrentHistogram(const char *h)
Definition: GUIModel.cxx:102
fvar< T > floor(const fvar< T > &x)
Definition: floor.hpp:11
void XYDiblock(unsigned int *db, unsigned int ix)
enum BeamMode string
void PlotClickHandler::HwDetHistogramInfo ( )
private

Definition at line 148 of file PlotClickHandler.cxx.

References elec2geo::block, getBrightness::cell, daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), febshutoff_auto::dcm, geo2elec::diblock, APDHVSetting::feb, fH2, fHistoName, fHwMap, stan::math::floor(), fX, fXbin, fY, fYbin, om::GUIModel::Instance(), makeTrainCVSamples::int, om::kNEARDET, NDAPDHVSetting::plane, om::GUIModel::SetHistogramInfoText(), registry_explorer::v, POTSpillRate::view, daqchannelmap::X_VIEW, daqchannelmap::HardwareDisplay::XYToDAQ(), and daqchannelmap::Y_VIEW.

Referenced by SingleClick().

149 {
150  char buff[256];
151 
152  int ix = (int)floor(fX);
153  int iy = (int)floor(fY);
154 
155  unsigned int diblock, dcm, feb, pix;
156  unsigned int block, plane, view, module, cell;
157 
158  fHwMap->XYToDAQ(&diblock, &dcm, &feb, &pix, ix, iy);
159 
160  // For the NearDet we display global plane, for the FarDet & NDOS we
161  // display block and plane-in-block.
162 
163  if(GUIModel::Instance().Data().fDetector == kNEARDET) {
164 
165  // For NearDet
166  fHwMap->DAQToPlaneModCell(&block, &plane, &view, &module, &cell,
167  diblock, dcm, feb, pix);
168 
169  // Check that we are in an instrumented region
170  if (module<=2) {
171  const char* v = "?";
172  if (view==daqchannelmap::X_VIEW) v = "V";
173  if (view==daqchannelmap::Y_VIEW) v = "H";
174  sprintf(buff,
175  "%s: Contents = %e\n"
176  "[Plane %d %s / Module %d] "
177  "[DB %.2d / DCM %.2d / FEB %2d]",
178  fHistoName.c_str(),
179  fH2->GetBinContent(fXbin,fYbin),
180  plane,
181  v,
182  module,
183  diblock,
184  dcm,
185  feb);
186 
187  }
188  else {
189  sprintf(buff,
190  "%s: Contents = %e\n"
191  "[Plane n/a / Module n/a] "
192  "[DB %.2d / DCM %.2d / FEB %2d]",
193  fHistoName.c_str(),
194  fH2->GetBinContent(fXbin,fYbin),
195  diblock,
196  dcm,
197  feb);
198 
199  }
200  }
201  else {
202 
203  // For FarDet & NDOS
204  fHwMap->DAQToPlaneInBlockModCell(&block, &plane, &view, &module, &cell,
205  diblock, dcm, feb, pix);
206 
207  // Check that we are in an instrumented region
208  if (module<=11) {
209  const char* v = "?";
210  if (view==daqchannelmap::X_VIEW) v = "V";
211  if (view==daqchannelmap::Y_VIEW) v = "H";
212  sprintf(buff,
213  "%s: Contents = %e\n"
214  "[Block %.2d / Plane in block %d %s / Module %d] "
215  "[DB %.2d / DCM %.2d / FEB %2d]",
216  fHistoName.c_str(),
217  fH2->GetBinContent(fXbin,fYbin),
218  block,
219  plane,
220  v,
221  module,
222  diblock,
223  dcm,
224  feb);
225  }
226  else {
227  sprintf(buff,
228  "%s: Contents = %e\n"
229  "[Block %.2d / Plane n/a / Module n/a] "
230  "[DB %.2d / DCM %.2d / FEB %2d]",
231  fHistoName.c_str(),
232  fH2->GetBinContent(fXbin,fYbin),
233  block,
234  diblock,
235  dcm,
236  feb);
237  }
238 
239  }
240 
242 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
void DAQToPlaneInBlockModCell(unsigned int *block, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
void XYToDAQ(unsigned int *db, unsigned int *dcm, unsigned int *feb, unsigned int *pix, unsigned int ix, unsigned int iy)
daqchannelmap::HardwareDisplay * fHwMap
Identifier for the Y measuring view of the detector (side)
double fX
X position of click.
block
print "ROW IS " print row
Definition: elec2geo.py:31
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
double fY
Y position of click.
Identifier for the X measuring view of the detector (top)
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
void DAQToPlaneModCell(unsigned int *block, unsigned int *plane, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
fvar< T > floor(const fvar< T > &x)
Definition: floor.hpp:11
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
void PlotClickHandler::HwPCHistogramInfoX ( )
private

Definition at line 364 of file PlotClickHandler.cxx.

References elec2geo::block, getBrightness::cell, febshutoff_auto::dcm, geo2elec::diblock, APDHVSetting::feb, fH2, fHistoName, fHwMap, fXbin, fYbin, om::GUIModel::Instance(), om::kNEARDET, NDAPDHVSetting::plane, daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), om::GUIModel::SetHistogramInfoText(), POTSpillRate::view, and daqchannelmap::X_VIEW.

Referenced by SingleClick().

365 {
366  unsigned int diblock, block, dcm, feb, pix;
367  unsigned int plane, pinb, view, module, cell;
368 
369  plane = fH2->GetNbinsX() - fXbin;
370  cell = fH2->GetNbinsY() - fYbin;
371 
372  fHwMap->PlaneCellToDAQ(plane, &pinb, &view, &module, cell,
373  &diblock, &block, &dcm, &feb, &pix);
374 
375  char buff[256];
376 
377  // For the NearDet we display global plane, for the FarDet & NDOS we
378  // display block and plane-in-block.
379 
380  if(GUIModel::Instance().Data().fDetector == kNEARDET) {
381 
382  // For NearDet
383 
384  // Check to see if we clicked on a bin cooresponding to a plane in the
385  // other view (in which case db, dcm, etc. will be wrong.)
386  if(view == daqchannelmap::X_VIEW) {
387  sprintf(buff,
388  "%s: Contents = %e\n"
389  "[Plane %d V / Module %d / Cell %d] "
390  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
391  fHistoName.c_str(),
392  fH2->GetBinContent(fXbin,fYbin),
393  plane,
394  module,
395  cell,
396  diblock,
397  dcm,
398  feb,
399  pix);
400  }
401  else {
402  sprintf(buff,
403  "%s: Contents = %e\n"
404  "[Plane %dH]",
405  fHistoName.c_str(),
406  fH2->GetBinContent(fXbin,fYbin),
407  plane);
408  }
409 
410  }
411  else {
412 
413  // For FarDet & NDOS
414 
415  // Check to see if we clicked on a bin cooresponding to a plane in the
416  // other view (in which case db, dcm, etc. will be wrong.)
417  if(view == daqchannelmap::X_VIEW) {
418  sprintf(buff,
419  "%s: Contents = %e\n"
420  "[Block %.2d / Plane in block %d V / Module %d / Cell %d] "
421  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
422  fHistoName.c_str(),
423  fH2->GetBinContent(fXbin,fYbin),
424  block,
425  pinb,
426  module,
427  cell,
428  diblock,
429  dcm,
430  feb,
431  pix);
432  }
433  else {
434  sprintf(buff,
435  "%s: Contents = %e\n"
436  "[Plane %dH]",
437  fHistoName.c_str(),
438  fH2->GetBinContent(fXbin,fYbin),
439  plane);
440  }
441 
442  }
443 
445 }
void PlaneCellToDAQ(unsigned int plane, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int cell, unsigned int *db, unsigned int *block, unsigned int *dcm, unsigned int *feb, unsigned int *pix)
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
daqchannelmap::HardwareDisplay * fHwMap
block
print "ROW IS " print row
Definition: elec2geo.py:31
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
Identifier for the X measuring view of the detector (top)
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
void PlotClickHandler::HwPCHistogramInfoY ( )
private

Definition at line 449 of file PlotClickHandler.cxx.

References elec2geo::block, getBrightness::cell, febshutoff_auto::dcm, geo2elec::diblock, APDHVSetting::feb, fH2, fHistoName, fHwMap, fXbin, fYbin, om::GUIModel::Instance(), om::kNEARDET, NDAPDHVSetting::plane, daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), om::GUIModel::SetHistogramInfoText(), POTSpillRate::view, and daqchannelmap::Y_VIEW.

Referenced by SingleClick().

450 {
451  unsigned int diblock, block, dcm, feb, pix;
452  unsigned int plane, pinb, view, module, cell;
453 
454  plane = fH2->GetNbinsX() - fXbin;
455  cell = fYbin - 1;
456 
457  fHwMap->PlaneCellToDAQ(plane, &pinb, &view, &module, cell,
458  &diblock, &block, &dcm, &feb, &pix);
459 
460  char buff[256];
461 
462  // For the NearDet we display global plane, for the FarDet & NDOS we
463  // display block and plane-in-block.
464 
465  if(GUIModel::Instance().Data().fDetector == kNEARDET) {
466 
467  // For NearDet
468 
469  // Check to see if we clicked on a bin cooresponding to a plane in the
470  // other view (in which case db, dcm, etc. will be wrong.)
471  if(view == daqchannelmap::Y_VIEW) {
472  sprintf(buff,
473  "%s: Contents = %e\n"
474  "[Plane %d H / Module %d / Cell %d] "
475  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
476  fHistoName.c_str(),
477  fH2->GetBinContent(fXbin,fYbin),
478  plane,
479  module,
480  cell,
481  diblock,
482  dcm,
483  feb,
484  pix);
485  }
486  else {
487  sprintf(buff,
488  "%s: Contents = %e\n"
489  "[Plane %dV]",
490  fHistoName.c_str(),
491  fH2->GetBinContent(fXbin,fYbin),
492  plane);
493  }
494 
495  }
496  else {
497 
498  // For FarDet & NDOS
499 
500  // Check to see if we clicked on a bin cooresponding to a plane in the
501  // other view (in which case db, dcm, etc. will be wrong.)
502  if(view == daqchannelmap::Y_VIEW) {
503  sprintf(buff,
504  "%s: Contents = %e\n"
505  "[Block %.2d / Plane in block %d H / Module %d / Cell %d] "
506  "[DB %.2d / DCM %.2d / FEB %2d / PIX %2d]",
507  fHistoName.c_str(),
508  fH2->GetBinContent(fXbin,fYbin),
509  block,
510  pinb,
511  module,
512  cell,
513  diblock,
514  dcm,
515  feb,
516  pix);
517  }
518  else {
519  sprintf(buff,
520  "%s: Contents = %e\n"
521  "[Plane %dV]",
522  fHistoName.c_str(),
523  fH2->GetBinContent(fXbin,fYbin),
524  plane);
525  }
526 
527  }
528 
530 }
void PlaneCellToDAQ(unsigned int plane, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int cell, unsigned int *db, unsigned int *block, unsigned int *dcm, unsigned int *feb, unsigned int *pix)
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
daqchannelmap::HardwareDisplay * fHwMap
Identifier for the Y measuring view of the detector (side)
block
print "ROW IS " print row
Definition: elec2geo.py:31
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistoName
Name of Current Histogram.
void SetHistogramInfoText(const char *t)
Definition: GUIModel.cxx:129
int fYbin
Y bin number of click.
TH2 * fH2
2D histogram clicked on
int fXbin
X bin number of click.
void PlotClickHandler::SingleClick ( const PlotOptions plotopt)

Definition at line 31 of file PlotClickHandler.cxx.

References DCMutcInfo(), DecodeClick(), DefaultHistogramInfo(), FEButcInfo(), fHistoName, om::PlotOptions::fHwLblDCM, om::PlotOptions::fHwLblDet, om::PlotOptions::fHwLblPCX, om::PlotOptions::fHwLblPCY, HwDCMHistogramInfo(), HwDetHistogramInfo(), HwPCHistogramInfoX(), and HwPCHistogramInfoY().

Referenced by om::PlotViewer::Exec().

32 {
33  int decoded = this->DecodeClick();
34  if (decoded==0) return;
35 
36  if (plotopt.fHwLblDet) this->HwDetHistogramInfo();
37  else if (plotopt.fHwLblDCM) this->HwDCMHistogramInfo();
38  else if (plotopt.fHwLblPCX) this->HwPCHistogramInfoX();
39  else if (plotopt.fHwLblPCY) this->HwPCHistogramInfoY();
40  else if (fHistoName.find("FEBRatesVsHourDB") < fHistoName.length() ||
41  fHistoName.find("FEBHitsVsHourDB") < fHistoName.length())
42  this->FEButcInfo();
43  else if (fHistoName.find("DCMRatesVsHour") < fHistoName.length() ||
44  fHistoName.find("DCMHitsVsHour") < fHistoName.length() ||
45  fHistoName.find("EmptyDCMsVsHour") < fHistoName.length())
46  this->DCMutcInfo();
47  else this->DefaultHistogramInfo();
48 }
std::string fHistoName
Name of Current Histogram.
bool fHwLblDet
Apply hardware label to detector-wide plot.
Definition: PlotOptions.h:51
bool fHwLblPCX
Apply hardware labels to plane/cell plot (X-view)
Definition: PlotOptions.h:54
bool fHwLblPCY
Apply hardware labels to plane/cell plot (Y-view)
Definition: PlotOptions.h:55
bool fHwLblDCM
Apply hardware label to DCM plot.
Definition: PlotOptions.h:53

Member Data Documentation

TH1* om::PlotClickHandler::fH1
private

1D histogram clicked on

Definition at line 38 of file PlotClickHandler.h.

Referenced by DecodeClick(), and DefaultHistogramInfo().

TH2* om::PlotClickHandler::fH2
private
std::string om::PlotClickHandler::fHistoName
private
daqchannelmap::HardwareDisplay* om::PlotClickHandler::fHwMap
private
double om::PlotClickHandler::fX
private

X position of click.

Definition at line 40 of file PlotClickHandler.h.

Referenced by DecodeClick(), DefaultHistogramInfo(), HwDCMHistogramInfo(), HwDetDoubleClick(), and HwDetHistogramInfo().

int om::PlotClickHandler::fXbin
private
double om::PlotClickHandler::fY
private

Y position of click.

Definition at line 41 of file PlotClickHandler.h.

Referenced by DecodeClick(), DefaultHistogramInfo(), HwDCMHistogramInfo(), HwDetDoubleClick(), and HwDetHistogramInfo().

int om::PlotClickHandler::fYbin
private

The documentation for this class was generated from the following files: