QwAnalysis
VQwBPM Class Referenceabstract

#include <VQwBPM.h>

+ Inheritance diagram for VQwBPM:
+ Collaboration diagram for VQwBPM:

Public Types

enum  EBeamPositionMonitorAxis { kXAxis =0, kYAxis, kNumAxes }
 
- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 

Public Member Functions

 VQwBPM ()
 
 VQwBPM (TString &name)
 
 VQwBPM (const VQwBPM &source)
 
virtual ~VQwBPM ()
 
void InitializeChannel (TString name)
 
virtual void LoadChannelParameters (QwParameterFile &paramfile)=0
 
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)
 
virtual UInt_t UpdateErrorFlag ()=0
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
virtual void UpdateErrorFlag (const VQwBPM *ev_error)=0
 
virtual void Scale (Double_t factor)
 
void SetGains (TString pos, Double_t value)
 
virtual VQwBPMoperator= (const VQwBPM &value)=0
 
virtual VQwBPMoperator+= (const VQwBPM &value)=0
 
virtual VQwBPMoperator-= (const VQwBPM &value)=0
 
void SetRootSaveStatus (TString &prefix)
 
virtual const VQwHardwareChannelGetPosition (EBeamPositionMonitorAxis axis) const =0
 
virtual const VQwHardwareChannelGetEffectiveCharge () const =0
 
Double_t GetPositionInZ () const
 
virtual void CalculateRunningAverage ()=0
 
virtual void AccumulateRunningSum (const VQwBPM &value)
 
virtual void DeaccumulateRunningSum (VQwBPM &value)=0
 
virtual void ConstructHistograms (TDirectory *folder, TString &prefix)=0
 Construct the histograms for this data element. More...
 
virtual void FillHistograms ()=0
 Fill the histograms for this data element. More...
 
virtual void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)=0
 
virtual void ConstructBranch (TTree *tree, TString &prefix)=0
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist)=0
 
virtual void FillTreeVector (std::vector< Double_t > &values) const =0
 
virtual std::vector
< QwDBInterface
GetDBEntry ()=0
 
virtual std::vector
< QwErrDBInterface
GetErrDBEntry ()=0
 
virtual void Ratio (VQwBPM &numer, VQwBPM &denom)
 
virtual TString GetSubElementName (Int_t subindex)
 
virtual void GetAbsolutePosition ()
 
virtual void SetEventCutMode (Int_t bcuts)=0
 
virtual void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure More...
 
virtual Bool_t ApplySingleEventCuts ()=0
 
virtual void IncrementErrorCounters ()=0
 
virtual void ProcessEvent ()=0
 
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)
 
virtual void SetDefaultSampleSize (Int_t sample_size)
 
virtual void SetRandomEventParameters (Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
 
virtual void RandomizeEventData (int helicity=0, double time=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &buffer)
 
virtual void SetSubElementPedestal (Int_t j, Double_t value)
 
virtual void SetSubElementCalibrationFactor (Int_t j, Double_t value)
 
virtual void PrintInfo () const
 Print multiple lines of information about this data element. More...
 
- 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...
 
virtual void ClearEventData ()
 Clear the event data in this element. More...
 
virtual Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t num_words_left, UInt_t subelement=0)=0
 Process the CODA event buffer for 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 PrintValue () const
 Print single line of value and error of this data element. 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 UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device 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 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

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

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

Static Protected Attributes

static const TString kAxisLabel [2] ={"X","Y"}
 
static const TString axis [3]
 
static const Bool_t bDEBUG =kFALSE
 

Private Member Functions

void InitializeChannel_base ()
 

Friends

template<typename TT >
class QwBPMStripline
 
template<typename TT >
class QwCombinedBPM
 
class QwEnergyCalculator
 

Detailed Description

Definition at line 34 of file VQwBPM.h.

Member Enumeration Documentation

Axis enumerator for the BPMs; Z will never be an instrumented axis.

