Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
JCALIBRATE::JHVGainGraph Struct Reference

Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-voltage. More...

#include <JHVGainGraph.hh>

Inheritance diagram for JCALIBRATE::JHVGainGraph:

Public Member Functions

 JHVGainGraph (const char *name="HVGainGraph", const bool logScale=false, const double base=10.0)
 Constructor. More...
 
 JHVGainGraph (const TMultiGraph &object, const bool logScale, const double base=10.0)
 Copy constructor. More...
 
void AddPoint (Double_t HV, Double_t gain, Double_t gainError)
 Add point to diagram. More...
 
void SetPoint (Int_t i, Double_t HV, Double_t gain, Double_t gainError)
 Set point with index i. More...
 
const bool checkHV (const double HV) const
 Checks whether high-voltage is within range. More...
 
const bool checkHV (const double HV1, const double HV2) const
 Checks whether two high-voltage values are different. More...
 
const bool checkGain (const double gain) const
 Checks if gain is within range. More...
 
const bool areIncreasing (const Int_t i, const Int_t j)
 Checks whether the gains of two points are strictly increasing as function of their absolute high-voltage. More...
 
const bool areValid (const Int_t i, const Int_t j)
 Checks whether two points are valid for inter-/extrapolation. More...
 
bool interpolate (const double gainTarget)
 Inter-/Extrapolate the high-voltage value corresponding to the target gain value. More...
 
double getTargetHV (const double gainTarget)
 Get high-voltage corresponding to given target gain value. More...
 
double getTargetHVError (const double gainTarget)
 Get error estimate on high-voltage corresponding to given target gain value. More...
 
void setLogLog ()
 Set log-log scale. More...
 
void unsetLogLog ()
 Unset log-log scale. More...
 
void setLogBase (const double base)
 Set logarithmic base for log-log scaling. More...
 
TGraphErrors * getData ()
 Get graph with the input data for the interpolation. More...
 
TGraphErrors * getResult ()
 Get graph with the interpolation result. More...
 
JHVGainGraphClone (const char *newname="") const
 Clone this object. More...
 

Static Public Member Functions

static void setMinHVDistance (const double minDist)
 Set minimal separation distance for high-voltage. More...
 
static void setHVRange (const JRange< double > range)
 Set valid gain range. More...
 
static void setGainRange (const JRange< double > range)
 Set valid gain range. More...
 

Private Attributes

bool loglog
 Log-log scale toggle. More...
 
double base
 Base for logarithmic scaling. More...
 

Static Private Attributes

static double dHVmin = 2 * 3.14
 Minimal high-voltage difference between two points [V]. More...
 
static JRange< double > hvRange = JRange<double>(-1500, -80)
 Allowed high-voltage range [V]. More...
 
static JRange< double > gainRange
 Allowed gain range. More...
 

Detailed Description

Auxiliary data structure to store high-voltage versus gain data and interpolate the nominal high-voltage.

Definition at line 35 of file JHVGainGraph.hh.

Constructor & Destructor Documentation

JCALIBRATE::JHVGainGraph::JHVGainGraph ( const char *  name = "HVGainGraph",
const bool  logScale = false,
const double  base = 10.0 
)
inline

Constructor.

Parameters
namename
logScaleset logarithmic scaling
basebase for logarithmic scaling

Definition at line 45 of file JHVGainGraph.hh.

47  :
48  loglog(logScale), base(base)
49  {
50  this->SetName(name);
51 
52  TGraphErrors* g0 = getResult();
53  TGraphErrors* g1 = getData();
54 
55  g0->SetName(HVGAINGRAPH_RESULT);
56  g0->SetLineColor (kRed);
57  g0->SetMarkerColor(kRed);
58  g0->SetMarkerStyle(kFullDotSmall);
59 
60  g1->SetName(HVGAINGRAPH_DATA);
61  g1->SetMarkerStyle(kFullDotSmall);
62  }
static const char * HVGAINGRAPH_RESULT
Definition: JHVGainGraph.hh:30
TGraphErrors * getData()
Get graph with the input data for the interpolation.
static const char * HVGAINGRAPH_DATA
Definition: JHVGainGraph.hh:29
TGraphErrors * getResult()
Get graph with the interpolation result.
double base
Base for logarithmic scaling.
then echo n User name
Definition: JCookie.sh:45
bool loglog
Log-log scale toggle.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
JCALIBRATE::JHVGainGraph::JHVGainGraph ( const TMultiGraph &  object,
const bool  logScale,
const double  base = 10.0 
)
inline

