53 #ifndef StMtdGeometry_HH
54 #define StMtdGeometry_HH
60 #include "TGeoManager.h"
62 #include "TGeoMatrix.h"
63 #include "TGeoShape.h"
64 #include "StThreeVectorD.hh"
66 #include "StPhysicalHelixD.hh"
67 #include "StarMagField.h"
68 #include "StMtdConstants.h"
72 #ifndef ST_NO_NAMESPACES
78 #if !defined(ST_NO_TEMPLATE_DEF_ARGS)
79 typedef vector<Int_t> IntVec;
80 typedef vector<Double_t> DoubleVec;
81 typedef vector<StThreeVectorD > PointVec;
83 typedef vector<Int_t, allocator<Int_t> > IntVec;
84 typedef vector<Double_t, allocator<Double_t> > DoubleVec;
85 typedef vector<StThreeVectorD, allocator<StThreeVectorD>> PointVec;
93 const double muonMass= 0.105658389;
108 void LocalToMaster(
const Double_t* local, Double_t* master);
109 void MasterToLocal(
const Double_t* master, Double_t* local);
113 void SetNExtraCells(Int_t val) { fNExtraCells = val>0?val:0; }
115 Bool_t HelixCross(
const StPhysicalHelixD helix,
const Double_t pathToMagOutR,
const Double_t tofToMagOutR, Double_t &pathL, Double_t &
tof,
StThreeVectorD &cross);
117 Bool_t IsLocalPointIn(
const Double_t x,
const Double_t y,
const Double_t z);
122 TGeoHMatrix *fMatrix;
126 const Double_t *fTransMRS;
127 const Double_t *fRotMRS;
133 inline void StMtdGeoNode::PrintNormal()
135 LOG_INFO<<
"normal x,y,z = "
174 Int_t FindCellId(
const Double_t *local);
175 Float_t GetCellPhiCenter(Int_t iCell);
176 Float_t GetCellZCenter(Int_t iCell);
177 Float_t GetCellLocalYCenter(Int_t iCell, Int_t iBL, Int_t idTruth);
178 Float_t GetCellLocalYCenter(Int_t iCell);
193 static const Double_t mMtdMinR;
194 static const Double_t mMtdMaxR;
195 static const Double_t mMagInR;
196 static const Double_t mMagOutR;
197 static const Double_t mEmcInR;
198 static const Double_t mEmcOutR;
202 const char* title=
"Simplified Mtd Geometry",
203 TGeoManager *manager = 0);
208 void DebugOn() { mDebug = kTRUE; }
209 void DebugOff() { mDebug = kFALSE; }
210 Bool_t IsDebugOn() {
return mDebug; }
212 void SetNExtraCells(Int_t val) {
mNExtraCells = val>0?val:0; }
216 Bool_t ProjToBLModVect(
const StPhysicalHelixD helix, IntVec &blVect, IntVec &modVect);
217 Bool_t HelixCrossCellIds(
const StPhysicalHelixD helix,
const StThreeVectorD vertex, IntVec &idVec, DoubleVec &pathVec, PointVec &crossVec, DoubleVec &tofVec );
218 Bool_t HelixCrossCellIds(
const StPhysicalHelixD helix, IntVec &idVec, DoubleVec &pathVec, PointVec &crossVec, DoubleVec &tofVec );
221 Int_t CalcCellId(Int_t iBL, Int_t iMod, Int_t iCel);
223 Int_t FindBLId(Double_t phi);
224 Int_t FindModId(Double_t z);
225 void SetBFactor(Float_t val){mBFactor=val;}
226 void SetELossFlag(Bool_t val){
mELossFlag=val;}
228 void SetLockBField(Bool_t val);
229 void DecodeCellId(Int_t
id, Int_t &iBL, Int_t &iMod, Int_t &iCell);
231 StThreeVectorD GetField(Double_t x, Double_t y, Double_t z)
const;
233 Double_t GetFieldZ(Double_t x, Double_t y, Double_t z)
const;
243 Int_t mMTTG2BL[gMtdNBacklegs];
244 Int_t mMTRA2Mod[gMtdNBacklegs][gMtdNModules];
253 static const char* modulePref ;
254 TGeoManager *mGeoManager;
256 Bool_t IsMTTG(
const TGeoVolume * vol)
const;
257 Bool_t IsMTRA(
const TGeoVolume * vol)
const {
return !(strcmp(vol->GetName(), modulePref));}
260 void RemoveDuplicate(IntVec &vec);
263 const char *GetCVS()
const
264 {
static const char cvs[]=
"Tag $Name: $ $Id: StMtdGeometry.h,v 1.13 2017/03/08 20:40:38 marr Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
Bool_t mCosmicFlag
Control message printing of this class.
Int_t mNExtraCells
Control mag field to FF.
Bool_t mELossFlag
Cosmic event flag.
Bool_t IsIdValid(Int_t id)
return BL*1000+Module*100+(Cell+50). BL: 1-30, Module: 1-5, Cell: 0-11.
Int_t mNValidBLs
Control matching range in the module.
StMtdGeometry(const char *name="mtdGeo", const char *title="Simplified Mtd Geometry", TGeoManager *manager=0)
EMC system outer radius.
static const char * backlegPref[4]
EMC system outer radius.
Bool_t mLockBField
Control energy loss flag.