Enumerator
kXAxis 
kYAxis 
kNumAxes 

Definition at line 54 of file VQwBPM.h.

Constructor & Destructor Documentation

VQwBPM::VQwBPM ( )
inline

Definition at line 58 of file VQwBPM.h.

References InitializeChannel_base().

void InitializeChannel_base()
Definition: VQwBPM.h:230

+ Here is the call graph for this function:

VQwBPM::VQwBPM ( TString &  name)
inline

Definition at line 59 of file VQwBPM.h.

References InitializeChannel_base().

void InitializeChannel_base()
Definition: VQwBPM.h:230

+ Here is the call graph for this function:

VQwBPM::VQwBPM ( const VQwBPM source)
inline

Definition at line 60 of file VQwBPM.h.

References fPositionCenter.

61  : VQwDataElement(source),
62  bRotated(source.bRotated),
63  bFullSave(source.bFullSave)
64  {
65  for (size_t i = 0; i < 3; i++)
66  fPositionCenter[i] = source.fPositionCenter[i];
67  }
VQwDataElement()
Default constructor.
Bool_t bRotated
Definition: VQwBPM.h:263
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
Bool_t bFullSave
Definition: VQwBPM.h:273
virtual VQwBPM::~VQwBPM ( )
inlinevirtual

Definition at line 68 of file VQwBPM.h.

68 { };

Member Function Documentation

virtual void VQwBPM::AccumulateRunningSum ( const VQwBPM value)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 139 of file VQwBPM.h.

References VQwDataElement::GetElementName().

139  {
140  std::cerr << "AccumulateRunningSum not implemented for BPM named="
141  <<GetElementName()<<"\n";
142  };
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

virtual Bool_t VQwBPM::ApplySingleEventCuts ( )
pure virtual
virtual void VQwBPM::CalculateRunningAverage ( )
pure virtual
virtual void VQwBPM::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
pure virtual
virtual void VQwBPM::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile modulelist 
)
pure virtual
virtual void VQwBPM::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
pure virtual
virtual void VQwBPM::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
pure virtual

Construct the histograms for this data element.

Implements VQwDataElement.

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

VQwBPM * VQwBPM::CreateCombo ( TString  subsystemname,
TString  type,
TString  name 
)
static

A fast way of creating a BPM stripline of specified type.

Definition at line 268 of file VQwBPM.cc.

References QwMessage, and QwWarning.

Referenced by QwBeamLine::CopyTemplatedDataElements(), and QwBeamLine::LoadChannelMap().

