GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TFragHistLoop Class Reference

Detailed Description

This loop takes fragments and fills histograms based on 'histos/MakeFragmentHistograms.cxx'

Definition at line 25 of file TFragHistLoop.h.

Public Member Functions

 TFragHistLoop (const TFragHistLoop &)=delete
 
 TFragHistLoop (TFragHistLoop &&) noexcept=delete
 
 ~TFragHistLoop ()
 
void AddCutFile (TFile *cut_file)
 
void ClearHistograms ()
 
void ClearQueue () override
 
virtual std::string EndStatus ()
 
TList * GetGates ()
 
size_t GetItemsCurrent () override
 
size_t GetItemsPopped () override
 
size_t GetItemsPushed () override
 
std::string GetLibraryName () const
 
TList * GetObjects ()
 
std::string GetOutputFilename () const
 
size_t GetRate () override
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > & InputQueue ()
 
bool IsPaused ()
 
bool IsRunning ()
 
void Join ()
 
void LoadLibrary (const std::string &library)
 
std::string Name () const
 
virtual void OnEnd ()
 
TFragHistLoopoperator= (const TFragHistLoop &)=delete
 
TFragHistLoopoperator= (TFragHistLoop &&) noexcept=delete
 
void Pause ()
 
virtual std::string Progress ()
 
void Resume ()
 
void SetOutputFilename (const std::string &name)
 
virtual std::string Status ()
 
void Stop ()
 
void Write ()
 

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 size_t ColumnWidth ()
 
static void ColumnWidth (size_t val)
 
static StoppableThreadGet (const std::string &name)
 
