QwAnalysis
QwCombinedBPM< T > Class Template Reference

#include <QwCombinedBPM.h>

+ Inheritance diagram for QwCombinedBPM< T >:
+ Collaboration diagram for QwCombinedBPM< T >:

Public Types

enum  EBeamPositionMonitorAxis
 
- Public Types inherited from VQwBPM
enum  EBeamPositionMonitorAxis { kXAxis =0, kYAxis, kNumAxes }
 
- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 

Public Member Functions

 QwCombinedBPM ()
 
 QwCombinedBPM (TString name)
 
 QwCombinedBPM (TString subsystem, TString name)
 
 QwCombinedBPM (TString subsystem, TString name, TString type)
 
 QwCombinedBPM (const QwCombinedBPM &source)
 
virtual ~QwCombinedBPM ()
 
void InitializeChannel (TString name)
 
void InitializeChannel (TString subsystem, TString name)
 
void InitializeChannel (TString subsystem, TString name, TString type)
 
void LoadChannelParameters (QwParameterFile &paramfile)
 
void ClearEventData ()
 Clear the event data in this element. More...
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber)
 Process the CODA event buffer for this element. More...
 
void ProcessEvent ()
 
void PrintValue () const
 Print single line of value and error of this data element. More...
 
void PrintInfo () const
 Print multiple lines of information about this data element. More...
 
const VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) const
 
const VQwHardwareChannelGetSlope (EBeamPositionMonitorAxis axis) const
 
const VQwHardwareChannelGetEffectiveCharge () const
 
Bool_t ApplyHWChecks ()
 
Bool_t ApplySingleEventCuts ()
 
void SetEventCutMode (Int_t bcuts)
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel. More...
 
void IncrementErrorCounters ()
 
void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure More...
 
UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device More...
 
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 VQwBPM *ev_error)
 
void SetBPMForCombo (const VQwBPM *bpm, Double_t charge_weight, Double_t x_weight, Double_t y_weight, Double_t sumqw)
 
void Ratio (QwCombinedBPM &numer, QwCombinedBPM &denom)
 
void Ratio (VQwBPM &numer, VQwBPM &denom)
 
void Scale (Double_t factor)
 
VQwBPMoperator= (const VQwBPM &value)
 
VQwBPMoperator+= (const VQwBPM &value)
 
VQwBPMoperator-= (const VQwBPM &value)
 
virtual QwCombinedBPMoperator= (const QwCombinedBPM &value)
 
virtual QwCombinedBPMoperator+= (const QwCombinedBPM &value)
 
virtual QwCombinedBPMoperator-= (const QwCombinedBPM &value)
 
void AccumulateRunningSum (const VQwBPM &value)
 
void AccumulateRunningSum (const QwCombinedBPM &value)
 
void DeaccumulateRunningSum (VQwBPM &value)
 
void DeaccumulateRunningSum (QwCombinedBPM &value)
 
void CalculateRunningAverage ()
 
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
 
VQwHardwareChannelGetAngleX ()
 
const VQwHardwareChannelGetAngleX () const
 
VQwHardwareChannelGetAngleY ()
 
const VQwHardwareChannelGetAngleY () const
 
std::vector< QwDBInterfaceGetDBEntry ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
- Public Member Functions inherited from VQwBPM
 VQwBPM ()
 
 VQwBPM (TString &name)
 
 VQwBPM (const VQwBPM &source)
 
virtual ~VQwBPM ()
 
void InitializeChannel (TString name)
 
void GetSurveyOffsets (Double_t Xoffset, Double_t Yoffset, Double_t Zoffset)
 
void GetElectronicFactors (Double_t BSENfactor, Double_t AlphaX, Double_t AlphaY)
 
void SetRotation (Double_t)
 
void SetRotationOff ()
 
void SetSingleEventCuts (TString, Double_t, Double_t)
 
void SetSingleEventCuts (TString, UInt_t, Double_t, Double_t, Double_t)
 
void SetGains (TString pos, Double_t value)
 
void SetRootSaveStatus (TString &prefix)
 
Double_t GetPositionInZ () const
 
virtual TString GetSubElementName (Int_t subindex)
 
virtual void GetAbsolutePosition ()
 
virtual void SetDefaultSampleSize (Int_t sample_size)
 
