JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwLinearDiodeArray Class Reference

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

#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)
 
 ~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 VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) const override
 
const VQwHardwareChannelGetEffectiveCharge () 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
 
VQwBPMoperator= (const VQwBPM &value) override
 
VQwBPMoperator+= (const VQwBPM &value) override
 
VQwBPMoperator-= (const VQwBPM &value) override
 
virtual QwLinearDiodeArrayoperator= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArrayoperator+= (const QwLinearDiodeArray &value)
 
virtual QwLinearDiodeArrayoperator-= (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 VQwHardwareChannelGetAngleX () const
 
virtual const VQwHardwareChannelGetAngleY () 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 *)
 
VQwDataElementoperator+= (const VQwDataElement &)
 Addition-assignment operator.
 
VQwDataElementoperator-= (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 VQwBPMCreateStripline (TString subsystemname, TString type, TString name)
 A fast way of creating a BPM stripline of specified type.
 
static VQwBPMCreateStripline (const VQwBPM &source)
 
static VQwBPMCreateCombo (TString subsystemname, TString type, TString name)
 A fast way of creating a BPM stripline of specified type.
 
static VQwBPMCreateCombo (const VQwBPM &source)
 

Protected Member Functions

VQwHardwareChannelGetSubelementByName (TString ch_name) override
 Resolve an internal channel pointer by subelement name.
 
- Protected Member Functions inherited from VQwBPM
virtual VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis)
 
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.
 
VQwDataElementoperator= (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.
 
MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 

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 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_ptrfHistograms
 Histograms associated with this data element.
 

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 , 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

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 35 of file QwLinearDiodeArray.h.

Constructor & Destructor Documentation

◆ QwLinearDiodeArray() [1/4]

QwLinearDiodeArray::QwLinearDiodeArray ( )
inline

Definition at line 40 of file QwLinearDiodeArray.h.

40 {
41 };

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/4]

QwLinearDiodeArray::QwLinearDiodeArray ( TString name)
inline

Definition at line 42 of file QwLinearDiodeArray.h.

42 :VQwBPM(name){
43 };
VQwBPM()
Definition VQwBPM.h:76

References VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ QwLinearDiodeArray() [3/4]

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

Definition at line 44 of file QwLinearDiodeArray.h.

44 :VQwBPM(name){
45 SetSubsystemName(subsystemname);
46 InitializeChannel(subsystemname, name);
47 };
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/4]

QwLinearDiodeArray::QwLinearDiodeArray ( const QwLinearDiodeArray & source)
inline

Definition at line 48 of file QwLinearDiodeArray.h.

49 : VQwBPM(source),
51 {
52 for (size_t i = 0; i < 2; i++) {
53 fRelPos[i] = source.fRelPos[i];
54 fAbsPos[i] = source.fAbsPos[i];
55 }
56 for (size_t i = 0; i < 8; i++) {
57 fPhotodiode[i] = source.fPhotodiode[i];
58 }
59 }
QwVQWK_Channel fRelPos[2]
QwVQWK_Channel fAbsPos[2]
QwVQWK_Channel fPhotodiode[8]
QwVQWK_Channel fEffectiveCharge

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

+ Here is the call graph for this function:

◆ ~QwLinearDiodeArray()

QwLinearDiodeArray::~QwLinearDiodeArray ( )
inlineoverride

Definition at line 60 of file QwLinearDiodeArray.h.

60{ };

Member Function Documentation

◆ AccumulateRunningSum() [1/2]

void QwLinearDiodeArray::AccumulateRunningSum ( const QwLinearDiodeArray & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )

Definition at line 608 of file QwLinearDiodeArray.cc.

609{
610 size_t i = 0;
611 for(i=0;i<8;i++) fPhotodiode[i].AccumulateRunningSum(value.fPhotodiode[i], count, ErrorMask);
612 for (i = 0; i < 2; i++) fRelPos[i].AccumulateRunningSum(value.fRelPos[i], count, ErrorMask);
613 fEffectiveCharge.AccumulateRunningSum(value.fEffectiveCharge, count, ErrorMask);
614 return;
615}
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]

