LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ColorDrawingOptions_service.cc
Go to the documentation of this file.
1 
6 // Framework includes
7 
11 
15 
16 namespace evd{
17 
18  //......................................................................
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  }
62 
63  //......................................................................
65  {
66  }
67 
68  //......................................................................
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  }
112 
113  //......................................................................
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  }
138 
139  //......................................................................
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  }
152 
153  //......................................................................
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  }
166 
167  //......................................................................
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  }
181 
182  //......................................................................
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  }
195 }// namespace
196 
197 namespace evd {
198 
200 
201 } // namespace evd
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
Who knows?
Definition: geo_types.h:94
const evdb::ColorScale & CalT(geo::SigType_t st) const
std::vector< int > fRawDiv
number of divisions in raw
std::vector< evdb::ColorScale > fGrayScaleRaw
#define DEFINE_ART_SERVICE(svc)
Definition: ServiceMacros.h:93
std::vector< evdb::ColorScale > fColorScaleReco
std::vector< evdb::ColorScale > fColorScaleRaw
void reconfigure(fhicl::ParameterSet const &pset)
Manage all things related to colors for the event display.
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
The color scales used by the event display.
LArSoft includes.
Build an association between a numerical range and a ROOT color index for use in, eg...
Definition: ColorScale.h:44
const evdb::ColorScale & RawQ(geo::SigType_t st) const
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
T get(std::string const &key) const
Definition: ParameterSet.h:231
const evdb::ColorScale & CalQ(geo::SigType_t st) const
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
ColorDrawingOptions(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
int fColorOrGray
0 = color, 1 = gray
std::vector< int > fRecoDiv
number of divisions in raw
std::vector< evdb::ColorScale > fGrayScaleReco
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const evdb::ColorScale & RawT(geo::SigType_t st) const