00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef BesMdcSD_h
00012 #define BesMdcSD_h 1
00013 class TFile;
00014 class TH1F;
00015 class G4Svc;
00016
00017
00018 #include "BesSensitiveDetector.hh"
00019 #include "BesMdcHit.hh"
00020 #include "BesMdcGeoParameter.hh"
00021 #include "BesMdcCalTransfer.hh"
00022 #include "MdcGeomSvc/MdcGeomSvc.h"
00023 #include "CalibDataSvc/CalibDataSvc.h"
00024 #include "DedxCurSvc/DedxCurSvc.h"
00025 #include "GaudiKernel/NTuple.h"
00026 #include "TF1.h"
00027
00028 #include <vector>
00029
00030 class G4Step;
00031 class G4HCofThisEvent;
00032 class BesSensitiveManager;
00033 class G4Svc;
00034
00035 class BesMdcSD : public BesSensitiveDetector
00036 {
00037 public:
00038 BesMdcSD(G4String);
00039 ~BesMdcSD();
00040
00041 void Initialize(G4HCofThisEvent*);
00042 G4bool ProcessHits(G4Step*, G4TouchableHistory*);
00043 void EndOfEvent(G4HCofThisEvent*);
00044
00045 void BeginOfTruthEvent(const G4Event*);
00046 void EndOfTruthEvent(const G4Event*);
00047
00048 G4double Distance(G4int, G4int,G4ThreeVector,G4ThreeVector,G4ThreeVector&,G4double&);
00049
00050 void dedxFuncInti(void);
00051
00052 private:
00053 G4int hitPointer[43][288],truthPointer[43][288];
00054 BesMdcHitsCollection* hitsCollection;
00055 BesMdcHitsCollection* truthCollection;
00056 BesMdcGeoParameter* mdcGeoPointer;
00057 BesMdcCalTransfer* mdcCalPointer;
00058 MdcGeomSvc* mdcGeomSvc;
00059 G4Svc* m_G4Svc;
00060 TF1 *dEdE_mylanfunc;
00061
00063 CalibDataSvc* m_calibDataSvc;
00064 IDedxCurSvc* m_pDedxCurSvc;
00065 TH1F* m_dedx_hists;
00066 G4int m_version;
00067 G4int m_numDedxHists;
00068 G4int m_numBg;
00069 G4int m_numTheta;
00070 std::vector<G4double> m_bgRange;
00071 G4int GetBetagammaIndex(G4double bg);
00072 G4int GetAngleIndex(G4double);
00073 G4int GetChargeIndex(G4int);
00074 G4double GetValDedxCurve(G4double bg, G4double charge);
00075 G4double dedxSample(G4double betagamma, G4double length, G4double theta);
00076
00077
00078 NTuple::Tuple* m_tupleMdc;
00079 NTuple::Item<double> m_betaGamma;
00080 NTuple::Item<double> m_fitval;
00081 NTuple::Item<double> m_random;
00082 NTuple::Item<double> m_dedx;
00083 NTuple::Item<double> m_de;
00084
00085 NTuple::Item<double> m_charge;
00086 NTuple::Item<double> m_costheta;
00088 };
00089
00090 #endif
00091