StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcDataDrivenMcMaker.h
1 // -*- mode: C++ -*-
2 //
3 // Hal Spinka <hms@anl.gov>
4 // Argonne National Laboratory
5 //
6 // Pibero Djawotho <pibero@indiana.edu>
7 // Indiana University Cyclotron Facility
8 //
9 // Ilya Selyuzhenkov <ilya.selyuzhenkov@gmail.com>
10 // Indiana University Cyclotron Facility
11 //
12 
13 #ifndef ST_EEMC_DATA_DRIVEN_MC_MAKER_H
14 #define ST_EEMC_DATA_DRIVEN_MC_MAKER_H
15 #include <vector>
16 // ROOT
17 class TClonesArray;
18 class TH2F;
19 class TTree;
20 
21 // STAR
22 class StEEmcDb;
23 class StMuEmcHit;
24 class StEEmcSmdResponse;
25 class StMuEmcUtil;
26 class StMcEvent;
27 class StMcVertex;
28 class StMcTrack;
29 class StMcCalorimeterHit;
33 class StEEmcA2EMaker;
34 
35 // Local
36 class StEEmcShowerShape;
37 
38 // STAR
39 #include "StMaker.h"
40 #include <vector>
42 public:
43  StEEmcDataDrivenMcMaker(const char* name = "StEEmcDataDrivenMcMaker");
45 
46  void Clear(Option_t* option = "");
47  int Init();
48  int InitRun(int runNumber);
49  int Make();
50  int Finish();
51 
52  StEEmcDataDrivenMcEventInfo* GetDataDrivenMcEventInfo();
53  void SetLibraryFile(const char* filename);
54  void SetLogFileName(const char* filename);
55  void SetNumberOfStripsReplaced(int n);
56 
57  void SetShowerShapeScalingMethod(int id);
58  // defaul is method 1
59  // method 1: preserve SMD integrated energy for the replaced strips within +/- mNumberOfStripsReplaced:
60  // method 1: scale = E_smd^geant / E_smd^library
61  // method 2: use photon energies ratio from geant and library records:
62  // method 2: scale = E_gamma^geant / E_gamma^library
63 
64  void UsePed(bool value = true) { mUsePed = value; }
65 
66 private:
67  enum { NUMBER_OF_ENERGY_BINS = 2, NUMBER_OF_PRESHOWER_BINS = 4 };
68 
69  void processVertex(StMcVertex* mcVertex);
70  void processTrack(StMcTrack* mcTrack);
71  bool multiSector(const vector<StMcCalorimeterHit*>& hits) const;
72  int getEnergyBin(StEEmcShowerShape* showerShape) const;
73  int getPreshowerBin(StEEmcShowerShape* showerShape) const;
74  void getEnergies(StMcTrack* mcTrack, StEEmcDataDrivenMcReplaceInfo* replaceInfo);
75  float GetShowerShapeScale(StMcTrack *mcTrack, StEEmcShowerShape* showerShape, int sector, int plane, int geantPhotonCentralStrip);
76 
77  bool mUsePed;
78  float mPed[12][2][288]; // [sector][plane][strip]
79  float mGain[12][2][288]; // [sector][plane][strip]
80  TString mLibraryFile;
81  TString mLogFileName;
82  TFile* mLogFile;
83  StEEmcDb* mEEmcDb;
84  StMuEmcHit* mStrips[12][2][288]; // [sector][plane][strip]
85  StMcEvent* mMcEvent;
86  StMuEmcUtil* mMuEmcUtil;
87 
88  // Each SMD sector follows one of 3 SMD order
89  // S=Spacer, U=U-plane, V=V-plane
90  // Sector 3, 6, 9, 12: SUV (mResponses[0])
91  // Sector 1, 4, 7, 10: VSU (mResponses[1])
92  // Sector 2, 5, 8, 11: UVS (mResponses[2])
93  // See http://www.star.bnl.gov/public/eemc/geom/geom.html
94  // The shower shapes are also binned in energy (E < 8 GeV, E > 8 GeV)
95  // and in preshower energies (preshower1 == 0 && preshower2 == 0, or otherwise).
96  TClonesArray* mShowerShapes[2][4]; // [energy][preshower]
97 
98  // QA tree
99  TTree* mTree;
100  StEEmcDataDrivenMcEventInfo* mDataDrivenMcEventInfo;
101  int mNumberOfStripsReplaced;
102  int mShowerShapeScalingMethod;
103  map<StEEmcShowerShape*, int> mLibraryMap;
104  StEEmcA2EMaker* mA2E;
105 
106  ClassDef(StEEmcDataDrivenMcMaker, 1);
107 };
108 
109 inline StEEmcDataDrivenMcEventInfo* StEEmcDataDrivenMcMaker::GetDataDrivenMcEventInfo()
110 {
111  return mDataDrivenMcEventInfo;
112 }
113 
114 inline void StEEmcDataDrivenMcMaker::SetLibraryFile(const char* filename)
115 {
116  mLibraryFile = filename;
117 }
118 
119 inline void StEEmcDataDrivenMcMaker::SetLogFileName(const char* filename)
120 {
121  mLogFileName = filename;
122 }
123 
124 inline void StEEmcDataDrivenMcMaker::SetNumberOfStripsReplaced(int n)
125 {
126  mNumberOfStripsReplaced = n;
127 }
128 
129 inline void StEEmcDataDrivenMcMaker::SetShowerShapeScalingMethod(int id)
130 {
131  mShowerShapeScalingMethod = id;
132 }
133 
134 #endif // ST_EEMC_DATA_DRIVEN_MC_MAKER_H
EEmc ADC –&gt; energy maker.
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
void Clear(Option_t *option="")
User defined functions.
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169