CalScheme Class Reference

#include <CalScheme.h>

Inheritance diagram for CalScheme:
CfgPromptConfigurable Calibrator MIPCalScheme MuonDriftCalScheme PEGainAggCalScheme PEGainCalScheme PmtDriftCalScheme PulserDriftCalScheme PulserLinearityCalScheme PulserSigLinCalScheme PulserTimeCalScheme QuadLinearityCalScheme SimpleCalScheme StripAttenCalScheme StripToStripCalScheme TemperatureCalScheme TimeCalScheme VaLinearityCalScheme

List of all members.

Public Types

enum  ESchemeType {
  kUnknown = 0, kTimeCalibrator, kPeCalibrator, kVALinCalibrator,
  kLinCalibrator, kDriftCalibrator, kStripCalibrator, kAttenCalibrator,
  kMIPCalibrator, kThermometer, kNumberOfSchemeTypes
}
enum  EErrorType {
  kGeneralErr = 0, kMissingTable = 1, kMissingRow = 2, kFPE = 3,
  kDataInsufficient = 4, kBadInput = 5, kNumberOfErrorTypes
}
typedef enum CalScheme::ESchemeType SchemeType_t
typedef enum CalScheme::EErrorType ErrorType_t

Public Member Functions

 CalScheme ()
virtual ~CalScheme ()
virtual DoubleErr GetCalibratedTime (DoubleErr rawtime, FloatErr charge, const PlexStripEndId &seid) const
virtual FloatErr GetPhotoElectrons (FloatErr rawcharge, const PlexStripEndId &seid) const
virtual FloatErr GetLinearizedVA (FloatErr rawcharge, const RawChannelId &rcid) const
virtual FloatErr GetDriftCorrected (FloatErr rawcharge, const PlexStripEndId &seid) const
virtual FloatErr GetLinearized (FloatErr sigdrift, const PlexStripEndId &seid) const
virtual FloatErr GetStripToStripCorrected (FloatErr siglin, const PlexStripEndId &seid) const
virtual FloatErr GetAttenCorrected (FloatErr sigcorr, FloatErr stripX, const PlexStripEndId &seid) const
virtual FloatErr GetMIP (FloatErr sigmap, const PlexStripEndId &seid=PlexStripEndId()) const
virtual DoubleErr DecalTime (DoubleErr caltime, FloatErr charge, const PlexStripEndId &seid) const
virtual void DecalGainAndWidth (FloatErr &gain, FloatErr &width, const PlexStripEndId &seid) const
virtual void DecalGainAndWidth (FloatErr &gain, FloatErr &width, const PlexPixelSpotId &psid) const
virtual FloatErr DecalVALinearity (FloatErr adc, const RawChannelId &rcid) const
virtual FloatErr DecalDrift (FloatErr undrifted, const PlexStripEndId &seid) const
virtual FloatErr DecalLinearity (FloatErr lin, const PlexStripEndId &seid) const
virtual FloatErr DecalStripToStrip (FloatErr sigcorr, const PlexStripEndId &seid) const
virtual FloatErr DecalAttenCorrected (FloatErr sigmap, FloatErr stripX, const PlexStripEndId &seid) const
virtual FloatErr DecalMIP (FloatErr sigmip, const PlexStripEndId &seid=PlexStripEndId()) const
virtual Float_t GetTemperature (Int_t mode=0) const
virtual void PrintConfig (std::ostream &os) const
void Reset (const VldContext &context, Bool_t force=false)
const VldContextGetContext (void) const
void PrintConfig (MsgStream &ms) const
void PrintConfig () const
void PrintErrorStats (std::ostream &os) const
void PrintErrorStats (MsgStream &ms) const
void PrintErrorStats () const

Static Public Member Functions

static const char * SchemeTypeName (int t)
static const char * UnitName (int t)

Protected Member Functions

virtual void DoReset (const VldContext &)
virtual void ConfigModified ()

Static Protected Member Functions

static void ResetStatistics ()
static void IncrementErrors (SchemeType_t, ErrorType_t=kGeneralErr)
static void IncrementErrors (SchemeType_t, ErrorType_t, const GenericThingId &thing)
static void IncrementErrors (SchemeType_t, ErrorType_t, Int_t genericId)
static void IncrementErrors (SchemeType_t, ErrorType_t, const RawChannelId &rcid)
static void IncrementErrors (SchemeType_t, ErrorType_t, const PlexPixelSpotId &psid)
static void IncrementErrors (SchemeType_t, ErrorType_t, const PlexStripEndId &seid)
static void IncrementErrors (SchemeType_t, ErrorType_t, const PlexLedId &led)
static void IncrementCalls (SchemeType_t)

