QwAnalysis
QwBPMCavity Class Reference

#include <QwBPMCavity.h>

+ Inheritance diagram for QwBPMCavity:
+ Collaboration diagram for QwBPMCavity:

Public Member Functions

 QwBPMCavity ()
 
 QwBPMCavity (TString name)
 
 QwBPMCavity (TString subsystemname, TString name)
 
 QwBPMCavity (const QwBPMCavity &source)
 
virtual ~QwBPMCavity ()
 
void InitializeChannel (TString name)
 
void InitializeChannel (TString subsystem, TString name)
 
void ClearEventData ()
 Clear the event data in this element. More...
 
void LoadChannelParameters (QwParameterFile &paramfile)
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber)
 Process the CODA event buffer for this element. More...
 
void ProcessEvent ()
 
void PrintValue () const
 Print single line of value and error of this data element. More...
 
void PrintInfo () const
 Print multiple lines of information about this data element. More...
 
const VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) const
 
const VQwHardwareChannelGetEffectiveCharge () const
 
TString GetSubElementName (Int_t subindex)
 
void GetAbsolutePosition ()
 
Bool_t ApplyHWChecks ()
 
Bool_t ApplySingleEventCuts ()
 
void SetEventCutMode (Int_t bcuts)
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel. More...
 
void IncrementErrorCounters ()
 
void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure More...
 
UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device More...
 
UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
void UpdateErrorFlag (const VQwBPM *ev_error)
 
void SetDefaultSampleSize (Int_t sample_size)
 
void SetRandomEventParameters (Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
 
void RandomizeEventData (int helicity=0, double time=0.0)
 
void SetEventData (Double_t *block, UInt_t sequencenumber)
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
void SetSubElementPedestal (Int_t j, Double_t value)
 
void SetSubElementCalibrationFactor (Int_t j, Double_t value)
 
void Ratio (QwBPMCavity &numer, QwBPMCavity &denom)
 
void Scale (Double_t factor)
 
VQwBPMoperator= (const VQwBPM &value)
 
VQwBPMoperator+= (const VQwBPM &value)
 
VQwBPMoperator-= (const VQwBPM &value)
 
virtual QwBPMCavityoperator= (const QwBPMCavity &value)
 
virtual QwBPMCavityoperator+= (const QwBPMCavity &value)
 
virtual QwBPMCavityoperator-= (const QwBPMCavity &value)
 
void AccumulateRunningSum (const VQwBPM &value)
 
void AccumulateRunningSum (const QwBPMCavity &value)
 
void DeaccumulateRunningSum (VQwBPM &value)
 
void DeaccumulateRunningSum (QwBPMCavity &value)
 
void CalculateRunningAverage ()
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this data element. More...
 
void FillHistograms ()
 Fill the histograms for this data element. More...
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 
void FillTreeVector (std::vector< Double_t > &values) const
 
void ConstructBranch (TTree *tree, TString &prefix)
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist)
 
std::vector< QwDBInterfaceGetDBEntry ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
- Public Member Functions inherited from VQwBPM
 VQwBPM ()
 
 VQwBPM (TString &name)
 
 VQwBPM (const VQwBPM &source)
 
virtual ~VQwBPM ()
 
void InitializeChannel (TString name)
 
void GetSurveyOffsets (Double_t Xoffset, Double_t Yoffset, Double_t Zoffset)
 
void GetElectronicFactors (Double_t BSENfactor, Double_t AlphaX, Double_t AlphaY)
 
void SetRotation (Double_t)
 
void SetRotationOff ()
 
void SetSingleEventCuts (TString, Double_t, Double_t)
 
void SetSingleEventCuts (TString, UInt_t, Double_t, Double_t, Double_t)
 
void SetGains (TString pos, Double_t value)
 
void SetRootSaveStatus (TString &prefix)
 
Double_t GetPositionInZ () const
 
virtual void Ratio (VQwBPM &numer, VQwBPM &denom)
 
virtual const VQwHardwareChannelGetAngleX () const
 
virtual const VQwHardwareChannelGetAngleY () const
 
virtual void SetBPMForCombo (const VQwBPM *bpm, Double_t charge_weight, Double_t x_weight, Double_t y_weight, Double_t sumqw)
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor. More...
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor. More...
 
virtual ~VQwDataElement ()
 Virtual destructor. More...
 
Bool_t IsNameEmpty () const
 Is the name of this element empty? More...
 
void SetElementName (const TString &name)
 Set the name of this element. More...
 
virtual const TString & GetElementName () const
 Get the name of this element. More...
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element. More...
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *valueptr)
 
virtual VQwDataElementoperator+= (const VQwDataElement &value)
 Addition-assignment operator. More...
 
virtual VQwDataElementoperator-= (const VQwDataElement &value)
 Subtraction-assignment operator. More...
 
virtual void Sum (const VQwDataElement &value1, const VQwDataElement &value2)
 Sum operator. More...
 
virtual void Difference (const VQwDataElement &value1, const VQwDataElement &value2)
 Difference operator. More...
 
virtual void Ratio (const VQwDataElement &numer, const VQwDataElement &denom)
 Ratio operator. More...
 
virtual void SetSingleEventCuts (UInt_t errorflag, Double_t min, Double_t max, Double_t stability)
 set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel More...
 
virtual void SetNeedsExternalClock (Bool_t needed)
 
virtual Bool_t NeedsExternalClock ()
 
virtual std::string GetExternalClockName ()
 
virtual void SetExternalClockPtr (const VQwHardwareChannel *clock)
 
virtual void SetExternalClockName (const std::string name)
 
virtual Double_t GetNormClockValue ()
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name. More...
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name. More...
 
TString GetModuleType () const
 Return the type of the beam instrument. More...
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument More...
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects. More...
 

Static Public Member Functions

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

Protected Member Functions

VQwHardwareChannelGetSubelementByName (TString ch_name)
 
