00001
00002
00003
00004
00005
00006
00007 #ifndef BesMucNoise_h
00008 #define BesMucNoise_h 1
00009
00010 #include "GaudiKernel/IMessageSvc.h"
00011 #include "GaudiKernel/MsgStream.h"
00012
00013 #include "BesMucHit.hh"
00014 #include "G4Step.hh"
00015 #include "G4Event.hh"
00016 #include "G4LogicalVolume.hh"
00017
00018 #include "TMath.h"
00019
00020 #include "MucCalibAlg/MucStructConst.h"
00021 #include "MucCalibAlg/MucIdTransform.h"
00022 #include "MucCalibAlg/MucMark.h"
00023 #include "MucCalibConstSvc/IMucCalibConstSvc.h"
00024 #include "MucCalibConstSvc/MucCalibConstSvc.h"
00025
00026
00027 using namespace std;
00028
00029 class BesMucNoise
00030 {
00031 public:
00032 BesMucNoise();
00033 ~BesMucNoise();
00034
00035 static BesMucNoise* Instance(void);
00036 void Initialize(G4String filename,G4LogicalVolume* logicalMuc);
00037 void Initialize(G4String filename,G4LogicalVolume* logicalMuc,G4String temp);
00038
00039 void CheckCalibSvc();
00040 G4int AddNoise( int model, BesMucHitsCollection* MucHitCollection,BesMucHitsCollection* MucHitList);
00041 G4int NoiseByCnt(BesMucHitsCollection* MucHitCollection,BesMucHitsCollection* MucHitList);
00042 G4int NoiseByNosRatio(BesMucHitsCollection* MucHitCollection,BesMucHitsCollection* MucHitList);
00043 G4int NoiseSampling(int level, int prt, int seg, int lay, int strip);
00044 G4int GetStripNo(G4int,G4int,G4int);
00045 G4int IsNearestStrip(G4int,G4int,G4int,G4int,G4float);
00046 bool IsExist(BesMucHit* aNoiseHit, BesMucHitsCollection* aMucHitList);
00047 G4float Factorial(G4int i);
00048 void InitProb();
00049
00050 private:
00051
00052 static const int m_kPart =3;
00053 static const int m_kSegment[m_kPart] ;
00054 static const int m_kAbsorber[m_kPart] ;
00055 static const int m_kGap[m_kPart] ;
00056 static const int m_kPanel[m_kPart] ;
00057 static const int m_kGasChamber =2;
00058
00059 G4double m_noise[3][8][9];
00060 G4double m_noise_strip[3][8][9][112];
00061 G4float area[3][8][9][112];
00062 G4float strip_area[3][8][9][112];
00063 G4float box_area[3][8][9];
00064 double m_HitMean;
00065 double m_Prob[20][2];
00066 static BesMucNoise * fPointer;
00067
00068 int m_noiseLevel;
00069 IMucCalibConstSvc* m_ptrCalibSvc;
00070 MucIdTransform* m_ptrIdTr;
00071
00072 };
00073 #endif