QwAnalysis
QwCombinedPMT Class Reference

#include <QwCombinedPMT.h>

+ Inheritance diagram for QwCombinedPMT:
+ Collaboration diagram for QwCombinedPMT:

Public Member Functions

 QwCombinedPMT ()
 
 QwCombinedPMT (TString name)
 
 QwCombinedPMT (TString subsystemname, TString name)
 
 QwCombinedPMT (const QwCombinedPMT &source)
 
virtual ~QwCombinedPMT ()
 
void InitializeChannel (TString name, TString datatosave)
 
void InitializeChannel (TString subsystem, TString name, TString datatosave)
 
void LinkChannel (TString name)
 
const QwVQWK_ChannelGetChannel (const TString name) const
 
void Add (QwIntegrationPMT *pmt, Double_t weight)
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0)
 Process the CODA event buffer for this element. More...
 
void ClearEventData ()
 Clear the event data in this element. More...
 
void PrintErrorCounters ()
 
void CalculateSumAndAverage ()
 
void SetRandomEventParameters (Double_t mean, Double_t sigma)
 
void SetRandomEventAsymmetry (Double_t asymmetry)
 
void RandomizeEventData (int helicity)
 
void SetHardwareSum (Double_t hwsum, UInt_t sequencenumber=0)
 
void SetEventData (Double_t *block, UInt_t sequencenumber)
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
void ProcessEvent ()
 
Bool_t ApplyHWChecks ()
 
Bool_t ApplySingleEventCuts ()
 
void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure More...
 
void SetSingleEventCuts (UInt_t errorflag, Double_t LL, Double_t UL, Double_t stability)
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel. More...
 
void SetDefaultSampleSize (Int_t sample_size)
 
void SetEventCutMode (Int_t bcuts)
 
UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device More...
 
void IncrementErrorCounters ()
 
UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
void UpdateErrorFlag (const QwCombinedPMT *ev_error)
 
void PrintInfo () const
 Print multiple lines of information about this data element. More...
 
void PrintValue () const
 Print single line of value and error of this data element. More...
 
QwCombinedPMToperator= (const QwCombinedPMT &value)
 
QwCombinedPMToperator+= (const QwCombinedPMT &value)
 
QwCombinedPMToperator-= (const QwCombinedPMT &value)
 
void Sum (QwCombinedPMT &value1, QwCombinedPMT &value2)
 
void Difference (QwCombinedPMT &value1, QwCombinedPMT &value2)
 
void Ratio (QwCombinedPMT &numer, QwCombinedPMT &denom)
 
void Scale (Double_t factor)
 
void Normalize (VQwDataElement *denom)
 
void AccumulateRunningSum (const QwCombinedPMT &value)
 
void DeaccumulateRunningSum (QwCombinedPMT &value)
 
void CalculateRunningAverage ()
 
void SetBlindability (Bool_t isblindable)
 
void SetNormalizability (Bool_t isnormalizable)
 
void Blind (const QwBlinder *blinder)
 Blind the asymmetry. More...
 
void Blind (const QwBlinder *blinder, const QwCombinedPMT &yield)
 Blind the difference using the yield. More...
 
void SetPedestal (Double_t ped)
 
void SetCalibrationFactor (Double_t calib)
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this data element. More...
 
void FillHistograms ()
 Fill the histograms for this data element. More...
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 
void ConstructBranch (TTree *tree, TString &prefix)
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist)
 
void FillTreeVector (std::vector< Double_t > &values) const
 
std::vector< QwDBInterfaceGetDBEntry ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor. More...
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor. More...
 
virtual ~VQwDataElement ()
 Virtual destructor. More...
 
Bool_t IsNameEmpty () const
 Is the name of this element empty? More...
 
void SetElementName (const TString &name)
 Set the name of this element. More...
 
virtual const TString & GetElementName () const
 Get the name of this element. More...
 
virtual void LoadChannelParameters (QwParameterFile &paramfile)
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element. More...
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *valueptr)
 
virtual VQwDataElementoperator+= (const VQwDataElement &value)
 Addition-assignment operator. More...
 
virtual VQwDataElementoperator-= (const VQwDataElement &value)
 Subtraction-assignment operator. More...
 
virtual void Sum (const VQwDataElement &value1, const VQwDataElement &value2)
 Sum operator. More...
 
virtual void Difference (const VQwDataElement &value1, const VQwDataElement &value2)
 Difference operator. More...
 
virtual void Ratio (const VQwDataElement &numer, const VQwDataElement &denom)
 Ratio operator. More...
 
