StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdFastSimMaker.h
1  /*
2  \class StSsdFastSimMaker
3 
4  \brief Class to simulate Ssd from GEANT.
5 
6  Currently, we read in the SSD hits from the GEANT hit table, smear the hit on the wafer, and fill the SSD Hit Collection with the smeared points.
7  This class conforms to the STAR StMaker standards.
8 */
9 
10 #ifndef STAR_StSsdFastSimMaker
11 #define STAR_StSsdFastSimMaker
12 #ifndef StMaker_H
13 #include "StMaker.h"
14 #endif
15 #include "StThreeVectorF.hh"
16 #include "StThreeVectorD.hh"
17 #include "StSsdUtil/StSsdBarrel.hh"
18 #include "StSsdUtil/StSsdWafer.hh"
19 class StEvent;
20 class StMcEvent;
21 class StRandom;
22 class TH1S;
23 class TH2S;
24 class TH2F;
25 
26 class StSsdBarrel;
27 class St_ssdDimensions;
28 class St_ssdWafersPosition;
29 class slsCtrl_st;
30 class St_slsCtrl;
31 class StSsdBarrel;
32 class St_g2t_ssd_hit;
33 class St_g2t_svt_hit;
34 class St_sls_strip;
35 class ssdConfiguration_st;
36 class StSsdHit;
37 class StSsdHitCollection;
38 class StSsdFastSimMaker : public StMaker {
39  private :
40  StSsdBarrel *mySsd;
41  St_ssdDimensions *m_dimensions;
42  St_ssdWafersPosition *m_positions;
43  ssdConfiguration_st *m_config;
44  St_slsCtrl *m_ctrl;
45  StSsdHit *mHit;
46  public:
47  StSsdFastSimMaker(const char *name="SsdFastSim");
48  /* Please note: The destructor is empty. StEvent will own any hits
49  created by this maker, and is responsible for cleanup.
50  */
51  virtual ~StSsdFastSimMaker();
52  /* \brief This is called every event, and contains all the activity
53  of making StHit objects.
54 
55  Make() creates an StSsdHit object for every MChit, and fills the
56  hit container. Hit container is passed to StEvent.
57  Returns kStOk always.
58  */
59  virtual Int_t Make();
60  /* \brief Read in SSD Hit from Table, smear hit, and fill SSD Hit Collection */
61  virtual Int_t Init();
62  /* \brief Define variables and histograms */
63  virtual Int_t InitRun(int);
64  /* \brief Define Hit Errors and Geometry Parameters */
65  virtual void Clear(Option_t *option="");
66  /* \brief Finish method is not currently used. */
67  virtual Int_t Finish();
68  /* \brief Accept method for reconstructed event. */
69  virtual Bool_t accept(StEvent* event);
70  //Routine to smear hit by resolution with gaussian, mean zero and width res
71  Float_t distortHit(Float_t x, double res);
72  void setSsdParameters(ssdDimensions_st *geom_par);
73  void printSsdParameters();
74  Int_t idWaferToWaferNumb(Int_t idWafer); // idwafer = layer*1000+waf*100+ladder => waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1
75  Int_t idWaferToLadderNumb(Int_t idWafer);// idwafer => ladder-1
76  Int_t waferNumbToIdWafer(Int_t waferNumb);// waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1 => idwafer
77  Int_t idWaferToWafer(Int_t idWafer) {return (idWafer-7000)/100-1;}
78  Int_t IsOnWafer(Float_t x, Float_t y);
79  Int_t RemoveTriangle(Float_t x, Float_t y);
80 
81  private :
82  ssdDimensions_st *mDimensions;
83  Int_t mSsdLayer;
84  Int_t mNLadder;
85  Int_t mNWaferPerLadder;
86  Int_t mNStripPerSide;
87  Int_t mActiveLadders[20];
88  Float_t mDetectorLargeEdge;
89  Float_t mDetectorSmallEdge;
90  Float_t mStripPitch;
91  Float_t mTheta;
92 
93  protected:
94  StRandom* myRandom;
95  double mResXSsd;
96  double mResZSsd;
97  StSsdHitCollection *mCol;
98  StEvent *mEvent;
99  int mSmear; //to turn smearing on and off
100  TH1S *WaferNumb; //id of wafer where there are hits
101  TH2S *HitsMap; //wafer (y_axis :1 to 16) vs ladder (x_axis: 1 to 20)
102  TH1F *dX; //x-x(smeared) in cm
103  TH1F *dY; //y-y(smeared) in cm
104  TH1F *dZ; //z-z(smeared) in cm
105  TH2F *Local;
106  TH1F *Ratio;
107 
108 
109 /* \brief Documentation method. GetCVS can be called from the chain, providing a list
110  of all maker versions in use. */
111  virtual const char *GetCVS() const
112  {
113  static const char cvs[]="Tag $Name: $ $Id: StSsdFastSimMaker.h,v 1.5 2014/08/11 19:27:09 bouchet Exp $ built " __DATE__ " " __TIME__ ;
114  return cvs;
115  }
116  ClassDef(StSsdFastSimMaker,0) //StAF chain virtual base class for Makers
117 };
118 #endif
virtual Int_t Make()
virtual void Clear(Option_t *option="")
User defined functions.
virtual Int_t Finish()
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169