JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwLinearDiodeArray< ChannelType > Class Template Reference

Linear diode array beam position monitor implementation. More...

#include <QwLinearDiodeArray.h>

+ Inheritance diagram for QwLinearDiodeArray< ChannelType >:
+ Collaboration diagram for QwLinearDiodeArray< ChannelType >:

Public Member Functions

 QwLinearDiodeArray ()
 
 QwLinearDiodeArray (TString name)
 
 QwLinearDiodeArray (TString subsystemname, TString name)
 
 QwLinearDiodeArray (TString subsystemname, TString name, TString type)
 
 QwLinearDiodeArray (const QwLinearDiodeArray &source)
 
 ~QwLinearDiodeArray () override
 
void InitializeChannel (TString name)
 Initialize this linear diode array with a detector name.
 
void InitializeChannel (TString subsystem, TString name)
 Initialize this linear diode array with subsystem and name.
 
void ClearEventData () override
 Clear event-scoped data for all pads and derived channels.
 
void LoadChannelParameters (QwParameterFile &paramfile) override
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber) override
 Process the CODA event buffer for this element.
 
void ProcessEvent () override
 
void PrintValue () const override
 Print single line of value and error of this data element.
 
void PrintInfo () const override
 Print multiple lines of information about this data element.
 
const VQwHardwareChannel * GetPosition (EBeamPositionMonitorAxis axis) const override
 
const VQwHardwareChannel * GetEffectiveCharge () const override
 
TString GetSubElementName (Int_t subindex) override
 
UInt_t SetSubElementName (TString subname)
 
void GetAbsolutePosition () override
 
Bool_t ApplyHWChecks ()
 Apply hardware checks for all photodiode pads.
 
Bool_t ApplySingleEventCuts () override
 Apply single-event cuts across photodiodes and derived channels.
 
void SetSingleEventCuts (TString ch_name, UInt_t errorflag, Double_t minX, Double_t maxX, Double_t stability, Double_t burplevel)
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.
 
void SetEventCutMode (Int_t bcuts) override
 
void IncrementErrorCounters () override
 Increment error counters for all internal channels.
 
void PrintErrorCounters () const override
 Print error counters for all internal channels.
 
UInt_t GetEventcutErrorFlag () override
 Aggregate and return the event-cut error flag for this array.
 
UInt_t UpdateErrorFlag () override
 Update and return the aggregated event-cut error flag.
 
void UpdateErrorFlag (const VQwBPM *ev_error) override
 
Bool_t CheckForBurpFail (const VQwDataElement *ev_error) override
 Check for burp failures against another linear array of same type.
 
void SetDefaultSampleSize (Int_t sample_size) override
 
void SetRandomEventParameters (Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY) override
 
void RandomizeEventData (int helicity=0, double time=0.0) override
 
void SetEventData (Double_t *block, UInt_t sequencenumber)
 
void EncodeEventData (std::vector< UInt_t > &buffer) override
 
void SetSubElementPedestal (Int_t j, Double_t value) override
 
void SetSubElementCalibrationFactor (Int_t j, Double_t value) override
 
void Ratio (VQwBPM &numer, VQwBPM &denom) override
 
void Ratio (QwLinearDiodeArray &numer, QwLinearDiodeArray &denom)
 
void Scale (Double_t factor) override
 
VQwBPM & operator= (const VQwBPM &value) override
 
VQwBPM & operator+= (const VQwBPM &value) override
 
VQwBPM & operator-= (const VQwBPM &value) override
 
virtual QwLinearDiodeArray & operator= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArray & operator+= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArray & operator-= (const QwLinearDiodeArray &value)
 
void AccumulateRunningSum (const QwLinearDiodeArray &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 
void AccumulateRunningSum (const VQwBPM &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
 
void DeaccumulateRunningSum (QwLinearDiodeArray &value, Int_t ErrorMask=0xFFFFFFF)
 
void DeaccumulateRunningSum (VQwBPM &value, Int_t ErrorMask=0xFFFFFFF) override
 
void CalculateRunningAverage () override
 
void ConstructHistograms (TDirectory *folder, TString &prefix) override
 Construct the histograms for this data element.
 
void FillHistograms () override
 Fill the histograms for this data element.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
 
void ConstructBranch (TTree *tree, TString &prefix) override
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist) override
 
void FillTreeVector (QwRootTreeBranchVector &values) const override
 
void MakeLinearArrayList ()
 
- Public Member Functions inherited from VQwBPM
 VQwBPM ()
 
 VQwBPM (TString &)
 
 VQwBPM (const VQwBPM &source)
 
 ~VQwBPM () override
 
void InitializeChannel (TString name)
 Initialize common BPM state and set the element name.
 
virtual void GetProjectedPosition (VQwBPM *)
 
virtual size_t GetNumberOfElements ()
 
virtual void FillRawEventData ()
 
void GetSurveyOffsets (Double_t Xoffset, Double_t Yoffset, Double_t Zoffset)
 Store geometry/survey offsets for absolute position calibration.
 
void GetElectronicFactors (Double_t BSENfactor, Double_t AlphaX, Double_t AlphaY)
 Apply per-detector electronic calibration and relative gains.
 
void SetRotation (Double_t)
 Set detector rotation angle and update cached trigonometric values.
 
void SetRotationOff ()
 
void SetSingleEventCuts (TString, Double_t, Double_t)
 
void SetSingleEventCuts (TString, UInt_t, Double_t, Double_t, Double_t, Double_t)
 
void SetGains (TString pos, Double_t value)
 
void SetRootSaveStatus (TString &prefix)
 
Double_t GetPositionInZ () const
 
void PrintErrorCounters () const override
 report number of events failed due to HW and event cut failure
 
virtual const VQwHardwareChannel * GetAngleX () const
 
virtual const VQwHardwareChannel * GetAngleY () const
 
virtual void SetBPMForCombo (const VQwBPM *, Double_t, Double_t, Double_t, Double_t)
 
virtual void SetResolution (Double_t resolutionX, Double_t resolutionY)
 
virtual void SetRandomEventParameters (Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t)
 
virtual void SetRandomEventAsymmetry (Double_t)
 
virtual void ApplyResolutionSmearing ()
 
virtual void ApplyResolutionSmearing (EBeamPositionMonitorAxis)
 
void PrintInfo () const override
 Print multiple lines of information about this data element.
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor.
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor.
 
 ~VQwDataElement () override
 Virtual destructor.
 
void CopyFrom (const VQwDataElement &value)
 
Bool_t IsNameEmpty () const
 Is the name of this element empty?
 
void SetElementName (const TString &name)
 Set the name of this element.
 
virtual const TString & GetElementName () const
 Get the name of this element.
 
virtual void LoadMockDataParameters (QwParameterFile &)
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element.
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *)
 
VQwDataElement & operator+= (const VQwDataElement &)
 Addition-assignment operator.
 
VQwDataElement & operator-= (const VQwDataElement &)
 Subtraction-assignment operator.
 
void Sum (const VQwDataElement &, const VQwDataElement &)
 Sum operator (base class fallback throws runtime error)
 
void Difference (const VQwDataElement &, const VQwDataElement &)
 Difference operator (base class fallback throws runtime error)
 
void Ratio (const VQwDataElement &, const VQwDataElement &)
 Ratio operator (base class fallback throws runtime error)
 
void SetSingleEventCuts (UInt_t, Double_t, Double_t, Double_t)
 set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel
 
Bool_t CheckForBurpFail (const VQwDataElement *)
 
virtual void SetNeedsExternalClock (Bool_t)
 
virtual Bool_t NeedsExternalClock ()
 
virtual std::string GetExternalClockName ()
 
virtual void SetExternalClockPtr (const VQwHardwareChannel *)
 
virtual void SetExternalClockName (const std::string)
 
virtual Double_t GetNormClockValue ()
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name.
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name.
 
TString GetModuleType () const
 Return the type of the beam instrument.
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 

Static Public Member Functions

static UInt_t GetSubElementIndex (TString subname)
 
- Static Public Member Functions inherited from VQwBPM
static VQwBPM * CreateStripline (TString subsystemname, TString name, TString type)
 A fast way of creating a BPM stripline of specified type.
 
static VQwBPM * CreateStripline (const VQwBPM &source)
 
static VQwBPM * CreateCombo (TString subsystemname, TString name, TString type)
 A fast way of creating a BPM stripline of specified type.
 
static VQwBPM * CreateCombo (const VQwBPM &source)
 
static VQwBPM * CreateLinearDiodeArray (TString subsystemname, TString name, TString type)
 
static VQwBPM * CreateLinearDiodeArray (const VQwBPM &source)
 

Protected Member Functions

VQwHardwareChannel * GetSubelementByName (TString ch_name) override
 Resolve an internal channel pointer by subelement name.
 
- Protected Member Functions inherited from VQwBPM
virtual VQwHardwareChannel * GetPosition (EBeamPositionMonitorAxis axis)
 
VQwHardwareChannel * GetSubelementByIndex (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.
 
VQwDataElement & operator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data.
 
void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistograms & operator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 

Protected Attributes

std::array< ChannelType, 8 > fPhotodiode
 
std::array< ChannelType, 2 > fRelPos
 
std::array< ChannelType, 2 > fAbsPos
 
ChannelType fEffectiveCharge
 
std::vector< ChannelType > fLinearArrayElementList
 
- Protected Attributes inherited from VQwBPM
std::vector< TString > fSubelementNames
 
Double_t fPositionCenter [3]
 
Double_t fQwStriplineCalibration
 
Double_t fQwStriplineCorrection
 
Double_t fRelativeGains [2]
 
Double_t fGains [2]
 
Bool_t bRotated
 
Double_t fRotationAngle
 
Double_t fCosRotation
 
Double_t fSinRotation
 
Double_t fResolution [2]
 
Bool_t fGoodEvent
 
Bool_t bFullSave
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element.
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element.
 
UInt_t fGoodEventCount
 Number of good events accumulated in this element.
 
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)
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptr > fHistograms
 Histograms associated with this data element.
 

Static Private Attributes

static const size_t kMaxElements
 
static const TString subelement [8]
 
static const Double_t kQwLinearDiodeArrayPadSize
 

Additional Inherited Members

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

Linear diode array beam position monitor implementation.

Implements beam position monitoring using a linear array of photodiodes. Provides position calculation from diode array readouts with calibration and error handling for linear array detectors.

Definition at line 45 of file QwLinearDiodeArray.h.

Constructor & Destructor Documentation

◆ QwLinearDiodeArray() [1/5]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::QwLinearDiodeArray ( )
inline

Definition at line 50 of file QwLinearDiodeArray.h.

50 {
51 };

Referenced by AccumulateRunningSum(), AccumulateRunningSum(), CheckForBurpFail(), DeaccumulateRunningSum(), DeaccumulateRunningSum(), operator+=(), operator+=(), operator-=(), operator-=(), operator=(), operator=(), QwLinearDiodeArray(), Ratio(), Ratio(), SetSubElementName(), and UpdateErrorFlag().

+ Here is the caller graph for this function:

◆ QwLinearDiodeArray() [2/5]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::QwLinearDiodeArray ( TString name)
inline

Definition at line 52 of file QwLinearDiodeArray.h.

52 :VQwBPM(name){
53 };
Linear diode array beam position monitor implementation.
VQwBPM()
Definition VQwBPM.h:76

References VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ QwLinearDiodeArray() [3/5]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::QwLinearDiodeArray ( TString subsystemname,
TString name )
inline

Definition at line 54 of file QwLinearDiodeArray.h.

54 :VQwBPM(name){
57 };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
void InitializeChannel(TString name)
Initialize this linear diode array with a detector name.

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

+ Here is the call graph for this function:

◆ QwLinearDiodeArray() [4/5]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::QwLinearDiodeArray ( TString subsystemname,
TString name,
TString type )
inline

Definition at line 58 of file QwLinearDiodeArray.h.

58 :VQwBPM(name){
62 };
void SetModuleType(TString ModuleType)
set the type of the beam instrument

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

+ Here is the call graph for this function:

◆ QwLinearDiodeArray() [5/5]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::QwLinearDiodeArray ( const QwLinearDiodeArray< ChannelType > & source)
inline

Definition at line 63 of file QwLinearDiodeArray.h.

64 : VQwBPM(source),
66 {
70 }
void QwCopyArray(const T &a, T &b)
Definition QwUtil.h:15
std::array< ChannelType, 2 > fAbsPos
std::array< ChannelType, 8 > fPhotodiode
std::array< ChannelType, 2 > fRelPos

References fAbsPos, fEffectiveCharge, fPhotodiode, fRelPos, QwCopyArray(), QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ ~QwLinearDiodeArray()

template<typename ChannelType>
QwLinearDiodeArray< ChannelType >::~QwLinearDiodeArray ( )
inlineoverride

Definition at line 71 of file QwLinearDiodeArray.h.

71{ };

Member Function Documentation

◆ AccumulateRunningSum() [1/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::AccumulateRunningSum ( const QwLinearDiodeArray< ChannelType > & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )

Definition at line 640 of file QwLinearDiodeArray.cc.

641{
642 size_t i = 0;
644 for (i = 0; i < 2; i++) fRelPos[i].AccumulateRunningSum(value.fRelPos[i], count, ErrorMask);
645 fEffectiveCharge.AccumulateRunningSum(value.fEffectiveCharge, count, ErrorMask);
646 return;
647}
void AccumulateRunningSum(const QwLinearDiodeArray &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)

References AccumulateRunningSum(), fEffectiveCharge, fPhotodiode, fRelPos, and QwLinearDiodeArray().

Referenced by AccumulateRunningSum(), and AccumulateRunningSum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AccumulateRunningSum() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::AccumulateRunningSum ( const VQwBPM & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 635 of file QwLinearDiodeArray.cc.

635 {
636 AccumulateRunningSum(*dynamic_cast<const QwLinearDiodeArray* >(&value), count, ErrorMask);
637}

References AccumulateRunningSum(), QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ ApplyHWChecks()

template<typename ChannelType>
Bool_t QwLinearDiodeArray< ChannelType >::ApplyHWChecks ( )

Apply hardware checks for all photodiode pads.

Returns
kTRUE if no hardware error was detected; otherwise kFALSE.

Definition at line 121 of file QwLinearDiodeArray.cc.

122{
124
126 for(size_t i=0;i<8;i++)
127 {
128 deviceerror|= fPhotodiode[i].ApplyHWChecks(); //OR the error code from each wire
129 eventokay &= (deviceerror & 0x0);//AND with 0 since zero means HW is good.
130
131 if (bDEBUG) std::cout<<" Inconsistent within LinearArray terminals photodiode[ "<<i<<" ] "<<std::endl;
132 if (bDEBUG) std::cout<<" photodiode[ "<<i<<" ] sequence num "<<fPhotodiode[i].GetSequenceNumber()<<" sample size "<<fPhotodiode[i].GetNumberOfSamples()<<std::endl;
133 }
134
135 return eventokay;
136}
static const Bool_t bDEBUG
Definition VQwBPM.h:352

References VQwBPM::bDEBUG, and fPhotodiode.

Referenced by ProcessEvent().

+ Here is the caller graph for this function:

◆ ApplySingleEventCuts()

template<typename ChannelType>
Bool_t QwLinearDiodeArray< ChannelType >::ApplySingleEventCuts ( )
overridevirtual

Apply single-event cuts across photodiodes and derived channels.

Returns
kTRUE if the event passes all configured cuts; otherwise kFALSE.

Implements VQwBPM.

Definition at line 202 of file QwLinearDiodeArray.cc.

203{
205 size_t i=0;
206 UInt_t error_code = 0;
207 //Event cuts for four wires
208 for(i=0;i<8;i++){
210 status&=kTRUE;
211 }
212 else{
213 status&=kFALSE;
214 if (bDEBUG) std::cout<<" array ["<<i<<"] event cut failed ";
215 }
216 //Get the Event cut error flag for wires
217 error_code|=fPhotodiode[i].GetErrorCode();
218 }
219
220 //Event cuts for Relative X & Y
221 for(i=kXAxis;i<kNumAxes;i++){
222 fRelPos[i].UpdateErrorFlag(error_code);//To update the event cut failed error code from the channels/wires error codes
223 if (fRelPos[i].ApplySingleEventCuts()){ //for RelX
224 status&=kTRUE;
225 }
226 else{
227 status&=kFALSE;
228 if (bDEBUG) std::cout<<" Rel X event cut failed ";
229 }
230 }
231
232 //Event cuts for four wire sum (EffectiveCharge)
233 fEffectiveCharge.UpdateErrorFlag(error_code);//To update the eff-charge error code from the channels/wires event cut error codes
234 if (fEffectiveCharge.ApplySingleEventCuts()){
235 status&=kTRUE;
236 }
237 else{
238 status&=kFALSE;
239 if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
240 }
241 return status;
242}
Bool_t ApplySingleEventCuts() override
Apply single-event cuts across photodiodes and derived channels.
@ kXAxis
Definition VQwBPM.h:72
@ kNumAxes
Definition VQwBPM.h:72

References ApplySingleEventCuts(), VQwBPM::bDEBUG, fEffectiveCharge, fPhotodiode, fRelPos, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

Referenced by ApplySingleEventCuts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateRunningAverage()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::CalculateRunningAverage ( )
overridevirtual

Implements VQwBPM.

Definition at line 625 of file QwLinearDiodeArray.cc.

626{
627 size_t i = 0;
629 for (i = 0; i < 2; i++) fRelPos[i].CalculateRunningAverage();
630 fEffectiveCharge.CalculateRunningAverage();
631 return;
632}
void CalculateRunningAverage() override

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

Referenced by CalculateRunningAverage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckForBurpFail()

template<typename ChannelType>
Bool_t QwLinearDiodeArray< ChannelType >::CheckForBurpFail ( const VQwDataElement * ev_error)
overridevirtual

Check for burp failures against another linear array of same type.

Parameters
ev_errorReference array to compare against.
Returns
kTRUE if a burp failure was detected; otherwise kFALSE.

Reimplemented from VQwBPM.

Definition at line 318 of file QwLinearDiodeArray.cc.

318 {
319 Short_t i=0;
321 try {
322 if(typeid(*ev_error)==typeid(*this)) {
323 //std::cout<<" Here in QwLinearDiodeArray::CheckForBurpFail \n";
324 if (this->GetElementName()!="") {
325 const QwLinearDiodeArray* value_lin = dynamic_cast<const QwLinearDiodeArray* >(ev_error);
326 for(i=kXAxis;i<kNumAxes;i++) {
327 burpstatus |= fRelPos[i].CheckForBurpFail(&(value_lin->fRelPos[i]));
328 }
329 for(i=0;i<8;i++){
330 burpstatus |= fPhotodiode[i].CheckForBurpFail(&(value_lin->fPhotodiode[i]));
331 }
332 burpstatus |= fEffectiveCharge.CheckForBurpFail(&(value_lin->fEffectiveCharge));
333 }
334 } else {
335 TString loc="Standard exception from QwLinearDiodeArray::CheckForBurpFail :"+
336 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
337 +"same type";
338 throw std::invalid_argument(loc.Data());
339 }
340 } catch (std::exception& e) {
341 std::cerr<< e.what()<<std::endl;
342 }
343 return burpstatus;
344};
virtual const TString & GetElementName() const
Get the name of this element.

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

+ Here is the call graph for this function:

◆ ClearEventData()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ClearEventData ( )
overridevirtual

Clear event-scoped data for all pads and derived channels.

Reimplemented from VQwDataElement.

Definition at line 101 of file QwLinearDiodeArray.cc.

102{
103 size_t i=0;
104
105 for(i=0;i<8;i++) fPhotodiode[i].ClearEventData();
106
107 for(i=kXAxis;i<kNumAxes;i++){
108 fRelPos[i].ClearEventData();
109 }
110 fEffectiveCharge.ClearEventData();
111
112 return;
113}
void ClearEventData() override
Clear event-scoped data for all pads and derived channels.

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

Referenced by ClearEventData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructBranch() [1/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ConstructBranch ( TTree * tree,
TString & prefix )
overridevirtual

Implements VQwBPM.

Definition at line 736 of file QwLinearDiodeArray.cc.

737{
738 if (GetElementName()==""){
739 // This channel is not used, so skip constructing trees.
740 }
741 else {
743 if(prefix.Contains("asym_"))
744 thisprefix.ReplaceAll("asym_","diff_");
745
747
748 fEffectiveCharge.ConstructBranch(tree,prefix);
749 size_t i = 0;
750 if(bFullSave) {
752 }
753 for(i=kXAxis;i<kNumAxes;i++) {
754 fRelPos[i].ConstructBranch(tree,thisprefix);
755 }
756
757 }
758 return;
759}
void ConstructBranch(TTree *tree, TString &prefix) override
void SetRootSaveStatus(TString &prefix)
Definition VQwBPM.cc:221
Bool_t bFullSave
Definition VQwBPM.h:350

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

Referenced by ConstructBranch(), and ConstructBranch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructBranch() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & modulelist )
overridevirtual

Implements VQwBPM.

Definition at line 762 of file QwLinearDiodeArray.cc.

763{
765
767 devicename.ToLower();
768 if (GetElementName()==""){
769 // This channel is not used, so skip filling the histograms.
770 } else
771 {
772 if (modulelist.HasValue(devicename)){
774 if(prefix.Contains("asym_"))
775 thisprefix.ReplaceAll("asym_","diff_");
776
778
779 fEffectiveCharge.ConstructBranch(tree,prefix);
780 size_t i = 0;
781 if(bFullSave) {
783 }
784 for(i=kXAxis;i<kNumAxes;i++) {
785 fRelPos[i].ConstructBranch(tree,thisprefix);
786 }
787
788 QwMessage <<" Tree leaves added to "<<devicename<<" Corresponding channels"<<QwLog::endl;
789 }
790 // this functions doesn't do anything yet
791 }
792
793
794
795
796
797 return;
798}

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

+ Here is the call graph for this function:

◆ ConstructBranchAndVector()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
overridevirtual

Implements VQwBPM.

Definition at line 710 of file QwLinearDiodeArray.cc.

711{
712 if (GetElementName()==""){
713 // This channel is not used, so skip constructing trees.
714 }
715 else {
717 if(prefix.Contains("asym_"))
718 thisprefix.ReplaceAll("asym_","diff_");
719
721
722 fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
723 size_t i = 0;
724 if(bFullSave) {
726 }
727 for(i=kXAxis;i<kNumAxes;i++) {
728 fRelPos[i].ConstructBranchAndVector(tree,thisprefix,values);
729 }
730
731 }
732 return;
733}
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override

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

Referenced by ConstructBranchAndVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConstructHistograms()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ConstructHistograms ( TDirectory * folder,
TString & prefix )
overridevirtual

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 667 of file QwLinearDiodeArray.cc.

668{
669
670 if (GetElementName()=="") {
671 // This channel is not used, so skip filling the histograms.
672 } else {
673 fEffectiveCharge.ConstructHistograms(folder, prefix);
675
676 if(prefix.Contains("asym_"))
677 thisprefix.ReplaceAll("asym_","diff_");
679 size_t i = 0;
680 if(bFullSave) {
682 }
683 for(i=kXAxis;i<kNumAxes;i++) {
684 fRelPos[i].ConstructHistograms(folder, thisprefix);
685 }
686 }
687 return;
688}
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.

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

Referenced by ConstructHistograms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeaccumulateRunningSum() [1/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::DeaccumulateRunningSum ( QwLinearDiodeArray< ChannelType > & value,
Int_t ErrorMask = 0xFFFFFFF )

Definition at line 655 of file QwLinearDiodeArray.cc.

656{
657 size_t i = 0;
659 for (i = 0; i < 2; i++) fRelPos[i].DeaccumulateRunningSum(value.fRelPos[i], ErrorMask);
660 fEffectiveCharge.DeaccumulateRunningSum(value.fEffectiveCharge, ErrorMask);
661 return;
662}
void DeaccumulateRunningSum(QwLinearDiodeArray &value, Int_t ErrorMask=0xFFFFFFF)

References DeaccumulateRunningSum(), fEffectiveCharge, fPhotodiode, fRelPos, and QwLinearDiodeArray().

Referenced by DeaccumulateRunningSum(), and DeaccumulateRunningSum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeaccumulateRunningSum() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::DeaccumulateRunningSum ( VQwBPM & value,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Implements VQwBPM.

Definition at line 650 of file QwLinearDiodeArray.cc.

650 {
652}

References DeaccumulateRunningSum(), QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ EncodeEventData()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::EncodeEventData ( std::vector< UInt_t > & buffer)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 974 of file QwLinearDiodeArray.cc.

975{
976 for (size_t i=0; i<8; i++) fPhotodiode[i].EncodeEventData(buffer);
977}
void EncodeEventData(std::vector< UInt_t > &buffer) override

References EncodeEventData(), and fPhotodiode.

Referenced by EncodeEventData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillHistograms()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::FillHistograms ( )
overridevirtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 691 of file QwLinearDiodeArray.cc.

692{
693 if (GetElementName()=="") {
694 // This channel is not used, so skip filling the histograms.
695 }
696 else {
697 fEffectiveCharge.FillHistograms();
698 size_t i = 0;
699 if(bFullSave) {
700 for(i=0;i<8;i++) fPhotodiode[i].FillHistograms();
701 }
702 for(i=kXAxis;i<kNumAxes;i++){
703 fRelPos[i].FillHistograms();
704 }
705 }
706 return;
707}
void FillHistograms() override
Fill the histograms for this data element.

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

Referenced by FillHistograms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillTreeVector()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Implements VQwBPM.

Definition at line 801 of file QwLinearDiodeArray.cc.

802{
803 if (GetElementName()=="") {
804 // This channel is not used, so skip filling the tree.
805 }
806 else {
807 fEffectiveCharge.FillTreeVector(values);
808 size_t i = 0;
809 if(bFullSave) {
810 for(i=0;i<8;i++) fPhotodiode[i].FillTreeVector(values);
811 }
812 for(i=kXAxis;i<kNumAxes;i++){
813 fRelPos[i].FillTreeVector(values);
814 }
815 }
816 return;
817}
void FillTreeVector(QwRootTreeBranchVector &values) const override

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

Referenced by FillTreeVector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAbsolutePosition()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::GetAbsolutePosition ( )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 512 of file QwLinearDiodeArray.cc.

513{
514 for(size_t i=kXAxis;i<kNumAxes;i++){
515 fAbsPos[i].AddChannelOffset(fPositionCenter[i]);
516 }
517
518}
Double_t fPositionCenter[3]
Definition VQwBPM.h:330

References fAbsPos, VQwBPM::fPositionCenter, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

◆ GetEffectiveCharge()

template<typename ChannelType>
const VQwHardwareChannel * QwLinearDiodeArray< ChannelType >::GetEffectiveCharge ( ) const
inlineoverridevirtual

Implements VQwBPM.

Definition at line 97 of file QwLinearDiodeArray.h.

97{return &fEffectiveCharge;}

References fEffectiveCharge.

◆ GetEventcutErrorFlag()

template<typename ChannelType>
UInt_t QwLinearDiodeArray< ChannelType >::GetEventcutErrorFlag ( )
overridevirtual

Aggregate and return the event-cut error flag for this array.

Reimplemented from VQwDataElement.

Definition at line 164 of file QwLinearDiodeArray.cc.

165{
166 size_t i=0;
167 UInt_t error=0;
168 for(i=0;i<8;i++) error|=fPhotodiode[i].GetEventcutErrorFlag();
169 for(i=kXAxis;i<kNumAxes;i++) {
170 error|=fRelPos[i].GetEventcutErrorFlag();
171 }
172 error|=fEffectiveCharge.GetEventcutErrorFlag();
173
174 return error;
175}
UInt_t GetEventcutErrorFlag() override
Aggregate and return the event-cut error flag for this array.

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

Referenced by GetEventcutErrorFlag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPosition()

template<typename ChannelType>
const VQwHardwareChannel * QwLinearDiodeArray< ChannelType >::GetPosition ( EBeamPositionMonitorAxis axis) const
inlineoverridevirtual

Reimplemented from VQwBPM.

Definition at line 89 of file QwLinearDiodeArray.h.

89 {
90 if (axis<0 || axis>2){
91 TString loc="QwLinearDiodeArray::GetPosition for "
92 +this->GetElementName()+" failed for axis value "+Form("%d",axis);
93 throw std::out_of_range(loc.Data());
94 }
95 return &fAbsPos[axis];
96 }
static const TString axis[3]
Definition VQwBPM.h:335

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

+ Here is the call graph for this function:

◆ GetSubelementByName()

template<typename ChannelType>
VQwHardwareChannel * QwLinearDiodeArray< ChannelType >::GetSubelementByName ( TString ch_name)
overrideprotectedvirtual

Resolve an internal channel pointer by subelement name.

Parameters
ch_nameSubelement symbolic name (e.g., relx, rely, absx, absy).
Returns
Non-owning pointer to the requested hardware channel.

Implements VQwBPM.

Definition at line 251 of file QwLinearDiodeArray.cc.

252{
254 ch_name.ToLower();
255 if (ch_name=="relx"){
256 tmpptr = &fRelPos[0];
257 }else if (ch_name=="rely"){
258 tmpptr = &fRelPos[1];
259 }else if (ch_name=="absx" || ch_name=="x" ){
260 tmpptr = &fAbsPos[0];
261 }else if (ch_name=="absy" || ch_name=="y"){
262 tmpptr = &fAbsPos[1];
263 }else if (ch_name=="effectivecharge" || ch_name=="charge"){
265 } else {
266 TString loc="QwLinearDiodeArray::GetSubelementByName for"
267 + this->GetElementName() + " was passed "
268 + ch_name + ", which is an unrecognized subelement name.";
269 throw std::invalid_argument(loc.Data());
270 }
271 return tmpptr;
272}

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

+ Here is the call graph for this function:

◆ GetSubElementIndex()

template<typename ChannelType>
UInt_t QwLinearDiodeArray< ChannelType >::GetSubElementIndex ( TString subname)
static

Definition at line 490 of file QwLinearDiodeArray.cc.

491{
494
495 padindex = subname(subname.Sizeof()-2,1);
496 // Interpret the subname as the pad index.
497 if (padindex.IsDigit()){
498 Int_t tmpval = padindex.Atoi();
499 if (tmpval>-1) localindex = tmpval-1;
500 }
501
502 // localindex is unsigned int and always positive
504 std::cerr << "QwLinearDiodeArray::GetSubElementIndex is unable to associate the string -"
505 <<subname<<"- to any index"<<std::endl;
507 }
508 return localindex;
509}
static const size_t kMaxElements

References kInvalidSubelementIndex, and kMaxElements.

Referenced by QwBeamDetectorID::QwBeamDetectorID().

+ Here is the caller graph for this function:

◆ GetSubElementName()

template<typename ChannelType>
TString QwLinearDiodeArray< ChannelType >::GetSubElementName ( Int_t subindex)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 473 of file QwLinearDiodeArray.cc.

474{
477 if (subindex>-1) localindex = subindex;
478
479 if(localindex<8)
480 thisname=fPhotodiode[subindex].GetElementName();
481 else
482 std::cerr<< "QwLinearDiodeArray::GetSubElementName for "
483 << GetElementName()<<" this subindex, "
484 << subindex << ", doesn't exist \n";
485
486 return thisname;
487}

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

+ Here is the call graph for this function:

◆ IncrementErrorCounters()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::IncrementErrorCounters ( )
overridevirtual

Increment error counters for all internal channels.

Implements VQwBPM.

Definition at line 140 of file QwLinearDiodeArray.cc.

141{
142 size_t i=0;
143 for(i=0;i<8;i++) fPhotodiode[i].IncrementErrorCounters();
144 for(i=kXAxis;i<kNumAxes;i++) {
145 fRelPos[i].IncrementErrorCounters();
146 }
147 fEffectiveCharge.IncrementErrorCounters();
148}
void IncrementErrorCounters() override
Increment error counters for all internal channels.

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

Referenced by IncrementErrorCounters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeChannel() [1/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::InitializeChannel ( TString name)

Initialize this linear diode array with a detector name.

Parameters
nameDetector name used for subchannel naming.

Definition at line 41 of file QwLinearDiodeArray.cc.

42{
43
44 Int_t i=0;
47
48 for(i=0;i<8;i++) {
49 fPhotodiode[i].InitializeChannel(name+subelement[i],"raw");
50
51 if(localdebug)
52 std::cout<<" photodiode ["<<i<<"]="<<fPhotodiode[i].GetElementName()<<"\n";
53 }
54
55
56 fEffectiveCharge.InitializeChannel(name+"WS","derived");
57
58 // We don't initialize the photodiode channels yet.
59 fRelPos[0].InitializeChannel(name+"RelMean","derived");
60 fRelPos[1].InitializeChannel(name+"RelVariance","derived");
61
63
64 return;
65}
static const TString subelement[8]
void InitializeChannel(TString name)
Initialize common BPM state and set the element name.
Definition VQwBPM.cc:36

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

Referenced by QwLinearDiodeArray(), and QwLinearDiodeArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeChannel() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::InitializeChannel ( TString subsystem,
TString name )

Initialize this linear diode array with subsystem and name.

Parameters
subsystemSubsystem identifier.
nameDetector name used for subchannel naming.

Definition at line 73 of file QwLinearDiodeArray.cc.

74{
75
76 Int_t i=0;
78
80
81 for(i=0;i<8;i++) {
82 fPhotodiode[i].InitializeChannel(subsystem, "QwLinearDiodeArray", name+subelement[i],"raw");
83 if(localdebug)
84 std::cout<<" photodiode ["<<i<<"]="<<fPhotodiode[i].GetElementName()<<"\n";
85 }
86
87 fEffectiveCharge.InitializeChannel(subsystem, "QwLinearDiodeArray", name+"WS","derived");
88
89 // We don't initialize the photodiode channels yet.
90
91 fRelPos[0].InitializeChannel(subsystem, "QwLinearDiodeArray", name+"RelMean","derived");
92 fRelPos[1].InitializeChannel(subsystem, "QwLinearDiodeArray", name+"RelVariance","derived");
93
95
96 return;
97}

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

+ Here is the call graph for this function:

◆ LoadChannelParameters()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::LoadChannelParameters ( QwParameterFile & paramfile)
inlineoverridevirtual

Implements VQwBPM.

Definition at line 78 of file QwLinearDiodeArray.h.

78 {
79 for(size_t i=0;i<kMaxElements;i++)
81 }
void LoadChannelParameters(QwParameterFile &paramfile) override

References fPhotodiode, kMaxElements, and LoadChannelParameters().

Referenced by LoadChannelParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeLinearArrayList()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::MakeLinearArrayList ( )

Definition at line 881 of file QwLinearDiodeArray.cc.

882{
883 for (size_t i = kXAxis; i < kNumAxes; i++) {
885 relpos = fRelPos[i];
887 }
891}
std::vector< ChannelType > fLinearArrayElementList

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

◆ operator+=() [1/2]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType > & QwLinearDiodeArray< ChannelType >::operator+= ( const QwLinearDiodeArray< ChannelType > & value)
virtual

Definition at line 554 of file QwLinearDiodeArray.cc.

555{
556
557 if (GetElementName()!=""){
558 size_t i = 0;
560 for(i=0;i<8;i++) this->fPhotodiode[i]+=value.fPhotodiode[i];
561 for(i=kXAxis;i<kNumAxes;i++) {
562 this->fRelPos[i]+=value.fRelPos[i];
563 }
564 }
565 return *this;
566}

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

+ Here is the call graph for this function:

◆ operator+=() [2/2]

template<typename ChannelType>
VQwBPM & QwLinearDiodeArray< ChannelType >::operator+= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 546 of file QwLinearDiodeArray.cc.

547{
548 *(dynamic_cast<QwLinearDiodeArray*>(this)) +=
549 *(dynamic_cast<const QwLinearDiodeArray*>(&value));
550 return *this;
551}

References QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ operator-=() [1/2]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType > & QwLinearDiodeArray< ChannelType >::operator-= ( const QwLinearDiodeArray< ChannelType > & value)
virtual

Definition at line 577 of file QwLinearDiodeArray.cc.

578{
579
580 if (GetElementName()!=""){
581 size_t i = 0;
583 for(i=0;i<8;i++) this->fPhotodiode[i]-=value.fPhotodiode[i];
584 for(i=kXAxis;i<kNumAxes;i++) {
585 this->fRelPos[i]-=value.fRelPos[i];
586 }
587 }
588 return *this;
589}

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

+ Here is the call graph for this function:

◆ operator-=() [2/2]

template<typename ChannelType>
VQwBPM & QwLinearDiodeArray< ChannelType >::operator-= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 569 of file QwLinearDiodeArray.cc.

570{
571 *(dynamic_cast<QwLinearDiodeArray*>(this)) -=
572 *(dynamic_cast<const QwLinearDiodeArray*>(&value));
573 return *this;
574}

References QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ operator=() [1/2]

template<typename ChannelType>
QwLinearDiodeArray< ChannelType > & QwLinearDiodeArray< ChannelType >::operator= ( const QwLinearDiodeArray< ChannelType > & value)
virtual

Definition at line 530 of file QwLinearDiodeArray.cc.

531{
533
534 if (GetElementName()!=""){
535 size_t i = 0;
537 for(i=0;i<8;i++) this->fPhotodiode[i]=value.fPhotodiode[i];
538 for(i=kXAxis;i<kNumAxes;i++) {
539 this->fRelPos[i]=value.fRelPos[i];
540 }
541 }
542 return *this;
543}
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition VQwBPM.cc:157

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

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<typename ChannelType>
VQwBPM & QwLinearDiodeArray< ChannelType >::operator= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 522 of file QwLinearDiodeArray.cc.

523{
524 *(dynamic_cast<QwLinearDiodeArray*>(this)) =
525 *(dynamic_cast<const QwLinearDiodeArray*>(&value));
526 return *this;
527}

References QwLinearDiodeArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ PrintErrorCounters()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::PrintErrorCounters ( ) const
overridevirtual

Print error counters for all internal channels.

Reimplemented from VQwDataElement.

Definition at line 152 of file QwLinearDiodeArray.cc.

153{
154 size_t i=0;
155 for(i=0;i<8;i++) fPhotodiode[i].PrintErrorCounters();
156 for(i=kXAxis;i<kNumAxes;i++) {
157 fRelPos[i].PrintErrorCounters();
158 }
159 fEffectiveCharge.PrintErrorCounters();
160}
void PrintErrorCounters() const override
Print error counters for all internal channels.

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

Referenced by PrintErrorCounters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintInfo()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::PrintInfo ( ) const
overridevirtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 462 of file QwLinearDiodeArray.cc.

463{
464 size_t i = 0;
465 for (i = 0; i < 8; i++) fPhotodiode[i].PrintInfo();
466 for (i = 0; i < 2; i++) {
467 fAbsPos[i].PrintInfo();
468 }
469 fEffectiveCharge.PrintInfo();
470}
void PrintInfo() const override
Print multiple lines of information about this data element.

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

Referenced by PrintInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintValue()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::PrintValue ( ) const
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 453 of file QwLinearDiodeArray.cc.

454{
455 for (size_t i = 0; i < 2; i++) {
456 fRelPos[i].PrintValue();
457 }
458 return;
459}

References fRelPos.

◆ ProcessEvBuffer()

template<typename ChannelType>
Int_t QwLinearDiodeArray< ChannelType >::ProcessEvBuffer ( UInt_t * buffer,
UInt_t num_words_left,
UInt_t subelement )
overridevirtual

Process the CODA event buffer for this element.

Implements VQwDataElement.

Definition at line 437 of file QwLinearDiodeArray.cc.

438{
439 if(index<8)
440 {
442 }
443 else
444 {
445 std::cerr <<
446 "QwLinearDiodeArray::ProcessEvBuffer(): attempt to fill in raw data for a pad that doesn't exist \n";
447 }
449}

References fPhotodiode.

◆ ProcessEvent()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::ProcessEvent ( )
overridevirtual

Implements VQwBPM.

Definition at line 374 of file QwLinearDiodeArray.cc.

375{
377 static ChannelType mean, meansqr;
378 static ChannelType tmp("tmp");
379 static ChannelType tmp2("tmp2");
380
381 mean.InitializeChannel("mean","raw");
382 meansqr.InitializeChannel("meansqr","raw");
383
384
385 size_t i = 0;
386
387
389 //first apply HW checks and update HW error flags.
390 // Calling this routine here and not in ApplySingleEventCuts
391 //makes a difference for a LinearArrays because they have derived devices.
392
393 fEffectiveCharge.ClearEventData();
394 for(i=0;i<8;i++){
395 fPhotodiode[i].ProcessEvent();
397 }
398
399
400 // First calculate the mean pad position and mean of squared pad position
401 // with respect to the center of the array, in units of pad spacing.
404 for (i=0;i<8;i++){
406 tmp = fPhotodiode[i];
407 tmp.Scale(pos); // Scale for S(i)*pos
408 mean+=tmp;
409 tmp.Scale(pos); // Scale again for S(i)*(pos**2)
410 meansqr+=tmp;
411 }
412 fRelPos[0].Ratio(mean,fEffectiveCharge);
413 tmp = meansqr;
415 tmp2.Product(fRelPos[0], fRelPos[0]);
416
417 // Now calculate the variance
418 fRelPos[1].Difference(meansqr,tmp2);
419
420 if(localdebug){
421 std::cout<<"\n#################"<<std::endl;
422 std::cout<<" LinearArray name="<<fElementName<<std::endl;
423 std::cout<<" Size of the linear array = "<<8<<std::endl;
424 std::cout<<" event number= "<<fPhotodiode[0].GetSequenceNumber()<<std::endl;
425 for(Int_t i = 0; i<8; i++)
426 std::cout<<" pad"<<i<<" ="<<fPhotodiode[i].GetValue()<<std::endl;
427 std::cout<<" mean ="<<fRelPos[0].GetValue()<<std::endl;
428 std::cout<<" variance ="<<fRelPos[1].GetValue()<<std::endl;
429 std::cout<<" total charge ="<<fEffectiveCharge.GetValue()<<std::endl;
430
431 }
432
433 return;
434}
TString fElementName
Name of this data element.
Bool_t ApplyHWChecks()
Apply hardware checks for all photodiode pads.
static const Double_t kQwLinearDiodeArrayPadSize
void Ratio(VQwBPM &numer, VQwBPM &denom) override
void Scale(Double_t factor) override

References ApplyHWChecks(), fEffectiveCharge, VQwDataElement::fElementName, fPhotodiode, fRelPos, and kQwLinearDiodeArrayPadSize.

+ Here is the call graph for this function:

◆ RandomizeEventData()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::RandomizeEventData ( int helicity = 0,
double time = 0.0 )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 954 of file QwLinearDiodeArray.cc.

955{
956 for (size_t i=0; i<8; i++) fPhotodiode[i].RandomizeEventData(helicity, time);
957
958 return;
959}
void RandomizeEventData(int helicity=0, double time=0.0) override

References fPhotodiode, and RandomizeEventData().

Referenced by RandomizeEventData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Ratio() [1/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::Ratio ( QwLinearDiodeArray< ChannelType > & numer,
QwLinearDiodeArray< ChannelType > & denom )

Definition at line 593 of file QwLinearDiodeArray.cc.

594{
595 // this function is called when forming asymmetries. In this case what we actually want for the
596 // LinearArray is the difference only not the asymmetries
597
598 *this=numer;
600 return;
601}

References fEffectiveCharge, and QwLinearDiodeArray().

+ Here is the call graph for this function:

◆ Ratio() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::Ratio ( VQwBPM & numer,
VQwBPM & denom )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 604 of file QwLinearDiodeArray.cc.

605{
606 Ratio(*(dynamic_cast<QwLinearDiodeArray*>(&numer)), *(dynamic_cast<QwLinearDiodeArray*>(&denom)));
607}

References QwLinearDiodeArray(), Ratio(), and VQwBPM::VQwBPM().

Referenced by Ratio().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Scale()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::Scale ( Double_t factor)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 611 of file QwLinearDiodeArray.cc.

612{
613 size_t i = 0;
615
616 for(i=0;i<8;i++) fPhotodiode[i].Scale(factor);
617 for(i=kXAxis;i<kNumAxes;i++){
618 fRelPos[i].Scale(factor);
619 }
620 return;
621}

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

Referenced by Scale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDefaultSampleSize()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetDefaultSampleSize ( Int_t sample_size)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 981 of file QwLinearDiodeArray.cc.

982{
983 for(size_t i=0;i<8;i++) fPhotodiode[i].SetDefaultSampleSize((size_t)sample_size);
984 return;
985}
void SetDefaultSampleSize(Int_t sample_size) override

References fPhotodiode, and SetDefaultSampleSize().

Referenced by SetDefaultSampleSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetEventCutMode()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetEventCutMode ( Int_t bcuts)
overridevirtual

Implements VQwBPM.

Definition at line 868 of file QwLinearDiodeArray.cc.

869{
870 size_t i = 0;
871 // bEVENTCUTMODE=bcuts;
872 for (i=0;i<8;i++) fPhotodiode[i].SetEventCutMode(bcuts);
873 for (i=kXAxis;i<kNumAxes;i++) {
874 fRelPos[i].SetEventCutMode(bcuts);
875 fAbsPos[i].SetEventCutMode(bcuts);
876 }
877 fEffectiveCharge.SetEventCutMode(bcuts);
878}
void SetEventCutMode(Int_t bcuts) override

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

Referenced by SetEventCutMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetEventData()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetEventData ( Double_t * block,
UInt_t sequencenumber )

Definition at line 962 of file QwLinearDiodeArray.cc.

963{
964 for (size_t i=0; i<2; i++)
965 {
966 fRelPos[i].SetHardwareSum(relpos[i], sequencenumber);
967 }
968
969 return;
970}

References fRelPos.

◆ SetRandomEventParameters()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetRandomEventParameters ( Double_t meanX,
Double_t sigmaX,
Double_t meanY,
Double_t sigmaY )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 926 of file QwLinearDiodeArray.cc.

927{
928 // Average values of the signals in the stripline ADCs
929 Double_t sumX = 1.1e8; // These are just guesses, but I made X and Y different
930 Double_t sumY = 0.9e8; // to make it more interesting for the analyzer...
931
932
933 // Determine the asymmetry from the position
934 Double_t meanXP = (1.0 + meanX) * sumX / 2.0;
935 Double_t meanXM = (1.0 - meanX) * sumX / 2.0; // = sumX - meanXP;
936 Double_t meanYP = (1.0 + meanY) * sumY / 2.0;
937 Double_t meanYM = (1.0 - meanY) * sumY / 2.0; // = sumY - meanYP;
938
939 // Determine the spread of the asymmetry (this is not tested yet)
940 // (negative sigma should work in the QwVQWK_Channel, but still using fabs)
945
946 // Propagate these parameters to the ADCs
947 fPhotodiode[0].SetRandomEventParameters(meanXP, sigmaXP);
948 fPhotodiode[1].SetRandomEventParameters(meanXM, sigmaXM);
949 fPhotodiode[2].SetRandomEventParameters(meanYP, sigmaYP);
950 fPhotodiode[3].SetRandomEventParameters(meanYM, sigmaYM);
951}

References fPhotodiode.

◆ SetSingleEventCuts()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetSingleEventCuts ( TString ch_name,
UInt_t errorflag,
Double_t minX,
Double_t maxX,
Double_t stability,
Double_t burplevel )

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

Configure detailed single-event cuts for a named subelement.

Parameters
ch_nameSubelement name.
errorflagDevice-specific error flag mask to set.
minXLower limit.
maxXUpper limit.
stabilityStability threshold.
burplevelBurp detection threshold.

Definition at line 291 of file QwLinearDiodeArray.cc.

291 {
292 errorflag|=kBPMErrorFlag;//update the device flag (Do not have a error flag yet)
293 // QwWarning << "QwLinearDiodeArray::SetSingleEventCuts: " << "Does not do anything yet." << QwLog::endl;
294 if (ch_name=="relx"){
295 QwMessage<<"RelX LL " << minX <<" UL " << maxX <<QwLog::endl;
296 fRelPos[0].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
297
298 }else if (ch_name=="rely"){
299 QwMessage<<"RelY LL " << minX <<" UL " << maxX <<QwLog::endl;
300 fRelPos[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
301
302 } else if (ch_name=="effectivecharge"){
303 QwMessage<<"EffectveQ LL " << minX <<" UL " << maxX <<QwLog::endl;
305
306 } else if (ch_name=="photodiode"){
307 QwMessage<<"photodiode LL " << minX <<" UL " << maxX <<QwLog::endl;
308 fPhotodiode[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
309 }
310}

References QwLog::endl(), fEffectiveCharge, fPhotodiode, fRelPos, kBPMErrorFlag, and QwMessage.

+ Here is the call graph for this function:

◆ SetSubElementCalibrationFactor()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetSubElementCalibrationFactor ( Int_t j,
Double_t value )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 995 of file QwLinearDiodeArray.cc.

996{
997 fPhotodiode[j].SetCalibrationFactor(value);
998 return;
999}

References fPhotodiode.

◆ SetSubElementName()

template<typename ChannelType>
UInt_t QwLinearDiodeArray< ChannelType >::SetSubElementName ( TString subname)

References QwLinearDiodeArray(), VQwBPM::VQwBPM(), and VQwDataElement::VQwDataElement().

+ Here is the call graph for this function:

◆ SetSubElementPedestal()

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::SetSubElementPedestal ( Int_t j,
Double_t value )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 988 of file QwLinearDiodeArray.cc.

989{
990 fPhotodiode[j].SetPedestal(value);
991 return;
992}

References fPhotodiode.

◆ UpdateErrorFlag() [1/2]

template<typename ChannelType>
UInt_t QwLinearDiodeArray< ChannelType >::UpdateErrorFlag ( )
overridevirtual

Update and return the aggregated event-cut error flag.

Implements VQwBPM.

Definition at line 179 of file QwLinearDiodeArray.cc.

180{
181 size_t i=0;
182 UInt_t error1=0;
183 UInt_t error2=0;
184 for(i=0;i<8;i++){
185 error1|=fPhotodiode[i].GetErrorCode();
186 error2|=fPhotodiode[i].GetEventcutErrorFlag();
187 }
188 for(i=kXAxis;i<kNumAxes;i++) {
189 fRelPos[i].UpdateErrorFlag(error1);
190 error2|=fRelPos[i].GetEventcutErrorFlag();
191 }
192 fEffectiveCharge.UpdateErrorFlag(error1);
193 error2|=fEffectiveCharge.GetEventcutErrorFlag();
194 return error2;
195}

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

◆ UpdateErrorFlag() [2/2]

template<typename ChannelType>
void QwLinearDiodeArray< ChannelType >::UpdateErrorFlag ( const VQwBPM * ev_error)
overridevirtual

Implements VQwBPM.

Definition at line 347 of file QwLinearDiodeArray.cc.

347 {
348 Short_t i=0;
349 try {
350 if(typeid(*ev_error)==typeid(*this)) {
351 // std::cout<<" Here in QwQPD::UpdateErrorFlag \n";
352 if (this->GetElementName()!="") {
353 const QwLinearDiodeArray* value_bpm = dynamic_cast<const QwLinearDiodeArray* >(ev_error);
354 for(i=0;i<4;i++){
355 fPhotodiode[i].UpdateErrorFlag(value_bpm->fPhotodiode[i]);
356 }
357 for(i=kXAxis;i<kNumAxes;i++) {
358 fRelPos[i].UpdateErrorFlag(value_bpm->fRelPos[i]);
359 }
361 }
362 } else {
363 TString loc="Standard exception from QwLinearDiodeArray::UpdateErrorFlag :"+
364 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
365 +"same type";
366 throw std::invalid_argument(loc.Data());
367 }
368 } catch (std::exception& e) {
369 std::cerr<< e.what()<<std::endl;
370 }
371};

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

+ Here is the call graph for this function:

Field Documentation

◆ fAbsPos

template<typename ChannelType>
std::array<ChannelType,2> QwLinearDiodeArray< ChannelType >::fAbsPos
protected

◆ fEffectiveCharge

◆ fLinearArrayElementList

template<typename ChannelType>
std::vector<ChannelType> QwLinearDiodeArray< ChannelType >::fLinearArrayElementList
protected

Definition at line 187 of file QwLinearDiodeArray.h.

Referenced by MakeLinearArrayList().

◆ fPhotodiode

◆ fRelPos

◆ kMaxElements

template<typename ChannelType>
const size_t QwLinearDiodeArray< ChannelType >::kMaxElements
staticprivate

Definition at line 169 of file QwLinearDiodeArray.h.

Referenced by GetSubElementIndex(), and LoadChannelParameters().

◆ kQwLinearDiodeArrayPadSize

template<typename ChannelType>
const Double_t QwLinearDiodeArray< ChannelType >::kQwLinearDiodeArrayPadSize
staticprivate

Definition at line 173 of file QwLinearDiodeArray.h.

Referenced by ProcessEvent().

◆ subelement

template<typename ChannelType>
const TString QwLinearDiodeArray< ChannelType >::subelement[8]
staticprivate

Definition at line 170 of file QwLinearDiodeArray.h.

Referenced by InitializeChannel(), and InitializeChannel().


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