JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwBPMStripline< T > Class Template Reference

Templated concrete stripline beam position monitor implementation. More...

#include <QwBPMStripline.h>

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

Public Member Functions

 QwBPMStripline ()
 
 QwBPMStripline (TString name)
 
 QwBPMStripline (TString subsystemname, TString name)
 
 QwBPMStripline (TString subsystemname, TString name, TString type)
 
 QwBPMStripline (const QwBPMStripline &source)
 
 ~QwBPMStripline () override
 
void InitializeChannel (TString name)
 Initialize this BPM stripline with a detector name.
 
void InitializeChannel (TString subsystem, TString name)
 Initialize this BPM stripline with subsystem and name.
 
void InitializeChannel (TString subsystem, TString name, TString type)
 Initialize this BPM stripline with subsystem and module type.
 
void ClearEventData () override
 Clear event-scoped data in all channels of this BPM.
 
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.
 
void WritePromptSummary (QwPromptSummary *ps, TString type)
 
const VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) const override
 
const VQwHardwareChannelGetEffectiveCharge () const override
 
const VQwHardwareChannelGetEllipticity () const
 
TString GetSubElementName (Int_t subindex) override
 
void GetAbsolutePosition () override
 
Bool_t ApplyHWChecks ()
 Apply hardware checks across all wires and derived channels.
 
Bool_t ApplySingleEventCuts () override
 
void SetSingleEventCuts (TString ch_name, UInt_t errorflag, Double_t minX, Double_t maxX, Double_t stability, Double_t burplevel)
 
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 BPM.
 
UInt_t UpdateErrorFlag () override
 Update and return the aggregated event-cut error flag.
 
Bool_t CheckForBurpFail (const VQwDataElement *ev_error) override
 Check for burp failures against another BPM of the same type.
 
void UpdateErrorFlag (const VQwBPM *ev_error) override
 
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 LoadMockDataParameters (QwParameterFile &paramfile) override
 
void ApplyResolutionSmearing () override
 
void ApplyResolutionSmearing (EBeamPositionMonitorAxis iaxis) override
 
void FillRawEventData () override
 
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 (QwBPMStripline &numer, QwBPMStripline &denom)
 
void Scale (Double_t factor) override
 
VQwBPMoperator= (const VQwBPM &value) override
 
VQwBPMoperator+= (const VQwBPM &value) override
 
VQwBPMoperator-= (const VQwBPM &value) override
 
virtual QwBPMStriplineoperator= (const QwBPMStripline &value)
 
virtual QwBPMStriplineoperator+= (const QwBPMStripline &value)
 
virtual QwBPMStriplineoperator-= (const QwBPMStripline &value)
 
void AccumulateRunningSum (const QwBPMStripline &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 (VQwBPM &value, Int_t ErrorMask=0xFFFFFFF) override
 
void DeaccumulateRunningSum (QwBPMStripline &value, Int_t ErrorMask=0xFFFFFFF)
 
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
 
- 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 ()
 
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)
 
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.
 
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

VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) override
 
VQwHardwareChannelGetSubelementByName (TString ch_name) override
 
- Protected Member Functions inherited from VQwBPM
VQwHardwareChannelGetSubelementByIndex (size_t index)
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element.
 
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

std::array< T, 4 > fWire
 
std::array< T, 2 > fRelPos
 
std::array< T, 2 > fAbsPos
 
fEffectiveCharge
 
fEllipticity
 
- 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.
 

Private Member Functions

void SetEventData (Double_t *block, UInt_t sequencenumber)
 
void MakeBPMList ()
 

Private Attributes

std::vector< T > fBPMElementList
 

Static Private Attributes

static const Double_t kRotationCorrection
 
static const TString subelement [4]
 

Friends

template<typename TT>
class QwCombinedBPM
 
class QwEnergyCalculator
 

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 T>
class QwBPMStripline< T >

Templated concrete stripline beam position monitor implementation.

Template class for stripline BPMs using hardware channel type T. Implements position calculation from four stripline signals (XP, XM, YP, YM), coordinate transformations, effective charge calculation, and calibration. Supports rotation corrections and geometry-based position calculations.

Definition at line 41 of file QwBPMStripline.h.

Constructor & Destructor Documentation

◆ QwBPMStripline() [1/5]

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

Definition at line 49 of file QwBPMStripline.h.

49{ };

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

+ Here is the caller graph for this function:

◆ QwBPMStripline() [2/5]

template<typename T>
QwBPMStripline< T >::QwBPMStripline ( TString name)
inline

Definition at line 50 of file QwBPMStripline.h.

50 {
52 fRotationAngle = 45.0;
55 };
Templated concrete stripline beam position monitor implementation.
void InitializeChannel(TString name)
Initialize this BPM stripline with a detector name.
void SetRotation(Double_t)
Set detector rotation angle and update cached trigonometric values.
Definition VQwBPM.cc:108
Double_t fRotationAngle
Definition VQwBPM.h:337
Bool_t bRotated
Definition VQwBPM.h:336

References VQwBPM::bRotated, VQwBPM::fRotationAngle, InitializeChannel(), and VQwBPM::SetRotation().

+ Here is the call graph for this function:

◆ QwBPMStripline() [3/5]

template<typename T>
QwBPMStripline< T >::QwBPMStripline ( TString subsystemname,
TString name )
inline

Definition at line 56 of file QwBPMStripline.h.

56 {
59 fRotationAngle = 45.0;
62 };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.

References VQwBPM::bRotated, VQwBPM::fRotationAngle, InitializeChannel(), VQwBPM::SetRotation(), and VQwDataElement::SetSubsystemName().

+ Here is the call graph for this function:

◆ QwBPMStripline() [4/5]

template<typename T>
QwBPMStripline< T >::QwBPMStripline ( TString subsystemname,
TString name,
TString type )
inline

Definition at line 63 of file QwBPMStripline.h.

References VQwBPM::bRotated, VQwBPM::fRotationAngle, InitializeChannel(), VQwBPM::SetRotation(), and VQwDataElement::SetSubsystemName().

+ Here is the call graph for this function:

◆ QwBPMStripline() [5/5]

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