virtual void SetRandomEventParameters (Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
 
virtual void RandomizeEventData (int helicity=0, double time=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &buffer)
 
virtual void SetSubElementPedestal (Int_t j, Double_t value)
 
virtual void SetSubElementCalibrationFactor (Int_t j, Double_t value)
 
- 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...
 
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 SetSingleEventCuts (UInt_t errorflag, Double_t min, Double_t max, Double_t stability)
 set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel 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...
 

Protected Member Functions

VQwHardwareChannelGetSubelementByName (TString ch_name)
 
void CalculateFixedParameter (std::vector< Double_t > fWeights, Int_t pos)
 
Double_t SumOver (std::vector< Double_t > weight, std::vector< T > val)
 
void LeastSquareFit (VQwBPM::EBeamPositionMonitorAxis axis, std::vector< Double_t > fWeights)
 
- Protected Member Functions inherited from VQwBPM
VQwHardwareChannelGetSubelementByIndex (size_t index)
 
- 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

fSlope [2]
 
fIntercept [2]
 
fMinimumChiSquare [2]
 
fAbsPos [2]
 
fEffectiveCharge
 
- Protected Attributes inherited from VQwBPM
std::vector< TString > fSubelementNames
 
Double_t fPositionCenter [3]
 
Double_t fQwStriplineCalibration
 
Double_t fRelativeGains [2]
 
Double_t fGains [2]
 
Bool_t bRotated
 
Double_t fRotationAngle
 
Double_t fCosRotation
 
Double_t fSinRotation
 
Bool_t fGoodEvent
 
Bool_t bFullSave
 
- 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...
 

Private Member Functions

void MakeBPMComboList ()
 

Private Attributes

Bool_t fixedParamCalculated
 
Double_t erra [2]
 
Double_t errb [2]
 
Double_t covab [2]
 
Double_t A [2]
 
Double_t B [2]
 
Double_t D [2]
 
Double_t m [2]
 
Double_t chi_square [2]
 
Double_t fSumQweights
 
std::vector< const VQwBPM * > fElement
 
std::vector< Double_t > fQWeights
 
std::vector< Double_t > fXWeights
 
std::vector< Double_t > fYWeights
 
std::vector< T > fBPMComboElementList
 

Friends

class QwEnergyCalculator
 

Additional Inherited Members

- Static Public Member Functions inherited from VQwBPM
static VQwBPMCreateStripline (TString subsystemname, TString type, TString name)
 A fast way of creating a BPM stripline of specified type. More...
 
static VQwBPMCreateStripline (const VQwBPM &source)
 
static VQwBPMCreateCombo (TString subsystemname, TString type, TString name)
 A fast way of creating a BPM stripline of specified type. More...
 
static VQwBPMCreateCombo (const VQwBPM &source)
 
- Static Protected Attributes inherited from VQwBPM
static const TString kAxisLabel [2] ={"X","Y"}
 
static const TString axis [3]
 
static const Bool_t bDEBUG =kFALSE
 

Detailed Description

template<typename T>
class QwCombinedBPM< T >

Definition at line 31 of file QwCombinedBPM.h.

Member Enumeration Documentation

template<typename T>
enum VQwBPM::EBeamPositionMonitorAxis

Axis enumerator for the BPMs; Z will never be an instrumented axis.

Definition at line 54 of file VQwBPM.h.

Constructor & Destructor Documentation

template<typename T>
QwCombinedBPM< T >::QwCombinedBPM ( )
inline

Definition at line 36 of file QwCombinedBPM.h.

36  {
37  };
template<typename T>
QwCombinedBPM< T >::QwCombinedBPM ( TString  name)
inline

Definition at line 38 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::InitializeChannel().

38  :VQwBPM(name){
39  InitializeChannel(name);
40  };
void InitializeChannel(TString name)
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

template<typename T>
QwCombinedBPM< T >::QwCombinedBPM ( TString  subsystem,
TString  name 
)
inline

Definition at line 41 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::InitializeChannel().

41  : VQwBPM(name){
42  InitializeChannel(subsystem, name);
43  };
void InitializeChannel(TString name)
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

template<typename T>
QwCombinedBPM< T >::QwCombinedBPM ( TString  subsystem,
TString  name,
TString  type 
)
inline

Definition at line 45 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::InitializeChannel().

45  : VQwBPM(name){
46  InitializeChannel(subsystem, name,type);
47  };
void InitializeChannel(TString name)
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

template<typename T>
QwCombinedBPM< T >::QwCombinedBPM ( const QwCombinedBPM< T > &  source)
inline

Definition at line 48 of file QwCombinedBPM.h.

49  : VQwBPM(source),
50  fSlope(source.fSlope),
51  fIntercept(source.fIntercept),
53  fAbsPos(source.fAbsPos),
55  { }
VQwBPM()
Definition: VQwBPM.h:58
T fMinimumChiSquare[2]
template<typename T>
virtual QwCombinedBPM< T >::~QwCombinedBPM ( )
inlinevirtual

Definition at line 56 of file QwCombinedBPM.h.

56 { };

Member Function Documentation

template<typename T >
void QwCombinedBPM< T >::AccumulateRunningSum ( const VQwBPM value)
virtual

Reimplemented from VQwBPM.

Definition at line 893 of file QwCombinedBPM.cc.

894 {
895  AccumulateRunningSum(*dynamic_cast<const QwCombinedBPM<T>* >(&value));
896 }
void AccumulateRunningSum(const VQwBPM &value)
template<typename T >
void QwCombinedBPM< T >::AccumulateRunningSum ( const QwCombinedBPM< T > &  value)

Definition at line 899 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, and QwCombinedBPM< T >::fSlope.

900 {
901  for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
902  fSlope[axis].AccumulateRunningSum(value.fSlope[axis]);
903  fIntercept[axis].AccumulateRunningSum(value.fIntercept[axis]);
904  fAbsPos[axis].AccumulateRunningSum(value.fAbsPos[axis]);
905  fMinimumChiSquare[axis].AccumulateRunningSum(value.fMinimumChiSquare[axis]);
906  }
907  fEffectiveCharge.AccumulateRunningSum(value.fEffectiveCharge);
908 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
Bool_t QwCombinedBPM< T >::ApplyHWChecks ( )

Definition at line 140 of file QwCombinedBPM.cc.

141 {
142  Bool_t eventokay=kTRUE;
143 
144  return eventokay;
145 }
template<typename T >
Bool_t QwCombinedBPM< T >::ApplySingleEventCuts ( )
virtual

TODO: The returned base class should be changed so these casts aren't needed, but "GetErrorCode" is not meaningful for every VQwDataElement. Maybe the return should be a VQwHardwareChannel?

Implements VQwBPM.

Definition at line 192 of file QwCombinedBPM.cc.

193 {
194  Bool_t status=kTRUE;
195  Int_t axis=0;
196  UInt_t charge_error;
197  UInt_t pos_error[2];
198  charge_error = 0;
199  pos_error[kXAxis]=0;
200  pos_error[kYAxis]=0;
201 
202  for(size_t i=0;i<fElement.size();i++){
203  /// TODO: The returned base class should be changed so
204  /// these casts aren't needed, but "GetErrorCode"
205  /// is not meaningful for every VQwDataElement.
206  /// Maybe the return should be a VQwHardwareChannel?
207 
208  //To update the event cut faliures in individual BPM devices
209  charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
210  pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
211  pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
212  }
213 
214  //Event cuts for X & Y slopes
215  for(axis=kXAxis;axis<kNumAxes;axis++){
216  fSlope[axis].UpdateErrorFlag(pos_error[axis]);
217  if (fSlope[axis].ApplySingleEventCuts()){ //for X slope
218  status&=kTRUE;
219  }
220  else{
221  status&=kFALSE;
222  if (bDEBUG) std::cout<<" X Slope event cut failed ";
223  }
224  }
225 
226  //Event cuts for X & Y intercepts
227  for(axis=kXAxis;axis<kNumAxes;axis++){
228  fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
229  if (fIntercept[axis].ApplySingleEventCuts()){ //for X slope
230  status&=kTRUE;
231  }
232  else{
233  status&=kFALSE;
234  if (bDEBUG) std::cout<<" X Intercept event cut failed ";
235  }
236  }
237 
238 
239  //Event cuts for X & Y minimum chi square
240  for(axis=kXAxis;axis<kNumAxes;axis++){
241  fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
242  if (fMinimumChiSquare[axis].ApplySingleEventCuts()){ //for X slope
243  status&=kTRUE;
244  }
245  else{
246  status&=kFALSE;
247  if (bDEBUG) std::cout<<" X Intercept event cut failed ";
248  }
249  }
250 
251 
252  //Event cuts for X & Y positions
253  for(axis=kXAxis;axis<kNumAxes;axis++){
254  fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
255  if (fAbsPos[axis].ApplySingleEventCuts()){
256  status&=kTRUE;
257  }
258  else{
259  status&=kFALSE;
260  if (bDEBUG) std::cout<<" Abs X event cut failed ";
261  }
262  }
263 
264  //Event cuts for four wire sum (EffectiveCharge)
265  fEffectiveCharge.UpdateErrorFlag(charge_error);
266  if (fEffectiveCharge.ApplySingleEventCuts()){
267  status&=kTRUE;
268  }
269  else{
270  status&=kFALSE;
271  if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
272  }
273 
274  return status;
275 }
static const Bool_t bDEBUG
Definition: VQwBPM.h:275
Bool_t ApplySingleEventCuts()
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
std::vector< const VQwBPM * > fElement
template<typename T >
void QwCombinedBPM< T >::CalculateFixedParameter ( std::vector< Double_t >  fWeights,
Int_t  pos 
)
protected

Definition at line 552 of file QwCombinedBPM.cc.

References QwLog::endl(), Qw::m, and QwWarning.

553  {
554 
555  Bool_t ldebug = kFALSE;
556  static Double_t zpos = 0.0;
557 
558  for(size_t i=0;i<fElement.size();i++){
559  zpos = fElement[i]->GetPositionInZ();
560  A[pos] += zpos*fWeights[i]; //zw
561  B[pos] += fWeights[i]; //w
562  D[pos] += zpos*zpos*fWeights[i]; //z^2w
563  }
564 
565  m[pos] = D[pos]*B[pos]-A[pos]*A[pos];
566  erra[pos] = B[pos]/m[pos];
567  errb[pos] = D[pos]/m[pos];
568  covab[pos] = -A[pos]/m[pos];
569 
570  // Divvy
571  if (m[pos] == 0)
572  QwWarning << "Angry Divvy: Division by zero in " << this->GetElementName() << QwLog::endl;
573 
574  if(ldebug){
575  std::cout<<" A = "<<A[pos]<<", B = "<<B[pos]<<", D = "<<D[pos]<<", m = "<<m[pos]<<std::endl;
576  std::cout<<"For least square fit, errors are "<<erra[pos]
577  <<"\ncovariance = "<<covab[pos]<<"\n\n";
578  }
579 
580  return;
581  }
Double_t covab[2]
Double_t m[2]
Double_t D[2]
Double_t errb[2]
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Double_t A[2]
virtual const TString & GetElementName() const
Get the name of this element.
Double_t B[2]
std::vector< const VQwBPM * > fElement
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45
Double_t erra[2]

+ Here is the call graph for this function:

template<typename T >
void QwCombinedBPM< T >::CalculateRunningAverage ( )
virtual

Implements VQwBPM.

Definition at line 879 of file QwCombinedBPM.cc.

880 {
881  fEffectiveCharge.CalculateRunningAverage();
882 
883  for (Short_t axis = kXAxis; axis < kNumAxes; axis++) {
884  fSlope[axis].CalculateRunningAverage();
885  fIntercept[axis].CalculateRunningAverage();
886  fAbsPos[axis].CalculateRunningAverage();
887  fMinimumChiSquare[axis].CalculateRunningAverage();
888  }
889 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::ClearEventData ( )
virtual

Clear the event data in this element.

Reimplemented from VQwDataElement.

Definition at line 96 of file QwCombinedBPM.cc.

97 {
98  fEffectiveCharge.ClearEventData();
99 
100  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
101  fAbsPos[axis].ClearEventData();
102  fSlope[axis].ClearEventData();
103  fIntercept[axis].ClearEventData();
104  }
105 
106  return;
107 }
static const TString axis[3]
Definition: VQwBPM.h:260
template<typename T >
void QwCombinedBPM< T >::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
virtual

Implements VQwBPM.

Definition at line 1006 of file QwCombinedBPM.cc.

1007 {
1008  if (this->GetElementName()==""){
1009  // This channel is not used, so skip constructing trees.
1010  } else
1011  {
1012  TString thisprefix=prefix;
1013  if(prefix=="asym_")
1014  thisprefix="diff_";
1015 
1016 
1017  fEffectiveCharge.ConstructBranch(tree,prefix);
1018 
1019  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1020  fSlope[axis].ConstructBranch(tree,thisprefix);
1021  fIntercept[axis].ConstructBranch(tree,thisprefix);
1022  fAbsPos[axis].ConstructBranch(tree,thisprefix);
1023  fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
1024  }
1025 
1026  }
1027  return;
1028 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwCombinedBPM< T >::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile modulelist 
)
virtual

