26 fEffectiveCharge.InitializeChannel(name+
"_EffectiveCharge",
"derived");
28 for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
29 fAbsPos[axis].InitializeChannel(name+kAxisLabel[axis],
"derived");
30 fSlope[axis].InitializeChannel(name+kAxisLabel[axis]+
"Slope",
"derived");
31 fIntercept[axis].InitializeChannel(name+kAxisLabel[axis]+
"Intercept",
"derived");
32 fMinimumChiSquare[axis].InitializeChannel(name+kAxisLabel[axis]+
"MinChiSquare",
"derived");
35 fixedParamCalculated =
false;
44 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
63 fEffectiveCharge.InitializeChannel(subsystem,
"QwCombinedBPM", name+
"_EffectiveCharge",
"derived");
65 for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
66 fAbsPos[axis].InitializeChannel(subsystem,
"QwCombinedBPM", name+kAxisLabel[axis],
"derived");
67 fSlope[axis].InitializeChannel(subsystem,
"QwCombinedBPM", name+kAxisLabel[axis]+
"Slope",
"derived");
68 fIntercept[axis].InitializeChannel(subsystem,
"QwCombinedBPM", name+kAxisLabel[axis]+
"Intercept",
"derived");
69 fMinimumChiSquare[axis].InitializeChannel(subsystem,
"QwCombinedBPM",name+kAxisLabel[axis]+
"MinChiSquare",
"derived");
72 fixedParamCalculated =
false;
81 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
98 fEffectiveCharge.ClearEventData();
100 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
101 fAbsPos[axis].ClearEventData();
102 fSlope[axis].ClearEventData();
103 fIntercept[axis].ClearEventData();
114 fElement.push_back(bpm);
115 fQWeights.push_back(charge_weight);
116 fXWeights.push_back(x_weight);
117 fYWeights.push_back(y_weight);
120 size_t i = fElement.size();
142 Bool_t eventokay=kTRUE;
151 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
152 fAbsPos[axis].IncrementErrorCounters();
153 fSlope[axis].IncrementErrorCounters();
154 fIntercept[axis].IncrementErrorCounters();
155 fMinimumChiSquare[axis].IncrementErrorCounters();
158 fEffectiveCharge.IncrementErrorCounters();
164 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
165 fAbsPos[axis].PrintErrorCounters();
166 fSlope[axis].PrintErrorCounters();
167 fIntercept[axis].PrintErrorCounters();
168 fMinimumChiSquare[axis].PrintErrorCounters();
171 fEffectiveCharge.PrintErrorCounters();
178 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
179 error|=fAbsPos[axis].GetEventcutErrorFlag();
180 error|=fSlope[axis].GetEventcutErrorFlag();
181 error|=fIntercept[axis].GetEventcutErrorFlag();
182 error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
185 error|=fEffectiveCharge.GetEventcutErrorFlag();
202 for(
size_t i=0;i<fElement.size();i++){
209 charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
210 pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
211 pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
215 for(axis=kXAxis;axis<kNumAxes;axis++){
216 fSlope[axis].UpdateErrorFlag(pos_error[axis]);
217 if (fSlope[axis].ApplySingleEventCuts()){
222 if (bDEBUG) std::cout<<
" X Slope event cut failed ";
227 for(axis=kXAxis;axis<kNumAxes;axis++){
228 fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
229 if (fIntercept[axis].ApplySingleEventCuts()){
234 if (bDEBUG) std::cout<<
" X Intercept event cut failed ";
240 for(axis=kXAxis;axis<kNumAxes;axis++){
241 fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
242 if (fMinimumChiSquare[axis].ApplySingleEventCuts()){
247 if (bDEBUG) std::cout<<
" X Intercept event cut failed ";
253 for(axis=kXAxis;axis<kNumAxes;axis++){
254 fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
255 if (fAbsPos[axis].ApplySingleEventCuts()){
260 if (bDEBUG) std::cout<<
" Abs X event cut failed ";
265 fEffectiveCharge.UpdateErrorFlag(charge_error);
266 if (fEffectiveCharge.ApplySingleEventCuts()){
271 if (bDEBUG) std::cout<<
"EffectiveCharge event cut failed ";
289 for(
size_t i=0;i<fElement.size();i++){
291 charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
292 pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
293 pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
297 for(axis=kXAxis;axis<kNumAxes;axis++){
298 fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
299 fSlope[axis].UpdateErrorFlag(pos_error[axis]);
300 fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
301 fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
304 error|=fSlope[axis].GetEventcutErrorFlag();
305 error|=fIntercept[axis].GetEventcutErrorFlag();
306 error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
307 error|=fAbsPos[axis].GetEventcutErrorFlag();
312 fEffectiveCharge.UpdateErrorFlag(charge_error);
314 error|=fEffectiveCharge.GetEventcutErrorFlag();
325 if (ch_name==
"xslope"){
326 tmpptr = &fSlope[kXAxis];
327 }
else if (ch_name==
"yslope"){
328 tmpptr = &fSlope[kYAxis];
329 }
else if (ch_name==
"xintercept"){
330 tmpptr = &fIntercept[kXAxis];
331 }
else if (ch_name==
"yintercept"){
332 tmpptr = &fIntercept[kYAxis];
333 }
else if (ch_name==
"xminchisquare"){
334 tmpptr = &fMinimumChiSquare[kXAxis];
335 }
else if (ch_name==
"yminchisquare"){
336 tmpptr = &fMinimumChiSquare[kYAxis];
337 }
else if (ch_name==
"absx" || ch_name==
"x" ){
338 tmpptr = &fAbsPos[kXAxis];
339 }
else if (ch_name==
"absy" || ch_name==
"y"){
340 tmpptr = &fAbsPos[kYAxis];
341 }
else if (ch_name==
"effectivecharge" || ch_name==
"charge"){
342 tmpptr = &fEffectiveCharge;
344 TString loc=
"QwCombinedBPM::GetSubelementByName for"
345 + this->GetElementName() +
" was passed "
346 + ch_name +
", which is an unrecognized subelement name.";
347 throw std::invalid_argument(loc.Data());
430 if(
typeid(*ev_error)==
typeid(*
this)) {
432 if (this->GetElementName()!=
"") {
434 for(i=kXAxis;i<kNumAxes;i++) {
436 fSlope[i].UpdateErrorFlag(value_bpm->
fSlope[i]);
437 fIntercept[i].UpdateErrorFlag(value_bpm->
fIntercept[i]);
443 TString loc=
"Standard exception from QwCombinedBPM::UpdateErrorFlag :"+
444 ev_error->
GetElementName()+
" "+this->GetElementName()+
" are not of the "
446 throw std::invalid_argument(loc.Data());
448 }
catch (std::exception&
e) {
449 std::cerr<< e.what()<<std::endl;
458 Bool_t ldebug = kFALSE;
460 static T tmpQADC(
"tmpQADC"), tmpADC(
"tmpADC");
463 if(!fixedParamCalculated){
464 if(ldebug) std::cout<<
"QwCombinedBPM:Calculating fixed parameters..\n";
465 CalculateFixedParameter(fXWeights,kXAxis);
466 CalculateFixedParameter(fYWeights,kYAxis);
467 fixedParamCalculated = kTRUE;
470 for(
size_t i=0;i<fElement.size();i++){
472 std::cout<<
"*******************************\n";
473 std::cout<<
" QwCombinedBPM: Reading "<<fElement[i]->GetElementName()<<
" with charge weight ="<<fQWeights[i]
474 <<
" and x weight ="<<fXWeights[i]
475 <<
" and y weight ="<<fYWeights[i]<<
"\n"<<std::flush;
478 tmpQADC.AssignValueFrom(fElement[i]->GetEffectiveCharge());
479 tmpQADC.Scale(fQWeights[i]);
480 fEffectiveCharge+=tmpQADC;
484 std::cout<<
"fElement[" << i <<
"]->GetEffectiveCharge()=="
485 << fElement[i]->GetEffectiveCharge()
486 << std::endl << std::flush;
487 fElement[i]->GetEffectiveCharge()->PrintInfo();
488 std::cout<<
"fElement[" << i <<
"]->GetPosition(kXAxis)=="
489 << fElement[i]->GetPosition(kXAxis)
490 << std::endl << std::flush;
491 std::cout<<
"fElement[" << i <<
"]->GetPosition(kYAxis)=="
492 << fElement[i]->GetPosition(kYAxis)
493 << std::endl << std::flush;
495 if (fElement[i]->GetEffectiveCharge()==NULL){
496 std::cout<<
"fElement[" << i <<
"]->GetEffectiveCharge returns NULL"
499 std::cout<<
"got 4-wire.hw_sum = "<<fEffectiveCharge.GetValue()
501 << fElement[i]->GetEffectiveCharge()->GetValue()
502 << std::endl << std::flush;
505 std::cout<<
"copied absolute X position hw_sum from device "
506 << fElement[i]->GetPosition(kXAxis)->GetValue() <<std::endl;
507 std::cout<<
"copied absolute Y position hw_sum from device "
508 << fElement[i]->GetPosition(kYAxis)->GetValue() <<std::endl;
513 fEffectiveCharge.Scale(1.0/fSumQweights);
516 LeastSquareFit(kXAxis, fXWeights );
519 LeastSquareFit(kYAxis, fYWeights );
523 std::cout<<
" QwCombinedBPM:: Projected target X position = "<<fAbsPos[kXAxis].GetValue()
524 <<
" and target X slope = "<<fSlope[kXAxis].GetValue()
525 <<
" and target X intercept = "<<fIntercept[kXAxis].GetValue()
526 <<
" with mimimum chi square = "<< fMinimumChiSquare[kXAxis].GetValue()
527 <<
" \nProjected target Y position = "<<fAbsPos[kYAxis].GetValue()
528 <<
" and target Y slope = "<<fSlope[kYAxis].GetValue()
529 <<
" and target Y intercept = "<<fIntercept[kYAxis].GetValue()
530 <<
" with mimimum chi square = "<< fMinimumChiSquare[kYAxis].GetValue()<<std::endl;
536 fEffectiveCharge.PrintInfo();
537 for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
538 fAbsPos[axis].PrintInfo();
539 fSlope[axis].PrintInfo();
540 fIntercept[axis].PrintInfo();
541 fMinimumChiSquare[axis].PrintInfo();
555 Bool_t ldebug = kFALSE;
556 static Double_t zpos = 0.0;
558 for(
size_t i=0;i<fElement.size();i++){
559 zpos = fElement[i]->GetPositionInZ();
560 A[pos] += zpos*fWeights[i];
561 B[pos] += fWeights[i];
562 D[pos] += zpos*zpos*fWeights[i];
565 m[pos] = D[pos]*B[pos]-A[pos]*A[pos];
566 erra[pos] = B[pos]/
m[pos];
567 errb[pos] = D[pos]/
m[pos];
568 covab[pos] = -A[pos]/
m[pos];
575 std::cout<<
" A = "<<A[pos]<<
", B = "<<B[pos]<<
", D = "<<D[pos]<<
", m = "<<
m[pos]<<std::endl;
576 std::cout<<
"For least square fit, errors are "<<erra[pos]
577 <<
"\ncovariance = "<<covab[pos]<<
"\n\n";
588 if(weight.size()!=fElement.size()){
590 <<
"QwCombinedBPM:: Number of devices doesnt match the number of weights."
591 <<
" Exiting calculating parameters for the least squares fit"
595 for(
size_t i=0;i<weight.size();i++){
596 val[i].Scale(weight[i]);
597 sum+=val[i].GetValue();
618 Bool_t ldebug = kFALSE;
619 static Double_t zpos = 0;
620 static T tmp1(
"tmp1",
"derived");
621 static T tmp2(
"tmp2",
"derived");
622 static T tmp3(
"tmp3",
"derived");
623 static T C[kNumAxes];
624 static T E[kNumAxes];
627 C[kXAxis].InitializeChannel(
"cx",
"derived");
628 C[kYAxis].InitializeChannel(
"cy",
"derived");
629 E[kXAxis].InitializeChannel(
"ex",
"derived");
630 E[kYAxis].InitializeChannel(
"ey",
"derived");
632 C[axis].ClearEventData();
633 E[axis].ClearEventData();
634 for(
size_t i=0;i<fElement.size();i++){
635 zpos = fElement[i]->GetPositionInZ();
636 tmp1.ClearEventData();
637 tmp1.AssignValueFrom(fElement[i]->GetPosition(axis));
638 tmp1.Scale(fWeights[i]);
644 if(ldebug) std::cout<<
"\n A ="<<A[axis]
646 <<
" --C ="<<C[axis].GetValue()
648 <<
" --E ="<<E[axis].GetValue()<<
"\n";
651 fSlope[axis].AssignScaledValue(E[axis], erra[axis]);
652 tmp2.AssignScaledValue(C[axis], covab[axis]);
653 fSlope[axis] += tmp2;
656 fIntercept[axis].AssignScaledValue(C[axis], errb[axis]);
657 tmp2.AssignScaledValue(E[axis], covab[axis]);
658 fIntercept[axis] += tmp2;
660 if(ldebug) std::cout<<
" Least Squares Fit Parameters for "<< axis
661 <<
" are: \n slope = "<< fSlope[axis].GetValue()
662 <<
" \n intercept = " << fIntercept[axis].GetValue()<<
"\n\n";
666 tmp1.ClearEventData();
670 zpos = this->GetPositionInZ();
672 fAbsPos[axis] = fIntercept[axis];
674 tmp1.AssignScaledValue(fSlope[axis],zpos);
675 fAbsPos[axis] += tmp1;
680 tmp3.ClearEventData();
681 fMinimumChiSquare[axis].ClearEventData();
683 for(
size_t i=0;i<fElement.size();i++){
684 tmp1.ClearEventData();
685 tmp2.ClearEventData();
689 tmp1.AssignValueFrom(fElement[i]->GetPosition(axis));
692 tmp2.AssignScaledValue(fSlope[axis],fElement[i]->GetPositionInZ());
693 tmp2+=fIntercept[axis];
698 tmp1.Product(tmp1,tmp1);
700 tmp1.Scale(fWeights[i]*fWeights[i]);
706 fMinimumChiSquare[axis].AssignScaledValue(tmp3,1.0/(fElement.size()-2));
714 return word_position_in_buffer;
724 for(axis = kXAxis; axis < kNumAxes; axis++){
725 fAbsPos[axis].PrintValue();
728 for(axis = kXAxis; axis < kNumAxes; axis++) {
729 fSlope[axis].PrintValue();
730 fIntercept[axis].PrintValue();
731 fMinimumChiSquare[axis].PrintValue();
733 fEffectiveCharge.PrintValue();
745 for(axis = kXAxis; axis < kNumAxes; axis++){
746 fAbsPos[axis].PrintInfo();
749 for(axis = kXAxis; axis < kNumAxes; axis++) {
750 fSlope[axis].PrintInfo();
751 fIntercept[axis].PrintInfo();
752 fMinimumChiSquare[axis].PrintInfo();
754 fEffectiveCharge.PrintInfo();
772 if (this->GetElementName()!=
""){
774 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
775 this->fSlope[axis]=value.
fSlope[axis];
776 this->fIntercept[axis] = value.
fIntercept[axis];
777 this->fAbsPos[axis]=value.
fAbsPos[axis];
797 if (this->GetElementName()!=
""){
799 for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
800 this->fSlope[axis]+=value.
fSlope[axis];
801 this->fIntercept[axis]+=value.
fIntercept[axis];
802 this->fAbsPos[axis]+=value.
fAbsPos[axis];
822 if (this->GetElementName()!=
""){
824 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
825 this->fSlope[axis]-=value.
fSlope[axis];
826 this->fIntercept[axis]-=value.
fIntercept[axis];
827 this->fAbsPos[axis]-=value.
fAbsPos[axis];
851 if (this->GetElementName()!=
""){
853 for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
854 this->fSlope[axis] = numer.
fSlope[axis];
855 this->fIntercept[axis] = numer.
fIntercept[axis];
856 this->fAbsPos[axis] = numer.
fAbsPos[axis];
868 fEffectiveCharge.Scale(factor);
869 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
870 fSlope[axis].Scale(factor);
871 fIntercept[axis].Scale(factor);
872 fAbsPos[axis].Scale(factor);
873 fMinimumChiSquare[axis].Scale(factor);
881 fEffectiveCharge.CalculateRunningAverage();
883 for (Short_t axis = kXAxis; axis < kNumAxes; axis++) {
884 fSlope[axis].CalculateRunningAverage();
885 fIntercept[axis].CalculateRunningAverage();
886 fAbsPos[axis].CalculateRunningAverage();
887 fMinimumChiSquare[axis].CalculateRunningAverage();
901 for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
902 fSlope[axis].AccumulateRunningSum(value.
fSlope[axis]);
903 fIntercept[axis].AccumulateRunningSum(value.
fIntercept[axis]);
904 fAbsPos[axis].AccumulateRunningSum(value.
fAbsPos[axis]);
920 for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
921 fSlope[axis].DeaccumulateRunningSum(value.
fSlope[axis]);
922 fIntercept[axis].DeaccumulateRunningSum(value.
fIntercept[axis]);
923 fAbsPos[axis].DeaccumulateRunningSum(value.
fAbsPos[axis]);
938 if (this->GetElementName()==
""){
943 fEffectiveCharge.ConstructHistograms(folder, prefix);
944 TString thisprefix=prefix;
947 this->SetRootSaveStatus(prefix);
949 for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
950 fSlope[axis].ConstructHistograms(folder, thisprefix);
951 fIntercept[axis].ConstructHistograms(folder, thisprefix);
952 fAbsPos[axis].ConstructHistograms(folder, thisprefix);
953 fMinimumChiSquare[axis].ConstructHistograms(folder, thisprefix);
963 if (this->GetElementName()==
""){
967 fEffectiveCharge.FillHistograms();
968 for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
969 fSlope[axis].FillHistograms();
970 fIntercept[axis].FillHistograms();
971 fAbsPos[axis].FillHistograms();
972 fMinimumChiSquare[axis].FillHistograms();
981 if (this->GetElementName()==
""){
986 TString thisprefix=prefix;
990 this->SetRootSaveStatus(prefix);
992 fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
993 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
994 fSlope[axis].ConstructBranchAndVector(tree,thisprefix,values);
995 fIntercept[axis].ConstructBranchAndVector(tree,thisprefix,values);
996 fAbsPos[axis].ConstructBranchAndVector(tree,thisprefix,values);
997 fMinimumChiSquare[axis].ConstructBranchAndVector(tree,thisprefix,values);
1005 template<
typename T>
1008 if (this->GetElementName()==
""){
1012 TString thisprefix=prefix;
1017 fEffectiveCharge.ConstructBranch(tree,prefix);
1019 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1020 fSlope[axis].ConstructBranch(tree,thisprefix);
1021 fIntercept[axis].ConstructBranch(tree,thisprefix);
1022 fAbsPos[axis].ConstructBranch(tree,thisprefix);
1023 fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
1030 template<
typename T>
1034 devicename=this->GetElementName();
1035 devicename.ToLower();
1037 if (this->GetElementName()==
""){
1041 if (modulelist.
HasValue(devicename)){
1042 TString thisprefix=prefix;
1047 fEffectiveCharge.ConstructBranch(tree,prefix);
1049 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1050 fSlope[axis].ConstructBranch(tree,thisprefix);
1051 fIntercept[axis].ConstructBranch(tree,thisprefix);
1052 fAbsPos[axis].ConstructBranch(tree,thisprefix);
1053 fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
1063 template<
typename T>
1066 if (this->GetElementName()==
""){
1070 fEffectiveCharge.FillTreeVector(values);
1072 for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
1073 fSlope[axis].FillTreeVector(values);
1074 fIntercept[axis].FillTreeVector(values);
1075 fAbsPos[axis].FillTreeVector(values);
1076 fMinimumChiSquare[axis].FillTreeVector(values);
1082 template<
typename T>
1087 for (Short_t axis=kXAxis;axis<kNumAxes;axis++){
1088 fSlope[axis].SetEventCutMode(bcuts);
1089 fIntercept[axis].SetEventCutMode(bcuts);
1090 fAbsPos[axis].SetEventCutMode(bcuts);
1091 fMinimumChiSquare[axis].SetEventCutMode(bcuts);
1093 fEffectiveCharge.SetEventCutMode(bcuts);
1099 template<
typename T>
1102 for (
size_t axis = kXAxis; axis < kNumAxes; axis++) {
1103 T abspos(fAbsPos[axis]);
1104 abspos = fAbsPos[axis];
1105 fBPMComboElementList.push_back(abspos);
1106 T slope(fSlope[axis]);
1107 slope = fSlope[axis];
1108 fBPMComboElementList.push_back(slope);
1109 T intercept(fIntercept[axis]);
1110 intercept = fIntercept[axis];
1111 fBPMComboElementList.push_back(intercept);
1112 T minimumchisquare(fMinimumChiSquare[axis]);
1113 minimumchisquare = fMinimumChiSquare[axis];
1114 fBPMComboElementList.push_back(minimumchisquare);
1116 T effectivecharge(fEffectiveCharge);
1117 effectivecharge = fEffectiveCharge;
1118 fBPMComboElementList.push_back(effectivecharge);
1123 template<
typename T>
1126 std::vector <QwDBInterface> row_list;
1128 for(
size_t axis=kXAxis;axis<kNumAxes;axis++) {
1129 fAbsPos[axis].AddEntriesToList(row_list);
1130 fSlope[axis].AddEntriesToList(row_list);
1131 fIntercept[axis].AddEntriesToList(row_list);
1132 fMinimumChiSquare[axis].AddEntriesToList(row_list);
1134 fEffectiveCharge.AddEntriesToList(row_list);
1140 template<
typename T>
1143 std::vector <QwErrDBInterface> row_list;
1145 for(
size_t axis=kXAxis;axis<kNumAxes;axis++) {
1146 fAbsPos[axis].AddErrEntriesToList(row_list);
1147 fSlope[axis].AddErrEntriesToList(row_list);
1148 fIntercept[axis].AddErrEntriesToList(row_list);
1149 fMinimumChiSquare[axis].AddErrEntriesToList(row_list);
#define QwMessage
Predefined log drain for regular messages.
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void CalculateRunningAverage()
void InitializeChannel(TString name)
void IncrementErrorCounters()
VQwBPM & operator-=(const VQwBPM &value)
void CalculateFixedParameter(std::vector< Double_t > fWeights, Int_t pos)
VQwBPM & operator=(const VQwBPM &value)
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.
Bool_t ApplySingleEventCuts()
void FillTreeVector(std::vector< Double_t > &values) const
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
Double_t SumOver(std::vector< Double_t > weight, std::vector< T > val)
Bool_t HasValue(TString &vname)
void ClearEventData()
Clear the event data in this element.
VQwHardwareChannel * GetSubelementByName(TString ch_name)
void FillHistograms()
Fill the histograms for this data element.
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
void DeaccumulateRunningSum(VQwBPM &value)
void LeastSquareFit(VQwBPM::EBeamPositionMonitorAxis axis, std::vector< Double_t > fWeights)
void Scale(Double_t factor)
void SetBPMForCombo(const VQwBPM *bpm, Double_t charge_weight, Double_t x_weight, Double_t y_weight, Double_t sumqw)
static const double T
Magnetic field: base unit is T.
void InitializeChannel(TString name)
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
static std::ostream & endl(std::ostream &)
End of the line.
virtual const TString & GetElementName() const
Get the name of this element.
void PrintInfo() const
Print multiple lines of information about this data element.
VQwBPM & operator+=(const VQwBPM &value)
std::vector< QwErrDBInterface > GetErrDBEntry()
#define QwWarning
Predefined log drain for warnings.
virtual VQwBPM & operator=(const VQwBPM &value)=0
std::vector< QwDBInterface > GetDBEntry()
void Ratio(QwCombinedBPM &numer, QwCombinedBPM &denom)
void PrintValue() const
Print single line of value and error of this data element.
void ConstructBranch(TTree *tree, TString &prefix)
void AccumulateRunningSum(const VQwBPM &value)
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t indexnumber)
Process the CODA event buffer for this element.