GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TUnpackingLoop Class Reference

This loop parses raw events into fragments.

Definition at line 27 of file TUnpackingLoop.h.

Public Types

enum  EDataType { EDataType::kMidas, EDataType::kLst, EDataType::kTdr }
 

Public Member Functions

 ~TUnpackingLoop () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > & AddGoodOutputQueue (size_t maxSize=50000)
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TBadFragment > > > & BadOutputQueue ()
 
void ClearQueue () override
 
std::string EndStatus () override
 
size_t GetItemsCurrent () override
 
size_t GetItemsPopped () override
 
size_t GetItemsPushed () override
 
size_t GetRate () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TRawEvent > > > & InputQueue ()
 
bool IsPaused ()
 
bool IsRunning ()
 
bool Iteration () override
 
void Join ()
 
std::string Name () const
 
virtual void OnEnd ()
 
void Pause ()
 
virtual std::string Progress ()
 
void Resume ()
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TEpicsFrag > > > & ScalerOutputQueue ()
 
void SetNoWaveForms (bool temp=true)
 
void SetRecordDiag (bool temp=true)
 
virtual std::string Status ()
 
void Stop ()
 

Static Public Member Functions

static std::string AllThreadHeader ()
 
static std::string AllThreadProgress ()
 
static std::string AllThreadStatus ()
 
static bool AnyThreadRunning ()
 
static std::string AnyThreadStatus ()
 
static void ClearAllQueues ()
 
static void ColumnWidth (size_t val)
 
static size_t ColumnWidth ()
 
static TUnpackingLoopGet (std::string name="")
 
static StoppableThreadGet (const std::string &name)
 
static std::vector< StoppableThread * > GetAll ()
 
static int GetNThreads ()
 
static void join_status_thread ()
 
static void PauseAll ()
 
static void Print ()
 
static void ResumeAll ()
 
static void SendStop ()
 
static void start_status_thread ()
 
static void status_out ()
 
static void status_out_loop ()
 
static void StatusWidth (size_t val)
 
static size_t StatusWidth ()
 
static void stop_status_thread ()
 
static void StopAll ()
 

Static Public Attributes

static std::thread fStatusThread
 
static bool fStatusThreadOn = false
 

Protected Attributes

std::atomic_long fInputSize {0}
 
std::atomic_size_t fItemsPopped {0}
 
std::string fName
 

Static Protected Attributes

static std::map< std::string, StoppableThread * > fThreadMap
 

Private Member Functions

 TUnpackingLoop (std::string name)
 
 TUnpackingLoop (const TUnpackingLoop &other)
 
TUnpackingLoopoperator= (const TUnpackingLoop &other)
 

Private Attributes

EDataType fDataType
 
bool fEvaluateDataType
 
long fFragsReadFromRaw
 
long fGoodFragsRead
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TRawEvent > > > fInputQueue
 
TDataParserfParser
 

#include <TUnpackingLoop.h>

+ Inheritance diagram for TUnpackingLoop:
+ Collaboration diagram for TUnpackingLoop:

Member Enumeration Documentation

◆ EDataType

Enumerator
kMidas 
kLst 
kTdr 

Definition at line 29 of file TUnpackingLoop.h.

Constructor & Destructor Documentation

◆ ~TUnpackingLoop()

TUnpackingLoop::~TUnpackingLoop ( )
override

Definition at line 37 of file TUnpackingLoop.cxx.

◆ TUnpackingLoop() [1/2]

TUnpackingLoop::TUnpackingLoop ( std::string  name)
private

◆ TUnpackingLoop() [2/2]

TUnpackingLoop::TUnpackingLoop ( const TUnpackingLoop other)
private

Member Function Documentation

◆ AddGoodOutputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > >& TUnpackingLoop::AddGoodOutputQueue ( size_t  maxSize = 50000)
inline

Definition at line 39 of file TUnpackingLoop.h.