Implements VQwBPM.

Definition at line 1031 of file QwCombinedBPM.cc.

References QwLog::endl(), QwParameterFile::HasValue(), and QwMessage.

1032 {
1033  TString devicename;
1034  devicename=this->GetElementName();
1035  devicename.ToLower();
1036 
1037  if (this->GetElementName()==""){
1038  // This channel is not used, so skip constructing trees.
1039  } else
1040  {
1041  if (modulelist.HasValue(devicename)){
1042  TString thisprefix=prefix;
1043  if(prefix=="asym_")
1044  thisprefix="diff_";
1045 
1046 
1047  fEffectiveCharge.ConstructBranch(tree,prefix);
1048 
1049  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1050  fSlope[axis].ConstructBranch(tree,thisprefix);
1051  fIntercept[axis].ConstructBranch(tree,thisprefix);
1052  fAbsPos[axis].ConstructBranch(tree,thisprefix);
1053  fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
1054  }
1055  QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
1056  }
1057 
1058  }
1059  return;
1060 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Bool_t HasValue(TString &vname)
static const TString axis[3]
Definition: VQwBPM.h:260
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

template<typename T >
void QwCombinedBPM< T >::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
virtual

Implements VQwBPM.

Definition at line 979 of file QwCombinedBPM.cc.

980 {
981  if (this->GetElementName()==""){
982  // This channel is not used, so skip constructing trees.
983  } else
984  {
985 
986  TString thisprefix=prefix;
987  if(prefix=="asym_")
988  thisprefix="diff_";
989 
990  this->SetRootSaveStatus(prefix);
991 
992  fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
993  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
994  fSlope[axis].ConstructBranchAndVector(tree,thisprefix,values);
995  fIntercept[axis].ConstructBranchAndVector(tree,thisprefix,values);
996  fAbsPos[axis].ConstructBranchAndVector(tree,thisprefix,values);
997  fMinimumChiSquare[axis].ConstructBranchAndVector(tree,thisprefix,values);
998  }
999 
1000  }
1001 
1002  return;
1003 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwCombinedBPM< T >::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 935 of file QwCombinedBPM.cc.