static TFragHistLoopGet (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 size_t StatusWidth ()
 
static void StatusWidth (size_t val)
 
static void stop_status_thread ()
 
static void StopAll ()
 

Protected Member Functions

void IncrementItemsPopped ()
 
std::atomic_long & InputSize ()
 
void InputSize (int64_t val)
 
std::atomic_size_t & ItemsPopped ()
 
void ItemsPopped (size_t val)
 
bool Iteration () override
 

Private Member Functions

 TFragHistLoop (std::string name)
 
void CloseFile ()
 
void Loop ()
 
void OpenFile ()
 

Private Attributes

TCompiledHistograms fCompiledHistograms
 
std::atomic_bool fForceStop {false}
 
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > fInputQueue
 
std::atomic_long fInputSize {0}
 
std::atomic_size_t fItemsPopped {0}
 
std::string fName
 
TFile * fOutputFile
 
std::string fOutputFilename
 
std::atomic_bool fPaused {false}
 
std::condition_variable fPausedWait
 
std::mutex fPauseMutex
 
std::atomic_bool fRunning {false}
 
std::thread fThread
 

Static Private Attributes

static size_t fColumnWidth = 20
 
static std::thread fStatusThread
 
static bool fStatusThreadOn = false
 
static size_t fStatusWidth = 80
 
static std::map< std::string, StoppableThread * > fThreadMap
 
+ Inheritance diagram for TFragHistLoop:
+ Collaboration diagram for TFragHistLoop:

Constructor & Destructor Documentation

◆ TFragHistLoop() [1/3]

TFragHistLoop::TFragHistLoop ( const TFragHistLoop & )
delete

Referenced by Get().

◆ TFragHistLoop() [2/3]

TFragHistLoop::TFragHistLoop ( TFragHistLoop && )
deletenoexcept

◆ ~TFragHistLoop()

TFragHistLoop::~TFragHistLoop ( )

Definition at line 32 of file TFragHistLoop.cxx.

References CloseFile().

◆ TFragHistLoop() [3/3]

TFragHistLoop::TFragHistLoop ( std::string name)
explicitprivate

Definition at line 25 of file TFragHistLoop.cxx.

References TGRSIOptions::Get(), and LoadLibrary().

Member Function Documentation

◆ AddCutFile()

void TFragHistLoop::AddCutFile ( TFile * cut_file)

Definition at line 141 of file TFragHistLoop.cxx.

References TCompiledHistograms::AddCutFile(), and fCompiledHistograms.

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

◆ ClearHistograms()

void TFragHistLoop::ClearHistograms ( )

◆ ClearQueue()

void TFragHistLoop::ClearQueue ( )
overridevirtual

Reimplemented from StoppableThread.

Definition at line 37 of file TFragHistLoop.cxx.

References fInputQueue.

◆ CloseFile()

void TFragHistLoop::CloseFile ( )
private

Definition at line 79 of file TFragHistLoop.cxx.

References fOutputFile, fOutputFilename, and Write().

Referenced by ~TFragHistLoop().

◆ ColumnWidth() [1/2]

static size_t StoppableThread::ColumnWidth ( )
inlinestaticinherited

Definition at line 82 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

Referenced by TGRSIint::SetupPipeline().

◆ ColumnWidth() [2/2]

static void StoppableThread::ColumnWidth ( size_t val)
inlinestaticinherited

Definition at line 80 of file StoppableThread.h.

References StoppableThread::fColumnWidth.

◆ EndStatus()

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

◆ Get() [1/2]

◆ Get() [2/2]

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

Definition at line 13 of file TFragHistLoop.cxx.

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

Referenced by TGRSIint::SetupPipeline().

◆ GetAll()

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

Definition at line 315 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

◆ GetGates()

TList * TFragHistLoop::GetGates ( )

Definition at line 126 of file TFragHistLoop.cxx.

References fCompiledHistograms, and TCompiledHistograms::GetGates().

◆ GetItemsCurrent()

size_t TFragHistLoop::GetItemsCurrent ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 60 of file TFragHistLoop.h.

◆ GetItemsPopped()

size_t TFragHistLoop::GetItemsPopped ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 58 of file TFragHistLoop.h.

◆ GetItemsPushed()

size_t TFragHistLoop::GetItemsPushed ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 59 of file TFragHistLoop.h.

◆ GetLibraryName()

std::string TFragHistLoop::GetLibraryName ( ) const

◆ GetNThreads()

int StoppableThread::GetNThreads ( )
staticinherited

Definition at line 21 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by StoppableThread::Print().

◆ GetObjects()

TList * TFragHistLoop::GetObjects ( )

Definition at line 121 of file TFragHistLoop.cxx.

References fCompiledHistograms, and TCompiledHistograms::GetObjects().

◆ GetOutputFilename()

std::string TFragHistLoop::GetOutputFilename ( ) const

Definition at line 136 of file TFragHistLoop.cxx.

References fOutputFilename.

Referenced by Write().

◆ GetRate()

size_t TFragHistLoop::GetRate ( )
inlineoverridevirtual

Implements StoppableThread.

Definition at line 61 of file TFragHistLoop.h.

◆ IncrementItemsPopped()

◆ InputQueue()

std::shared_ptr< ThreadsafeQueue< std::shared_ptr< const TFragment > > > & TFragHistLoop::InputQueue ( )
inline

Definition at line 36 of file TFragHistLoop.h.

References fInputQueue.

Referenced by TGRSIint::SetupPipeline().

◆ InputSize() [1/2]

◆ InputSize() [2/2]

void StoppableThread::InputSize ( int64_t val)
inlineprotectedinherited

Definition at line 94 of file StoppableThread.h.

References StoppableThread::fInputSize.

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

◆ ItemsPopped() [1/2]

◆ ItemsPopped() [2/2]

void StoppableThread::ItemsPopped ( size_t val)
inlineprotectedinherited

Definition at line 93 of file StoppableThread.h.

References StoppableThread::fItemsPopped.

◆ Iteration()

bool TFragHistLoop::Iteration ( )
overrideprotectedvirtual

◆ Join()

void StoppableThread::Join ( )
inherited

◆ join_status_thread()

void StoppableThread::join_status_thread ( )
staticinherited

◆ LoadLibrary()

void TFragHistLoop::LoadLibrary ( const std::string & library)

Definition at line 111 of file TFragHistLoop.cxx.

References fCompiledHistograms, and TCompiledHistograms::Load().

Referenced by TFragHistLoop().

◆ Loop()

◆ Name()

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

◆ OnEnd()

virtual void StoppableThread::OnEnd ( )
inlinevirtualinherited

Reimplemented in TAnalysisWriteLoop, TDataLoop, and TFragmentChainLoop.

Definition at line 59 of file StoppableThread.h.

Referenced by StoppableThread::Loop().

◆ OpenFile()

void TFragHistLoop::OpenFile ( )
private

◆ operator=() [1/2]

TFragHistLoop & TFragHistLoop::operator= ( const TFragHistLoop & )
delete

◆ operator=() [2/2]

TFragHistLoop & TFragHistLoop::operator= ( TFragHistLoop && )
deletenoexcept

◆ 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

Definition at line 135 of file StoppableThread.cxx.

References StoppableThread::fThreadMap.

Referenced by StoppableThread::StopAll(), and TGRSIint::Terminate().

◆ SetOutputFilename()

void TFragHistLoop::SetOutputFilename ( const std::string & name)

Definition at line 131 of file TFragHistLoop.cxx.

References fOutputFilename.

Referenced by TGRSIint::SetupPipeline().

◆ 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 size_t StoppableThread::StatusWidth ( )
inlinestaticinherited

Definition at line 83 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

Referenced by TGRSIint::SetupPipeline().

◆ StatusWidth() [2/2]

static void StoppableThread::StatusWidth ( size_t val)
inlinestaticinherited

Definition at line 81 of file StoppableThread.h.

References StoppableThread::fStatusWidth.

◆ Stop()

◆ stop_status_thread()

void StoppableThread::stop_status_thread ( )
staticinherited

◆ StopAll()

void StoppableThread::StopAll ( )
staticinherited

◆ Write()

Member Data Documentation

◆ fColumnWidth

◆ fCompiledHistograms

TCompiledHistograms TFragHistLoop::fCompiledHistograms
private

◆ fForceStop

std::atomic_bool StoppableThread::fForceStop {false}
privateinherited

Definition at line 120 of file StoppableThread.h.

◆ fInputQueue

std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment> > > TFragHistLoop::fInputQueue
private

Definition at line 78 of file TFragHistLoop.h.

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

◆ fInputSize

std::atomic_long StoppableThread::fInputSize {0}
privateinherited

number of items in the input (queue), only updated within Iteration(), so not always fully up-to-date (signed to hold error from queue::pop)

Definition at line 102 of file StoppableThread.h.

Referenced by StoppableThread::InputSize(), StoppableThread::InputSize(), StoppableThread::Progress(), and StoppableThread::Status().

◆ fItemsPopped

std::atomic_size_t StoppableThread::fItemsPopped {0}
privateinherited

◆ fName

std::string StoppableThread::fName
privateinherited

◆ fOutputFile

TFile* TFragHistLoop::fOutputFile
private

Definition at line 74 of file TFragHistLoop.h.

Referenced by CloseFile(), Iteration(), OpenFile(), and Write().

◆ fOutputFilename

std::string TFragHistLoop::fOutputFilename
private

Definition at line 75 of file TFragHistLoop.h.

Referenced by CloseFile(), GetOutputFilename(), OpenFile(), and SetOutputFilename().

◆ fPaused

std::atomic_bool StoppableThread::fPaused {false}
privateinherited

◆ fPausedWait

std::condition_variable StoppableThread::fPausedWait
privateinherited

◆ fPauseMutex

std::mutex StoppableThread::fPauseMutex
privateinherited

◆ fRunning

std::atomic_bool StoppableThread::fRunning {false}
privateinherited

◆ fStatusThread

std::thread StoppableThread::fStatusThread
staticprivateinherited

◆ fStatusThreadOn

◆ fStatusWidth

◆ fThread

std::thread StoppableThread::fThread
privateinherited

Definition at line 118 of file StoppableThread.h.

Referenced by StoppableThread::StoppableThread(), and StoppableThread::Join().

◆ fThreadMap