StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEdsmAna.h
1 #ifndef EEdsmAna_h
2 #define EEdsmAna_h
3 /**************************************************************
4  * $Id: EEdsmAna.h,v 1.6 2009/04/02 14:30:06 pibero Exp $
5  **************************************************************/
6 #include <TObject.h>
7 #include <TString.h>
8 
9 
10 class EEdsm0;
11 class EEdsm1;
12 class EEdsm2;
13 class EEdsm3;
14 
15 struct DSM;
16 
17 class TH1F;
18 class TH2F;
19 class TFile;
20 
21 
22 class EEdsmAna {
23 public:
24  EEdsmAna(const Char_t *name = 0, int year = 2009);
25  virtual ~EEdsmAna();
26 
27  void usePed(const Char_t *filename = "dsm0inp.ped");
28 
29  void initHisto(TObjArray *HList = 0);
30  void clear();
31  void sort(const unsigned char *dsm0inp,
32  const unsigned short int *dsm1inp,
33  const unsigned short int *dsm2inp,
34  const unsigned short int *dsm3inp);
35  void saveHisto(TFile *f) const;
36  void resetHisto();
37 
38  int getNtot() const {return nTot;}
39 
40  void printAllEndcap(int k = 0) const;
41  void printAllBarrel(int k = 0) const;
42  void printDsm0map() const;
43 
44 private:
45 #define EEnJetPatch 6 // numbers of 1x1 Jet patches in EEMC
46 #define EEnTPinJP 15 // numbers trigger patches in JetPatch
47 #define EEnHalfJetPatch 12 // numbers .3 and .6 Jet patches
48 #define EEnHalf 2 // 3x1 3-JP
49 #define EEnThresh 4 //number of thresholds, below thr0, exceeds th0 th1 and th2
50 
51  int mJPthr[EEnThresh];
52  //2005--: 54--> ped=45+9=>2.2 GeV
53 
54  const Char_t *myName;
55  int nTot;
56 
57  //ENDCAP
58  int Nee0; // # of Level-0 boards
59  EEdsm0 * ee0; // Level-0 boards, nine
60  //BARREL-not implemented
61 
62  int **ped0; // pedestals for Level-0 inputs
63  int Nee0out; //# of Level-0 emuated outputs
64  int *ee0outTPadc; // Level-0 emulated values of TP sums
65  int *ee0outHTadc; // Level-0 emulated values of HT adc
66  int mYear; // unpacking changed in 2006
67 
68  //ENDCAP:
69  int Nee1; // # of Level-1 boards
70  EEdsm1 * ee1; // Level-1 boards , two
71  int *ee1out3JPadc; // Level-1 emulated values of 3x1 JP energy sums
72  //BARREL-not implemented
73 
74  int ee1outJPadc[EEnJetPatch]; // Level-1 emulated values of JP energy
75  int ee1outHT[EEnJetPatch]; // Level-1 emulated values of HT 2bit thresholds
76  int ee1outTPthrMax [EEnHalf]; // Level-1 emulated max TPthres (2bits)
77  int ee1outHTTPthrMax[EEnHalf]; // Level-1 emulated max HTTPthres (2bits)
78  int AdjJPsum[EEnJetPatch]; //Adjacent jet patch sums
79 
80  enum BrdCnt{Nbe2=3};
81  //ENDCAP:
82  EEdsm2 * ee2; // Level-2 board, just one
83  int ee2outHT; // Level-2 emulated values of HT 2bit threshold
84  //BARREL
85  EEdsm2 *be2; // Level-2 boards
86 
87  EEdsm3 *ee3; // Trigger DSM input
88 
89  void readDsm0(const unsigned char *);
90  void readDsm1(const unsigned short *);
91  void readDsm2(const unsigned short *);
92  void readDsm3(const unsigned short *);
93  void emulDsm0();
94  void emulDsm1();
95  void emulDsm2();
96  void histoDsm0();
97  void histoDsm1();
98  void histoDsm2();
99  void histoDsm3();
100 
101 /*
102  a) Layer-0 DSM input spectra, i.e., 6 pairs of 2D histograms (one per
103  jet patch) showing ADC value vs. trigger patch # (1-15) for
104  high tower (64 channels) and for trigger patch sum (256 channels).
105  These will allow us to see, e.g., sharpness of the summed pedestal,
106  malfunctioning FEE or DSM channels, sharp turnon of high tower
107  threshold at the appropriate channel.
108 */
109 
110  TH2F * H0inHT[EEnJetPatch]; // high tower
111  TH2F * H0inTP[EEnJetPatch]; // trigger patch sum
112  TH2F * H0inHTall; // high tower, 90 chan
113  TH2F * H0inTPall; // trigger patch sum, 90 chan
114 
115 /*
116  a 2D histogram for each layer 1 DSM input channel
117  (i.e., 12 2D histos in all) showing layer 1
118  DSM input (0-3) vs. emulated (from layer 0 DSM
119  inputs) HT input to that layer 1 DSM channel.
120  This will allow us to see easily if the transitions
121  among different DSM output values (0 to 1, 1 to 2, 2
122  to 3) are occurring at the anticipated thresholds.
123  We could basically debug all DSM's at a glance with
124  such histograms.
125 */
126 
127  TH2F *H1inHTvEmu[EEnHalfJetPatch]; // high tower level-1 input vs. emulation
128  TH2F *H1inTPvEmu[EEnHalfJetPatch]; // TP sum level-1 input vs. emulation
129 
130 
131  TH2F *H2inHTTP[EEnHalf]; // matrix of HT & HTTP
132  TH1F *H1inEtot[EEnHalf]; // Etot for each half, input to level2
133 
134  TH2F *H3inHTTP;
135 
136 /*
137  Histos for debugging the jet patch trigger. The first array of 6 are the summed jet
138  patch ADC spectra emulated from the input to layer 0 DSMs. This should allow us to
139  evaluate the sharpness of the pedestal and compare the 6 to each other. They should
140  be similar. The index matches Steve's convention with sector 1 starting around 1 o'clock.
141  The next triplet of histograms is the frequency that each patch passes th0
142  th1 and th2. These should be relatively uniform across the 6 jet patches. The following
143  array of 6 are spectra of adjacent jet patch sums when both pass th0. These should look
144  somewhat like the individual patch spectra above the threshold. The next array
145  of 6 are 2D correlations between adjacent patch ADCs when they both exceed th0. The last
146  is a frequency plot of adjacent patches passing th0.
147 */
148 
149  TH1F *H4jpSums[EEnJetPatch]; // jet patch sums from DSM 0 inputs
150  TH1F *H4jpFreq[EEnThresh]; // frequency of passing thresholds
151  TH1F *H4adjpSums[EEnJetPatch]; //adjacent jet patch sums from DSM 0 inputs if both exceed th0
152  TH2F *H4adjPcor[EEnJetPatch]; //adjacent patch adc correlations
153  TH1F *H4adjpFreq; // frequency of passing threshold 0 for adjacent jet patches
154 
155  // added in 2005 to help shift crew assess ETOW preformance
156 
157  TH2F *H5jpPed; // zoom in on pedestal for 1x1 JP
158  TH1F *H5jpFreq; //
159  TH1F *H5jpHot; //
160 
161  //Total energy histos
162  enum {mxEtotBit=2};
163  TH1F *HEetot[mxEtotBit]; //label: EEMC ETOT BIT
164  TH1F *HBetot[mxEtotBit]; //label: BEMC ETOT BIT
165  TH1F *HBEetot[mxEtotBit]; //label: B+EEMC ETOT BIT
166 
167  // 2009 trigger data
168  DSM& EE101;
169  DSM& EE102;
170 
171  ClassDef(EEdsmAna, 1)
172 };
173 #endif
174 
175 
176 /*
177  * $Log: EEdsmAna.h,v $
178  * Revision 1.6 2009/04/02 14:30:06 pibero
179  * Updates to include jet patch plots for Run 9
180  *
181  * Revision 1.5 2009/02/25 20:48:42 fisyak
182  * Add forward declaration of TFile for ROOT >= 5.22
183  *
184  * Revision 1.4 2009/02/24 04:07:45 ogrebeny
185  * Fixed part of the trigger histograms
186  *
187  * Revision 1.3 2009/01/23 00:14:50 ogrebeny
188  * Inherited EEmcDb from StEEmcDbMaker to fix run-time bug http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1378
189  *
190  * Revision 1.2 2006/04/05 18:33:02 balewski
191  * new DSM bits allocation in 2006, possibly lost backward compatibility
192  * use tagged 2005 version if needed
193  *
194  * Revision 1.1 2005/04/28 20:54:46 balewski
195  * start
196  *
197  * Revision 1.4 2004/08/20 20:15:10 balewski
198  * another printing format for DSM to compare w/ muDst
199  *
200  * Revision 1.3 2004/04/19 15:17:11 balewski
201  * jime's JP code added
202  *
203  * new dsm plots for jet patch trigger sowinski
204  *
205  * Revision 1.2 2004/03/13 22:03:13 balewski
206  * new plots from Hal added
207  *
208  * Revision 1.1 2004/02/17 03:09:17 balewski
209  * *** empty log message ***
210  *
211  * Revision 1.3 2004/01/18 06:15:59 balewski
212  * DSM plots a'la Hank added
213  *
214  * Revision 1.2 2003/12/30 04:01:10 balewski
215  * start
216  *
217  * Revision 1.1 2003/12/29 02:18:39 balewski
218  * star
219  *
220  * Revision 1.2 2003/05/26 02:10:51 balewski
221  * added plenty of Histos for DSM analysis
222  *
223  * Revision 1.1 2003/05/22 19:39:01 balewski
224  * analysis of DSM data
225  *
226  *
227  *
228  processing of EE-DSM
229  *
230  **************************************************************/
Definition: EEdsm0.h:10
Definition: EEdsm3.h:7
Definition: EEdsm1.h:8
Definition: DSM.hh:16
Definition: EEdsm2.h:7