936 {
937 
938  if (this->GetElementName()==""){
939  // This channel is not used, so skip filling the histograms.
940  }
941  else{
942  //we calculate the asym_ for the fEffectiveCharge becasue its an asymmetry and not a difference.
943  fEffectiveCharge.ConstructHistograms(folder, prefix);
944  TString thisprefix=prefix;
945  if(prefix=="asym_")
946  thisprefix="diff_";
947  this->SetRootSaveStatus(prefix);
948 
949  for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
950  fSlope[axis].ConstructHistograms(folder, thisprefix);
951  fIntercept[axis].ConstructHistograms(folder, thisprefix);
952  fAbsPos[axis].ConstructHistograms(folder, thisprefix);
953  fMinimumChiSquare[axis].ConstructHistograms(folder, thisprefix);
954  }
955 
956  }
957  return;
958 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwCombinedBPM< T >::DeaccumulateRunningSum ( VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 911 of file QwCombinedBPM.cc.

912 {
913  DeaccumulateRunningSum(*dynamic_cast<QwCombinedBPM<T>* >(&value));
914 }
void DeaccumulateRunningSum(VQwBPM &value)
template<typename T >
void QwCombinedBPM< T >::DeaccumulateRunningSum ( QwCombinedBPM< T > &  value)

Definition at line 917 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, and QwCombinedBPM< T >::fSlope.

918 {
919 
920  for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
921  fSlope[axis].DeaccumulateRunningSum(value.fSlope[axis]);
922  fIntercept[axis].DeaccumulateRunningSum(value.fIntercept[axis]);
923  fAbsPos[axis].DeaccumulateRunningSum(value.fAbsPos[axis]);
924  fMinimumChiSquare[axis].DeaccumulateRunningSum(value.fMinimumChiSquare[axis]);
925  }
926  fEffectiveCharge.DeaccumulateRunningSum(value.fEffectiveCharge);
927 
928 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 961 of file QwCombinedBPM.cc.

962 {
963  if (this->GetElementName()==""){
964  // This channel is not used, so skip filling the histograms.
965  }
966  else{
967  fEffectiveCharge.FillHistograms();
968  for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
969  fSlope[axis].FillHistograms();
970  fIntercept[axis].FillHistograms();
971  fAbsPos[axis].FillHistograms();
972  fMinimumChiSquare[axis].FillHistograms();
973  }
974  }
975  return;
976 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwCombinedBPM< T >::FillTreeVector ( std::vector< Double_t > &  values) const
virtual

Implements VQwBPM.

Definition at line 1064 of file QwCombinedBPM.cc.

1065 {
1066  if (this->GetElementName()==""){
1067  // This channel is not used, so skip filling the tree.
1068  }
1069  else{
1070  fEffectiveCharge.FillTreeVector(values);
1071 
1072  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1073  fSlope[axis].FillTreeVector(values);
1074  fIntercept[axis].FillTreeVector(values);
1075  fAbsPos[axis].FillTreeVector(values);
1076  fMinimumChiSquare[axis].FillTreeVector(values);
1077  }
1078  }
1079  return;
1080 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T>
VQwHardwareChannel* QwCombinedBPM< T >::GetAngleX ( )
inline

Definition at line 143 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::fSlope.

Referenced by QwCombinedBPM< T >::GetAngleX().

143  { //At present this returns the slope not the angle
144  return &fSlope[0];
145  };

+ Here is the caller graph for this function:

template<typename T>
const VQwHardwareChannel* QwCombinedBPM< T >::GetAngleX ( ) const
inlinevirtual

Reimplemented from VQwBPM.

Definition at line 147 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::GetAngleX().

147  { //At present this returns the slope not the angle
148  return const_cast<QwCombinedBPM*>(this)->GetAngleX();
149  };
VQwHardwareChannel * GetAngleX()

+ Here is the call graph for this function:

template<typename T>
VQwHardwareChannel* QwCombinedBPM< T >::GetAngleY ( )
inline

Definition at line 151 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::fSlope.

Referenced by QwCombinedBPM< T >::GetAngleY().

151  {//At present this returns the slope not the angle
152  return &fSlope[1];
153  };

+ Here is the caller graph for this function:

template<typename T>
const VQwHardwareChannel* QwCombinedBPM< T >::GetAngleY ( ) const
inlinevirtual

Reimplemented from VQwBPM.

Definition at line 155 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::GetAngleY().

155  { //At present this returns the slope not the angle
156  return const_cast<QwCombinedBPM*>(this)->GetAngleY();
157  };
VQwHardwareChannel * GetAngleY()

+ Here is the call graph for this function:

template<typename T >
std::vector< QwDBInterface > QwCombinedBPM< T >::GetDBEntry ( )
virtual

Implements VQwBPM.

Definition at line 1124 of file QwCombinedBPM.cc.

1125 {
1126  std::vector <QwDBInterface> row_list;
1127  row_list.clear();
1128  for(size_t axis=kXAxis;axis<kNumAxes;axis++) {
1129  fAbsPos[axis].AddEntriesToList(row_list);
1130  fSlope[axis].AddEntriesToList(row_list);
1131  fIntercept[axis].AddEntriesToList(row_list);
1132  fMinimumChiSquare[axis].AddEntriesToList(row_list);
1133  }
1134  fEffectiveCharge.AddEntriesToList(row_list);
1135  return row_list;
1136 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T>
const VQwHardwareChannel* QwCombinedBPM< T >::GetEffectiveCharge ( ) const
inlinevirtual

Implements VQwBPM.

Definition at line 94 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::fEffectiveCharge.

94  {
95  return &fEffectiveCharge;
96  }
template<typename T >
std::vector< QwErrDBInterface > QwCombinedBPM< T >::GetErrDBEntry ( )
virtual

Implements VQwBPM.

Definition at line 1141 of file QwCombinedBPM.cc.

1142 {
1143  std::vector <QwErrDBInterface> row_list;
1144  row_list.clear();
1145  for(size_t axis=kXAxis;axis<kNumAxes;axis++) {
1146  fAbsPos[axis].AddErrEntriesToList(row_list);
1147  fSlope[axis].AddErrEntriesToList(row_list);
1148  fIntercept[axis].AddErrEntriesToList(row_list);
1149  fMinimumChiSquare[axis].AddErrEntriesToList(row_list);
1150  }
1151  // fEffectiveCharge.AddErrEntriesToList(row_list);
1152  return row_list;
1153 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
UInt_t QwCombinedBPM< T >::GetEventcutErrorFlag ( )
virtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 175 of file QwCombinedBPM.cc.

176 {
177  UInt_t error=0;
178  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
179  error|=fAbsPos[axis].GetEventcutErrorFlag();
180  error|=fSlope[axis].GetEventcutErrorFlag();
181  error|=fIntercept[axis].GetEventcutErrorFlag();
182  error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
183  }
184 
185  error|=fEffectiveCharge.GetEventcutErrorFlag();
186  return error;
187 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T>
const VQwHardwareChannel* QwCombinedBPM< T >::GetPosition ( EBeamPositionMonitorAxis  axis) const
inlinevirtual

Implements VQwBPM.

Definition at line 77 of file QwCombinedBPM.h.

References VQwBPM::axis, QwCombinedBPM< T >::fAbsPos, and VQwDataElement::GetElementName().

77  {
78  if (axis<0 || axis>2){
79  TString loc="QwLinearDiodeArray::GetPosition for "
80  +this->GetElementName()+" failed for axis value "+Form("%d",axis);
81  throw std::out_of_range(loc.Data());
82  }
83  return &fAbsPos[axis];
84  }
static const TString axis[3]
Definition: VQwBPM.h:260
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

template<typename T>
const VQwHardwareChannel* QwCombinedBPM< T >::GetSlope ( EBeamPositionMonitorAxis  axis) const
inline

Definition at line 86 of file QwCombinedBPM.h.

References VQwBPM::axis, QwCombinedBPM< T >::fSlope, and VQwDataElement::GetElementName().

86  {
87  if (axis<0 || axis>2){
88  TString loc="QwLinearDiodeArray::GetPosition for "
89  +this->GetElementName()+" failed for axis value "+Form("%d",axis);
90  throw std::out_of_range(loc.Data());
91  }
92  return &fSlope[axis];
93  }
static const TString axis[3]
Definition: VQwBPM.h:260
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

template<typename T >
VQwHardwareChannel * QwCombinedBPM< T >::GetSubelementByName ( TString  ch_name)
protectedvirtual

Implements VQwBPM.

Definition at line 321 of file QwCombinedBPM.cc.

322 {
323  VQwHardwareChannel* tmpptr = NULL;
324  ch_name.ToLower();
325  if (ch_name=="xslope"){
326  tmpptr = &fSlope[kXAxis];
327  }else if (ch_name=="yslope"){
328  tmpptr = &fSlope[kYAxis];
329  }else if (ch_name=="xintercept"){
330  tmpptr = &fIntercept[kXAxis];
331  }else if (ch_name=="yintercept"){
332  tmpptr = &fIntercept[kYAxis];
333  }else if (ch_name=="xminchisquare"){
334  tmpptr = &fMinimumChiSquare[kXAxis];
335  }else if (ch_name=="yminchisquare"){
336  tmpptr = &fMinimumChiSquare[kYAxis];
337  }else if (ch_name=="absx" || ch_name=="x" ){
338  tmpptr = &fAbsPos[kXAxis];
339  }else if (ch_name=="absy" || ch_name=="y"){
340  tmpptr = &fAbsPos[kYAxis];
341  }else if (ch_name=="effectivecharge" || ch_name=="charge"){
342  tmpptr = &fEffectiveCharge;
343  } else {
344  TString loc="QwCombinedBPM::GetSubelementByName for"
345  + this->GetElementName() + " was passed "
346  + ch_name + ", which is an unrecognized subelement name.";
347  throw std::invalid_argument(loc.Data());
348  }
349  return tmpptr;
350 }
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwCombinedBPM< T >::IncrementErrorCounters ( )
virtual

Implements VQwBPM.

Definition at line 149 of file QwCombinedBPM.cc.

150 {
151  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
152  fAbsPos[axis].IncrementErrorCounters();
153  fSlope[axis].IncrementErrorCounters();
154  fIntercept[axis].IncrementErrorCounters();
155  fMinimumChiSquare[axis].IncrementErrorCounters();
156  }
157 
158  fEffectiveCharge.IncrementErrorCounters();
159 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::InitializeChannel ( TString  name)

Definition at line 21 of file QwCombinedBPM.cc.

References VQwBPM::InitializeChannel(), and Qw::m.

Referenced by QwCombinedBPM< T >::InitializeChannel(), and QwCombinedBPM< T >::QwCombinedBPM().

22 {
23 
25 
26  fEffectiveCharge.InitializeChannel(name+"_EffectiveCharge","derived");
27 
28  for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
29  fAbsPos[axis].InitializeChannel(name+kAxisLabel[axis],"derived");
30  fSlope[axis].InitializeChannel(name+kAxisLabel[axis]+"Slope","derived");
31  fIntercept[axis].InitializeChannel(name+kAxisLabel[axis]+"Intercept","derived");
32  fMinimumChiSquare[axis].InitializeChannel(name+kAxisLabel[axis]+"MinChiSquare","derived");
33  }
34 
35  fixedParamCalculated = false;
36 
37  fElement.clear();
38  fQWeights.clear();
39  fXWeights.clear();
40  fYWeights.clear();
41 
42  fSumQweights = 0.0;
43 
44  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
45  erra[axis] = 0.0;
46  errb[axis] = 0.0;
47  covab[axis] = 0.0;
48  A[axis] = 0.0;
49  B[axis] = 0.0;
50  D[axis] = 0.0;
51  m[axis] = 0.0;
52  }
53 
54  return;
55 }
Double_t covab[2]
std::vector< Double_t > fXWeights
Double_t fSumQweights
static const TString kAxisLabel[2]
Definition: VQwBPM.h:239
Double_t m[2]
Bool_t fixedParamCalculated
static const TString axis[3]
Definition: VQwBPM.h:260
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
Double_t D[2]
Double_t errb[2]
T fMinimumChiSquare[2]
Double_t A[2]
Double_t B[2]
std::vector< const VQwBPM * > fElement
std::vector< Double_t > fQWeights
Double_t erra[2]
std::vector< Double_t > fYWeights

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void QwCombinedBPM< T >::InitializeChannel ( TString  subsystem,
TString  name 
)

Definition at line 58 of file QwCombinedBPM.cc.

References VQwBPM::InitializeChannel(), and Qw::m.

59 {
60 
62 
63  fEffectiveCharge.InitializeChannel(subsystem, "QwCombinedBPM", name+"_EffectiveCharge","derived");
64 
65  for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
66  fAbsPos[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis],"derived");
67  fSlope[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis]+"Slope","derived");
68  fIntercept[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis]+"Intercept","derived");
69  fMinimumChiSquare[axis].InitializeChannel(subsystem, "QwCombinedBPM",name+kAxisLabel[axis]+"MinChiSquare","derived");
70  }
71 
72  fixedParamCalculated = false;
73 
74  fElement.clear();
75  fQWeights.clear();
76  fXWeights.clear();
77  fYWeights.clear();
78 
79  fSumQweights = 0.0;
80 
81  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
82  erra[axis] = 0.0;
83  errb[axis] = 0.0;
84  covab[axis] = 0.0;
85  A[axis] = 0.0;
86  B[axis] = 0.0;
87  D[axis] = 0.0;
88  m[axis] = 0.0;
89  }
90 
91  return;
92 }
Double_t covab[2]
std::vector< Double_t > fXWeights
Double_t fSumQweights
static const TString kAxisLabel[2]
Definition: VQwBPM.h:239
Double_t m[2]
Bool_t fixedParamCalculated
static const TString axis[3]
Definition: VQwBPM.h:260
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
Double_t D[2]
Double_t errb[2]
T fMinimumChiSquare[2]
Double_t A[2]
Double_t B[2]
std::vector< const VQwBPM * > fElement
std::vector< Double_t > fQWeights
Double_t erra[2]
std::vector< Double_t > fYWeights