References TDataParser::AddGoodOutputQueue(), and fParser.

Referenced by TGRSIint::SetupPipeline().

◆ AllThreadHeader()

std::string StoppableThread::AllThreadHeader ( )
staticinherited

◆ AllThreadProgress()

std::string StoppableThread::AllThreadProgress ( )
staticinherited

◆ AllThreadStatus()

std::string StoppableThread::AllThreadStatus ( )
staticinherited

◆ AnyThreadRunning()

bool StoppableThread::AnyThreadRunning ( )
staticinherited

◆ AnyThreadStatus()

std::string StoppableThread::AnyThreadStatus ( )
staticinherited

Definition at line 47 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ BadOutputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TBadFragment> > >& TUnpackingLoop::BadOutputQueue ( )
inline

Definition at line 43 of file TUnpackingLoop.h.

References TDataParser::BadOutputQueue(), and fParser.

Referenced by Iteration(), and TGRSIint::SetupPipeline().

◆ ClearAllQueues()

void StoppableThread::ClearAllQueues ( )
staticinherited

Definition at line 166 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by TGRSIInterruptHandler::Notify().

◆ ClearQueue()

void TUnpackingLoop::ClearQueue ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 41 of file TUnpackingLoop.cxx.

References TDataParser::ClearQueue(), fInputQueue, and fParser.

◆ ColumnWidth() [1/2]

static void StoppableThread::ColumnWidth ( size_t  val)
inlinestaticinherited

Definition at line 75 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

◆ ColumnWidth() [2/2]

static size_t StoppableThread::ColumnWidth ( )
inlinestaticinherited

Definition at line 77 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

Referenced by TGRSIint::SetupPipeline().

◆ EndStatus()

std::string TUnpackingLoop::EndStatus ( )
overridevirtual

◆ Get() [1/2]

TUnpackingLoop * TUnpackingLoop::Get ( std::string  name = "")
static

Definition at line 11 of file TUnpackingLoop.cxx.

References StoppableThread::Get(), and TUnpackingLoop().

Referenced by TGRSIint::SetupPipeline().

◆ Get() [2/2]

◆ GetAll()

std::vector< StoppableThread * > StoppableThread::GetAll ( )
staticinherited

Definition at line 315 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ GetItemsCurrent()

size_t TUnpackingLoop::GetItemsCurrent ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 59 of file TUnpackingLoop.h.

◆ GetItemsPopped()

size_t TUnpackingLoop::GetItemsPopped ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 58 of file TUnpackingLoop.h.

◆ GetItemsPushed()

size_t TUnpackingLoop::GetItemsPushed ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 57 of file TUnpackingLoop.h.

References fParser, and TDataParser::ItemsPushed().

◆ GetNThreads()

int StoppableThread::GetNThreads ( )
staticinherited

Definition at line 21 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by StoppableThread::Print().

◆ GetRate()

size_t TUnpackingLoop::GetRate ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 60 of file TUnpackingLoop.h.

◆ InputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TRawEvent> > >& TUnpackingLoop::InputQueue ( )
inline

Definition at line 38 of file TUnpackingLoop.h.

References fInputQueue.

Referenced by TGRSIint::SetupPipeline().

◆ IsPaused()

bool StoppableThread::IsPaused ( )
inherited

Definition at line 224 of file StoppableThread.cxx.

References StoppableThread::fPaused.

◆ IsRunning()

bool StoppableThread::IsRunning ( )
inherited

Definition at line 219 of file StoppableThread.cxx.

References StoppableThread::fRunning.

Referenced by StoppableThread::status_out().

◆ Iteration()

◆ Join()

void StoppableThread::Join ( )
inherited

◆ join_status_thread()

void StoppableThread::join_status_thread ( )
staticinherited

◆ Name()

std::string StoppableThread::Name ( ) const
inlineinherited

◆ OnEnd()

virtual void StoppableThread::OnEnd ( )
inlinevirtualinherited