270 {
271  Bool_t localDebug = kFALSE;
272  type.ToUpper();
273  if( localDebug ) QwMessage<<"Creating CombinedBPM of type: "<<type<<" with name: "<<
274  name<<". Subsystem Name: " <<subsystemname<<"\n";
275  // (jc2) As a first try, let's do this the ugly way (but rather very
276  // simple), just list out the types of BPM's supported by this code!!!
277  if( type == "VQWK") {
278  return new QwCombinedBPM<QwVQWK_Channel>(subsystemname,name,type);
279  } else if (type == "SIS3801" ) { // Default SCALER channel
280  return new QwCombinedBPM<QwSIS3801_Channel>(subsystemname,name,type);
281  } else if ( type == "SCALER" || type == "SIS3801D24" ) {
282  return new QwCombinedBPM<QwSIS3801D24_Channel>(subsystemname,name,type);
283  } else { // Unsupported one!
284  QwWarning << "BPM of type="<<type<<" is UNSUPPORTED!!\n";
285  exit(-1);
286  }
287 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the caller graph for this function:

VQwBPM * VQwBPM::CreateCombo ( const VQwBPM source)
static

Definition at line 289 of file VQwBPM.cc.

References QwLog::endl(), VQwDataElement::GetModuleType(), QwMessage, and QwWarning.

290 {
291  Bool_t localDebug = kFALSE;
292  TString type = source.GetModuleType();
293  type.ToUpper();
294  if( localDebug ) QwMessage<<"Creating CombinedBCM of type: "<<type<< QwLog::endl;
295  // (jc2) As a first try, let's do this the ugly way (but rather very
296  // simple), just list out the types of BCM's supported by this code!!!
297  if( type == "VQWK") {
298  return new QwCombinedBPM<QwVQWK_Channel>(dynamic_cast<const QwCombinedBPM<QwVQWK_Channel>&>(source));
299  } else if ( type == "SIS3801" ) { // Default SCALER channel
300  return new QwCombinedBPM<QwSIS3801_Channel>(dynamic_cast<const QwCombinedBPM<QwSIS3801_Channel>&>(source));
301  } else if ( type == "SCALER" || type == "SIS3801D24" ) {
302  return new QwCombinedBPM<QwSIS3801D24_Channel>(dynamic_cast<const QwCombinedBPM<QwSIS3801D24_Channel>&>(source));
303  } else { // Unsupported one!
304  QwWarning << "BPM of type="<<type<<" is UNSUPPORTED!!\n";
305  exit(-1);
306  }
307 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
TString GetModuleType() const
Return the type of the beam instrument.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

VQwBPM * VQwBPM::CreateStripline ( TString  subsystemname,
TString  type,
TString  name 
)
static

A fast way of creating a BPM stripline of specified type.

Definition at line 225 of file VQwBPM.cc.

References QwMessage, and QwWarning.

Referenced by QwBeamLine::AddToElementList(), and QwBeamLine::CopyTemplatedDataElements().

226 {
227  Bool_t localDebug = kFALSE;
228  type.ToUpper();
229  if( localDebug ) QwMessage<<"Creating BPM of type: "<<type<<" with name: "<<
230  name<<". Subsystem Name: " <<subsystemname<<"\n";
231  // (jc2) As a first try, let's do this the ugly way (but rather very
232  // simple), just list out the types of BPM's supported by this code!!!
233  if( type == "VQWK") {
234  return new QwBPMStripline<QwVQWK_Channel>(subsystemname,name,type);
235  } else if ( type == "SIS3801" ) {
236  return new QwBPMStripline<QwSIS3801_Channel>(subsystemname,name,type);
237  } else if ( type == "SCALER" || type == "SIS3801D24" ) {
238  return new QwBPMStripline<QwSIS3801D24_Channel>(subsystemname,name,type);
239  } else { // Unsupported one!
240  QwWarning << "BPM of type="<<type<<" is UNSUPPORTED!!\n";
241  exit(-1);
242  }
243 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the caller graph for this function:

VQwBPM * VQwBPM::CreateStripline ( const VQwBPM source)
static

Definition at line 245 of file VQwBPM.cc.

References QwLog::endl(), VQwDataElement::GetModuleType(), QwMessage, and QwWarning.

246 {
247  Bool_t localDebug = kFALSE;
248  TString type = source.GetModuleType();
249  type.ToUpper();
250  if( localDebug ) QwMessage<<"Creating BPM of type: "<<type << QwLog::endl;
251  // (jc2) As a first try, let's do this the ugly way (but rather very
252  // simple), just list out the types of BPM's supported by this code!!!
253  if( type == "VQWK") {
254  return new QwBPMStripline<QwVQWK_Channel>(dynamic_cast<const QwBPMStripline<QwVQWK_Channel>&>(source));
255  } else if ( type == "SIS3801" ) {
256  return new QwBPMStripline<QwSIS3801_Channel>(dynamic_cast<const QwBPMStripline<QwSIS3801_Channel>&>(source));
257  } else if ( type == "SCALER" || type == "SIS3801D24" ) {
258  return new QwBPMStripline<QwSIS3801D24_Channel>(dynamic_cast<const QwBPMStripline<QwSIS3801D24_Channel>&>(source));
259  } else { // Unsupported one!
260  QwWarning << "BPM of type="<<type<<" is UNSUPPORTED!!\n";
261  exit(-1);
262  }
263 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
TString GetModuleType() const
Return the type of the beam instrument.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

virtual void VQwBPM::DeaccumulateRunningSum ( VQwBPM value)
pure virtual
virtual void VQwBPM::EncodeEventData ( std::vector< UInt_t > &  buffer)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 209 of file VQwBPM.h.

209  {
210  std::cerr << "EncodeEventData is undefined!!!\n";
211  }
virtual void VQwBPM::FillHistograms ( )
pure virtual

Fill the histograms for this data element.

Implements VQwDataElement.

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

virtual void VQwBPM::FillTreeVector ( std::vector< Double_t > &  values) const
pure virtual
virtual void VQwBPM::GetAbsolutePosition ( )
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 172 of file VQwBPM.h.

172  {
173  std::cerr << "GetAbsolutePosition() is not implemented!!\n";
174  }
virtual const VQwHardwareChannel* VQwBPM::GetAngleX ( ) const
inlinevirtual

Reimplemented in QwCombinedBPM< T >.

Definition at line 184 of file VQwBPM.h.

184  {
185  std::cerr << "GetAngleX() is not implemented for VQwBPM, must be"
186  "used in a CombinedBPM!\n";
187  return 0;
188  }
virtual const VQwHardwareChannel* VQwBPM::GetAngleY ( ) const
inlinevirtual

Reimplemented in QwCombinedBPM< T >.

Definition at line 189 of file VQwBPM.h.

189  {
190  std::cerr << "GetAngleY() is not implemented for VQwBPM, must be"
191  "used in a CombinedBPM!\n";
192  return 0;
193  }
virtual std::vector<QwDBInterface> VQwBPM::GetDBEntry ( )
pure virtual
virtual const VQwHardwareChannel* VQwBPM::GetEffectiveCharge ( ) const
pure virtual

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Referenced by QwBeamLine::GetChannel().

+ Here is the caller graph for this function:

void VQwBPM::GetElectronicFactors ( Double_t  BSENfactor,
Double_t  AlphaX,
Double_t  AlphaY 
)

Definition at line 47 of file VQwBPM.cc.

References fQwStriplineCalibration, fRelativeGains, and VQwDataElement::GetElementName().

Referenced by QwBeamLine::LoadGeometryDefinition().

48 {
49  // Read in the electronic factors from the file
50  Bool_t ldebug = kFALSE;
51 
52  fQwStriplineCalibration = BSENfactor*18.81;
53 
54  fRelativeGains[0]=AlphaX;
55  fRelativeGains[1]=AlphaY;
56 
57  if(ldebug){
58  std::cout<<"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
59  std::cout<<this->GetElementName();
60  std::cout<<"\nfQwStriplineCalibration = "<<fQwStriplineCalibration<<std::endl;
61  std::cout<<"AlphaX = "<<fRelativeGains[0]<<std::endl;
62  std::cout<<"AlphaY = "<<fRelativeGains[1]<<std::endl;
63 
64  }
65  return;
66 }
Double_t fQwStriplineCalibration
Definition: VQwBPM.h:257
Double_t fRelativeGains[2]
Definition: VQwBPM.h:258
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual std::vector<QwErrDBInterface> VQwBPM::GetErrDBEntry ( )
pure virtual
virtual const VQwHardwareChannel* VQwBPM::GetPosition ( EBeamPositionMonitorAxis  axis) const
pure virtual

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Referenced by QwBeamLine::GetChannel().

+ Here is the caller graph for this function:

Double_t VQwBPM::GetPositionInZ ( ) const
inline

Definition at line 132 of file VQwBPM.h.

References fPositionCenter.

132  {
133  return fPositionCenter[2];
134  };
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
VQwHardwareChannel* VQwBPM::GetSubelementByIndex ( size_t  index)
inlineprotected

Definition at line 248 of file VQwBPM.h.

References fSubelementNames, and GetSubelementByName().

248  {
249  return GetSubelementByName(fSubelementNames.at(index));
250  };
virtual VQwHardwareChannel * GetSubelementByName(TString ch_name)=0
std::vector< TString > fSubelementNames
Definition: VQwBPM.h:250

+ Here is the call graph for this function:

virtual VQwHardwareChannel* VQwBPM::GetSubelementByName ( TString  ch_name)
protectedpure virtual

Implemented in QwCombinedBPM< T >, QwBPMStripline< T >, QwLinearDiodeArray, QwQPD, and QwBPMCavity.

Referenced by GetSubelementByIndex(), and SetSingleEventCuts().

+ Here is the caller graph for this function:

virtual TString VQwBPM::GetSubElementName ( Int_t  subindex)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 168 of file VQwBPM.h.

168  {
169  std::cerr << "GetSubElementName() is not implemented!!\n";
170  return TString("OBJECT_UNDEFINED"); // Return an erroneous TString
171  }
void VQwBPM::GetSurveyOffsets ( Double_t  Xoffset,
Double_t  Yoffset,
Double_t  Zoffset 
)

Definition at line 36 of file VQwBPM.cc.

References fPositionCenter.

Referenced by QwBeamLine::LoadGeometryDefinition().

37 {
38  // Read in the position offsets from the geometry map file
39  for(Short_t i=0;i<3;i++) fPositionCenter[i]=0.0;
40  fPositionCenter[0]=Xoffset;
41  fPositionCenter[1]=Yoffset;
42  fPositionCenter[2]=Zoffset;
43  return;
44 }
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256

+ Here is the caller graph for this function:

virtual void VQwBPM::IncrementErrorCounters ( )
pure virtual
void VQwBPM::InitializeChannel ( TString  name)

Definition at line 25 of file VQwBPM.cc.

References fPositionCenter, and VQwDataElement::SetElementName().

Referenced by QwQPD::InitializeChannel(), QwBPMCavity::InitializeChannel(), QwLinearDiodeArray::InitializeChannel(), QwCombinedBPM< T >::InitializeChannel(), and QwBPMStripline< T >::InitializeChannel().

26 {
27  Short_t i = 0;
28 
29  for(i=0;i<3;i++) fPositionCenter[i] = 0.0;
30 
31  SetElementName(name);
32 
33  return;
34 }
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
void SetElementName(const TString &name)
Set the name of this element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VQwBPM::InitializeChannel_base ( )
inlineprivate

Definition at line 230 of file VQwBPM.h.

References fGains, fQwStriplineCalibration, and fRelativeGains.

Referenced by VQwBPM().

230  {
231 /* fAbsPos_base[0] = NULL; */
232 /* fAbsPos_base[1] = NULL; */
233 /* fEffectiveCharge_base = NULL; */
234  fQwStriplineCalibration = 18.81; // adc counts/mm default value
235  for(Short_t i=0;i<2;i++) {
236  fRelativeGains[i]=1.0;
237  fGains[i]=1.0;
238  }
239  };
Double_t fQwStriplineCalibration
Definition: VQwBPM.h:257
Double_t fRelativeGains[2]
Definition: VQwBPM.h:258
Double_t fGains[2]
Definition: VQwBPM.h:259

+ Here is the caller graph for this function:

virtual void VQwBPM::LoadChannelParameters ( QwParameterFile paramfile)
pure virtual
virtual VQwBPM& VQwBPM::operator+= ( const VQwBPM value)
pure virtual
virtual VQwBPM& VQwBPM::operator-= ( const VQwBPM value)
pure virtual
VQwBPM & VQwBPM::operator= ( const VQwBPM value)
pure virtual

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 115 of file VQwBPM.cc.

References axis, bRotated, fCosRotation, fGoodEvent, fPositionCenter, fQwStriplineCalibration, fRelativeGains, fRotationAngle, fSinRotation, VQwDataElement::GetElementName(), kNumAxes, and kXAxis.

Referenced by QwBPMCavity::operator=(), QwLinearDiodeArray::operator=(), QwCombinedBPM< T >::operator=(), and QwBPMStripline< T >::operator=().

116 {
117  if (GetElementName()!=""){
119  bRotated = value.bRotated;
121  fCosRotation = value.fCosRotation;
122  fSinRotation = value.fSinRotation;
123  fGoodEvent = value.fGoodEvent;
124  // fDeviceErrorCode = value.fDeviceErrorCode;
125  // bFullSave = value.bFullSave;
126  for(size_t axis=kXAxis;axis<kNumAxes;axis++){
129  }
130  // Copy Z center position
131  this->fPositionCenter[2]=value.fPositionCenter[2];
132  }
133  return *this;
134 }
Double_t fQwStriplineCalibration
Definition: VQwBPM.h:257
Double_t fRelativeGains[2]
Definition: VQwBPM.h:258
Bool_t fGoodEvent
Definition: VQwBPM.h:270
Bool_t bRotated
Definition: VQwBPM.h:263
Double_t fRotationAngle
Definition: VQwBPM.h:264
Double_t fPositionCenter[3]
Definition: VQwBPM.h:256
Double_t fCosRotation
Definition: VQwBPM.h:265
static const TString axis[3]
Definition: VQwBPM.h:260
Double_t fSinRotation
Definition: VQwBPM.h:266
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void VQwBPM::PrintErrorCounters ( ) const
inlinevirtual

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

Reimplemented from VQwDataElement.

Reimplemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 176 of file VQwBPM.h.

176  {// report number of events failed due to HW and event cut faliure
177  std::cerr << "PrintErrorCounters() is not implemented!!\n";
178  }
virtual void VQwBPM::PrintInfo ( ) const
inlinevirtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Reimplemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, and QwBPMCavity.

Definition at line 218 of file VQwBPM.h.

218  {
219  std::cout<<"PrintInfo() for VQwBPM not impletemented\n";
220  };
virtual void VQwBPM::ProcessEvent ( )
pure virtual
virtual void VQwBPM::RandomizeEventData ( int  helicity = 0,
double  time = 0.0 
)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 206 of file VQwBPM.h.

206  {
207  std::cerr << "RandomizeEventData is undefined!!!\n";
208  }
virtual void VQwBPM::Ratio ( VQwBPM numer,
VQwBPM denom 
)
inlinevirtual

Reimplemented in QwBPMStripline< T >, and QwCombinedBPM< T >.

Definition at line 158 of file VQwBPM.h.

References VQwDataElement::GetElementName().

158  {
159  std::cerr << "Ratio() is not defined for BPM named="<<GetElementName()<<"\n";
160  }
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

virtual void VQwBPM::Scale ( Double_t  factor)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 86 of file VQwBPM.h.

86  {
87  std::cerr << "Scale for VQwBPM not implemented!\n";
88  }
virtual void VQwBPM::SetBPMForCombo ( const VQwBPM bpm,
Double_t  charge_weight,
Double_t  x_weight,
Double_t  y_weight,
Double_t  sumqw 
)
inlinevirtual

Reimplemented in QwCombinedBPM< T >.

Definition at line 194 of file VQwBPM.h.

195  {
196  std::cerr << "VQwBPM::SetBPMForCombo only defined for CombinedBPM's!!!\n";
197  }
virtual void VQwBPM::SetDefaultSampleSize ( Int_t  sample_size)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 200 of file VQwBPM.h.

200  {
201  std::cerr << "SetDefaultSampleSize() is undefined!!!\n";
202  }
virtual void VQwBPM::SetEventCutMode ( Int_t  bcuts)
pure virtual
void VQwBPM::SetGains ( TString  pos,
Double_t  value 
)

Definition at line 92 of file VQwBPM.cc.

References fGains.

Referenced by QwBeamLine::AssignGeometry().

92  {
93  if(pos.Contains("X")) fGains[0] = value;
94  if(pos.Contains("Y")) fGains[1] = value;
95 }
Double_t fGains[2]
Definition: VQwBPM.h:259

+ Here is the caller graph for this function:

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

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 203 of file VQwBPM.h.

Referenced by main().

203  {
204  std::cerr<< "SetRandomEventParameters undefined!!\n";
205  }

+ Here is the caller graph for this function:

void VQwBPM::SetRootSaveStatus ( TString &  prefix)

Definition at line 178 of file VQwBPM.cc.

References bFullSave.

Referenced by QwQPD::ConstructBranch(), QwBPMCavity::ConstructBranch(), QwLinearDiodeArray::ConstructBranch(), QwQPD::ConstructBranchAndVector(), QwBPMCavity::ConstructBranchAndVector(), QwLinearDiodeArray::ConstructBranchAndVector(), QwQPD::ConstructHistograms(), QwBPMCavity::ConstructHistograms(), and QwLinearDiodeArray::ConstructHistograms().

179 {
180  if(prefix=="diff_"||prefix=="yield_"|| prefix=="asym_")
181  bFullSave=kFALSE;
182 
183  return;
184 }
Bool_t bFullSave
Definition: VQwBPM.h:273

+ Here is the caller graph for this function:

void VQwBPM::SetRotation ( Double_t  rotation_angle)

Definition at line 68 of file VQwBPM.cc.

References fCosRotation, fRotationAngle, fSinRotation, and VQwDataElement::GetElementName().

Referenced by QwBeamLine::AssignGeometry(), QwBPMStripline< T >::QwBPMStripline(), and SetRotationOff().

68  {
69  // Read the rotation angle in degrees (to beam right)
70  Bool_t ldebug = kFALSE;
71  fSinRotation = 0;
72  fCosRotation = 0;
73  fRotationAngle = rotation_angle;
74  fSinRotation = TMath::Sin(fRotationAngle*(TMath::DegToRad()));
75  fCosRotation = TMath::Cos(fRotationAngle*(TMath::DegToRad()));
76 
77  if(ldebug){
78  std::cout<<"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
79  std::cout<<this->GetElementName();
80  std::cout<<" is rotated by angle = "<<rotation_angle<<std::endl;
81 
82  }
83 }
Double_t fRotationAngle
Definition: VQwBPM.h:264
Double_t fCosRotation
Definition: VQwBPM.h:265
Double_t fSinRotation
Definition: VQwBPM.h:266
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VQwBPM::SetRotationOff ( )

Definition at line 85 of file VQwBPM.cc.

References bRotated, fRotationAngle, and SetRotation().

Referenced by QwBeamLine::AssignGeometry().

85  {
86  // Turn off rotation. This object is already in accelerator coordinates.
87  fRotationAngle = 0.0;
89  bRotated=kFALSE;
90 }
Bool_t bRotated
Definition: VQwBPM.h:263
Double_t fRotationAngle
Definition: VQwBPM.h:264
void SetRotation(Double_t)
Definition: VQwBPM.cc:68

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VQwBPM::SetSingleEventCuts ( TString  ch_name,
Double_t  minX,
Double_t  maxX 
)

Definition at line 97 of file VQwBPM.cc.

References QwLog::endl(), VQwDataElement::GetElementName(), GetSubelementByName(), QwMessage, and VQwHardwareChannel::SetSingleEventCuts().

98 {
99  VQwHardwareChannel* tmpptr = GetSubelementByName(ch_name);
100  QwMessage << GetElementName() << " " << ch_name
101  << " LL " << minX <<" UL " << maxX <<QwLog::endl;
102  tmpptr->SetSingleEventCuts(minX,maxX);
103 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void SetSingleEventCuts(Double_t min, Double_t max)
Set the upper and lower limits (fULimit and fLLimit) for this channel.
virtual VQwHardwareChannel * GetSubelementByName(TString ch_name)=0
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.

+ Here is the call graph for this function:

void VQwBPM::SetSingleEventCuts ( TString  ch_name,
UInt_t  errorflag,
Double_t  minX,
Double_t  maxX,
Double_t  stability 
)

Definition at line 105 of file VQwBPM.cc.

References QwLog::endl(), VQwDataElement::GetElementName(), GetSubelementByName(), kBPMErrorFlag, QwMessage, and VQwHardwareChannel::SetSingleEventCuts().

106 {
107  VQwHardwareChannel* tmpptr = GetSubelementByName(ch_name);
108  errorflag|=kBPMErrorFlag;//update the device flag
109  QwMessage << GetElementName() << " " << ch_name
110  << " LL " << minX <<" UL " << maxX <<QwLog::endl;
111  tmpptr->SetSingleEventCuts(errorflag,minX,maxX,stability);
112 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void SetSingleEventCuts(Double_t min, Double_t max)
Set the upper and lower limits (fULimit and fLLimit) for this channel.
virtual VQwHardwareChannel * GetSubelementByName(TString ch_name)=0
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.
static const UInt_t kBPMErrorFlag
Definition: QwTypes.h:169

+ Here is the call graph for this function:

virtual void VQwBPM::SetSubElementCalibrationFactor ( Int_t  j,
Double_t  value 
)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 215 of file VQwBPM.h.

215  {
216  std::cerr << "SetSubElementCalibrationFactor is undefined!!!\n";
217  }
virtual void VQwBPM::SetSubElementPedestal ( Int_t  j,
Double_t  value 
)
inlinevirtual

Reimplemented in QwBPMStripline< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

Definition at line 212 of file VQwBPM.h.

212  {
213  std::cerr << "SetSubElementPedestal is undefined!!!\n";
214  }
virtual UInt_t VQwBPM::UpdateErrorFlag ( )
pure virtual

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

Reimplemented from VQwDataElement.

Implemented in QwBPMStripline< T >, QwCombinedBPM< T >, QwLinearDiodeArray, QwBPMCavity, and QwQPD.

virtual void VQwBPM::UpdateErrorFlag ( const VQwBPM ev_error)
pure virtual

Friends And Related Function Documentation

template<typename TT >
friend class QwBPMStripline
friend

Definition at line 47 of file VQwBPM.h.

template<typename TT >
friend class QwCombinedBPM
friend

Definition at line 48 of file VQwBPM.h.

friend class QwEnergyCalculator
friend

Definition at line 49 of file VQwBPM.h.

Field Documentation

Bool_t VQwBPM::bRotated
protected
Double_t VQwBPM::fCosRotation
protected

Definition at line 265 of file VQwBPM.h.

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

Double_t VQwBPM::fGains[2]
protected

Definition at line 259 of file VQwBPM.h.

Referenced by InitializeChannel_base(), and SetGains().

Bool_t VQwBPM::fGoodEvent
protected

Definition at line 270 of file VQwBPM.h.

Referenced by operator=().

Double_t VQwBPM::fQwStriplineCalibration
protected

Definition at line 257 of file VQwBPM.h.

Referenced by GetElectronicFactors(), InitializeChannel_base(), and operator=().

Double_t VQwBPM::fRelativeGains[2]
protected
Double_t VQwBPM::fRotationAngle
protected
Double_t VQwBPM::fSinRotation
protected

Definition at line 266 of file VQwBPM.h.

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

std::vector<TString> VQwBPM::fSubelementNames
protected

Definition at line 250 of file VQwBPM.h.

Referenced by GetSubelementByIndex().

const TString VQwBPM::kAxisLabel ={"X","Y"}
staticprotected

Axis labels for the instrumented directions; Z will never be an instrumented axis.

Definition at line 239 of file VQwBPM.h.

Referenced by QwQPD::InitializeChannel(), QwBPMCavity::InitializeChannel(), and QwQPD::ProcessEvent().


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