StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBemcBeamBckgFinderMaker.h
1 /*********************************************************************
2  * $Id: StBemcBeamBckgFinderMaker.h,v 1.9 2014/08/06 11:43:05 jeromel Exp $
3  * \author Issam Qattan , IUCF, 2006
4  *********************************************************************
5  * Description:
6  * Pattern recognition of the Barrel Beam Background on an event-by-event basis.
7  *********************************************************************
8  */
9 
10 #ifndef STAR_St_StBemcBeamBckgFinderMaker_h
11 #define STAR_St_StBemcBeamBckgFinderMaker_h
12 
13 
14 #ifndef StMaker_H
15 #include "StMaker.h"
16 #endif
17 
18 class TH2F;
19 class TCanvas;
20 class TStyle;
21 class StEmcGeom;
22 class TObjArray;
23 class StEmcDecoder;
24 
26 
27  private:
28  // Private methods declaration if any:
29 
30  StEmcGeom *mGeomB;
31  StEmcDecoder *mMappB;
32  TObjArray *mHList;
33 
34  enum{mMaxH=8};
35  enum{mMaxevtH=3};
36  TH1F *mhisto[mMaxH];
37  TH2F *mevtH[mMaxevtH];
38 
39  enum{mxSoftId = 4800};
40  enum{mxEta=40, mxPhi=120};
41  enum{xmlocate = 10};
42 
43 
44  Int_t GetNewStatus(int id, int rdo, int run);
45  void FillAdc(float iadc,int ieta,int iphi,int isoft);
46  Int_t CheckPatternType3(int &etaBegin, int &phiBegin, int &etaEnd, int &patternLength, float &sumAdc, float &AverageWeightedEta);
47  void PlotOneEvent();
48 
49  float mdb_btowPed[mxSoftId]; //array of pedestals
50  int mdb_btowStat[mxSoftId]; //array of towers status (1 or 0 in values)
51 
52  int mdb_btowetaBin[mxSoftId]; //array of towers eta bins
53  int mdb_btowphiBin[mxSoftId]; //array of towers phi bins
54 
55  int mdb_btowRdo[mxSoftId]; //array of towers rdos
56  int mdb_btowSoftId[mxSoftId]; //array of towers softIds
57 
58  float mAdcArray[mxPhi][mxEta]; //array of adc values passing adc threshold
59  int mSoftId[mxPhi][mxEta]; //array of towers softIDs for a given eta and phi
60 
61  int mInpEve; //input events counter
62  int mAccEve; //accepted events counter
63  int mTrigId; //Trigger Id
64  int mRunNumber; //run number
65  int mDecision; //Decision whether a background==1 or not ==0.
66  char mLocation[xmlocate]; //location of background (east, central, west) based on eta range.
67  int metaBegin; //value of beginning eta bin in the background pattern
68  int metaEnd; //value of ending eta bin in the background pattern
69  int mphiBegin; //value of beginning phi bin in the background pattern
70  int mpatternLength; //background pattern length
71  float msumAdc; //background pattern adc sum
72  float mAvgEtaAdc; //average weighted eta = SUM(eta_i*adc_i)/SUM(adc_i) for the background pattern
73  int mPattSoftId[mxSoftId]; //list of soft ID's of towers from identified pattern
74 
75  int mAdcThreshold; //value used to set adc threshold
76  float mAdcSumThreshold; //value used to set adc sum threshold
77  int mpattern; //value used to set pattern length needed
78  int mMaxYesPlots; //value of Maximum number of postscript files to produce (file/event) when event is background.
79  int mMaxNoPlots; //value of Maximum number of postscript files to produce (file/event) when event is not background.
80  bool mSearchDone;
81 
82  public:
83  // Public methods if any:
84 
85  void SetHList(TObjArray *x){mHList = x;}
86 
87  StBemcBeamBckgFinderMaker(const char *name="BemcBckgFinder");
89  Int_t Init();
90  Int_t Make();
91  Int_t InitRun (int runumber);
92  void Clear(const Option_t* = "");
93  Int_t Finish();
94  void SetTrigger(int x) {mTrigId=x;}
95 
96  void SetAdcThreshold(int setadc) {mAdcThreshold=setadc;}
97  void SetAdcSumThreshold(float setadcsum) {mAdcSumThreshold=setadcsum;}
98  void SetPatternLength(int setpattern) {mpattern=setpattern;}
99  void SetMaxYesPlots(int setyesplots) {mMaxYesPlots=setyesplots;}
100  void SetMaxNoPlots(int setnoplots) {mMaxNoPlots=setnoplots;}
101  void GetDecision(int &fDecision,int &eta1, int &phi1, int &eta2, int &patternleng, float &Adcsum);
102  const int *GetSoftIdList(){return mPattSoftId;} // 0 is the terminator
103 
104  /* Note fDecision = 1 when trigger is of type set and background found.
105  * fDecision = 0 when trigger is of type set and no background found.
106  * fDecision = -1 when trigger is not of type set (not executed).
107  */
108 
109  // virtual Int_t FinishRun(int runumber){return 0;}; // Overload empty StMaker::FinishRun
110 
111  // Displayed on session exit, leave it as-is please ...
112  virtual const char *GetCVS() const {
113  static const char cvs[]="Tag $Name: $ $Id: StBemcBeamBckgFinderMaker.h,v 1.9 2014/08/06 11:43:05 jeromel Exp $ built " __DATE__ " " __TIME__ ;
114  return cvs;
115  }
116 
117  ClassDef(StBemcBeamBckgFinderMaker,0) //StAF chain virtual base class for Makers
118 };
119 
120 #endif
121 
122 /**********************************************************************
123  $Log: StBemcBeamBckgFinderMaker.h,v $
124  Revision 1.9 2014/08/06 11:43:05 jeromel
125  Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
126 
127  Revision 1.8 2006/06/27 15:41:30 qattan
128  *** empty log message ***
129 
130  Revision 1.7 2006/06/13 22:01:36 qattan
131  *** empty log message ***
132 
133  Revision 1.5 2006/06/13 21:42:42 qattan
134  *** empty log message ***
135 
136  Revision 1.4 2006/06/13 21:26:25 qattan
137  *** empty log message ***
138 
139  Revision 1.3 2006/05/30 22:38:23 qattan
140  check4
141 
142  Revision 1.2 2006/05/30 22:21:41 qattan
143  *** empty log message ***
144 
145  Revision 1.1 2006/05/30 20:08:03 qattan
146  start1
147 
148 
149 */
150