StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPmdReadMaker.h
1 /***************************************************************************
2  *$Id: StPmdReadMaker.h,v 1.8 2014/08/06 11:43:33 jeromel Exp $
3  *
4  * StPmdReadMaker
5  *
6  * Author: Supriya Das and Subhasis Chattopadhyay
7  ***************************************************************************
8  *
9  * Description: Pmd Data Reader to store hits in StEvent
10  ***************************************************************************
11  * $Log: StPmdReadMaker.h,v $
12  * Revision 1.8 2014/08/06 11:43:33 jeromel
13  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
14  *
15  * Revision 1.7 2010/04/16 12:04:24 rashmi
16  * Modifcation for new DAQ
17  *
18  * Revision 1.6 2007/08/31 10:50:39 rashmi
19  * Added routines to read badchains,HotCells,Cell_GNF,SMChain_GNF
20  *
21  * Revision 1.5 2004/07/12 14:45:16 subhasis
22  * QA hist added
23  *
24  * Revision 1.4 2004/03/23 08:52:03 subhasis
25  * several changes (Board Detail by hand etc) for first production
26  *
27  * Revision 1.3 2004/03/11 11:29:41 subhasis
28  * Changes made for PMD run config
29  *
30  * Revision 1.2 2003/12/03 11:52:38 subhasis
31  * Comment header changed by Supriya
32  *
33  ***************************************************************************/
34 #ifdef __ROOT__
35 #ifndef STAR_StPmdReadMaker
36 #define STAR_StPmdReadMaker
37 
38 //include <StRoot/RTS/src/DAQ_READER/daq_det.h>
39 #include "StRTSBaseMaker.h"
40 // DAQ Libraries
41 //#include "StDaqLib/PMD/PMD_Reader.hh"
42 //#ifndef NEW_DAQ_READER
43 // class evpReader;
44 //#else
45 struct pmd_t;
46 //#endif /* ! NEW_DAQ_READER */
47 class StPhmdCollection;
48 class StPhmdHit;
49 class StPhmdDetector;
50 class StPmdCollection;
51 class StPmdHit;
52 class StPmdDetector;
53 
54 #ifndef __CINT__
55 #include <vector>
56 #ifndef ST_NO_NAMESPACES
57 using std::vector;
58 #endif
59 #endif
60 
61 #include "StPmdUtil/StPmdGeom.h"
62 #include "StPmdUtil/StPmdDBUtil.h"
63 #include "tables/St_pmdBrdMipCalib_Table.h"
64 #include "tables/St_pmdCalSummary_Table.h"
65 #include "tables/St_pmdSMCalib_Table.h"
66 #include "tables/St_pmdSMChain_GNF_Table.h"
67 
68 #include <TH1.h>
69 #include <TH2.h>
70 
71 #include "tables/St_pmdHotCells_Table.h"
72 class StDAQReader;
73 class StPMDReader;
74 //SP
75 class EventReader;
76 class StPmdGeom;
77 class StPmdDBUtil;
78 
79 class StPmdReadMaker : public StRTSBaseMaker {
80 
81 
82  public:
83  StPmdReadMaker(const char *name="pmdReader"); // Constructor
84  virtual ~StPmdReadMaker(); //Destructor
85  virtual Int_t Init(); //Initialization
86  virtual Int_t InitRun(Int_t runnr); // Init for every run to read DB
87  virtual Int_t Make(); // Make
88  Int_t fillStEvent(StPmdDetector*, StPmdDetector*); // Fills StEvent
89  virtual Int_t Finish(); // Finish
90  void SetPmdPrint(Bool_t); //Set print flag
91  void SetCalibFlag(Bool_t); //Set calib flag
92  void SetChainThreshold(Float_t); //Set ADC Threshold
93  void bookHist();
94  Int_t GetCalib(int,int,int,float&);
95  virtual const char *GetCVS() const {
96  static const char cvs[]="Tag $Name: $ $Id: StPmdReadMaker.h,v 1.8 2014/08/06 11:43:33 jeromel Exp $ built " __DATE__ " " __TIME__ ;
97  return cvs;
98  }
99 
100  protected:
101  // virtual StRtsTable *GetNextRaw(int sector);
102  // virtual StRtsTable * GetNextLegacy(int sector);
103  TH1F * m_event_tothit_pmd;
104  TH1F * m_event_tothit_cpv;
105  TH2F* m_chain_channel;
106 
107  TH1D *chain_mean[49];
108  TH1D *chain_rms[49];
109  TH1D *chain_adc[49];
110  TH2F * pmdhit_tof;
111  TH2F * pmdadc_tof;
112 
113  private:
114  StDAQReader* mTheDataReader;
115  StPMDReader* mThePmdReader;
116  St_DataSet* mThePmdData;
117 
118  // These give the hot channels
119  St_pmdHotCells* mHotCells;
120  Bool_t IsHot(Int_t chain, Int_t channel);
121  Bool_t Accept(Int_t chain, Int_t channel);
122 
123  Int_t mRunNumber;
124  Int_t mVmeCond;
125  //
126  StPhmdCollection * mEvtPmdCollection;
127  StPhmdDetector* mPmdEvent;
128  StPhmdDetector* mCpvEvent;
129  StPmdCollection * mPmdCollection;
130  TDataSet *mDb;
131  Bool_t mPmdPrint;
132  Bool_t mCalibFlag;
133  Float_t mChainTh;
134  StPmdGeom* mPmdGeom;
135  StPmdDBUtil* mPmdDBUtil;
136  Int_t mHotTracks;
137 
138  //calib arrays
139  pmdSMCalib_st* m_PmdCalibConst;
140 
141  Int_t ApplyMapping(int*);// Reads raw data from DAQReader and applies mapping
142  Bool_t ReadCalibrationsConst(); // Reads calibration constant from DB
143  void ReadBadChains(int);//Read Bad Chain information from StPmdCleanConstants
144 
145  ClassDef(StPmdReadMaker, 1)
146  };
147 inline void StPmdReadMaker::SetPmdPrint(Bool_t var) {mPmdPrint = var;}
148 inline void StPmdReadMaker::SetCalibFlag(Bool_t var) {mCalibFlag = var;}
149 inline void StPmdReadMaker::SetChainThreshold(Float_t var) {mChainTh = var;}
150 #endif
151 #endif
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
Definition: daq_pmd.h:7
virtual Int_t Finish()
Definition: StMaker.cxx:776
virtual Int_t Make()=0