void QwLinearDiodeArray::AccumulateRunningSum ( const VQwBPM & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 604 of file QwLinearDiodeArray.cc.

604 {
605 AccumulateRunningSum(*dynamic_cast<const QwLinearDiodeArray* >(&value), count, ErrorMask);
606}

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

+ Here is the call graph for this function:

◆ ApplyHWChecks()

Bool_t QwLinearDiodeArray::ApplyHWChecks ( )

Apply hardware checks for all photodiode pads.

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

Definition at line 114 of file QwLinearDiodeArray.cc.

115{
116 Bool_t eventokay=kTRUE;
117
118 UInt_t deviceerror=0;
119 for(size_t i=0;i<8;i++)
120 {
121 deviceerror|= fPhotodiode[i].ApplyHWChecks(); //OR the error code from each wire
122 eventokay &= (deviceerror & 0x0);//AND with 0 since zero means HW is good.
123
124 if (bDEBUG) std::cout<<" Inconsistent within LinearArray terminals photodiode[ "<<i<<" ] "<<std::endl;
125 if (bDEBUG) std::cout<<" photodiode[ "<<i<<" ] sequence num "<<fPhotodiode[i].GetSequenceNumber()<<" sample size "<<fPhotodiode[i].GetNumberOfSamples()<<std::endl;
126 }
127
128 return eventokay;
129}
static const Bool_t bDEBUG
Definition VQwBPM.h:350

References VQwBPM::bDEBUG, and fPhotodiode.

Referenced by ProcessEvent().

+ Here is the caller graph for this function:

◆ ApplySingleEventCuts()

Bool_t QwLinearDiodeArray::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 190 of file QwLinearDiodeArray.cc.

191{
192 Bool_t status=kTRUE;
193 size_t i=0;
194 UInt_t error_code = 0;
195 //Event cuts for four wires
196 for(i=0;i<8;i++){
198 status&=kTRUE;
199 }
200 else{
201 status&=kFALSE;
202 if (bDEBUG) std::cout<<" array ["<<i<<"] event cut failed ";
203 }
204 //Get the Event cut error flag for wires
205 error_code|=fPhotodiode[i].GetErrorCode();
206 }
207
208 //Event cuts for Relative X & Y
209 for(i=kXAxis;i<kNumAxes;i++){
210 fRelPos[i].UpdateErrorFlag(error_code);//To update the event cut failed error code from the channels/wires error codes
211 if (fRelPos[i].ApplySingleEventCuts()){ //for RelX
212 status&=kTRUE;
213 }
214 else{
215 status&=kFALSE;
216 if (bDEBUG) std::cout<<" Rel X event cut failed ";
217 }
218 }
219
220 //Event cuts for four wire sum (EffectiveCharge)
221 fEffectiveCharge.UpdateErrorFlag(error_code);//To update the eff-charge error code from the channels/wires event cut error codes
222 if (fEffectiveCharge.ApplySingleEventCuts()){
223 status&=kTRUE;
224 }
225 else{
226 status&=kFALSE;
227 if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
228 }
229 return status;
230}
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()

void QwLinearDiodeArray::CalculateRunningAverage ( )
overridevirtual

Implements VQwBPM.

Definition at line 595 of file QwLinearDiodeArray.cc.

596{
597 size_t i = 0;
598 for(i=0;i<8;i++) fPhotodiode[i].CalculateRunningAverage();
599 for (i = 0; i < 2; i++) fRelPos[i].CalculateRunningAverage();
600 fEffectiveCharge.CalculateRunningAverage();
601 return;
602}
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()

Bool_t QwLinearDiodeArray::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 303 of file QwLinearDiodeArray.cc.

303 {
304 Short_t i=0;
305 Bool_t burpstatus = kFALSE;
306 try {
307 if(typeid(*ev_error)==typeid(*this)) {
308 //std::cout<<" Here in QwLinearDiodeArray::CheckForBurpFail \n";
309 if (this->GetElementName()!="") {
310 const QwLinearDiodeArray* value_lin = dynamic_cast<const QwLinearDiodeArray* >(ev_error);
311 for(i=kXAxis;i<kNumAxes;i++) {
312 burpstatus |= fRelPos[i].CheckForBurpFail(&(value_lin->fRelPos[i]));
313 }
314 for(i=0;i<8;i++){
315 burpstatus |= fPhotodiode[i].CheckForBurpFail(&(value_lin->fPhotodiode[i]));
316 }
317 burpstatus |= fEffectiveCharge.CheckForBurpFail(&(value_lin->fEffectiveCharge));
318 }
319 } else {
320 TString loc="Standard exception from QwLinearDiodeArray::CheckForBurpFail :"+
321 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
322 +"same type";
323 throw std::invalid_argument(loc.Data());
324 }
325 } catch (std::exception& e) {
326 std::cerr<< e.what()<<std::endl;
327 }
328 return burpstatus;
329};
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()

void QwLinearDiodeArray::ClearEventData ( )
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 95 of file QwLinearDiodeArray.cc.

96{
97 size_t i=0;
98
99 for(i=0;i<8;i++) fPhotodiode[i].ClearEventData();
100
101 for(i=kXAxis;i<kNumAxes;i++){
102 fRelPos[i].ClearEventData();
103 }
104 fEffectiveCharge.ClearEventData();
105
106 return;
107}
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]

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

Implements VQwBPM.

Definition at line 698 of file QwLinearDiodeArray.cc.