- Protected Member Functions inherited from VQwBPM
VQwHardwareChannelGetSubelementByIndex (size_t index)
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element. More...
 
virtual VQwDataElementoperator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data. More...
 
virtual void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor. More...
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor. More...
 
virtual ~MQwHistograms ()
 Virtual destructor. More...
 
virtual MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram. More...
 

Protected Attributes

Bool_t bRotated
 
QwVQWK_Channel fWire [2]
 
QwVQWK_Channel fRelPos [2]
 
QwVQWK_Channel fAbsPos [2]
 
QwVQWK_Channel fEffectiveCharge
 
- Protected Attributes inherited from VQwBPM
std::vector< TString > fSubelementNames
 
Double_t fPositionCenter [3]
 
Double_t fQwStriplineCalibration
 
Double_t fRelativeGains [2]
 
Double_t fGains [2]
 
Bool_t bRotated
 
Double_t fRotationAngle
 
Double_t fCosRotation
 
Double_t fSinRotation
 
Bool_t fGoodEvent
 
Bool_t bFullSave
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element. More...
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element. More...
 
Int_t fGoodEventCount
 Number of good events accumulated in this element. More...
 
TString fSubsystemName
 
TString fModuleType
 
UInt_t fErrorFlag
 This the standard error code generated for the channel that contains the global/local/stability flags and the Device error code (Unique error code for HW failures) More...
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags More...
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element. More...
 

Private Member Functions

void MakeBPMCavityList ()
 

Private Attributes

std::vector< QwVQWK_ChannelfBPMElementList
 

Static Private Attributes

static const Double_t kQwCavityCalibration = 1e-8
 
static const Double_t kRotationCorrection = 1./1.414
 
static const TString subelement [3] ={"X","Y","Q"}
 

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 }
 
- Static Protected Attributes inherited from VQwBPM
static const TString kAxisLabel [2] ={"X","Y"}
 
static const TString axis [3]
 
static const Bool_t bDEBUG =kFALSE
 

Detailed Description

Definition at line 32 of file QwBPMCavity.h.

Constructor & Destructor Documentation

QwBPMCavity::QwBPMCavity ( )
inline

Definition at line 40 of file QwBPMCavity.h.

40 { };
QwBPMCavity::QwBPMCavity ( TString  name)
inline

Definition at line 41 of file QwBPMCavity.h.

References bRotated, and InitializeChannel().

41  :VQwBPM(name){
42  InitializeChannel(name);
43  bRotated=kTRUE;
44  };
Bool_t bRotated
Definition: QwBPMCavity.h:150
void InitializeChannel(TString name)
Definition: QwBPMCavity.cc:24
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

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

Definition at line 45 of file QwBPMCavity.h.

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

46  : VQwBPM(name) {
47  SetSubsystemName(subsystemname);
48  InitializeChannel(subsystemname, name);
49  bRotated=kTRUE;
50  };
Bool_t bRotated
Definition: QwBPMCavity.h:150
void InitializeChannel(TString name)
Definition: QwBPMCavity.cc:24
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
VQwBPM()
Definition: VQwBPM.h:58

+ Here is the call graph for this function:

QwBPMCavity::QwBPMCavity ( const QwBPMCavity source)
inline

Definition at line 51 of file QwBPMCavity.h.

52  : VQwBPM(source),
53  fWire(source.fWire),fRelPos(source.fRelPos),fAbsPos(source.fAbsPos),
55  { }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
VQwBPM()
Definition: VQwBPM.h:58
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
virtual QwBPMCavity::~QwBPMCavity ( )
inlinevirtual

Definition at line 56 of file QwBPMCavity.h.

56 { };

Member Function Documentation

void QwBPMCavity::AccumulateRunningSum ( const VQwBPM value)
virtual

Reimplemented from VQwBPM.

Definition at line 546 of file QwBPMCavity.cc.

Referenced by AccumulateRunningSum().

546  {
547  AccumulateRunningSum(*dynamic_cast<const QwBPMCavity* >(&value));
548 };
void AccumulateRunningSum(const VQwBPM &value)
Definition: QwBPMCavity.cc:546

+ Here is the caller graph for this function:

void QwBPMCavity::AccumulateRunningSum ( const QwBPMCavity value)

Definition at line 550 of file QwBPMCavity.cc.

References AccumulateRunningSum(), QwVQWK_Channel::AccumulateRunningSum(), fAbsPos, fEffectiveCharge, fRelPos, and fWire.

551 {
552 
553  Short_t i = 0;
554  for(i=0;i<2;i++) fWire[i].AccumulateRunningSum(value.fWire[i]);
556  for (i = 0; i < 2; i++) fRelPos[i].AccumulateRunningSum(value.fRelPos[i]);
557  for (i = 0; i < 2; i++) fAbsPos[i].AccumulateRunningSum(value.fAbsPos[i]);
558  return;
559 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void AccumulateRunningSum(const VQwBPM &value)
Definition: QwBPMCavity.cc:546
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
void AccumulateRunningSum(const QwVQWK_Channel &value)

+ Here is the call graph for this function:

Bool_t QwBPMCavity::ApplyHWChecks ( )

Definition at line 89 of file QwBPMCavity.cc.

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

Referenced by ProcessEvent().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t QwBPMCavity::ApplySingleEventCuts ( )
virtual

Implements VQwBPM.

Definition at line 165 of file QwBPMCavity.cc.

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

166 {
167  Bool_t status=kTRUE;
168  Int_t i=0;
169  UInt_t error_code = 0;
170  //Event cuts for X & Y
171  for(i=0;i<2;i++){
172 
173  if (fWire[i].ApplySingleEventCuts()){ //for RelX
174  status&=kTRUE;
175  }
176  else{
177  status&=kFALSE;
178  if (bDEBUG) std::cout<<" Rel X event cut failed ";
179  }
180  error_code |= fWire[i].GetErrorCode();//this to be updated in the rel and abp pos channels
181  }
182  for(i=kXAxis;i<kNumAxes;i++){
183  fRelPos[i].UpdateErrorFlag(error_code);
184  if (fRelPos[i].ApplySingleEventCuts()){ //for RelX
185  status&=kTRUE;
186  }
187  else{
188  status&=kFALSE;
189  if (bDEBUG) std::cout<<" Rel X event cut failed ";
190  }
191  }
192 
193  for(i=kXAxis;i<kNumAxes;i++){
194  fAbsPos[i].UpdateErrorFlag(error_code);
195  if (fAbsPos[i].ApplySingleEventCuts()){ //for RelX
196  status&=kTRUE;
197  }
198  else{
199  status&=kFALSE;
200  if (bDEBUG) std::cout<<" Abs X event cut failed ";
201  }
202  }
203 
204  //Event cuts for four wire sum (EffectiveCharge)
205  fEffectiveCharge.UpdateErrorFlag(error_code);
207  status&=kTRUE;
208  }
209  else{
210  status&=kFALSE;
211  if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
212  }
213  return status;
214 }
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
static const Bool_t bDEBUG
Definition: VQwBPM.h:275
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
virtual UInt_t GetErrorCode() const
Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
Bool_t ApplySingleEventCuts()
Definition: QwBPMCavity.cc:165
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::CalculateRunningAverage ( )
virtual