virtual void SetNeedsExternalClock (Bool_t needed)
 
virtual Bool_t NeedsExternalClock ()
 
virtual std::string GetExternalClockName ()
 
virtual void SetExternalClockPtr (const VQwHardwareChannel *clock)
 
virtual void SetExternalClockName (const std::string name)
 
virtual Double_t GetNormClockValue ()
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name. More...
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name. More...
 
TString GetModuleType () const
 Return the type of the beam instrument. More...
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument More...
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects. More...
 

Private Attributes

Int_t fDataToSave
 
Double_t fCalibration
 
Double_t fULimit
 
Double_t fLLimit
 
Double_t fSequenceNo_Prev
 
Bool_t fGoodEvent
 
std::vector< QwIntegrationPMT * > fElement
 used to validate sequence number in the IsGoodEvent() More...
 
std::vector< Double_t > fWeights
 
QwIntegrationPMT fSumADC
 
Int_t fDevice_flag
 
Int_t fDeviceErrorCode
 
Bool_t bEVENTCUTMODE
 

Static Private Attributes

static const Bool_t bDEBUG =kFALSE
 

Additional Inherited Members

- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element. More...
 
virtual VQwDataElementoperator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data. More...
 
virtual void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor. More...
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor. More...
 
virtual ~MQwHistograms ()
 Virtual destructor. More...
 
virtual MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram. More...
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element. More...
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element. More...
 
Int_t fGoodEventCount
 Number of good events accumulated in this element. More...
 
TString fSubsystemName
 
TString fModuleType
 
UInt_t fErrorFlag
 This the standard error code generated for the channel that contains the global/local/stability flags and the Device error code (Unique error code for HW failures) More...
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags More...
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element. More...
 

Detailed Description

Definition at line 19 of file QwCombinedPMT.h.

Constructor & Destructor Documentation

QwCombinedPMT::QwCombinedPMT ( )
inline

Definition at line 22 of file QwCombinedPMT.h.

References InitializeChannel().

22  {
23  InitializeChannel("", "derived");
24  };
void InitializeChannel(TString name, TString datatosave)

+ Here is the call graph for this function:

QwCombinedPMT::QwCombinedPMT ( TString  name)
inline

Definition at line 26 of file QwCombinedPMT.h.

References InitializeChannel().

26  {
27  InitializeChannel(name, "derived");
28  };
void InitializeChannel(TString name, TString datatosave)

+ Here is the call graph for this function:

QwCombinedPMT::QwCombinedPMT ( TString  subsystemname,
TString  name 
)
inline

Definition at line 30 of file QwCombinedPMT.h.

References InitializeChannel(), and VQwDataElement::SetSubsystemName().

30  {
31  SetSubsystemName(subsystemname);
32  InitializeChannel(subsystemname, name, "derived");
33  };
void InitializeChannel(TString name, TString datatosave)
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.

+ Here is the call graph for this function:

QwCombinedPMT::QwCombinedPMT ( const QwCombinedPMT source)
inline

Definition at line 34 of file QwCombinedPMT.h.

35  : VQwDataElement(source),
36  fCalibration(source.fCalibration),
37  fElement(source.fElement),
38  fWeights(source.fWeights),
39  fSumADC(source.fSumADC)
40  { }
VQwDataElement()
Default constructor.
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
QwIntegrationPMT fSumADC
std::vector< Double_t > fWeights
Double_t fCalibration
virtual QwCombinedPMT::~QwCombinedPMT ( )
inlinevirtual

Definition at line 41 of file QwCombinedPMT.h.

41 { };

Member Function Documentation

void QwCombinedPMT::AccumulateRunningSum ( const QwCombinedPMT value)

Definition at line 283 of file QwCombinedPMT.cc.

References QwIntegrationPMT::AccumulateRunningSum(), and fSumADC.

284 {
286 }
void AccumulateRunningSum(const QwIntegrationPMT &value)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::Add ( QwIntegrationPMT pmt,
Double_t  weight 
)

Definition at line 10 of file QwCombinedPMT.cc.

References fElement, and fWeights.

11 {
12  //std::cout<<"QwCombinedPMT: Got "<<pmt->GetElementName()<<" and weight ="<<weight<<"\n";
13  fElement.push_back(pmt);
14  fWeights.push_back(weight);
15 }
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
std::vector< Double_t > fWeights
Bool_t QwCombinedPMT::ApplyHWChecks ( )

Definition at line 126 of file QwCombinedPMT.cc.

127 {
128  Bool_t eventokay=kTRUE;
129 
130 
131  return eventokay;
132 }
Bool_t QwCombinedPMT::ApplySingleEventCuts ( )