Copy constructor.

Parameters
objectTMultiGraph object
logScaleset logarithmic scale
basebase for logarithmic scaling

Definition at line 72 of file JHVGainGraph.hh.

74  :
75  loglog(logScale), base(base)
76  {
77  TList* graphs = object.GetListOfGraphs();
78 
79  if (graphs != NULL) {
80 
81  TGraphErrors* g0 = (TGraphErrors*)graphs->FindObject(HVGAINGRAPH_RESULT);
82  TGraphErrors* g1 = (TGraphErrors*)graphs->FindObject(HVGAINGRAPH_DATA);
83 
84  if (g0 != NULL) {
85  this->Add((TGraphErrors*)g0->Clone());
86  }
87 
88  if (g1 != NULL) {
89  this->Add((TGraphErrors*)g1->Clone());
90  }
91  }
92  }
static const char * HVGAINGRAPH_RESULT
Definition: JHVGainGraph.hh:30
static const char * HVGAINGRAPH_DATA
Definition: JHVGainGraph.hh:29
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25

Member Function Documentation

void JCALIBRATE::JHVGainGraph::AddPoint ( Double_t  HV,
Double_t  gain,
Double_t  gainError 
)
inline

Add point to diagram.

Parameters
HVhigh-voltage [V]
gaingain value
gainErrorerror on gain value

Definition at line 102 of file JHVGainGraph.hh.

103  {
104  TGraphErrors* g1 = getData();
105 
106  const Int_t N = g1->GetN();
107 
108  if (loglog) {
109 
110  g1->SetPoint (N, log(fabs(HV)) / log(base), log(gain) / log(base));
111  g1->SetPointError(N, 0.0, gainError / log(base) / gain);
112 
113  } else {
114 
115  g1->SetPoint (N, HV, gain);
116  g1->SetPointError(N, 0.0, gainError);
117  }
118  }
TGraphErrors * getData()
Get graph with the input data for the interpolation.
double base
Base for logarithmic scaling.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Definition: JToT.sh:45
bool loglog
Log-log scale toggle.
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
void JCALIBRATE::JHVGainGraph::SetPoint ( Int_t  i,
Double_t  HV,
Double_t  gain,
Double_t  gainError 
)
inline

Set point with index i.

Parameters
iindex of point
HVhigh-voltage [V]
gaingain value
gainErrorerror on gain value

Definition at line 129 of file JHVGainGraph.hh.

130  {
131  TGraphErrors* g1 = getData();
132 
133  if (loglog) {
134 
135  g1->SetPoint (i, log(fabs(HV)) / log(base), log(gain) / log(base));
136  g1->SetPointError(i, 0.0, gainError / log(base) / gain);
137 
138  } else {
139 
140  g1->SetPoint (i, HV, gain);
141  g1->SetPointError(i, 0.0, gainError);
142  }
143  }
TGraphErrors * getData()
Get graph with the input data for the interpolation.
double base
Base for logarithmic scaling.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Definition: JToT.sh:45
bool loglog
Log-log scale toggle.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
const bool JCALIBRATE::JHVGainGraph::checkHV ( const double  HV) const
inline

Checks whether high-voltage is within range.

Parameters
HVhigh-voltage [V]
Returns
true if high-voltage is within range; else false

Definition at line 152 of file JHVGainGraph.hh.