Definition at line 70 of file QwBPMStripline.h.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, QwBPMStripline(), QwCopyArray(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ ~QwBPMStripline()

template<typename T>
QwBPMStripline< T >::~QwBPMStripline ( )
inlineoverride

Definition at line 78 of file QwBPMStripline.h.

78{ };

Member Function Documentation

◆ AccumulateRunningSum() [1/2]

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

Definition at line 796 of file QwBPMStripline.cc.

797{
798 Short_t i = 0;
799 for (i = 0; i < 4; i++){
800 fWire[i].AccumulateRunningSum(value.fWire[i], count, ErrorMask);
801 }
802 for (i = 0; i < 2; i++){
803 fRelPos[i].AccumulateRunningSum(value.fRelPos[i], count, ErrorMask);
804 fAbsPos[i].AccumulateRunningSum(value.fAbsPos[i], count, ErrorMask);
805 }
806 fEffectiveCharge.AccumulateRunningSum(value.fEffectiveCharge, count, ErrorMask);
807 fEllipticity.AccumulateRunningSum(value.fEllipticity, count, ErrorMask);
808}

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, and QwBPMStripline().

Referenced by AccumulateRunningSum().

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

◆ AccumulateRunningSum() [2/2]

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

Reimplemented from VQwBPM.

Definition at line 790 of file QwBPMStripline.cc.

791{
792 AccumulateRunningSum(*dynamic_cast<const QwBPMStripline<T>* >(&value), count, ErrorMask);
793}
void AccumulateRunningSum(const QwBPMStripline &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)

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

+ Here is the call graph for this function:

◆ ApplyHWChecks()

template<typename T>
Bool_t QwBPMStripline< T >::ApplyHWChecks ( )

Apply hardware checks across all wires and derived channels.

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

Definition at line 131 of file QwBPMStripline.cc.

132{
134
136 for(Short_t i=0;i<4;i++)
137 {
138 deviceerror|= fWire[i].ApplyHWChecks(); //OR the error code from each wire
139 eventokay &= (deviceerror & 0x0);//AND with 0 since zero means HW is good.
140
141 // if (bDEBUG) std::cout<<" Inconsistent within BPM terminals wire[ "<<i<<" ] "<<std::endl;
142 // if (bDEBUG) std::cout<<" wire[ "<<i<<" ] sequence num "<<fWire[i].GetSequenceNumber()<<" sample size "<<fWire[i].GetNumberOfSamples()<<std::endl;
143 }
144
145 return eventokay;
146}

References fWire.

Referenced by ProcessEvent().

+ Here is the caller graph for this function:

◆ ApplyResolutionSmearing() [1/2]

template<typename T>
void QwBPMStripline< T >::ApplyResolutionSmearing ( )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1243 of file QwBPMStripline.cc.

1243 {
1244 for(size_t i=kXAxis;i<kNumAxes;i++){
1245 fAbsPos[i].SmearByResolution(fResolution[i]);
1246 }
1247}
@ kXAxis
Definition VQwBPM.h:72
@ kNumAxes
Definition VQwBPM.h:72
Double_t fResolution[2]
Definition VQwBPM.h:342

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

◆ ApplyResolutionSmearing() [2/2]

template<typename T>
void QwBPMStripline< T >::ApplyResolutionSmearing ( EBeamPositionMonitorAxis iaxis)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1249 of file QwBPMStripline.cc.

1249 {
1250 // std::cout << this->GetElementName() << " resolution on axis(" << iaxis << ")==" << fResolution[iaxis] << std::endl;
1251 fAbsPos[iaxis].SmearByResolution(fResolution[iaxis]);
1252}

References fAbsPos, and VQwBPM::fResolution.

◆ ApplySingleEventCuts()

template<typename T>
Bool_t QwBPMStripline< T >::ApplySingleEventCuts ( )
overridevirtual

Implements VQwBPM.

Definition at line 287 of file QwBPMStripline.cc.

288{
290 Int_t i=0;
291
293 //Event cuts for four wires
294 for(i=0;i<4;i++){
295 if (fWire[i].ApplySingleEventCuts()){ //for RelX
296 status&=kTRUE;
297 }
298 else{
299 status&=kFALSE;
300 if (bDEBUG) std::cout<<" Abs X event cut failed ";
301 }
302 }
303
304 //Get the rex/abs X event cut error flag from xm and xp
306 //Get the rex/abs Y event cut error flag from ym and yp
308 //Update the error flags for rel and abs positions
309 fRelPos[kXAxis].UpdateErrorFlag(element_error_code[kXAxis]);
310 fRelPos[kYAxis].UpdateErrorFlag(element_error_code[kYAxis]);
311 fAbsPos[kXAxis].UpdateErrorFlag(element_error_code[kXAxis]);
312 fAbsPos[kYAxis].UpdateErrorFlag(element_error_code[kYAxis]);
313 //update the sum of error flags of all wires to the charge element
316
317
318
319 //Event cuts for Relative X & Y
320 for(i=kXAxis;i<kNumAxes;i++){
321 if (fRelPos[i].ApplySingleEventCuts()){ //for RelX
322 status&=kTRUE;
323 }
324 else{
325 status&=kFALSE;
326 if (bDEBUG) std::cout<<" Rel X event cut failed ";
327 }
328 }
329
330 for(i=kXAxis;i<kNumAxes;i++){
331 if (fAbsPos[i].ApplySingleEventCuts()){ //for RelX
332 status&=kTRUE;
333 }
334 else{
335 status&=kFALSE;
336 if (bDEBUG) std::cout<<" Abs X event cut failed ";
337 }
338 }
339
340 //Event cuts for four wire sum (EffectiveCharge) are already ORed when EffectiveCharge is calculated
341 if (fEffectiveCharge.ApplySingleEventCuts()){
342 status&=kTRUE;
343 }
344 if (fEllipticity.ApplySingleEventCuts()){
345 status&=kTRUE;
346 }
347 else{
348 status&=kFALSE;
349 if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
350 }
351 return status;
352}
virtual UInt_t GetErrorCode() const
VQwHardwareChannel * GetSubelementByName(TString ch_name) override
Bool_t ApplySingleEventCuts() override
@ kYAxis
Definition VQwBPM.h:72
static const Bool_t bDEBUG
Definition VQwBPM.h:350

References ApplySingleEventCuts(), VQwBPM::bDEBUG, fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, GetSubelementByName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::kYAxis.

Referenced by ApplySingleEventCuts().

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

◆ CalculateRunningAverage()

template<typename T>
void QwBPMStripline< T >::CalculateRunningAverage ( )
overridevirtual

Implements VQwBPM.

Definition at line 773 of file QwBPMStripline.cc.

774{
775 Short_t i = 0;
776 for (i = 0; i < 4; i++){
777 fWire[i].CalculateRunningAverage();
778 }
779
780 for (i = 0; i < 2; i++){
781 fRelPos[i].CalculateRunningAverage();
782 fAbsPos[i].CalculateRunningAverage();
783 }
784 fEffectiveCharge.CalculateRunningAverage();
785 fEllipticity.CalculateRunningAverage();
786}

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, and fWire.

◆ CheckForBurpFail()

template<typename T>
Bool_t QwBPMStripline< T >::CheckForBurpFail ( const VQwDataElement * ev_error)
overridevirtual

Check for burp failures against another BPM of the same type.

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

Reimplemented from VQwBPM.

Definition at line 225 of file QwBPMStripline.cc.

225 {
226 Short_t i=0;
228 try {
229 if(typeid(*ev_error)==typeid(*this)) {
230 //std::cout<<" Here in QwBPMStripline::CheckForBurpFail \n";
231 if (this->GetElementName()!="") {
232 const QwBPMStripline<T>* value_bpm = dynamic_cast<const QwBPMStripline<T>* >(ev_error);
233 for(i=0;i<4;i++){
234 burpstatus |= fWire[i].CheckForBurpFail(&(value_bpm->fWire[i]));
235 }
236 for(i=kXAxis;i<kNumAxes;i++) {
237 burpstatus |= fRelPos[i].CheckForBurpFail(&(value_bpm->fRelPos[i]));
238 burpstatus |= fAbsPos[i].CheckForBurpFail(&(value_bpm->fAbsPos[i]));
239 }
240 burpstatus |= fEffectiveCharge.CheckForBurpFail(&(value_bpm->fEffectiveCharge));
241 burpstatus |= fEllipticity.CheckForBurpFail(&(value_bpm->fEllipticity));
242 }
243 } else {
244 TString loc="Standard exception from QwBPMStripline::CheckForBurpFail :"+
245 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
246 +"same type";
247 throw std::invalid_argument(loc.Data());
248 }
249 } catch (std::exception& e) {
250 std::cerr<< e.what()<<std::endl;
251 }
252 return burpstatus;
253};
virtual const TString & GetElementName() const
Get the name of this element.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, QwBPMStripline(), and VQwDataElement::VQwDataElement().

+ Here is the call graph for this function:

◆ ClearEventData()

template<typename T>
void QwBPMStripline< T >::ClearEventData ( )
overridevirtual

Clear event-scoped data in all channels of this BPM.

Reimplemented from VQwDataElement.

Definition at line 109 of file QwBPMStripline.cc.

110{
111 Short_t i=0;
112
113 for(i=0;i<4;i++) fWire[i].ClearEventData();
114
115 for(i=kXAxis;i<kNumAxes;i++){
116 fAbsPos[i].ClearEventData();
117 fRelPos[i].ClearEventData();
118 }
119 fEffectiveCharge.ClearEventData();
120 fEllipticity.ClearEventData();
121
122 return;
123}
void ClearEventData() override
Clear event-scoped data in all channels of this BPM.

References ClearEventData(), fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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 T>
void QwBPMStripline< T >::ConstructBranch ( TTree * tree,
TString & prefix )
overridevirtual

Implements VQwBPM.

Definition at line 906 of file QwBPMStripline.cc.

907{
908 if (GetElementName()==""){
909 // This channel is not used, so skip constructing trees.
910 }
911 else {
913 if(prefix.Contains("asym_"))
914 thisprefix.ReplaceAll("asym_","diff_");
915
917
918 fEffectiveCharge.ConstructBranch(tree,prefix);
919 fEllipticity.ConstructBranch(tree,prefix);
920 Short_t i = 0;
921 if(bFullSave) {
922 for(i=0;i<4;i++) fWire[i].ConstructBranch(tree,thisprefix);
923 }
924 for(i=kXAxis;i<kNumAxes;i++) {
925 // 2018dec20, pking: Do not output the relative positions to Trees
926 // fRelPos[i].ConstructBranch(tree,thisprefix);
927 fAbsPos[i].ConstructBranch(tree,thisprefix);
928 }
929
930 }
931 return;
932}
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(), fAbsPos, fEffectiveCharge, fEllipticity, fWire, 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 T>
void QwBPMStripline< T >::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & modulelist )
overridevirtual

Implements VQwBPM.

Definition at line 935 of file QwBPMStripline.cc.

936{
938 /*
939 QwMessage <<" QwBCM::ConstructBranch "<<QwLog::endl;
940 modulelist.RewindToFileStart();
941 while (modulelist.ReadNextLine()){
942 modulelist.TrimComment('!'); // Remove everything after a '!' character.
943 modulelist.TrimWhitespace(); // Get rid of leading and trailing spaces.
944 QwMessage <<" "<<modulelist.GetLine()<<" ";
945 }
946 QwMessage <<QwLog::endl;
947 */
949 devicename.ToLower();
950 if (GetElementName()==""){
951 // This channel is not used, so skip filling the histograms.
952 } else
953 {
954 if (modulelist.HasValue(devicename)){
956 if(prefix.Contains("asym_"))
957 thisprefix.ReplaceAll("asym_","diff_");
958
960
961 fEffectiveCharge.ConstructBranch(tree,prefix);
962 fEllipticity.ConstructBranch(tree,prefix);
963 Short_t i = 0;
964 if(bFullSave) {
965 for(i=0;i<4;i++) fWire[i].ConstructBranch(tree,thisprefix);
966 }
967 for(i=kXAxis;i<kNumAxes;i++) {
968 // 2018dec20, pking: Do not output the relative positions to Trees
969 // fRelPos[i].ConstructBranch(tree,thisprefix);
970 fAbsPos[i].ConstructBranch(tree,thisprefix);
971 }
972
973 QwMessage <<" Tree leaves added to "<<devicename<<" Corresponding channels"<<QwLog::endl;
974 }
975 // this functions doesn't do anything yet
976 }
977
978 return;
979}

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

+ Here is the call graph for this function:

◆ ConstructBranchAndVector()

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

Implements VQwBPM.

Definition at line 877 of file QwBPMStripline.cc.

878{
879 if (GetElementName()==""){
880 // This channel is not used, so skip constructing trees.
881 }
882 else {
884 if(prefix.Contains("asym_"))
885 thisprefix.ReplaceAll("asym_","diff_");
886
888
889 fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
890 fEllipticity.ConstructBranchAndVector(tree,prefix,values);
891 Short_t i = 0;
892 if(bFullSave) {
894 }
895 for(i=kXAxis;i<kNumAxes;i++) {
896 // 2018dec20, pking: Do not output the relative positions to Trees
897 // fRelPos[i].ConstructBranchAndVector(tree,thisprefix,values);
898 fAbsPos[i].ConstructBranchAndVector(tree,thisprefix,values);
899 }
900
901 }
902 return;
903}
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override

References VQwBPM::bFullSave, ConstructBranchAndVector(), fAbsPos, fEffectiveCharge, fEllipticity, fWire, 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 T>
void QwBPMStripline< T >::ConstructHistograms ( TDirectory * folder,
TString & prefix )
overridevirtual

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 829 of file QwBPMStripline.cc.

830{
831
832 if (GetElementName()=="") {
833 // This channel is not used, so skip filling the histograms.
834 } else {
835 fEffectiveCharge.ConstructHistograms(folder, prefix);
836 fEllipticity.ConstructHistograms(folder, prefix);
838
839 if(prefix.Contains("asym_"))
840 thisprefix.ReplaceAll("asym_","diff_");
842 Short_t i = 0;
843 if(bFullSave) {
845 }
846 for(i=kXAxis;i<kNumAxes;i++) {
847 fRelPos[i].ConstructHistograms(folder, thisprefix);
848 fAbsPos[i].ConstructHistograms(folder, thisprefix);
849 }
850 }
851 return;
852}
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.

References VQwBPM::bFullSave, ConstructHistograms(), fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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 T>
void QwBPMStripline< T >::DeaccumulateRunningSum ( QwBPMStripline< T > & value,
Int_t ErrorMask = 0xFFFFFFF )

Definition at line 815 of file QwBPMStripline.cc.

815 {
816 Short_t i = 0;
817 for (i = 0; i < 4; i++){
818 fWire[i].DeaccumulateRunningSum(value.fWire[i], ErrorMask);
819 }
820 for (i = 0; i < 2; i++){
821 fRelPos[i].DeaccumulateRunningSum(value.fRelPos[i], ErrorMask);
822 fAbsPos[i].DeaccumulateRunningSum(value.fAbsPos[i], ErrorMask);
823 }
824 fEffectiveCharge.DeaccumulateRunningSum(value.fEffectiveCharge, ErrorMask);
825 fEllipticity.DeaccumulateRunningSum(value.fEllipticity, ErrorMask);
826};

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, and QwBPMStripline().

+ Here is the call graph for this function:

◆ DeaccumulateRunningSum() [2/2]

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

Implements VQwBPM.

Definition at line 810 of file QwBPMStripline.cc.

810 {
812};
void DeaccumulateRunningSum(VQwBPM &value, Int_t ErrorMask=0xFFFFFFF) override

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

Referenced by DeaccumulateRunningSum().

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

◆ EncodeEventData()

template<typename T>
void QwBPMStripline< T >::EncodeEventData ( std::vector< UInt_t > & buffer)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1346 of file QwBPMStripline.cc.

1347{
1348 for (Short_t i=0; i<4; i++) fWire[i].EncodeEventData(buffer);
1349}
void EncodeEventData(std::vector< UInt_t > &buffer) override

References EncodeEventData(), and fWire.

Referenced by EncodeEventData().

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

◆ FillHistograms()

template<typename T>
void QwBPMStripline< T >::FillHistograms ( )
overridevirtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 855 of file QwBPMStripline.cc.

856{
857 if (GetElementName()=="") {
858 // This channel is not used, so skip filling the histograms.
859 }
860 else {
861 fEffectiveCharge.FillHistograms();
862 fEllipticity.FillHistograms();
863 Short_t i = 0;
864 if(bFullSave) {
865 for(i=0;i<4;i++) fWire[i].FillHistograms();
866 }
867 for(i=kXAxis;i<kNumAxes;i++){
868 fRelPos[i].FillHistograms();
869 fAbsPos[i].FillHistograms();
870 }
871 //No data for z position
872 }
873 return;
874}
void FillHistograms() override
Fill the histograms for this data element.

References VQwBPM::bFullSave, fAbsPos, fEffectiveCharge, fEllipticity, FillHistograms(), fRelPos, fWire, 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:

◆ FillRawEventData()

template<typename T>
void QwBPMStripline< T >::FillRawEventData ( )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1255 of file QwBPMStripline.cc.

1256{
1257 //std::cout << "*******In QwBPMStripline::FillRawEventData for channel:\t" << this->GetElementName() << std::endl;
1258 // XP = XM*(A+tmpX)/(A-tmpX);
1259
1260 size_t i;
1261 static T numer("numerator","derived"), denom("denominator","derived");
1262 static T tmp1("tmp1","derived"), tmp2("tmp2","derived");
1263 static T rawpos[2] = {T("rawpos_0","derived"),T("rawpos_1","derived")};
1264 int helicity = 0; double time = 0.0;
1265
1266 numer.CopyParameters(&fAbsPos[0]);
1267 denom.CopyParameters(&fAbsPos[0]);
1268 tmp1.CopyParameters(&fAbsPos[0]);
1269 tmp2.CopyParameters(&fAbsPos[0]);
1270 rawpos[0].CopyParameters(&fAbsPos[0]);
1271 rawpos[1].CopyParameters(&fAbsPos[0]);
1272
1273 for(i=kXAxis;i<kNumAxes;i++){
1274 //fAbsPos[i].PrintValue();
1275 fRelPos[i] = fAbsPos[i];
1276 fRelPos[i].Scale(fGains[i]);
1277 fRelPos[i].AddChannelOffset(-1.0*fPositionCenter[i]);
1278 //fRelPos[i].PrintValue();
1279 }
1280
1281 for(i=kXAxis; i<kNumAxes; i++){
1282 tmp1.AssignScaledValue(fRelPos[i], fCosRotation);
1283 tmp2.AssignScaledValue(fRelPos[1-i], fSinRotation);
1284 //std::cout << "CosRotation: " << fCosRotation << std::endl;
1285 //std::cout << "SinRotation: " << fSinRotation << std::endl;
1286 if (i == kXAxis) {
1287 rawpos[i].Sum(tmp1,tmp2);
1288 } else {
1290 }
1291 }
1292
1293 for(i=kXAxis; i<kNumAxes; i++){
1294 numer.AssignScaledValue(rawpos[i],1.0);
1295 numer.AddChannelOffset(fQwStriplineCalibration);
1296 denom.AssignScaledValue(rawpos[i],-1.0);
1297 denom.AddChannelOffset(fQwStriplineCalibration);
1298 tmp2.SetRandomEventParameters(5.0, 0.005);
1299 // tmp2.SetRandomEventParameters(5.0, 0.0);
1302 if (tmp1.GetValue()<1.0){
1303 fWire[i*2+1].AssignScaledValue(tmp2, 1.0);
1304 fWire[i*2].Product(tmp1, tmp2);
1305 } else {
1306 fWire[i*2].AssignScaledValue(tmp2, 1.0);
1307 fWire[i*2+1].Ratio(tmp2, tmp1);
1308 }
1309
1310 //fWire[i*2].PrintValue();
1311 //fWire[i*2+1].PrintValue();
1312 fWire[i*2].CopyParameters(&fAbsPos[0]);
1313 fWire[i*2+1].CopyParameters(&fAbsPos[0]);
1314 fWire[i*2].SetRawEventData();
1315 fWire[i*2+1].SetRawEventData();
1316 //std::cout << "*******In QwBPMStripline::FillRawEventData for channel:\t" << this->GetElementName() << std::endl;
1317 //fWire[i*2].PrintInfo();
1318 //fWire[i*2+1].PrintInfo();
1319 }
1320
1321
1322/* for (Short_t i=0; i<4; i++) {
1323 std::cout << "wire " <<i<< std::endl;
1324 fWire[i].RandomizeEventData(helicity, time);
1325 fWire[i].PrintInfo();
1326 fWire[i].SetRawEventData();
1327 fWire[i].PrintInfo();
1328 }
1329*/
1330 return;
1331}
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 RandomizeEventData(int helicity=0, double time=0.0) override
void SetRandomEventParameters(Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY) override
void Ratio(VQwBPM &numer, VQwBPM &denom) override
Double_t fPositionCenter[3]
Definition VQwBPM.h:328
Double_t fQwStriplineCalibration
Definition VQwBPM.h:329
Double_t fGains[2]
Definition VQwBPM.h:332
Double_t fCosRotation
Definition VQwBPM.h:338
Double_t fSinRotation
Definition VQwBPM.h:339

References fAbsPos, VQwBPM::fCosRotation, VQwBPM::fGains, VQwBPM::fPositionCenter, VQwBPM::fQwStriplineCalibration, fRelPos, VQwBPM::fSinRotation, fWire, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

Referenced by RandomizeEventData().

+ Here is the caller graph for this function:

◆ FillTreeVector()

template<typename T>
void QwBPMStripline< T >::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Implements VQwBPM.

Definition at line 983 of file QwBPMStripline.cc.

984{
985 if (GetElementName()=="") {
986 // This channel is not used, so skip filling the tree.
987 }
988 else {
989 fEffectiveCharge.FillTreeVector(values);
990 fEllipticity.FillTreeVector(values);
991 Short_t i = 0;
992 if(bFullSave) {
993 for(i=0;i<4;i++) fWire[i].FillTreeVector(values);
994 }
995 for(i=kXAxis;i<kNumAxes;i++){
996 // 2018dec20, pking: Do not output the relative positions to Trees
997 // fRelPos[i].FillTreeVector(values);
998 fAbsPos[i].FillTreeVector(values);
999 }
1000 }
1001 return;
1002}
void FillTreeVector(QwRootTreeBranchVector &values) const override

References VQwBPM::bFullSave, fAbsPos, fEffectiveCharge, fEllipticity, FillTreeVector(), fWire, 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 T>
void QwBPMStripline< T >::GetAbsolutePosition ( )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 649 of file QwBPMStripline.cc.

650{
651 for(Short_t i=kXAxis;i<kNumAxes;i++){
652 fAbsPos[i]= fRelPos[i];
653 fAbsPos[i].AddChannelOffset(fPositionCenter[i]);
654 }
655 // For Z, the absolute position will be the offset we are reading from the
656 // geometry map file. Since we are not putting that to the tree it is not
657 // treated as a vqwk channel.
658}

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

◆ GetEffectiveCharge()

template<typename T>
const VQwHardwareChannel * QwBPMStripline< T >::GetEffectiveCharge ( ) const
inlineoverridevirtual

Implements VQwBPM.

Definition at line 110 of file QwBPMStripline.h.

110{return &fEffectiveCharge;}

References fEffectiveCharge.

◆ GetEllipticity()

template<typename T>
const VQwHardwareChannel * QwBPMStripline< T >::GetEllipticity ( ) const
inline

Definition at line 111 of file QwBPMStripline.h.

111{return &fEllipticity;}

References fEllipticity.

◆ GetEventcutErrorFlag()

template<typename T>
UInt_t QwBPMStripline< T >::GetEventcutErrorFlag ( )
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 181 of file QwBPMStripline.cc.

181 {
182 Short_t i=0;
183 UInt_t error=0;
184 for(i=0;i<4;i++) error|=fWire[i].GetEventcutErrorFlag();
185 for(i=kXAxis;i<kNumAxes;i++) {
186 error|=fRelPos[i].GetEventcutErrorFlag();
187 error|=fAbsPos[i].GetEventcutErrorFlag();
188 }
189 error|=fEffectiveCharge.GetEventcutErrorFlag();
190 error|=fEllipticity.GetEventcutErrorFlag();
191 return error;
192}
UInt_t GetEventcutErrorFlag() override
Aggregate and return the event-cut error flag for this BPM.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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() [1/2]

template<typename T>
const VQwHardwareChannel * QwBPMStripline< T >::GetPosition ( EBeamPositionMonitorAxis axis) const
inlineoverridevirtual

Reimplemented from VQwBPM.

Definition at line 102 of file QwBPMStripline.h.

102 {
103 if (axis<0 || axis>2){
104 TString loc="QwBPMStripline::GetPosition for "
105 +this->GetElementName()+" failed for axis value "+Form("%d",axis);
106 throw std::out_of_range(loc.Data());
107 }
108 return &fAbsPos[axis];
109 }
static const TString axis[3]
Definition VQwBPM.h:333

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

+ Here is the call graph for this function:

◆ GetPosition() [2/2]

template<typename T>
VQwHardwareChannel * QwBPMStripline< T >::GetPosition ( EBeamPositionMonitorAxis axis)
inlineoverrideprotectedvirtual

Should be used inside the QwCombinedBPM::GetProjectedPosition function to assign the BPM's X and Y values based on the slope and intercept of the combinedBPM.

Reimplemented from VQwBPM.

Definition at line 185 of file QwBPMStripline.h.

185 {
186 if (axis<0 || axis>2){
187 TString loc="QwBPMStripline::GetPosition for "
188 +this->GetElementName()+" failed for axis value "+Form("%d",axis);
189 throw std::out_of_range(loc.Data());
190 }
191 return &fAbsPos[axis];
192 }

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

+ Here is the call graph for this function:

◆ GetSubelementByName()

template<typename T>
VQwHardwareChannel * QwBPMStripline< T >::GetSubelementByName ( TString ch_name)
overrideprotectedvirtual

Implements VQwBPM.

Definition at line 355 of file QwBPMStripline.cc.

356{
358 ch_name.ToLower();
359 if (ch_name=="xp"){
360 tmpptr = &fWire[0];
361 }else if (ch_name=="xm"){
362 tmpptr = &fWire[1];
363 }else if (ch_name=="yp"){
364 tmpptr = &fWire[2];
365 }else if (ch_name=="ym"){
366 tmpptr = &fWire[3];
367 }else if (ch_name=="relx"){
368 tmpptr = &fRelPos[0];
369 }else if (ch_name=="rely"){
370 tmpptr = &fRelPos[1];
371 }else if (ch_name=="absx" || ch_name=="x" ){
372 tmpptr = &fAbsPos[0];
373 }else if (ch_name=="absy" || ch_name=="y"){
374 tmpptr = &fAbsPos[1];
375 }else if (ch_name=="effectivecharge" || ch_name=="charge"){
377 }else if (ch_name=="ellipticity" || ch_name=="elli"){
379 } else {
380 TString loc="QwBPMStripline::GetSubelementByName for"
381 + this->GetElementName() + " was passed "
382 + ch_name + ", which is an unrecognized subelement name.";
383 throw std::invalid_argument(loc.Data());
384 }
385 return tmpptr;
386}

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

Referenced by ApplySingleEventCuts().

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

◆ GetSubElementIndex()

template<typename T>
UInt_t QwBPMStripline< T >::GetSubElementIndex ( TString subname)
static

Definition at line 636 of file QwBPMStripline.cc.

637{
638 subname.ToUpper();
640 for(Short_t i=0;i<4;i++) if(subname==subelement[i])localindex=i;
641
643 std::cerr << "QwBPMStripline::GetSubElementIndex is unable to associate the string -"
644 <<subname<<"- to any index"<<std::endl;
645 return localindex;
646}
static const TString subelement[4]

References kInvalidSubelementIndex, and subelement.

Referenced by QwBeamDetectorID::QwBeamDetectorID().

+ Here is the caller graph for this function:

◆ GetSubElementName()

template<typename T>
TString QwBPMStripline< T >::GetSubElementName ( Int_t subindex)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 623 of file QwBPMStripline.cc.

624{
627 thisname=fWire[subindex].GetElementName();
628 else
629 std::cerr<<"QwBPMStripline::GetSubElementName for "<<
630 GetElementName()<<" this subindex doesn't exists \n";
631
632 return thisname;
633}

References fWire, and VQwDataElement::GetElementName().

+ Here is the call graph for this function:

◆ IncrementErrorCounters()

template<typename T>
void QwBPMStripline< T >::IncrementErrorCounters ( )
overridevirtual

Increment error counters for all internal channels.

Implements VQwBPM.

Definition at line 151 of file QwBPMStripline.cc.

152{
153 Short_t i=0;
154
155 for(i=0;i<4;i++) fWire[i].IncrementErrorCounters();
156 for(i=kXAxis;i<kNumAxes;i++) {
157 fRelPos[i].IncrementErrorCounters();
158 fAbsPos[i].IncrementErrorCounters();
159 }
160 fEffectiveCharge.IncrementErrorCounters();
161 fEllipticity.IncrementErrorCounters();
162}
void IncrementErrorCounters() override
Increment error counters for all internal channels.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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/3]

template<typename T>
void QwBPMStripline< T >::InitializeChannel ( TString name)

Initialize this BPM stripline with a detector name.

Parameters
nameDetector name used for subchannel naming.

Definition at line 34 of file QwBPMStripline.cc.

35{
36 Short_t i=0;
38
39
41
42 for(i=kXAxis;i<kNumAxes;i++)
44
45 fEffectiveCharge.InitializeChannel(name+"WS","derived");
46 fEllipticity.InitializeChannel(name+"Elli","derived");
47
48 for(i=0;i<4;i++) {
49 fWire[i].InitializeChannel(name+subelement[i],"raw");
50 if(localdebug)
51 std::cout<<" Wire ["<<i<<"]="<<fWire[i].GetElementName()<<"\n";
52 }
53
54 for(i=kXAxis;i<kNumAxes;i++) fRelPos[i].InitializeChannel(name+"Rel"+kAxisLabel[i],"derived");
55
57
58 return;
59}
static const TString kAxisLabel[2]
Definition VQwBPM.h:25
void InitializeChannel(TString name)
Initialize common BPM state and set the element name.
Definition VQwBPM.cc:35

References VQwBPM::bFullSave, fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, InitializeChannel(), VQwBPM::InitializeChannel(), VQwBPM::kAxisLabel, VQwBPM::kNumAxes, VQwBPM::kXAxis, and subelement.

Referenced by InitializeChannel(), InitializeChannel(), InitializeChannel(), QwBPMStripline(), QwBPMStripline(), and QwBPMStripline().

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

◆ InitializeChannel() [2/3]

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

Initialize this BPM stripline with subsystem and name.

Parameters
subsystemSubsystem identifier.
nameDetector name used for subchannel naming.

Definition at line 81 of file QwBPMStripline.cc.

82{
83 Short_t i=0;
85
87
88 for(i=kXAxis;i<kNumAxes;i++)
89 fAbsPos[i].InitializeChannel(subsystem, "QwBPMStripline", name+kAxisLabel[i],"derived");
90
91 fEffectiveCharge.InitializeChannel(subsystem, "QwBPMStripline", name+"WS","derived");
92 fEllipticity.InitializeChannel(subsystem, "QwBPMStripline", name+"Elli","derived");
93
94 for(i=0;i<4;i++) {
95 fWire[i].InitializeChannel(subsystem, "QwBPMStripline", name+subelement[i],"raw");
96 if(localdebug)
97 std::cout<<" Wire ["<<i<<"]="<<fWire[i].GetElementName()<<"\n";
98 }
99
100 for(i=kXAxis;i<kNumAxes;i++) fRelPos[i].InitializeChannel(subsystem, "QwBPMStripline", name+"Rel"+kAxisLabel[i],"derived");
101
103
104 return;
105}

References VQwBPM::bFullSave, fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, InitializeChannel(), VQwBPM::InitializeChannel(), VQwBPM::kAxisLabel, VQwBPM::kNumAxes, VQwBPM::kXAxis, and subelement.

+ Here is the call graph for this function:

◆ InitializeChannel() [3/3]

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

Initialize this BPM stripline with subsystem and module type.

Parameters
subsystemSubsystem identifier.
nameDetector name used for subchannel naming.
typeModule type tag used in ROOT foldering.

Definition at line 68 of file QwBPMStripline.cc.

70{
73}
void SetModuleType(TString ModuleType)
set the type of the beam instrument

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

+ Here is the call graph for this function:

◆ LoadChannelParameters()

template<typename T>
void QwBPMStripline< T >::LoadChannelParameters ( QwParameterFile & paramfile)
inlineoverridevirtual

Implements VQwBPM.

Definition at line 86 of file QwBPMStripline.h.

86 {
87 for(Short_t i=0;i<4;i++){
88 fWire[i].LoadChannelParameters(paramfile);
89 }
90 fAbsPos[0].LoadChannelParameters(paramfile);
91 fAbsPos[1].LoadChannelParameters(paramfile);
92 }

References fAbsPos, and fWire.

◆ LoadMockDataParameters()

template<typename T>
void QwBPMStripline< T >::LoadMockDataParameters ( QwParameterFile & paramfile)
overridevirtual

Reimplemented from VQwDataElement.

Definition at line 1199 of file QwBPMStripline.cc.

1199 {
1200
1201 //Bool_t ldebug=kFALSE;
1202 //Double_t asym=0.0, meanX=0.0, sigmaX=0.0, meanY=0.0, sigmaY=0.0;
1203
1204 Double_t xres=0.0, yres=0.0;
1205
1206 if (paramfile.GetLine().find("resolution")!=std::string::npos){
1207 paramfile.GetNextToken();
1208 xres = paramfile.GetTypedNextToken<Double_t>();
1209 yres = paramfile.GetTypedNextToken<Double_t>();
1210 this->SetResolution(xres, yres);
1211 } else {
1212// again, if we have asymmetry for each coord, we can use the mockable load function acting on fAbsPos[xaxis, yaxis]
1213/*
1214 asym = paramfile.GetTypedNextToken<Double_t>();
1215 meanX = paramfile.GetTypedNextToken<Double_t>();
1216 sigmaX = paramfile.GetTypedNextToken<Double_t>();
1217 meanY = paramfile.GetTypedNextToken<Double_t>();
1218 sigmaY = paramfile.GetTypedNextToken<Double_t>();
1219
1220 if (ldebug==1) {
1221 std::cout << "#################### \n";
1222 std::cout << "asym, meanX, sigmaX, meanY, sigmaY \n" << std::endl;
1223 std::cout << asym << " / "
1224 << meanX << " / "
1225 << sigmaX << " / "
1226 << meanY << " / "
1227 << sigmaY << " / "
1228 << std::endl;
1229 }
1230 this->SetRandomEventParameters(meanX, sigmaX, meanY, sigmaY);
1231 this->SetRandomEventAsymmetry(asym);
1232*/
1233 for(size_t i=kXAxis;i<kNumAxes;i++){
1234 //std::cout << "In QwBPMStripline: ChannelName = " << GetElementName() << std::endl;
1235 fAbsPos[i].SetMockDataAsDiff();
1236 fAbsPos[i].LoadMockDataParameters(paramfile);
1237 }
1238 }
1239}
virtual void SetResolution(Double_t resolutionX, Double_t resolutionY)
Definition VQwBPM.h:256