+ Here is the call graph for this function:

template<typename T>
void QwCombinedBPM< T >::InitializeChannel ( TString  subsystem,
TString  name,
TString  type 
)
inline

Definition at line 63 of file QwCombinedBPM.h.

References QwCombinedBPM< T >::InitializeChannel(), and VQwDataElement::SetModuleType().

63  {
64  SetModuleType(type);
65  InitializeChannel(subsystem, name);
66  }
void InitializeChannel(TString name)
void SetModuleType(TString ModuleType)
set the type of the beam instrument

+ Here is the call graph for this function:

template<typename T >
void QwCombinedBPM< T >::LeastSquareFit ( VQwBPM::EBeamPositionMonitorAxis  axis,
std::vector< Double_t >  fWeights 
)
protected

REF : W.R Leo

For Y = aX +b

A = sigma(X * Wy) B = sigma(Wy) C = sigma(Y*Wy) D = sigma(X *X * Wy) E = sigma(X*Y*Wy) F = sigma(Y * Y *Wy)

then a = (EB-CA)/(DB-AA) b =(DC-EA)/(DB-AA)

Definition at line 604 of file QwCombinedBPM.cc.

References Qw::T.

605  {
606 
607  /**
608  REF : W.R Leo
609 
610  For Y = aX +b
611 
612  A = sigma(X * Wy) B = sigma(Wy) C = sigma(Y*Wy) D = sigma(X *X * Wy) E = sigma(X*Y*Wy) F = sigma(Y * Y *Wy)
613 
614  then
615  a = (EB-CA)/(DB-AA) b =(DC-EA)/(DB-AA)
616  **/
617 
618  Bool_t ldebug = kFALSE;
619  static Double_t zpos = 0;
620  static T tmp1("tmp1","derived");
621  static T tmp2("tmp2","derived");
622  static T tmp3("tmp3","derived");
623  static T C[kNumAxes];
624  static T E[kNumAxes];
625 
626  // initialize the VQWK_Channel arrays
627  C[kXAxis].InitializeChannel("cx","derived");
628  C[kYAxis].InitializeChannel("cy","derived");
629  E[kXAxis].InitializeChannel("ex","derived");
630  E[kYAxis].InitializeChannel("ey","derived");
631 
632  C[axis].ClearEventData();
633  E[axis].ClearEventData();
634  for(size_t i=0;i<fElement.size();i++){
635  zpos = fElement[i]->GetPositionInZ();
636  tmp1.ClearEventData();
637  tmp1.AssignValueFrom(fElement[i]->GetPosition(axis));
638  tmp1.Scale(fWeights[i]);
639  C[axis] += tmp1; //xw or yw
640  tmp1.Scale(zpos);//xzw or yzw
641  E[axis] += tmp1;
642  }
643 
644  if(ldebug) std::cout<<"\n A ="<<A[axis]
645  <<" -- B ="<<B[axis]
646  <<" --C ="<<C[axis].GetValue()
647  <<" --D ="<<D[axis]
648  <<" --E ="<<E[axis].GetValue()<<"\n";
649 
650  // calculate the slope a = E*erra + C*covab
651  fSlope[axis].AssignScaledValue(E[axis], erra[axis]);
652  tmp2.AssignScaledValue(C[axis], covab[axis]);
653  fSlope[axis] += tmp2;
654 
655  // calculate the intercept b = C*errb + E*covab
656  fIntercept[axis].AssignScaledValue(C[axis], errb[axis]);
657  tmp2.AssignScaledValue(E[axis], covab[axis]);
658  fIntercept[axis] += tmp2;
659 
660  if(ldebug) std::cout<<" Least Squares Fit Parameters for "<< axis
661  <<" are: \n slope = "<< fSlope[axis].GetValue()
662  <<" \n intercept = " << fIntercept[axis].GetValue()<<"\n\n";
663 
664 
665  // absolute positions at target using X = Za + b
666  tmp1.ClearEventData();
667  // Absolute position of the combined bpm is not a physical position but a derived one.
668 
669 
670  zpos = this->GetPositionInZ();
671  //UInt_t err_flag=fAbsPos[axis].GetEventcutErrorFlag();
672  fAbsPos[axis] = fIntercept[axis]; // X = b
673  //fAbsPos[axis].ResetErrorFlag(err_flag);
674  tmp1.AssignScaledValue(fSlope[axis],zpos); //az
675  fAbsPos[axis] += tmp1; //X = az+b
676 
677 
678  // to perform the minimul chi-square test
679  // We want to calculte (X-az-b)^2 for each bpm in the combination and sum over the values
680  tmp3.ClearEventData();
681  fMinimumChiSquare[axis].ClearEventData();
682 
683  for(size_t i=0;i<fElement.size();i++){
684  tmp1.ClearEventData();
685  tmp2.ClearEventData();
686  //std::cout<<"\nName -------- ="<<(fElement[i]->GetElementName())<<std::endl;
687  //std::cout<<"\nRead value ="<<(fElement[i]->GetPosition(axis))->GetValue()<<std::endl;
688 
689  tmp1.AssignValueFrom(fElement[i]->GetPosition(axis)); // = X
690  //std::cout<<"Read value ="<<tmp1.GetValue()<<std::endl;
691 
692  tmp2.AssignScaledValue(fSlope[axis],fElement[i]->GetPositionInZ());
693  tmp2+=fIntercept[axis];
694  //std::cout<<"Calculated abs value ="<<tmp2.GetValue()<<std::endl;
695 
696  tmp1 -= tmp2; // = X-Za-b
697  //std::cout<<"Read-calculated ="<<tmp1.GetValue()<<std::endl;
698  tmp1.Product(tmp1,tmp1); // = (X-Za-b)^2
699  //std::cout<<"(Read-calculated)^2 ="<<tmp1.GetValue()<<std::endl;
700  tmp1.Scale(fWeights[i]*fWeights[i]); // = [(X-Za-b)^2]W
701  //std::cout<<"(Read-calculated)^2/weight ="<<tmp1.GetValue()<<std::endl;
702  tmp3+=tmp1; //sum over
703  //std::cout<<"Sum (Read-calculated)^2/weight +="<<tmp3.GetValue()<<std::endl;
704  }
705 
706  fMinimumChiSquare[axis].AssignScaledValue(tmp3,1.0/(fElement.size()-2)); //minimul chi-square
707 
708  return;
709  }
Double_t covab[2]
Double_t GetPositionInZ() const
Definition: VQwBPM.h:132
const VQwHardwareChannel * GetPosition(EBeamPositionMonitorAxis axis) const
Definition: QwCombinedBPM.h:77
static const TString axis[3]
Definition: VQwBPM.h:260
static const double T
Magnetic field: base unit is T.
Definition: QwUnits.h:111
Double_t D[2]
Double_t errb[2]
T fMinimumChiSquare[2]
Double_t A[2]
Double_t B[2]
std::vector< const VQwBPM * > fElement
Double_t erra[2]
template<typename T>
void QwCombinedBPM< T >::LoadChannelParameters ( QwParameterFile paramfile)
inlinevirtual