Definition at line 195 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ApplySingleEventCuts(), and fSumADC.

195  {
196  return fSumADC.ApplySingleEventCuts();
197 }
Bool_t ApplySingleEventCuts()
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::Blind ( const QwBlinder blinder)

Blind the asymmetry.

Definition at line 331 of file QwCombinedPMT.cc.

References QwIntegrationPMT::Blind(), and fSumADC.

332 {
333  fSumADC.Blind(blinder);
334 // fAvgADC.Blind(blinder);
335 }
void Blind(const QwBlinder *blinder)
Blind the asymmetry.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::Blind ( const QwBlinder blinder,
const QwCombinedPMT yield 
)

Blind the difference using the yield.

Definition at line 337 of file QwCombinedPMT.cc.

References QwIntegrationPMT::Blind(), and fSumADC.

338 {
339  fSumADC.Blind(blinder, yield.fSumADC);
340 // fAvgADC.Blind(blinder, yield.fAvgADC);
341 }
void Blind(const QwBlinder *blinder)
Blind the asymmetry.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::CalculateRunningAverage ( )

Definition at line 325 of file QwCombinedPMT.cc.

References QwIntegrationPMT::CalculateRunningAverage(), and fSumADC.

326 {
328 // fAvgADC.CalculateRunningAverage();
329 }
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::CalculateSumAndAverage ( )

Definition at line 77 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ClearEventData(), fElement, fSumADC, fWeights, VQwDataElement::GetElementName(), QwIntegrationPMT::GetValue(), QwIntegrationPMT::PrintInfo(), and QwIntegrationPMT::Scale().

Referenced by ProcessEvent().

78 {
79 
80  Bool_t ldebug = kFALSE;
81  Double_t total_weights=0.0;
82 
84  static QwIntegrationPMT tmpADC("tmpADC");
85 
86  for (size_t i=0;i<fElement.size();i++)
87  {
88  //std::cout<<"=========fElement["<<i<<"]=========="<<std::endl;
89  //fElement[i]->Print();
90  tmpADC = *(fElement[i]);
91  //std::cout<<"=========tmpADC========="<<std::endl;
92  //tmpADC->Print();
93  tmpADC.Scale(fWeights[i]);
94  fSumADC += tmpADC;
95  total_weights += fWeights[i];
96  }
97 
98 // fAvgADC = fSumADC;
99 // if (total_weights!=0.0)
100 // fAvgADC.Scale(1/total_weights);
101 
102  if (total_weights!=0.0)
103  fSumADC.Scale(1/total_weights);
104 
105 
106  if (ldebug)
107  {
108  std::cout<<"QwCombinedPMT::CalculateAverage()"<<std::endl;
109 // fAvgADC.PrintInfo();
110  fSumADC.PrintInfo();
111 
112 // std::cout<<"QwCombinedPMT: "<<GetElementName()
113 // <<"\nweighted average of hardware sums = "<<fAvgADC.GetValue()<<"\n";
114  std::cout<<"QwCombinedPMT: "<<GetElementName()
115  <<"\nweighted average of hardware sums = "<<fSumADC.GetValue()<<"\n";
116 
117  for (size_t i=0;i<4;i++)
118  {
119  std::cout<<"weighted average of block["<<i<<"] = "<<fSumADC.GetValue(i+1)<<"\n";
120  }
121  }
122 
123 }
void ClearEventData()
Clear the event data in this element.
void Scale(Double_t factor)
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
QwIntegrationPMT fSumADC
std::vector< Double_t > fWeights
virtual const TString & GetElementName() const
Get the name of this element.
void PrintInfo() const
Print multiple lines of information about this data element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwCombinedPMT::ClearEventData ( )
virtual

Clear the event data in this element.

Reimplemented from VQwDataElement.

Definition at line 59 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ClearEventData(), and fSumADC.

60 {
62 // fAvgADC.ClearEventData();
63 }
void ClearEventData()
Clear the event data in this element.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::ConstructBranch ( TTree *  tree,
TString &  prefix 
)

Definition at line 404 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ConstructBranch(), fSumADC, and VQwDataElement::GetElementName().

405 {
406  if (GetElementName()=="")
407  {
408  // This channel is not used, so skip
409  }
410  else
411  {
412  TString sumprefix = prefix+"";
413  fSumADC.ConstructBranch(tree, sumprefix);
414  }
415  return;
416 }
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.
void ConstructBranch(TTree *tree, TString &prefix)

+ Here is the call graph for this function:

