GRUTinizer
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
TWriteLoop.h
Go to the documentation of this file.
1
#ifndef _TWRITELOOP_H_
2
#define _TWRITELOOP_H_
3
4
#include <atomic>
5
#include <map>
6
#include <vector>
7
8
#include "TClass.h"
9
#include "TDirectory.h"
10
#include "TTree.h"
11
12
#include "
StoppableThread.h
"
13
#include "
ThreadsafeQueue.h
"
14
#include "
TUnpackedEvent.h
"
15
16
class
TWriteLoop
:
public
StoppableThread
{
17
public
:
18
TWriteLoop
(
ThreadsafeQueue<TUnpackedEvent*>
&
input_queue
, TDirectory& dir);
19
virtual
~TWriteLoop
();
20
21
void
SetLearningPhaseLength
(
int
length) {
learning_phase_length
= length; }
22
int
GetLearningPhaseLength
(
int
length)
const
{
return
learning_phase_length
; }
23
24
void
Write
();
25
26
bool
InLearningPhase
() {
return
in_learning_phase
; }
27
28
protected
:
29
bool
Iteration
();
30
31
private
:
32
void
HandleEvent
(
TUnpackedEvent
* event);
33
void
LearningPhase
(
TUnpackedEvent
* event);
34
void
EndLearningPhase
();
35
void
WriteEvent
(
TUnpackedEvent
* event);
36
37
ThreadsafeQueue<TUnpackedEvent*>
&
input_queue
;
38
TTree*
event_tree
;
39
//TTree* scaler_tree;
40
41
std::map<TClass*, TDetector**>
det_map
;
42
std::vector<TUnpackedEvent*>
learning_queue
;
43
std::atomic_bool
in_learning_phase
;
44
int
learning_phase_length
;
45
46
TDirectory&
output_dir
;
47
};
48
49
50
#endif
/* _TWRITELOOP_H_ */
Generated on Wed Nov 4 2015 17:27:54 for GRUTinizer by
1.8.1.2