StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcHitMaker.h
1 #ifndef StTpcHitMaker_H
2 #define StTpcHitMaker_H
3 
4 /***************************************************************************
5  *
6  * $Id: StTpcHitMaker.h,v 1.30 2021/05/10 21:13:19 fisyak Exp $
7  * StTpcHitMaker - class to fill the StEvent with TPC clusters from DAQ reader
8  * $Log: StTpcHitMaker.h,v $
9  * Revision 1.30 2021/05/10 21:13:19 fisyak
10  * Clean up
11  *
12  * Revision 1.28 2018/10/17 20:45:27 fisyak
13  * Restore update for Run XVIII dE/dx calibration removed by Gene on 08/07/2018
14  *
15  * Revision 1.26 2018/06/22 18:35:19 perev
16  * Merging with TPC group code
17  *
18  * Revision 1.19 2014/08/06 11:43:50 jeromel
19  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
20  *
21  * Revision 1.18 2014/06/26 21:31:42 fisyak
22  * New Tpc Alignment, v632
23  *
24  * Revision 1.16 2013/04/07 21:58:36 fisyak
25  * Move selection of sector range from InitRun to Init, add cluster averaging based on TH3
26  *
27  * Revision 1.15 2012/09/13 21:00:04 fisyak
28  * Corrections for iTpx, clean up
29  *
30  * Revision 1.14 2012/05/07 15:51:01 fisyak
31  * Remove hard coded TPC numbers
32  *
33  * Revision 1.13 2011/06/09 20:52:08 genevb
34  * Set sanity flag
35  *
36  * Revision 1.12 2011/03/08 18:20:44 genevb
37  * Limit on number of hits starting at time bin 0
38  *
39  * Revision 1.11 2010/08/30 18:02:02 genevb
40  * Introduce hit maxima for tracking
41  *
42  * Revision 1.10 2010/03/25 15:05:54 fisyak
43  * Add AfterBurner
44  *
45  * Revision 1.9 2010/02/19 23:36:08 fisyak
46  * Add hit Id
47  *
48  * Revision 1.8 2009/03/16 13:41:45 fisyak
49  * Switch to new scheme (avoid legacy) for TPX cluster reading
50  *
51  * Revision 1.7 2009/03/11 18:38:20 fisyak
52  * Add 22 time bins to account subtracted by Tonko, clean up
53  *
54  * Revision 1.6 2008/12/29 23:58:07 fine
55  * Optimize the DAQ data access
56  *
57  * Revision 1.5 2008/12/18 20:20:26 fine
58  * access two different detectors tpx/tpc
59  *
60  * Revision 1.4 2008/12/15 21:04:01 fine
61  * For for the NEW_DAQ_READER
62  *
63  * Revision 1.3 2008/07/31 20:45:27 fisyak
64  * Add TpcMixer
65  *
66  * Revision 1.2 2008/06/23 20:13:53 fisyak
67  * Add real data pixel annotation
68  *
69  * Revision 1.1.1.1 2008/05/27 14:22:41 fisyak
70  * Maker to access TPC DAQ information via EVP_READER
71  *
72  * Revision 1.3 2008/05/27 14:18:18 fisyak
73  * Freeze before moving to STAR repository
74  *
75  * Revision 1.2 2008/04/28 14:37:15 fisyak
76  * Rearrage TpcHitMaker to make it run for parallel taks, add the first version of online clustering
77  *
78  * Revision 1.1.1.1 2008/04/03 20:16:39 fisyak
79  * Initial version
80  *
81  *--------------------------------------------------------------------------
82  *
83  ***************************************************************************/
84 
85 #include "StRTSBaseMaker.h"
86 #include "TString.h"
87 #include "StThreeVectorF.hh"
88 //#define __USE__THnSparse__
89 #include "TH1.h"
90 #include "TH2.h"
91 #ifdef __USE__THnSparse__
92 #include "THnSparse.h"
93 #else /* ! __USE__THnSparse__ */
94 #include "TH3.h"
95 #endif /* __USE__THnSparse__ */
96 class StTpcDigitalSector;
97 class StTpcHit;
98 class tpc_cl;
99 class daq_cld;
100 class tpc_t;
101 class StTpcHitCollection;
103  public:
104  enum EReaderType {kUnknown, kLegacyTpc, kLegacyTpx, kStandardTpx, kStandardiTPC};
105  enum EMode {kUndefined,
106  kTpc, kTpx, kiTPC,
107  kTpcPulser, kTpxPulser, kiTPCPulser,
108  kTpcRaw, kTpxRaw, kiTPCRaw,
109  kTpcAvLaser, kTpxAvLaser, // averaging on pixel level
110  kTpxO,
111  kAll};
112  StTpcHitMaker(const char *name="tpc_hits");
113  virtual ~StTpcHitMaker() {}
114 
115  Int_t Init();
116  Int_t InitRun(Int_t runnumber);
117  Int_t Make();
118  void DoPulser(Int_t sector);
119  void TpxAvLaser(Int_t sector);
120  void TpcAvLaser(Int_t sector);
121  void PadMonitor(Int_t sector);
122  Int_t UpdateHitCollection(Int_t sector);
123  void DumpPixels2Ntuple(Int_t sector, Int_t row, Int_t pad);
124  void PrintSpecial(Int_t sector);
125  Int_t RawTpcData(Int_t sector);
126  Int_t RawTpxData(Int_t sector);
127  void InitializeHistograms(Int_t token);
128  void CheckThrSeq();
129  TH2C *Thr() {return fThr;}
130  TH2C *Seq() {return fSeq;}
131 #ifdef __USE__THnSparse__
132  THnSparseF *CompressTHn(THnSparseF *hist, Double_t compress = 1e4);
133 #endif /* __USE__THnSparse__ */
134  StTpcDigitalSector *GetDigitalSector(Int_t sector);
135  virtual Int_t Finish();
136  Int_t getADC(Int_t i) {if (i < 0 || i > 511) {return 0;} else {return ADCs[i];}}
137  private:
138 
139  EMode kMode;
140  EReaderType kReaderType;
141  TString mQuery;
142  tpc_t *fTpc;
143  Short_t ADCs[512];
144 #ifdef __TFG__VERSION__
145  Int_t IDTs[512];
146 #else
147  UShort_t IDTs[512];
148 #endif
149  UShort_t fId; // current cluster Id
150  Int_t maxHits[24];
151  Int_t maxBin0Hits;
152  Int_t bin0Hits;
153 #ifdef __USE__THnSparse__
154  THnSparseF **fAvLaser;
155 #else /* ! __USE__THnSparse__ */
156  TH3F **fAvLaser;
157 #endif /* __USE__THnSparse__ */
158  TH1F *fSectCounts;
159  Int_t RowNumber();
160  protected:
161  StTpcHit *CreateTpcHit(const tpc_cl &cluster, Int_t sector, Int_t row);
162  StTpcHit *CreateTpcHit(const daq_cld &cluster, Int_t sector, Int_t row);
163 
164  public:
165  static void AfterBurner(StTpcHitCollection *hitCollection);
166  static StTpcHit* StTpcHitFlag(const StThreeVectorF& p,
167  const StThreeVectorF& e,
168  UInt_t hw, float q, UChar_t c,
169  Int_t idTruth, UShort_t quality,
170  UShort_t id,
171  UShort_t mnpad, UShort_t mxpad, UShort_t mntmbk,
172  UShort_t mxtmbk, Float_t cl_x, Float_t cl_t, UShort_t adc,
173  UShort_t flag);
174  static void SetCosmics() {fgCosmics = kTRUE;}
175  static Float_t fgDp; // hardcoded errors
176  static Float_t fgDt;
177  static Float_t fgDperp;
178  static Bool_t fgCosmics;
179  TH2C *fThr;
180  TH2C *fSeq;
181  // cvs
182  virtual const char *GetCVS() const {
183  static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs;
184  }
185  ClassDef(StTpcHitMaker, 1) //StTpcHitMaker - class to fille the StEvewnt from DAQ reader
186 };
187 
188 #endif
virtual Int_t Finish()
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
Definition: daq_tpc.h:22
Definition: daq_tpc.h:11