QwAnalysis
QwLinearDiodeArray Class Reference

#include <QwLinearDiodeArray.h>

+ Inheritance diagram for QwLinearDiodeArray:
+ Collaboration diagram for QwLinearDiodeArray:

Public Member Functions

 QwLinearDiodeArray ()
 
 QwLinearDiodeArray (TString name)
 
 QwLinearDiodeArray (TString subsystemname, TString name)
 
 QwLinearDiodeArray (const QwLinearDiodeArray &source)
 
virtual ~QwLinearDiodeArray ()
 
void InitializeChannel (TString name)
 
void InitializeChannel (TString subsystem, TString name)
 
void ClearEventData ()
 Clear the event data in this element. More...
 
void LoadChannelParameters (QwParameterFile &paramfile)
 
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 VQwHardwareChannelGetEffectiveCharge () const
 
TString GetSubElementName (Int_t subindex)
 
UInt_t SetSubElementName (TString subname)
 
void GetAbsolutePosition ()
 
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 SetDefaultSampleSize (Int_t sample_size)
 
void SetRandomEventParameters (Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
 
void RandomizeEventData (int helicity=0, double time=0.0)
 
void SetEventData (Double_t *block, UInt_t sequencenumber)
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
void SetSubElementPedestal (Int_t j, Double_t value)
 
void SetSubElementCalibrationFactor (Int_t j, Double_t value)
 
void Ratio (QwLinearDiodeArray &numer, QwLinearDiodeArray &denom)
 
void Scale (Double_t factor)
 
VQwBPMoperator= (const VQwBPM &value)
 
VQwBPMoperator+= (const VQwBPM &value)
 
VQwBPMoperator-= (const VQwBPM &value)
 
virtual QwLinearDiodeArrayoperator= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArrayoperator+= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArrayoperator-= (const QwLinearDiodeArray &value)
 
void AccumulateRunningSum (const QwLinearDiodeArray &value)
 
void AccumulateRunningSum (const VQwBPM &value)
 
void DeaccumulateRunningSum (QwLinearDiodeArray &value)
 
void DeaccumulateRunningSum (VQwBPM &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
 
std::vector< QwDBInterfaceGetDBEntry ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
void MakeLinearArrayList ()
 
- 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 void Ratio (VQwBPM &numer, VQwBPM &denom)
 
virtual const VQwHardwareChannelGetAngleX () const
 
virtual const VQwHardwareChannelGetAngleY () const
 
virtual void SetBPMForCombo (const VQwBPM *bpm, Double_t charge_weight, Double_t x_weight, Double_t y_weight, Double_t sumqw)
 
- 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...
 

Static Public Member Functions

static UInt_t GetSubElementIndex (TString subname)
 
- 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)
 

Protected Member Functions

VQwHardwareChannelGetSubelementByName (TString ch_name)
 
- 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

QwVQWK_Channel fPhotodiode [8]
 
QwVQWK_Channel fRelPos [2]
 
QwVQWK_Channel fAbsPos [2]
 
QwVQWK_Channel fEffectiveCharge
 
std::vector< QwVQWK_ChannelfLinearArrayElementList
 
- 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...
 

Static Private Attributes

static const size_t kMaxElements = 8
 
static const TString subelement [8] ={"p1","p2","p3","p4","p5","p6","p7","p8"}
 
static const Double_t kQwLinearDiodeArrayPadSize = 1.57
 

Additional Inherited Members

- Public Types inherited from VQwBPM
enum  EBeamPositionMonitorAxis { kXAxis =0, kYAxis, kNumAxes }
 
- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 
- 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

Definition at line 32 of file QwLinearDiodeArray.h.

Constructor & Destructor Documentation

QwLinearDiodeArray::QwLinearDiodeArray ( )
inline

Definition at line 37 of file QwLinearDiodeArray.h.

37  {
38  };
QwLinearDiodeArray::QwLinearDiodeArray ( TString  name)
inline

Definition at line 39 of file QwLinearDiodeArray.h.

39  :VQwBPM(name){
40  };
VQwBPM()
Definition: VQwBPM.h:58
QwLinearDiodeArray::QwLinearDiodeArray ( TString  subsystemname,
TString  name 
)
inline

Definition at line 41 of file QwLinearDiodeArray.h.

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

41  :VQwBPM(name){
42  SetSubsystemName(subsystemname);
43  InitializeChannel(subsystemname, name);
44  };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
void InitializeChannel(TString name)
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

QwLinearDiodeArray::QwLinearDiodeArray ( const QwLinearDiodeArray source)
inline

Definition at line 45 of file QwLinearDiodeArray.h.

References fAbsPos, fPhotodiode, and fRelPos.

46  : VQwBPM(source),
48  {
49  for (size_t i = 0; i < 2; i++) {
50  fRelPos[i] = source.fRelPos[i];
51  fAbsPos[i] = source.fAbsPos[i];
52  }
53  for (size_t i = 0; i < 8; i++) {
54  fPhotodiode[i] = source.fPhotodiode[i];
55  }
56  }
QwVQWK_Channel fPhotodiode[8]
VQwBPM()
Definition: VQwBPM.h:58
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
QwVQWK_Channel fAbsPos[2]
virtual QwLinearDiodeArray::~QwLinearDiodeArray ( )
inlinevirtual

Definition at line 57 of file QwLinearDiodeArray.h.

57 { };

Member Function Documentation

void QwLinearDiodeArray::AccumulateRunningSum ( const QwLinearDiodeArray value)

Definition at line 524 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::AccumulateRunningSum(), fEffectiveCharge, fPhotodiode, and fRelPos.

Referenced by AccumulateRunningSum().

525 {
526  size_t i = 0;
527  for(i=0;i<8;i++) fPhotodiode[i].AccumulateRunningSum(value.fPhotodiode[i]);
528  for (i = 0; i < 2; i++) fRelPos[i].AccumulateRunningSum(value.fRelPos[i]);
530  return;
531 }
void AccumulateRunningSum(const QwLinearDiodeArray &value)
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void AccumulateRunningSum(const QwVQWK_Channel &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwLinearDiodeArray::AccumulateRunningSum ( const VQwBPM value)
virtual

Reimplemented from VQwBPM.

Definition at line 520 of file QwLinearDiodeArray.cc.

References AccumulateRunningSum().

520  {
521  AccumulateRunningSum(*dynamic_cast<const QwLinearDiodeArray* >(&value));
522 }
void AccumulateRunningSum(const QwLinearDiodeArray &value)

+ Here is the call graph for this function:

Bool_t QwLinearDiodeArray::ApplyHWChecks ( )

Definition at line 92 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::ApplyHWChecks(), VQwBPM::bDEBUG, fPhotodiode, QwVQWK_Channel::GetNumberOfSamples(), and QwVQWK_Channel::GetSequenceNumber().

Referenced by ProcessEvent().

93 {
94  Bool_t eventokay=kTRUE;
95 
96  UInt_t deviceerror=0;
97  for(size_t i=0;i<8;i++)
98  {
99  deviceerror|= fPhotodiode[i].ApplyHWChecks(); //OR the error code from each wire
100  eventokay &= (deviceerror & 0x0);//AND with 0 since zero means HW is good.
101 
102  if (bDEBUG) std::cout<<" Inconsistent within LinearArray terminals photodiode[ "<<i<<" ] "<<std::endl;
103  if (bDEBUG) std::cout<<" photodiode[ "<<i<<" ] sequence num "<<fPhotodiode[i].GetSequenceNumber()<<" sample size "<<fPhotodiode[i].GetNumberOfSamples()<<std::endl;
104  }
105 
106  return eventokay;
107 }
size_t GetNumberOfSamples() const
Int_t ApplyHWChecks()
static const Bool_t bDEBUG
Definition: VQwBPM.h:275
QwVQWK_Channel fPhotodiode[8]
size_t GetSequenceNumber() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t QwLinearDiodeArray::ApplySingleEventCuts ( )
virtual

Implements VQwBPM.

Definition at line 160 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::ApplySingleEventCuts(), VQwBPM::bDEBUG, fEffectiveCharge, fPhotodiode, fRelPos, VQwHardwareChannel::GetErrorCode(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwHardwareChannel::UpdateErrorFlag().

161 {
162  Bool_t status=kTRUE;
163  size_t i=0;
164  UInt_t error_code = 0;
165  //Event cuts for four wires
166  for(i=0;i<8;i++){
168  status&=kTRUE;
169  }
170  else{
171  status&=kFALSE;
172  if (bDEBUG) std::cout<<" array ["<<i<<"] event cut failed ";
173  }
174  //Get the Event cut error flag for wires
175  error_code|=fPhotodiode[i].GetErrorCode();
176  }
177 
178  //Event cuts for Relative X & Y
179  for(i=kXAxis;i<kNumAxes;i++){
180  fRelPos[i].UpdateErrorFlag(error_code);//To update the event cut failed error code from the channels/wires error codes
181  if (fRelPos[i].ApplySingleEventCuts()){ //for RelX
182  status&=kTRUE;
183  }
184  else{
185  status&=kFALSE;
186  if (bDEBUG) std::cout<<" Rel X event cut failed ";
187  }
188  }
189 
190  //Event cuts for four wire sum (EffectiveCharge)
191  fEffectiveCharge.UpdateErrorFlag(error_code);//To update the eff-charge error code from the channels/wires event cut error codes
193  status&=kTRUE;
194  }
195  else{
196  status&=kFALSE;
197  if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
198  }
199  return status;
200 }
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
static const Bool_t bDEBUG
Definition: VQwBPM.h:275
virtual UInt_t GetErrorCode() const
Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL)
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::CalculateRunningAverage ( )
virtual

