GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
The TPPG is designed to hold all of the information about the PPG status.
Public Types | |
using | PPGMap_t = std::map<ULong_t, TPPGData*> |
Public Member Functions | |
TPPG () | |
TPPG (const TPPG &) | |
TPPG (TPPG &&)=default | |
~TPPG () | |
void | Add (const TPPG *ppg) |
void | AddData (TPPGData *pat) |
void | Clear (Option_t *opt="") override |
void | Copy (TObject &obj) const override |
bool | Correct (bool verbose=false) |
const TPPGData * | First () |
ULong64_t | GetCycleLength () |
ULong64_t | GetCycleNumber (ULong64_t real_time) |
ULong64_t | GetLastStatusTime (ULong64_t time, EPpgPattern pat=EPpgPattern::kJunk) const |
EPpgPattern | GetNextStatus (ULong64_t time) const |
ULong64_t | GetNextStatusTime (ULong64_t time, EPpgPattern pat=EPpgPattern::kJunk) const |
ULong64_t | GetNumberOfCycles () |
EPpgPattern | GetStatus (ULong64_t time) const |
ULong64_t | GetStatusStart (EPpgPattern) |
ULong64_t | GetTimeInCycle (ULong64_t real_time) |
const TPPGData * | Last () |
Bool_t | MapIsEmpty () const |
Long64_t | Merge (TCollection *list) |
const TPPGData * | Next () |
Long64_t | OdbCycleLength () const |
int | OdbDuration (size_t index) const |
bool | OdbMatchesData (bool verbose=false) |
int16_t | OdbPPGCode (size_t index) const |
std::size_t | OdbPPGSize () const |
void | operator+= (const TPPG &rhs) |
TPPG & | operator= (const TPPG &) |
TPPG & | operator= (TPPG &&)=default |
std::size_t | PPGSize () const |
const TPPGData * | Previous () |
void | Print (Option_t *opt="") const override |
void | SetCycleLength (ULong64_t length) |
void | SetOdbCycle (std::vector< int16_t > ppgCodes, std::vector< int > durations) |
void | SetOdbFromData (bool verbose=false) |
void | Setup () |
Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override |
Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override |
Static Public Member Functions | |
static TPPG * | AddCurrent () |
static TPPG * | Get (bool verbose=false) |
static TPPG * | GetAll () |
static void | PrintDirectory () |
static void | Set (TPPG *val) |
Private Member Functions | |
bool | CalculateCycleFromData (bool verbose=false) |
PPGMap_t::iterator | MapBegin () const |
PPGMap_t::iterator | MapEnd () const |
Private Attributes | |
PPGMap_t::iterator | fCurrIterator |
ULong64_t | fCycleLength {0} |
bool | fCycleSet {false} |
std::vector< ULong64_t > | fDurations {0, 0, 0, 0} |
std::map< ULong64_t, int > | fNumberOfCycleLengths |
std::vector< int > | fOdbDurations |
std::vector< int16_t > | fOdbPPGCodes |
std::vector< int16_t > | fPPGCodes {0x8, 0x2, 0x1, 0x4} |
PPGMap_t * | fPPGStatusMap {nullptr} |
Static Private Attributes | |
static TDirectory * | fDir |
static TPPG * | fSingleton |
Friends | |
class | TSingleton< TPPG > |
using TPPG::PPGMap_t = std::map<ULong_t, TPPGData*> |
|
default |
TPPG::~TPPG | ( | ) |
Definition at line 68 of file TPPG.cxx.
References Clear(), and fPPGStatusMap.
void TPPG::Add | ( | const TPPG * | ppg | ) |
Definition at line 680 of file TPPG.cxx.
References AddData(), fCycleLength, fNumberOfCycleLengths, fOdbDurations, fOdbPPGCodes, GetCycleLength(), MapBegin(), and MapEnd().
Referenced by Analyze(), and operator+=().
|
inlinestaticinherited |
Definition at line 141 of file TSingleton.h.
void TPPG::AddData | ( | TPPGData * | pat | ) |
Adds a PPG status word at a given time in the current run. Makes a copy of the pointer to store in the map.
Definition at line 121 of file TPPG.cxx.
References fCycleLength, fCycleSet, fNumberOfCycleLengths, fPPGStatusMap, and TPPGData::GetTimeStamp().
Referenced by Add(), Clear(), Copy(), TGRSIDataParser::GriffinDataToPPGEvent(), and TTdrDataParser::TdrToFragment().
|
private |
Calculate the cycle from the data and store it.
Definition at line 379 of file TPPG.cxx.
References fCycleSet, fDurations, fPPGCodes, GetLastStatusTime(), hex(), kBackground, kBeamOn, kDecay, kTapeMove, MapBegin(), and MapEnd().
Referenced by OdbMatchesData(), and SetOdbFromData().
|
override |
Definition at line 430 of file TPPG.cxx.
References AddData(), fCurrIterator, fCycleLength, fCycleSet, fNumberOfCycleLengths, fOdbDurations, fOdbPPGCodes, and fPPGStatusMap.
|
override |
Definition at line 93 of file TPPG.cxx.
References AddData(), Clear(), fCurrIterator, fCycleLength, fNumberOfCycleLengths, fOdbDurations, fOdbPPGCodes, and fPPGStatusMap.
Referenced by TPPG(), operator=(), and Setup().
bool TPPG::Correct | ( | bool | verbose = false | ) |
Correct the map of PPG events by checking that we always have a PPG event with the same status that occured fCycleLength ago.
Definition at line 482 of file TPPG.cxx.
References DBLUE, DRED, fCycleLength, fNumberOfCycleLengths, fPPGStatusMap, GetCycleLength(), GetLastStatusTime(), hex(), MapBegin(), MapEnd(), and RESET_COLOR.
const TPPGData * TPPG::First | ( | ) |
Definition at line 595 of file TPPG.cxx.
References fCurrIterator, and MapBegin().
|
inlinestaticinherited |
Definition at line 33 of file TSingleton.h.
Referenced by TScaler::Draw(), TScaler::Draw(), TFragment::GetCycleNumber(), TDetectorHit::GetCycleTimeStamp(), TDetectorHit::GetPPGStatus(), TFragment::GetTimeInCycle(), TDetectorHit::GetTimeSinceTapeMove(), TGRSIDataParser::GriffinDataToPPGEvent(), TMidasFile::SetGRIFFOdb(), TTdrDataParser::TdrToFragment(), TAnalysisWriteLoop::Write(), and TFragWriteLoop::Write().
|
inlinestaticinherited |
Definition at line 66 of file TSingleton.h.
ULong64_t TPPG::GetCycleLength | ( | ) |
Calculates cycle length from the most often occuring time difference between two PPG events with the same code. The result is also stored in fCycleLength (which prevents a second calculation of it the next time this function is called)
Definition at line 629 of file TPPG.cxx.
References fCycleLength, fNumberOfCycleLengths, GetLastStatusTime(), MapBegin(), and MapEnd().
Referenced by Add(), Correct(), TScaler::Draw(), TScaler::Draw(), GetCycleNumber(), GetNumberOfCycles(), GetTimeInCycle(), and TParsingDiagnostics::ReadPPG().
ULong64_t TPPG::GetCycleNumber | ( | ULong64_t | real_time | ) |
Returns the cycle number based on "real_time", i.e. the time divided by the cycle length. "real_time" is in ns since that's how we store the PPG timestamps as well.
Definition at line 621 of file TPPG.cxx.
References GetCycleLength().
Referenced by TFragment::GetCycleNumber().
ULong64_t TPPG::GetLastStatusTime | ( | ULong64_t | time, |
EPpgPattern | pat = EPpgPattern::kJunk ) const |
Gets the last time that a status was given. If the EPpgPattern kJunk is passed, the current status at the time "time" is looked for. "time" is in ns (since we store the PPG timestamp in ns as well)
Definition at line 131 of file TPPG.cxx.
References fPPGStatusMap, kJunk, and MapIsEmpty().
Referenced by CalculateCycleFromData(), Correct(), GetCycleLength(), TDetectorHit::GetCycleTimeStamp(), TDetectorHit::GetPPGStatus(), GetStatusStart(), TDetectorHit::GetTimeSinceTapeMove(), and Print().
EPpgPattern TPPG::GetNextStatus | ( | ULong64_t | time | ) | const |
Returns the next status of the PPG at the time "time". "time" is in ns (since we store the PPG timestamp in ns as well)
Definition at line 199 of file TPPG.cxx.
References fPPGStatusMap, kJunk, and MapIsEmpty().
ULong64_t TPPG::GetNextStatusTime | ( | ULong64_t | time, |
EPpgPattern | pat = EPpgPattern::kJunk ) const |
Gets the next time that a status was given. If the EPpgPattern kJunk is passed, the current status at the time "time" is looked for. "time" is in ns (since we store the PPG timestamp in ns as well)
Definition at line 159 of file TPPG.cxx.
References fPPGStatusMap, kJunk, and MapIsEmpty().
ULong64_t TPPG::GetNumberOfCycles | ( | ) |
Definition at line 652 of file TPPG.cxx.
References GetCycleLength(), TPPGData::GetTimeStamp(), and Last().
EPpgPattern TPPG::GetStatus | ( | ULong64_t | time | ) | const |
Returns the current status of the PPG at the time "time". "time" is in ns (since we store the PPG timestamp in ns as well)
Definition at line 187 of file TPPG.cxx.
References fPPGStatusMap, and MapIsEmpty().
Referenced by TDetectorHit::GetCycleTimeStamp(), and TDetectorHit::GetPPGStatus().
ULong64_t TPPG::GetStatusStart | ( | EPpgPattern | pat | ) |
return the time in the cycle when pat starts
Definition at line 669 of file TPPG.cxx.
References GetLastStatusTime(), GetTimeInCycle(), and Last().
ULong64_t TPPG::GetTimeInCycle | ( | ULong64_t | real_time | ) |
Returns the time in the cycle based on "real_time", i.e. the modulus of the time and the cycle length. "real_time" is in ns since that's how we store the PPG timestamps as well.
Definition at line 613 of file TPPG.cxx.
References GetCycleLength().
Referenced by TScaler::Draw(), TScaler::Draw(), GetStatusStart(), and TFragment::GetTimeInCycle().
const TPPGData * TPPG::Last | ( | ) |
Definition at line 588 of file TPPG.cxx.
References fCurrIterator, and MapEnd().
Referenced by GetNumberOfCycles(), and GetStatusStart().
|
inlineprivate |
Definition at line 209 of file TPPG.h.
References fPPGStatusMap.
Referenced by Add(), CalculateCycleFromData(), Correct(), First(), GetCycleLength(), Previous(), and Print().
|
inlineprivate |
Definition at line 210 of file TPPG.h.
References fPPGStatusMap.
Referenced by Add(), CalculateCycleFromData(), Correct(), GetCycleLength(), Last(), Next(), and Print().
Bool_t TPPG::MapIsEmpty | ( | ) | const |
Checks to see if the ppg map is empty. We need this because we need to put a default PPG in at time T=0 to prevent bad things from happening. This function says the map is empty when only the default is there, which it essentially is.
Definition at line 113 of file TPPG.cxx.
References fPPGStatusMap.
Referenced by GetLastStatusTime(), GetNextStatus(), GetNextStatusTime(), GetStatus(), and Print().
const TPPGData * TPPG::Next | ( | ) |
Definition at line 570 of file TPPG.cxx.
References fCurrIterator, and MapEnd().
|
inline |
Definition at line 171 of file TPPG.h.
References fOdbDurations.
Referenced by ExampleEventHelper::CreateHistograms(), and Print().
|
inline |
Definition at line 170 of file TPPG.h.
References fOdbDurations.
bool TPPG::OdbMatchesData | ( | bool | verbose = false | ) |
Definition at line 339 of file TPPG.cxx.
References CalculateCycleFromData(), fDurations, fOdbDurations, fOdbPPGCodes, fPPGCodes, and hex().
|
inline |
Definition at line 169 of file TPPG.h.
References fOdbPPGCodes.
|
inline |
void TPPG::operator+= | ( | const TPPG & | rhs | ) |
Definition at line 79 of file TPPG.cxx.
References Copy(), and fPPGStatusMap.
|
inline |
const TPPGData * TPPG::Previous | ( | ) |
Definition at line 579 of file TPPG.cxx.
References fCurrIterator, and MapBegin().
|
override |
Definition at line 214 of file TPPG.cxx.
References fOdbDurations, fOdbPPGCodes, fPPGStatusMap, GetLastStatusTime(), hex(), kBackground, kBeamOn, kDecay, kTapeMove, MapBegin(), MapEnd(), MapIsEmpty(), and OdbCycleLength().
|
inlinestaticinherited |
Definition at line 171 of file TSingleton.h.
|
inlinestaticinherited |
Definition at line 133 of file TSingleton.h.
|
inline |
Definition at line 182 of file TPPG.h.
References fCycleLength.
|
inline |
Definition at line 197 of file TPPG.h.
References fOdbDurations, and fOdbPPGCodes.
Referenced by TMidasFile::SetGRIFFOdb().
void TPPG::SetOdbFromData | ( | bool | verbose = false | ) |
Definition at line 364 of file TPPG.cxx.
References CalculateCycleFromData(), fDurations, fOdbDurations, fOdbPPGCodes, fPPGCodes, RED, and RESET_COLOR.
void TPPG::Setup | ( | ) |
Definition at line 460 of file TPPG.cxx.
References Copy(), TRunInfo::RunNumber(), and TRunInfo::SubRunNumber().
|
override |
Definition at line 449 of file TPPG.cxx.
References OdbPPGSize(), and PPGSize().
|
inlineoverride |
Definition at line 149 of file TPPG.h.
References Write().
Referenced by TGRSIFrame::Run(), TGRSISelector::Terminate(), TFragWriteLoop::Write(), and Write().
|
friend |
|
private |
|
private |
Definition at line 214 of file TPPG.h.
Referenced by Add(), AddData(), Clear(), Copy(), Correct(), GetCycleLength(), and SetCycleLength().
|
private |
! flag to indicate whether the codes and durations have been calculated from the data
Definition at line 220 of file TPPG.h.
Referenced by AddData(), CalculateCycleFromData(), and Clear().
|
staticprivateinherited |
Definition at line 187 of file TSingleton.h.
|
private |
! duration of ppg state calculated from data
Definition at line 222 of file TPPG.h.
Referenced by CalculateCycleFromData(), OdbMatchesData(), and SetOdbFromData().
|
private |
|
private |
duration of ppg state as read from odb
Definition at line 218 of file TPPG.h.
Referenced by Add(), Clear(), Copy(), OdbCycleLength(), OdbDuration(), OdbMatchesData(), Print(), SetOdbCycle(), and SetOdbFromData().
|
private |
ppg state codes read from odb
Definition at line 217 of file TPPG.h.
Referenced by Add(), Clear(), Copy(), OdbMatchesData(), OdbPPGCode(), OdbPPGSize(), Print(), SetOdbCycle(), and SetOdbFromData().
|
private |
! ppg state codes (these are always set)
Definition at line 221 of file TPPG.h.
Referenced by CalculateCycleFromData(), OdbMatchesData(), and SetOdbFromData().
|
private |
Definition at line 213 of file TPPG.h.
Referenced by ~TPPG(), AddData(), Clear(), Copy(), Correct(), GetLastStatusTime(), GetNextStatus(), GetNextStatusTime(), GetStatus(), MapBegin(), MapEnd(), MapIsEmpty(), operator=(), PPGSize(), and Print().
|
staticprivateinherited |
Definition at line 186 of file TSingleton.h.