void QwCombinedPMT::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile modulelist 
)

Definition at line 418 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ConstructBranch(), QwLog::endl(), fSumADC, VQwDataElement::GetElementName(), QwParameterFile::HasValue(), and QwMessage.

419 {
420  TString devicename;
421  devicename=GetElementName();
422  devicename.ToLower();
423  if (GetElementName()=="")
424  {
425  // This channel is not used, so skip
426  }
427  else
428  {
429  if (modulelist.HasValue(devicename)){
430  TString sumprefix = prefix+"";
431  fSumADC.ConstructBranch(tree, sumprefix);
432  QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
433  }
434  }
435  return;
436 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Bool_t HasValue(TString &vname)
QwIntegrationPMT fSumADC
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
virtual const TString & GetElementName() const
Get the name of this element.
void ConstructBranch(TTree *tree, TString &prefix)

+ Here is the call graph for this function:

void QwCombinedPMT::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)

Definition at line 389 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ConstructBranchAndVector(), fSumADC, and VQwDataElement::GetElementName().

390 {
391  if (GetElementName()=="")
392  {
393  // This channel is not used, so skip
394  }
395  else
396  {
397  TString sumprefix = prefix+"";
398  fSumADC.ConstructBranchAndVector(tree, sumprefix,values);
399 
400  }
401  return;
402 }
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

void QwCombinedPMT::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

Construct the histograms for this data element.

Implements VQwDataElement.

Definition at line 356 of file QwCombinedPMT.cc.

References QwIntegrationPMT::ConstructHistograms(), fSumADC, and VQwDataElement::GetElementName().

357 {
358  if (GetElementName()=="")
359  {
360  // This channel is not used, so skip filling the histograms.
361  }
362  else
363  {
364  TString sumprefix = prefix+TString("");
365  fSumADC.ConstructHistograms(folder, sumprefix);
366 // TString avgprefix = prefix+TString("");
367 // fAvgADC.ConstructHistograms(folder, avgprefix);
368  }
369  return;
370 
371 }
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

void QwCombinedPMT::DeaccumulateRunningSum ( QwCombinedPMT value)

Definition at line 288 of file QwCombinedPMT.cc.

References QwIntegrationPMT::DeaccumulateRunningSum(), and fSumADC.

289 {
291 }
void DeaccumulateRunningSum(QwIntegrationPMT &value)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::Difference ( QwCombinedPMT value1,
QwCombinedPMT value2 
)

Definition at line 294 of file QwCombinedPMT.cc.

References fSumADC.

295 {
296  //std::cout<<"Calling QwCombinedPMT::Difference="<<std::endl;
297  this->fSumADC = value1.fSumADC;
298 // this->fAvgADC = value1.fAvgADC;
299  this->fSumADC -= value2.fSumADC;
300 // this->fAvgADC -= value2.fAvgADC;
301 }
QwIntegrationPMT fSumADC
void QwCombinedPMT::EncodeEventData ( std::vector< UInt_t > &  buffer)
void QwCombinedPMT::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwDataElement.

Definition at line 373 of file QwCombinedPMT.cc.

References QwIntegrationPMT::FillHistograms(), fSumADC, and VQwDataElement::GetElementName().

374 {
375  if (GetElementName()=="")
376  {
377  // This channel is not used, so skip filling the histograms.
378  }
379  else
380  {
382 // fAvgADC.FillHistograms();
383  }
384 
385 
386  return;
387 }
void FillHistograms()
Fill the histograms for this data element.
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

void QwCombinedPMT::FillTreeVector ( std::vector< Double_t > &  values) const

Definition at line 439 of file QwCombinedPMT.cc.

References QwIntegrationPMT::FillTreeVector(), fSumADC, and VQwDataElement::GetElementName().

440 {
441  if (GetElementName()=="") {
442  // This channel is not used, so skip filling the histograms.
443  } else {
444  fSumADC.FillTreeVector(values);
445 // fAvgADC.FillTreeVector(values);
446  }
447 }
void FillTreeVector(std::vector< Double_t > &values) const
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

const QwVQWK_Channel* QwCombinedPMT::GetChannel ( const TString  name) const
inline

Definition at line 48 of file QwCombinedPMT.h.

References fSumADC, QwIntegrationPMT::GetChannel(), and VQwDataElement::GetElementName().

Referenced by QwMainCerenkovDetector::PublishInternalValues().

48  {
49  if (fSumADC.GetElementName() == name) return fSumADC.GetChannel(name);
50  else return 0;
51  };
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.
const QwVQWK_Channel * GetChannel(const TString name) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< QwDBInterface > QwCombinedPMT::GetDBEntry ( )

