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

The client(s) for the TAnalysisWriteLoop. Each gets a subset of event to write to file.

Definition at line 36 of file TAnalysisWriteLoopClient.h.

Public Member Functions

 TAnalysisWriteLoopClient (std::string name, std::string outputFilename, Int_t localPort)
 
 ~TAnalysisWriteLoopClient () override
 
void ClearQueue () override
 
virtual std::string EndStatus ()
 
size_t GetInputSize ()
 
size_t GetItemsCurrent () override
 
size_t GetItemsPopped () override
 
size_t GetItemsPushed () override
 
size_t GetRate () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TUnpackedEvent > > > InputQueue ()
 
bool IsPaused ()
 
bool IsRunning ()
 
void Join ()
 
std::string Name () const
 
void OnEnd () override
 
void OutOfOrderFragment (std::shared_ptr< const TFragment > frag)
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > OutOfOrderQueue ()
 
void Pause ()
 
virtual std::string Progress ()
 
void Resume ()
 
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 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

void AddBranch (TClass *cls)
 
void WriteEvent (std::shared_ptr< TUnpackedEvent > &event)
 

Private Attributes

std::map< TClass *, TDetector * > fDefaultDets
 
std::map< TClass *, TDetector ** > fDetMap
 
TTree * fEventTree
 
bool fFirstClient
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TUnpackedEvent > > > fInputQueue
 
bool fOutOfOrder
 
TFragmentfOutOfOrderFrag
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > fOutOfOrderQueue
 
TTree * fOutOfOrderTree
 
TParallelMergingFile * fOutputFile
 

Static Private Attributes

static std::map< TClass *, TDetector ** > fGlobalDetMap
 

#include <TAnalysisWriteLoopClient.h>

+ Inheritance diagram for TAnalysisWriteLoopClient:
+ Collaboration diagram for TAnalysisWriteLoopClient:

Constructor & Destructor Documentation

◆ TAnalysisWriteLoopClient()

TAnalysisWriteLoopClient::TAnalysisWriteLoopClient ( std::string  name,
std::string  outputFilename,
Int_t  localPort 
)

◆ ~TAnalysisWriteLoopClient()

TAnalysisWriteLoopClient::~TAnalysisWriteLoopClient ( )
override

Definition at line 34 of file TAnalysisWriteLoopClient.cxx.

References fDetMap.

Member Function Documentation

◆ AddBranch()

void TAnalysisWriteLoopClient::AddBranch ( TClass *  cls)
private

◆ 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 TAnalysisWriteLoopClient::ClearQueue ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 41 of file TAnalysisWriteLoopClient.cxx.

References fInputQueue.

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

◆ GetAll()

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

Definition at line 315 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ GetInputSize()

size_t TAnalysisWriteLoopClient::GetInputSize ( )
inline

Definition at line 53 of file TAnalysisWriteLoopClient.h.

References StoppableThread::fInputSize.

◆ GetItemsCurrent()

size_t TAnalysisWriteLoopClient::GetItemsCurrent ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 51 of file TAnalysisWriteLoopClient.h.

◆ GetItemsPopped()

size_t TAnalysisWriteLoopClient::GetItemsPopped ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 50 of file TAnalysisWriteLoopClient.h.

◆ GetItemsPushed()

size_t TAnalysisWriteLoopClient::GetItemsPushed ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 49 of file TAnalysisWriteLoopClient.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 TAnalysisWriteLoopClient::GetRate ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 52 of file TAnalysisWriteLoopClient.h.

◆ InputQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TUnpackedEvent> > > TAnalysisWriteLoopClient::InputQueue ( )
inline

Definition at line 42 of file TAnalysisWriteLoopClient.h.

References fInputQueue.

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

void TAnalysisWriteLoopClient::OnEnd ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 81 of file TAnalysisWriteLoopClient.cxx.

References fOutputFile.

◆ OutOfOrderFragment()

void TAnalysisWriteLoopClient::OutOfOrderFragment ( std::shared_ptr< const TFragment frag)

◆ OutOfOrderQueue()

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > > TAnalysisWriteLoopClient::OutOfOrderQueue ( )
inline

Definition at line 43 of file TAnalysisWriteLoopClient.h.

References fOutOfOrderQueue.

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

◆ SendStop()

void StoppableThread::SendStop ( )
staticinherited

◆ 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

◆ WriteEvent()

void TAnalysisWriteLoopClient::WriteEvent ( std::shared_ptr< TUnpackedEvent > &  event)
private

Referenced by Iteration().

Member Data Documentation

◆ fDefaultDets

std::map<TClass*, TDetector*> TAnalysisWriteLoopClient::fDefaultDets
private

Definition at line 74 of file TAnalysisWriteLoopClient.h.

Referenced by AddBranch().

◆ fDetMap

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

Definition at line 73 of file TAnalysisWriteLoopClient.h.

Referenced by AddBranch(), and ~TAnalysisWriteLoopClient().

◆ fEventTree

TTree* TAnalysisWriteLoopClient::fEventTree
private

Definition at line 65 of file TAnalysisWriteLoopClient.h.

Referenced by AddBranch(), and TAnalysisWriteLoopClient().

◆ fFirstClient

bool TAnalysisWriteLoopClient::fFirstClient
private

Definition at line 69 of file TAnalysisWriteLoopClient.h.

Referenced by AddBranch(), and TAnalysisWriteLoopClient().

◆ fGlobalDetMap

std::map< TClass *, TDetector ** > TAnalysisWriteLoopClient::fGlobalDetMap
staticprivate

Definition at line 72 of file TAnalysisWriteLoopClient.h.

Referenced by AddBranch().

◆ fInputQueue

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TUnpackedEvent> > > TAnalysisWriteLoopClient::fInputQueue
private

Definition at line 75 of file TAnalysisWriteLoopClient.h.

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

◆ fInputSize

◆ fItemsPopped

◆ fName

std::string StoppableThread::fName
protectedinherited

◆ fOutOfOrder

bool TAnalysisWriteLoopClient::fOutOfOrder
private

Definition at line 68 of file TAnalysisWriteLoopClient.h.

Referenced by Iteration(), and TAnalysisWriteLoopClient().

◆ fOutOfOrderFrag

TFragment* TAnalysisWriteLoopClient::fOutOfOrderFrag
private

Definition at line 67 of file TAnalysisWriteLoopClient.h.

Referenced by Iteration(), and TAnalysisWriteLoopClient().

◆ fOutOfOrderQueue

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > > TAnalysisWriteLoopClient::fOutOfOrderQueue
private

Definition at line 76 of file TAnalysisWriteLoopClient.h.

Referenced by Iteration(), and OutOfOrderQueue().

◆ fOutOfOrderTree

TTree* TAnalysisWriteLoopClient::fOutOfOrderTree
private

Definition at line 66 of file TAnalysisWriteLoopClient.h.

Referenced by Iteration(), and TAnalysisWriteLoopClient().

◆ fOutputFile

TParallelMergingFile* TAnalysisWriteLoopClient::fOutputFile
private

Definition at line 64 of file TAnalysisWriteLoopClient.h.

Referenced by OnEnd(), and TAnalysisWriteLoopClient().

◆ fStatusThread

std::thread StoppableThread::fStatusThread
staticinherited

◆ fStatusThreadOn

◆ fThreadMap