TSetupData Class Reference
[alcapanarootana]

Holds data relevent to each run. More...

#include <TSetupData.h>

Inheritance diagram for TSetupData:
TObject

List of all members.

Public Member Functions

std::string GetBankName (std::string DetectorName) const
std::string GetDetectorName (std::string BankName) const
void GetAllDetectors (std::map< std::string, std::string > &detectors) const
void GetAllDetectors (std::vector< std::string > &detectors) const
bool IsEnable (const std::string &BankName)
Getters

Parameters:
[in] BankName Name of the MIDAS bank we're querying about.


double GetClockTick (const std::string &BankName) const
int GetNBits (const std::string &BankName) const
double GetADCSlopeCalib (const std::string &BankName) const
 Deprecated.
double GetADCOffsetCalib (const std::string &BankName) const
 Deprecated.
double GetTimeShift (const std::string &BankName) const
 Timing offset of bank from muSc.
int GetTriggerPolarity (const std::string &BankName) const
 Pulse polarity.
int GetPedestal (const std::string &BankName) const
bool GetEnableBit (const std::string &BankName) const
Setters

Parameters:
[in] BankName Name of bank information is being set about.
[out] value The value to saved.


bool SetDetectorName (std::string BankName, std::string value)
void SetClockTick (std::string BankName, double value)
void SetNBits (std::string BankName, int value)
void SetTimeShift (std::string BankName, double value)
void SetTriggerPolarity (std::string BankName, int value)
void SetPedestal (std::string BankName, int value)
void SetADCSlopeCalib (std::string BankName, double value)
void SetADCOffsetCalib (std::string BankName, double value)
void SetEnableBit (std::string BankName, bool value)

Static Public Member Functions

static TSetupDataInstance ()
 (Quasi-)Singleton interface
static bool IsFADC (const std::string &BankName)
static bool IsHoustonCAEN (const std::string &BankName)
static bool IsBostonCAEN (const std::string &BankName)
static bool IsSlow (const std::string &BankName)
static bool IsFast (const std::string &BankName)

Public Attributes

Maps

All maps have, as their keys the MIDAS bank (digitizer channel) name. These are all from the ODB.



std::map< std::string,
std::string > 
fBankToDetectorMap
 The physical detector name.
std::map< std::string, double > fBankToClockTickMap
 The length, in nanoseconds, of each sample clock tick.
std::map< std::string, int > fBankToBitMap
 The number of bits (precision) each ADC sample has.
std::map< std::string, double > fBankToADCSlopeCalibMap
 Deprecated.
std::map< std::string, double > fBankToADCOffsetCalibMap
 Deprecated.
std::map< std::string, double > fBankToTimeShift
 The timing offset from the muSc.
std::map< std::string, int > fBankToPolarityMap
 The pulse polarity (positive = 1, negative = -1).
std::map< std::string, int > fBankToPedestalMap
 The voltage offet in units of ADC.
std::map< std::string, bool > fBankToEnableBitMap
 Whether or not the channel was enabled.

Private Member Functions

double GetValue (const std::map< std::string, double > &map, const std::string &BankName) const
int GetValue (const std::map< std::string, int > &map, const std::string &BankName) const
bool GetValue (const std::map< std::string, bool > &map, const std::string &BankName) const

Detailed Description

Holds data relevent to each run.

TSetupData (TSD) holds information about each run. This consists mainly of data from the ODB WireMap, most importantly a mapping between each digitizer channel and the physical detector it had plugged in. Other hardware information such as the bit precision of each digitizer channel, is also contained here.

Definition at line 24 of file TSetupData.h.


Member Function Documentation

double TSetupData::GetADCOffsetCalib ( const std::string &  BankName  )  const [inline]

Deprecated.

Definition at line 79 of file TSetupData.h.

References fBankToADCOffsetCalibMap, and GetValue().

Referenced by SetupRecord::InitMetaData().

00079 { return GetValue(fBankToADCOffsetCalibMap,BankName); };

double TSetupData::GetADCSlopeCalib ( const std::string &  BankName  )  const [inline]

Deprecated.

Definition at line 77 of file TSetupData.h.

References fBankToADCSlopeCalibMap, and GetValue().

Referenced by SetupRecord::InitMetaData().

00077 { return GetValue(fBankToADCSlopeCalibMap,BankName); };

void TSetupData::GetAllDetectors ( std::vector< std::string > &  detectors  )  const
Parameters:
[out] detectors Vector of all detectors, omitting detectors named "blank".

Definition at line 21 of file TSetupData.cpp.

References fBankToDetectorMap.

00021                                                                     {
00022    std::map<std::string, std::string>::const_iterator it;
00023    for (it=fBankToDetectorMap.begin();it!= fBankToDetectorMap.end(); ++it){
00024        if(it->second!="blank" ) detectors.push_back(it->second);
00025    }
00026 }

void TSetupData::GetAllDetectors ( std::map< std::string, std::string > &  detectors  )  const
Parameters:
[out] detectors Map with detectors as keys and banks as the mapped value, omitting detectors name "blank".