Definition at line 450 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::GetDBEntry().

451 {
452  return fSumADC.GetDBEntry();
453 }
std::vector< QwDBInterface > GetDBEntry()
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

std::vector< QwErrDBInterface > QwCombinedPMT::GetErrDBEntry ( )

Definition at line 455 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::GetErrDBEntry().

456 {
457  return fSumADC.GetErrDBEntry();
458 }
QwIntegrationPMT fSumADC
std::vector< QwErrDBInterface > GetErrDBEntry()

+ Here is the call graph for this function:

UInt_t QwCombinedPMT::GetEventcutErrorFlag ( )
inlinevirtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 81 of file QwCombinedPMT.h.

References fSumADC, and QwIntegrationPMT::GetEventcutErrorFlag().

Referenced by UpdateErrorFlag().

81  {//return the error flag
83  }
QwIntegrationPMT fSumADC
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwCombinedPMT::IncrementErrorCounters ( )
inline

Definition at line 85 of file QwCombinedPMT.h.

References fSumADC, and QwIntegrationPMT::IncrementErrorCounters().

85  {
87  }
void IncrementErrorCounters()
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::InitializeChannel ( TString  name,
TString  datatosave 
)

Definition at line 18 of file QwCombinedPMT.cc.

References fDataToSave, fSumADC, QwIntegrationPMT::InitializeChannel(), VQwDataElement::kDerived, VQwDataElement::kRaw, SetBlindability(), and VQwDataElement::SetElementName().

Referenced by QwCombinedPMT().

19 {
20  SetElementName(name);
21  //SetPedestal(0.);
22  //SetCalibrationFactor(1.);
23  if (datatosave=="raw") fDataToSave=kRaw;
24  else
25  if (datatosave=="derived") fDataToSave=kDerived;
26 
27  fSumADC.InitializeChannel(name, datatosave);
28  SetBlindability(kTRUE);
29  return;
30 }
void InitializeChannel(TString name, TString datatosave)
void SetBlindability(Bool_t isblindable)
void SetElementName(const TString &name)
Set the name of this element.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwCombinedPMT::InitializeChannel ( TString  subsystem,
TString  name,
TString  datatosave 
)

Definition at line 32 of file QwCombinedPMT.cc.

References fDataToSave, fSumADC, QwIntegrationPMT::InitializeChannel(), VQwDataElement::kDerived, VQwDataElement::kRaw, SetBlindability(), and VQwDataElement::SetElementName().

33 {
34  SetElementName(name);
35  //SetPedestal(0.);
36  //SetCalibrationFactor(1.);
37  if (datatosave=="raw") fDataToSave=kRaw;
38  else
39  if (datatosave=="derived") fDataToSave=kDerived;
40 
41  fSumADC.InitializeChannel(subsystemname, "QwCombinedPMT", name, datatosave);
42  SetBlindability(kTRUE);
43 
44  return;
45 }
void InitializeChannel(TString name, TString datatosave)
void SetBlindability(Bool_t isblindable)
void SetElementName(const TString &name)
Set the name of this element.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::LinkChannel ( TString  name)

Definition at line 47 of file QwCombinedPMT.cc.

References fSumADC, VQwDataElement::GetElementName(), QwIntegrationPMT::SetElementName(), and VQwDataElement::SetElementName().

48 {
49  Bool_t local_debug = false;
50  SetElementName(name);
51 // TString sumstr = name+TString("_sum");
52  TString sumstr = name+TString("");
53  fSumADC.SetElementName(sumstr);
54 // TString avgstr = name+TString("_avg");
55 // fAvgADC.SetElementName(avgstr);
56  if(local_debug) std::cout<<"linked combined PMT channel "<< GetElementName()<<std::endl;
57 }
void SetElementName(const TString &name)
Set the name of this element.
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.
void SetElementName(const TString &name)

+ Here is the call graph for this function:

void QwCombinedPMT::Normalize ( VQwDataElement denom)

Definition at line 317 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::Normalize().

318 {
319  fSumADC.Normalize(denom);
320 
321  return;
322 }
void Normalize(VQwDataElement *denom)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

QwCombinedPMT & QwCombinedPMT::operator+= ( const QwCombinedPMT value)

Definition at line 236 of file QwCombinedPMT.cc.

References fElement, fSumADC, fWeights, and VQwDataElement::GetElementName().