Implements VQwBPM.

Definition at line 68 of file QwCombinedBPM.h.

68 {};
template<typename T >
void QwCombinedBPM< T >::MakeBPMComboList ( )
private

Definition at line 1100 of file QwCombinedBPM.cc.

References Qw::T.

1101 {
1102  for (size_t axis = kXAxis; axis < kNumAxes; axis++) {
1103  T abspos(fAbsPos[axis]);
1104  abspos = fAbsPos[axis];
1105  fBPMComboElementList.push_back(abspos);
1106  T slope(fSlope[axis]);
1107  slope = fSlope[axis];
1108  fBPMComboElementList.push_back(slope);
1109  T intercept(fIntercept[axis]);
1110  intercept = fIntercept[axis];
1111  fBPMComboElementList.push_back(intercept);
1112  T minimumchisquare(fMinimumChiSquare[axis]);
1113  minimumchisquare = fMinimumChiSquare[axis];
1114  fBPMComboElementList.push_back(minimumchisquare);
1115  }
1116  T effectivecharge(fEffectiveCharge);
1117  effectivecharge = fEffectiveCharge;
1118  fBPMComboElementList.push_back(effectivecharge);
1119 }
static const TString axis[3]
Definition: VQwBPM.h:260
static const double T
Magnetic field: base unit is T.
Definition: QwUnits.h:111
T fMinimumChiSquare[2]
std::vector< T > fBPMComboElementList
template<typename T >
VQwBPM & QwCombinedBPM< T >::operator+= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 786 of file QwCombinedBPM.cc.

787 {
788  *(dynamic_cast<QwCombinedBPM<T>*>(this))+=
789  *(dynamic_cast<const QwCombinedBPM<T>*>(&value));
790  return *this;
791 }
template<typename T >
QwCombinedBPM< T > & QwCombinedBPM< T >::operator+= ( const QwCombinedBPM< T > &  value)
virtual

Definition at line 794 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, and QwCombinedBPM< T >::fSlope.

795 {
796 
797  if (this->GetElementName()!=""){
798  this->fEffectiveCharge+=value.fEffectiveCharge;
799  for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
800  this->fSlope[axis]+=value.fSlope[axis];
801  this->fIntercept[axis]+=value.fIntercept[axis];
802  this->fAbsPos[axis]+=value.fAbsPos[axis];
804  }
805  }
806  return *this;
807 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
VQwBPM & QwCombinedBPM< T >::operator-= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 810 of file QwCombinedBPM.cc.

811 {
812  *(dynamic_cast<QwCombinedBPM<T>*>(this))-=
813  *(dynamic_cast<const QwCombinedBPM<T>*>(&value));
814  return *this;
815 }
template<typename T >
QwCombinedBPM< T > & QwCombinedBPM< T >::operator-= ( const QwCombinedBPM< T > &  value)
virtual

Definition at line 819 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, and QwCombinedBPM< T >::fSlope.

820 {
821 
822  if (this->GetElementName()!=""){
823  this->fEffectiveCharge-=value.fEffectiveCharge;
824  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
825  this->fSlope[axis]-=value.fSlope[axis];
826  this->fIntercept[axis]-=value.fIntercept[axis];
827  this->fAbsPos[axis]-=value.fAbsPos[axis];
829  }
830  }
831  return *this;
832 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
VQwBPM & QwCombinedBPM< T >::operator= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 761 of file QwCombinedBPM.cc.

762 {
763  *(dynamic_cast<QwCombinedBPM<T>*>(this))=
764  *(dynamic_cast<const QwCombinedBPM<T>*>(&value));
765  return *this;
766 }
template<typename T >
QwCombinedBPM< T > & QwCombinedBPM< T >::operator= ( const QwCombinedBPM< T > &  value)
virtual

Definition at line 769 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, QwCombinedBPM< T >::fSlope, and VQwBPM::operator=().

770 {
771  VQwBPM::operator= (value);
772  if (this->GetElementName()!=""){
774  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
775  this->fSlope[axis]=value.fSlope[axis];
776  this->fIntercept[axis] = value.fIntercept[axis];
777  this->fAbsPos[axis]=value.fAbsPos[axis];
779  }
780  }
781  return *this;
782 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition: VQwBPM.cc:115

+ Here is the call graph for this function:

template<typename T >
void QwCombinedBPM< T >::PrintErrorCounters ( ) const
virtual

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

Reimplemented from VQwBPM.

Definition at line 162 of file QwCombinedBPM.cc.

163 {
164  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
165  fAbsPos[axis].PrintErrorCounters();
166  fSlope[axis].PrintErrorCounters();
167  fIntercept[axis].PrintErrorCounters();
168  fMinimumChiSquare[axis].PrintErrorCounters();
169  }
170 
171  fEffectiveCharge.PrintErrorCounters();
172 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

TODO: To print the Z position, we need to use GetPositionInZ()

Reimplemented from VQwBPM.

Definition at line 740 of file QwCombinedBPM.cc.

741 {
742 
743  Short_t axis;
744 
745  for(axis = kXAxis; axis < kNumAxes; axis++){
746  fAbsPos[axis].PrintInfo();
747  }
748  /// TODO: To print the Z position, we need to use GetPositionInZ()
749  for(axis = kXAxis; axis < kNumAxes; axis++) {
750  fSlope[axis].PrintInfo();
751  fIntercept[axis].PrintInfo();
752  fMinimumChiSquare[axis].PrintInfo();
753  }
754  fEffectiveCharge.PrintInfo();
755 
756  return;
757 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::PrintValue ( ) const
virtual

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

TODO: To print the Z position, we need to use GetPositionInZ()

Reimplemented from VQwDataElement.

Definition at line 720 of file QwCombinedBPM.cc.

721 {
722  Short_t axis;
723 
724  for(axis = kXAxis; axis < kNumAxes; axis++){
725  fAbsPos[axis].PrintValue();
726  }
727  /// TODO: To print the Z position, we need to use GetPositionInZ()
728  for(axis = kXAxis; axis < kNumAxes; axis++) {
729  fSlope[axis].PrintValue();
730  fIntercept[axis].PrintValue();
731  fMinimumChiSquare[axis].PrintValue();
732  }
733  fEffectiveCharge.PrintValue();
734 
735  return;
736  }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
Int_t QwCombinedBPM< T >::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement 
)
virtual

