All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
evd::ColorDrawingOptions Class Reference

#include <ColorDrawingOptions.h>

Inheritance diagram for evd::ColorDrawingOptions:

Public Member Functions

 ColorDrawingOptions (fhicl::ParameterSet const &pset)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
const evdb::ColorScale & RawQ (geo::SigType_t st) const
 
const evdb::ColorScale & CalQ (geo::SigType_t st) const
 
const evdb::ColorScale & RawT (geo::SigType_t st) const
 
const evdb::ColorScale & CalT (geo::SigType_t st) const
 

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::ColorScale > fColorScaleRaw
 
std::vector< evdb::ColorScale > fColorScaleReco
 
std::vector< evdb::ColorScale > fGrayScaleRaw
 
std::vector< evdb::ColorScale > fGrayScaleReco
 

Detailed Description

Definition at line 18 of file ColorDrawingOptions.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file ColorDrawingOptions.cc.

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){
28  fColorScaleRaw.push_back(evdb::ColorScale(fRawQLow[i], fRawQHigh[i],
29  evdb::kBlueToRedII, evdb::kLinear,
30  fRawDiv[i],
31  285.0, 135.0, // angle in the color wheel
32  0.65, 0.25)); // intensity from light to dark,
33  // starting with low color wheel value
34 
35  fGrayScaleRaw.push_back(evdb::ColorScale(fRawQLow[i], fRawQHigh[i],
36  evdb::kLinGray, evdb::kLinear,
37  fRawDiv[i],
38  270.0, 0.0, // angle in the color wheel
39  0.5, 0.5)); // intensity from light to dark,
40  // starting with low color wheel value
41  }
42 
43  for(size_t i = 0; i < fRecoDiv.size(); ++i){
44  fColorScaleReco.push_back(evdb::ColorScale(fRecoQLow[i], fRecoQHigh[i],
45  evdb::kBlueToRedII, evdb::kLinear,
46  fRecoDiv[i],
47  285.0, 135.0,
48  0.65, 0.25));
49  fGrayScaleReco.push_back(evdb::ColorScale(fRecoQLow[i], fRecoQHigh[i],
50  evdb::kLinGray, evdb::kLinear,
51  fRecoDiv[i],
52  270.0, 0.0,
53  0.5, 0.5));
54  }
55  }
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 Function Documentation

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

Definition at line 143 of file ColorDrawingOptions.cc.

144  {
145  size_t pos = (size_t)st;
146 
147  if(st == geo::kMysteryType)
148  throw cet::exception("ColorDrawingOptions") << "asked for CalQ with geo::kMysteryType, "
149  << "bad things will happen, so bail\n";
150 
151  if(fColorOrGray > 0) return fGrayScaleReco[pos];
152 
153  return fColorScaleReco[pos];
154  }
Who knows?
Definition: geo_types.h:147
std::vector< evdb::ColorScale > fColorScaleReco
int fColorOrGray
0 = color, 1 = gray
std::vector< evdb::ColorScale > fGrayScaleReco
const evdb::ColorScale & evd::ColorDrawingOptions::CalT ( geo::SigType_t  st) const

Definition at line 172 of file ColorDrawingOptions.cc.

173  {
174  size_t pos = (size_t)st;
175 
176  if(st == geo::kMysteryType)
177  throw cet::exception("ColorDrawingOptions") << "asked for CalT with geo::kMysteryType, "
178  << "bad things will happen, so bail\n";
179 
180  if(fColorOrGray > 0) return fGrayScaleReco[pos];
181 
182  return fColorScaleReco[pos];
183  }
Who knows?
Definition: geo_types.h:147
std::vector< evdb::ColorScale > fColorScaleReco
int fColorOrGray
0 = color, 1 = gray
std::vector< evdb::ColorScale > fGrayScaleReco
void evd::ColorDrawingOptions::CheckInputVectorSizes ( )
private

Definition at line 58 of file ColorDrawingOptions.cc.

