39 Bool_t ldebug = kFALSE;
43 fType.push_back(type);
47 std::cout<<
"QwEnergyCalculator:: Using "<<device->
GetElementName()<<
" with ratio "<< tmatrix_ratio <<
" for "<<
property<<std::endl;
54 if(prefix==
"diff_"||prefix==
"yield_"|| prefix==
"asym_")
69 Bool_t ldebug = kFALSE;
70 Double_t targetbeamangle = 0;
76 for(UInt_t i = 0; i<
fProperty.size(); i++){
77 if(
fProperty[i].Contains(
"targetbeamangle")){
80 if(ldebug) std::cout<<
"QwEnegyCalculator::ProcessEvent() :: Beam angle in X at target = "<<targetbeamangle<<std::endl;
82 if(ldebug) std::cout<<
"QwEnegyCalculator::ProcessEvent() :: dp/p += (M12/M16)*X angle = "<<
fEnergyChange.
GetValue()<<std::endl;
86 if(ldebug) std::cout<<
"QwEnegyCalculator::ProcessEvent() :: X position from "<<
fDevice[i]->GetElementName()<<
" = "<<tmp.
GetValue()<<std::endl;
88 if(ldebug) std::cout<<
"QwEnegyCalculator::ProcessEvent() :: (M11/M16)*X position = "<<tmp.
GetValue()<<std::endl;
92 if(ldebug) std::cout<<
"QwEnegyCalculator::ProcessEvent() :: dp/p = "<<
fEnergyChange.
GetValue()<<std::endl;
100 UInt_t error_code = 0;
101 for(UInt_t i = 0; i<
fProperty.size(); i++){
102 if(
fProperty[i].Contains(
"targetbeamangle")){
132 UInt_t error_code = 0;
133 for(UInt_t i = 0; i<
fProperty.size(); i++){
134 if(
fProperty[i].Contains(
"targetbeamangle")){
225 Bool_t eventokay=kTRUE;
248 TString thisprefix=prefix;
268 std::vector<Double_t> &values){
273 TString thisprefix=prefix;
291 TString thisprefix=prefix;
305 devicename.ToLower();
310 if (modulelist.
HasValue(devicename)){
311 TString thisprefix=prefix;
334 std::vector <QwDBInterface> row_list;
343 std::vector <QwErrDBInterface> row_list;
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
#define QwMessage
Predefined log drain for regular messages.
static const UInt_t kBCMErrorFlag
void AccumulateRunningSum(const QwEnergyCalculator &value)
void CalculateRunningAverage()
void AssignValueFrom(const VQwDataElement *valueptr)
void ConstructBranch(TTree *tree, TString &prefix)
void SetRootSaveStatus(TString &prefix)
void DeaccumulateRunningSum(const QwVQWK_Channel &value)
std::vector< TString > fType
void SetSingleEventCuts(Double_t min, Double_t max)
Set the upper and lower limits (fULimit and fLLimit) for this channel.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void InitializeChannel(TString name, TString datatosave)
void Ratio(QwEnergyCalculator &numer, QwEnergyCalculator &denom)
std::vector< const VQwBPM * > fDevice
void PrintInfo() const
Print multiple lines of information about this data element.
Double_t GetValue(size_t element) const
Bool_t ApplySingleEventCuts()
void Set(const VQwBPM *device, TString type, TString property, Double_t tmatrix_ratio)
void FillHistograms()
Fill the histograms for this data element.
void Scale(Double_t Offset)
void ConstructBranch(TTree *tree, TString &prefix)
std::vector< TString > fProperty
void IncrementErrorCounters()
std::vector< QwErrDBInterface > GetErrDBEntry()
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void DeaccumulateRunningSum(QwEnergyCalculator &value)
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
Bool_t HasValue(TString &vname)
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
std::vector< Double_t > fTMatrixRatio
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void PrintValue() const
Print single line of value and error of this data element.
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
virtual QwEnergyCalculator & operator+=(const QwEnergyCalculator &value)
void ClearEventData()
Clear the event data in this element.
void PrintInfo() const
Print multiple lines of information about this data element.
Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL)
void Scale(Double_t factor)
void FillTreeVector(std::vector< Double_t > &values) const
void SetElementName(const TString &name)
Set the name of this element.
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void FillHistograms()
Fill the histograms for this data element.
virtual QwEnergyCalculator & operator=(const QwEnergyCalculator &value)
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
static std::ostream & endl(std::ostream &)
End of the line.
virtual const TString & GetElementName() const
Get the name of this element.
void FillTreeVector(std::vector< Double_t > &values) const
void ClearEventData()
Clear the event data in this element.
void PrintValue() const
Print single line of value and error of this data element.
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
void AddChannelOffset(Double_t Offset)
void AddErrEntriesToList(std::vector< QwErrDBInterface > &row_list)
Int_t SetSingleEventCuts(Double_t mean, Double_t sigma)
void IncrementErrorCounters()
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber)
Process the CODA event buffer for this element.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
virtual QwEnergyCalculator & operator-=(const QwEnergyCalculator &value)
void CalculateRunningAverage()
std::vector< QwDBInterface > GetDBEntry()
QwVQWK_Channel fEnergyChange
void AccumulateRunningSum(const QwVQWK_Channel &value)