20#ifdef HAS_RNTUPLE_SUPPORT
21#include "ROOT/RNTupleModel.hxx"
32#ifdef __USE_DATABASE__
83 for (
size_t i = 0; i < 3; i++)
99 {std::cerr <<
"FillRawEventData for VQwBPM not implemented for device " <<
GetElementName() <<
"!\n";};
103 void GetSurveyOffsets(Double_t Xoffset, Double_t Yoffset, Double_t Zoffset);
114 std::cerr <<
"Scale for VQwBPM not implemented!\n";
116 void SetGains(TString pos, Double_t value);
155 TString loc=
"VQwBPM::GetPosition for "
157 throw std::out_of_range(loc.Data());
179 std::cerr <<
"AccumulateRunningSum not implemented for BPM named="
194#ifdef HAS_RNTUPLE_SUPPORT
195 virtual void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs) = 0;
196 virtual void FillNTupleVector(std::vector<Double_t>& values)
const = 0;
199#ifdef __USE_DATABASE__
200 virtual std::vector<QwDBInterface> GetDBEntry() = 0;
201 virtual std::vector<QwErrDBInterface> GetErrDBEntry() = 0;
205 std::cerr <<
"Ratio() is not defined for BPM named="<<
GetElementName()<<
"\n";
221 std::cerr <<
"GetSubElementName() is not implemented!! for device: " <<
GetElementName() <<
"\n";
222 return TString(
"OBJECT_UNDEFINED");
225 std::cerr <<
"GetAbsolutePosition() is not implemented!!\n";
229 std::cerr <<
"PrintErrorCounters() is not implemented!!\n";
237 std::cerr <<
"GetAngleX() is not implemented for VQwBPM, must be"
238 "used in a CombinedBPM!\n";
242 std::cerr <<
"GetAngleY() is not implemented for VQwBPM, must be"
243 "used in a CombinedBPM!\n";
247 Double_t , Double_t ,Double_t ) {
248 std::cerr <<
"VQwBPM::SetBPMForCombo only defined for CombinedBPM's!!!\n";
253 std::cerr <<
"SetDefaultSampleSize() is undefined!!!\n";
262 std::cerr<<
"SetRandomEventParameters undefined!!\n";
265 std::cerr<<
"SetRandomEventParameters undefined!!\n";
268 std::cerr<<
"SetRandomEventAsymmetry undefined!!\n";
271 std::cerr <<
"RandomizeEventData is undefined for device" <<
GetElementName() <<
"!!!\n";
274 std::cerr <<
"ApplyResolutionSmearing is undefined" <<
GetElementName() <<
"!!!\n";
277 std::cerr <<
"ApplyResolutionSmearing(EBeamPositionMonitorAxis iaxis) is undefined!!!\n";
280 std::cerr <<
"EncodeEventData is undefined!!!\n";
283 std::cerr <<
"SetSubElementPedestal is undefined!!!\n";
286 std::cerr <<
"SetSubElementCalibrationFactor is undefined!!!\n";
289 std::cout<<
"PrintInfo() for VQwBPM not impletemented\n";
306 for(Short_t i=0;i<2;i++) {
Definition of the pure virtual base class of all data elements.
std::shared_ptr< VQwBPM > VQwBPM_ptr
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
VQwDataElement()
Default constructor.
virtual const TString & GetElementName() const
Get the name of this element.
Bool_t CheckForBurpFail(const VQwDataElement *)
Abstract base for concrete hardware channels implementing dual-operator pattern.
Abstract base for beam position monitors (BPMs)
Double_t fPositionCenter[3]
virtual void SetSubElementPedestal(Int_t, Double_t)
virtual void SetSubElementCalibrationFactor(Int_t, Double_t)
friend class QwEnergyCalculator
virtual void ApplyResolutionSmearing()
virtual void UpdateErrorFlag(const VQwBPM *ev_error)=0
friend class QwCombinedBPM
virtual TString GetSubElementName(Int_t)
void PrintErrorCounters() const override
report number of events failed due to HW and event cut failure
friend class QwBPMStripline
void ConstructHistograms(TDirectory *folder, TString &prefix) override=0
Construct the histograms for this data element.
virtual void EncodeEventData(std::vector< UInt_t > &)
virtual VQwHardwareChannel * GetPosition(EBeamPositionMonitorAxis axis)
virtual void SetRandomEventParameters(Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t)
virtual void ConstructBranch(TTree *tree, TString &prefix)=0
std::vector< TString > fSubelementNames
virtual void FillTreeVector(QwRootTreeBranchVector &values) const =0
virtual void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile &modulelist)=0
void LoadChannelParameters(QwParameterFile ¶mfile) override=0
virtual void IncrementErrorCounters()=0
virtual void SetRandomEventParameters(Double_t, Double_t, Double_t, Double_t)
void GetSurveyOffsets(Double_t Xoffset, Double_t Yoffset, Double_t Zoffset)
Store geometry/survey offsets for absolute position calibration.
void SetRotation(Double_t)
Set detector rotation angle and update cached trigonometric values.
Double_t fQwStriplineCalibration
virtual VQwBPM & operator-=(const VQwBPM &value)=0
void SetRootSaveStatus(TString &prefix)
static const TString kAxisLabel[2]
virtual void SetResolution(Double_t resolutionX, Double_t resolutionY)
virtual void SetRandomEventAsymmetry(Double_t)
virtual size_t GetNumberOfElements()
virtual Bool_t CheckForBurpFail(const VQwDataElement *ev_error)
virtual void GetAbsolutePosition()
virtual void SetEventCutMode(Int_t bcuts)=0
virtual const VQwHardwareChannel * GetAngleY() const
void SetSingleEventCuts(TString, Double_t, Double_t)
static VQwBPM * CreateCombo(TString subsystemname, TString type, TString name)
A fast way of creating a BPM stripline of specified type.
Double_t fRelativeGains[2]
virtual Bool_t ApplySingleEventCuts()=0
virtual void SetDefaultSampleSize(Int_t)
void FillHistograms() override=0
Fill the histograms for this data element.
virtual void DeaccumulateRunningSum(VQwBPM &value, Int_t ErrorMask=0xFFFFFFF)=0
void InitializeChannel(TString name)
Initialize common BPM state and set the element name.
virtual void AccumulateRunningSum(const VQwBPM &, Int_t=0, Int_t=0xFFFFFFF)
static const Bool_t bDEBUG
void PrintInfo() const override
Print multiple lines of information about this data element.
virtual void Ratio(VQwBPM &, VQwBPM &)
VQwHardwareChannel * GetSubelementByIndex(size_t index)
UInt_t UpdateErrorFlag() override=0
Update the error flag based on the error flags of internally contained objects Return parameter is th...
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
virtual void SetBPMForCombo(const VQwBPM *, Double_t, Double_t, Double_t, Double_t)
virtual void FillRawEventData()
virtual void RandomizeEventData(int=0, double=0.0)
void GetElectronicFactors(Double_t BSENfactor, Double_t AlphaX, Double_t AlphaY)
Apply per-detector electronic calibration and relative gains.
virtual VQwHardwareChannel * GetSubelementByName(TString ch_name)=0
virtual const VQwHardwareChannel * GetAngleX() const
void SetGains(TString pos, Double_t value)
virtual void GetProjectedPosition(VQwBPM *)
Double_t fQwStriplineCorrection
virtual void CalculateRunningAverage()=0
static VQwBPM * CreateStripline(TString subsystemname, TString type, TString name)
A fast way of creating a BPM stripline of specified type.
static const TString axis[3]
virtual const VQwHardwareChannel * GetEffectiveCharge() const =0
virtual VQwBPM & operator=(const VQwBPM &value)=0
virtual void Scale(Double_t)
VQwBPM(const VQwBPM &source)
virtual void ApplyResolutionSmearing(EBeamPositionMonitorAxis)
virtual VQwBPM & operator+=(const VQwBPM &value)=0
void InitializeChannel_base()
virtual const VQwHardwareChannel * GetPosition(EBeamPositionMonitorAxis axis) const
virtual void ProcessEvent()=0
Double_t GetPositionInZ() const