StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
JanBprsEveA.h
1 #ifndef STAR_JanBprsEveA_H
2 #define STAR_JanBprsEveA_H
3 
4 #include <TGraph.h>
5 
6 #include "JanBarrelConst.h"
7 class BprsCapPolygraph;
8 class JanBprsEveA {
9  friend class BprsCapPolygraph;
10  public:
11  JanBprsEveA(){ } //printf("cstr:JanBprsEve\n"); }
12  void clear() { chi2=chi2dof=eveID=capID=crateID=-999; raw.Set(0); good.Set(0);
13  bestChi2dof=bestCapID=-888; useFix=false;
14  }
15  int getBestCapID() { if(useFix) return bestCapID; else return capID; }
16  void print() {
17  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);
18  if(bestCapID>=0) printf(" better capID=%d chi2dof=%f useFix=%d\n", bestCapID,bestChi2dof, useFix);
19  // raw.Print();
20  }
21  void set(int cap, int crate, int e) { capID=cap; crateID=crate; eveID=e;}
22  void addRawValue(double id, float rawAdc) { raw.SetPoint(raw.GetN(),rawAdc,id);}
23  void addGoodValue(double id, float rawAdc) { good.SetPoint(good.GetN(),rawAdc,id);}
24 
25  private:
26  int capID, crateID,eveID,bestCapID, useFix;
27  float chi2,chi2dof ;// base values for nominal capID
28  float bestChi2dof;
29  TGraph raw; // X=rawADC, y=id; all 1200 ADC
30  TGraph good; // X=rawADC, y=id; only good channels
31 
32 };
33 
34 #endif