Process the CODA event buffer for this element.

Implements VQwDataElement.

Definition at line 712 of file QwCombinedBPM.cc.

713  {
714  return word_position_in_buffer;
715  }
template<typename T >
void QwCombinedBPM< T >::ProcessEvent ( )
virtual

Implements VQwBPM.

Definition at line 456 of file QwCombinedBPM.cc.

References Qw::T.

457 {
458  Bool_t ldebug = kFALSE;
459 
460  static T tmpQADC("tmpQADC"), tmpADC("tmpADC");
461 
462  //check to see if the fixed parameters are calculated
464  if(ldebug) std::cout<<"QwCombinedBPM:Calculating fixed parameters..\n";
467  fixedParamCalculated = kTRUE;
468  }
469 
470  for(size_t i=0;i<fElement.size();i++){
471  if(ldebug){
472  std::cout<<"*******************************\n";
473  std::cout<<" QwCombinedBPM: Reading "<<fElement[i]->GetElementName()<<" with charge weight ="<<fQWeights[i]
474  <<" and x weight ="<<fXWeights[i]
475  <<" and y weight ="<<fYWeights[i]<<"\n"<<std::flush;
476 
477  }
478  tmpQADC.AssignValueFrom(fElement[i]->GetEffectiveCharge());
479  tmpQADC.Scale(fQWeights[i]);
480  fEffectiveCharge+=tmpQADC;
481 
482 
483  if(ldebug) {
484  std::cout<<"fElement[" << i << "]->GetEffectiveCharge()=="
485  << fElement[i]->GetEffectiveCharge()
486  << std::endl << std::flush;
487  fElement[i]->GetEffectiveCharge()->PrintInfo();
488  std::cout<<"fElement[" << i << "]->GetPosition(kXAxis)=="
489  << fElement[i]->GetPosition(kXAxis)
490  << std::endl << std::flush;
491  std::cout<<"fElement[" << i << "]->GetPosition(kYAxis)=="
492  << fElement[i]->GetPosition(kYAxis)
493  << std::endl << std::flush;
494 
495  if (fElement[i]->GetEffectiveCharge()==NULL){
496  std::cout<<"fElement[" << i << "]->GetEffectiveCharge returns NULL"
497  << std::endl;
498  } else
499  std::cout<<"got 4-wire.hw_sum = "<<fEffectiveCharge.GetValue()
500  <<" vs actual "
501  << fElement[i]->GetEffectiveCharge()->GetValue()
502  << std::endl << std::flush;
503 
504 
505  std::cout<<"copied absolute X position hw_sum from device "
506  << fElement[i]->GetPosition(kXAxis)->GetValue() <<std::endl;
507  std::cout<<"copied absolute Y position hw_sum from device "
508  << fElement[i]->GetPosition(kYAxis)->GetValue() <<std::endl;
509 
510  }
511  }
512 
513  fEffectiveCharge.Scale(1.0/fSumQweights);
514  //fAbsPos[0].ResetErrorFlag(0x4000000);
515  //Least squares fit for X
517 
518  //Least squares fit for Y
520 
521 
522  if(ldebug){
523  std::cout<<" QwCombinedBPM:: Projected target X position = "<<fAbsPos[kXAxis].GetValue()
524  <<" and target X slope = "<<fSlope[kXAxis].GetValue()
525  <<" and target X intercept = "<<fIntercept[kXAxis].GetValue()
526  <<" with mimimum chi square = "<< fMinimumChiSquare[kXAxis].GetValue()
527  <<" \nProjected target Y position = "<<fAbsPos[kYAxis].GetValue()
528  <<" and target Y slope = "<<fSlope[kYAxis].GetValue()
529  <<" and target Y intercept = "<<fIntercept[kYAxis].GetValue()
530  <<" with mimimum chi square = "<< fMinimumChiSquare[kYAxis].GetValue()<<std::endl;
531 
532  }
533 
534 
535  if (ldebug) {
536  fEffectiveCharge.PrintInfo();
537  for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
538  fAbsPos[axis].PrintInfo();
539  fSlope[axis].PrintInfo();
540  fIntercept[axis].PrintInfo();
541  fMinimumChiSquare[axis].PrintInfo();
542  }
543  }
544 
545  return;
546 
547  }
std::vector< Double_t > fXWeights
Double_t fSumQweights
void CalculateFixedParameter(std::vector< Double_t > fWeights, Int_t pos)
Bool_t fixedParamCalculated
void LeastSquareFit(VQwBPM::EBeamPositionMonitorAxis axis, std::vector< Double_t > fWeights)
static const TString axis[3]
Definition: VQwBPM.h:260
static const double T
Magnetic field: base unit is T.
Definition: QwUnits.h:111
T fMinimumChiSquare[2]
const VQwHardwareChannel * GetEffectiveCharge() const
Definition: QwCombinedBPM.h:94
std::vector< const VQwBPM * > fElement
std::vector< Double_t > fQWeights
std::vector< Double_t > fYWeights
template<typename T >
void QwCombinedBPM< T >::Ratio ( QwCombinedBPM< T > &  numer,
QwCombinedBPM< T > &  denom 
)

Definition at line 843 of file QwCombinedBPM.cc.

References QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, QwCombinedBPM< T >::fSlope, and QwCombinedBPM< T >::Ratio().

Referenced by QwCombinedBPM< T >::Ratio().

845 {
846  // this function is called when forming asymmetries. In this case waht we actually want for the
847  // combined bpm is the difference only not the asymmetries
848 
849  *this=numer;
850  this->fEffectiveCharge.Ratio(numer.fEffectiveCharge,denom.fEffectiveCharge);
851  if (this->GetElementName()!=""){
852  // The slope, intercept and absolute positions should all be differences, not asymmetries.
853  for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
854  this->fSlope[axis] = numer.fSlope[axis];
855  this->fIntercept[axis] = numer.fIntercept[axis];
856  this->fAbsPos[axis] = numer.fAbsPos[axis];
858  }
859  }
860 
861  return;
862 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void QwCombinedBPM< T >::Ratio ( VQwBPM numer,
VQwBPM denom 
)
virtual

Reimplemented from VQwBPM.

Definition at line 836 of file QwCombinedBPM.cc.

837 {
838  Ratio(*dynamic_cast<QwCombinedBPM<T>*>(&numer),
839  *dynamic_cast<QwCombinedBPM<T>*>(&denom));
840 }
void Ratio(QwCombinedBPM &numer, QwCombinedBPM &denom)
template<typename T >
void QwCombinedBPM< T >::Scale ( Double_t  factor)
virtual

Reimplemented from VQwBPM.

Definition at line 866 of file QwCombinedBPM.cc.

867 {
868  fEffectiveCharge.Scale(factor);
869  for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
870  fSlope[axis].Scale(factor);
871  fIntercept[axis].Scale(factor);
872  fAbsPos[axis].Scale(factor);
873  fMinimumChiSquare[axis].Scale(factor);
874  }
875  return;
876 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
void QwCombinedBPM< T >::SetBPMForCombo ( const VQwBPM bpm,
Double_t  charge_weight,
Double_t  x_weight,
Double_t  y_weight,
Double_t  sumqw 
)
virtual

Reimplemented from VQwBPM.

Definition at line 111 of file QwCombinedBPM.cc.