237 {
238  //std::cout<<"Calling QwCombinedPMT::operator+="<<std::endl;
239  if ( (GetElementName()!="") && (this->fElement.size()==value.fElement.size()) )
240  {
241  for (size_t i=0; i<value.fElement.size(); i++)
242  {
243  *(this->fElement[i]) += *(value.fElement[i]);
244  this->fWeights[i] += value.fWeights[i];
245  }
246 
247  this->fSumADC+=value.fSumADC;
248 // this->fAvgADC+=value.fAvgADC;
249  }
250 
251  return *this;
252 }
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
QwIntegrationPMT fSumADC
std::vector< Double_t > fWeights
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

QwCombinedPMT & QwCombinedPMT::operator-= ( const QwCombinedPMT value)

Definition at line 254 of file QwCombinedPMT.cc.

References fElement, fSumADC, fWeights, and VQwDataElement::GetElementName().

255 {
256  //std::cout<<"Calling QwCombinedPMT::operator-="<<std::endl;
257  if ( (GetElementName()!="") && (this->fElement.size()==value.fElement.size()) )
258  {
259  for (size_t i=0; i<value.fElement.size(); i++)
260  {
261  *(this->fElement[i]) -= *(value.fElement[i]);
262  this->fWeights[i] -= value.fWeights[i];
263  }
264 
265  this->fSumADC-=value.fSumADC;
266 // this->fAvgADC-=value.fAvgADC;
267  //value.fSumADC.Print();
268  //fSumADC.Print();
269  }
270 
271  return *this;
272 }
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
QwIntegrationPMT fSumADC
std::vector< Double_t > fWeights
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

QwCombinedPMT & QwCombinedPMT::operator= ( const QwCombinedPMT value)

Definition at line 207 of file QwCombinedPMT.cc.

References fElement, fSumADC, fWeights, and VQwDataElement::GetElementName().

208 {
209  //std::cout<<"Calling QwCombinedPMT::operator="<<std::endl;
210  if ( (GetElementName()!="") && (this->fElement.size()==value.fElement.size()) )
211  {
212  for (size_t i=0; i<value.fElement.size(); i++)
213  {
214  //std::cout<<"value.fWeight["<<i<<"]="<<value.fWeights[i]<<std::endl;
215  //std::cout<<"=========value.fElement["<<i<<"]=========="<<std::endl;
216  //value.fElement[i]->Print();
217  (this->fElement[i]) = (value.fElement[i]);
218  this->fWeights[i] = value.fWeights[i];
219  //std::cout<<"this->fWeight["<<i<<"]="<<fWeights[i]<<std::endl;
220  //std::cout<<"=========this->fElement["<<i<<"]=========="<<std::endl;
221  //fElement[i]->Print();
222  }
223 
224  this->fSumADC=value.fSumADC;
225 // this->fAvgADC=value.fAvgADC;
226 
227  //std::cout<<"value.fSumADC"<<std::endl;
228  //value.fSumADC.Print();
229  //std::cout<<"this->fSumADC"<<std::endl;
230  //fSumADC.Print();
231  }
232 
233  return *this;
234 }
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
QwIntegrationPMT fSumADC
std::vector< Double_t > fWeights
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

void QwCombinedPMT::PrintErrorCounters ( )
void QwCombinedPMT::PrintErrorCounters ( ) const
virtual

report number of events failed due to HW and event cut failure

Reimplemented from VQwDataElement.

Definition at line 160 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::PrintErrorCounters().

161 {
163 }
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 349 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::PrintInfo().

350 {
351  fSumADC.PrintInfo();
352 // fAvgADC.PrintInfo();
353 }
QwIntegrationPMT fSumADC
void PrintInfo() const
Print multiple lines of information about this data element.

+ Here is the call graph for this function:

void QwCombinedPMT::PrintValue ( ) const
virtual

Print single line of value and error of this data element.

Reimplemented from VQwDataElement.

Definition at line 343 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::PrintValue().

344 {
346 // fAvgADC.PrintValue();
347 }
void PrintValue() const
Print single line of value and error of this data element.
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

Int_t QwCombinedPMT::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement = 0 
)
virtual

Process the CODA event buffer for this element.

Implements VQwDataElement.

Definition at line 201 of file QwCombinedPMT.cc.

202 {
203  return 0;
204 }
void QwCombinedPMT::ProcessEvent ( )

Definition at line 144 of file QwCombinedPMT.cc.

References CalculateSumAndAverage().

145 {
146 //Calculate the weigted averages of the hardware sum and each of the four blocks.
148  //fSumADC.ProcessEvent(); //This is not necessary for combined devices-Rakitha 11-15-2010
149 
150  return;
151 }
void CalculateSumAndAverage()

