23 Bool_t localdebug = kFALSE;
49 Bool_t localdebug = kFALSE;
73 Bool_t ldebug = kFALSE;
79 std::cout<<
"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
108 Bool_t eventokay=kTRUE;
110 UInt_t deviceerror=0;
111 for(Short_t i=0;i<4;i++)
114 eventokay &= (deviceerror & 0x0);
116 if (
bDEBUG) std::cout<<
" Inconsistent within QPD terminals photodiode[ "<<i<<
" ] "<<std::endl;
187 UInt_t error_code = 0;
220 }
else if (ch_name==
"tr"){
222 }
else if (ch_name==
"br"){
224 }
else if (ch_name==
"bl"){
226 }
else if (ch_name==
"relx"){
228 }
else if (ch_name==
"rely"){
230 }
else if (ch_name==
"absx" || ch_name==
"x" ){
232 }
else if (ch_name==
"absy" || ch_name==
"y"){
234 }
else if (ch_name==
"effectivecharge" || ch_name==
"charge"){
237 TString loc=
"QwQPD::GetSubelementByName for"
239 + ch_name +
", which is an unrecognized subelement name.";
240 throw std::invalid_argument(loc.Data());
327 if(
typeid(*ev_error)==
typeid(*
this)) {
330 const QwQPD* value_bpm =
dynamic_cast<const QwQPD*
>(ev_error);
341 TString loc=
"Standard exception from QwQPD::UpdateErrorFlag :"+
344 throw std::invalid_argument(loc.Data());
346 }
catch (std::exception&
e) {
347 std::cerr<< e.what()<<std::endl;
356 Bool_t localdebug = kFALSE;
398 std::cout<<
"#############################\n";
413 numer[0].
Sum(tmp1,tmp2);
421 numer[1].
Sum(tmp1,tmp2);
438 std::cout<<
" hw numerator= "<<numer[i].
GetValue()<<
" ";
459 "QwQPD::ProcessEvBuffer(): attemp to fill in raw date for a wire that doesn't exist \n";
461 return word_position_in_buffer;
468 if(subindex<4&&subindex>-1)
471 std::cerr<<
"QwQPD::GetSubElementName for "<<
481 for(Short_t i=0;i<4;i++)
if(subname==
subelement[i])localindex=i;
484 std::cerr <<
"QwQPD::GetSubElementIndex is unable to associate the string -"
485 <<subname<<
"- to any index"<<std::endl;
492 *(
dynamic_cast<QwQPD*
>(
this)) = *(
dynamic_cast<const QwQPD*
>(&value));
512 *(
dynamic_cast<QwQPD*
>(
this)) += *(
dynamic_cast<const QwQPD*
>(&value));
533 *(
dynamic_cast<QwQPD*
>(
this)) -= *(
dynamic_cast<const QwQPD*
>(&value));
582 for (i = 0; i < 2; i++){
599 for (i = 0; i < 2; i++){
619 for (i = 0; i < 2; i++){
638 TString thisprefix=prefix;
680 TString thisprefix=prefix;
706 TString thisprefix=prefix;
731 devicename.ToLower();
736 if (modulelist.
HasValue(devicename)){
737 TString thisprefix=prefix;
815 std::vector <QwDBInterface> row_list;
829 std::vector <QwErrDBInterface> row_list;
849 Double_t sumX = 1.1e8;
850 Double_t sumY = 0.9e8;
861 Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
862 Double_t sigmaXM = sigmaXP;
863 Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
864 Double_t sigmaYM = sigmaYP;
884 for (Short_t i=0; i<2; i++)
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
#define QwMessage
Predefined log drain for regular messages.
Bool_t ApplySingleEventCuts()
void CalculateRunningAverage()
Double_t fRelativeGains[2]
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
Decode the event data from a CODA buffer.
void SetSubElementCalibrationFactor(Int_t j, Double_t value)
void ProcessEvent()
Process the event data according to pedestal and calibration factor.
size_t GetNumberOfSamples() const
void SetEventData(Double_t *block, UInt_t sequencenumber)
void SetRandomEventParameters(Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
void SetRootSaveStatus(TString &prefix)
void SetRandomEventParameters(Double_t mean, Double_t sigma)
Set the normal random event parameters.
void FillTreeVector(std::vector< Double_t > &values) const
static const Bool_t bDEBUG
void ClearEventData()
Clear the event data in this element.
void InitializeChannel(TString name)
void SetDefaultSampleSize(Int_t sample_size)
void DeaccumulateRunningSum(const QwVQWK_Channel &value)
void IncrementErrorCounters()
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void PrintInfo() const
Print multiple lines of information about this data element.
void SetPedestal(Double_t ped)
VQwBPM & operator-=(const VQwBPM &value)
void AccumulateRunningSum(const QwQPD &value)
Double_t GetValue(size_t element) const
std::vector< QwErrDBInterface > GetErrDBEntry()
Double_t fQwQPDCalibration[2]
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.
void SetEventCutMode(Int_t bcuts)
VQwBPM & operator=(const VQwBPM &value)
void Scale(Double_t Offset)
void ConstructBranch(TTree *tree, TString &prefix)
static const TString kAxisLabel[2]
static const UInt_t kInvalidSubelementIndex
QwVQWK_Channel fPhotodiode[4]
virtual UInt_t GetErrorCode() const
void FillHistograms()
Fill the histograms for this data element.
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
std::vector< QwVQWK_Channel > fQPDElementList
void RandomizeEventData(int helicity=0, double time=0.0)
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
VQwHardwareChannel * GetSubelementByName(TString ch_name)
Bool_t HasValue(TString &vname)
void Scale(Double_t factor)
void DeaccumulateRunningSum(VQwBPM &value)
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
void SetCalibrationFactor(Double_t factor)
void ConstructBranch(TTree *tree, TString &prefix)
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
void ClearEventData()
Clear the event data in this element.
QwVQWK_Channel fAbsPos[2]
Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL)
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber)
Process the CODA event buffer for this element.
void FillTreeVector(std::vector< Double_t > &values) const
QwVQWK_Channel fRelPos[2]
void InitializeChannel(TString name)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
TString GetSubElementName(Int_t subindex)
VQwBPM & operator+=(const VQwBPM &value)
std::vector< QwDBInterface > GetDBEntry()
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
void FillHistograms()
Fill the histograms for this data element.
void Ratio(QwQPD &numer, QwQPD &denom)
void Sum(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
static UInt_t GetSubElementIndex(TString subname)
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
static std::ostream & endl(std::ostream &)
End of the line.
TString fElementName
Name of this data element.
virtual const TString & GetElementName() const
Get the name of this element.
void Difference(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
void EncodeEventData(std::vector< UInt_t > &buffer)
void GetCalibrationFactors(Double_t AlphaX, Double_t AlphaY)
static const TString subelement[4]
size_t GetSequenceNumber() const
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
void AddErrEntriesToList(std::vector< QwErrDBInterface > &row_list)
void IncrementErrorCounters()
QwVQWK_Channel fEffectiveCharge
void CalculateRunningAverage()
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
void AccumulateRunningSum(const QwVQWK_Channel &value)
void SetSubElementPedestal(Int_t j, Double_t value)