699{
700 if (GetElementName()==""){
701 // This channel is not used, so skip constructing trees.
702 }
703 else {
704 TString thisprefix=prefix;
705 if(prefix.Contains("asym_"))
706 thisprefix.ReplaceAll("asym_","diff_");
707
708 SetRootSaveStatus(prefix);
709
710 fEffectiveCharge.ConstructBranch(tree,prefix);
711 size_t i = 0;
712 if(bFullSave) {
713 for(i=0;i<8;i++) fPhotodiode[i].ConstructBranch(tree,thisprefix);
714 }
715 for(i=kXAxis;i<kNumAxes;i++) {
716 fRelPos[i].ConstructBranch(tree,thisprefix);
717 }
718
719 }
720 return;
721}
void ConstructBranch(TTree *tree, TString &prefix) override
void SetRootSaveStatus(TString &prefix)
Definition VQwBPM.cc:220
Bool_t bFullSave
Definition VQwBPM.h:348

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]

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

Implements VQwBPM.

Definition at line 723 of file QwLinearDiodeArray.cc.

724{
725 TString devicename;
726
727 devicename=GetElementName();
728 devicename.ToLower();
729 if (GetElementName()==""){
730 // This channel is not used, so skip filling the histograms.
731 } else
732 {
733 if (modulelist.HasValue(devicename)){
734 TString thisprefix=prefix;
735 if(prefix.Contains("asym_"))
736 thisprefix.ReplaceAll("asym_","diff_");
737
738 SetRootSaveStatus(prefix);
739
740 fEffectiveCharge.ConstructBranch(tree,prefix);
741 size_t i = 0;
742 if(bFullSave) {
743 for(i=0;i<8;i++) fPhotodiode[i].ConstructBranch(tree,thisprefix);
744 }
745 for(i=kXAxis;i<kNumAxes;i++) {
746 fRelPos[i].ConstructBranch(tree,thisprefix);
747 }
748
749 QwMessage <<" Tree leaves added to "<<devicename<<" Corresponding channels"<<QwLog::endl;
750 }
751 // this functions doesn't do anything yet
752 }
753
754
755
756
757
758 return;
759}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
Bool_t HasValue(TString &vname)

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()

void QwLinearDiodeArray::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
overridevirtual

Implements VQwBPM.

Definition at line 673 of file QwLinearDiodeArray.cc.

674{
675 if (GetElementName()==""){
676 // This channel is not used, so skip constructing trees.
677 }
678 else {
679 TString thisprefix=prefix;
680 if(prefix.Contains("asym_"))
681 thisprefix.ReplaceAll("asym_","diff_");
682
683 SetRootSaveStatus(prefix);
684
685 fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
686 size_t i = 0;
687 if(bFullSave) {
688 for(i=0;i<8;i++) fPhotodiode[i].ConstructBranchAndVector(tree,thisprefix,values);
689 }
690 for(i=kXAxis;i<kNumAxes;i++) {
691 fRelPos[i].ConstructBranchAndVector(tree,thisprefix,values);
692 }
693
694 }
695 return;
696}
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()

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

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 632 of file QwLinearDiodeArray.cc.

633{
634
635 if (GetElementName()=="") {
636 // This channel is not used, so skip filling the histograms.
637 } else {
638 fEffectiveCharge.ConstructHistograms(folder, prefix);
639 TString thisprefix=prefix;
640
641 if(prefix.Contains("asym_"))
642 thisprefix.ReplaceAll("asym_","diff_");
643 SetRootSaveStatus(prefix);
644 size_t i = 0;
645 if(bFullSave) {
646 for(i=0;i<8;i++) fPhotodiode[i].ConstructHistograms(folder, thisprefix);
647 }
648 for(i=kXAxis;i<kNumAxes;i++) {
649 fRelPos[i].ConstructHistograms(folder, thisprefix);
650 }
651 }
652 return;
653}
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]

void QwLinearDiodeArray::DeaccumulateRunningSum ( QwLinearDiodeArray & value,
Int_t ErrorMask = 0xFFFFFFF )

Definition at line 621 of file QwLinearDiodeArray.cc.

622{
623 size_t i = 0;
624 for(i=0;i<8;i++) fPhotodiode[i].DeaccumulateRunningSum(value.fPhotodiode[i], ErrorMask);
625 for (i = 0; i < 2; i++) fRelPos[i].DeaccumulateRunningSum(value.fRelPos[i], ErrorMask);
626 fEffectiveCharge.DeaccumulateRunningSum(value.fEffectiveCharge, ErrorMask);
627 return;
628}
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]