153  {
154  return (HV > hvRange.getLowerLimit() &&
155  HV < hvRange.getUpperLimit());
156  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
static JRange< double > hvRange
Allowed high-voltage range [V].
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
const bool JCALIBRATE::JHVGainGraph::checkHV ( const double  HV1,
const double  HV2 
) const
inline

Checks whether two high-voltage values are different.

Parameters
HV1first high-voltage [V]
HV2second high-voltage [V]
Returns
true if absolute difference is greater than minimal required difference; else false

Definition at line 166 of file JHVGainGraph.hh.

167  {
168  return (fabs(HV1 - HV2) > dHVmin);
169  }
static double dHVmin
Minimal high-voltage difference between two points [V].
const bool JCALIBRATE::JHVGainGraph::checkGain ( const double  gain) const
inline

Checks if gain is within range.

Parameters
gaingain value
Returns
true if gain within allowed range; else false

Definition at line 178 of file JHVGainGraph.hh.

179  {
180  return (gain > gainRange.getLowerLimit() &&
182  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Definition: JToT.sh:45
static JRange< double > gainRange
Allowed gain range.
const bool JCALIBRATE::JHVGainGraph::areIncreasing ( const Int_t  i,
const Int_t  j 
)
inline

Checks whether the gains of two points are strictly increasing as function of their absolute high-voltage.

Parameters
iindex of first point
jindex of second point
Returns
true if gains of given points are strictly increasing
as function of the absolute high-voltage; else false

Definition at line 193 of file JHVGainGraph.hh.

194  {
195  TGraphErrors* g1 = getData();
196 
197  if ( (g1 != NULL) && ((i >= 0 && i < g1->GetN()) &&
198  (j >= 0 && i < g1->GetN())) ) {
199 
200  if (loglog) {
201 
202  return ((g1->GetPointX(i) > g1->GetPointX(j) && g1->GetPointY(i) > g1->GetPointY(j)) ||
203  (g1->GetPointX(i) < g1->GetPointX(j) && g1->GetPointY(i) < g1->GetPointY(j)));
204 
205  } else {
206 
207  return ((g1->GetPointX(i) < g1->GetPointX(j) && g1->GetPointY(i) > g1->GetPointY(j)) ||
208  (g1->GetPointX(i) > g1->GetPointX(j) && g1->GetPointY(i) < g1->GetPointY(j)));
209  }
210 
211  } else {
212 
213  return false;
214  }
215  }
TGraphErrors * getData()
Get graph with the input data for the interpolation.
int j
Definition: JPolint.hh:666
bool loglog
Log-log scale toggle.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
const bool JCALIBRATE::JHVGainGraph::areValid ( const Int_t  i,
const Int_t  j 
)
inline

Checks whether two points are valid for inter-/extrapolation.

Parameters
iindex of first point
jindex of second point
Returns
true if valid for inter-/extrapolation; else false

Definition at line 225 of file JHVGainGraph.hh.

226  {
227  TGraphErrors* g1 = getData();
228 
229  if ((i >= 0 && i < g1->GetN()) &&
230  (j >= 0 && i < g1->GetN())) {
231 
232  double HV_i, HV_j, gain_i, gain_j;
233 
234  if (loglog) {
235 
236  HV_i = -pow(base, g1->GetPointX(i));
237  HV_j = -pow(base, g1->GetPointX(j));
238  gain_i = pow(base, g1->GetPointY(i));
239  gain_j = pow(base, g1->GetPointY(j));
240 
241  } else {
242 
243  HV_i = g1->GetPointX(i);
244  HV_j = g1->GetPointX(j);
245  gain_i = g1->GetPointY(i);
246  gain_j = g1->GetPointY(j);
247  }
248 
249  return (areIncreasing( i, j) && checkHV(HV_i) && checkGain(gain_i) &&
250  checkHV (HV_i, HV_j) && checkHV(HV_j) && checkGain(gain_j));
251 
252  } else {
253 
254  return false;
255  }
256  }
TGraphErrors * getData()
Get graph with the input data for the interpolation.
const bool areIncreasing(const Int_t i, const Int_t j)
Checks whether the gains of two points are strictly increasing as function of their absolute high-vol...
const bool checkHV(const double HV) const
Checks whether high-voltage is within range.
const bool checkGain(const double gain) const
Checks if gain is within range.
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double base
Base for logarithmic scaling.
int j
Definition: JPolint.hh:666
bool loglog
Log-log scale toggle.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
bool JCALIBRATE::JHVGainGraph::interpolate ( const double  gainTarget)
inline

Inter-/Extrapolate the high-voltage value corresponding to the target gain value.

Parameters
gainTargettarget gain value for inter-/extrapolation
Returns
true if inter-/extrapolation successful; else false

Definition at line 265 of file JHVGainGraph.hh.

266  {
267  TGraphErrors* g1 = getData();
268 
269  if (g1->GetN() < 2 || !checkGain(gainTarget)) {
270  return false;
271  }
272 
273  const bool isLogLog = loglog;
274 
275  if (!isLogLog) {
276  setLogLog();
277  }
278 
279  // Search for valid inter-/extrapolation points
280 
281  Int_t i = 0;
282  Int_t j = 1;
283 
284  const double logGainTarget = log(gainTarget) / log(base);
285 
286  for (Int_t k = 1; k < g1->GetN(); ++k) {
287 
288  const double dlogG_i = fabs(g1->GetPointY(i) - logGainTarget);
289  const double dlogG_j = fabs(g1->GetPointY(j) - logGainTarget);
290  const double dlogG_k = fabs(g1->GetPointY(k) - logGainTarget);
291 
292  if (dlogG_k < dlogG_i) {
293 
294  j = (areValid(i, k) ? i : j);
295  i = k;
296 
297  } else if ((dlogG_k < dlogG_j || !areValid(i, j)) &&
298  areValid(i, k)) {
299  j = k;
300  }
301  }
302 
303  // Inter-/Extrapolate high-voltage corresponding to given gain
304 
305  bool valid = areValid(i, j);
306 
307  if (valid) {
308 
309  const double logHV0 = g1->GetPointX(i);
310  const double logHV1 = g1->GetPointX(j);
311 
312  const double logG0 = g1->GetPointY(i);
313  const double logG1 = g1->GetPointY(j);
314  const double elogG0 = g1->GetErrorY(i);
315  const double elogG1 = g1->GetErrorY(j);
316 
317  const double dlogG0 = logGainTarget - logG0;
318  const double dlogG1 = logGainTarget - logG1;
319 
320  const double slope = (logG1 - logG0) / (logHV1 - logHV0);
321 
322  const double logHVnom = dlogG0 / slope + logHV0;
323  const double elogHVnom = sqrt(dlogG1 * dlogG1 * elogG0 * elogG0 +
324  dlogG0 * dlogG0 * elogG1 * elogG1) / fabs(slope * (logG1 - logG0));
325 
326  const double distance = fabs((logHVnom - logHV0) / (logHV0 - logHV1));
327 
328  static const double maxDist = 2.0;
329 
330  valid = (logHVnom > 0.0 && checkHV(-pow(base, logHVnom)) && distance < maxDist);
331 
332  if (valid) {
333 
334  TGraphErrors* g0 = getResult();
335 
336  g0->SetPoint (0, logHVnom, logGainTarget);
337  g0->SetPointError(0, elogHVnom, 0.0);
338  }
339  }
340 
341  if (!isLogLog) {
342  unsetLogLog();
343  }
344 
345  return valid;
346  }
void unsetLogLog()
Unset log-log scale.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
TGraphErrors * getData()
Get graph with the input data for the interpolation.
then fatal No sound hydrophone file $HYDROPHONE_TXT fi JGraph f $HYDROPHONE_TXT o $HYDROPHONE_ROOT sort gr k
const bool checkHV(const double HV) const
Checks whether high-voltage is within range.
const bool checkGain(const double gain) const
Checks if gain is within range.
const bool areValid(const Int_t i, const Int_t j)
Checks whether two points are valid for inter-/extrapolation.
TGraphErrors * getResult()
Get graph with the interpolation result.
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double base
Base for logarithmic scaling.
int j
Definition: JPolint.hh:666
bool loglog
Log-log scale toggle.
void setLogLog()
Set log-log scale.
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
double JCALIBRATE::JHVGainGraph::getTargetHV ( const double  gainTarget)
inline

Get high-voltage corresponding to given target gain value.

Parameters
gainTargettarget gain value for inter-/extrapolation
Returns
inter-/extrapolated high-voltage
corresponding to target gain value [V]

Definition at line 356 of file JHVGainGraph.hh.

357  {
358  static const double precision = 1e-3;
359 
360  const double target = (loglog ? log(gainTarget) / log(base) : gainTarget);
361 
362  TGraphErrors* g0 = getResult();
363 
364  if ((g0->GetN() > 0 && fabs(g0->GetPointY(0) - target < precision)) || interpolate(gainTarget)) {
365 
366  return (loglog ? -pow(base, g0->GetPointX(0)) : g0->GetPointX(0));
367 
368  } else {
369 
370  THROW(JValueOutOfRange, "JHVGainGraph::getTargetError(): No valid inter-/extrapolation candidate found for given target gain.");
371  }
372  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
bool interpolate(const double gainTarget)
Inter-/Extrapolate the high-voltage value corresponding to the target gain value. ...
TGraphErrors * getResult()
Get graph with the interpolation result.
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
double JCALIBRATE::JHVGainGraph::getTargetHVError ( const double  gainTarget)
inline

Get error estimate on high-voltage corresponding to given target gain value.

Parameters
gainTargettarget gain value for inter-/extrapolation
Returns
error on inter-/extrapolated high-voltage
corresponding to the target gain value [V]

Definition at line 382 of file JHVGainGraph.hh.

383  {
384  static const double precision = 1e-3;
385 
386  const double target = (loglog ? log(gainTarget) / log(base) : gainTarget);
387 
388  TGraphErrors* g0 = getResult();
389 
390  if ((g0->GetN() > 0 && fabs(g0->GetPointY(0) - target) < precision) || interpolate(gainTarget)) {
391 
392  return (loglog ? g0->GetErrorX(0) * pow(base, g0->GetPointX(0)) * log(base) : g0->GetErrorX(0));
393 
394  } else {
395 
396  THROW(JValueOutOfRange, "JHVGainGraph::getTargetError(): No valid inter-/extrapolation candidate found for given target gain.");
397  }
398  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
bool interpolate(const double gainTarget)
Inter-/Extrapolate the high-voltage value corresponding to the target gain value. ...
TGraphErrors * getResult()
Get graph with the interpolation result.
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
void JCALIBRATE::JHVGainGraph::setLogLog ( )
inline

Set log-log scale.

Definition at line 404 of file JHVGainGraph.hh.

405  {
406  if (!loglog) {
407 
408  TIter next(this->GetListOfGraphs());
409 
410  while (TGraphErrors* graph = (TGraphErrors*)next()) {
411 
412  if (graph != NULL) {
413 
414  for (Int_t i = 0; i < graph->GetN(); ++i) {
415 
416  Double_t absLogHV = log(fabs(graph->GetPointX(i))) / log(base);
417  Double_t logGain = log(graph->GetPointY(i)) / log(base);
418 
419  Double_t absLogHVerror = graph->GetErrorX(i) / fabs(graph->GetPointX(i)) / log(base);
420  Double_t logGainError = graph->GetErrorY(i) / fabs(graph->GetPointY(i)) / log(base);
421 
422  graph->SetPoint (i, absLogHV, logGain);
423  graph->SetPointError(i, absLogHVerror, logGainError);
424  }
425  }
426  }
427 
428  loglog = true;
429  }
430  }
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
void JCALIBRATE::JHVGainGraph::unsetLogLog ( )
inline

Unset log-log scale.

Definition at line 436 of file JHVGainGraph.hh.

437  {
438  if (loglog) {
439 
440  TIter next(this->GetListOfGraphs());
441 
442  while (TGraphErrors* graph = (TGraphErrors*)next()) {
443 
444  if (graph != NULL) {
445 
446  for (Int_t i = 0; i < graph->GetN(); ++i) {
447 
448  Double_t HV = -pow(base, graph->GetPointX(i));
449  Double_t gain = pow(base, graph->GetPointY(i));
450 
451  Double_t HVerror = graph->GetErrorX(i) * -HV * log(base);
452  Double_t gainError = graph->GetErrorY(i) * gain * log(base);
453 
454  graph->SetPoint (i, HV, gain);
455  graph->SetPointError(i, HVerror, gainError);
456  }
457  }
458  }
459 
460  loglog = false;
461  }
462  }
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double base
Base for logarithmic scaling.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Definition: JToT.sh:45
bool loglog
Log-log scale toggle.
void JCALIBRATE::JHVGainGraph::setLogBase ( const double  base)
inline

Set logarithmic base for log-log scaling.

Parameters
baselogarithmic base for scaling

Definition at line 470 of file JHVGainGraph.hh.

471  {
472  if (loglog) {
473 
474  TIter next(this->GetListOfGraphs());
475 
476  while (TGraphErrors* graph = (TGraphErrors*)next()) {
477 
478  if (graph != NULL) {
479 
480  for (Int_t i = 0; i < graph->GetN(); ++i) {
481 
482  Double_t absLogHV = graph->GetPointX(i) * log(this->base) / log(base);
483  Double_t logGain = graph->GetPointY(i) * log(this->base) / log(base);
484 
485  Double_t abslogHVerror = graph->GetErrorX(i) * log(this->base) / log(base);
486  Double_t logGainError = graph->GetErrorY(i) * log(this->base) / log(base);
487 
488  graph->SetPoint (i, absLogHV, logGain);
489  graph->SetPointError(i, abslogHVerror, logGainError);
490  }
491  }
492  }
493  }
494 
495  this->base = base;
496  }
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
TGraphErrors* JCALIBRATE::JHVGainGraph::getData ( )
inline

Get graph with the input data for the interpolation.

Returns
pointer to graph with input data

Definition at line 504 of file JHVGainGraph.hh.

505  {
506  TGraphErrors* g1;
507 
508  TList* list = this->GetListOfGraphs();
509 
510  if (list != NULL && list->FindObject(HVGAINGRAPH_DATA) != NULL) {
511 
512  g1 = (TGraphErrors*)list->FindObject(HVGAINGRAPH_DATA);
513 
514  } else {
515 
516  g1 = new TGraphErrors();
517 
518  g1->SetName(HVGAINGRAPH_DATA);
519 
520  g1->Set(0);
521 
522  this->Add(g1);
523  }
524 
525  return g1;
526  }
static const char * HVGAINGRAPH_DATA
Definition: JHVGainGraph.hh:29
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
TGraphErrors* JCALIBRATE::JHVGainGraph::getResult ( )
inline

Get graph with the interpolation result.

Returns
pointer to graph with the interpolation result

Definition at line 534 of file JHVGainGraph.hh.

535  {
536  TGraphErrors* g0;
537 
538  TList* list = this->GetListOfGraphs();
539 
540  if (list != NULL && list->FindObject(HVGAINGRAPH_RESULT) != NULL) {
541 
542  g0 = (TGraphErrors*)list->FindObject(HVGAINGRAPH_RESULT);
543 
544  } else {
545 
546  g0 = new TGraphErrors();
547 
548  g0->SetName(HVGAINGRAPH_RESULT);
549 
550  g0->Set(0);
551 
552  this->Add(g0);
553  }
554 
555  return g0;
556  }
static const char * HVGAINGRAPH_RESULT
Definition: JHVGainGraph.hh:30
JHVGainGraph* JCALIBRATE::JHVGainGraph::Clone ( const char *  newname = "") const
inline

Clone this object.

Parameters
newnamenew name

Definition at line 564 of file JHVGainGraph.hh.

565  {
566  JHVGainGraph* clone = new JHVGainGraph(*this, loglog, base);
567 
568  clone->SetName(newname);
569 
570  return clone;
571  }
JHVGainGraph(const char *name="HVGainGraph", const bool logScale=false, const double base=10.0)
Constructor.
Definition: JHVGainGraph.hh:45
double base
Base for logarithmic scaling.
bool loglog
Log-log scale toggle.
static void JCALIBRATE::JHVGainGraph::setMinHVDistance ( const double  minDist)
inlinestatic

Set minimal separation distance for high-voltage.

Parameters
minDistminimal separation distance for high-voltage

Definition at line 579 of file JHVGainGraph.hh.

580  {
581  dHVmin = minDist;
582  }
static double dHVmin
Minimal high-voltage difference between two points [V].
static void JCALIBRATE::JHVGainGraph::setHVRange ( const JRange< double >  range)
inlinestatic

Set valid gain range.

Parameters
rangevalid high-voltage range [V]

Definition at line 590 of file JHVGainGraph.hh.

591  {
592  hvRange = range;
593  }
static JRange< double > hvRange
Allowed high-voltage range [V].
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi mv $WORKDIR/fit.root $MODULE_ROOT typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Definition: module-Z:fit.sh:84
static void JCALIBRATE::JHVGainGraph::setGainRange ( const JRange< double >  range)
inlinestatic

Set valid gain range.

Parameters
rangevalid gain range

Definition at line 601 of file JHVGainGraph.hh.

602  {
603  gainRange = range;
604  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi mv $WORKDIR/fit.root $MODULE_ROOT typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Definition: module-Z:fit.sh:84
static JRange< double > gainRange
Allowed gain range.

Member Data Documentation

bool JCALIBRATE::JHVGainGraph::loglog
private

Log-log scale toggle.

Definition at line 609 of file JHVGainGraph.hh.

double JCALIBRATE::JHVGainGraph::base
private

Base for logarithmic scaling.

Definition at line 610 of file JHVGainGraph.hh.

double JCALIBRATE::JHVGainGraph::dHVmin = 2 * 3.14
staticprivate

Minimal high-voltage difference between two points [V].

Default values.

Definition at line 612 of file JHVGainGraph.hh.

JRange< double > JCALIBRATE::JHVGainGraph::hvRange = JRange<double>(-1500, -80)
staticprivate

Allowed high-voltage range [V].

Definition at line 613 of file JHVGainGraph.hh.

JRange< double > JCALIBRATE::JHVGainGraph::gainRange
staticprivate
Initial value:
= JRange<double>(FITTOT_GAIN_MIN,

Allowed gain range.

Definition at line 614 of file JHVGainGraph.hh.


The documentation for this struct was generated from the following file: