29 Bool_t localdebug = kFALSE;
55 Bool_t localdebug = kFALSE;
94 Bool_t eventokay=kTRUE;
97 for(
size_t i=0;i<8;i++)
100 eventokay &= (deviceerror & 0x0);
102 if (
bDEBUG) std::cout<<
" Inconsistent within LinearArray terminals photodiode[ "<<i<<
" ] "<<std::endl;
164 UInt_t error_code = 0;
172 if (
bDEBUG) std::cout<<
" array ["<<i<<
"] event cut failed ";
186 if (
bDEBUG) std::cout<<
" Rel X event cut failed ";
197 if (
bDEBUG) std::cout<<
"EffectiveCharge event cut failed ";
207 if (ch_name==
"relx"){
209 }
else if (ch_name==
"rely"){
211 }
else if (ch_name==
"absx" || ch_name==
"x" ){
213 }
else if (ch_name==
"absy" || ch_name==
"y"){
215 }
else if (ch_name==
"effectivecharge" || ch_name==
"charge"){
218 TString loc=
"QwLinearDiodeArray::GetSubelementByName for"
220 + ch_name +
", which is an unrecognized subelement name.";
221 throw std::invalid_argument(loc.Data());
254 if(
typeid(*ev_error)==
typeid(*
this)) {
267 TString loc=
"Standard exception from QwLinearDiodeArray::UpdateErrorFlag :"+
270 throw std::invalid_argument(loc.Data());
272 }
catch (std::exception&
e) {
273 std::cerr<< e.what()<<std::endl;
279 Bool_t localdebug = kFALSE;
324 std::cout<<
"\n#################"<<std::endl;
325 std::cout<<
" LinearArray name="<<
fElementName<<std::endl;
326 std::cout<<
" Size of the linear array = "<<8<<std::endl;
328 for(Int_t i = 0; i<8; i++)
329 std::cout<<
" pad"<<i<<
" ="<<
fPhotodiode[i].GetValue()<<std::endl;
349 "QwLinearDiodeArray::ProcessEvBuffer(): attemp to fill in raw data for a pad that doesn't exist \n";
351 return word_position_in_buffer;
358 for (
size_t i = 0; i < 2; i++) {
368 for (i = 0; i < 2; i++) {
379 if (subindex>-1) localindex = subindex;
384 std::cerr<<
"QwLinearDiodeArray::GetSubElementName for "
386 << subindex <<
", doesn't exist \n";
396 padindex = subname(subname.Sizeof()-2,1);
398 if (padindex.IsDigit()){
399 Int_t tmpval = padindex.Atoi();
400 if (tmpval>-1) localindex = tmpval-1;
405 std::cerr <<
"QwLinearDiodeArray::GetSubElementIndex is unable to associate the string -"
406 <<subname<<
"- to any index"<<std::endl;
555 TString thisprefix=prefix;
595 TString thisprefix=prefix;
620 TString thisprefix=prefix;
644 devicename.ToLower();
649 if (modulelist.
HasValue(devicename)){
650 TString thisprefix=prefix;
724 std::vector <QwDBInterface> row_list;
727 for(
size_t i=0;i<2;i++) {
739 std::vector <QwErrDBInterface> row_list;
741 for(
size_t i=0;i<2;i++) {
759 Double_t sumX = 1.1e8;
760 Double_t sumY = 0.9e8;
764 Double_t meanXP = (1.0 + meanX) * sumX / 2.0;
765 Double_t meanXM = (1.0 - meanX) * sumX / 2.0;
766 Double_t meanYP = (1.0 + meanY) * sumY / 2.0;
767 Double_t meanYM = (1.0 - meanY) * sumY / 2.0;
771 Double_t sigmaXP = fabs(sumX * sigmaX / meanX);
772 Double_t sigmaXM = sigmaXP;
773 Double_t sigmaYP = fabs(sumY * sigmaY / meanY);
774 Double_t sigmaYM = sigmaYP;
794 for (
size_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.
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t index=0)
Decode the event data from a CODA buffer.
void ProcessEvent()
Process the event data according to pedestal and calibration factor.
static const size_t kMaxElements
size_t GetNumberOfSamples() const
void EncodeEventData(std::vector< UInt_t > &buffer)
std::vector< QwVQWK_Channel > fLinearArrayElementList
static UInt_t GetSubElementIndex(TString subname)
void MakeLinearArrayList()
void SetRootSaveStatus(TString &prefix)
void SetRandomEventParameters(Double_t mean, Double_t sigma)
Set the normal random event parameters.
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
void DeaccumulateRunningSum(const QwVQWK_Channel &value)
void Ratio(const QwVQWK_Channel &numer, const QwVQWK_Channel &denom)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void SetSubElementPedestal(Int_t j, Double_t value)
void PrintInfo() const
Print multiple lines of information about this data element.
void SetPedestal(Double_t ped)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Double_t GetValue(size_t element) const
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void PrintInfo() const
Print multiple lines of information about this data element.
Double_t fPositionCenter[3]
void SetEventCutMode(Int_t bcuts)
void Scale(Double_t Offset)
TString GetSubElementName(Int_t subindex)
std::vector< QwDBInterface > GetDBEntry()
VQwBPM & operator+=(const VQwBPM &value)
VQwHardwareChannel * GetSubelementByName(TString ch_name)
void ConstructBranch(TTree *tree, TString &prefix)
static const UInt_t kInvalidSubelementIndex
virtual UInt_t GetErrorCode() const
void IncrementErrorCounters()
void ClearEventData()
Clear the event data in this element.
void SetHardwareSum(Double_t hwsum, UInt_t sequencenumber=0)
VQwBPM & operator=(const VQwBPM &value)
void GetAbsolutePosition()
void FillTreeVector(std::vector< Double_t > &values) const
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
Bool_t ApplySingleEventCuts()
Bool_t HasValue(TString &vname)
void AccumulateRunningSum(const QwLinearDiodeArray &value)
virtual UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
void SetCalibrationFactor(Double_t factor)
void PrintValue() const
Print single line of value and error of this data element.
void InitializeChannel(TString name)
void SetSubElementCalibrationFactor(Int_t j, Double_t value)
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void ClearEventData()
Clear the event data in this element.
void ConstructBranch(TTree *tree, TString &prefix)
Bool_t ApplySingleEventCuts(Double_t LL, Double_t UL)
void SetEventData(Double_t *block, UInt_t sequencenumber)
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 fPhotodiode[8]
void InitializeChannel(TString name)
void Scale(Double_t factor)
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
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 FillHistograms()
Fill the histograms for this data element.
void Product(const QwVQWK_Channel &value1, const QwVQWK_Channel &value2)
VQwBPM & operator-=(const VQwBPM &value)
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 Ratio(QwLinearDiodeArray &numer, QwLinearDiodeArray &denom)
void CalculateRunningAverage()
void FillHistograms()
Fill the histograms for this data element.
void DeaccumulateRunningSum(QwLinearDiodeArray &value)
QwVQWK_Channel fRelPos[2]
void PrintValue() const
Print single line of value and error of this data element.
void SetRandomEventParameters(Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY)
size_t GetSequenceNumber() const
void RandomizeEventData(int helicity=0, double time=0.0)
QwVQWK_Channel fEffectiveCharge
std::vector< QwErrDBInterface > GetErrDBEntry()
virtual VQwBPM & operator=(const VQwBPM &value)=0
void InitializeChannel(TString name, TString datatosave)
Initialize the fields in this object.
void AddChannelOffset(Double_t Offset)
void AddErrEntriesToList(std::vector< QwErrDBInterface > &row_list)
void IncrementErrorCounters()
void CalculateRunningAverage()
static const TString subelement[8]
static const Double_t kQwLinearDiodeArrayPadSize
QwVQWK_Channel fAbsPos[2]
void SetDefaultSampleSize(Int_t sample_size)
void AccumulateRunningSum(const QwVQWK_Channel &value)