LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evd::ColorDrawingOptions Class Reference

#include "ColorDrawingOptions.h"

Inheritance diagram for evd::ColorDrawingOptions:
evdb::Reconfigurable

Public Member Functions

 ColorDrawingOptions (fhicl::ParameterSet const &pset)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
const evdb::ColorScaleRawQ (geo::SigType_t st) const
 
const evdb::ColorScaleCalQ (geo::SigType_t st) const
 
const evdb::ColorScaleRawT (geo::SigType_t st) const
 
const evdb::ColorScaleCalT (geo::SigType_t st) const
 
void do_reconfigure (fhicl::ParameterSet const &pset)
 

Public Attributes

int fColorOrGray
 0 = color, 1 = gray More...
 
std::vector< int > fRawDiv
 number of divisions in raw More...
 
std::vector< int > fRecoDiv
 number of divisions in raw More...
 
std::vector< double > fRawQLow
 low edge of ADC values for drawing raw digits More...
 
std::vector< double > fRawQHigh
 high edge of ADC values for drawing raw digits More...
 
std::vector< double > fRecoQLow
 low edge of ADC values for drawing raw digits More...
 
std::vector< double > fRecoQHigh
 high edge of ADC values for drawing raw digits More...
 

Private Member Functions

void CheckInputVectorSizes ()
 

Private Attributes

std::vector< evdb::ColorScalefColorScaleRaw
 
std::vector< evdb::ColorScalefColorScaleReco
 
std::vector< evdb::ColorScalefGrayScaleRaw
 
std::vector< evdb::ColorScalefGrayScaleReco
 

Detailed Description

Definition at line 20 of file ColorDrawingOptions.h.

Constructor & Destructor Documentation

evd::ColorDrawingOptions::ColorDrawingOptions ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 15 of file ColorDrawingOptions.cc.

References CheckInputVectorSizes(), fColorOrGray, fColorScaleRaw, fColorScaleReco, fGrayScaleRaw, fGrayScaleReco, fRawDiv, fRawQHigh, fRawQLow, fRecoDiv, fRecoQHigh, fRecoQLow, evdb::kBlueToRedII, evdb::kLinear, and evdb::kLinGray.

16  : evdb::Reconfigurable{pset}
17  , fColorOrGray(pset.get<int>("ColorOrGrayScale"))
18  , fRawDiv(pset.get<std::vector<int>>("RawDiv"))
19  , fRecoDiv(pset.get<std::vector<int>>("RecoDiv"))
20  , fRawQLow(pset.get<std::vector<double>>("RawQLow"))
21  , fRawQHigh(pset.get<std::vector<double>>("RawQHigh"))
22  , fRecoQLow(pset.get<std::vector<double>>("RecoQLow"))
23  , fRecoQHigh(pset.get<std::vector<double>>("RecoQHigh"))
24  {
25  this->CheckInputVectorSizes();
26 
27  for (size_t i = 0; i < fRawDiv.size(); ++i) {
29  fRawQHigh[i],
32  fRawDiv[i],
33  285.0,
34  135.0, // angle in the color wheel
35  0.65,
36  0.25)); // intensity from light to dark,
37  // starting with low color wheel value
38 
40  fRawQHigh[i],
43  fRawDiv[i],
44  270.0,
45  0.0, // angle in the color wheel
46  0.5,
47  0.5)); // intensity from light to dark,
48  // starting with low color wheel value
49  }
50 
51  for (size_t i = 0; i < fRecoDiv.size(); ++i) {
53  fRecoQHigh[i],
56  fRecoDiv[i],
57  285.0,
58  135.0,
59  0.65,
60  0.25));
62  fRecoQHigh[i],
65  fRecoDiv[i],
66  270.0,
67  0.0,
68  0.5,
69  0.5));
70  }
71  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleReco
std::vector< evdb::ColorScale > fColorScaleRaw
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
Build an association between a numerical range and a ROOT color index for use in, eg...
Definition: ColorScale.h:44
std::vector< int > fRawDiv
number of divisions in raw
Blue = cold, red = hot.
Definition: ColorScale.h:21
Rainbow with high and low flipped.
Definition: ColorScale.h:18
std::vector< double > fRawQHigh
high edge of ADC values for drawing raw digits
int fColorOrGray
0 = color, 1 = gray
std::vector< int > fRecoDiv
number of divisions in raw
std::vector< evdb::ColorScale > fGrayScaleReco