void QwLinearDiodeArray::DeaccumulateRunningSum ( VQwBPM & value,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Implements VQwBPM.

Definition at line 617 of file QwLinearDiodeArray.cc.

617 {
618 DeaccumulateRunningSum(*dynamic_cast<QwLinearDiodeArray* >(&value), ErrorMask);
619}

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

+ Here is the call graph for this function:

◆ EncodeEventData()

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

Reimplemented from VQwBPM.

Definition at line 927 of file QwLinearDiodeArray.cc.

928{
929 for (size_t i=0; i<8; i++) fPhotodiode[i].EncodeEventData(buffer);
930}
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()

void QwLinearDiodeArray::FillHistograms ( )
overridevirtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 655 of file QwLinearDiodeArray.cc.

656{
657 if (GetElementName()=="") {
658 // This channel is not used, so skip filling the histograms.
659 }
660 else {
661 fEffectiveCharge.FillHistograms();
662 size_t i = 0;
663 if(bFullSave) {
664 for(i=0;i<8;i++) fPhotodiode[i].FillHistograms();
665 }
666 for(i=kXAxis;i<kNumAxes;i++){
667 fRelPos[i].FillHistograms();
668 }
669 }
670 return;
671}
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()

void QwLinearDiodeArray::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Implements VQwBPM.

Definition at line 761 of file QwLinearDiodeArray.cc.

762{
763 if (GetElementName()=="") {
764 // This channel is not used, so skip filling the tree.
765 }
766 else {
767 fEffectiveCharge.FillTreeVector(values);
768 size_t i = 0;
769 if(bFullSave) {
770 for(i=0;i<8;i++) fPhotodiode[i].FillTreeVector(values);
771 }
772 for(i=kXAxis;i<kNumAxes;i++){
773 fRelPos[i].FillTreeVector(values);
774 }
775 }
776 return;
777}
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()

void QwLinearDiodeArray::GetAbsolutePosition ( )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 492 of file QwLinearDiodeArray.cc.

493{
494 for(size_t i=kXAxis;i<kNumAxes;i++){
495 fAbsPos[i].AddChannelOffset(fPositionCenter[i]);
496 }
497
498}
Double_t fPositionCenter[3]
Definition VQwBPM.h:328

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

◆ GetEffectiveCharge()

const VQwHardwareChannel * QwLinearDiodeArray::GetEffectiveCharge ( ) const
inlineoverridevirtual

Implements VQwBPM.

Definition at line 86 of file QwLinearDiodeArray.h.

86{return &fEffectiveCharge;}

References fEffectiveCharge.

◆ GetEventcutErrorFlag()

UInt_t QwLinearDiodeArray::GetEventcutErrorFlag ( )
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 154 of file QwLinearDiodeArray.cc.

155{
156 size_t i=0;
157 UInt_t error=0;
158 for(i=0;i<8;i++) error|=fPhotodiode[i].GetEventcutErrorFlag();
159 for(i=kXAxis;i<kNumAxes;i++) {
160 error|=fRelPos[i].GetEventcutErrorFlag();
161 }
162 error|=fEffectiveCharge.GetEventcutErrorFlag();
163
164 return error;
165}
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()

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

Reimplemented from VQwBPM.

Definition at line 78 of file QwLinearDiodeArray.h.

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

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

+ Here is the call graph for this function:

◆ GetSubelementByName()

VQwHardwareChannel * QwLinearDiodeArray::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 238 of file QwLinearDiodeArray.cc.

239{
240 VQwHardwareChannel* tmpptr = NULL;
241 ch_name.ToLower();
242 if (ch_name=="relx"){
243 tmpptr = &fRelPos[0];
244 }else if (ch_name=="rely"){
245 tmpptr = &fRelPos[1];
246 }else if (ch_name=="absx" || ch_name=="x" ){
247 tmpptr = &fAbsPos[0];
248 }else if (ch_name=="absy" || ch_name=="y"){
249 tmpptr = &fAbsPos[1];
250 }else if (ch_name=="effectivecharge" || ch_name=="charge"){
251 tmpptr = &fEffectiveCharge;
252 } else {
253 TString loc="QwLinearDiodeArray::GetSubelementByName for"
254 + this->GetElementName() + " was passed "
255 + ch_name + ", which is an unrecognized subelement name.";
256 throw std::invalid_argument(loc.Data());
257 }
258 return tmpptr;
259}

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

+ Here is the call graph for this function:

◆ GetSubElementIndex()

UInt_t QwLinearDiodeArray::GetSubElementIndex ( TString subname)
static

Definition at line 471 of file QwLinearDiodeArray.cc.

472{
473 size_t localindex=kInvalidSubelementIndex;
474 TString padindex;
475
476 padindex = subname(subname.Sizeof()-2,1);
477 // Interpret the subname as the pad index.
478 if (padindex.IsDigit()){
479 Int_t tmpval = padindex.Atoi();
480 if (tmpval>-1) localindex = tmpval-1;
481 }
482
483 // localindex is unsigned int and always positive
484 if (localindex > kMaxElements){
485 std::cerr << "QwLinearDiodeArray::GetSubElementIndex is unable to associate the string -"
486 <<subname<<"- to any index"<<std::endl;
487 localindex=kInvalidSubelementIndex;
488 }
489 return localindex;
490}
static const UInt_t kInvalidSubelementIndex
Definition QwTypes.h:198
static const size_t kMaxElements

References kInvalidSubelementIndex, and kMaxElements.

Referenced by QwBeamDetectorID::QwBeamDetectorID().

+ Here is the caller graph for this function:

◆ GetSubElementName()

TString QwLinearDiodeArray::GetSubElementName ( Int_t subindex)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 455 of file QwLinearDiodeArray.cc.

456{
457 TString thisname;
458 size_t localindex=kInvalidSubelementIndex;
459 if (subindex>-1) localindex = subindex;
460
461 if(localindex<8)
462 thisname=fPhotodiode[subindex].GetElementName();
463 else
464 std::cerr<< "QwLinearDiodeArray::GetSubElementName for "
465 << GetElementName()<<" this subindex, "
466 << subindex << ", doesn't exist \n";
467
468 return thisname;
469}

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

+ Here is the call graph for this function:

◆ IncrementErrorCounters()

void QwLinearDiodeArray::IncrementErrorCounters ( )
overridevirtual

Increment error counters for all internal channels.

Implements VQwBPM.

Definition at line 132 of file QwLinearDiodeArray.cc.

133{
134 size_t i=0;
135 for(i=0;i<8;i++) fPhotodiode[i].IncrementErrorCounters();
136 for(i=kXAxis;i<kNumAxes;i++) {
137 fRelPos[i].IncrementErrorCounters();
138 }
139 fEffectiveCharge.IncrementErrorCounters();
140}
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]