113 {
114  fElement.push_back(bpm);
115  fQWeights.push_back(charge_weight);
116  fXWeights.push_back(x_weight);
117  fYWeights.push_back(y_weight);
118  fSumQweights=sumqw;
119 
120  size_t i = fElement.size();
121  if (i>=1){
122  i--;
123  // std::cout << "+++++++++++++++++++++++++++\n+++++++++++++++++++++++++++\n" << std::endl;
124  // std::cout << "fElement.size()==" << fElement.size() << " " << i << " "
125  // << fElement.at(i)->GetElementName() << " "
126  // << fQWeights.at(i) << " "
127  // << fXWeights.at(i) << " "
128  // << fYWeights.at(i) << " "
129  // << "fElement.at(i)->GetEffectiveCharge()==" << fElement.at(i)->GetEffectiveCharge() << " "
130  // << std::endl;
131  // fElement.at(i)->GetEffectiveCharge()->PrintInfo();
132  // fElement.at(i)->PrintInfo();
133  }
134  return;
135 
136 }
std::vector< Double_t > fXWeights
Double_t fSumQweights
std::vector< const VQwBPM * > fElement
std::vector< Double_t > fQWeights
std::vector< Double_t > fYWeights
template<typename T >
void QwCombinedBPM< T >::SetEventCutMode ( Int_t  bcuts)
virtual

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

Implements VQwBPM.

Definition at line 1083 of file QwCombinedBPM.cc.

1084 {
1085 
1086  // bEVENTCUTMODE=bcuts;
1087  for (Short_t axis=kXAxis;axis<kNumAxes;axis++){
1088  fSlope[axis].SetEventCutMode(bcuts);
1089  fIntercept[axis].SetEventCutMode(bcuts);
1090  fAbsPos[axis].SetEventCutMode(bcuts);
1091  fMinimumChiSquare[axis].SetEventCutMode(bcuts);
1092  }
1093  fEffectiveCharge.SetEventCutMode(bcuts);
1094 
1095  return;
1096 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
template<typename T >
Double_t QwCombinedBPM< T >::SumOver ( std::vector< Double_t >  weight,
std::vector< T >  val 
)
protected

Definition at line 585 of file QwCombinedBPM.cc.

586  {
587  Double_t sum = 0.0;
588  if(weight.size()!=fElement.size()){
589  std::cout
590  <<"QwCombinedBPM:: Number of devices doesnt match the number of weights."
591  <<" Exiting calculating parameters for the least squares fit"
592  <<std::endl;
593  }
594  else{
595  for(size_t i=0;i<weight.size();i++){
596  val[i].Scale(weight[i]);
597  sum+=val[i].GetValue();
598  }
599  }
600  return sum;
601  }
std::vector< const VQwBPM * > fElement
template<typename T >
UInt_t QwCombinedBPM< T >::UpdateErrorFlag ( )
virtual

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

Implements VQwBPM.

Definition at line 278 of file QwCombinedBPM.cc.

Referenced by QwCombinedBPM< T >::UpdateErrorFlag().

279 {
280  Int_t axis=0;
281  UInt_t charge_error;
282  UInt_t pos_error[2];
283  charge_error = 0;
284  pos_error[kXAxis]=0;
285  pos_error[kYAxis]=0;
286 
287  UInt_t error = 0;
288 
289  for(size_t i=0;i<fElement.size();i++){
290  //To update the event cut faliures in individual BPM devices
291  charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
292  pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
293  pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
294  }
295 
296  //Event cuts for X & Y slopes
297  for(axis=kXAxis;axis<kNumAxes;axis++){
298  fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
299  fSlope[axis].UpdateErrorFlag(pos_error[axis]);
300  fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
301  fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
302 
303  //Get the Event cut error flag for SlopeX/Y
304  error|=fSlope[axis].GetEventcutErrorFlag();
305  error|=fIntercept[axis].GetEventcutErrorFlag();
306  error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
307  error|=fAbsPos[axis].GetEventcutErrorFlag();
308 
309  }
310 
311  //Event cuts for four wire sum (EffectiveCharge)
312  fEffectiveCharge.UpdateErrorFlag(charge_error);
313  //Get the Event cut error flag for EffectiveCharge
314  error|=fEffectiveCharge.GetEventcutErrorFlag();
315 
316  return error;
317 }
static const TString axis[3]
Definition: VQwBPM.h:260
T fMinimumChiSquare[2]
std::vector< const VQwBPM * > fElement

+ Here is the caller graph for this function:

template<typename T >
void QwCombinedBPM< T >::UpdateErrorFlag ( const VQwBPM ev_error)
virtual

Implements VQwBPM.

Definition at line 427 of file QwCombinedBPM.cc.

References Qw::e, QwCombinedBPM< T >::fAbsPos, QwCombinedBPM< T >::fEffectiveCharge, QwCombinedBPM< T >::fIntercept, QwCombinedBPM< T >::fMinimumChiSquare, QwCombinedBPM< T >::fSlope, VQwDataElement::GetElementName(), and QwCombinedBPM< T >::UpdateErrorFlag().

427  {
428  Short_t i=0;
429  try {
430  if(typeid(*ev_error)==typeid(*this)) {
431  // std::cout<<" Here in QwBPMStripline::UpdateErrorFlag \n";
432  if (this->GetElementName()!="") {
433  const QwCombinedBPM<T>* value_bpm = dynamic_cast<const QwCombinedBPM<T>* >(ev_error);
434  for(i=kXAxis;i<kNumAxes;i++) {
435  fAbsPos[i].UpdateErrorFlag(value_bpm->fAbsPos[i]);
436  fSlope[i].UpdateErrorFlag(value_bpm->fSlope[i]);
437  fIntercept[i].UpdateErrorFlag(value_bpm->fIntercept[i]);
438  fMinimumChiSquare[i].UpdateErrorFlag(value_bpm->fMinimumChiSquare[i]);
439  }
440  fEffectiveCharge.UpdateErrorFlag(value_bpm->fEffectiveCharge);
441  }
442  } else {
443  TString loc="Standard exception from QwCombinedBPM::UpdateErrorFlag :"+
444  ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
445  +"same type";
446  throw std::invalid_argument(loc.Data());
447  }
448  } catch (std::exception& e) {
449  std::cerr<< e.what()<<std::endl;
450  }
451 };
static const double e
Definition: QwUnits.h:91
T fMinimumChiSquare[2]
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

Friends And Related Function Documentation

template<typename T>
friend class QwEnergyCalculator
friend

Definition at line 32 of file QwCombinedBPM.h.

Field Documentation

template<typename T>
Double_t QwCombinedBPM< T >::A[2]
private

Definition at line 180 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::B[2]
private

Definition at line 180 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::chi_square[2]
private

Definition at line 181 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::covab[2]
private

Definition at line 179 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::D[2]
private

Definition at line 180 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::erra[2]
private

Definition at line 179 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::errb[2]
private

Definition at line 179 of file QwCombinedBPM.h.

template<typename T>
std::vector<T> QwCombinedBPM< T >::fBPMComboElementList
private

Definition at line 208 of file QwCombinedBPM.h.

template<typename T>
std::vector<const VQwBPM*> QwCombinedBPM< T >::fElement
private

Definition at line 184 of file QwCombinedBPM.h.

template<typename T>
Bool_t QwCombinedBPM< T >::fixedParamCalculated
private

Definition at line 176 of file QwCombinedBPM.h.

template<typename T>
std::vector<Double_t> QwCombinedBPM< T >::fQWeights
private

Definition at line 185 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::fSumQweights
private

Definition at line 182 of file QwCombinedBPM.h.

template<typename T>
std::vector<Double_t> QwCombinedBPM< T >::fXWeights
private

Definition at line 186 of file QwCombinedBPM.h.

template<typename T>
std::vector<Double_t> QwCombinedBPM< T >::fYWeights
private

Definition at line 187 of file QwCombinedBPM.h.

template<typename T>
Double_t QwCombinedBPM< T >::m[2]
private

Definition at line 180 of file QwCombinedBPM.h.


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