QwAnalysis
QwEventRing.h
Go to the documentation of this file.
1 /**********************************************************\
2 * File: QwEventRing.h *
3 * *
4 * Author: P. M. King, Rakitha Beminiwattha *
5 * Time-stamp: <2009-11-08 15:40> *
6 \**********************************************************/
7 
8 #ifndef __QwEventRing__
9 #define __QwEventRing__
10 
11 #include <vector>
12 
13 #include <fstream>
14 #include "QwSubsystemArrayParity.h"
15 
16 class QwEventRing {
17 
18 /******************************************************************
19  * Class: QwEventRing
20  * Description : The event buffer to reduce beam trips effects on running
21  * averages.
22  *
23  ******************************************************************/
24  private:
25  QwEventRing();
26 
27  public:
29  QwEventRing(QwSubsystemArrayParity &event, Int_t ring_size); //this will create a fixed size event ring
30  virtual ~QwEventRing() { };
31 
32  /// \brief Define options
33  static void DefineOptions(QwOptions &options);
34  /// \brief Process options
35  void ProcessOptions(QwOptions &options);
36 
37  /// \brief Add the subsystem to the ring
38  void push(QwSubsystemArrayParity &event);
39  /// \brief Return the last subsystem in the ring
41 
42  /// \brief Return the read status of the ring
43  Bool_t IsReady();
44 
45  private:
46 
47  Int_t fRING_SIZE;//this is the length of the ring
48 
49 
50  Int_t fNextToBeFilled;//counts events in the ring
51  Int_t fNextToBeRead;//keep track off when to read next from the ring.
52 
53 
54  Bool_t bEVENT_READY; //If kTRUE, the good events are added to the event ring. After a beam trip this is set to kFALSE
55  //after discarding LEAVE_COUNT no.of good event this is set to kTRUE
56 
57  Bool_t bRING_READY; //set to true after ring is filled with good events and time to process them. Set to kFALSE after processing
58  //all the events in the ring
59  std::vector<QwSubsystemArrayParity> fEvent_Ring;
60  //to track all the rolling averages for stability checks
62 
63  //for debugging purposes
64  FILE *out_file;
65  static const Bool_t bDEBUG=kFALSE;//kTRUE;
66  static const Bool_t bDEBUG_Write=kFALSE;
67 
68  //State of the stability check - ON/OFF
69  Bool_t bStability;
70 
71 };
72 
73 
74 
75 
76 #endif
QwSubsystemArrayParity & pop()
Return the last subsystem in the ring.
Definition: QwEventRing.cc:121
Int_t fRING_SIZE
Definition: QwEventRing.h:47
An options class.
Definition: QwOptions.h:133
static const Bool_t bDEBUG
Definition: QwEventRing.h:65
static void DefineOptions(QwOptions &options)
Define options.
Definition: QwEventRing.cc:41
static const Bool_t bDEBUG_Write
Definition: QwEventRing.h:66
Int_t fNextToBeFilled
Definition: QwEventRing.h:50
void push(QwSubsystemArrayParity &event)
Add the subsystem to the ring.
Definition: QwEventRing.cc:69
Virtual base class for the parity subsystems.
std::vector< QwSubsystemArrayParity > fEvent_Ring
Definition: QwEventRing.h:59
Int_t fNextToBeRead
Definition: QwEventRing.h:51
FILE * out_file
Definition: QwEventRing.h:64
Bool_t bStability
Definition: QwEventRing.h:69
virtual ~QwEventRing()
Definition: QwEventRing.h:30
Bool_t bRING_READY
Definition: QwEventRing.h:57
Bool_t bEVENT_READY
Definition: QwEventRing.h:54
QwSubsystemArrayParity fRollingAvg
Definition: QwEventRing.h:61
Bool_t IsReady()
Return the read status of the ring.
Definition: QwEventRing.cc:138
void ProcessOptions(QwOptions &options)
Process options.
Definition: QwEventRing.cc:53