void QwLinearDiodeArray::InitializeChannel ( TString name)

Initialize this linear diode array with a detector name.

Parameters
nameDetector name used for subchannel naming.

Definition at line 37 of file QwLinearDiodeArray.cc.

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

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

Referenced by QwLinearDiodeArray().

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

◆ InitializeChannel() [2/2]

void QwLinearDiodeArray::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 68 of file QwLinearDiodeArray.cc.

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

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

+ Here is the call graph for this function:

◆ LoadChannelParameters()

void QwLinearDiodeArray::LoadChannelParameters ( QwParameterFile & paramfile)
inlineoverridevirtual

Implements VQwBPM.

Definition at line 67 of file QwLinearDiodeArray.h.

67 {
68 for(size_t i=0;i<kMaxElements;i++)
70 }
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()

void QwLinearDiodeArray::MakeLinearArrayList ( )

Definition at line 838 of file QwLinearDiodeArray.cc.

839{
840 for (size_t i = kXAxis; i < kNumAxes; i++) {
841 QwVQWK_Channel relpos(fRelPos[i]);
842 relpos = fRelPos[i];
843 fLinearArrayElementList.push_back(relpos);
844 }
845 QwVQWK_Channel effectivecharge(fEffectiveCharge);
846 effectivecharge = fEffectiveCharge;
847 fLinearArrayElementList.push_back(effectivecharge);
848}
std::vector< QwVQWK_Channel > fLinearArrayElementList

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

◆ operator+=() [1/2]

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

Definition at line 530 of file QwLinearDiodeArray.cc.

531{
532
533 if (GetElementName()!=""){
534 size_t i = 0;
536 for(i=0;i<8;i++) this->fPhotodiode[i]+=value.fPhotodiode[i];
537 for(i=kXAxis;i<kNumAxes;i++) {
538 this->fRelPos[i]+=value.fRelPos[i];
539 }
540 }
541 return *this;
542}

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

+ Here is the call graph for this function:

◆ operator+=() [2/2]

VQwBPM & QwLinearDiodeArray::operator+= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 523 of file QwLinearDiodeArray.cc.

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

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

+ Here is the call graph for this function:

◆ operator-=() [1/2]

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

Definition at line 551 of file QwLinearDiodeArray.cc.

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

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

+ Here is the call graph for this function:

◆ operator-=() [2/2]

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

Implements VQwBPM.

Definition at line 544 of file QwLinearDiodeArray.cc.

545{
546 *(dynamic_cast<QwLinearDiodeArray*>(this)) -=
547 *(dynamic_cast<const QwLinearDiodeArray*>(&value));
548 return *this;
549}

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

+ Here is the call graph for this function:

◆ operator=() [1/2]

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

Definition at line 508 of file QwLinearDiodeArray.cc.

509{
510 VQwBPM::operator= (value);
511
512 if (GetElementName()!=""){
513 size_t i = 0;
515 for(i=0;i<8;i++) this->fPhotodiode[i]=value.fPhotodiode[i];
516 for(i=kXAxis;i<kNumAxes;i++) {
517 this->fRelPos[i]=value.fRelPos[i];
518 }
519 }
520 return *this;
521}
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition VQwBPM.cc:156

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]

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

Implements VQwBPM.

Definition at line 501 of file QwLinearDiodeArray.cc.

502{
503 *(dynamic_cast<QwLinearDiodeArray*>(this)) =
504 *(dynamic_cast<const QwLinearDiodeArray*>(&value));
505 return *this;
506}

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

+ Here is the call graph for this function:

◆ PrintErrorCounters()