Private Member Functions

void Unimplimented () const
 ClassDef (CalScheme, 0)

Private Attributes

VldContext fContext

Static Private Attributes

static Int_t fsCalls [kNumberOfSchemeTypes] = {0}
static Int_t fsErrors [kNumberOfSchemeTypes][kNumberOfErrorTypes] = {{0},{0}}
static std::map
< GenericThingId, int > 
fsChannelErrors

Friends

std::ostream & operator<< (std::ostream &os, const CalScheme &s)

Detailed Description

Definition at line 31 of file CalScheme.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kGeneralErr 
kMissingTable 
kMissingRow 
kFPE 
kDataInsufficient 
kBadInput 
kNumberOfErrorTypes 

Definition at line 149 of file CalScheme.h.

00149                           {
00150     kGeneralErr   = 0,    // Catch-all catagory
00151     kMissingTable = 1, // Table was completely empty for context
00152     kMissingRow   = 2, // Table didn't have requested entry
00153     kFPE          = 3, // Computation generated illegal quantity.
00154     kDataInsufficient = 4,
00155     kBadInput = 5,
00156     kNumberOfErrorTypes
00157   } ErrorType_t;

Enumerator:
kUnknown 
kTimeCalibrator 
kPeCalibrator 
kVALinCalibrator 
kLinCalibrator 
kDriftCalibrator 
kStripCalibrator 
kAttenCalibrator 
kMIPCalibrator 
kThermometer 
kNumberOfSchemeTypes 

Definition at line 102 of file CalScheme.h.


Constructor & Destructor Documentation

CalScheme::CalScheme (  ) 

Definition at line 31 of file CalScheme.cxx.

00031                      : fContext()
00032 {
00033 }

CalScheme::~CalScheme (  )  [virtual]

Definition at line 35 of file CalScheme.cxx.

00036 {
00037 }


Member Function Documentation

