StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEsmdCal.h
1 // \class EEsmdCal
2 // \author Jan Balewski
3 #ifndef EEsmdCal_h
4 #define EEsmdCal_h
5 /*******************************************************
6  * $Id: EEsmdCal.h,v 1.15 2009/12/03 22:35:03 ogrebeny Exp $
7  *******************************************************
8  * Descripion:
9  * Calibration of SMD/pre/post using MIPs from UxV
10  *******************************************************/
11 
12 class EEmcGeomSimple;
13 class TVector3;
14 class TH1F ;
15 class EEmcDbItem;
16 class EEsmdPlain;
17 class EEmcSmdGeom;
18 class EEmcSmdMap;
19 
21 #include "StEEmcUtil/EEfeeRaw/EEdims.h"
22 #include "TString.h"
24 #ifdef StRootFREE
25  class EEmcDb;
26  typedef EEmcDb EEDB;
27 #else
28  class StEEmcDb;
29  typedef StEEmcDb EEDB;
30 #endif
31 
32 class EEsmdCal {
33  protected:
34  enum {mxTile=4,kT=0, kP=1, kQ=2, kR=3, kU=0, kV=1}; // 0=tower, 1=pres1, 2=pres2, 3=post
35  int thrMipPresAdc; // (ADC) threshold on MIP signal in pre/post
36 
37  private:
38  float thrMipSmdE; //(GeV) threshold on MIP signal in SMD strip
39  float twMipRelEneLow, twMipRelEneHigh; // relative maximal energy deviation for MIP in towers
40 
41  float offCenter;// cut on deviation of UxV from tower center in eta & phi
42 
43  int emptyStripCount; // minimal # of SMD strops below threshold
44  float towerMipE [MaxEtaBins]; // mean EM equiv energy for MIP in towers
45  float presMipE [MaxEtaBins]; // mean Elos energy for MIP in pre/post
46  float smdAvrMipE ; // mean Elos energy for MIP in SMD strip
47  float twTghEta[MaxEtaBins]; // mean tgh(eta) for towers
48 
49  int dbMapped;// flag indicating local DB is mapped
50  const EEmcDbItem *dbT[mxTile][MaxEtaBins][MaxPhiBins]; // local fast access to DB
51  const EEmcDbItem *dbS[MaxSmdPlains][MaxSmdStrips];// local fast access to DB
52 
53  // various utility classes
54  EEmcSmdMap *mapSmd;
55  EEmcGeomSimple *geoTw;
56  EEmcSmdGeom *geoSmd;
57 
58  // cuts: 0=inclusive, 1=tagged with PostShower, 2=Tagged & UxVinTower, etc.
59  enum {kCut='h'-'a'};
60 
61  TH1F *hA[32]; // some global (test) histograms
62  // all histograms are created for only one sector
63 
64  TH1F *hT[kCut][mxTile][MaxEtaBins][MaxPhiBins]; // tower histograms
65  TH1F *hSs[kCut][MaxSmdPlains][MaxSmdStrips]; // individual SMD strips ,inclusive
66 #if 0 //smdMap verification
67  TH1F *hM[12];
68  void scanSpike(float adc1, TH1F *h);
69 #endif
70 
71  void initTileHistoAdc(char cut, const char * title, int col=1);
72  void initTileHistoEne(char cut, const char * title, int col=1);
73  void initSmdHist(char cut, const char * title, int col=1);
74  void initSmdEneHist(char cut, const char * title, int col=1);
75  void initAuxHisto();
76  void mapTileDb();
77  void histoGains();
78  void addTwMipEbarsToHisto (int col, char mxC);
79  void addPresMipEbarsToHisto (int col, char cT);
80  void addSmdMipEbarsToHisto (int col, char cT);
81 
82  void fillSmdHisto_a();
83  void fillOneTailHisto(char cut, int iEta, int iPhi);
84 
85  int getUxVmip();
86 
87  // extension of event storage, also cleared for every eve
88  EEsmdPlain *smdHitPl; // auxil. for MIP search in U/V planes
89 
90  protected:
91  // only this variables can be altered by extrenal classes
92  int nInpEve;
93  int sectID;
94  int iSect;
95  void setSector(int x){sectID=x; iSect=x-1;}
96 
100  float tileAdc[mxTile][MaxEtaBins][MaxPhiBins]; // adc-ped for : T,P,Q,R
101  float tileEne[mxTile][MaxEtaBins][MaxPhiBins]; // adc-ped/gain (if exist)
102  bool tileThr[mxTile][MaxEtaBins][MaxPhiBins]; // == adc-ped>thr
103 
105  float smdAdc[MaxSmdPlains][MaxSmdStrips]; // adc-ped
106  float smdEne[MaxSmdPlains][MaxSmdStrips]; // adc-ped/gain (if exist)
107  bool killT[mxTile][MaxEtaBins][MaxPhiBins]; // mark tiles excluded from ana
108 
109  void clear();
110  void findSectorMip();
111  void calibAllwithMip(int iStrU, int iStrV);
112  EEDB *eeDb;
113  unsigned short killStat; // fatal stat bits
114  float maxStripAdc; // suppress large jump in ped or sticky bits
115 
116  TObjArray *HList;
117 
118  public:
119 
120  EEsmdCal();
121  virtual ~EEsmdCal();
122  void finish(int k=0);
123 
124  void init();
125  void initRun(int runID);// must be called after DB timestamp is known
126  void setSmdCuts(float xs, int n1){ thrMipSmdE=xs; emptyStripCount=n1;}
127  void setPreCuts(int n1){ thrMipPresAdc=n1;}
128  void setTwCuts( float e1, float e2 ,float r){
129  twMipRelEneLow=e1; twMipRelEneHigh=e2; offCenter=r;
130  }
131 
132  void saveHisto(TString fname="fixMe3");
133 
134  ClassDef(EEsmdCal,1)
135 };
136 #endif
137 
138 
139 
140 /*****************************************************************
141  * $Log: EEsmdCal.h,v $
142  * Revision 1.15 2009/12/03 22:35:03 ogrebeny
143  * Fixed compiler warnings, mostly char* -> const char*
144  *
145  * Revision 1.14 2009/02/04 20:33:22 ogrebeny
146  * Moved the EEMC database functionality from StEEmcDbMaker to StEEmcUtil/database. See ticket http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1388
147  *
148  * Revision 1.13 2007/07/12 19:27:19 fisyak
149  * Add includes for TMath for ROOT 5.16
150  *
151  * Revision 1.12 2005/05/04 17:00:32 balewski
152  * tuned for MIP detection in CuCu200
153  *
154  * Revision 1.11 2005/02/05 00:41:37 perev
155  * Remove forward decl of TMath. Conflicts with ROOT
156  *
157  * Revision 1.10 2004/10/08 14:34:39 balewski
158  * as used for PQRUV calib for pp200, 2004
159  *
160  * Revision 1.9 2004/09/22 00:45:50 balewski
161  * ready for calib of smd
162  *
163  * Revision 1.8 2004/09/11 04:57:34 balewski
164  * cleanup
165  *
166  * Revision 1.7 2004/07/27 21:59:46 balewski
167  * now runs on muDst as well
168  *
169  * Revision 1.6 2004/07/10 18:40:54 balewski
170  * use now first and last 8 strips in 00xx00
171  *
172  * Revision 1.5 2004/07/08 01:20:20 balewski
173  * merged with Murad
174  *
175  * Revision 1.4 2004/06/29 16:37:41 balewski
176  * towards SMD calib
177  *
178  * Revision 1.3 2004/06/22 23:31:11 balewski
179  * few more gadgets added
180  *
181  * Revision 1.2 2004/06/15 20:03:26 balewski
182  * to match web-descriptio
183  *
184  * Revision 1.1 2004/06/12 04:09:20 balewski
185  * start
186  *
187  * Revision 1.1 2004/06/06 04:54:10 balewski
188  * dual analyzis
189  *
190  *
191  ********************************************************************/
192 
int iSect
calibrate only one sector
Definition: EEsmdCal.h:94
int sectID
no. of input events
Definition: EEsmdCal.h:93
float smdAdc[MaxSmdPlains][MaxSmdStrips]
30 deg (only for this sector)
Definition: EEsmdCal.h:105
unsigned short killStat
DB access point.
Definition: EEsmdCal.h:113
EEsmdCal()
output histo access point
Definition: EEsmdCal.cxx:31
void setSector(int x)
the same info, counted from 0
Definition: EEsmdCal.h:95
float tileAdc[mxTile][MaxEtaBins][MaxPhiBins]
Definition: EEsmdCal.h:100
EEMC simple geometry.