+ Here is the call graph for this function:

void QwCombinedPMT::RandomizeEventData ( int  helicity)
void QwCombinedPMT::Ratio ( QwCombinedPMT numer,
QwCombinedPMT denom 
)

Definition at line 303 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::Ratio().

304 {
305  //std::cout<<"Calling QwCombinedPMT::Ratio"<<std::endl;
306  fSumADC.Ratio(numer.fSumADC,denom.fSumADC);
307 // fAvgADC.Ratio(numer.fAvgADC,denom.fAvgADC);
308  return;
309 }
void Ratio(QwIntegrationPMT &numer, QwIntegrationPMT &denom)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::Scale ( Double_t  factor)

Definition at line 311 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::Scale().

312 {
313  fSumADC.Scale(factor);
314 // fAvgADC.Scale(factor);
315  return;
316 }
void Scale(Double_t factor)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::SetBlindability ( Bool_t  isblindable)
inline

Definition at line 107 of file QwCombinedPMT.h.

References fSumADC, and QwIntegrationPMT::SetBlindability().

Referenced by InitializeChannel(), QwMainCerenkovDetector::LoadChannelMap(), and QwLumi::LoadChannelMap().

107 {fSumADC.SetBlindability(isblindable);};
void SetBlindability(Bool_t isblindable)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwCombinedPMT::SetCalibrationFactor ( Double_t  calib)
void QwCombinedPMT::SetDefaultSampleSize ( Int_t  sample_size)

Definition at line 154 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::SetDefaultSampleSize().

155 {
156  fSumADC.SetDefaultSampleSize((size_t)sample_size);
157 }
QwIntegrationPMT fSumADC
void SetDefaultSampleSize(Int_t sample_size)

+ Here is the call graph for this function:

void QwCombinedPMT::SetEventCutMode ( Int_t  bcuts)
inline

Definition at line 77 of file QwCombinedPMT.h.

References bEVENTCUTMODE, fSumADC, and QwIntegrationPMT::SetEventCutMode().

77  {
78  bEVENTCUTMODE=bcuts;
79  fSumADC.SetEventCutMode(bcuts);
80  }
Bool_t bEVENTCUTMODE
QwIntegrationPMT fSumADC
void SetEventCutMode(Int_t bcuts)

+ Here is the call graph for this function:

void QwCombinedPMT::SetEventData ( Double_t *  block,
UInt_t  sequencenumber 
)

Definition at line 71 of file QwCombinedPMT.cc.

References fSumADC, and QwIntegrationPMT::SetEventData().

72 {
73  fSumADC.SetEventData(block, sequencenumber);
74 // fAvgADC.SetEventData(block, sequencenumber);
75 }
void SetEventData(Double_t *block, UInt_t sequencenumber)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::SetHardwareSum ( Double_t  hwsum,
UInt_t  sequencenumber = 0 
)

Definition at line 66 of file QwCombinedPMT.cc.

67 {
68 
69 }
void QwCombinedPMT::SetNormalizability ( Bool_t  isnormalizable)
inline

Definition at line 108 of file QwCombinedPMT.h.

References fSumADC, and QwIntegrationPMT::SetNormalizability().

Referenced by QwMainCerenkovDetector::LoadChannelMap(), and QwLumi::LoadChannelMap().

108 {fSumADC.SetNormalizability(isnormalizable);};
void SetNormalizability(Bool_t isnormalizable)
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwCombinedPMT::SetPedestal ( Double_t  ped)
void QwCombinedPMT::SetRandomEventAsymmetry ( Double_t  asymmetry)
void QwCombinedPMT::SetRandomEventParameters ( Double_t  mean,
Double_t  sigma 
)
void QwCombinedPMT::SetSingleEventCuts ( UInt_t  errorflag,
Double_t  LL = 0,
Double_t  UL = 0,
Double_t  stability = 0 
)
virtual

Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.

Reimplemented from VQwDataElement.

Definition at line 135 of file QwCombinedPMT.cc.

References QwLog::endl(), fSumADC, QwMessage, and QwIntegrationPMT::SetSingleEventCuts().

