00001 #ifndef STAR_JanBprsEveA_H
00002 #define STAR_JanBprsEveA_H
00003
00004 #include <TGraph.h>
00005
00006 #include "JanBarrelConst.h"
00007 class BprsCapPolygraph;
00008 class JanBprsEveA {
00009 friend class BprsCapPolygraph;
00010 public:
00011 JanBprsEveA(){ }
00012 void clear() { chi2=chi2dof=eveID=capID=crateID=-999; raw.Set(0); good.Set(0);
00013 bestChi2dof=bestCapID=-888; useFix=false;
00014 }
00015 int getBestCapID() { if(useFix) return bestCapID; else return capID; }
00016 void print() {
00017 printf("BPRS: eveID=%d capID=%d carteID=%d nRaw=%d nGood=%d chi2=%f chi2dof=%f\n",eveID,capID,crateID,raw.GetN(),good.GetN(),chi2,chi2dof);
00018 if(bestCapID>=0) printf(" better capID=%d chi2dof=%f useFix=%d\n", bestCapID,bestChi2dof, useFix);
00019
00020 }
00021 void set(int cap, int crate, int e) { capID=cap; crateID=crate; eveID=e;}
00022 void addRawValue(double id, float rawAdc) { raw.SetPoint(raw.GetN(),rawAdc,id);}
00023 void addGoodValue(double id, float rawAdc) { good.SetPoint(good.GetN(),rawAdc,id);}
00024
00025 private:
00026 int capID, crateID,eveID,bestCapID, useFix;
00027 float chi2,chi2dof ;
00028 float bestChi2dof;
00029 TGraph raw;
00030 TGraph good;
00031
00032 };
00033
00034 #endif