59  {
60 
61  // compare all input vectors for reco and raw color scaling against
62  // the number of possible signal types in the geometry
63  if(fRawDiv.size() != geo::kMysteryType){
64  if(fRawDiv.size() == 1 && fRawQLow.size() == 1 && fRawQHigh.size() == 1){
65  // pad out the vectors to all have the same entries
66  fRawDiv .resize(geo::kMysteryType, fRawDiv[0]);
67  fRawQLow .resize(geo::kMysteryType, fRawQLow[0]);
69  mf::LogWarning("ColorDrawingOptions") << "only 1 value given for raw color scale: "
70  << "number of divisions, low and high values.\n"
71  << "Pad out those values for the number of signal types.";
72  }
73  else
74  throw cet::exception("ColorDrawingOptionsUnclear") << "You have specified an incorrect number of "
75  << "values for the raw color/gray scale "
76  << "than there are types of signal planes in "
77  << "the detector. It is unclear what your "
78  << "intention is, so bail.\n";
79  }// end check on the raw vector sizes
80 
81  if(fRecoDiv.size() != geo::kMysteryType){
82  if(fRecoDiv.size() == 1 && fRecoQLow.size() == 1 && fRecoQHigh.size() == 1){
83  // pad out the vectors to all have the same entries
84  fRecoDiv .resize(geo::kMysteryType, fRecoDiv[0]);
87  mf::LogWarning("ColorDrawingOptions") << "only 1 value given for reco color scale: "
88  << "number of divisions, low and high values.\n"
89  << "Pad out those values for the number of signal types.";
90  }
91  else
92  throw cet::exception("ColorDrawingOptionsUnclear") << "You have specified an incorrect number of "
93  << "values for the reco 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 reco vector sizes
98 
99  return;
100  }
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
Who knows?
Definition: geo_types.h:147
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
std::vector< int > fRecoDiv
number of divisions in raw
const evdb::ColorScale & evd::ColorDrawingOptions::RawQ ( geo::SigType_t  st) const

Definition at line 129 of file ColorDrawingOptions.cc.

130  {
131  size_t pos = (size_t)st;
132 
133  if(st == geo::kMysteryType)
134  throw cet::exception("ColorDrawingOptions") << "asked for RawQ with geo::kMysteryType, "
135  << "bad things will happen, so bail\n";
136 
137  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
138 
139  return fColorScaleRaw[pos];
140  }
Who knows?
Definition: geo_types.h:147
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleRaw
int fColorOrGray
0 = color, 1 = gray
const evdb::ColorScale & evd::ColorDrawingOptions::RawT ( geo::SigType_t  st) const

Definition at line 157 of file ColorDrawingOptions.cc.

158  {
159  size_t pos = (size_t)st;
160 
161  if(st == geo::kMysteryType)
162  throw cet::exception("ColorDrawingOptions") << "asked for RawT with geo::kMysteryType, "
163  << "bad things will happen, so bail\n";
164 
165 
166  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
167 
168  return fColorScaleRaw[pos];
169  }
Who knows?
Definition: geo_types.h:147
std::vector< evdb::ColorScale > fGrayScaleRaw
std::vector< evdb::ColorScale > fColorScaleRaw
int fColorOrGray
0 = color, 1 = gray
void evd::ColorDrawingOptions::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 103 of file ColorDrawingOptions.cc.

104  {
105  fColorOrGray = pset.get< int >("ColorOrGrayScale");
106  fRawDiv = pset.get< std::vector<int> >("RawDiv");
107  fRecoDiv = pset.get< std::vector<int> >("RecoDiv");
108  fRawQLow = pset.get< std::vector<double> >("RawQLow");
109  fRawQHigh = pset.get< std::vector<double> >("RawQHigh");
110  fRecoQLow = pset.get< std::vector<double> >("RecoQLow");
111  fRecoQHigh = pset.get< std::vector<double> >("RecoQHigh");
112 
113  this->CheckInputVectorSizes();
114 
115  for(size_t i = 0; i < fRawDiv.size(); ++i){
116  fColorScaleRaw[i].SetBounds(fRawQLow[i], fRawQHigh[i]);
117  fGrayScaleRaw[i] .SetBounds(fRawQLow[i], fRawQHigh[i]);
118  }
119 
120  for(size_t i = 0; i < fRecoDiv.size(); ++i){
121  fColorScaleReco[i].SetBounds(fRecoQLow[i], fRecoQHigh[i]);
122  fGrayScaleReco[i] .SetBounds(fRecoQLow[i], fRecoQHigh[i]);
123  }
124 
125  return;
126  }
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

0 = color, 1 = gray

Definition at line 30 of file ColorDrawingOptions.h.

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

Definition at line 42 of file ColorDrawingOptions.h.

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

Definition at line 43 of file ColorDrawingOptions.h.

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

Definition at line 44 of file ColorDrawingOptions.h.

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

Definition at line 45 of file ColorDrawingOptions.h.

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

number of divisions in raw

Definition at line 31 of file ColorDrawingOptions.h.

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

high edge of ADC values for drawing raw digits

Definition at line 34 of file ColorDrawingOptions.h.

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

low edge of ADC values for drawing raw digits

Definition at line 33 of file ColorDrawingOptions.h.

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

number of divisions in raw

Definition at line 32 of file ColorDrawingOptions.h.

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

high edge of ADC values for drawing raw digits

Definition at line 36 of file ColorDrawingOptions.h.

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

low edge of ADC values for drawing raw digits

Definition at line 35 of file ColorDrawingOptions.h.


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