Implements VQwBPM.

Definition at line 511 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::CalculateRunningAverage(), fEffectiveCharge, fPhotodiode, and fRelPos.

512 {
513  size_t i = 0;
514  for(i=0;i<8;i++) fPhotodiode[i].CalculateRunningAverage();
515  for (i = 0; i < 2; i++) fRelPos[i].CalculateRunningAverage();
517  return;
518 }
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void CalculateRunningAverage()

+ Here is the call graph for this function:

void QwLinearDiodeArray::ClearEventData ( )
virtual

Clear the event data in this element.

Reimplemented from VQwDataElement.

Definition at line 77 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::ClearEventData(), fEffectiveCharge, fPhotodiode, fRelPos, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

78 {
79  size_t i=0;
80 
81  for(i=0;i<8;i++) fPhotodiode[i].ClearEventData();
82 
83  for(i=kXAxis;i<kNumAxes;i++){
85  }
87 
88  return;
89 }
void ClearEventData()
Clear the event data in this element.
void ClearEventData()
Clear the event data in this element.
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 614 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, QwVQWK_Channel::ConstructBranch(), fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::SetRootSaveStatus().

Referenced by ConstructBranch().

615 {
616  if (GetElementName()==""){
617  // This channel is not used, so skip constructing trees.
618  }
619  else {
620  TString thisprefix=prefix;
621  if(prefix=="asym_")
622  thisprefix="diff_";
623 
624  SetRootSaveStatus(prefix);
625 
626  fEffectiveCharge.ConstructBranch(tree,prefix);
627  size_t i = 0;
628  if(bFullSave) {
629  for(i=0;i<8;i++) fPhotodiode[i].ConstructBranch(tree,thisprefix);
630  }
631  for(i=kXAxis;i<kNumAxes;i++) {
632  fRelPos[i].ConstructBranch(tree,thisprefix);
633  }
634 
635  }
636  return;
637 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
void ConstructBranch(TTree *tree, TString &prefix)
Bool_t bFullSave
Definition: VQwBPM.h:273
void ConstructBranch(TTree *tree, TString &prefix)
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements VQwBPM.

Definition at line 639 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, ConstructBranch(), QwVQWK_Channel::ConstructBranch(), QwLog::endl(), fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), QwParameterFile::HasValue(), VQwBPM::kNumAxes, VQwBPM::kXAxis, QwMessage, and VQwBPM::SetRootSaveStatus().

