GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TAnalysisHistLoop.h
Go to the documentation of this file.
1#ifndef TANALYSISHISTOGRAMLOOP_H
2#define TANALYSISHISTOGRAMLOOP_H
3
4/** \addtogroup Loops
5 * @{
6 */
7
8////////////////////////////////////////////////////////////////////////////////
9///
10/// \class TAnalysisHistLoop
11///
12/// This loop takes built events and fills histograms using
13/// 'histos/MakeAnalysisHistograms.cxx'
14///
15////////////////////////////////////////////////////////////////////////////////
16
17#include <string>
18
19#include "StoppableThread.h"
20#include "TCompiledHistograms.h"
21#include "ThreadsafeQueue.h"
22#include "TUnpackedEvent.h"
23
24class TFile;
25
27public:
28 static TAnalysisHistLoop* Get(std::string name = "");
29
32 TAnalysisHistLoop& operator=(const TAnalysisHistLoop&) = delete;
33 TAnalysisHistLoop& operator=(TAnalysisHistLoop&&) noexcept = delete;
35
36#ifndef __CINT__
37 std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TUnpackedEvent>>>& InputQueue()
38 {
39 return fInputQueue;
40 }
41#endif
42
43 void SetOutputFilename(const std::string& name);
44 std::string GetOutputFilename() const;
45
46 void LoadLibrary(const std::string& library);
47 std::string GetLibraryName() const;
48 void ClearHistograms();
49
50 void AddCutFile(TFile* cut_file);
51
52 void Write();
53
54 void ClearQueue() override;
55
56 TList* GetObjects();
57 TList* GetGates();
58
59 size_t GetItemsPopped() override { return 0; }
60 size_t GetItemsPushed() override { return 0; }
61 size_t GetItemsCurrent() override { return 0; }
62 size_t GetRate() override { return 0; }
63
64protected:
65 bool Iteration() override;
66
67private:
68 explicit TAnalysisHistLoop(std::string name);
69
71
72 void OpenFile();
73 void CloseFile();
74
76 std::string fOutputFilename;
77
78#ifndef __CINT__
79 std::shared_ptr<ThreadsafeQueue<std::shared_ptr<TUnpackedEvent>>> fInputQueue;
80#endif
81
82 /// \cond CLASSIMP
83 ClassDefOverride(TAnalysisHistLoop, 0) // NOLINT(readability-else-after-return)
84 /// \endcond
85};
86
87/*! @} */
88#endif /* _THISTOGRAMLOOP_H_ */
size_t GetItemsPushed() override
bool Iteration() override
TAnalysisHistLoop(const TAnalysisHistLoop &)=delete
TCompiledHistograms fCompiledHistograms
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TUnpackedEvent > > > fInputQueue
size_t GetItemsPopped() override
std::string GetOutputFilename() const
TAnalysisHistLoop(TAnalysisHistLoop &&) noexcept=delete
void SetOutputFilename(const std::string &name)
void ClearQueue() override
std::shared_ptr< ThreadsafeQueue< std::shared_ptr< TUnpackedEvent > > > & InputQueue()
void LoadLibrary(const std::string &library)
void AddCutFile(TFile *cut_file)
size_t GetItemsCurrent() override
std::string fOutputFilename
size_t GetRate() override
std::string GetLibraryName() const
static TAnalysisHistLoop * Get(std::string name="")