void QwLinearDiodeArray::PrintErrorCounters ( ) const
overridevirtual

Print error counters for all internal channels.

Reimplemented from VQwDataElement.

Definition at line 143 of file QwLinearDiodeArray.cc.

144{
145 size_t i=0;
146 for(i=0;i<8;i++) fPhotodiode[i].PrintErrorCounters();
147 for(i=kXAxis;i<kNumAxes;i++) {
148 fRelPos[i].PrintErrorCounters();
149 }
150 fEffectiveCharge.PrintErrorCounters();
151}
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()

void QwLinearDiodeArray::PrintInfo ( ) const
overridevirtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 444 of file QwLinearDiodeArray.cc.

445{
446 size_t i = 0;
447 for (i = 0; i < 8; i++) fPhotodiode[i].PrintInfo();
448 for (i = 0; i < 2; i++) {
449 fAbsPos[i].PrintInfo();
450 }
451 fEffectiveCharge.PrintInfo();
452}
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()

void QwLinearDiodeArray::PrintValue ( ) const
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 436 of file QwLinearDiodeArray.cc.

437{
438 for (size_t i = 0; i < 2; i++) {
439 fRelPos[i].PrintValue();
440 }
441 return;
442}

References fRelPos.

◆ ProcessEvBuffer()

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

421{
422 if(index<8)
423 {
424 fPhotodiode[index].ProcessEvBuffer(buffer,word_position_in_buffer);
425 }
426 else
427 {
428 std::cerr <<
429 "QwLinearDiodeArray::ProcessEvBuffer(): attempt to fill in raw data for a pad that doesn't exist \n";
430 }
431 return word_position_in_buffer;
432}

References fPhotodiode.

◆ ProcessEvent()

void QwLinearDiodeArray::ProcessEvent ( )
overridevirtual

Implements VQwBPM.

Definition at line 357 of file QwLinearDiodeArray.cc.

358{
359 Bool_t localdebug = kFALSE;
360 static QwVQWK_Channel mean, meansqr;
361 static QwVQWK_Channel tmp("tmp");
362 static QwVQWK_Channel tmp2("tmp2");
363
364 mean.InitializeChannel("mean","raw");
365 meansqr.InitializeChannel("meansqr","raw");
366
367
368 size_t i = 0;
369
370
372 //first apply HW checks and update HW error flags.
373 // Calling this routine here and not in ApplySingleEventCuts
374 //makes a difference for a LinearArrays because they have derived devices.
375
376 fEffectiveCharge.ClearEventData();
377 for(i=0;i<8;i++){
378 fPhotodiode[i].ProcessEvent();
380 }
381
382
383 // First calculate the mean pad position and mean of squared pad position
384 // with respect to the center of the array, in units of pad spacing.
385 mean.ClearEventData();
386 meansqr.ClearEventData();
387 for (i=0;i<8;i++){
388 Double_t pos = kQwLinearDiodeArrayPadSize*i*0.5;
389 tmp = fPhotodiode[i];
390 tmp.Scale(pos); // Scale for S(i)*pos
391 mean+=tmp;
392 tmp.Scale(pos); // Scale again for S(i)*(pos**2)
393 meansqr+=tmp;
394 }
395 fRelPos[0].Ratio(mean,fEffectiveCharge);
396 tmp = meansqr;
397 meansqr.Ratio(tmp,fEffectiveCharge);
398 tmp2.Product(fRelPos[0], fRelPos[0]);
399
400 // Now calculate the variance
401 fRelPos[1].Difference(meansqr,tmp2);
402
403 if(localdebug){
404 std::cout<<"\n#################"<<std::endl;
405 std::cout<<" LinearArray name="<<fElementName<<std::endl;
406 std::cout<<" Size of the linear array = "<<8<<std::endl;
407 std::cout<<" event number= "<<fPhotodiode[0].GetSequenceNumber()<<std::endl;
408 for(Int_t i = 0; i<8; i++)
409 std::cout<<" pad"<<i<<" ="<<fPhotodiode[i].GetValue()<<std::endl;
410 std::cout<<" mean ="<<fRelPos[0].GetValue()<<std::endl;
411 std::cout<<" variance ="<<fRelPos[1].GetValue()<<std::endl;
412 std::cout<<" total charge ="<<fEffectiveCharge.GetValue()<<std::endl;
413
414 }
415
416 return;
417}
void InitializeChannel(TString name, TString datatosave) override
Initialize the fields in this object.
void ClearEventData() override
Clear the event data in this element.
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
void Scale(Double_t Offset) override
TString fElementName
Name of this data element.
Bool_t ApplyHWChecks()
Apply hardware checks for all photodiode pads.
static const Double_t kQwLinearDiodeArrayPadSize

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

+ Here is the call graph for this function:

◆ RandomizeEventData()

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

Reimplemented from VQwBPM.

Definition at line 908 of file QwLinearDiodeArray.cc.