135  {
136  //set the unique tag to identify device type (Int.PMT & Comb. PMT)
137  //errorflag|=kPMTErrorFlag;
138  QwMessage<<"QwCombinedPMT Error Code passing to QwIntegrationPMT "<<errorflag<<QwLog::endl;
139  fSumADC.SetSingleEventCuts(errorflag,LL,UL,stability);
140 
141 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Int_t SetSingleEventCuts(Double_t, Double_t)
QwIntegrationPMT fSumADC
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

void QwCombinedPMT::Sum ( QwCombinedPMT value1,
QwCombinedPMT value2 
)

Definition at line 274 of file QwCombinedPMT.cc.

References fSumADC.

275 {
276  //std::cout<<"Calling QwCombinedPMT::Sum"<<std::endl;
277  this->fSumADC = value1.fSumADC;
278 // this->fAvgADC = value1.fAvgADC;
279  this->fSumADC += value2.fSumADC;
280 // this->fAvgADC += value2.fAvgADC;
281 }
QwIntegrationPMT fSumADC
UInt_t QwCombinedPMT::UpdateErrorFlag ( )
virtual

Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag".

Reimplemented from VQwDataElement.

Definition at line 166 of file QwCombinedPMT.cc.

References fElement, fSumADC, GetEventcutErrorFlag(), and QwIntegrationPMT::UpdateErrorFlag().

167 {
168  for (size_t i=0;i<fElement.size();i++) {
170  }
171  return GetEventcutErrorFlag();
172 }
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
std::vector< QwIntegrationPMT * > fElement
used to validate sequence number in the IsGoodEvent()
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
Definition: QwCombinedPMT.h:81
QwIntegrationPMT fSumADC

+ Here is the call graph for this function:

void QwCombinedPMT::UpdateErrorFlag ( const QwCombinedPMT ev_error)

Definition at line 175 of file QwCombinedPMT.cc.

References Qw::e, fSumADC, VQwDataElement::GetElementName(), and QwIntegrationPMT::UpdateErrorFlag().

175  {
176  try {
177  if(typeid(*ev_error)==typeid(*this)) {
178  // std::cout<<" Here in QwCombinedPMT::UpdateErrorFlag \n";
179  if (this->GetElementName()!="") {
180  fSumADC.UpdateErrorFlag(&(ev_error->fSumADC));
181  }
182  } else {
183  TString loc="Standard exception from QwCombinedPMT::UpdateErrorFlag :"+
184  ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
185  +"same type";
186  throw std::invalid_argument(loc.Data());
187  }
188  } catch (std::exception& e) {
189  std::cerr<< e.what()<<std::endl;
190  }
191 };
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
static const double e
Definition: QwUnits.h:91
QwIntegrationPMT fSumADC
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

Field Documentation

const Bool_t QwCombinedPMT::bDEBUG =kFALSE
staticprivate

If this set to kFALSE then Event cuts do not depend on HW ckecks. This is set externally through the qweak_beamline_eventcuts.map

Definition at line 157 of file QwCombinedPMT.h.

Bool_t QwCombinedPMT::bEVENTCUTMODE
private

keep the device HW status using a unique code from the QwVQWK_Channel::fDeviceErrorCode

Definition at line 153 of file QwCombinedPMT.h.

Referenced by SetEventCutMode().

Double_t QwCombinedPMT::fCalibration
private

Definition at line 134 of file QwCombinedPMT.h.

Int_t QwCombinedPMT::fDataToSave
private

Definition at line 133 of file QwCombinedPMT.h.

Referenced by InitializeChannel().

Int_t QwCombinedPMT::fDevice_flag
private

Definition at line 146 of file QwCombinedPMT.h.

Int_t QwCombinedPMT::fDeviceErrorCode
private

sets the event cut level for the device fDevice_flag=1 Event cuts & HW check, fDevice_flag=0 HW check, fDevice_flag=-1 no check

Definition at line 150 of file QwCombinedPMT.h.

std::vector<QwIntegrationPMT*> QwCombinedPMT::fElement
private

used to validate sequence number in the IsGoodEvent()

Definition at line 140 of file QwCombinedPMT.h.

Referenced by Add(), CalculateSumAndAverage(), operator+=(), operator-=(), operator=(), and UpdateErrorFlag().

Bool_t QwCombinedPMT::fGoodEvent
private

Definition at line 138 of file QwCombinedPMT.h.

Double_t QwCombinedPMT::fLLimit
private

Definition at line 135 of file QwCombinedPMT.h.

Double_t QwCombinedPMT::fSequenceNo_Prev
private

Definition at line 136 of file QwCombinedPMT.h.

Double_t QwCombinedPMT::fULimit
private

Definition at line 135 of file QwCombinedPMT.h.

std::vector<Double_t> QwCombinedPMT::fWeights
private

Definition at line 141 of file QwCombinedPMT.h.

Referenced by Add(), CalculateSumAndAverage(), operator+=(), operator-=(), and operator=().


The documentation for this class was generated from the following files: