00001 #ifndef EEdsmAna_h 00002 #define EEdsmAna_h 00003 /************************************************************** 00004 * $Id: EEdsmAna.h,v 1.6 2009/04/02 14:30:06 pibero Exp $ 00005 **************************************************************/ 00006 #include <TObject.h> 00007 #include <TString.h> 00008 00009 00010 class EEdsm0; 00011 class EEdsm1; 00012 class EEdsm2; 00013 class EEdsm3; 00014 00015 struct DSM; 00016 00017 class TH1F; 00018 class TH2F; 00019 class TFile; 00020 00021 00022 class EEdsmAna { 00023 public: 00024 EEdsmAna(const Char_t *name = 0, int year = 2009); 00025 virtual ~EEdsmAna(); 00026 00027 void usePed(const Char_t *filename = "dsm0inp.ped"); 00028 00029 void initHisto(TObjArray *HList = 0); 00030 void clear(); 00031 void sort(const unsigned char *dsm0inp, 00032 const unsigned short int *dsm1inp, 00033 const unsigned short int *dsm2inp, 00034 const unsigned short int *dsm3inp); 00035 void saveHisto(TFile *f) const; 00036 void resetHisto(); 00037 00038 int getNtot() const {return nTot;} 00039 00040 void printAllEndcap(int k = 0) const; 00041 void printAllBarrel(int k = 0) const; 00042 void printDsm0map() const; 00043 00044 private: 00045 #define EEnJetPatch 6 // numbers of 1x1 Jet patches in EEMC 00046 #define EEnTPinJP 15 // numbers trigger patches in JetPatch 00047 #define EEnHalfJetPatch 12 // numbers .3 and .6 Jet patches 00048 #define EEnHalf 2 // 3x1 3-JP 00049 #define EEnThresh 4 //number of thresholds, below thr0, exceeds th0 th1 and th2 00050 00051 int mJPthr[EEnThresh]; 00052 //2005--: 54--> ped=45+9=>2.2 GeV 00053 00054 const Char_t *myName; 00055 int nTot; 00056 00057 //ENDCAP 00058 int Nee0; // # of Level-0 boards 00059 EEdsm0 * ee0; // Level-0 boards, nine 00060 //BARREL-not implemented 00061 00062 int **ped0; // pedestals for Level-0 inputs 00063 int Nee0out; //# of Level-0 emuated outputs 00064 int *ee0outTPadc; // Level-0 emulated values of TP sums 00065 int *ee0outHTadc; // Level-0 emulated values of HT adc 00066 int mYear; // unpacking changed in 2006 00067 00068 //ENDCAP: 00069 int Nee1; // # of Level-1 boards 00070 EEdsm1 * ee1; // Level-1 boards , two 00071 int *ee1out3JPadc; // Level-1 emulated values of 3x1 JP energy sums 00072 //BARREL-not implemented 00073 00074 int ee1outJPadc[EEnJetPatch]; // Level-1 emulated values of JP energy 00075 int ee1outHT[EEnJetPatch]; // Level-1 emulated values of HT 2bit thresholds 00076 int ee1outTPthrMax [EEnHalf]; // Level-1 emulated max TPthres (2bits) 00077 int ee1outHTTPthrMax[EEnHalf]; // Level-1 emulated max HTTPthres (2bits) 00078 int AdjJPsum[EEnJetPatch]; //Adjacent jet patch sums 00079 00080 enum BrdCnt{Nbe2=3}; 00081 //ENDCAP: 00082 EEdsm2 * ee2; // Level-2 board, just one 00083 int ee2outHT; // Level-2 emulated values of HT 2bit threshold 00084 //BARREL 00085 EEdsm2 *be2; // Level-2 boards 00086 00087 EEdsm3 *ee3; // Trigger DSM input 00088 00089 void readDsm0(const unsigned char *); 00090 void readDsm1(const unsigned short *); 00091 void readDsm2(const unsigned short *); 00092 void readDsm3(const unsigned short *); 00093 void emulDsm0(); 00094 void emulDsm1(); 00095 void emulDsm2(); 00096 void histoDsm0(); 00097 void histoDsm1(); 00098 void histoDsm2(); 00099 void histoDsm3(); 00100 00101 /* 00102 a) Layer-0 DSM input spectra, i.e., 6 pairs of 2D histograms (one per 00103 jet patch) showing ADC value vs. trigger patch # (1-15) for 00104 high tower (64 channels) and for trigger patch sum (256 channels). 00105 These will allow us to see, e.g., sharpness of the summed pedestal, 00106 malfunctioning FEE or DSM channels, sharp turnon of high tower 00107 threshold at the appropriate channel. 00108 */ 00109 00110 TH2F * H0inHT[EEnJetPatch]; // high tower 00111 TH2F * H0inTP[EEnJetPatch]; // trigger patch sum 00112 TH2F * H0inHTall; // high tower, 90 chan 00113 TH2F * H0inTPall; // trigger patch sum, 90 chan 00114 00115 /* 00116 a 2D histogram for each layer 1 DSM input channel 00117 (i.e., 12 2D histos in all) showing layer 1 00118 DSM input (0-3) vs. emulated (from layer 0 DSM 00119 inputs) HT input to that layer 1 DSM channel. 00120 This will allow us to see easily if the transitions 00121 among different DSM output values (0 to 1, 1 to 2, 2 00122 to 3) are occurring at the anticipated thresholds. 00123 We could basically debug all DSM's at a glance with 00124 such histograms. 00125 */ 00126 00127 TH2F *H1inHTvEmu[EEnHalfJetPatch]; // high tower level-1 input vs. emulation 00128 TH2F *H1inTPvEmu[EEnHalfJetPatch]; // TP sum level-1 input vs. emulation 00129 00130 00131 TH2F *H2inHTTP[EEnHalf]; // matrix of HT & HTTP 00132 TH1F *H1inEtot[EEnHalf]; // Etot for each half, input to level2 00133 00134 TH2F *H3inHTTP; 00135 00136 /* 00137 Histos for debugging the jet patch trigger. The first array of 6 are the summed jet 00138 patch ADC spectra emulated from the input to layer 0 DSMs. This should allow us to 00139 evaluate the sharpness of the pedestal and compare the 6 to each other. They should 00140 be similar. The index matches Steve's convention with sector 1 starting around 1 o'clock. 00141 The next triplet of histograms is the frequency that each patch passes th0 00142 th1 and th2. These should be relatively uniform across the 6 jet patches. The following 00143 array of 6 are spectra of adjacent jet patch sums when both pass th0. These should look 00144 somewhat like the individual patch spectra above the threshold. The next array 00145 of 6 are 2D correlations between adjacent patch ADCs when they both exceed th0. The last 00146 is a frequency plot of adjacent patches passing th0. 00147 */ 00148 00149 TH1F *H4jpSums[EEnJetPatch]; // jet patch sums from DSM 0 inputs 00150 TH1F *H4jpFreq[EEnThresh]; // frequency of passing thresholds 00151 TH1F *H4adjpSums[EEnJetPatch]; //adjacent jet patch sums from DSM 0 inputs if both exceed th0 00152 TH2F *H4adjPcor[EEnJetPatch]; //adjacent patch adc correlations 00153 TH1F *H4adjpFreq; // frequency of passing threshold 0 for adjacent jet patches 00154 00155 // added in 2005 to help shift crew assess ETOW preformance 00156 00157 TH2F *H5jpPed; // zoom in on pedestal for 1x1 JP 00158 TH1F *H5jpFreq; // 00159 TH1F *H5jpHot; // 00160 00161 //Total energy histos 00162 enum {mxEtotBit=2}; 00163 TH1F *HEetot[mxEtotBit]; //label: EEMC ETOT BIT 00164 TH1F *HBetot[mxEtotBit]; //label: BEMC ETOT BIT 00165 TH1F *HBEetot[mxEtotBit]; //label: B+EEMC ETOT BIT 00166 00167 // 2009 trigger data 00168 DSM& EE101; 00169 DSM& EE102; 00170 00171 ClassDef(EEdsmAna, 1) 00172 }; 00173 #endif 00174 00175 00176 /* 00177 * $Log: EEdsmAna.h,v $ 00178 * Revision 1.6 2009/04/02 14:30:06 pibero 00179 * Updates to include jet patch plots for Run 9 00180 * 00181 * Revision 1.5 2009/02/25 20:48:42 fisyak 00182 * Add forward declaration of TFile for ROOT >= 5.22 00183 * 00184 * Revision 1.4 2009/02/24 04:07:45 ogrebeny 00185 * Fixed part of the trigger histograms 00186 * 00187 * Revision 1.3 2009/01/23 00:14:50 ogrebeny 00188 * Inherited EEmcDb from StEEmcDbMaker to fix run-time bug http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1378 00189 * 00190 * Revision 1.2 2006/04/05 18:33:02 balewski 00191 * new DSM bits allocation in 2006, possibly lost backward compatibility 00192 * use tagged 2005 version if needed 00193 * 00194 * Revision 1.1 2005/04/28 20:54:46 balewski 00195 * start 00196 * 00197 * Revision 1.4 2004/08/20 20:15:10 balewski 00198 * another printing format for DSM to compare w/ muDst 00199 * 00200 * Revision 1.3 2004/04/19 15:17:11 balewski 00201 * jime's JP code added 00202 * 00203 * new dsm plots for jet patch trigger sowinski 00204 * 00205 * Revision 1.2 2004/03/13 22:03:13 balewski 00206 * new plots from Hal added 00207 * 00208 * Revision 1.1 2004/02/17 03:09:17 balewski 00209 * *** empty log message *** 00210 * 00211 * Revision 1.3 2004/01/18 06:15:59 balewski 00212 * DSM plots a'la Hank added 00213 * 00214 * Revision 1.2 2003/12/30 04:01:10 balewski 00215 * start 00216 * 00217 * Revision 1.1 2003/12/29 02:18:39 balewski 00218 * star 00219 * 00220 * Revision 1.2 2003/05/26 02:10:51 balewski 00221 * added plenty of Histos for DSM analysis 00222 * 00223 * Revision 1.1 2003/05/22 19:39:01 balewski 00224 * analysis of DSM data 00225 * 00226 * 00227 * 00228 processing of EE-DSM 00229 * 00230 **************************************************************/
1.5.9