LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
evd::ColorDrawingOptions Class Reference

#include "ColorDrawingOptions.h"

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

Public Member Functions

 ColorDrawingOptions (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~ColorDrawingOptions ()
 
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 17 of file ColorDrawingOptions.h.

Constructor & Destructor Documentation

evd::ColorDrawingOptions::ColorDrawingOptions ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)
explicit

Definition at line 19 of file ColorDrawingOptions_service.cc.

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

20  : evdb::Reconfigurable{pset}
21  , fColorOrGray(pset.get< int >("ColorOrGrayScale"))
22  , fRawDiv (pset.get< std::vector<int> >("RawDiv") )
23  , fRecoDiv (pset.get< std::vector<int> >("RecoDiv") )
24  , fRawQLow (pset.get< std::vector<double> >("RawQLow") )
25  , fRawQHigh (pset.get< std::vector<double> >("RawQHigh") )
26  , fRecoQLow (pset.get< std::vector<double> >("RecoQLow") )
27  , fRecoQHigh (pset.get< std::vector<double> >("RecoQHigh") )
28  {
29  this->CheckInputVectorSizes();
30 
31  for(size_t i = 0; i < fRawDiv.size(); ++i){
34  fRawDiv[i],
35  285.0, 135.0, // angle in the color wheel
36  0.65, 0.25)); // intensity from light to dark,
37  // starting with low color wheel value
38 
41  fRawDiv[i],
42  270.0, 0.0, // angle in the color wheel
43  0.5, 0.5)); // intensity from light to dark,
44  // starting with low color wheel value
45  }
46 
47  for(size_t i = 0; i < fRecoDiv.size(); ++i){
50  fRecoDiv[i],
51  285.0, 135.0,
52  0.65, 0.25));
55  fRecoDiv[i],
56  270.0, 0.0,
57  0.5, 0.5));
58  }
59 
60  return;
61  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
std::vector< int > fRawDiv
number of divisions in raw
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
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
evd::ColorDrawingOptions::~ColorDrawingOptions ( )

Definition at line 64 of file ColorDrawingOptions_service.cc.

65  {
66  }

Member Function Documentation

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

Definition at line 154 of file ColorDrawingOptions_service.cc.

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

Referenced by evd::TQPad::Draw(), evd::RecoBaseDrawer::DrawPFParticle3D(), and evd::RecoBaseDrawer::Wire2D().

155  {
156  size_t pos = (size_t)st;
157 
158  if(st == geo::kMysteryType)
159  throw cet::exception("ColorDrawingOptions") << "asked for CalQ with geo::kMysteryType, "
160  << "bad things will happen, so bail\n";
161 
162  if(fColorOrGray > 0) return fGrayScaleReco[pos];
163 
164  return fColorScaleReco[pos];
165  }
Who knows?
Definition: geo_types.h:94
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 183 of file ColorDrawingOptions_service.cc.

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

184  {
185  size_t pos = (size_t)st;
186 
187  if(st == geo::kMysteryType)
188  throw cet::exception("ColorDrawingOptions") << "asked for CalT with geo::kMysteryType, "
189  << "bad things will happen, so bail\n";
190 
191  if(fColorOrGray > 0) return fGrayScaleReco[pos];
192 
193  return fColorScaleReco[pos];
194  }
Who knows?
Definition: geo_types.h:94
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 69 of file ColorDrawingOptions_service.cc.

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

Referenced by ColorDrawingOptions(), and reconfigure().