909{
910 for (size_t i=0; i<8; i++) fPhotodiode[i].RandomizeEventData(helicity, time);
911
912 return;
913}
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]

void QwLinearDiodeArray::Ratio ( QwLinearDiodeArray & numer,
QwLinearDiodeArray & denom )

Definition at line 566 of file QwLinearDiodeArray.cc.

567{
568 // this function is called when forming asymmetries. In this case what we actually want for the
569 // LinearArray is the difference only not the asymmetries
570
571 *this=numer;
572 this->fEffectiveCharge.Ratio(numer.fEffectiveCharge,denom.fEffectiveCharge);
573 return;
574}

References fEffectiveCharge, and QwLinearDiodeArray().

+ Here is the call graph for this function:

◆ Ratio() [2/2]

void QwLinearDiodeArray::Ratio ( VQwBPM & numer,
VQwBPM & denom )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 576 of file QwLinearDiodeArray.cc.

577{
578 Ratio(*(dynamic_cast<QwLinearDiodeArray*>(&numer)), *(dynamic_cast<QwLinearDiodeArray*>(&denom)));
579}
void Ratio(VQwBPM &numer, VQwBPM &denom) override

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()

void QwLinearDiodeArray::Scale ( Double_t factor)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 582 of file QwLinearDiodeArray.cc.

583{
584 size_t i = 0;
585 fEffectiveCharge.Scale(factor);
586
587 for(i=0;i<8;i++) fPhotodiode[i].Scale(factor);
588 for(i=kXAxis;i<kNumAxes;i++){
589 fRelPos[i].Scale(factor);
590 }
591 return;
592}
void Scale(Double_t factor) override

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()

void QwLinearDiodeArray::SetDefaultSampleSize ( Int_t sample_size)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 933 of file QwLinearDiodeArray.cc.

934{
935 for(size_t i=0;i<8;i++) fPhotodiode[i].SetDefaultSampleSize((size_t)sample_size);
936 return;
937}
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()

void QwLinearDiodeArray::SetEventCutMode ( Int_t bcuts)
overridevirtual

Implements VQwBPM.

Definition at line 825 of file QwLinearDiodeArray.cc.

826{
827 size_t i = 0;
828 // bEVENTCUTMODE=bcuts;
829 for (i=0;i<8;i++) fPhotodiode[i].SetEventCutMode(bcuts);
830 for (i=kXAxis;i<kNumAxes;i++) {
831 fRelPos[i].SetEventCutMode(bcuts);
832 fAbsPos[i].SetEventCutMode(bcuts);
833 }
834 fEffectiveCharge.SetEventCutMode(bcuts);
835}
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()

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

Definition at line 916 of file QwLinearDiodeArray.cc.

917{
918 for (size_t i=0; i<2; i++)
919 {
920 fRelPos[i].SetHardwareSum(relpos[i], sequencenumber);
921 }
922
923 return;
924}

References fRelPos.

◆ SetRandomEventParameters()

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

Reimplemented from VQwBPM.

Definition at line 880 of file QwLinearDiodeArray.cc.

881{
882 // Average values of the signals in the stripline ADCs
883 Double_t sumX = 1.1e8; // These are just guesses, but I made X and Y different
884 Double_t sumY = 0.9e8; // to make it more interesting for the analyzer...
885
886
887 // Determine the asymmetry from the position
888 Double_t meanXP = (1.0 + meanX) * sumX / 2.0;
889 Double_t meanXM = (1.0 - meanX) * sumX / 2.0; // = sumX - meanXP;
890 Double_t meanYP = (1.0 + meanY) * sumY / 2.0;
891 Double_t meanYM = (1.0 - meanY) * sumY / 2.0; // = sumY - meanYP;
892
893 // Determine the spread of the asymmetry (this is not tested yet)
894 // (negative sigma should work in the QwVQWK_Channel, but still using fabs)
895 Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
896 Double_t sigmaXM = sigmaXP;
897 Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
898 Double_t sigmaYM = sigmaYP;
899
900 // Propagate these parameters to the ADCs
901 fPhotodiode[0].SetRandomEventParameters(meanXP, sigmaXP);
902 fPhotodiode[1].SetRandomEventParameters(meanXM, sigmaXM);
903 fPhotodiode[2].SetRandomEventParameters(meanYP, sigmaYP);
904 fPhotodiode[3].SetRandomEventParameters(meanYM, sigmaYM);
905}

References fPhotodiode.

◆ SetSingleEventCuts()

void QwLinearDiodeArray::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 277 of file QwLinearDiodeArray.cc.

