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 14 of file ColorDrawingOptions.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file ColorDrawingOptions_service.cc.

17  : evdb::Reconfigurable{pset}
18  , fColorOrGray(pset.get< int >("ColorOrGrayScale"))
19  , fRawDiv (pset.get< std::vector<int> >("RawDiv") )
20  , fRecoDiv (pset.get< std::vector<int> >("RecoDiv") )
21  , fRawQLow (pset.get< std::vector<double> >("RawQLow") )
22  , fRawQHigh (pset.get< std::vector<double> >("RawQHigh") )
23  , fRecoQLow (pset.get< std::vector<double> >("RecoQLow") )
24  , fRecoQHigh (pset.get< std::vector<double> >("RecoQHigh") )
25  {
26  this->CheckInputVectorSizes();
27 
28  for(size_t i = 0; i < fRawDiv.size(); ++i){
29  fColorScaleRaw.push_back(evdb::ColorScale(fRawQLow[i], fRawQHigh[i],
30  evdb::kBlueToRedII, evdb::kLinear,
31  fRawDiv[i],
32  285.0, 135.0, // angle in the color wheel
33  0.65, 0.25)); // intensity from light to dark,
34  // starting with low color wheel value
35 
36  fGrayScaleRaw.push_back(evdb::ColorScale(fRawQLow[i], fRawQHigh[i],
37  evdb::kLinGray, evdb::kLinear,
38  fRawDiv[i],
39  270.0, 0.0, // angle in the color wheel
40  0.5, 0.5)); // intensity from light to dark,
41  // starting with low color wheel value
42  }
43 
44  for(size_t i = 0; i < fRecoDiv.size(); ++i){
45  fColorScaleReco.push_back(evdb::ColorScale(fRecoQLow[i], fRecoQHigh[i],
46  evdb::kBlueToRedII, evdb::kLinear,
47  fRecoDiv[i],
48  285.0, 135.0,
49  0.65, 0.25));
50  fGrayScaleReco.push_back(evdb::ColorScale(fRecoQLow[i], fRecoQHigh[i],
51  evdb::kLinGray, evdb::kLinear,
52  fRecoDiv[i],
53  270.0, 0.0,
54  0.5, 0.5));
55  }
56  }
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 144 of file ColorDrawingOptions_service.cc.

145  {
146  size_t pos = (size_t)st;
147 
148  if(st == geo::kMysteryType)
149  throw cet::exception("ColorDrawingOptions") << "asked for CalQ with geo::kMysteryType, "
150  << "bad things will happen, so bail\n";
151 
152  if(fColorOrGray > 0) return fGrayScaleReco[pos];
153 
154  return fColorScaleReco[pos];
155  }
Who knows?
Definition: geo_types.h:147
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 173 of file ColorDrawingOptions_service.cc.

174  {
175  size_t pos = (size_t)st;
176 
177  if(st == geo::kMysteryType)
178  throw cet::exception("ColorDrawingOptions") << "asked for CalT with geo::kMysteryType, "
179  << "bad things will happen, so bail\n";
180 
181  if(fColorOrGray > 0) return fGrayScaleReco[pos];
182 
183  return fColorScaleReco[pos];
184  }
Who knows?
Definition: geo_types.h:147
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 59 of file ColorDrawingOptions_service.cc.

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

Definition at line 130 of file ColorDrawingOptions_service.cc.

131  {
132  size_t pos = (size_t)st;
133 
134  if(st == geo::kMysteryType)
135  throw cet::exception("ColorDrawingOptions") << "asked for RawQ with geo::kMysteryType, "
136  << "bad things will happen, so bail\n";
137 
138  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
139 
140  return fColorScaleRaw[pos];
141  }
Who knows?
Definition: geo_types.h:147
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 158 of file ColorDrawingOptions_service.cc.

159  {
160  size_t pos = (size_t)st;
161 
162  if(st == geo::kMysteryType)
163  throw cet::exception("ColorDrawingOptions") << "asked for RawT with geo::kMysteryType, "
164  << "bad things will happen, so bail\n";
165 
166 
167  if(fColorOrGray > 0) return fGrayScaleRaw[pos];
168 
169  return fColorScaleRaw[pos];
170  }
Who knows?
Definition: geo_types.h:147
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)

Definition at line 104 of file ColorDrawingOptions_service.cc.

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

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

Definition at line 38 of file ColorDrawingOptions.h.

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

Definition at line 39 of file ColorDrawingOptions.h.

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

Definition at line 40 of file ColorDrawingOptions.h.

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

Definition at line 41 of file ColorDrawingOptions.h.

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

number of divisions in raw

Definition at line 27 of file ColorDrawingOptions.h.

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

high edge of ADC values for drawing raw digits

Definition at line 30 of file ColorDrawingOptions.h.

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

low edge of ADC values for drawing raw digits

Definition at line 29 of file ColorDrawingOptions.h.

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

number of divisions in raw

Definition at line 28 of file ColorDrawingOptions.h.

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

high edge of ADC values for drawing raw digits

Definition at line 32 of file ColorDrawingOptions.h.

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

low edge of ADC values for drawing raw digits

Definition at line 31 of file ColorDrawingOptions.h.


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