Definition at line 14 of file TSetupData.cpp.

References fBankToDetectorMap.

Referenced by MakeAnalysedPulses::BeforeFirstEntry().

00014                                                                            {
00015    std::map<std::string, std::string>::const_iterator it;
00016    for (it=fBankToDetectorMap.begin();it!= fBankToDetectorMap.end(); ++it){
00017        if(it->second!="blank" ) detectors[it->second]=it->first;
00018    }
00019 }

std::string TSetupData::GetBankName ( std::string  DetectorName  )  const
double TSetupData::GetClockTick ( const std::string &  BankName  )  const [inline]
Returns:
Length of sample clock ticks in nanoseconds.

Definition at line 74 of file TSetupData.h.

References fBankToClockTickMap, and GetValue().

Referenced by TPulseIsland::GetClockTickInNs(), SetupRecord::InitMetaData(), MDQ_IslandTimestamp_init(), PrintSetupData(), and MakeTemplate::ProcessEntry().

00074 { return GetValue(fBankToClockTickMap,BankName);}

std::string TSetupData::GetDetectorName ( std::string  BankName  )  const [inline]
bool TSetupData::GetEnableBit ( const std::string &  BankName  )  const [inline]

Definition at line 85 of file TSetupData.h.

References fBankToEnableBitMap, and GetValue().

Referenced by SetupRecord::InitMetaData(), and IsEnable().

00085 {return GetValue(fBankToEnableBitMap, BankName);};

int TSetupData::GetNBits ( const std::string &  BankName  )  const [inline]
int TSetupData::GetPedestal ( const std::string &  BankName  )  const [inline]
double TSetupData::GetTimeShift ( const std::string &  BankName  )  const [inline]

Timing offset of bank from muSc.

Definition at line 81 of file TSetupData.h.

References fBankToTimeShift, and GetValue().

Referenced by GetTime(), SetupRecord::InitMetaData(), MDQ_muScTDiff(), and PrintSetupData().

00081 { return GetValue(fBankToTimeShift,BankName); };

int TSetupData::GetTriggerPolarity ( const std::string &  BankName  )  const [inline]
bool TSetupData::GetValue ( const std::map< std::string, bool > &  map,
const std::string &  BankName 
) const [inline, private]

Definition at line 136 of file TSetupData.h.

00137                                                {
00138     std::map<std::string, bool>::const_iterator it=map.find(BankName); 
00139     if(it!=map.end()) return it->second;
00140     return false;
00141   }

int TSetupData::GetValue ( const std::map< std::string, int > &  map,
const std::string &  BankName 
) const [inline, private]

Definition at line 129 of file TSetupData.h.

00130                                               {
00131     std::map<std::string, int>::const_iterator it=map.find(BankName); 
00132     if(it!=map.end()) return it->second;
00133     return 0;
00134   }

double TSetupData::GetValue ( const std::map< std::string, double > &  map,
const std::string &  BankName 
) const [inline, private]

Definition at line 122 of file TSetupData.h.

Referenced by GetADCOffsetCalib(), GetADCSlopeCalib(), GetClockTick(), GetEnableBit(), GetNBits(), GetPedestal(), GetTimeShift(), and GetTriggerPolarity().

00123                                                  {
00124     std::map<std::string, double>::const_iterator it=map.find(BankName); 
00125     if(it!=map.end()) return it->second;
00126     return 0.;
00127   }

static bool TSetupData::IsBostonCAEN ( const std::string &  BankName  )  [inline, static]

Definition at line 113 of file TSetupData.h.

Referenced by module_event_sort_and_stitch(), module_init(), and UpdateDetectorBankNameMap().

00113 { return BankName.substr(2,2)  == "BU"; } // if the first letter is C then the bank name is for a CAEN

bool TSetupData::IsEnable ( const std::string &  BankName  )  [inline]

Definition at line 117 of file TSetupData.h.

References GetEnableBit().

00117 {return GetEnableBit(BankName);}

static bool TSetupData::IsFADC ( const std::string &  BankName  )  [inline, static]

Definition at line 111 of file TSetupData.h.

Referenced by MDQ_Thresholds_eor(), and UpdateDetectorBankNameMap().

00111 { return BankName[0] == 'N'; } // if the first letter is N then the bank name is for a FADC

static bool TSetupData::IsFast ( const std::string &  BankName  )  [inline, static]

Definition at line 115 of file TSetupData.h.

Referenced by MakeAnalysedPulses::BeforeFirstEntry().

00115 { return (*(BankName.end() -1)  == 'F' || BankName.substr(0,2) == "Sc" ); } // if the last letter is F then the bank name is for a Fast pulse

static bool TSetupData::IsHoustonCAEN ( const std::string &  BankName  )  [inline, static]

Definition at line 112 of file TSetupData.h.

Referenced by module_event_sort_and_stitch(), module_init(), and UpdateDetectorBankNameMap().

00112 { return BankName.substr(2,2) == "UH"; } // if the first letter is C then the bank name is for a CAEN