640 {
641  TString devicename;
642 
643  devicename=GetElementName();
644  devicename.ToLower();
645  if (GetElementName()==""){
646  // This channel is not used, so skip filling the histograms.
647  } else
648  {
649  if (modulelist.HasValue(devicename)){
650  TString thisprefix=prefix;
651  if(prefix=="asym_")
652  thisprefix="diff_";
653 
654  SetRootSaveStatus(prefix);
655 
656  fEffectiveCharge.ConstructBranch(tree,prefix);
657  size_t i = 0;
658  if(bFullSave) {
659  for(i=0;i<8;i++) fPhotodiode[i].ConstructBranch(tree,thisprefix);
660  }
661  for(i=kXAxis;i<kNumAxes;i++) {
662  fRelPos[i].ConstructBranch(tree,thisprefix);
663  }
664 
665  QwMessage <<" Tree leaves added to "<<devicename<<" Corresponding channels"<<QwLog::endl;
666  }
667  // this functions doesn't do anything yet
668  }
669 
670 
671 
672 
673 
674  return;
675 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
void ConstructBranch(TTree *tree, TString &prefix)
Bool_t bFullSave
Definition: VQwBPM.h:273
Bool_t HasValue(TString &vname)
void ConstructBranch(TTree *tree, TString &prefix)
QwVQWK_Channel fPhotodiode[8]
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.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 589 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, QwVQWK_Channel::ConstructBranchAndVector(), fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::SetRootSaveStatus().

590 {
591  if (GetElementName()==""){
592  // This channel is not used, so skip constructing trees.
593  }
594  else {
595  TString thisprefix=prefix;
596  if(prefix=="asym_")
597  thisprefix="diff_";
598 
599  SetRootSaveStatus(prefix);
600 
601  fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
602  size_t i = 0;
603  if(bFullSave) {
604  for(i=0;i<8;i++) fPhotodiode[i].ConstructBranchAndVector(tree,thisprefix,values);
605  }
606  for(i=kXAxis;i<kNumAxes;i++) {
607  fRelPos[i].ConstructBranchAndVector(tree,thisprefix,values);
608  }
609 
610  }
611  return;
612 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

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

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 548 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, QwVQWK_Channel::ConstructHistograms(), fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::SetRootSaveStatus().

549 {
550 
551  if (GetElementName()=="") {
552  // This channel is not used, so skip filling the histograms.
553  } else {
554  fEffectiveCharge.ConstructHistograms(folder, prefix);
555  TString thisprefix=prefix;
556 
557  if(prefix=="asym_")
558  thisprefix="diff_";
559  SetRootSaveStatus(prefix);
560  size_t i = 0;
561  if(bFullSave) {
562  for(i=0;i<8;i++) fPhotodiode[i].ConstructHistograms(folder, thisprefix);
563  }
564  for(i=kXAxis;i<kNumAxes;i++) {
565  fRelPos[i].ConstructHistograms(folder, thisprefix);
566  }
567  }
568  return;
569 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::DeaccumulateRunningSum ( QwLinearDiodeArray value)

Definition at line 537 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::DeaccumulateRunningSum(), fEffectiveCharge, fPhotodiode, and fRelPos.

Referenced by DeaccumulateRunningSum().

538 {
539  size_t i = 0;
540  for(i=0;i<8;i++) fPhotodiode[i].DeaccumulateRunningSum(value.fPhotodiode[i]);
541  for (i = 0; i < 2; i++) fRelPos[i].DeaccumulateRunningSum(value.fRelPos[i]);
543  return;
544 }
void DeaccumulateRunningSum(const QwVQWK_Channel &value)
QwVQWK_Channel fPhotodiode[8]
void DeaccumulateRunningSum(QwLinearDiodeArray &value)
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwLinearDiodeArray::DeaccumulateRunningSum ( VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 533 of file QwLinearDiodeArray.cc.

References DeaccumulateRunningSum().

533  {
534  DeaccumulateRunningSum(*dynamic_cast<QwLinearDiodeArray* >(&value));
535 }
void DeaccumulateRunningSum(QwLinearDiodeArray &value)

+ Here is the call graph for this function:

void QwLinearDiodeArray::EncodeEventData ( std::vector< UInt_t > &  buffer)
virtual

Reimplemented from VQwBPM.

Definition at line 803 of file QwLinearDiodeArray.cc.

References fPhotodiode.

804 {
805  for (size_t i=0; i<8; i++) fPhotodiode[i].EncodeEventData(buffer);
806 }
void EncodeEventData(std::vector< UInt_t > &buffer)
QwVQWK_Channel fPhotodiode[8]
void QwLinearDiodeArray::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 571 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, fEffectiveCharge, QwVQWK_Channel::FillHistograms(), fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

572 {
573  if (GetElementName()=="") {
574  // This channel is not used, so skip filling the histograms.
575  }
576  else {
578  size_t i = 0;
579  if(bFullSave) {
580  for(i=0;i<8;i++) fPhotodiode[i].FillHistograms();
581  }
582  for(i=kXAxis;i<kNumAxes;i++){
583  fRelPos[i].FillHistograms();
584  }
585  }
586  return;
587 }
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fPhotodiode[8]
void FillHistograms()
Fill the histograms for this data element.
virtual const TString & GetElementName() const
Get the name of this element.
void FillHistograms()
Fill the histograms for this data element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 677 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, fEffectiveCharge, QwVQWK_Channel::FillTreeVector(), fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

678 {
679  if (GetElementName()=="") {
680  // This channel is not used, so skip filling the tree.
681  }
682  else {
684  size_t i = 0;
685  if(bFullSave) {
686  for(i=0;i<8;i++) fPhotodiode[i].FillTreeVector(values);
687  }
688  for(i=kXAxis;i<kNumAxes;i++){
689  fRelPos[i].FillTreeVector(values);
690  }
691  }
692  return;
693 }
void FillTreeVector(std::vector< Double_t > &values) const
Bool_t bFullSave
Definition: VQwBPM.h:273
void FillTreeVector(std::vector< Double_t > &values) const
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::GetAbsolutePosition ( )
virtual

Reimplemented from VQwBPM.

Definition at line 412 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::AddChannelOffset(), fAbsPos, VQwBPM::fPositionCenter, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

413 {
414  for(size_t i=kXAxis;i<kNumAxes;i++){
416  }
417 
418 }
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
void AddChannelOffset(Double_t Offset)
QwVQWK_Channel fAbsPos[2]

+ Here is the call graph for this function:

std::vector< QwDBInterface > QwLinearDiodeArray::GetDBEntry ( )
virtual

Implements VQwBPM.

Definition at line 722 of file QwLinearDiodeArray.cc.

References VQwHardwareChannel::AddEntriesToList(), fEffectiveCharge, and fRelPos.

723 {
724  std::vector <QwDBInterface> row_list;
725  row_list.clear();
726 
727  for(size_t i=0;i<2;i++) {
728  fRelPos[i].AddEntriesToList(row_list);
729  }
731  return row_list;
732 
733 
734 }
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

const VQwHardwareChannel* QwLinearDiodeArray::GetEffectiveCharge ( ) const
inlinevirtual

Implements VQwBPM.

Definition at line 83 of file QwLinearDiodeArray.h.

References fEffectiveCharge.

83 {return &fEffectiveCharge;}
QwVQWK_Channel fEffectiveCharge
std::vector< QwErrDBInterface > QwLinearDiodeArray::GetErrDBEntry ( )
virtual

Implements VQwBPM.

Definition at line 737 of file QwLinearDiodeArray.cc.

References QwVQWK_Channel::AddErrEntriesToList(), fEffectiveCharge, and fRelPos.

738 {
739  std::vector <QwErrDBInterface> row_list;
740  row_list.clear();
741  for(size_t i=0;i<2;i++) {
742  fRelPos[i].AddErrEntriesToList(row_list);
743  }
745  return row_list;
746 
747 
748 }
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void AddErrEntriesToList(std::vector< QwErrDBInterface > &row_list)

+ Here is the call graph for this function:

UInt_t QwLinearDiodeArray::GetEventcutErrorFlag ( )
virtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 129 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetEventcutErrorFlag(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

130 {
131  size_t i=0;
132  UInt_t error=0;
133  for(i=0;i<8;i++) error|=fPhotodiode[i].GetEventcutErrorFlag();
134  for(i=kXAxis;i<kNumAxes;i++) {
135  error|=fRelPos[i].GetEventcutErrorFlag();
136  }
138 
139  return error;
140 }
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
QwVQWK_Channel fPhotodiode[8]
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

const VQwHardwareChannel* QwLinearDiodeArray::GetPosition ( EBeamPositionMonitorAxis  axis) const
inlinevirtual

Implements VQwBPM.

Definition at line 75 of file QwLinearDiodeArray.h.

References VQwBPM::axis, fAbsPos, and VQwDataElement::GetElementName().

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

+ Here is the call graph for this function:

VQwHardwareChannel * QwLinearDiodeArray::GetSubelementByName ( TString  ch_name)
protectedvirtual

Implements VQwBPM.

Definition at line 203 of file QwLinearDiodeArray.cc.

References fAbsPos, fEffectiveCharge, fRelPos, and VQwDataElement::GetElementName().

204 {
205  VQwHardwareChannel* tmpptr = NULL;
206  ch_name.ToLower();
207  if (ch_name=="relx"){
208  tmpptr = &fRelPos[0];
209  }else if (ch_name=="rely"){
210  tmpptr = &fRelPos[1];
211  }else if (ch_name=="absx" || ch_name=="x" ){
212  tmpptr = &fAbsPos[0];
213  }else if (ch_name=="absy" || ch_name=="y"){
214  tmpptr = &fAbsPos[1];
215  }else if (ch_name=="effectivecharge" || ch_name=="charge"){
216  tmpptr = &fEffectiveCharge;
217  } else {
218  TString loc="QwLinearDiodeArray::GetSubelementByName for"
219  + this->GetElementName() + " was passed "
220  + ch_name + ", which is an unrecognized subelement name.";
221  throw std::invalid_argument(loc.Data());
222  }
223  return tmpptr;
224 }
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
QwVQWK_Channel fAbsPos[2]

+ Here is the call graph for this function:

UInt_t QwLinearDiodeArray::GetSubElementIndex ( TString  subname)
static

Definition at line 391 of file QwLinearDiodeArray.cc.

References kInvalidSubelementIndex, and kMaxElements.

Referenced by QwBeamDetectorID::QwBeamDetectorID().

392 {
393  size_t localindex=kInvalidSubelementIndex;
394  TString padindex;
395 
396  padindex = subname(subname.Sizeof()-2,1);
397  // Interpret the subname as the pad index.
398  if (padindex.IsDigit()){
399  Int_t tmpval = padindex.Atoi();
400  if (tmpval>-1) localindex = tmpval-1;
401  }
402 
403  // localindex is unsigned int and always positive
404  if (localindex > kMaxElements){
405  std::cerr << "QwLinearDiodeArray::GetSubElementIndex is unable to associate the string -"
406  <<subname<<"- to any index"<<std::endl;
407  localindex=kInvalidSubelementIndex;
408  }
409  return localindex;
410 }
static const size_t kMaxElements
static const UInt_t kInvalidSubelementIndex
Definition: QwTypes.h:191

+ Here is the caller graph for this function:

TString QwLinearDiodeArray::GetSubElementName ( Int_t  subindex)
virtual

Reimplemented from VQwBPM.

Definition at line 375 of file QwLinearDiodeArray.cc.

References fPhotodiode, VQwDataElement::GetElementName(), and kInvalidSubelementIndex.

376 {
377  TString thisname;
378  size_t localindex=kInvalidSubelementIndex;
379  if (subindex>-1) localindex = subindex;
380 
381  if(localindex<8)
382  thisname=fPhotodiode[subindex].GetElementName();
383  else
384  std::cerr<< "QwLinearDiodeArray::GetSubElementName for "
385  << GetElementName()<<" this subindex, "
386  << subindex << ", doesn't exist \n";
387 
388  return thisname;
389 }
static const UInt_t kInvalidSubelementIndex
Definition: QwTypes.h:191
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

void QwLinearDiodeArray::IncrementErrorCounters ( )
virtual

Implements VQwBPM.

Definition at line 109 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, QwVQWK_Channel::IncrementErrorCounters(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

110 {
111  size_t i=0;
112  for(i=0;i<8;i++) fPhotodiode[i].IncrementErrorCounters();
113  for(i=kXAxis;i<kNumAxes;i++) {
115  }
117 }
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void IncrementErrorCounters()

+ Here is the call graph for this function:

void QwLinearDiodeArray::InitializeChannel ( TString  name)

Definition at line 25 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::InitializeChannel(), QwVQWK_Channel::InitializeChannel(), and subelement.

Referenced by QwLinearDiodeArray().

26 {
27 
28  Int_t i=0;
29  Bool_t localdebug = kFALSE;
31 
32  for(i=0;i<8;i++) {
33  fPhotodiode[i].InitializeChannel(name+subelement[i],"raw");
34 
35  if(localdebug)
36  std::cout<<" photodiode ["<<i<<"]="<<fPhotodiode[i].GetElementName()<<"\n";
37  }
38 
39 
40  fEffectiveCharge.InitializeChannel(name+"_EffectiveCharge","derived");
41 
42  // We don't initialize the photodiode channels yet.
43  fRelPos[0].InitializeChannel(name+"RelMean","derived");
44  fRelPos[1].InitializeChannel(name+"RelVariance","derived");
45 
46  bFullSave=kTRUE;
47 
48  return;
49 }
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fPhotodiode[8]
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
static const TString subelement[8]

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwLinearDiodeArray::InitializeChannel ( TString  subsystem,
TString  name 
)

Definition at line 51 of file QwLinearDiodeArray.cc.

References VQwBPM::bFullSave, fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::InitializeChannel(), QwVQWK_Channel::InitializeChannel(), and subelement.

52 {
53 
54  Int_t i=0;
55  Bool_t localdebug = kFALSE;
56 
58 
59  for(i=0;i<8;i++) {
60  fPhotodiode[i].InitializeChannel(subsystem, "QwLinearDiodeArray", name+subelement[i],"raw");
61  if(localdebug)
62  std::cout<<" photodiode ["<<i<<"]="<<fPhotodiode[i].GetElementName()<<"\n";
63  }
64 
65  fEffectiveCharge.InitializeChannel(subsystem, "QwLinearDiodeArray", name+"_EffectiveCharge","derived");
66 
67  // We don't initialize the photodiode channels yet.
68 
69  fRelPos[0].InitializeChannel(subsystem, "QwLinearDiodeArray", name+"RelMean","derived");
70  fRelPos[1].InitializeChannel(subsystem, "QwLinearDiodeArray", name+"RelVariance","derived");
71 
72  bFullSave=kTRUE;
73 
74  return;
75 }
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fPhotodiode[8]
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
static const TString subelement[8]

+ Here is the call graph for this function:

void QwLinearDiodeArray::LoadChannelParameters ( QwParameterFile paramfile)
inlinevirtual

Implements VQwBPM.

Definition at line 64 of file QwLinearDiodeArray.h.

References fPhotodiode, and kMaxElements.

64  {
65  for(size_t i=0;i<kMaxElements;i++)
66  fPhotodiode[i].LoadChannelParameters(paramfile);
67  }
static const size_t kMaxElements
QwVQWK_Channel fPhotodiode[8]
void LoadChannelParameters(QwParameterFile &paramfile)
void QwLinearDiodeArray::MakeLinearArrayList ( )

Definition at line 709 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fLinearArrayElementList, fRelPos, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

710 {
711  for (size_t i = kXAxis; i < kNumAxes; i++) {
712  QwVQWK_Channel relpos(fRelPos[i]);
713  relpos = fRelPos[i];
714  fLinearArrayElementList.push_back(relpos);
715  }
716  QwVQWK_Channel effectivecharge(fEffectiveCharge);
717  effectivecharge = fEffectiveCharge;
718  fLinearArrayElementList.push_back(effectivecharge);
719 }
std::vector< QwVQWK_Channel > fLinearArrayElementList
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
VQwBPM & QwLinearDiodeArray::operator+= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 443 of file QwLinearDiodeArray.cc.

444 {
445  *(dynamic_cast<QwLinearDiodeArray*>(this)) +=
446  *(dynamic_cast<const QwLinearDiodeArray*>(&value));
447  return *this;
448 }
QwLinearDiodeArray & QwLinearDiodeArray::operator+= ( const QwLinearDiodeArray value)
virtual

Definition at line 450 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

451 {
452 
453  if (GetElementName()!=""){
454  size_t i = 0;
455  this->fEffectiveCharge+=value.fEffectiveCharge;
456  for(i=0;i<8;i++) this->fPhotodiode[i]+=value.fPhotodiode[i];
457  for(i=kXAxis;i<kNumAxes;i++) {
458  this->fRelPos[i]+=value.fRelPos[i];
459  }
460  }
461  return *this;
462 }
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

VQwBPM & QwLinearDiodeArray::operator-= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 464 of file QwLinearDiodeArray.cc.

465 {
466  *(dynamic_cast<QwLinearDiodeArray*>(this)) -=
467  *(dynamic_cast<const QwLinearDiodeArray*>(&value));
468  return *this;
469 }
QwLinearDiodeArray & QwLinearDiodeArray::operator-= ( const QwLinearDiodeArray value)
virtual

Definition at line 471 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

472 {
473 
474  if (GetElementName()!=""){
475  size_t i = 0;
476  this->fEffectiveCharge-=value.fEffectiveCharge;
477  for(i=0;i<8;i++) this->fPhotodiode[i]-=value.fPhotodiode[i];
478  for(i=kXAxis;i<kNumAxes;i++) {
479  this->fRelPos[i]-=value.fRelPos[i];
480  }
481  }
482  return *this;
483 }
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

VQwBPM & QwLinearDiodeArray::operator= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 421 of file QwLinearDiodeArray.cc.

422 {
423  *(dynamic_cast<QwLinearDiodeArray*>(this)) =
424  *(dynamic_cast<const QwLinearDiodeArray*>(&value));
425  return *this;
426 }
QwLinearDiodeArray & QwLinearDiodeArray::operator= ( const QwLinearDiodeArray value)
virtual

Definition at line 428 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::operator=().

429 {
430  VQwBPM::operator= (value);
431 
432  if (GetElementName()!=""){
433  size_t i = 0;
435  for(i=0;i<8;i++) this->fPhotodiode[i]=value.fPhotodiode[i];
436  for(i=kXAxis;i<kNumAxes;i++) {
437  this->fRelPos[i]=value.fRelPos[i];
438  }
439  }
440  return *this;
441 }
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition: VQwBPM.cc:115

+ Here is the call graph for this function:

void QwLinearDiodeArray::PrintErrorCounters ( ) const
virtual

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

Reimplemented from VQwBPM.

Definition at line 119 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwBPM::kNumAxes, VQwBPM::kXAxis, and QwVQWK_Channel::PrintErrorCounters().

120 {
121  size_t i=0;
122  for(i=0;i<8;i++) fPhotodiode[i].PrintErrorCounters();
123  for(i=kXAxis;i<kNumAxes;i++) {
125  }
127 }
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
QwVQWK_Channel fPhotodiode[8]
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

Reimplemented from VQwBPM.

Definition at line 364 of file QwLinearDiodeArray.cc.

References fAbsPos, fEffectiveCharge, fPhotodiode, and QwVQWK_Channel::PrintInfo().

365 {
366  size_t i = 0;
367  for (i = 0; i < 8; i++) fPhotodiode[i].PrintInfo();
368  for (i = 0; i < 2; i++) {
369  fAbsPos[i].PrintInfo();
370  }
372 }
void PrintInfo() const
Print multiple lines of information about this data element.
void PrintInfo() const
Print multiple lines of information about this data element.
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fEffectiveCharge
QwVQWK_Channel fAbsPos[2]

+ Here is the call graph for this function:

void QwLinearDiodeArray::PrintValue ( ) const
virtual

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

Reimplemented from VQwDataElement.

Definition at line 356 of file QwLinearDiodeArray.cc.

References fRelPos, and QwVQWK_Channel::PrintValue().

357 {
358  for (size_t i = 0; i < 2; i++) {
359  fRelPos[i].PrintValue();
360  }
361  return;
362 }
void PrintValue() const
Print single line of value and error of this data element.
QwVQWK_Channel fRelPos[2]

+ Here is the call graph for this function:

Int_t QwLinearDiodeArray::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 340 of file QwLinearDiodeArray.cc.

References fPhotodiode, and QwVQWK_Channel::ProcessEvBuffer().

341 {
342  if(index<8)
343  {
344  fPhotodiode[index].ProcessEvBuffer(buffer,word_position_in_buffer);
345  }
346  else
347  {
348  std::cerr <<
349  "QwLinearDiodeArray::ProcessEvBuffer(): attemp to fill in raw data for a pad that doesn't exist \n";
350  }
351  return word_position_in_buffer;
352 }
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
Decode the event data from a CODA buffer.
QwVQWK_Channel fPhotodiode[8]

+ Here is the call graph for this function:

void QwLinearDiodeArray::ProcessEvent ( )
virtual

Implements VQwBPM.

Definition at line 277 of file QwLinearDiodeArray.cc.

References ApplyHWChecks(), QwVQWK_Channel::ClearEventData(), QwVQWK_Channel::Difference(), fEffectiveCharge, VQwDataElement::fElementName, fPhotodiode, fRelPos, QwVQWK_Channel::GetSequenceNumber(), QwVQWK_Channel::GetValue(), QwVQWK_Channel::InitializeChannel(), kQwLinearDiodeArrayPadSize, QwVQWK_Channel::ProcessEvent(), QwVQWK_Channel::Product(), QwVQWK_Channel::Ratio(), and QwVQWK_Channel::Scale().

278 {
279  Bool_t localdebug = kFALSE;
280  static QwVQWK_Channel mean, meansqr;
281  static QwVQWK_Channel tmp("tmp");
282  static QwVQWK_Channel tmp2("tmp2");
283 
284  mean.InitializeChannel("mean","raw");
285  meansqr.InitializeChannel("meansqr","raw");
286 
287 
288  size_t i = 0;
289 
290 
291  ApplyHWChecks();
292  //first apply HW checks and update HW error flags.
293  // Calling this routine here and not in ApplySingleEventCuts
294  //makes a difference for a LinearArrays because they have derrived devices.
295 
297  for(i=0;i<8;i++){
300  }
301 
302 
303  // First calculate the mean pad position and mean of squared pad position
304  // with respect to the center of the array, in units of pad spacing.
305  mean.ClearEventData();
306  meansqr.ClearEventData();
307  for (i=0;i<8;i++){
308  Double_t pos = kQwLinearDiodeArrayPadSize*i*0.5;
309  tmp = fPhotodiode[i];
310  tmp.Scale(pos); // Scale for S(i)*pos
311  mean+=tmp;
312  tmp.Scale(pos); // Scale again for S(i)*(pos**2)
313  meansqr+=tmp;
314  }
315  fRelPos[0].Ratio(mean,fEffectiveCharge);
316  tmp = meansqr;
317  meansqr.Ratio(tmp,fEffectiveCharge);
318  tmp2.Product(fRelPos[0], fRelPos[0]);
319 
320  // Now calculate the variance
321  fRelPos[1].Difference(meansqr,tmp2);
322 
323  if(localdebug){
324  std::cout<<"\n#################"<<std::endl;
325  std::cout<<" LinearArray name="<<fElementName<<std::endl;
326  std::cout<<" Size of the linear array = "<<8<<std::endl;
327  std::cout<<" event number= "<<fPhotodiode[0].GetSequenceNumber()<<std::endl;
328  for(Int_t i = 0; i<8; i++)
329  std::cout<<" pad"<<i<<" ="<<fPhotodiode[i].GetValue()<<std::endl;
330  std::cout<<" mean ="<<fRelPos[0].GetValue()<<std::endl;
331  std::cout<<" varaiance ="<<fRelPos[1].GetValue()<<std::endl;
332  std::cout<<" total charge ="<<fEffectiveCharge.GetValue()<<std::endl;
333 
334  }
335 
336  return;
337 }
void ProcessEvent()
Process the event data according to pedestal and calibration factor.
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
Double_t GetValue(size_t element) const
void Scale(Double_t Offset)
void ClearEventData()
Clear the event data in this element.
QwVQWK_Channel fPhotodiode[8]
TString fElementName
Name of this data element.
void Difference(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
QwVQWK_Channel fRelPos[2]
size_t GetSequenceNumber() const
QwVQWK_Channel fEffectiveCharge
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
static const Double_t kQwLinearDiodeArrayPadSize

+ Here is the call graph for this function:

void QwLinearDiodeArray::RandomizeEventData ( int  helicity = 0,
double  time = 0.0 
)
virtual

Reimplemented from VQwBPM.

Definition at line 784 of file QwLinearDiodeArray.cc.

References fPhotodiode.

785 {
786  for (size_t i=0; i<8; i++) fPhotodiode[i].RandomizeEventData(helicity, time);
787 
788  return;
789 }
QwVQWK_Channel fPhotodiode[8]
void RandomizeEventData(int helicity=0, double time=0.0)
void QwLinearDiodeArray::Ratio ( QwLinearDiodeArray numer,
QwLinearDiodeArray denom 
)

Definition at line 486 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, and QwVQWK_Channel::Ratio().

487 {
488  // this function is called when forming asymmetries. In this case waht we actually want for the
489  // LinearArray is the difference only not the asymmetries
490 
491  *this=numer;
493  return;
494 }
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::Scale ( Double_t  factor)
virtual

Reimplemented from VQwBPM.

Definition at line 498 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwBPM::kNumAxes, VQwBPM::kXAxis, and QwVQWK_Channel::Scale().

499 {
500  size_t i = 0;
501  fEffectiveCharge.Scale(factor);
502 
503  for(i=0;i<8;i++) fPhotodiode[i].Scale(factor);
504  for(i=kXAxis;i<kNumAxes;i++){
505  fRelPos[i].Scale(factor);
506  }
507  return;
508 }
void Scale(Double_t Offset)
QwVQWK_Channel fPhotodiode[8]
void Scale(Double_t factor)
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::SetDefaultSampleSize ( Int_t  sample_size)
virtual

Reimplemented from VQwBPM.

Definition at line 809 of file QwLinearDiodeArray.cc.

References fPhotodiode.

810 {
811  for(size_t i=0;i<8;i++) fPhotodiode[i].SetDefaultSampleSize((size_t)sample_size);
812  return;
813 }
QwVQWK_Channel fPhotodiode[8]
void SetDefaultSampleSize(Int_t sample_size)
void QwLinearDiodeArray::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 696 of file QwLinearDiodeArray.cc.

References fAbsPos, fEffectiveCharge, fPhotodiode, fRelPos, VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwHardwareChannel::SetEventCutMode().

697 {
698  size_t i = 0;
699  // bEVENTCUTMODE=bcuts;
700  for (i=0;i<8;i++) fPhotodiode[i].SetEventCutMode(bcuts);
701  for (i=kXAxis;i<kNumAxes;i++) {
702  fRelPos[i].SetEventCutMode(bcuts);
703  fAbsPos[i].SetEventCutMode(bcuts);
704  }
706 }
void SetEventCutMode(Int_t bcuts)
QwVQWK_Channel fPhotodiode[8]
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.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge
QwVQWK_Channel fAbsPos[2]

+ Here is the call graph for this function:

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

Definition at line 792 of file QwLinearDiodeArray.cc.

References fRelPos, and QwVQWK_Channel::SetHardwareSum().

793 {
794  for (size_t i=0; i<2; i++)
795  {
796  fRelPos[i].SetHardwareSum(relpos[i], sequencenumber);
797  }
798 
799  return;
800 }
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
QwVQWK_Channel fRelPos[2]

+ Here is the call graph for this function:

void QwLinearDiodeArray::SetRandomEventParameters ( Double_t  meanX,
Double_t  sigmaX,
Double_t  meanY,
Double_t  sigmaY 
)
virtual

Reimplemented from VQwBPM.

Definition at line 756 of file QwLinearDiodeArray.cc.

References fPhotodiode, and MQwMockable::SetRandomEventParameters().

757 {
758  // Average values of the signals in the stripline ADCs
759  Double_t sumX = 1.1e8; // These are just guesses, but I made X and Y different
760  Double_t sumY = 0.9e8; // to make it more interesting for the analyzer...
761 
762 
763  // Determine the asymmetry from the position
764  Double_t meanXP = (1.0 + meanX) * sumX / 2.0;
765  Double_t meanXM = (1.0 - meanX) * sumX / 2.0; // = sumX - meanXP;
766  Double_t meanYP = (1.0 + meanY) * sumY / 2.0;
767  Double_t meanYM = (1.0 - meanY) * sumY / 2.0; // = sumY - meanYP;
768 
769  // Determine the spread of the asymmetry (this is not tested yet)
770  // (negative sigma should work in the QwVQWK_Channel, but still using fabs)
771  Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
772  Double_t sigmaXM = sigmaXP;
773  Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
774  Double_t sigmaYM = sigmaYP;
775 
776  // Propagate these parameters to the ADCs
777  fPhotodiode[0].SetRandomEventParameters(meanXP, sigmaXP);
778  fPhotodiode[1].SetRandomEventParameters(meanXM, sigmaXM);
779  fPhotodiode[2].SetRandomEventParameters(meanYP, sigmaYP);
780  fPhotodiode[3].SetRandomEventParameters(meanYM, sigmaYM);
781 }
void SetRandomEventParameters(Double_t mean, Double_t sigma)
Set the normal random event parameters.
Definition: MQwMockable.cc:41
QwVQWK_Channel fPhotodiode[8]

+ Here is the call graph for this function:

void QwLinearDiodeArray::SetSubElementCalibrationFactor ( Int_t  j,
Double_t  value 
)
virtual

Reimplemented from VQwBPM.

Definition at line 822 of file QwLinearDiodeArray.cc.

References fPhotodiode, and VQwHardwareChannel::SetCalibrationFactor().

823 {
825  return;
826 }
void SetCalibrationFactor(Double_t factor)
QwVQWK_Channel fPhotodiode[8]

+ Here is the call graph for this function:

UInt_t QwLinearDiodeArray::SetSubElementName ( TString  subname)
void QwLinearDiodeArray::SetSubElementPedestal ( Int_t  j,
Double_t  value 
)
virtual

Reimplemented from VQwBPM.

Definition at line 816 of file QwLinearDiodeArray.cc.

References fPhotodiode, and VQwHardwareChannel::SetPedestal().

817 {
818  fPhotodiode[j].SetPedestal(value);
819  return;
820 }
void SetPedestal(Double_t ped)
QwVQWK_Channel fPhotodiode[8]

+ Here is the call graph for this function:

UInt_t QwLinearDiodeArray::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 142 of file QwLinearDiodeArray.cc.

References fEffectiveCharge, fPhotodiode, fRelPos, VQwHardwareChannel::GetErrorCode(), VQwDataElement::GetEventcutErrorFlag(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwHardwareChannel::UpdateErrorFlag().

143 {
144  size_t i=0;
145  UInt_t error1=0;
146  UInt_t error2=0;
147  for(i=0;i<8;i++){
148  error1|=fPhotodiode[i].GetErrorCode();
149  error2|=fPhotodiode[i].GetEventcutErrorFlag();
150  }
151  for(i=kXAxis;i<kNumAxes;i++) {
152  fRelPos[i].UpdateErrorFlag(error1);
153  error2|=fRelPos[i].GetEventcutErrorFlag();
154  }
157  return error2;
158 }
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
virtual UInt_t GetErrorCode() const
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

void QwLinearDiodeArray::UpdateErrorFlag ( const VQwBPM ev_error)
virtual

Implements VQwBPM.

Definition at line 251 of file QwLinearDiodeArray.cc.

References Qw::e, fEffectiveCharge, fPhotodiode, fRelPos, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwHardwareChannel::UpdateErrorFlag().

251  {
252  Short_t i=0;
253  try {
254  if(typeid(*ev_error)==typeid(*this)) {
255  // std::cout<<" Here in QwQPD::UpdateErrorFlag \n";
256  if (this->GetElementName()!="") {
257  const QwLinearDiodeArray* value_bpm = dynamic_cast<const QwLinearDiodeArray* >(ev_error);
258  for(i=0;i<4;i++){
259  fPhotodiode[i].UpdateErrorFlag(value_bpm->fPhotodiode[i]);
260  }
261  for(i=kXAxis;i<kNumAxes;i++) {
262  fRelPos[i].UpdateErrorFlag(value_bpm->fRelPos[i]);
263  }
265  }
266  } else {
267  TString loc="Standard exception from QwLinearDiodeArray::UpdateErrorFlag :"+
268  ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
269  +"same type";
270  throw std::invalid_argument(loc.Data());
271  }
272  } catch (std::exception& e) {
273  std::cerr<< e.what()<<std::endl;
274  }
275 };
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
QwVQWK_Channel fPhotodiode[8]
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fEffectiveCharge

+ Here is the call graph for this function:

Field Documentation

QwVQWK_Channel QwLinearDiodeArray::fAbsPos[2]
protected
std::vector<QwVQWK_Channel> QwLinearDiodeArray::fLinearArrayElementList
protected

Definition at line 165 of file QwLinearDiodeArray.h.

Referenced by MakeLinearArrayList().

const size_t QwLinearDiodeArray::kMaxElements = 8
staticprivate

Definition at line 147 of file QwLinearDiodeArray.h.

Referenced by GetSubElementIndex(), and LoadChannelParameters().

const Double_t QwLinearDiodeArray::kQwLinearDiodeArrayPadSize = 1.57
staticprivate

Definition at line 151 of file QwLinearDiodeArray.h.

Referenced by ProcessEvent().

const TString QwLinearDiodeArray::subelement ={"p1","p2","p3","p4","p5","p6","p7","p8"}
staticprivate

Definition at line 148 of file QwLinearDiodeArray.h.

Referenced by InitializeChannel().


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