EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicIdealTrackingCode.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicIdealTrackingCode.h
1 // *************************************************************************
2 // Author: Ralf Kliemt ralf.kliemt(at)hiskp(dot)uni-bonn(dot)de
3 //
4 // ideal tracker using MC id & track info
5 // gaussian momentum smearing & fake efficiency included
6 // z-momentum & z-coordinate of vertex is smeared with doubled sigma (just a guess)
7 //
8 // Created: 28.01.2011
9 //
10 // Modified for EicRoot: AYK, 2013
11 //
12 // *************************************************************************
13 
14 #ifndef _EIC_IDEAL_TRACKING_CODE_
15 #define _EIC_IDEAL_TRACKING_CODE_
16 
17 #include "TVector3.h"
18 #include "TDatabasePDG.h"
19 #include "FairTask.h"
20 
21 #include <cmath>
22 #include <map>
23 
24 class EicGeoParData;
26 class SensitiveVolume;
28 
29 #include <EicDetName.h>
30 #include <EicGeoParData.h>
31 #include <EicTrackingDigiHit.h>
32 
33 class EicDetectorGroup: public TObject {
34  // FIXME: do it better later;
35  friend class EicIdealTrackingCode;
36  friend class EicHtcTask;
37  friend class EicRecoKalmanTask;
38  friend class FwdTrackFinder;
39  friend class FwdHoughTree;
40 
41  public:
42  //@@@ EicDetectorGroup();
43  EicDetectorGroup(const char *name = 0): svCounter(0), _fMCPoints(0), _fHits(0),
44  mGptr(0), mDigi(0) { dname = name ? new EicDetName(name) : 0; };
46 
47  // For now this is the only field needed;
49 
51  if (!hit) return 0;
52 
53  // FIXME: may want to simplify (and optimize) this stuff at some point;
56 
57  if (mSensitiveVolumes.find(lNode) == mSensitiveVolumes.end()) return 0;
58 
59  return mSensitiveVolumes.at(lNode);
60  };
61 
62  EicGeoParData *GetGptr() const { return mGptr; };
63 
64  private:
65  TClonesArray* _fMCPoints;
66  TClonesArray* _fHits;
67  Int_t _fBranchID;
68 
69  unsigned svCounter;
72 
73  std::map<LogicalVolumeLookupTableEntry*, SensitiveVolume*> mSensitiveVolumes;
74 
76 };
77 
79  // FIXME: do it better later;
80  friend class EicRecoKalmanTask;
81  friend class EicHtcTask;
82  friend class FwdTrackFinder;
83 
84 public:
85 
87  virtual ~EicIdealTrackingCode();
88 
89  int AddDetectorGroup(const char *name);
90 
91  virtual void Exec(Option_t * option);
92  virtual InitStatus Init();
93  virtual void Finish();
94 
95  void Reset();
96  virtual void Register();
97 
99 
100  void SetMomentumSmearing(Double_t sigmax, Double_t sigmay, Double_t sigmaz)
101  { fMomSigma.SetXYZ(fabs(sigmax),fabs(sigmay),fabs(sigmaz)); fRelative=kFALSE; }; // in GeV
102  void SetRelativeMomentumSmearing(Double_t dpop) { fDPoP=fabs(dpop); fRelative=kTRUE;}; // in GeV
103  void SetVertexSmearing(Double_t sigmax, Double_t sigmay, Double_t sigmaz)
104  { fVtxSigma.SetXYZ(fabs(sigmax),fabs(sigmay),fabs(sigmaz)); }; // in cm
105  void SetTrackingEfficiency(Double_t eff) { fEfficiency=eff; };
106 
107 protected:
108 
109  void SmearFWD(TVector3 &vec, const TVector3 &sigma); // smearing with doubled sigma in z direction
110 
111  TClonesArray* fMCTracks;
112 
113  std::vector<EicDetectorGroup> fGroups;
114 
115  TClonesArray *fTrackCands;
116  TClonesArray *fTracks;
117  TClonesArray *fTrackIds;
118 
119  // Parameters for fake tracking;
120  TVector3 fMomSigma;
121  Double_t fDPoP;
122  Bool_t fRelative;
123  TVector3 fVtxSigma;
124  Double_t fEfficiency;
125 
126  TString fTracksArrayName; // Branch name where to store the Track candidates
127  TDatabasePDG *pdg;
128 
131 
133 };
134 
135 #endif