Reimplemented in TAnalysisWriteLoopClient, TFragmentChainLoop, TAnalysisWriteLoop, and TDataLoop.

Definition at line 54 of file StoppableThread.h.

Referenced by StoppableThread::Loop().

◆ operator=()

TUnpackingLoop& TUnpackingLoop::operator= ( const TUnpackingLoop other)
private

◆ Pause()

void StoppableThread::Pause ( )
inherited

Definition at line 202 of file StoppableThread.cxx.

References StoppableThread::fPaused, and StoppableThread::fRunning.

◆ PauseAll()

void StoppableThread::PauseAll ( )
staticinherited

Definition at line 97 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ Print()

void StoppableThread::Print ( )
staticinherited

◆ Progress()

std::string StoppableThread::Progress ( )
virtualinherited

◆ Resume()

void StoppableThread::Resume ( )
inherited

◆ ResumeAll()

void StoppableThread::ResumeAll ( )
staticinherited

Definition at line 104 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by TGRSIint::SetupPipeline().

◆ ScalerOutputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TEpicsFrag> > >& TUnpackingLoop::ScalerOutputQueue ( )
inline

Definition at line 47 of file TUnpackingLoop.h.

References fParser, and TDataParser::ScalerOutputQueue().

Referenced by Iteration(), and TGRSIint::SetupPipeline().

◆ SendStop()

void StoppableThread::SendStop ( )
staticinherited

◆ SetNoWaveForms()

void TUnpackingLoop::SetNoWaveForms ( bool  temp = true)
inline

Definition at line 34 of file TUnpackingLoop.h.

References fParser, and TDataParser::SetNoWaveForms().

◆ SetRecordDiag()

void TUnpackingLoop::SetRecordDiag ( bool  temp = true)
inline

Definition at line 35 of file TUnpackingLoop.h.

References fParser, and TDataParser::SetRecordDiag().

◆ start_status_thread()

void StoppableThread::start_status_thread ( )
staticinherited

◆ Status()

std::string StoppableThread::Status ( )
virtualinherited

◆ status_out()

◆ status_out_loop()

void StoppableThread::status_out_loop ( )
staticinherited

◆ StatusWidth() [1/2]

static void StoppableThread::StatusWidth ( size_t  val)
inlinestaticinherited

Definition at line 76 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

◆ StatusWidth() [2/2]

static size_t StoppableThread::StatusWidth ( )
inlinestaticinherited

Definition at line 78 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

Referenced by TGRSIint::SetupPipeline().

◆ Stop()

◆ stop_status_thread()

void StoppableThread::stop_status_thread ( )
staticinherited

◆ StopAll()

void StoppableThread::StopAll ( )
staticinherited

Member Data Documentation

◆ fDataType

EDataType TUnpackingLoop::fDataType
private

Definition at line 74 of file TUnpackingLoop.h.

◆ fEvaluateDataType

bool TUnpackingLoop::fEvaluateDataType
private

Definition at line 73 of file TUnpackingLoop.h.

◆ fFragsReadFromRaw

long TUnpackingLoop::fFragsReadFromRaw
private

Definition at line 70 of file TUnpackingLoop.h.

Referenced by EndStatus(), and Iteration().

◆ fGoodFragsRead

long TUnpackingLoop::fGoodFragsRead
private

Definition at line 71 of file TUnpackingLoop.h.

Referenced by EndStatus(), and Iteration().

◆ fInputQueue

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TRawEvent> > > TUnpackingLoop::fInputQueue
private

Definition at line 66 of file TUnpackingLoop.h.

Referenced by ClearQueue(), InputQueue(), and Iteration().

◆ fInputSize

◆ fItemsPopped

◆ fName

std::string StoppableThread::fName
protectedinherited

◆ fParser

◆ fStatusThread

std::thread StoppableThread::fStatusThread
staticinherited

◆ fStatusThreadOn

◆ fThreadMap