70  {
71 
72  // compare all input vectors for reco and raw color scaling against
73  // the number of possible signal types in the geometry
74  if(fRawDiv.size() != geo::kMysteryType){
75  if(fRawDiv.size() == 1 && fRawQLow.size() == 1 && fRawQHigh.size() == 1){
76  // pad out the vectors to all have the same entries
77  fRawDiv .resize(geo::kMysteryType, fRawDiv[0]);
78  fRawQLow .resize(geo::kMysteryType, fRawQLow[0]);
80  mf::LogWarning("ColorDrawingOptions") << "only 1 value given for raw color scale: "
81  << "number of divisions, low and high values.\n"
82  << "Pad out those values for the number of signal types.";
83  }
84  else
85  throw cet::exception("ColorDrawingOptionsUnclear") << "You have specified an incorrect number of "
86  << "values for the raw color/gray scale "
87  << "than there are types of signal planes in "
88  << "the detector. It is unclear what your "
89  << "intention is, so bail.\n";
90  }// end check on the raw vector sizes
91 
92  if(fRecoDiv.size() != geo::kMysteryType){
93  if(fRecoDiv.size() == 1 && fRecoQLow.size() == 1 && fRecoQHigh.size() == 1){
94  // pad out the vectors to all have the same entries
95  fRecoDiv .resize(geo::kMysteryType, fRecoDiv[0]);
98  mf::LogWarning("ColorDrawingOptions") << "only 1 value given for reco color scale: "
99  << "number of divisions, low and high values.\n"
100  << "Pad out those values for the number of signal types.";
101  }
102  else
103  throw cet::exception("ColorDrawingOptionsUnclear") << "You have specified an incorrect number of "
104  << "values for the reco color/gray scale "
105  << "than there are types of signal planes in "
106  << "the detector. It is unclear what your "
107  << "intention is, so bail.\n";
108  }// end check on the reco vector sizes
109 
110  return;
111  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
Who knows?
Definition: geo_types.h:94
std::vector< int > fRawDiv
number of divisions in raw
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< 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 17 of file Reconfigurable.h.

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

Definition at line 140 of file ColorDrawingOptions_service.cc.

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

Referenced by evd::TQPad::Draw(), and evd::RawDataDrawer::QueueDrawingBoxes().

141  {
142  size_t pos = (size_t)st;
143 
144  if(st == geo::kMysteryType)
145  throw cet::exception("ColorDrawingOptions") << "asked for RawQ with geo::kMysteryType, "
146  << "bad things will happen, so bail\n";
147 
148  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
149 
150  return fColorScaleRaw[pos];
151  }
Who knows?
Definition: geo_types.h:94
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 168 of file ColorDrawingOptions_service.cc.

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

169  {
170  size_t pos = (size_t)st;
171 
172  if(st == geo::kMysteryType)
173  throw cet::exception("ColorDrawingOptions") << "asked for RawT with geo::kMysteryType, "
174  << "bad things will happen, so bail\n";
175 
176 
177  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
178 
179  return fColorScaleRaw[pos];
180  }
Who knows?
Definition: geo_types.h:94
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 114 of file ColorDrawingOptions_service.cc.

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

115  {
116  fColorOrGray = pset.get< int >("ColorOrGrayScale");
117  fRawDiv = pset.get< std::vector<int> >("RawDiv");
118  fRecoDiv = pset.get< std::vector<int> >("RecoDiv");
119  fRawQLow = pset.get< std::vector<double> >("RawQLow");
120  fRawQHigh = pset.get< std::vector<double> >("RawQHigh");
121  fRecoQLow = pset.get< std::vector<double> >("RecoQLow");
122  fRecoQHigh = pset.get< std::vector<double> >("RecoQHigh");
123 
124  this->CheckInputVectorSizes();
125 
126  for(size_t i = 0; i < fRawDiv.size(); ++i){
127  fColorScaleRaw[i].SetBounds(fRawQLow[i], fRawQHigh[i]);
128  fGrayScaleRaw[i] .SetBounds(fRawQLow[i], fRawQHigh[i]);
129  }
130 
131  for(size_t i = 0; i < fRecoDiv.size(); ++i){
132  fColorScaleReco[i].SetBounds(fRecoQLow[i], fRecoQHigh[i]);
133  fGrayScaleReco[i] .SetBounds(fRecoQLow[i], fRecoQHigh[i]);
134  }
135 
136  return;
137  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
std::vector< int > fRawDiv
number of divisions in raw
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< 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 31 of file ColorDrawingOptions.h.

Referenced by CheckInputVectorSizes(), ColorDrawingOptions(), evd::TQPad::Draw(), and reconfigure().

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

high edge of ADC values for drawing raw digits

Definition at line 34 of file ColorDrawingOptions.h.

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

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

low edge of ADC values for drawing raw digits

Definition at line 33 of file ColorDrawingOptions.h.

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

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

number of divisions in raw

Definition at line 32 of file ColorDrawingOptions.h.

Referenced by CheckInputVectorSizes(), ColorDrawingOptions(), evd::TQPad::Draw(), and reconfigure().

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

high edge of ADC values for drawing raw digits

Definition at line 36 of file ColorDrawingOptions.h.

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

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

low edge of ADC values for drawing raw digits

Definition at line 35 of file ColorDrawingOptions.h.

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


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