References fAbsPos, QwParameterFile::GetLine(), QwParameterFile::GetNextToken(), QwParameterFile::GetTypedNextToken(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::SetResolution().

+ Here is the call graph for this function:

◆ MakeBPMList()

template<typename T>
void QwBPMStripline< T >::MakeBPMList ( )
private

Definition at line 1070 of file QwBPMStripline.cc.

1071{
1072 for(size_t i=kXAxis;i<kNumAxes;i++) {
1073 T relpos(fRelPos[i]);
1074 relpos = fRelPos[i]; // data
1075 fBPMElementList.push_back(relpos);
1076 T abspos(fAbsPos[i]);
1077 abspos = fAbsPos[i]; // dfor(i=kXAxis;i<kNumAxes;i++){
1078 fAbsPos[i] = fRelPos[i];
1079 fAbsPos[i].AddChannelOffset(fPositionCenter[i]);
1080 fAbsPos[i].Scale(1.0/fGains[i]);
1081
1082 fBPMElementList.push_back(abspos);
1083 }
1090}
std::vector< T > fBPMElementList

References fAbsPos, fBPMElementList, fEffectiveCharge, fEllipticity, VQwBPM::fGains, VQwBPM::fPositionCenter, fRelPos, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

◆ operator+=() [1/2]

template<typename T>
QwBPMStripline< T > & QwBPMStripline< T >::operator+= ( const QwBPMStripline< T > & value)
virtual

Definition at line 697 of file QwBPMStripline.cc.

698{
699
700 if (GetElementName()!=""){
701 Short_t i = 0;
704 for(i=0;i<4;i++) this->fWire[i]+=value.fWire[i];
705 for(i=kXAxis;i<kNumAxes;i++) {
706 this->fRelPos[i]+=value.fRelPos[i];
707 this->fAbsPos[i]+=value.fAbsPos[i];
708 }
709 }
710 return *this;
711}

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and QwBPMStripline().

+ Here is the call graph for this function:

◆ operator+=() [2/2]

template<typename T>
VQwBPM & QwBPMStripline< T >::operator+= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 689 of file QwBPMStripline.cc.

690{
691 *(dynamic_cast<QwBPMStripline<T>*>(this)) +=
692 *(dynamic_cast<const QwBPMStripline<T>*>(&value));
693 return *this;
694}

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

+ Here is the call graph for this function:

◆ operator-=() [1/2]

template<typename T>
QwBPMStripline< T > & QwBPMStripline< T >::operator-= ( const QwBPMStripline< T > & value)
virtual

Definition at line 721 of file QwBPMStripline.cc.

722{
723
724 if (GetElementName()!=""){
725 Short_t i = 0;
728 for(i=0;i<4;i++) this->fWire[i]-=value.fWire[i];
729 for(i=kXAxis;i<kNumAxes;i++) {
730 this->fRelPos[i]-=value.fRelPos[i];
731 this->fAbsPos[i]-=value.fAbsPos[i];
732 }
733 }
734 return *this;
735}

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, and QwBPMStripline().

+ Here is the call graph for this function:

◆ operator-=() [2/2]

template<typename T>
VQwBPM & QwBPMStripline< T >::operator-= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 714 of file QwBPMStripline.cc.

715{
716 *(dynamic_cast<QwBPMStripline<T>*>(this)) -=
717 *(dynamic_cast<const QwBPMStripline<T>*>(&value));
718 return *this;
719}

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

+ Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T>
QwBPMStripline< T > & QwBPMStripline< T >::operator= ( const QwBPMStripline< T > & value)
virtual

Definition at line 670 of file QwBPMStripline.cc.

671{
673
674 this->bRotated=value.bRotated;
675 if (GetElementName()!=""){
676 Short_t i = 0;
679 for(i=0;i<4;i++) this->fWire[i]=value.fWire[i];
680 for(i=kXAxis;i<kNumAxes;i++) {
681 this->fRelPos[i]=value.fRelPos[i];
682 this->fAbsPos[i]=value.fAbsPos[i];
683 }
684 }
685 return *this;
686}
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition VQwBPM.cc:156

References VQwBPM::bRotated, fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, VQwBPM::operator=(), and QwBPMStripline().

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
VQwBPM & QwBPMStripline< T >::operator= ( const VQwBPM & value)
overridevirtual

Implements VQwBPM.

Definition at line 662 of file QwBPMStripline.cc.

663{
664 *(dynamic_cast<QwBPMStripline<T>*>(this)) =
665 *(dynamic_cast<const QwBPMStripline<T>*>(&value));
666 return *this;
667}

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

+ Here is the call graph for this function:

◆ PrintErrorCounters()

template<typename T>
void QwBPMStripline< T >::PrintErrorCounters ( ) const
overridevirtual

Print error counters for all internal channels.

Reimplemented from VQwDataElement.

Definition at line 166 of file QwBPMStripline.cc.

167{
168 Short_t i=0;
169
170 for(i=0;i<4;i++) fWire[i].PrintErrorCounters();
171 for(i=kXAxis;i<kNumAxes;i++) {
172 fRelPos[i].PrintErrorCounters();
173 fAbsPos[i].PrintErrorCounters();
174 }
175 fEffectiveCharge.PrintErrorCounters();
176 fEllipticity.PrintErrorCounters();
177}
void PrintErrorCounters() const override
Print error counters for all internal channels.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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 T>
void QwBPMStripline< T >::PrintInfo ( ) const
overridevirtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 609 of file QwBPMStripline.cc.

610{
611 Short_t i = 0;
612 for (i = 0; i < 4; i++) fWire[i].PrintInfo();
613 for (i = 0; i < 2; i++) {
614 fRelPos[i].PrintInfo();
615 fAbsPos[i].PrintInfo();
616 }
617 fEffectiveCharge.PrintInfo();
618 fEllipticity.PrintInfo();
619}
void PrintInfo() const override
Print multiple lines of information about this data element.

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, and PrintInfo().

Referenced by PrintInfo().

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

◆ PrintValue()

template<typename T>
void QwBPMStripline< T >::PrintValue ( ) const
overridevirtual

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

Reimplemented from VQwDataElement.

Definition at line 584 of file QwBPMStripline.cc.

585{
586 for (Short_t i = 0; i < 2; i++) {
587 fAbsPos[i].PrintValue();
588 fRelPos[i].PrintValue();
589 }
590 fEffectiveCharge.PrintValue();
591 fEllipticity.PrintValue();
592}

References fAbsPos, fEffectiveCharge, fEllipticity, and fRelPos.

◆ ProcessEvBuffer()

template<typename T>
Int_t QwBPMStripline< T >::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 567 of file QwBPMStripline.cc.

568{
569 if(index<4)
570 {
571 fWire[index].ProcessEvBuffer(buffer,word_position_in_buffer);
572 }
573 else
574 {
575 std::cerr <<
576 "QwBPMStripline::ProcessEvBuffer(): attempt to fill in raw data for a wire that doesn't exist \n";
577 }
579}

References fWire.

◆ ProcessEvent()

template<typename T>
void QwBPMStripline< T >::ProcessEvent ( )
overridevirtual

First apply HW checks and update HW error flags. Calling this routine here and not in ApplySingleEventCuts
makes a difference for a BPMs because they have derived devices.

To obtain the beam position in X and Y in the CEBAF coordinates, we use the following equations

                                                        (XP - AlphaX XM)

RelX (bpm coordinates) = fQwStriplineCalibration x GainX x -------------— (XP + AlphaX XM)

(YP - AplhaY YM) RelY (bpm coordinates) = fQwStriplineCalibration x GainY x -------------— (YP + AlphaY YM)

To get back to accelerator coordinates, rotate anti-clockwise around +Z by phi degrees (angle w.r.t X axis).

RelX (accelerator coordinates) = cos(phi) RelX - sin(phi)RelY

RelY (accelerator coordinates) = sin(phi) RelX + cos(Phi)RelY

The Ellipticity is calculated as coefficients*(xp+xm-yp-ym)/(xp+xm+yp+ym) where the coefficients are ~ 2*k/sigma, k = stripline calibration, sigma = BPM effective size

Implements VQwBPM.

Definition at line 448 of file QwBPMStripline.cc.

449{
451 static T numer("numerator","derived"), denom("denominator","derived");
452 static T tmp1("tmp1","derived"), tmp2("tmp2","derived");
453 static T tmp3("tmp3","derived"), tmp4("tmp4","derived");
454 static T tmp5("tmp3","derived");
455 static T rawpos[2] = {T("rawpos_0","derived"),T("rawpos_1","derived")};
456
457 Short_t i = 0;
458
460 /**First apply HW checks and update HW error flags.
461 Calling this routine here and not in ApplySingleEventCuts
462 makes a difference for a BPMs because they have derived devices.
463 */
464
465 fEffectiveCharge.ClearEventData();
466 fEllipticity.ClearEventData();
467
468 for(i=0;i<4;i++)
469 {
470 fWire[i].ProcessEvent();
472 if (i<2)
473 {
475 }
476 else
477 {
479 }
480 }
482 fEllipticity.Scale(0.5*fQwStriplineCalibration*fQwStriplineCalibration); // Include 2*k/sigma scale factor here
483
484 /**
485 To obtain the beam position in X and Y in the CEBAF coordinates, we use the following equations
486
487 (XP - AlphaX XM)
488 RelX (bpm coordinates) = fQwStriplineCalibration x GainX x ----------------
489 (XP + AlphaX XM)
490
491 (YP - AplhaY YM)
492 RelY (bpm coordinates) = fQwStriplineCalibration x GainY x ----------------
493 (YP + AlphaY YM)
494
495 To get back to accelerator coordinates, rotate anti-clockwise around +Z by phi degrees (angle w.r.t X axis).
496
497 RelX (accelerator coordinates) = cos(phi) RelX - sin(phi)RelY
498
499 RelY (accelerator coordinates) = sin(phi) RelX + cos(Phi)RelY
500
501 The Ellipticity is calculated as coefficients*(xp+xm-yp-ym)/(xp+xm+yp+ym)
502 where the coefficients are ~ 2*k/sigma, k = stripline calibration, sigma = BPM effective size
503 */
504
505 for(i=kXAxis;i<kNumAxes;i++)
506 {
507// fWire[i*2+1].PrintInfo();
508 fWire[i*2+1].Scale(fRelativeGains[i]);
509// fWire[i*2+1].PrintInfo();
510 numer.Difference(fWire[i*2],fWire[i*2+1]);
511 denom.Sum(fWire[i*2],fWire[i*2+1]);
514
515 if(localdebug)
516 {
517 std::cout<<" stripline name="<<fElementName<<std::endl;
518 // std::cout<<" event number= "<<fWire[i*2].GetSequenceNumber()<<std::endl;
519 std::cout<<" hw Wire["<<i*2<<"]="<<fWire[i*2].GetValue()<<" ";
520 std::cout<<" hw relative gain * Wire["<<i*2+1<<"]="<<fWire[i*2+1].GetValue()<<"\n";
521 std::cout<<" Relative gain["<<i<<"]="<<fRelativeGains[i]<<"\n";
522 std::cout<<" hw numerator= "<<numer.GetValue()<<" ";
523 std::cout<<" hw denominator= "<<denom.GetValue()<<"\n";
524 std::cout<<" Rotation = "<<fRotationAngle<<std::endl;
525 }
526 }
527
528 for(i=kXAxis;i<kNumAxes;i++){
529 tmp1.AssignScaledValue(rawpos[i], fCosRotation);
530// tmp1.PrintInfo();
531 tmp2.AssignScaledValue(rawpos[1-i], fSinRotation);
532 if (i == kXAxis) {
533 fRelPos[i].Difference(tmp1,tmp2);
534 } else {
535 fRelPos[i].Sum(tmp1,tmp2);
536 }
537 }
538
539
540 for(i=kXAxis;i<kNumAxes;i++){
541 fAbsPos[i] = fRelPos[i];
542 fAbsPos[i].AddChannelOffset(fPositionCenter[i]);
543 fAbsPos[i].Scale(1.0/fGains[i]);
544
545// Start from here.....................................
546
547 if(localdebug)
548 {
549 std::cout<<" hw fRelPos["<<kAxisLabel[i]<<"]="<<fRelPos[i].GetValue()<<"\n";
550 std::cout<<" hw fOffset["<<kAxisLabel[i]<<"]="<<fPositionCenter[i]<<"\n";
551 std::cout<<" hw fAbsPos["<<kAxisLabel[i]<<"]="<<fAbsPos[i].GetValue()<<"\n \n";
552 }
553
554 }
555 // Ellipticity gets corrected by the BPM central axis relative positions
556 tmp3.Product(fRelPos[kXAxis],fRelPos[kXAxis]);
557 tmp4.Product(fRelPos[kYAxis],fRelPos[kYAxis]);
559 tmp5.Scale(-1.0*0.250014); // FIXME Does this correction factor need a BPM specific (i.e. BSEN) scaling factor? - It already includes BSENfactor^2 because it is made of post-BSENfactor scaled X and Y values, so lets assume its ok for now
560 fEllipticity.Sum(fEllipticity,tmp5); // Correction to ellipticity (only 1st order correction)
561
562 return;
563}
TString fElementName
Name of this data element.
Bool_t ApplyHWChecks()
Apply hardware checks across all wires and derived channels.
void Scale(Double_t factor) override
Double_t fRelativeGains[2]
Definition VQwBPM.h:331

References ApplyHWChecks(), fAbsPos, VQwBPM::fCosRotation, fEffectiveCharge, VQwDataElement::fElementName, fEllipticity, VQwBPM::fGains, VQwBPM::fPositionCenter, VQwBPM::fQwStriplineCalibration, VQwBPM::fRelativeGains, fRelPos, VQwBPM::fRotationAngle, VQwBPM::fSinRotation, fWire, VQwBPM::kAxisLabel, VQwBPM::kNumAxes, VQwBPM::kXAxis, and VQwBPM::kYAxis.

+ Here is the call graph for this function:

◆ RandomizeEventData()

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

Reimplemented from VQwBPM.

Definition at line 1179 of file QwBPMStripline.cc.

1180{
1181
1182/* First randomize AbsX and AbsY, then go backwards through the steps of QwBPMStripline<T>::ProcessEvent() to get the randomized wire values.*/
1183
1184 size_t i;
1185 static T numer("numerator","derived"), denom("denominator","derived");
1186 static T tmp1("tmp1","derived"), tmp2("tmp2","derived");
1187 static T rawpos[2] = {T("rawpos_0","derived"),T("rawpos_1","derived")};
1188
1189 // std::cout << "In QwBPMStripline<T>::RandomizeEventData" << std::endl;
1190 for(i=kXAxis;i<kNumAxes;i++){
1191 fAbsPos[i].RandomizeEventData(helicity, time);
1192 //fAbsPos[i].PrintInfo();
1193 }
1194 this->FillRawEventData();
1195}
void FillRawEventData() override

References fAbsPos, FillRawEventData(), VQwBPM::kNumAxes, and VQwBPM::kXAxis.

+ Here is the call graph for this function:

◆ Ratio() [1/2]

template<typename T>
void QwBPMStripline< T >::Ratio ( QwBPMStripline< T > & numer,
QwBPMStripline< T > & denom )

Definition at line 745 of file QwBPMStripline.cc.

746{
747 // this function is called when forming asymmetries. In this case what we actually want for the
748 // stripline is the difference only not the asymmetries
749
750 *this=numer;
753}

References fEffectiveCharge, fEllipticity, and QwBPMStripline().

+ Here is the call graph for this function:

◆ Ratio() [2/2]

template<typename T>
void QwBPMStripline< T >::Ratio ( VQwBPM & numer,
VQwBPM & denom )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 738 of file QwBPMStripline.cc.

739{
740 Ratio(*dynamic_cast<QwBPMStripline<T>*>(&numer),
741 *dynamic_cast<QwBPMStripline<T>*>(&denom));
742}

References QwBPMStripline(), 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 T>
void QwBPMStripline< T >::Scale ( Double_t factor)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 758 of file QwBPMStripline.cc.

759{
760 Short_t i = 0;
762 fEllipticity.Scale(factor);
763
764 for(i=0;i<4;i++) fWire[i].Scale(factor);
765 for(Short_t i=kXAxis;i<kNumAxes;i++){
766 fRelPos[i].Scale(factor);
767 fAbsPos[i].Scale(factor);
768 }
769}

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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 T>
void QwBPMStripline< T >::SetDefaultSampleSize ( Int_t sample_size)
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1353 of file QwBPMStripline.cc.

1354{
1355 for(Short_t i=0;i<4;i++) fWire[i].SetDefaultSampleSize((size_t)sample_size);
1356 return;
1357}
void SetDefaultSampleSize(Int_t sample_size) override

References fWire, and SetDefaultSampleSize().

Referenced by SetDefaultSampleSize().

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

◆ SetEventCutMode()

template<typename T>
void QwBPMStripline< T >::SetEventCutMode ( Int_t bcuts)
overridevirtual

Implements VQwBPM.

Definition at line 1055 of file QwBPMStripline.cc.

1056{
1057 Short_t i = 0;
1058 // bEVENTCUTMODE=bcuts;
1059 for (i=0;i<4;i++) fWire[i].SetEventCutMode(bcuts);
1060 for (i=kXAxis;i<kNumAxes;i++) {
1061 fRelPos[i].SetEventCutMode(bcuts);
1062 fAbsPos[i].SetEventCutMode(bcuts);
1063 }
1064 fEffectiveCharge.SetEventCutMode(bcuts);
1065 fEllipticity.SetEventCutMode(bcuts);
1066}
void SetEventCutMode(Int_t bcuts) override

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, 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 T>
void QwBPMStripline< T >::SetEventData ( Double_t * block,
UInt_t sequencenumber )
private

Definition at line 1335 of file QwBPMStripline.cc.

1336{
1337 for (Short_t i=0; i<2; i++){
1338 //fRelPos[i].SetHardwareSum(relpos[i], sequencenumber);
1339 }
1340
1341 return;
1342}

◆ SetRandomEventParameters()

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

Reimplemented from VQwBPM.

Definition at line 1131 of file QwBPMStripline.cc.

1132{
1133 //fAbsPos[kXAxis].SetMockDataAsDiff();
1134 //fAbsPos[kYAxis].SetMockDataAsDiff();
1135
1136 fAbsPos[kXAxis].SetRandomEventParameters(meanX, sigmaX);
1137 fAbsPos[kYAxis].SetRandomEventParameters(meanY, sigmaY);
1138
1139 for(int i = 0; i < 4; i++){
1140 fWire[i].CopyParameters(&fAbsPos[0]);
1141 }
1142
1143/* // Average values of the signals in the stripline ADCs
1144 Double_t sumX = 3.5; // These are just guesses, but I made X and Y different
1145 Double_t sumY = 4.1; // to make it more interesting for the analyzer...
1146
1147 // Rotate the requested position if necessary (this is not tested yet)
1148 if (bRotated) {
1149 Double_t rotated_meanX = (meanX*fCosRotation - meanY*fSinRotation);// / fRotationCorrection;
1150 Double_t rotated_meanY = (meanX*fSinRotation + meanY*fCosRotation);// / fRotationCorrection;
1151 meanX = rotated_meanX;
1152 meanY = rotated_meanY;
1153 }
1154
1155 // Determine the asymmetry from the position
1156 Double_t meanXP = (1.0 + meanX / fQwStriplineCalibration) * sumX / 2.0;
1157 Double_t meanXM = (1.0 - meanX / fQwStriplineCalibration) * sumX / 2.0; // = sumX - meanXP;
1158 Double_t meanYP = (1.0 + meanY / fQwStriplineCalibration) * sumY / 2.0;
1159 Double_t meanYM = (1.0 - meanY / fQwStriplineCalibration) * sumY / 2.0; // = sumY - meanYP;
1160
1161 // Determine the spread of the asymmetry (this is not tested yet)
1162 // (negative sigma should work in the QwVQWK_Channel, but still using fabs)
1163 Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
1164 Double_t sigmaXM = sigmaXP;
1165 Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
1166 Double_t sigmaYM = sigmaYP;
1167
1168 // Propagate these parameters to the ADCs
1169 fWire[0].SetRandomEventParameters(meanXP, sigmaXP);
1170 fWire[1].SetRandomEventParameters(meanXM, sigmaXM);
1171 fWire[2].SetRandomEventParameters(meanYP, sigmaYP);
1172 fWire[3].SetRandomEventParameters(meanYM, sigmaYM);
1173*/
1174
1175}

References fAbsPos, fWire, VQwBPM::kXAxis, and VQwBPM::kYAxis.

◆ SetSingleEventCuts()

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

Definition at line 400 of file QwBPMStripline.cc.

400 {
401 errorflag|=kBPMErrorFlag;//update the device flag
402 if (ch_name=="xp"){
403 QwMessage<<"XP LL " << minX <<" UL " << maxX <<QwLog::endl;
404 QwError<<"***************************inside QwBPStripline "<<typeid(this).name()<<QwLog::endl;
405 fWire[0].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
406
407 }else if (ch_name=="xm"){
408 QwMessage<<"XM LL " << minX <<" UL " << maxX <<QwLog::endl;
409 fWire[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
410
411 }else if (ch_name=="yp"){
412 QwMessage<<"YP LL " << minX <<" UL " << maxX <<QwLog::endl;
413 fWire[2].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
414
415 }else if (ch_name=="ym"){
416 QwMessage<<"YM LL " << minX <<" UL " << maxX <<QwLog::endl;
417 fWire[3].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
418
419 }else if (ch_name=="relx"){
420 QwMessage<<"RelX LL " << minX <<" UL " << maxX <<QwLog::endl;
421 fRelPos[0].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
422
423 }else if (ch_name=="rely"){
424 QwMessage<<"RelY LL " << minX <<" UL " << maxX <<QwLog::endl;
425 fRelPos[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
426
427 } else if (ch_name=="absx"){
428 //cuts for the absolute x and y
429 QwMessage<<"AbsX LL " << minX <<" UL " << maxX <<QwLog::endl;
430 fAbsPos[0].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
431
432 }else if (ch_name=="absy"){
433 QwMessage<<"AbsY LL " << minX <<" UL " << maxX <<QwLog::endl;
434 fAbsPos[1].SetSingleEventCuts(errorflag,minX,maxX,stability,burplevel);
435
436 }else if (ch_name=="effectivecharge"){
437 QwMessage<<"EffectveQ LL " << minX <<" UL " << maxX <<QwLog::endl;
439
440 }else if (ch_name=="ellipticity"){
441 QwMessage<<"Ellipticity LL " << minX <<" UL " << maxX <<QwLog::endl;
443 }
444}

References QwLog::endl(), fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, kBPMErrorFlag, QwError, and QwMessage.

+ Here is the call graph for this function:

◆ SetSubElementCalibrationFactor()

template<typename T>
void QwBPMStripline< T >::SetSubElementCalibrationFactor ( Int_t j,
Double_t value )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1368 of file QwBPMStripline.cc.

1369{
1370 fWire[j].SetCalibrationFactor(value);
1371 return;
1372}

References fWire.

◆ SetSubElementPedestal()

template<typename T>
void QwBPMStripline< T >::SetSubElementPedestal ( Int_t j,
Double_t value )
overridevirtual

Reimplemented from VQwBPM.

Definition at line 1361 of file QwBPMStripline.cc.

1362{
1363 fWire[j].SetPedestal(value);
1364 return;
1365}

References fWire.

◆ UpdateErrorFlag() [1/2]

template<typename T>
UInt_t QwBPMStripline< T >::UpdateErrorFlag ( )
overridevirtual

Update and return the aggregated event-cut error flag.

Implements VQwBPM.

Definition at line 196 of file QwBPMStripline.cc.

197{
198 Short_t i=0;
199 UInt_t error1=0;
200 UInt_t error2=0;
201 for(i=0;i<4;i++){
202 error1 |= fWire[i].GetErrorCode();
203 error2 |= fWire[i].GetEventcutErrorFlag();
204 }
205 for(i=kXAxis;i<kNumAxes;i++) {
206 fRelPos[i].UpdateErrorFlag(error1);
207 fAbsPos[i].UpdateErrorFlag(error1);
208 error2|=fRelPos[i].GetEventcutErrorFlag();
209 error2|=fAbsPos[i].GetEventcutErrorFlag();
210 }
211 fEffectiveCharge.UpdateErrorFlag(error1);
212 error2|=fEffectiveCharge.GetEventcutErrorFlag();
213 fEllipticity.UpdateErrorFlag(error1);
214 error2|=fEllipticity.GetEventcutErrorFlag();
215 return error2;
216};

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwBPM::kNumAxes, and VQwBPM::kXAxis.

◆ UpdateErrorFlag() [2/2]

template<typename T>
void QwBPMStripline< T >::UpdateErrorFlag ( const VQwBPM * ev_error)
overridevirtual

Implements VQwBPM.

Definition at line 257 of file QwBPMStripline.cc.

257 {
258 Short_t i=0;
259 try {
260 if(typeid(*ev_error)==typeid(*this)) {
261 // std::cout<<" Here in QwBPMStripline::UpdateErrorFlag \n";
262 if (this->GetElementName()!="") {
263 const QwBPMStripline<T>* value_bpm = dynamic_cast<const QwBPMStripline<T>* >(ev_error);
264 for(i=0;i<4;i++){
265 fWire[i].UpdateErrorFlag(value_bpm->fWire[i]);
266 }
267 for(i=kXAxis;i<kNumAxes;i++) {
268 fRelPos[i].UpdateErrorFlag(value_bpm->fRelPos[i]);
269 fAbsPos[i].UpdateErrorFlag(value_bpm->fAbsPos[i]);
270 }
272 fEllipticity.UpdateErrorFlag(value_bpm->fEllipticity);
273 }
274 } else {
275 TString loc="Standard exception from QwBPMStripline::UpdateErrorFlag :"+
276 ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
277 +"same type";
278 throw std::invalid_argument(loc.Data());
279 }
280 } catch (std::exception& e) {
281 std::cerr<< e.what()<<std::endl;
282 }
283};

References fAbsPos, fEffectiveCharge, fEllipticity, fRelPos, fWire, VQwDataElement::GetElementName(), VQwBPM::kNumAxes, VQwBPM::kXAxis, QwBPMStripline(), and VQwBPM::VQwBPM().

+ Here is the call graph for this function:

◆ WritePromptSummary()

template<typename T>
void QwBPMStripline< T >::WritePromptSummary ( QwPromptSummary * ps,
TString type )

Definition at line 596 of file QwBPMStripline.cc.

597{
598
599 QwMessage << "void QwBPMStripline<T>::WritePromptSummary() const test " << QwLog::endl;
600 // for (Short_t i = 0; i < 2; i++) {
601 // fAbsPos[i].PrintValue();
602 // fRelPos[i].PrintValue();
603 // }
604 return;
605}

References QwLog::endl(), and QwMessage.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QwCombinedBPM

template<typename T>
template<typename TT>
friend class QwCombinedBPM
friend

Definition at line 42 of file QwBPMStripline.h.

References QwCombinedBPM.

Referenced by QwCombinedBPM.

◆ QwEnergyCalculator

template<typename T>
friend class QwEnergyCalculator
friend

Definition at line 43 of file QwBPMStripline.h.

References QwEnergyCalculator.

Referenced by QwEnergyCalculator.

Field Documentation

◆ fAbsPos

◆ fBPMElementList

template<typename T>
std::vector<T> QwBPMStripline< T >::fBPMElementList
private

Definition at line 221 of file QwBPMStripline.h.

Referenced by MakeBPMList().

◆ fEffectiveCharge

◆ fEllipticity

◆ fRelPos

◆ fWire

◆ kRotationCorrection

template<typename T>
const Double_t QwBPMStripline< T >::kRotationCorrection
staticprivate

Definition at line 203 of file QwBPMStripline.h.

◆ subelement

template<typename T>
const TString QwBPMStripline< T >::subelement[4]
staticprivate

Definition at line 204 of file QwBPMStripline.h.

Referenced by GetSubElementIndex(), InitializeChannel(), and InitializeChannel().


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