StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEqaSorter.h
1 // \class EEqaSorter
2 // \author Jan Balewski, Hal Spinka
3 // $Id: EEqaSorter.h,v 1.5 2009/02/24 04:07:45 ogrebeny Exp $
4 
5 #ifndef EEqaSorter_h
6 #define EEqaSorter_h
7 
8 #include <TObject.h>
9 #include <TString.h>
10 
11 class TObjArray;
12 class TH1F;
13 class TFile;
14 
15 class EEqaSorterA;
16 class EEqaSorterC;
17 class EEdsmAna;
18 class StEEmcDb;
19 
20 #include "StEEmcUtil/EEfeeRaw/EEdims.h"
21 class EztEmcRawData;
22 class EztEventHeader;
23 class SpyGeneric;
24 class SpyCopyCat;
25 
26 class EEqaSorter :public TObject{
27 
28  private:
29  enum {mxH=8};
30  TH1F *hCorT[mxH]; // corruption histos ETOW
31  TH1F *H4jpCor; // added in 2005 to help shift crew assess ETOW
32  TH1F *hCorS[mxH]; // corruption histos ESMD
33 
34  EEqaSorterA *sortA;
35  EEqaSorterC *sortC;
36  EEdsmAna *dsm;
37  StEEmcDb *eeDb;
38 
39  TH1F * H1tot;
40  const Char_t *pathInp;
41  const Char_t *pathOut;
42  int timeStamp; // for event
43  void crateHealth(EztEmcRawData *eRaw, TH1F **, int es, int ver) const;
44  void xRayETOW(EztEmcRawData *t, int token) const;
45  void xRayESMD(EztEmcRawData *s, int token, int ver, int runNo) const;
46 
47  // spy tool
48  SpyGeneric **mySpy;
49  SpyCopyCat **mySpyCC;
50  int nSpy, nSpyCC;
51  int minSecSpy; // time delay
52  int nEveSpy; //event sample this time
53  int spyMode; // internal switch
54  int lastSpyRun;
55 
56  public:
57  EEqaSorter(StEEmcDb *dbx = 0);
58  virtual ~EEqaSorter();
59  void setPath(const char *path_in, const char *path_out) {pathInp = path_in; pathOut = path_out;}
60  void initHisto(TObjArray *HList = 0, int nb=150, int mx=600);
61  void initRun();
62  void sort(EztEmcRawData *t, EztEmcRawData *s,
63  int runNo, int token, int ver,
64  const unsigned char * dsm0inp,
65  const unsigned short int * dsm1inp ,
66  const unsigned short int * dsm2inp,
67  const unsigned short int * dsm3inp);
68  void initSpy(const TObjArray *HList, int minSec, int mode); // must be called after histos initialized
69  //mode: 1=balewski@rcf, 2=eemc@evp,3=operator@evp
70  void spy(EztEmcRawData *t, EztEmcRawData *s, int runNo=888999, int eventId=777);
71  void clear();
72  void Finish();
73  void resetHisto();
74  void saveHisto(const Char_t *filename = "out/eemcQA.hist.root") const;
75  void saveHisto(TFile *f) const;
76 
77  ClassDef(EEqaSorter,1)
78 };
79 
80 #endif
81 
82 // $Log: EEqaSorter.h,v $
83 // Revision 1.5 2009/02/24 04:07:45 ogrebeny
84 // Fixed part of the trigger histograms
85 //
86 // Revision 1.4 2009/02/04 20:33:26 ogrebeny
87 // Moved the EEMC database functionality from StEEmcDbMaker to StEEmcUtil/database. See ticket http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1388
88 //
89 // Revision 1.3 2009/01/23 00:14:50 ogrebeny
90 // Inherited EEmcDb from StEEmcDbMaker to fix run-time bug http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1378
91 //
92 // Revision 1.2 2009/01/18 01:01:28 ogrebeny
93 // Better separate EMC histogramming from OnlinePlots infrastructure
94 //
95 // Revision 1.1 2005/04/28 20:54:46 balewski
96 // start
97 //
98 // Revision 1.2 2004/02/26 04:22:23 balewski
99 // more Hal's plots
100 //
101 // Revision 1.1 2004/02/17 03:09:18 balewski
102 // *** empty log message ***
103 //
104 // Revision 1.4 2004/01/29 17:23:14 balewski
105 // fix for BTOW
106 //
107 // Revision 1.3 2004/01/27 16:29:39 balewski
108 // reset added
109 //
110 // Revision 1.7 2004/01/21 18:53:33 spinka
111 // Various problems fixed for towers. More remain.
112 //
113 
114 /* how to merge with Panitkin code
115 1) disable ClassDef(EEqaSorter) in .cxx & .h
116 
117 2) histo I/O
118 
119 histoHandler.cxx:17:#include "EEqaSorter.h"
120 histoHandler.cxx:18:EEqaSorter *eeqaA;
121 
122 increae memeory 3x
123  mfile = TMapFile::Create("hsimple.map","RECREATE", 90000000, ....
124 
125 histoHandler.cxx:293: eeqaA=new EEqaSorter; // creates EEMC related histos
126 
127 line ~350
128  eeqaA->saveHistoAdd();
129 
130 3) sorter
131 eventLoop.cxx:18:#include "EEqaSorter.h"
132 eventLoop.cxx:19:extern EEqaSorter *eeqaA;
133 eventLoop.cxx:1655: eeqaA->sort(evp->token);
134 
135 4) presenter
136 test_3.h test_3.h: static const int MAX_SUBTABS = 11;
137 
138 
139 test_3.cxx:3:#include "EEqaPresenter.h"
140 
141 line ~200
142  TabNames[10][0]="EEMC";
143 
144 line ~290
145 
146  //ETOW and ESMD
147  nSubTabs[10]=4;
148  TabNames[10][1]="Errors";
149  TabNames[10][2]="Towers";
150  TabNames[10][3]="SMD sec 5,6";
151  TabNames[10][4]="SMD sec 7,8";
152  // [9] is last
153 
154 5) add canvas divisions to
155 CanvasDescriptions.txt
156 
157 10,1,2,2,1,cr1
158 10,2,3,2,1,cr1
159 10,3,4,2,1,cr1
160 10,4,8,1,1,cr1
161 
162 */
163 
164