The TScaler is designed to hold all of the information about the scaler status.
Public Member Functions | |
TScaler (bool loadIntoMap=false) | |
TScaler (TTree *, bool loadIntoMap=false) | |
TScaler (const TScaler &) | |
~TScaler () override | |
void | Clear (Option_t *opt="") override |
void | Copy (TObject &obj) const override |
TH1D * | Draw (UInt_t address, size_t index=0, Option_t *option="") |
TH1D * | Draw (UInt_t lowAddress, UInt_t highAddress, size_t index=0, Option_t *option="") |
TH1D * | DrawRawTimes (UInt_t address, Double_t lowtime, Double_t hightime, size_t index=0, Option_t *option="") |
std::map< UInt_t, std::map< ULong64_t, int > > | GetNumberOfTimePeriods () |
std::vector< UInt_t > | GetScaler (UInt_t address, ULong64_t time) const |
UInt_t | GetScaler (UInt_t address, ULong64_t time, size_t index) const |
UInt_t | GetScalerDifference (UInt_t address, ULong64_t time, size_t index) const |
ULong64_t | GetTimePeriod (UInt_t address) |
std::map< UInt_t, ULong64_t > | GetTimePeriodMap () |
void | ListHistograms () |
ULong64_t | NumberOfScalerReadouts () const |
Private Attributes | |
Long64_t | fEntries |
std::map< UInt_t, TH1D * > | fHist |
std::map< std::pair< UInt_t, UInt_t >, TH1D * > | fHistRange |
std::map< UInt_t, std::map< ULong64_t, int > > | fNumberOfTimePeriods |
TPPG * | fPPG |
TScalerData * | fScalerData |
std::map< UInt_t, std::map< ULong64_t, std::vector< UInt_t > > > | fScalerMap |
std::map< UInt_t, ULong64_t > | fTimePeriod |
std::map< ULong64_t, int > | fTotalNumberOfTimePeriods |
ULong64_t | fTotalTimePeriod |
TTree * | fTree |
#include <TScaler.h>
TScaler::TScaler | ( | bool | loadIntoMap = false | ) |
This constructor tries to find the "ScalerTree" and uses it (if requested) to load the scaler data into the map.
[in] | loadIntoMap | Flag telling TScaler to load all scaler data into fScalerMap. |
Definition at line 51 of file TScaler.cxx.
References Clear(), fEntries, fScalerData, fScalerMap, fTree, TScalerData::GetAddress(), TScalerData::GetScaler(), and TScalerData::GetTimeStamp().
TScaler::TScaler | ( | TTree * | tree, |
bool | loadIntoMap = false |
||
) |
Definition at line 69 of file TScaler.cxx.
References Clear(), fEntries, fScalerData, fScalerMap, fTree, TScalerData::GetAddress(), TScalerData::GetScaler(), and TScalerData::GetTimeStamp().
TScaler::TScaler | ( | const TScaler & | rhs | ) |
Definition at line 85 of file TScaler.cxx.
References Copy().
|
override |
Definition at line 90 of file TScaler.cxx.
References fEntries, fHist, fHistRange, fNumberOfTimePeriods, fPPG, fScalerData, fScalerMap, fTimePeriod, fTotalNumberOfTimePeriods, fTotalTimePeriod, and fTree.
|
override |
Definition at line 239 of file TScaler.cxx.
References fEntries, fHist, fHistRange, fNumberOfTimePeriods, fPPG, fScalerData, fScalerMap, fTimePeriod, fTotalNumberOfTimePeriods, fTotalTimePeriod, and fTree.
Referenced by Copy(), MakeSpectra(), and TScaler().
|
override |
Definition at line 106 of file TScaler.cxx.
References Clear(), fEntries, fNumberOfTimePeriods, fScalerData, fScalerMap, fTimePeriod, fTotalNumberOfTimePeriods, fTotalTimePeriod, and fTree.
Referenced by TScaler().
TH1D * TScaler::Draw | ( | UInt_t | address, |
size_t | index = 0 , |
||
Option_t * | option = "" |
||
) |
Draw scaler differences (i.e. current scaler minus last scaler) vs. time in cycle. Passing "redraw" as option forces re-drawing of the histogram (e.g. for a different index).
Definition at line 266 of file TScaler.cxx.
References fEntries, fHist, fPPG, fScalerData, fTree, TSingleton< TPPG >::Get(), TScalerData::GetAddress(), TPPG::GetCycleLength(), TScalerData::GetScaler(), GetScaler(), TPPG::GetTimeInCycle(), GetTimePeriod(), and TScalerData::GetTimeStamp().
TH1D * TScaler::Draw | ( | UInt_t | lowAddress, |
UInt_t | highAddress, | ||
size_t | index = 0 , |
||
Option_t * | option = "" |
||
) |
Draw scaler differences (i.e. current scaler minus last scaler) vs. time in cycle. Passing "redraw" as option forces re-drawing of the histogram (e.g. for a different index). The "single" options creates spectra for all single addresses in the given range (instead of one accumulative spectrum).
Definition at line 334 of file TScaler.cxx.
References fEntries, fHist, fHistRange, fPPG, fScalerData, fTree, TSingleton< TPPG >::Get(), TScalerData::GetAddress(), TPPG::GetCycleLength(), TScalerData::GetScaler(), TPPG::GetTimeInCycle(), GetTimePeriod(), and TScalerData::GetTimeStamp().
TH1D * TScaler::DrawRawTimes | ( | UInt_t | address, |
Double_t | lowtime, | ||
Double_t | hightime, | ||
size_t | index = 0 , |
||
Option_t * | option = "" |
||
) |
Draw scaler differences (i.e. current scaler minus last scaler) vs. time.
Definition at line 463 of file TScaler.cxx.
References fEntries, fScalerData, fTree, TScalerData::GetAddress(), TScalerData::GetScaler(), GetScaler(), GetTimePeriod(), and TScalerData::GetTimeStamp().
|
inline |
Definition at line 116 of file TScaler.h.
References fNumberOfTimePeriods.
std::vector< UInt_t > TScaler::GetScaler | ( | UInt_t | address, |
ULong64_t | time | ||
) | const |
Returns the vector of scaler values for address "address" at the time "time". If the time is after the last entry, we return the last entry, otherwise we return the following entry (or the current entry if the time is an exact match).
Definition at line 119 of file TScaler.cxx.
References fEntries, fScalerData, fScalerMap, fTree, TScalerData::GetAddress(), TScalerData::GetScaler(), and TScalerData::GetTimeStamp().
Referenced by Draw(), DrawRawTimes(), and GetScaler().
UInt_t TScaler::GetScaler | ( | UInt_t | address, |
ULong64_t | time, | ||
size_t | index | ||
) | const |
Definition at line 165 of file TScaler.cxx.
References GetScaler().
UInt_t TScaler::GetScalerDifference | ( | UInt_t | address, |
ULong64_t | time, | ||
size_t | index | ||
) | const |
Returns the difference between "index"th scaler value for address "address" at the time "time" and the previous scaler value. If the time is after our last entry, we return the last entry divided by the number of entries, if this is before the first scaler, we just return the first scaler, otherwise we return the scaler minus the previous scaler.
Definition at line 174 of file TScaler.cxx.
References fEntries, fScalerData, fScalerMap, fTree, TScalerData::GetAddress(), TScalerData::GetScaler(), and TScalerData::GetTimeStamp().
ULong64_t TScaler::GetTimePeriod | ( | UInt_t | address | ) |
Get time period of scaler readouts for address "address" by calculating all time differences and choosing the one that occurs most often. Returns 0 if the address doesn't exist in the map.
Definition at line 504 of file TScaler.cxx.
References fEntries, fNumberOfTimePeriods, fScalerData, fTimePeriod, fTree, TScalerData::GetAddress(), and TScalerData::GetTimeStamp().
Referenced by Draw(), and DrawRawTimes().
|
inline |
Definition at line 115 of file TScaler.h.
References fTimePeriod.
void TScaler::ListHistograms | ( | ) |
Definition at line 536 of file TScaler.cxx.
References fHist, fHistRange, and hex().
|
inline |
|
private |
Definition at line 129 of file TScaler.h.
Referenced by Clear(), Copy(), Draw(), DrawRawTimes(), GetScaler(), GetScalerDifference(), GetTimePeriod(), NumberOfScalerReadouts(), TScaler(), and ~TScaler().
|
private |
! map to store histograms that have already been drawn
Definition at line 138 of file TScaler.h.
Referenced by Clear(), Draw(), ListHistograms(), and ~TScaler().
|
private |
! map to store histograms for address-ranges
Definition at line 139 of file TScaler.h.
Referenced by Clear(), Draw(), ListHistograms(), and ~TScaler().
|
private |
!
Definition at line 134 of file TScaler.h.
Referenced by Clear(), Copy(), GetNumberOfTimePeriods(), GetTimePeriod(), and ~TScaler().
|
private |
|
private |
Definition at line 128 of file TScaler.h.
Referenced by Clear(), Copy(), Draw(), DrawRawTimes(), GetScaler(), GetScalerDifference(), GetTimePeriod(), TScaler(), and ~TScaler().
|
private |
! an address-map of timestamp mapped scaler values
Definition at line 131 of file TScaler.h.
Referenced by Clear(), Copy(), GetScaler(), GetScalerDifference(), TScaler(), and ~TScaler().
|
private |
! a map between addresses and time differences (used to calculate the time period)
Definition at line 133 of file TScaler.h.
Referenced by Clear(), Copy(), GetTimePeriod(), GetTimePeriodMap(), and ~TScaler().
|
private |
|
private |
|
private |
Definition at line 127 of file TScaler.h.
Referenced by Clear(), Copy(), Draw(), DrawRawTimes(), GetScaler(), GetScalerDifference(), GetTimePeriod(), TScaler(), and ~TScaler().