QwAnalysis
QwCombinedBCM.h
Go to the documentation of this file.
1 /**********************************************************\
2 <<<<<<< .working
3 * File: QwCombinedBCM.h *
4 =======
5 * File: QwBCM.h *
6 >>>>>>> .merge-right.r3406
7 * *
8 * Author: *
9 * Time-stamp: *
10 \**********************************************************/
11 
12 #ifndef __Qw_COMBINEDBCM__
13 #define __Qw_COMBINEDBCM__
14 
15 // System headers
16 #include <vector>
17 
18 // ROOT headers
19 #include <TTree.h>
20 
21 // Qweak headers
22 #include "VQwDataElement.h"
23 #include "VQwHardwareChannel.h"
24 #include "QwBCM.h"
25 
26 // Forward declarations
27 class QwDBInterface;
28 
29 /*****************************************************************
30 * Class:
31 ******************************************************************/
32 
33 template<typename T>
34 class QwCombinedBCM : public QwBCM<T> {
35 /////
36  public:
38  QwCombinedBCM(TString name){
39  InitializeChannel(name, "derived");
40  };
41  QwCombinedBCM(TString subsystem, TString name){
42  InitializeChannel(subsystem, name, "derived");
43  };
44  QwCombinedBCM(TString subsystemname, TString name, TString type){
45  this->SetSubsystemName(subsystemname);
46  InitializeChannel(subsystemname, name,type,"raw");
47  };
49  : QwBCM<T>(source)
50  { }
51  virtual ~QwCombinedBCM() { };
52 
53  // This is to setup one of the used BCM's in this combo
54  void SetBCMForCombo(VQwBCM* bcm, Double_t weight, Double_t sumqw );
55 
56  // No processing of event buffer
57  Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t word_position_in_buffer, UInt_t subelement = 0) { return 0; };
58 
59  void InitializeChannel(TString name, TString datatosave);
60  // new routine added to update necessary information for tree trimming
61  void InitializeChannel(TString subsystem, TString name, TString datatosave);
62  void InitializeChannel(TString subsystem, TString name, TString type,
63  TString datatosave);
64 
65  void ProcessEvent();
66 
67  Bool_t ApplyHWChecks(){
68  return kTRUE;
69  };
70 
71  Bool_t ApplySingleEventCuts();//Check for good events by stting limits on the devices readings
72 
73  UInt_t UpdateErrorFlag();
74 
75 
76  // Implementation of Parent class's virtual operators
77  VQwBCM& operator= (const VQwBCM &value);
78  QwCombinedBCM& operator= (const QwCombinedBCM &value);
79 
80  /*
81  void AccumulateRunningSum(const VQwBCM &value);
82  void DeaccumulateRunningSum(VQwBCM &value);
83  void CalculateRunningAverage();
84  */
85  void SetPedestal(Double_t ped) {
87  }
88  void SetCalibrationFactor(Double_t calib) {
90  }
91 
93  return &(this->fBeamCurrent);
94  };
95 
96  const VQwHardwareChannel* GetCharge() const {
97  return const_cast<QwCombinedBCM*>(this)->GetCharge();
98  };
99 
100 /////
101  private:
102 
103  std::vector <QwBCM<T>*> fElement;
104  std::vector <Double_t> fWeights;
105  Double_t fSumQweights;
106 
107 };
108 
109 #endif
virtual ~QwCombinedBCM()
Definition: QwCombinedBCM.h:51
void SetCalibrationFactor(Double_t calib)
Definition: QwCombinedBCM.h:88
Definition: VQwBCM.h:32
VQwHardwareChannel * GetCharge()
Definition: QwCombinedBCM.h:92
VQwBCM & operator=(const VQwBCM &value)
void SetPedestal(Double_t ped)
Definition: QwCombinedBCM.h:85
void SetPedestal(Double_t ped)
Definition: QwBCM.cc:22
void SetBCMForCombo(VQwBCM *bcm, Double_t weight, Double_t sumqw)
std::vector< Double_t > fWeights
QwCombinedBCM(TString subsystemname, TString name, TString type)
Definition: QwCombinedBCM.h:44
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
Definition of the pure virtual base class of all data elements.
Bool_t ApplyHWChecks()
Definition: QwCombinedBCM.h:67
const VQwHardwareChannel * GetCharge() const
Definition: QwCombinedBCM.h:96
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
QwCombinedBCM(const QwCombinedBCM &source)
Definition: QwCombinedBCM.h:48
static const double T
Magnetic field: base unit is T.
Definition: QwUnits.h:111
QwCombinedBCM(TString name)
Definition: QwCombinedBCM.h:38
QwCombinedBCM(TString subsystem, TString name)
Definition: QwCombinedBCM.h:41
Double_t fSumQweights
Definition: QwBCM.h:34
void ProcessEvent()
Bool_t ApplySingleEventCuts()
void InitializeChannel(TString name, TString datatosave)
void SetCalibrationFactor(Double_t calib)
Definition: QwBCM.cc:28
std::vector< QwBCM< T > * > fElement
Definition: QwCombinedBCM.h:98
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0)
Process the CODA event buffer for this element.
Definition: QwCombinedBCM.h:57
T fBeamCurrent
Definition: QwBCM.h:168