StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBarrelMonitorMaker.h
1 #ifndef STAR_StBarrelMonitorMaker
2 #define STAR_StBarrelMonitorMaker
3 
4 /************************************************************
5  * $Id: StBarrelMonitorMaker.h,v 1.3 2014/08/06 11:43:06 jeromel Exp $
6  ************************************************************
7  Goal: Unpack & monitor barrel events
8  *
9  ******************************************************/
10 
11 #ifndef StMaker_H
12 #include "StMaker.h"
13 #endif
14 
15 class TObjArray ;
16 class StMuDstMaker;
17 class StEmcDecoder;
18 class TH3F;
19 class TH2F;
20 class TH2D;
21 class TH2I;
22 class TH1I;
23 class BprsCapPolygraph;
24 class BarrelMipCalib;
25 
26 #include "JanBarrelConst.h"
27 #include "JanBarrelEvent.h"
28 #include "JanBprsEveA.h"
29 
30 class StEmcGeom;
31 class StMuDstMaker;
32 class StJanBarrelDbMaker;
33 
34 //------- main class
35 class StBarrelMonitorMaker : public StMaker {
36 
37  private:
38 
39  JanBarrelEvent janEve;
40  JanBprsEveA janBprsEveA[mxBprsCrate]; // to monitor BPRS cpaID corruption
41  BprsCapPolygraph *bprsPolygraph;
42  BarrelMipCalib * mipCalib;
43 
44  int nTrigEve, nAcceptEve,nCorrEve;
45  int trigID; // filter only one trigger if non-zero
46  int nInpEve; // no. of input events
47  int eventID; // recorded by DAQ
48  int mGeantEveInp;
49  StMuDstMaker *mMuDstMaker;
50  StJanBarrelDbMaker *mJanDbMaker;
51 
52  // variable setup
53  int isMC; //0 for real data
54 
55  // interanal params
56  enum {kPassPedSub=0x1, kPassCapFix=0x2};// WARN: bits
57  int par_calibPass; // 0=raw, 1=capPed , 2=capIdfix... stages of calibration
58  int par_bprsHisto; // 1=comCap, 2=128cap
59 
60  char cTile[mxBTile];
61  const char *cTile4[mxBTile];
62 
63  // output histograms
64  TH1 *hTile[mxBTile]; // ADC spectra, one per channel
65  TH1 *hBprsA[mxBprsCrate];
66  TH3F *hBprs3D;// LARGE (softId,adc,capID)
67  TH2D *hTonko0,*hTonko1, *hTonko2;
68 
69  TObjArray *HList;
70 
71  void initHistos();
72  void initHistosTiles(int ibp);
73  void initAuxBprsHistos();
74  TH1F *addBprsEveHisto(int *cap);
75 
76  void unpackStTiles(int ibp); // BTOW=0 or BPRS=1
77 
78  void calibrateTiles(int ibp);
79  void populateBprsEveA();
80  void doTonkosBprsPeds();
81  void test1();
82 
83  StEmcGeom *mBtowGeom, *mBprsGeom, * mSmdEGeom, * mSmdPGeom;
84  StEmcDecoder* mMappB;
85 
86  public:
87  StBarrelMonitorMaker(const char *self="janBarrelMonitor");
88  virtual ~StBarrelMonitorMaker();
89  virtual Int_t Init();
90  virtual Int_t InitRun(int);
91  virtual void Clear(const Option_t* = "");
92  virtual Int_t Finish();
93  virtual Int_t Make();
94  void setHList(TObjArray * x){HList=x;}
95  void saveHisto(TString fname="fixMe3");
96  void uploadJanCalib(char* path);
97  void setTrigIdFilter(int id) {trigID=id;}
98  void setMC(int x){isMC=x;}
99 
100  void setBprsHisto(int i) {par_bprsHisto=i;}
101  void setCalibPass(int i) {par_calibPass=i;}
102 
104  virtual const char *GetCVS() const {
105  static const char cvs[]="Tag $Name: $ $Id: StBarrelMonitorMaker.h,v 1.3 2014/08/06 11:43:06 jeromel Exp $ built " __DATE__ " " __TIME__ ;
106  return cvs;
107  }
108 
109  ClassDef(StBarrelMonitorMaker, 1) //StAF chain virtual base class for Makers
110 };
111 
112 #endif
113 
114 
115 // $Log: StBarrelMonitorMaker.h,v $
116 // Revision 1.3 2014/08/06 11:43:06 jeromel
117 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
118 //
119 // Revision 1.2 2009/08/25 16:08:04 fine
120 // fix the compilation issues under SL5_64_bits gcc 4.3.2
121 //
122 // Revision 1.1 2008/11/24 23:06:36 balewski
123 // start
124 //
125 // Revision 1.3 2005/09/29 13:57:57 balewski
126 // after SMD gains were rescaled
127 //
128 // Revision 1.2 2005/05/04 17:00:32 balewski
129 // tuned for MIP detection in CuCu200
130 //
131 // Revision 1.1 2005/03/11 15:44:25 balewski
132 // works with muEzt, cucu200
133 //
134 //
135 
136 #if 0
137  // full raw event: 360 deg, eta [-1,1]
138  // ...... BSMD .....
139  float smdAdc[mxBSmd][mxBStrips]; // adc-ped
140  float smdEne[mxBSmd][mxBStrips]; // adc-ped/gain (if exist)
141  float smdDE[mxBSmd][mxBStrips] ; // geant dE
142  int smdUsed[mxBSmd][mxBStrips] ; // tags used hits
143  unsigned int smdKill[mxBSmd][mxBStrips]; // mark strips excluded from ana
144 
145  // ...... BTOW .....
146  float btowAdc[mxBTail][mxBtow]; // adc-ped
147  float btowEne[mxBTail][mxBtow]; // adc-ped/gain (if exist)
148  unsigned int btowKill[mxBTail][mxBtow]; // mark strips excluded from ana
149  float btowDE[mxBTail][mxBtow] ; // geant dE
150 #endif
151 
152 
153 #if 0
154  // private Jan's gain correction, maping , status tables
155  bool jhOK;
156  TH1F *jhGCorr[mxBSmd]; // gain corr vs. ID, full barrel
157  TH1I *jhStat[mxBSmd]; // status table vs. ID, full barrel
158  TH2I *jhMap2id[mxBSmd];// mapping iEta-iPhi--> ID, full barrel
159  TH1I *jhMapid2[mxBSmd];//mapping ID --> iEta-iPhi, full barrel
160  TH1F *jhS2Tmap[mxBSmd]; // mapping strip ID --> tower ID + center distance, full barrel
161  TH1F *jhSped[mxBSmd]; // strip pedestals
162  float calibC0data, *calibC1;// BSMD
163  enum {mxTw20=20};
164  float calibTdata[mxTw20];// towers
165 #endif
166 
167 #if 0 // iso-gamma params
168  int par_strWinLen; //length of strip window for cluster search
169  float par_strEneThr; // GeV, energy threshold for strip
170  float par_cluEneThr; // GeV, energy threshold for cluster
171  float par_isoMinT3x3adc;
172  float par_isoMaxT3x3adc;
173  float par_isoTowerEneR;
174  float par_isoRms;
175  int par_isoStripMargin;
176  float par_kSigPed; // thres=ped+kSig*sigPed
177 
178  enum{ mxhS=16, mxhC=256};
179  TH1 *hS[mxBSmd][mxhS]; // specific SMD-plane histos
180  char cPlane[mxBSmd];
181  TH1 *hC[mxhC]; // isolated clusters
182  TH1 *hStrip[mxCutH][mxBSmd]; // raw spectra
183  TH2F *hX;
184 
185  void initHistosSMD(int iep,int modID);
186  void initHistosIsoSmdCluster();
187  void initHistosStrips(int iep,int iCut);
188 
189  void scanSmdEtaModule(int modID); // one physical module
190  void scanSmdPhiBand(int iEtaBin_bsmdP); // slice from 60 modules
191  bool scanStrips(char plane, int mxStr, float *eneA, int *usedA, unsigned int *killA, int *idA, BsmdCluster1D &cluster);// working horse for 1D cluster finder
192  void pickIsoSmdCluster();
193  float sum3x3towerADC(int towID,int size);
194  void sete3x3TwoAdc(float x, float y) {par_isoMinT3x3adc=x; par_isoMaxT3x3adc=y;}
195 #endif
virtual const char * GetCVS() const
Displayed on session exit, leave it as-is please ...