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

This loop reads fragments from a root-file with a FragmentTree.

Definition at line 31 of file TFragmentChainLoop.h.

Public Member Functions

 ~TFragmentChainLoop () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > & AddOutputQueue ()
 
void ClearQueue () override
 
virtual std::string EndStatus ()
 
size_t GetItemsCurrent () override
 
size_t GetItemsPopped () override
 
size_t GetItemsPushed () override
 
size_t GetRate () override
 
bool GetSelfStopping () const
 
bool IsPaused ()
 
bool IsRunning ()
 
void Join ()
 
std::string Name () const
 
void OnEnd () override
 
void Pause ()
 
virtual std::string Progress ()
 
void Restart ()
 
void Resume ()
 
void SetSelfStopping (bool self_stopping)
 
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 TFragmentChainLoopGet (std::string name="", TChain *chain=nullptr)
 
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 Member Functions

bool Iteration () override
 

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

 TFragmentChainLoop (std::string name, TChain *chain)
 
int SetupChain ()
 

Private Attributes

std::map< TClass *, TDetector ** > fDetMap
 
long fEntriesTotal
 
TFragmentfFragment
 
TChain * fInputChain
 
std::vector< std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > > fOutputQueues
 
bool fSelfStopping
 

#include <TFragmentChainLoop.h>

+ Inheritance diagram for TFragmentChainLoop:
+ Collaboration diagram for TFragmentChainLoop:

Constructor & Destructor Documentation

◆ ~TFragmentChainLoop()

TFragmentChainLoop::~TFragmentChainLoop ( )
overridedefault

◆ TFragmentChainLoop()

TFragmentChainLoop::TFragmentChainLoop ( std::string  name,
TChain *  chain 
)
private

Definition at line 33 of file TFragmentChainLoop.cxx.

References SetupChain().

Referenced by Get().

Member Function Documentation

◆ AddOutputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > >& TFragmentChainLoop::AddOutputQueue ( )
inline

Definition at line 37 of file TFragmentChainLoop.h.

References fOutputQueues.

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.

◆ ClearAllQueues()

void StoppableThread::ClearAllQueues ( )
staticinherited

Definition at line 166 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by TGRSIInterruptHandler::Notify().

◆ ClearQueue()

void TFragmentChainLoop::ClearQueue ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 42 of file TFragmentChainLoop.cxx.

References fOutputQueues.

◆ 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()

virtual std::string StoppableThread::EndStatus ( )
inlinevirtualinherited

◆ Get() [1/2]

TFragmentChainLoop * TFragmentChainLoop::Get ( std::string  name = "",
TChain *  chain = nullptr 
)
static

Definition at line 14 of file TFragmentChainLoop.cxx.

References StoppableThread::Get(), gFragment, and TFragmentChainLoop().

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 TFragmentChainLoop::GetItemsCurrent ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 46 of file TFragmentChainLoop.h.

References fEntriesTotal.

◆ GetItemsPopped()

size_t TFragmentChainLoop::GetItemsPopped ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 45 of file TFragmentChainLoop.h.

References StoppableThread::fItemsPopped.

◆ GetItemsPushed()

size_t TFragmentChainLoop::GetItemsPushed ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 44 of file TFragmentChainLoop.h.

References StoppableThread::fItemsPopped.

◆ GetNThreads()

int StoppableThread::GetNThreads ( )
staticinherited

Definition at line 21 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by StoppableThread::Print().

◆ GetRate()

size_t TFragmentChainLoop::GetRate ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 47 of file TFragmentChainLoop.h.

◆ GetSelfStopping()

bool TFragmentChainLoop::GetSelfStopping ( ) const
inline

Definition at line 54 of file TFragmentChainLoop.h.

References fSelfStopping.

◆ 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()

bool TFragmentChainLoop::Iteration ( )
overrideprotectedvirtual

◆ Join()

void StoppableThread::Join ( )
inherited

◆ join_status_thread()

void StoppableThread::join_status_thread ( )
staticinherited

◆ Name()

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

◆ OnEnd()

void TFragmentChainLoop::OnEnd ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 67 of file TFragmentChainLoop.cxx.

References fOutputQueues.

◆ 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

◆ Restart()

void TFragmentChainLoop::Restart ( )

Definition at line 62 of file TFragmentChainLoop.cxx.

References StoppableThread::fItemsPopped.

◆ 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().

◆ SendStop()

void StoppableThread::SendStop ( )
staticinherited

◆ SetSelfStopping()

void TFragmentChainLoop::SetSelfStopping ( bool  self_stopping)
inline

Definition at line 53 of file TFragmentChainLoop.h.

References fSelfStopping.

Referenced by TGRSIint::SetupPipeline().

◆ SetupChain()

int TFragmentChainLoop::SetupChain ( )
private

Definition at line 52 of file TFragmentChainLoop.cxx.

References fFragment, and fInputChain.

Referenced by TFragmentChainLoop().

◆ 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

◆ fDetMap

std::map<TClass*, TDetector**> TFragmentChainLoop::fDetMap
private

Definition at line 74 of file TFragmentChainLoop.h.

◆ fEntriesTotal

long TFragmentChainLoop::fEntriesTotal
private

Definition at line 63 of file TFragmentChainLoop.h.

Referenced by GetItemsCurrent(), and Iteration().

◆ fFragment

TFragment* TFragmentChainLoop::fFragment
private

Definition at line 67 of file TFragmentChainLoop.h.

Referenced by Iteration(), and SetupChain().

◆ fInputChain

TChain* TFragmentChainLoop::fInputChain
private

Definition at line 65 of file TFragmentChainLoop.h.

Referenced by Iteration(), and SetupChain().

◆ fInputSize

◆ fItemsPopped

◆ fName

std::string StoppableThread::fName
protectedinherited

◆ fOutputQueues

std::vector<std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > > > TFragmentChainLoop::fOutputQueues
private

Definition at line 68 of file TFragmentChainLoop.h.

Referenced by AddOutputQueue(), ClearQueue(), Iteration(), and OnEnd().

◆ fSelfStopping

bool TFragmentChainLoop::fSelfStopping
private

Definition at line 71 of file TFragmentChainLoop.h.

Referenced by GetSelfStopping(), Iteration(), and SetSelfStopping().

◆ fStatusThread

std::thread StoppableThread::fStatusThread
staticinherited

◆ fStatusThreadOn

◆ fThreadMap