static bool TSetupData::IsSlow ( const std::string &  BankName  )  [inline, static]

Definition at line 114 of file TSetupData.h.

00114 { return (*BankName.end() -1 ) == 'S'; } // if the last letter is S then the bank name is for a Slow pulse

void TSetupData::SetADCOffsetCalib ( std::string  BankName,
double  value 
) [inline]

Definition at line 107 of file TSetupData.h.

References fBankToADCOffsetCalibMap.

Referenced by UpdateDetectorBankNameMap().

00107 { fBankToADCOffsetCalibMap[BankName] = value; };

void TSetupData::SetADCSlopeCalib ( std::string  BankName,
double  value 
) [inline]

Definition at line 106 of file TSetupData.h.

References fBankToADCSlopeCalibMap.

Referenced by UpdateDetectorBankNameMap().

00106 { fBankToADCSlopeCalibMap[BankName] = value; }

void TSetupData::SetClockTick ( std::string  BankName,
double  value 
) [inline]

Definition at line 101 of file TSetupData.h.

References fBankToClockTickMap.

Referenced by UpdateDetectorBankNameMap().

00101 { fBankToClockTickMap[BankName]=value; }

bool TSetupData::SetDetectorName ( std::string  BankName,
std::string  value 
) [inline]

Definition at line 93 of file TSetupData.h.

References fBankToDetectorMap.

Referenced by UpdateDetectorBankNameMap().

00093                                                             {
00094     std::map< std::string, std::string >::iterator it;
00095     for (it = fBankToDetectorMap.begin(); it != fBankToDetectorMap.end(); ++it)
00096       if (it->second == value)
00097         return false;
00098     fBankToDetectorMap[BankName] = value;
00099     return true;
00100   }

void TSetupData::SetEnableBit ( std::string  BankName,
bool  value 
) [inline]

Definition at line 108 of file TSetupData.h.

References fBankToEnableBitMap.

Referenced by UpdateDetectorBankNameMap().

00108 {fBankToEnableBitMap[BankName] = value;};

void TSetupData::SetNBits ( std::string  BankName,
int  value 
) [inline]

Definition at line 102 of file TSetupData.h.

References fBankToBitMap.

Referenced by UpdateDetectorBankNameMap().

00102 { fBankToBitMap[BankName]=value; }

void TSetupData::SetPedestal ( std::string  BankName,
int  value 
) [inline]

Definition at line 105 of file TSetupData.h.

References fBankToPedestalMap.

Referenced by UpdateDetectorBankNameMap().

00105 { fBankToPedestalMap[BankName]=value; }

void TSetupData::SetTimeShift ( std::string  BankName,
double  value 
) [inline]

Definition at line 103 of file TSetupData.h.

References fBankToTimeShift.

Referenced by UpdateDetectorBankNameMap().

00103 { fBankToTimeShift[BankName]=value; }

void TSetupData::SetTriggerPolarity ( std::string  BankName,
int  value 
) [inline]

Definition at line 104 of file TSetupData.h.

References fBankToPolarityMap.

Referenced by UpdateDetectorBankNameMap().

00104 { fBankToPolarityMap[BankName]=value; }


Member Data Documentation

std::map<std::string, double> TSetupData::fBankToADCOffsetCalibMap

Deprecated.

Definition at line 43 of file TSetupData.h.

Referenced by GetADCOffsetCalib(), and SetADCOffsetCalib().

std::map<std::string, double> TSetupData::fBankToADCSlopeCalibMap

Deprecated.

Definition at line 41 of file TSetupData.h.

Referenced by GetADCSlopeCalib(), and SetADCSlopeCalib().

std::map<std::string, int> TSetupData::fBankToBitMap

The number of bits (precision) each ADC sample has.

Definition at line 39 of file TSetupData.h.

Referenced by GetNBits(), SetupRecord::InitMetaData(), and SetNBits().

std::map<std::string, double> TSetupData::fBankToClockTickMap

The length, in nanoseconds, of each sample clock tick.

Definition at line 37 of file TSetupData.h.

Referenced by GetClockTick(), and SetClockTick().

std::map<std::string, std::string> TSetupData::fBankToDetectorMap
std::map<std::string, bool> TSetupData::fBankToEnableBitMap

Whether or not the channel was enabled.

Definition at line 51 of file TSetupData.h.

Referenced by GetEnableBit(), and SetEnableBit().

std::map<std::string, int> TSetupData::fBankToPedestalMap

The voltage offet in units of ADC.

Definition at line 49 of file TSetupData.h.

Referenced by GetPedestal(), and SetPedestal().

std::map<std::string, int> TSetupData::fBankToPolarityMap

The pulse polarity (positive = 1, negative = -1).

Definition at line 47 of file TSetupData.h.

Referenced by GetTriggerPolarity(), and SetTriggerPolarity().

std::map<std::string, double> TSetupData::fBankToTimeShift

The timing offset from the muSc.

Definition at line 45 of file TSetupData.h.

Referenced by GetTimeShift(), and SetTimeShift().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1