CalScheme::ClassDef ( CalScheme  ,
 
) [private]
virtual void CalScheme::ConfigModified ( void   )  [inline, protected, virtual]
FloatErr CalScheme::DecalAttenCorrected ( FloatErr  sigmap,
FloatErr  stripX,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get atttenuation correction

Input: Light expected if energy deposited in middle of strip True position of hit along strip Strip end

Output: Light seen at end of WLS pigtail

Must be implimented by: AttenCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and StripAttenCalScheme.

Definition at line 303 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalAttenCorrected().

00304 {
00318   
00319  Unimplimented(); return 0; 
00320 }

FloatErr CalScheme::DecalDrift ( FloatErr  undrifted,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get gain drift

Input: True gain of phototube in PEs, Strip end

Output: Drifted gain of phototube

Must be implimented by: DriftCalibrator

Reimplemented in Calibrator, MuonDriftCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserSigLinCalScheme, and SimpleCalScheme.

Definition at line 250 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalDrift().

00251 {
00264  Unimplimented(); return 0; 
00265 }

void CalScheme::DecalGainAndWidth ( FloatErr gain,
FloatErr width,
const PlexPixelSpotId psid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get PMT gain and width of single PE response

Input: Pixel spot

Output: Gain and and width of 1-pe response in ADCs Should be slightly more clever than the strip-end based one.. i.e. it should make guesses.

Must be implimented by: PeCalibrator

Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme.

Definition at line 215 of file CalScheme.cxx.

References Unimplimented().

00216 {
00230   Unimplimented(); return; 
00231 }

void CalScheme::DecalGainAndWidth ( FloatErr gain,
FloatErr width,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get PMT gain and width of single PE response

Input: Strip end

Output: Gain and and width of 1-pe response in ADCs

Must be implimented by: PeCalibrator

Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme.

Definition at line 199 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalGainAndWidth().

00200 {
00212   Unimplimented(); return; 
00213 }

FloatErr CalScheme::DecalLinearity ( FloatErr  lin,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Apply nonlinearity function.

Input: Linear charge expected from a perfect phototube, Strip end

Output: Realistic charge after PMT and electronics nonlinearity

Must be implimented by: LinCalibrator

Reimplemented in Calibrator, PulserLinearityCalScheme, PulserSigLinCalScheme, QuadLinearityCalScheme, and SimpleCalScheme.

Definition at line 267 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalLinearity().

00268 {
00281  
00282   Unimplimented(); return 0; 
00283 }

FloatErr CalScheme::DecalMIP ( FloatErr  sigmip,
const PlexStripEndId seid = PlexStripEndId() 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get atttenuation correction

Input: True energy of hit in MIPs Strip end (may be ignored, depending on implimentation)

Output: SigMaps that this hit will result in.

Must be implimented by: MIPCalibrator

Reimplemented in Calibrator, MIPCalScheme, and SimpleCalScheme.

Definition at line 322 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalMIP().

00323 {
00336   
00337  Unimplimented(); return 0; 
00338 }

FloatErr CalScheme::DecalStripToStrip ( FloatErr  sigcorr,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Get strip-to-strip variation

Input: Charge expected from a perfect strip with a perfect phototube Strip end

Output: Charge expected from this strip, including PMT gain

Must be implimented by: StripCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and StripToStripCalScheme.

Definition at line 285 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalStripToStrip().

00286 {
00299 
00300  Unimplimented(); return 0; 
00301 }

DoubleErr CalScheme::DecalTime ( DoubleErr  caltime,
FloatErr  charge,
const PlexStripEndId seid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Go from calibrated time to raw time

Input: True time Raw charge on strip end Strip end

Output: Raw, uncalibrated time.

Must be implimented by: TimeCalibrator

Reimplemented in Calibrator, PulserTimeCalScheme, SimpleCalScheme, and TimeCalScheme.

Definition at line 181 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalTime().

00182 {
00196   Unimplimented(); return 0; 
00197 }

FloatErr CalScheme::DecalVALinearity ( FloatErr  adc,
const RawChannelId rcid 
) const [virtual]

Inverse-calibration for use by Monte-Carlo

Purpose: Apply VA nonlinearity

Input: linear charge channel ID

Output: nonlinear charge

Must be implimented by: VALinCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and VaLinearityCalScheme.

Definition at line 233 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::DecalVALinearity().

00234 {
00247   Unimplimented(); return 0; 
00248 }

virtual void CalScheme::DoReset ( const VldContext  )  [inline, protected, virtual]
FloatErr CalScheme::GetAttenCorrected ( FloatErr  sigcorr,
FloatErr  stripX,
const PlexStripEndId seid 
) const [virtual]

Purpose: Correct for attenuation along strip.

In: sigcorr, position along strip (in strip coordinates: 0 is center of strip.) strip end

Out: position-corrected charge (SigMap)

Must be implimented by: AttenCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and StripAttenCalScheme.

Definition at line 142 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetAttenCorrected().

00143 {
00155 
00156  Unimplimented(); return 0; 
00157 }

DoubleErr CalScheme::GetCalibratedTime ( DoubleErr  rawtime,
FloatErr  charge,
const PlexStripEndId seid 
) const [virtual]

Purpose: Apply time calibration

In: raw time in seconds raw charge on stripend strip end

Out: calibrated time.

Must be implimented by: TimeCalibrator

Reimplemented in Calibrator, PulserTimeCalScheme, SimpleCalScheme, and TimeCalScheme.

Definition at line 43 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetCalibratedTime().

00044 {
00056  Unimplimented(); 
00057  return 0; 
00058 }

const VldContext& CalScheme::GetContext ( void   )  const [inline]

Definition at line 84 of file CalScheme.h.

References fContext.

Referenced by PulserSigLinCalScheme::ApplyBendyCalib(), PulserSigLinCalScheme::ApplyCalib(), PulserSigLinCalScheme::ApplyCalibFar(), PulserSigLinCalScheme::CalDet2003Check(), PulserDriftCalScheme::CalDet2003Check(), MuonDriftCalScheme::ConfigModified(), PmtDriftCalScheme::ConfigModified(), StripAttenCalScheme::ConfigModified(), VaLinearityCalScheme::ConfigModified(), PulserTimeCalScheme::ConfigModified(), Calibrator::ConfigModified(), MIPCalScheme::ConfigModified(), StripToStripCalScheme::ConfigModified(), SimpleCalScheme::DecalAttenCorrected(), StripAttenCalScheme::DecalAttenCorrected(), Calibrator::DecalAttenCorrected(), Calibrator::DecalAttenCorrectedTpos(), Calibrator::DecalDrift(), SimpleCalScheme::DecalGainAndWidth(), Calibrator::DecalGainAndWidth(), Calibrator::DecalLinearity(), Calibrator::DecalMIP(), Calibrator::DecalStripToStrip(), Calibrator::DecalTime(), PulserTimeCalScheme::DecalTime(), Calibrator::DecalVALinearity(), TemperatureCalScheme::DoReset(), SimpleCalScheme::GetAttenCorrected(), StripAttenCalScheme::GetAttenCorrected(), Calibrator::GetAttenCorrected(), Calibrator::GetAttenCorrectedTpos(), Calibrator::GetCalibratedTime(), PulserTimeCalScheme::GetCalibratedTime(), PmtDriftCalScheme::GetDrift(), Calibrator::GetDriftCorrected(), PulserDriftCalScheme::GetDriftFar(), PulserSigLinCalScheme::GetDriftFar(), PulserSigLinCalScheme::GetDriftPinDiodeValue(), PulserDriftCalScheme::GetDriftPinDiodeValue(), PulserDriftCalScheme::GetDriftPoint(), PulserSigLinCalScheme::GetDriftPoint(), Calibrator::GetLinearized(), Calibrator::GetLinearizedVA(), Calibrator::GetMIP(), Calibrator::GetPhotoElectrons(), SimpleCalScheme::GetPhotoElectrons(), PulserSigLinCalScheme::GetReferencePinDiodeValue(), PEGainAggCalScheme::GetRow(), PEGainCalScheme::GetRow(), Calibrator::GetStripToStripCorrected(), TemperatureCalScheme::GetTemperature(), Calibrator::GetTemperature(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), and PulserTimeCalScheme::WalkCorrection().

00084 { return fContext; };

FloatErr CalScheme::GetDriftCorrected ( FloatErr  rawcharge,
const PlexStripEndId seid 
) const [virtual]

Purpose: Apply drift correction

In: raw adc strip end

Out: drift-corrected adcs

Must be implimented by: DriftCalibrator

Reimplemented in Calibrator, MuonDriftCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserSigLinCalScheme, and SimpleCalScheme.

Definition at line 94 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetDriftCorrected().

00095 {
00106  Unimplimented(); return 0; 
00107 }

FloatErr CalScheme::GetLinearized ( FloatErr  sigdrift,
const PlexStripEndId seid 
) const [virtual]

Purpose: Apply linearity correction

In: drifted-corrected or raw ADC, strip end

Out: linearized adc (siglin)

Must be implimented by: LinCalibrator

Reimplemented in Calibrator, PulserLinearityCalScheme, PulserSigLinCalScheme, QuadLinearityCalScheme, and SimpleCalScheme.

Definition at line 109 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetLinearized().

00110 {
00121  Unimplimented(); return 0; 
00122 }

FloatErr CalScheme::GetLinearizedVA ( FloatErr  rawcharge,
const RawChannelId rcid 
) const [virtual]

Purpose: Linearize a VA channel to charge injection data. Usually applies only to pin diodes

In: raw adc raw channel ID

Out: number of pes.

Must be implimented by: VALinCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and VaLinearityCalScheme.

Definition at line 76 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetLinearizedVA().

00077 {
00089  
00090  Unimplimented(); return 0; 
00091 }

FloatErr CalScheme::GetMIP ( FloatErr  sigmap,
const PlexStripEndId seid = PlexStripEndId() 
) const [virtual]

Purpose: Convert from corrected charge to energy units. MIPs are usually defined as the the light seen from a muon going in the Z-direction through the center of the strip (i.e. ~2 MeV of muon energy)

In: sigcorr or sigmap Strip end (May be ignored, depending upon implimentation)

Out: energy in MIPs

Must be implimented by: MIPCalibrator

Reimplemented in Calibrator, MIPCalScheme, and SimpleCalScheme.

Definition at line 159 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetMIP().

00160 {
00173  Unimplimented(); return 0; 
00174 }

FloatErr CalScheme::GetPhotoElectrons ( FloatErr  rawcharge,
const PlexStripEndId seid 
) const [virtual]

Purpose: Apply PE calibration

In: raw adc strip end

Out: number of pes.

Must be implimented by: PeCalibrator

Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme.

Definition at line 60 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetPhotoElectrons().

00061 {
00072  
00073  Unimplimented(); return 0; 
00074 }

FloatErr CalScheme::GetStripToStripCorrected ( FloatErr  siglin,
const PlexStripEndId seid 
) const [virtual]

Purpose: Apply strip-to-strip correction i.e. scintillator light output, PMT gain, and light loss By default, assumes hit is in center of strip.

In: linearized or raw adc (siglin) strip end

Out: corrected adc (sigcorr)

Must be implimented by: StripCalibrator

Reimplemented in Calibrator, SimpleCalScheme, and StripToStripCalScheme.

Definition at line 124 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetStripToStripCorrected().

00125 {
00139  Unimplimented(); return 0; 
00140 }

Float_t CalScheme::GetTemperature ( Int_t  mode = 0  )  const [virtual]

Request temperature at current vld context

Purpose: Get temperature

Input: User-defined.

Output: Temperature in degrees Celcius

Must be implimented by: Thermometer

Reimplemented in Calibrator, SimpleCalScheme, and TemperatureCalScheme.

Definition at line 343 of file CalScheme.cxx.

References Unimplimented().

Referenced by Calibrator::GetTemperature().

00344 {
00356   Unimplimented(); return 0;
00357 }

void CalScheme::IncrementCalls ( SchemeType_t  i  )  [static, protected]
void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
const PlexLedId led 
) [static, protected]

Definition at line 464 of file CalScheme.cxx.

References IncrementErrors().

00466 {
00467   IncrementErrors(i,j,GenericThingId(c));
00468 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
const PlexStripEndId seid 
) [static, protected]

Definition at line 446 of file CalScheme.cxx.

References IncrementErrors().

00448 {
00449   IncrementErrors(i,j,GenericThingId(c));
00450 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
const PlexPixelSpotId psid 
) [static, protected]

Definition at line 458 of file CalScheme.cxx.

References IncrementErrors().

00460 {
00461   IncrementErrors(i,j,GenericThingId(c));
00462 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
const RawChannelId rcid 
) [static, protected]

Definition at line 452 of file CalScheme.cxx.

References IncrementErrors().

00454 {
00455   IncrementErrors(i,j,GenericThingId(c));
00456 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
Int_t  genericId 
) [static, protected]

Definition at line 440 of file CalScheme.cxx.

References IncrementErrors().

00442 {
00443   IncrementErrors(i,j,GenericThingId(c));
00444 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j,
const GenericThingId thing 
) [static, protected]

Increment an error count.

Definition at line 426 of file CalScheme.cxx.

References fsChannelErrors, and IncrementErrors().

00429 {
00433 
00434   // Mod the values by the max value to prevent buffer overflows.
00435   IncrementErrors(i,j);
00436   fsChannelErrors[id]++;
00437 }

void CalScheme::IncrementErrors ( SchemeType_t  i,
ErrorType_t  j = kGeneralErr 
) [static, protected]

Increment an error count.

Definition at line 414 of file CalScheme.cxx.

References fsErrors, kNumberOfErrorTypes, and kNumberOfSchemeTypes.

Referenced by PulserSigLinCalScheme::ApplyBendyCalib(), PulserSigLinCalScheme::ApplyCalib(), PulserSigLinCalScheme::ApplyCalibFar(), PulserTimeCalScheme::CalibrateByMuon(), PulserTimeCalScheme::CalibrateByPulser(), PulserTimeCalScheme::CalibrateShield(), StripAttenCalScheme::DecalAttenCorrected(), MuonDriftCalScheme::DecalDrift(), PulserDriftCalScheme::DecalDrift(), QuadLinearityCalScheme::DecalLinearity(), MIPCalScheme::DecalMIP(), StripToStripCalScheme::DecalStripToStrip(), TimeCalScheme::DecalTime(), VaLinearityCalScheme::DecalVALinearity(), PmtDriftCalScheme::DoReset(), PEGainCalScheme::DoReset(), VaLinearityCalScheme::DoReset(), TimeCalScheme::DoReset(), PulserSigLinCalScheme::DoReset(), StripToStripCalScheme::DoReset(), PEGainAggCalScheme::DoReset(), StripAttenCalScheme::DoReset(), PulserDriftCalScheme::DoReset(), MIPCalScheme::DoReset(), MuonDriftCalScheme::DoReset(), QuadLinearityCalScheme::DoReset(), TemperatureCalScheme::DoReset(), PulserTimeCalScheme::DoReset(), StripAttenCalScheme::GetAttenCorrected(), TimeCalScheme::GetCalibratedTime(), PmtDriftCalScheme::GetDrift(), PulserDriftCalScheme::GetDriftCorrected(), MuonDriftCalScheme::GetDriftCorrected(), PulserDriftCalScheme::GetDriftFar(), PulserSigLinCalScheme::GetDriftFar(), PulserSigLinCalScheme::GetDriftPinDiodeValue(), PulserDriftCalScheme::GetDriftPinDiodeValue(), PulserDriftCalScheme::GetDriftPoint(), PulserSigLinCalScheme::GetDriftPoint(), QuadLinearityCalScheme::GetLinearized(), VaLinearityCalScheme::GetLinearizedVA(), MIPCalScheme::GetMIP(), PulserSigLinCalScheme::GetReferencePinDiodeValue(), PEGainAggCalScheme::GetRow(), PEGainCalScheme::GetRow(), StripToStripCalScheme::GetStripToStripCorrected(), TemperatureCalScheme::GetTemperature(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), and IncrementErrors().

00416 {
00420 
00421   // Mod the values by the max value to prevent buffer overflows.
00422 
00423   fsErrors[i % kNumberOfSchemeTypes][j % kNumberOfErrorTypes]++;
00424 }

void CalScheme::PrintConfig (  )  const

Definition at line 544 of file CalScheme.cxx.

References MsgService::Instance().

Referenced by PrintConfig().

00545 {
00546   PrintConfig(*(MsgService::Instance()->GetStream("Calib")));
00547 }

void CalScheme::PrintConfig ( MsgStream ms  )  const

Definition at line 537 of file CalScheme.cxx.

References PrintConfig().

00538 {
00539   stringstream oss;
00540   PrintConfig(oss);
00541   ms << oss.str();
00542 }

void CalScheme::PrintConfig ( std::ostream &  os  )  const [virtual]

Prints out the current configuration status Should be overridden by implimentation.

Reimplemented in Calibrator, MIPCalScheme, MuonDriftCalScheme, PEGainAggCalScheme, PEGainCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserLinearityCalScheme, PulserSigLinCalScheme, PulserTimeCalScheme, QuadLinearityCalScheme, StripAttenCalScheme, StripToStripCalScheme, TemperatureCalScheme, TimeCalScheme, and VaLinearityCalScheme.

Definition at line 524 of file CalScheme.cxx.

References CfgPromptConfigurable::GetConfig(), and Registry::PrettyPrint().

Referenced by operator<<(), and Calibrator::PrintConfig().

00525 {
00530   os << "Generic CalScheme PrintConfig()" <<endl;
00531   const Registry& r = this->GetConfig();
00532   r.PrettyPrint(os);
00533 }

void CalScheme::PrintErrorStats (  )  const

Definition at line 557 of file CalScheme.cxx.

References MsgService::Instance().

Referenced by PrintErrorStats(), and Calibrator::~Calibrator().

00558 {
00559   PrintErrorStats(*(MsgService::Instance()->GetStream("Calib")));
00560 }

void CalScheme::PrintErrorStats ( MsgStream ms  )  const

Definition at line 550 of file CalScheme.cxx.

References PrintErrorStats().

00551 {
00552   stringstream oss;
00553   PrintErrorStats(oss);
00554   ms << oss.str();
00555 }

void CalScheme::PrintErrorStats ( std::ostream &  os  )  const

Definition at line 483 of file CalScheme.cxx.

References bfld::AsString(), Form(), fsCalls, fsChannelErrors, fsErrors, it, kBadInput, kDataInsufficient, kFPE, kGeneralErr, kMissingRow, kMissingTable, kNumberOfSchemeTypes, and SchemeTypeName().

00484 {
00485   os << "Calibrator Errors Statistics:" << endl;
00486   os << Form("%20s %10s ||%10s|%10s|%10s|%10s|%10s|%10s\n",
00487              "Calibrator","Calls","General","Miss Table","Miss Row","FP Error","Insuf.Data","Bad Input");
00488   for(int type = 0; type < kNumberOfSchemeTypes; type ++) {
00489     os << Form("%20s %10d || %8d | %8d | %8d | %8d | %8d | %8d\n",
00490                SchemeTypeName((SchemeType_t)type),
00491                fsCalls[type], 
00492                fsErrors[type][kGeneralErr],
00493                fsErrors[type][kMissingTable],
00494                fsErrors[type][kMissingRow],
00495                fsErrors[type][kFPE],
00496                fsErrors[type][kDataInsufficient],
00497                fsErrors[type][kBadInput]);
00498   }
00499   // Print out channel errors.
00500   // This bit of arcane code basically does an
00501   // insertion sort on the number of errors generated
00502   // in order to figure out which channels have generated
00503   // the most errors.
00504 
00505   os << "Channels with the most errors: " << endl;
00506   std::multimap<int,GenericThingId> sortedChannels;
00507   std::map<GenericThingId,int>::iterator it;
00508   for(it = fsChannelErrors.begin(); it!= fsChannelErrors.end(); it++) {
00509     sortedChannels.insert(std::pair<int,GenericThingId>(-(it->second),it->first));
00510   }
00511 
00512   std::multimap<int,GenericThingId>::iterator it2;
00513   it2 = sortedChannels.begin();
00514   int i=0;
00515   while((i<10) && (it2!=sortedChannels.end())) {
00516     os << "Errors: " << Form("%8d",-(it2->first)) << "  " << (it2->second).AsString() << endl;
00517     it2++; i++;
00518   }
00519 }

void CalScheme::Reset ( const VldContext context,
Bool_t  force = false 
)

Called by the user to indicate that the current event context has changed.

This routine calls this->DoReset(), which performs the user tasks for the current implimentation.

Definition at line 362 of file CalScheme.cxx.

References VldContext::AsString(), DoReset(), fContext, Nav::GetName(), VldContext::IsValid(), Msg::kVerbose, and MSG.

Referenced by UberDST::Ana(), EvtAddRawDigitBlockModule::Ana(), DatabaseToucher::Ana(), CDTrackerModule::Ana(), MeuPlots::CalAttenSyst(), EnergyCorrections::CalibrationGroupEnergyCorrections(), MuonDriftCalScheme::ConfigModified(), PmtDriftCalScheme::ConfigModified(), StripAttenCalScheme::ConfigModified(), VaLinearityCalScheme::ConfigModified(), PulserTimeCalScheme::ConfigModified(), MIPCalScheme::ConfigModified(), StripToStripCalScheme::ConfigModified(), Calibrator::DecalAttenCorrected(), Calibrator::DecalDrift(), Calibrator::DecalGainAndWidth(), Calibrator::DecalLinearity(), Calibrator::DecalMIP(), Calibrator::DecalStripToStrip(), Calibrator::DecalTime(), Calibrator::DecalVALinearity(), MeuPlots::DriftCalibrate(), MeuPlots::DriftDecalTwice(), PhotonStatSummarizer::FillTrees(), DigitListModule::Get(), DetSim::Get(), PhotonInjector::Get(), PhotonTransport::Get(), Calibrator::GetAttenCorrected(), Calibrator::GetCalibratedTime(), CDCrossTalker::GetCleanStripMap(), EvtOverlaySingleton::GetCrateT0s(), Calibrator::GetDriftCorrected(), Calibrator::GetLinearized(), Calibrator::GetLinearizedVA(), Calibrator::GetMIP(), Calibrator::GetPhotoElectrons(), Calibrator::GetStripToStripCorrected(), Calibrator::GetTemperature(), CDTrackedHits::GetTrackedStripInfo(), CDUnidentifiedHits::GetUnidentifiedStripInfo(), CDCrossTalker::GetXTalkStripInfo(), load_better_mipcal(), MinosCompactEvent::MinosCompactEvent(), ShowerSRListModule::Reco(), NtpSRModule::Reco(), MnvRawDigitSuppression::Reco(), TrackSRListModule::Reco(), ShowerEMListModule::Reco(), UberModule::Reco(), EventSRListModule::Reco(), UberModuleLite::Reco(), Calibrator::ReInitialise(), AlgPassThru::RunAlg(), FitterEM::SetUpStripInfo(), MeuPlots::ugliClearFibre(), and LIAnalysis::WriteGainsTextFile().

00363 {
00370 
00371   // Only perform actions if this context is a ligit one. Otherwise, don't bother
00372   // spamming with DB messages.
00373   if(context.IsValid()) {
00374 
00375     // Only perform actions if the context changes. Otherwise, don't
00376     // bother.
00377     if( (fContext!=context) || (force) ) {
00378       MSG("Calib",Msg::kVerbose) << "Resetting " << this->GetName() << "  " << context.AsString() << endl;
00379       fContext = context;
00380       this->DoReset(context);
00381     }
00382   }
00383 }

void CalScheme::ResetStatistics (  )  [static, protected]

Sets all error count statistics to zero.

Usually called by Calibrator c'tor at start of job.

Definition at line 399 of file CalScheme.cxx.

References fsCalls, fsChannelErrors, fsErrors, kNumberOfErrorTypes, and kNumberOfSchemeTypes.

Referenced by Calibrator::Instance().

00400 {
00406   for(int i=0;i<kNumberOfSchemeTypes;i++) {
00407     fsCalls[i] = 0;
00408     for(int j=0;j<kNumberOfErrorTypes;j++)
00409       fsErrors[i][j] = 0;
00410   }
00411   fsChannelErrors.clear();
00412 }

static const char* CalScheme::SchemeTypeName ( int  t  )  [inline, static]

Definition at line 116 of file CalScheme.h.

References kNumberOfSchemeTypes.

Referenced by PrintErrorStats(), Calibrator::PrintEventStats(), and Calibrator::ResetHistograms().

00116                                            {
00117     static const char* sTypeNames[] = {
00118       "Unknown",
00119       "TimeCalibrator",
00120       "PeCalibrator",
00121       "VALinCalibrator",
00122       "LinCalibrator",
00123       "DriftCalibrator",
00124       "StripCalibrator",
00125       "AttenCalibrator",
00126       "MIPCalibrator",
00127       "Thermometer",
00128       "???"};
00129     return sTypeNames[t%kNumberOfSchemeTypes];
00130   };

void CalScheme::Unimplimented (  )  const [private]

A short routine that warns the user that an improper scheme has been implimented. Then crashes, just to show 'em.

Definition at line 387 of file CalScheme.cxx.

References Nav::GetName(), Msg::kFatal, and MSG.

Referenced by DecalAttenCorrected(), DecalDrift(), DecalGainAndWidth(), DecalLinearity(), DecalMIP(), DecalStripToStrip(), DecalTime(), DecalVALinearity(), GetAttenCorrected(), GetCalibratedTime(), GetDriftCorrected(), GetLinearized(), GetLinearizedVA(), GetMIP(), GetPhotoElectrons(), GetStripToStripCorrected(), and GetTemperature().

00388 {
00393   MSG("Calib",Msg::kFatal) << this->GetName() << " called with unimplimented function. " << endl
00394                            << "Calibrator is not set up correctly!" << endl;
00395   assert(0);
00396 }

static const char* CalScheme::UnitName ( int  t  )  [inline, static]

Definition at line 132 of file CalScheme.h.

References kNumberOfSchemeTypes.

Referenced by Calibrator::PrintEventStats(), and Calibrator::ResetHistograms().

00132                                      {
00133     static const char* sUnitNames[] = {
00134       "Unknown",
00135       "Seconds",
00136       "PE",
00137       "ADC",
00138       "SigLin",
00139       "SigDrift",
00140       "SigCorr",
00141       "SigMap",
00142       "SigMip",
00143       "C",
00144       "???"};
00145     return sUnitNames[t%kNumberOfSchemeTypes];
00146   };


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CalScheme s 
) [friend]

Member Data Documentation

Definition at line 98 of file CalScheme.h.

Referenced by GetContext(), and Reset().

Int_t CalScheme::fsCalls = {0} [static, private]

Definition at line 173 of file CalScheme.h.

Referenced by IncrementCalls(), PrintErrorStats(), and ResetStatistics().

std::map< GenericThingId, int > CalScheme::fsChannelErrors [static, private]

Definition at line 175 of file CalScheme.h.

Referenced by IncrementErrors(), PrintErrorStats(), and ResetStatistics().

Int_t CalScheme::fsErrors = {{0},{0}} [static, private]

Definition at line 174 of file CalScheme.h.

Referenced by IncrementErrors(), PrintErrorStats(), and ResetStatistics().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1