Member Function Documentation

const evdb::ColorScale & evd::ColorDrawingOptions::CalQ ( geo::SigType_t  st) const

Definition at line 163 of file ColorDrawingOptions.cc.

References fColorOrGray, fColorScaleReco, fGrayScaleReco, and geo::kMysteryType.

Referenced by evdb_tool::SpacePoint3DDrawerChiSquare::Draw(), evdb_tool::SpacePoint3DDrawerHitAsymmetry::Draw(), evdb_tool::SpacePoint3DDrawerHitCharge::Draw(), evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), and evd::RecoBaseDrawer::Wire2D().

164  {
165  size_t pos = (size_t)st;
166 
167  if (st == geo::kMysteryType)
168  throw cet::exception("ColorDrawingOptions") << "asked for CalQ with geo::kMysteryType, "
169  << "bad things will happen, so bail\n";
170 
171  if (fColorOrGray > 0) return fGrayScaleReco[pos];
172 
173  return fColorScaleReco[pos];
174  }
Who knows?
Definition: geo_types.h:153
std::vector< evdb::ColorScale > fColorScaleReco
int fColorOrGray
0 = color, 1 = gray
std::vector< evdb::ColorScale > fGrayScaleReco
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const evdb::ColorScale & evd::ColorDrawingOptions::CalT ( geo::SigType_t  st) const

Definition at line 191 of file ColorDrawingOptions.cc.

References fColorOrGray, fColorScaleReco, fGrayScaleReco, and geo::kMysteryType.

192  {
193  size_t pos = (size_t)st;
194 
195  if (st == geo::kMysteryType)
196  throw cet::exception("ColorDrawingOptions") << "asked for CalT with geo::kMysteryType, "
197  << "bad things will happen, so bail\n";
198 
199  if (fColorOrGray > 0) return fGrayScaleReco[pos];
200 
201  return fColorScaleReco[pos];
202  }
Who knows?
Definition: geo_types.h:153
std::vector< evdb::ColorScale > fColorScaleReco
int fColorOrGray
0 = color, 1 = gray
std::vector< evdb::ColorScale > fGrayScaleReco
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evd::ColorDrawingOptions::CheckInputVectorSizes ( )
private

Definition at line 74 of file ColorDrawingOptions.cc.

References fRawDiv, fRawQHigh, fRawQLow, fRecoDiv, fRecoQHigh, fRecoQLow, and geo::kMysteryType.

Referenced by ColorDrawingOptions(), and reconfigure().

75  {
76 
77  // compare all input vectors for reco and raw color scaling against
78  // the number of possible signal types in the geometry
79  if (fRawDiv.size() != geo::kMysteryType) {
80  if (fRawDiv.size() == 1 && fRawQLow.size() == 1 && fRawQHigh.size() == 1) {
81  // pad out the vectors to all have the same entries
82  fRawDiv.resize(geo::kMysteryType, fRawDiv[0]);
85  mf::LogWarning("ColorDrawingOptions")
86  << "only 1 value given for raw color scale: "
87  << "number of divisions, low and high values.\n"
88  << "Pad out those values for the number of signal types.";
89  }
90  else
91  throw cet::exception("ColorDrawingOptionsUnclear")
92  << "You have specified an incorrect number of "
93  << "values for the raw color/gray scale "
94  << "than there are types of signal planes in "
95  << "the detector. It is unclear what your "
96  << "intention is, so bail.\n";
97  } // end check on the raw vector sizes
98 
99  if (fRecoDiv.size() != geo::kMysteryType) {
100  if (fRecoDiv.size() == 1 && fRecoQLow.size() == 1 && fRecoQHigh.size() == 1) {
101  // pad out the vectors to all have the same entries
102  fRecoDiv.resize(geo::kMysteryType, fRecoDiv[0]);
105  mf::LogWarning("ColorDrawingOptions")
106  << "only 1 value given for reco color scale: "
107  << "number of divisions, low and high values.\n"
108  << "Pad out those values for the number of signal types.";
109  }
110  else
111  throw cet::exception("ColorDrawingOptionsUnclear")
112  << "You have specified an incorrect number of "
113  << "values for the reco color/gray scale "
114  << "than there are types of signal planes in "
115  << "the detector. It is unclear what your "
116  << "intention is, so bail.\n";
117  } // end check on the reco vector sizes
118 
119  return;
120  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
Who knows?
Definition: geo_types.h:153
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
std::vector< int > fRawDiv
number of divisions in raw
std::vector< double > fRawQHigh
high edge of ADC values for drawing raw digits
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< int > fRecoDiv
number of divisions in raw
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evdb::Reconfigurable::do_reconfigure ( fhicl::ParameterSet const &  pset)
inlineinherited

Definition at line 16 of file Reconfigurable.h.

References evdb::Reconfigurable::reconfigure(), and evdb::Reconfigurable::~Reconfigurable().

16 { reconfigure(pset); }
virtual void reconfigure(fhicl::ParameterSet const &)=0
const evdb::ColorScale & evd::ColorDrawingOptions::RawQ ( geo::SigType_t  st) const

Definition at line 149 of file ColorDrawingOptions.cc.

References fColorOrGray, fColorScaleRaw, fGrayScaleRaw, and geo::kMysteryType.

Referenced by evd::RawDataDrawer::QueueDrawingBoxes().

150  {
151  size_t pos = (size_t)st;
152 
153  if (st == geo::kMysteryType)
154  throw cet::exception("ColorDrawingOptions") << "asked for RawQ with geo::kMysteryType, "
155  << "bad things will happen, so bail\n";
156 
157  if (fColorOrGray > 0) return fGrayScaleRaw[pos];
158 
159  return fColorScaleRaw[pos];
160  }
Who knows?
Definition: geo_types.h:153
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleRaw
int fColorOrGray
0 = color, 1 = gray
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const evdb::ColorScale & evd::ColorDrawingOptions::RawT ( geo::SigType_t  st) const

Definition at line 177 of file ColorDrawingOptions.cc.

References fColorOrGray, fColorScaleRaw, fGrayScaleRaw, and geo::kMysteryType.

178  {
179  size_t pos = (size_t)st;
180 
181  if (st == geo::kMysteryType)
182  throw cet::exception("ColorDrawingOptions") << "asked for RawT with geo::kMysteryType, "
183  << "bad things will happen, so bail\n";
184 
185  if (fColorOrGray > 0) return fGrayScaleRaw[pos];
186 
187  return fColorScaleRaw[pos];
188  }
Who knows?
Definition: geo_types.h:153
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleRaw
int fColorOrGray
0 = color, 1 = gray
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evd::ColorDrawingOptions::reconfigure ( fhicl::ParameterSet const &  pset)
virtual

Implements evdb::Reconfigurable.

Definition at line 123 of file ColorDrawingOptions.cc.

References CheckInputVectorSizes(), fColorOrGray, fColorScaleRaw, fColorScaleReco, fGrayScaleRaw, fGrayScaleReco, fRawDiv, fRawQHigh, fRawQLow, fRecoDiv, fRecoQHigh, fRecoQLow, and fhicl::ParameterSet::get().

124  {
125  fColorOrGray = pset.get<int>("ColorOrGrayScale");
126  fRawDiv = pset.get<std::vector<int>>("RawDiv");
127  fRecoDiv = pset.get<std::vector<int>>("RecoDiv");
128  fRawQLow = pset.get<std::vector<double>>("RawQLow");
129  fRawQHigh = pset.get<std::vector<double>>("RawQHigh");
130  fRecoQLow = pset.get<std::vector<double>>("RecoQLow");
131  fRecoQHigh = pset.get<std::vector<double>>("RecoQHigh");
132 
133  this->CheckInputVectorSizes();
134 
135  for (size_t i = 0; i < fRawDiv.size(); ++i) {
136  fColorScaleRaw[i].SetBounds(fRawQLow[i], fRawQHigh[i]);
137  fGrayScaleRaw[i].SetBounds(fRawQLow[i], fRawQHigh[i]);
138  }
139 
140  for (size_t i = 0; i < fRecoDiv.size(); ++i) {
141  fColorScaleReco[i].SetBounds(fRecoQLow[i], fRecoQHigh[i]);
142  fGrayScaleReco[i].SetBounds(fRecoQLow[i], fRecoQHigh[i]);
143  }
144 
145  return;
146  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleReco
std::vector< evdb::ColorScale > fColorScaleRaw
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
std::vector< int > fRawDiv
number of divisions in raw
std::vector< double > fRawQHigh
high edge of ADC values for drawing raw digits
int fColorOrGray
0 = color, 1 = gray
std::vector< int > fRecoDiv
number of divisions in raw
std::vector< evdb::ColorScale > fGrayScaleReco

Member Data Documentation

int evd::ColorDrawingOptions::fColorOrGray
std::vector<evdb::ColorScale> evd::ColorDrawingOptions::fColorScaleRaw
private

Definition at line 42 of file ColorDrawingOptions.h.

Referenced by ColorDrawingOptions(), RawQ(), RawT(), and reconfigure().

std::vector<evdb::ColorScale> evd::ColorDrawingOptions::fColorScaleReco
private

Definition at line 43 of file ColorDrawingOptions.h.

Referenced by CalQ(), CalT(), ColorDrawingOptions(), and reconfigure().

std::vector<evdb::ColorScale> evd::ColorDrawingOptions::fGrayScaleRaw
private

Definition at line 44 of file ColorDrawingOptions.h.

Referenced by ColorDrawingOptions(), RawQ(), RawT(), and reconfigure().

std::vector<evdb::ColorScale> evd::ColorDrawingOptions::fGrayScaleReco
private

Definition at line 45 of file ColorDrawingOptions.h.

Referenced by CalQ(), CalT(), ColorDrawingOptions(), and reconfigure().

std::vector<int> evd::ColorDrawingOptions::fRawDiv

number of divisions in raw

Definition at line 32 of file ColorDrawingOptions.h.

Referenced by CheckInputVectorSizes(), ColorDrawingOptions(), and reconfigure().

std::vector<double> evd::ColorDrawingOptions::fRawQHigh

high edge of ADC values for drawing raw digits

Definition at line 35 of file ColorDrawingOptions.h.

Referenced by evdb_tool::DrawRawHist::BookHistogram(), evd::TQPad::BookHistogram(), CheckInputVectorSizes(), ColorDrawingOptions(), and reconfigure().

std::vector<double> evd::ColorDrawingOptions::fRawQLow

low edge of ADC values for drawing raw digits

Definition at line 34 of file ColorDrawingOptions.h.

Referenced by evdb_tool::DrawRawHist::BookHistogram(), evd::TQPad::BookHistogram(), CheckInputVectorSizes(), ColorDrawingOptions(), and reconfigure().

std::vector<int> evd::ColorDrawingOptions::fRecoDiv

number of divisions in raw

Definition at line 33 of file ColorDrawingOptions.h.

Referenced by CheckInputVectorSizes(), ColorDrawingOptions(), and reconfigure().


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