277 {
278 errorflag|=kBPMErrorFlag;//update the device flag (Do not have a error flag yet)
279 // QwWarning << "QwLinearDiodeArray::SetSingleEventCuts: " << "Does not do anything yet." << QwLog::endl;
280 if (ch_name=="relx"){
281 QwMessage<<"RelX LL " << minX <<" UL " << maxX <<QwLog::endl;
282 fRelPos[0].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
283
284 }else if (ch_name=="rely"){
285 QwMessage<<"RelY LL " << minX <<" UL " << maxX <<QwLog::endl;
286 fRelPos[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
287
288 } else if (ch_name=="effectivecharge"){
289 QwMessage<<"EffectveQ LL " << minX <<" UL " << maxX <<QwLog::endl;
290 fEffectiveCharge.SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
291
292 } else if (ch_name=="photodiode"){
293 QwMessage<<"photodiode LL " << minX <<" UL " << maxX <<QwLog::endl;
294 fPhotodiode[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
295 }
296}
static const UInt_t kBPMErrorFlag
Definition QwTypes.h:170

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

+ Here is the call graph for this function:

◆ SetSubElementCalibrationFactor()

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

Reimplemented from VQwBPM.

Definition at line 946 of file QwLinearDiodeArray.cc.

947{
948 fPhotodiode[j].SetCalibrationFactor(value);
949 return;
950}

References fPhotodiode.

◆ SetSubElementName()

UInt_t QwLinearDiodeArray::SetSubElementName ( TString subname)

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

+ Here is the call graph for this function:

◆ SetSubElementPedestal()

void QwLinearDiodeArray::SetSubElementPedestal ( Int_t j,
Double_t value )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 940 of file QwLinearDiodeArray.cc.

941{
942 fPhotodiode[j].SetPedestal(value);
943 return;
944}

References fPhotodiode.

◆ UpdateErrorFlag() [1/2]

UInt_t QwLinearDiodeArray::UpdateErrorFlag ( )
overridevirtual

Update and return the aggregated event-cut error flag.

Implements VQwBPM.

Definition at line 168 of file QwLinearDiodeArray.cc.

169{
170 size_t i=0;
171 UInt_t error1=0;
172 UInt_t error2=0;
173 for(i=0;i<8;i++){
174 error1|=fPhotodiode[i].GetErrorCode();
175 error2|=fPhotodiode[i].GetEventcutErrorFlag();
176 }
177 for(i=kXAxis;i<kNumAxes;i++) {
178 fRelPos[i].UpdateErrorFlag(error1);
179 error2|=fRelPos[i].GetEventcutErrorFlag();
180 }
181 fEffectiveCharge.UpdateErrorFlag(error1);
182 error2|=fEffectiveCharge.GetEventcutErrorFlag();
183 return error2;
184}

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

◆ UpdateErrorFlag() [2/2]

void QwLinearDiodeArray::UpdateErrorFlag ( const VQwBPM * ev_error)
overridevirtual

Implements VQwBPM.

Definition at line 331 of file QwLinearDiodeArray.cc.

331 {
332 Short_t i=0;
333 try {
334 if(typeid(*ev_error)==typeid(*this)) {
335 // std::cout<<" Here in QwQPD::UpdateErrorFlag \n";
336 if (this->GetElementName()!="") {
337 const QwLinearDiodeArray* value_bpm = dynamic_cast<const QwLinearDiodeArray* >(ev_error);
338 for(i=0;i<4;i++){
339 fPhotodiode[i].UpdateErrorFlag(value_bpm->fPhotodiode[i]);
340 }
341 for(i=kXAxis;i<kNumAxes;i++) {
342 fRelPos[i].UpdateErrorFlag(value_bpm->fRelPos[i]);
343 }
344 fEffectiveCharge.UpdateErrorFlag(value_bpm->fEffectiveCharge);
345 }
346 } else {
347 TString loc="Standard exception from QwLinearDiodeArray::UpdateErrorFlag :"+
348 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
349 +"same type";
350 throw std::invalid_argument(loc.Data());
351 }
352 } catch (std::exception& e) {
353 std::cerr<< e.what()<<std::endl;
354 }
355};

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

QwVQWK_Channel QwLinearDiodeArray::fAbsPos[2]
protected

◆ fEffectiveCharge

◆ fLinearArrayElementList

std::vector<QwVQWK_Channel> QwLinearDiodeArray::fLinearArrayElementList
protected

Definition at line 176 of file QwLinearDiodeArray.h.

Referenced by MakeLinearArrayList().

◆ fPhotodiode

◆ fRelPos

◆ kMaxElements

const size_t QwLinearDiodeArray::kMaxElements = 8
staticprivate

Definition at line 158 of file QwLinearDiodeArray.h.

Referenced by GetSubElementIndex(), and LoadChannelParameters().

◆ kQwLinearDiodeArrayPadSize

const Double_t QwLinearDiodeArray::kQwLinearDiodeArrayPadSize = 1.57
staticprivate

Definition at line 162 of file QwLinearDiodeArray.h.

Referenced by ProcessEvent().

◆ subelement

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

Definition at line 28 of file QwLinearDiodeArray.h.

Referenced by InitializeChannel(), and InitializeChannel().


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