Implements VQwBPM.

Definition at line 536 of file QwBPMCavity.cc.

References QwVQWK_Channel::CalculateRunningAverage(), fAbsPos, fEffectiveCharge, fRelPos, and fWire.

537 {
538  Short_t i = 0;
539  for(i=0;i<2;i++) fWire[i].CalculateRunningAverage();
540  for (i = 0; i < 2; i++) fRelPos[i].CalculateRunningAverage();
541  for (i = 0; i < 2; i++) fAbsPos[i].CalculateRunningAverage();
543  return;
544 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void CalculateRunningAverage()
Definition: QwBPMCavity.cc:536
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void CalculateRunningAverage()
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::ClearEventData ( )
virtual

Clear the event data in this element.

Reimplemented from VQwDataElement.

Definition at line 74 of file QwBPMCavity.cc.

References QwVQWK_Channel::ClearEventData(), fAbsPos, fEffectiveCharge, fRelPos, and fWire.

75 {
76  Short_t i=0;
77 
78  for(i=0;i<2;i++){
80  fWire[i].ClearEventData();
82  }
84 
85  return;
86 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void ClearEventData()
Clear the event data in this element.
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 642 of file QwBPMCavity.cc.

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

643  {
644  if (GetElementName()==""){
645  // This channel is not used, so skip constructing trees.
646  }
647  else {
648  TString thisprefix=prefix;
649  if(prefix=="asym_")
650  thisprefix="diff_";
651 
652  SetRootSaveStatus(prefix);
653 
654  fEffectiveCharge.ConstructBranch(tree,prefix);
655  Short_t i = 0;
656  for(i=kXAxis;i<kNumAxes;i++) {
657  if (bFullSave) fWire[i].ConstructBranch(tree,thisprefix);
658  fRelPos[i].ConstructBranch(tree,thisprefix);
659  fAbsPos[i].ConstructBranch(tree,thisprefix);
660  }
661 
662  }
663  return;
664  }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void ConstructBranch(TTree *tree, TString &prefix)
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 666 of file QwBPMCavity.cc.

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

667  {
668  TString devicename;
669  /*
670  QwMessage <<" QwBCM::ConstructBranch "<<QwLog::endl;
671  modulelist.RewindToFileStart();
672  while (modulelist.ReadNextLine()){
673  modulelist.TrimComment('!'); // Remove everything after a '!' character.
674  modulelist.TrimWhitespace(); // Get rid of leading and trailing spaces
675  QwMessage <<" "<<modulelist.GetLine()<<" ";
676  }
677  QwMessage <<QwLog::endl;
678  */
679  devicename=GetElementName();
680  devicename.ToLower();
681  if (GetElementName()==""){
682  // This channel is not used, so skip filling the histograms.
683  } else
684  {
685  if (modulelist.HasValue(devicename)){
686  TString thisprefix=prefix;
687  if(prefix=="asym_")
688  thisprefix="diff_";
689 
690  SetRootSaveStatus(prefix);
691 
692  fEffectiveCharge.ConstructBranch(tree,prefix);
693  Short_t i = 0;
694  for(i=kXAxis;i<kNumAxes;i++) {
695  if (bFullSave) fWire[i].ConstructBranch(tree,thisprefix);
696  fRelPos[i].ConstructBranch(tree,thisprefix);
697  fAbsPos[i].ConstructBranch(tree,thisprefix);
698  }
699 
700  QwMessage <<" Tree leaves added to "<<devicename<<" Corresponding channels"<<QwLog::endl;
701  }
702  // this functions doesn't do anything yet
703  }
704 
705 
706 
707 
708 
709  return;
710  }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void ConstructBranch(TTree *tree, TString &prefix)
Bool_t bFullSave
Definition: VQwBPM.h:273
Bool_t HasValue(TString &vname)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 618 of file QwBPMCavity.cc.

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

619 {
620  if (GetElementName()==""){
621  // This channel is not used, so skip constructing trees.
622  }
623  else {
624  TString thisprefix=prefix;
625  if(prefix=="asym_")
626  thisprefix="diff_";
627 
628  SetRootSaveStatus(prefix);
629 
630  fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
631  Short_t i = 0;
632  for(i=kXAxis;i<kNumAxes;i++) {
633  if (bFullSave) fWire[i].ConstructBranchAndVector(tree,thisprefix,values);
634  fRelPos[i].ConstructBranchAndVector(tree,thisprefix,values);
635  fAbsPos[i].ConstructBranchAndVector(tree,thisprefix,values);
636  }
637 
638  }
639  return;
640 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Construct the histograms for this data element.

Implements VQwBPM.

Definition at line 578 of file QwBPMCavity.cc.

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

579 {
580 
581  if (GetElementName()=="") {
582  // This channel is not used, so skip filling the histograms.
583  } else {
584  fEffectiveCharge.ConstructHistograms(folder, prefix);
585  TString thisprefix=prefix;
586 
587  if(prefix=="asym_")
588  thisprefix="diff_";
589  SetRootSaveStatus(prefix);
590  Short_t i = 0;
591  for(i=kXAxis;i<kNumAxes;i++) {
592  if(bFullSave) fWire[i].ConstructHistograms(folder, thisprefix);
593  fRelPos[i].ConstructHistograms(folder, thisprefix);
594  fAbsPos[i].ConstructHistograms(folder, thisprefix);
595  }
596  }
597  return;
598 }
void SetRootSaveStatus(TString &prefix)
Definition: VQwBPM.cc:178
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::DeaccumulateRunningSum ( VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 561 of file QwBPMCavity.cc.

Referenced by DeaccumulateRunningSum().

561  {
562  DeaccumulateRunningSum(*dynamic_cast<QwBPMCavity* >(&value));
563 };
void DeaccumulateRunningSum(VQwBPM &value)
Definition: QwBPMCavity.cc:561

+ Here is the caller graph for this function:

void QwBPMCavity::DeaccumulateRunningSum ( QwBPMCavity value)

Definition at line 565 of file QwBPMCavity.cc.

References DeaccumulateRunningSum(), QwVQWK_Channel::DeaccumulateRunningSum(), fAbsPos, fEffectiveCharge, fRelPos, and fWire.

566 {
567  Short_t i = 0;
568  for(i=0;i<2;i++) fWire[i].DeaccumulateRunningSum(value.fWire[i]);
570  for (i = 0; i < 2; i++) fRelPos[i].DeaccumulateRunningSum(value.fRelPos[i]);
571  for (i = 0; i < 2; i++) fAbsPos[i].DeaccumulateRunningSum(value.fAbsPos[i]);
572  return;
573 }
void DeaccumulateRunningSum(const QwVQWK_Channel &value)
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void DeaccumulateRunningSum(VQwBPM &value)
Definition: QwBPMCavity.cc:561
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Reimplemented from VQwBPM.

Definition at line 839 of file QwBPMCavity.cc.

References fWire.

840 {
841  for (Short_t i=0; i<2; i++) fWire[i].EncodeEventData(buffer);
842 }
void EncodeEventData(std::vector< UInt_t > &buffer)
Definition: QwBPMCavity.cc:839
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
void QwBPMCavity::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwBPM.

Definition at line 600 of file QwBPMCavity.cc.

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

601 {
602  if (GetElementName()=="") {
603  // This channel is not used, so skip filling the histograms.
604  }
605  else {
607  Short_t i = 0;
608  for(i=kXAxis;i<kNumAxes;i++){
609  if (bFullSave) fWire[i].FillHistograms();
610  fRelPos[i].FillHistograms();
611  fAbsPos[i].FillHistograms();
612  }
613  //No data for z position
614  }
615  return;
616 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void FillHistograms()
Fill the histograms for this data element.
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 713 of file QwBPMCavity.cc.

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

714 {
715  if (GetElementName()=="") {
716  // This channel is not used, so skip filling the tree.
717  }
718  else {
720  Short_t i = 0;
721  for(i=kXAxis;i<kNumAxes;i++){
722  if (bFullSave) fWire[i].FillTreeVector(values);
723  fRelPos[i].FillTreeVector(values);
724  fAbsPos[i].FillTreeVector(values);
725  }
726  }
727  return;
728 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
void FillTreeVector(std::vector< Double_t > &values) const
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::GetAbsolutePosition ( )
virtual

Reimplemented from VQwBPM.

Definition at line 425 of file QwBPMCavity.cc.

References QwVQWK_Channel::AddChannelOffset(), fAbsPos, VQwBPM::fPositionCenter, fRelPos, and fWire.

426 {
427  for(Short_t i=0;i<2;i++){
428  fRelPos[i] = fWire[i];
429  fAbsPos[i]= fRelPos[i];
431  }
432  // For Z, the absolute position will be the offset we are reading from the
433  // geometry map file. Since we are not putting that to the tree it is not
434  // treated as a vqwk channel.
435 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void AddChannelOffset(Double_t Offset)
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 756 of file QwBPMCavity.cc.

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

757 {
758  std::vector <QwDBInterface> row_list;
759  row_list.clear();
760  for(size_t i=0;i<2;i++) {
761  fRelPos[i].AddEntriesToList(row_list);
762  fAbsPos[i].AddEntriesToList(row_list);
763  }
765  return row_list;
766 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152

+ Here is the call graph for this function:

const VQwHardwareChannel* QwBPMCavity::GetEffectiveCharge ( ) const
inlinevirtual

Implements VQwBPM.

Definition at line 82 of file QwBPMCavity.h.

References fEffectiveCharge.

82 {return &fEffectiveCharge;}
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
std::vector< QwErrDBInterface > QwBPMCavity::GetErrDBEntry ( )
virtual

Implements VQwBPM.

Definition at line 769 of file QwBPMCavity.cc.

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

770 {
771  std::vector <QwErrDBInterface> row_list;
772  row_list.clear();
773  for(size_t i=0;i<2;i++) {
774  fRelPos[i].AddErrEntriesToList(row_list);
775  fAbsPos[i].AddErrEntriesToList(row_list);
776  }
778  return row_list;
779 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void AddErrEntriesToList(std::vector< QwErrDBInterface > &row_list)

+ Here is the call graph for this function:

UInt_t QwBPMCavity::GetEventcutErrorFlag ( )
virtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 131 of file QwBPMCavity.cc.

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

132 {
133  Short_t i=0;
134  UInt_t error=0;
135  for(i=0;i<2;i++) {
136  error|=fWire[i].GetEventcutErrorFlag();
137  error|=fRelPos[i].GetEventcutErrorFlag();
138  error|=fAbsPos[i].GetEventcutErrorFlag();
139  }
141 
142  return error;
143 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 74 of file QwBPMCavity.h.

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

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

+ Here is the call graph for this function:

VQwHardwareChannel * QwBPMCavity::GetSubelementByName ( TString  ch_name)
protectedvirtual

Implements VQwBPM.

Definition at line 216 of file QwBPMCavity.cc.

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

217 {
218  VQwHardwareChannel* tmpptr = NULL;
219  ch_name.ToLower();
220  if (ch_name=="relx"){
221  tmpptr = &fRelPos[0];
222  }else if (ch_name=="rely"){
223  tmpptr = &fRelPos[1];
224  }else if (ch_name=="absx" || ch_name=="x" ){
225  tmpptr = &fAbsPos[0];
226  }else if (ch_name=="absy" || ch_name=="y"){
227  tmpptr = &fAbsPos[1];
228  }else if (ch_name=="effectivecharge" || ch_name=="charge"){
229  tmpptr = &fEffectiveCharge;
230  } else {
231  TString loc="QwLinearDiodeArray::GetSubelementByName for"
232  + this->GetElementName() + " was passed "
233  + ch_name + ", which is an unrecognized subelement name.";
234  throw std::invalid_argument(loc.Data());
235  }
236  return tmpptr;
237 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

UInt_t QwBPMCavity::GetSubElementIndex ( TString  subname)
static

Definition at line 412 of file QwBPMCavity.cc.

References kInvalidSubelementIndex, and subelement.

Referenced by QwBeamDetectorID::QwBeamDetectorID().

413 {
414  subname.ToUpper();
415  UInt_t localindex=kInvalidSubelementIndex;
416  for(Short_t i=0;i<3;i++) if(subname==subelement[i])localindex=i;
417 
418  if(localindex==kInvalidSubelementIndex)
419  std::cerr << "QwBPMCavity::GetSubElementIndex is unable to associate the string -"
420  <<subname<<"- to any index"<<std::endl;
421 
422  return localindex;
423 }
static const TString subelement[3]
Definition: QwBPMCavity.h:145
static const UInt_t kInvalidSubelementIndex
Definition: QwTypes.h:191

+ Here is the caller graph for this function:

TString QwBPMCavity::GetSubElementName ( Int_t  subindex)
virtual

Reimplemented from VQwBPM.

Definition at line 400 of file QwBPMCavity.cc.

References fWire, and VQwDataElement::GetElementName().

401 {
402  TString thisname;
403  if(subindex<2&&subindex>-1)
404  thisname=fWire[subindex].GetElementName();
405  else
406  std::cerr<<"QwBPMCavity::GetSubElementName for "<<
407  GetElementName()<<" this subindex doesn't exists \n";
408 
409  return thisname;
410 }
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::IncrementErrorCounters ( )
virtual

Implements VQwBPM.

Definition at line 107 of file QwBPMCavity.cc.

References fAbsPos, fEffectiveCharge, fRelPos, fWire, and QwVQWK_Channel::IncrementErrorCounters().

108 {
109  Short_t i=0;
110 
111  for(i=0;i<2;i++) {
115  }
117 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void IncrementErrorCounters()
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::InitializeChannel ( TString  name)

Definition at line 24 of file QwBPMCavity.cc.

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

Referenced by InitializeChannel(), and QwBPMCavity().

25 {
26  Short_t i=0;
27  Bool_t localdebug = kFALSE;
28 
30 
31  for(i=kXAxis;i<kNumAxes;i++)
32  fAbsPos[i].InitializeChannel(name+"Abs"+kAxisLabel[i],"derived");
33 
34  fEffectiveCharge.InitializeChannel(name+"_EffectiveCharge","raw");
35 
36  for(i=0;i<2;i++) {
37  fWire[i].InitializeChannel(name+subelement[i],"raw");
38  if(localdebug)
39  std::cout<<" Wire ["<<i<<"]="<<fWire[i].GetElementName()<<"\n";
40  }
41 
42  for(i=kXAxis;i<kNumAxes;i++) fRelPos[i].InitializeChannel(name+"Rel"+subelement[i],"derived");
43 
44  bFullSave=kTRUE;
45 
46  return;
47 }
static const TString subelement[3]
Definition: QwBPMCavity.h:145
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
static const TString kAxisLabel[2]
Definition: VQwBPM.h:239
void InitializeChannel(TString name)
Definition: QwBPMCavity.cc:24
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
virtual const TString & GetElementName() const
Get the name of this element.
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 49 of file QwBPMCavity.cc.

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

50 {
51  Short_t i=0;
52  Bool_t localdebug = kFALSE;
53 
55 
56  for(i=kXAxis;i<kNumAxes;i++)
57  fAbsPos[i].InitializeChannel(subsystem, "QwBPMCavity", name+"Abs"+kAxisLabel[i],"derived");
58 
59  fEffectiveCharge.InitializeChannel(subsystem, "QwBPMCavity", name+"_EffectiveCharge","raw");
60 
61  for(i=0;i<2;i++) {
62  fWire[i].InitializeChannel(subsystem, "QwBPMCavity", name+subelement[i],"raw");
63  if(localdebug)
64  std::cout<<" Wire ["<<i<<"]="<<fWire[i].GetElementName()<<"\n";
65  }
66 
67  for(i=kXAxis;i<kNumAxes;i++) fRelPos[i].InitializeChannel(subsystem, "QwBPMCavity", name+"Rel"+subelement[i],"derived");
68 
69  bFullSave=kTRUE;
70 
71  return;
72 }
static const TString subelement[3]
Definition: QwBPMCavity.h:145
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
static const TString kAxisLabel[2]
Definition: VQwBPM.h:239
void InitializeChannel(TString name)
Definition: QwBPMCavity.cc:24
Bool_t bFullSave
Definition: VQwBPM.h:273
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void InitializeChannel(TString name)
Definition: VQwBPM.cc:25
virtual const TString & GetElementName() const
Get the name of this element.
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::LoadChannelParameters ( QwParameterFile paramfile)
inlinevirtual

Implements VQwBPM.

Definition at line 63 of file QwBPMCavity.h.

References fWire.

63  {
64  for(Short_t i=0;i<2;i++)
65  fWire[i].LoadChannelParameters(paramfile);
66  }
void LoadChannelParameters(QwParameterFile &paramfile)
Definition: QwBPMCavity.h:63
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
void QwBPMCavity::MakeBPMCavityList ( )
private

Definition at line 743 of file QwBPMCavity.cc.

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

744 {
745  for (size_t i = kXAxis; i < kNumAxes; i++) {
746  QwVQWK_Channel relpos(fRelPos[i]);
747  relpos = fRelPos[i];
748  fBPMElementList.push_back(relpos);
749  }
750  QwVQWK_Channel effectivecharge(fEffectiveCharge);
751  effectivecharge = fEffectiveCharge;
752  fBPMElementList.push_back(effectivecharge);
753 }
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
std::vector< QwVQWK_Channel > fBPMElementList
Definition: QwBPMCavity.h:163
VQwBPM & QwBPMCavity::operator+= ( const VQwBPM value)
virtual

Implements VQwBPM.

Definition at line 478 of file QwBPMCavity.cc.

479 {
480  *(dynamic_cast<QwBPMCavity*>(this)) +=
481  *(dynamic_cast<const QwBPMCavity*>(&value));
482  return *this;
483 }
QwBPMCavity & QwBPMCavity::operator+= ( const QwBPMCavity value)
virtual

Definition at line 463 of file QwBPMCavity.cc.

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

464 {
465 
466  if (GetElementName()!=""){
467  Short_t i = 0;
468  this->fEffectiveCharge+=value.fEffectiveCharge;
469  for(i=0;i<2;i++) {
470  this->fWire[i]+=value.fWire[i];
471  this->fRelPos[i]+=value.fRelPos[i];
472  this->fAbsPos[i]+=value.fAbsPos[i];
473  }
474  }
475  return *this;
476 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 502 of file QwBPMCavity.cc.

503 {
504  *(dynamic_cast<QwBPMCavity*>(this)) -=
505  *(dynamic_cast<const QwBPMCavity*>(&value));
506  return *this;
507 }
QwBPMCavity & QwBPMCavity::operator-= ( const QwBPMCavity value)
virtual

Definition at line 487 of file QwBPMCavity.cc.

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

488 {
489 
490  if (GetElementName()!=""){
491  Short_t i = 0;
492  this->fEffectiveCharge-=value.fEffectiveCharge;
493  for(i=0;i<2;i++) {
494  this->fWire[i]-=value.fWire[i];
495  this->fRelPos[i]-=value.fRelPos[i];
496  this->fAbsPos[i]-=value.fAbsPos[i];
497  }
498  }
499  return *this;
500 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Implements VQwBPM.

Definition at line 438 of file QwBPMCavity.cc.

439 {
440  *(dynamic_cast<QwBPMCavity*>(this)) =
441  *(dynamic_cast<const QwBPMCavity*>(&value));
442  return *this;
443 }
QwBPMCavity & QwBPMCavity::operator= ( const QwBPMCavity value)
virtual

Definition at line 445 of file QwBPMCavity.cc.

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

446 {
447  VQwBPM::operator= (value);
448 
449  this->bRotated=value.bRotated;
450  if (GetElementName()!=""){
451  Short_t i = 0;
453  for(i=0;i<2;i++) {
454  this->fWire[i]=value.fWire[i];
455  this->fRelPos[i]=value.fRelPos[i];
456  this->fAbsPos[i]=value.fAbsPos[i];
457  }
458  }
459  return *this;
460 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
Bool_t bRotated
Definition: QwBPMCavity.h:150
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
virtual VQwBPM & operator=(const VQwBPM &value)=0
Definition: VQwBPM.cc:115
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::PrintErrorCounters ( ) const
virtual

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

Reimplemented from VQwBPM.

Definition at line 119 of file QwBPMCavity.cc.

References fAbsPos, fEffectiveCharge, fRelPos, fWire, and QwVQWK_Channel::PrintErrorCounters().

120 {
121  Short_t i=0;
122 
123  for(i=0;i<2;i++) {
127  }
129 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

Reimplemented from VQwBPM.

Definition at line 388 of file QwBPMCavity.cc.

References fAbsPos, fEffectiveCharge, fRelPos, fWire, and QwVQWK_Channel::PrintInfo().

389 {
390  Short_t i = 0;
391  for (i = 0; i < 2; i++) {
392  fWire[i].PrintInfo();
393  fAbsPos[i].PrintInfo();
394  fRelPos[i].PrintInfo();
395  }
397 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void PrintInfo() const
Print multiple lines of information about this data element.
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::PrintValue ( ) const
virtual

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

Reimplemented from VQwDataElement.

Definition at line 378 of file QwBPMCavity.cc.

References fAbsPos, fRelPos, fWire, and QwVQWK_Channel::PrintValue().

379 {
380  for (Short_t i = 0; i < 2; i++) {
381  fAbsPos[i].PrintValue();
382  fWire[i].PrintValue();
383  fRelPos[i].PrintValue();
384  }
385  return;
386 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void PrintValue() const
Print single line of value and error of this data element.
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

Int_t QwBPMCavity::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement 
)
virtual

Process the CODA event buffer for this element.

Implements VQwDataElement.

Definition at line 358 of file QwBPMCavity.cc.

References fEffectiveCharge, fWire, and QwVQWK_Channel::ProcessEvBuffer().

359 {
360  if(index<2)
361  {
362  fWire[index].ProcessEvBuffer(buffer,word_position_in_buffer);
363  }
364  else if(index==2)
365  {
366  fEffectiveCharge.ProcessEvBuffer(buffer,word_position_in_buffer);
367  }
368  else
369  {
370  std::cerr <<
371  "QwBPMCavity::ProcessEvBuffer(): attempt to fill in raw date for a wire that doesn't exist \n";
372  }
373  return word_position_in_buffer;
374 }
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
Decode the event data from a CODA buffer.
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::ProcessEvent ( )
virtual

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 derrived devices.

Implements VQwBPM.

Definition at line 325 of file QwBPMCavity.cc.

References QwVQWK_Channel::AddChannelOffset(), ApplyHWChecks(), fAbsPos, fEffectiveCharge, VQwBPM::fPositionCenter, fRelPos, fWire, VQwBPM::kNumAxes, kQwCavityCalibration, VQwBPM::kXAxis, QwVQWK_Channel::PrintInfo(), QwVQWK_Channel::ProcessEvent(), and QwVQWK_Channel::Scale().

326 {
327  Bool_t localdebug = kFALSE;
328  Short_t i = 0;
329 
330 
331  ApplyHWChecks();
332  /**First apply HW checks and update HW error flags.
333  Calling this routine here and not in ApplySingleEventCuts
334  makes a difference for a BPMs because they have derrived devices.
335  */
336  for(i=0;i<2;i++)
337  {
338  fWire[i].ProcessEvent();
339  }
341 
342  if (localdebug) {
344  fWire[i].PrintInfo();
345  }
346 
347  for(i=kXAxis;i<kNumAxes;i++){
348  fRelPos[i]= fWire[i];
350  fAbsPos[i]= fRelPos[i];
352  }
353 
354  return;
355 }
void ProcessEvent()
Process the event data according to pedestal and calibration factor.
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void PrintInfo() const
Print multiple lines of information about this data element.
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
void Scale(Double_t Offset)
static const Double_t kQwCavityCalibration
Definition: QwBPMCavity.h:142
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
void AddChannelOffset(Double_t Offset)
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
Bool_t ApplyHWChecks()
Definition: QwBPMCavity.cc:89

+ Here is the call graph for this function:

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

Reimplemented from VQwBPM.

Definition at line 820 of file QwBPMCavity.cc.

References fWire.

821 {
822  for (Short_t i=0; i<2; i++) fWire[i].RandomizeEventData(helicity, time);
823 
824  return;
825 }
void RandomizeEventData(int helicity=0, double time=0.0)
Definition: QwBPMCavity.cc:820
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
void QwBPMCavity::Ratio ( QwBPMCavity numer,
QwBPMCavity denom 
)

Definition at line 511 of file QwBPMCavity.cc.

References fEffectiveCharge, and QwVQWK_Channel::Ratio().

512 {
513  // this function is called when forming asymmetries. In this case what we actually want for the
514  // stripline is the difference only not the asymmetries
515 
516  *this=numer;
518  return;
519 }
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157

+ Here is the call graph for this function:

void QwBPMCavity::Scale ( Double_t  factor)
virtual

Reimplemented from VQwBPM.

Definition at line 523 of file QwBPMCavity.cc.

References fAbsPos, fEffectiveCharge, fRelPos, fWire, and QwVQWK_Channel::Scale().

524 {
525  fEffectiveCharge.Scale(factor);
526 
527  for(Short_t i=0;i<2;i++){
528  fWire[i].Scale(factor);
529  fRelPos[i].Scale(factor);
530  fAbsPos[i].Scale(factor);
531  }
532  return;
533 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void Scale(Double_t Offset)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::SetDefaultSampleSize ( Int_t  sample_size)
virtual

Reimplemented from VQwBPM.

Definition at line 845 of file QwBPMCavity.cc.

References fWire.

846 {
847  for(Short_t i=0;i<2;i++) fWire[i].SetDefaultSampleSize((size_t)sample_size);
848  return;
849 }
void SetDefaultSampleSize(Int_t sample_size)
Definition: QwBPMCavity.cc:845
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151
void QwBPMCavity::SetEventCutMode ( Int_t  bcuts)
virtual

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

Implements VQwBPM.

Definition at line 730 of file QwBPMCavity.cc.

References fAbsPos, fEffectiveCharge, fRelPos, fWire, and VQwHardwareChannel::SetEventCutMode().

731 {
732  Short_t i = 0;
733  // bEVENTCUTMODE=bcuts;
734  for (i=0;i<2;i++) {
735  fWire[i].SetEventCutMode(bcuts);
736  fRelPos[i].SetEventCutMode(bcuts);
737  fAbsPos[i].SetEventCutMode(bcuts);
738  }
740 }
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
void SetEventCutMode(Int_t bcuts)
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

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

Definition at line 828 of file QwBPMCavity.cc.

References fRelPos, and QwVQWK_Channel::SetHardwareSum().

829 {
830  for (Short_t i=0; i<2; i++)
831  {
832  fRelPos[i].SetHardwareSum(relpos[i], sequencenumber);
833  }
834 
835  return;
836 }
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152

+ Here is the call graph for this function:

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

Reimplemented from VQwBPM.

Definition at line 786 of file QwBPMCavity.cc.

787 {
788  // Average values of the signals in the stripline ADCs
789  //Double_t sumX = 1.1e8; // These are just guesses, but I made X and Y different
790  //Double_t sumY = 0.9e8; // to make it more interesting for the analyzer...
791 
792  // Rotate the requested position if necessary (this is not tested yet)
793  /* if (bRotated) {
794  Double_t rotated_meanX = (meanX + meanY) / kRotationCorrection;
795  Double_t rotated_meanY = (meanX - meanY) / kRotationCorrection;
796  meanX = rotated_meanX;
797  meanY = rotated_meanY;
798  }*/
799 
800  // Determine the asymmetry from the position
801  //Double_t meanXP = (1.0 + meanX / kQwCavityCalibration) * sumX / 2.0;
802  //Double_t meanXM = (1.0 - meanX / kQwCavityCalibration) * sumX / 2.0; // = sumX - meanXP;
803  //Double_t meanYP = (1.0 + meanY / kQwCavityCalibration) * sumY / 2.0;
804  //Double_t meanYM = (1.0 - meanY / kQwCavityCalibration) * sumY / 2.0; // = sumY - meanYP;
805 
806  // Determine the spread of the asymmetry (this is not tested yet)
807  // (negative sigma should work in the QwVQWK_Channel, but still using fabs)
808  //Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
809  //Double_t sigmaXM = sigmaXP;
810  //Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
811  //Double_t sigmaYM = sigmaYP;
812 
813  // Propagate these parameters to the ADCs
814  //fWire[0].SetRandomEventParameters(meanXP, sigmaXM);
815  //fWire[1].SetRandomEventParameters(meanXM, sigmaYM);
816  //fWire[2].SetRandomEventParameters(meanYP, sigmaYP);
817 }
void QwBPMCavity::SetSubElementCalibrationFactor ( Int_t  j,
Double_t  value 
)
virtual

Reimplemented from VQwBPM.

Definition at line 858 of file QwBPMCavity.cc.

References fWire, and VQwHardwareChannel::SetCalibrationFactor().

859 {
860  fWire[j].SetCalibrationFactor(value);
861  return;
862 }
void SetCalibrationFactor(Double_t factor)
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::SetSubElementPedestal ( Int_t  j,
Double_t  value 
)
virtual

Reimplemented from VQwBPM.

Definition at line 852 of file QwBPMCavity.cc.

References fWire, and VQwHardwareChannel::SetPedestal().

853 {
854  fWire[j].SetPedestal(value);
855  return;
856 }
void SetPedestal(Double_t ped)
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

UInt_t QwBPMCavity::UpdateErrorFlag ( )
virtual

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

Implements VQwBPM.

Definition at line 145 of file QwBPMCavity.cc.

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

146 {
147  Short_t i=0;
148  UInt_t error1=0;
149  UInt_t error2=0;
150  for(i=0;i<2;i++) {
151  error1|=fWire[i].GetErrorCode();
152  error2|=fWire[i].GetEventcutErrorFlag();
153  }
154  for(i=kXAxis;i<kNumAxes;i++) {
155  fRelPos[i].UpdateErrorFlag(error1);
156  fAbsPos[i].UpdateErrorFlag(error1);
157  error2|=fRelPos[i].GetEventcutErrorFlag();
158  error2|=fAbsPos[i].GetEventcutErrorFlag();
159  }
162  return error2;
163 }
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
virtual UInt_t GetErrorCode() const
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

void QwBPMCavity::UpdateErrorFlag ( const VQwBPM ev_error)
virtual

Implements VQwBPM.

Definition at line 296 of file QwBPMCavity.cc.

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

296  {
297  Short_t i=0;
298  try {
299  if(typeid(*ev_error)==typeid(*this)) {
300  // std::cout<<" Here in QwBPMStripline::UpdateErrorFlag \n";
301  if (this->GetElementName()!="") {
302  const QwBPMCavity* value_bpm = dynamic_cast<const QwBPMCavity* >(ev_error);
303  for(i=0;i<2;i++){
304  fWire[i].UpdateErrorFlag(value_bpm->fWire[i]);
305  }
306  for(i=kXAxis;i<kNumAxes;i++) {
307  fRelPos[i].UpdateErrorFlag(value_bpm->fRelPos[i]);
308  fAbsPos[i].UpdateErrorFlag(value_bpm->fAbsPos[i]);
309  }
311  }
312  } else {
313  TString loc="Standard exception from QwBPMCavity::UpdateErrorFlag :"+
314  ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
315  +"same type";
316  throw std::invalid_argument(loc.Data());
317  }
318  } catch (std::exception& e) {
319  std::cerr<< e.what()<<std::endl;
320  }
321 };
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
QwVQWK_Channel fAbsPos[2]
Definition: QwBPMCavity.h:156
static const double e
Definition: QwUnits.h:91
QwVQWK_Channel fEffectiveCharge
Definition: QwBPMCavity.h:157
QwVQWK_Channel fRelPos[2]
Definition: QwBPMCavity.h:152
virtual const TString & GetElementName() const
Get the name of this element.
QwVQWK_Channel fWire[2]
Definition: QwBPMCavity.h:151

+ Here is the call graph for this function:

Friends And Related Function Documentation

template<typename TT >
friend class QwCombinedBPM
friend

Definition at line 33 of file QwBPMCavity.h.

friend class QwEnergyCalculator
friend

Definition at line 34 of file QwBPMCavity.h.

Field Documentation

Bool_t QwBPMCavity::bRotated
protected

Definition at line 150 of file QwBPMCavity.h.

Referenced by operator=(), and QwBPMCavity().

std::vector<QwVQWK_Channel> QwBPMCavity::fBPMElementList
private

Definition at line 163 of file QwBPMCavity.h.

Referenced by MakeBPMCavityList().

const Double_t QwBPMCavity::kQwCavityCalibration = 1e-8
staticprivate

Definition at line 142 of file QwBPMCavity.h.

Referenced by ProcessEvent().

const Double_t QwBPMCavity::kRotationCorrection = 1./1.414
staticprivate

Definition at line 144 of file QwBPMCavity.h.

const TString QwBPMCavity::subelement ={"X","Y","Q"}
staticprivate

Definition at line 145 of file QwBPMCavity.h.

Referenced by GetSubElementIndex(), and InitializeChannel().


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