00001 #ifndef LCDG4CalSD_h
00002 #define LCDG4CalSD_h 1
00003
00004 #include "LCDG4CalHit.hh"
00005 #include "G4VSensitiveDetector.hh"
00006 #include "G4LogicalVolume.hh"
00007 #include <map>
00008
00009 class G4Step;
00010 class G4HCofThisEvent;
00011 class G4TouchableHistory;
00012
00013
00014
00015 class LCDG4CalSD : public G4VSensitiveDetector {
00016
00017 public:
00018
00019 LCDG4CalSD(G4String name);
00020
00021 ~LCDG4CalSD();
00022
00023
00024
00025
00026 G4bool ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist);
00027
00028
00029 void Initialize(G4HCofThisEvent* HCE);
00030
00031
00032 void EndOfEvent(G4HCofThisEvent* HCE);
00033
00034
00035
00036 virtual unsigned int findCell(const G4ThreeVector& position) = 0;
00037
00038 virtual G4ThreeVector getCellCenter(unsigned int cellIndex) = 0;
00039
00040 virtual unsigned int getIndex1(unsigned int cellIndex) const = 0;
00041 virtual unsigned int getIndex2(unsigned int cellIndex) const = 0;
00042 virtual unsigned int getIndex3(unsigned int cellIndex) const = 0;
00043
00044
00045 void clear();
00046 void DrawAll();
00047 void PrintAll();
00048
00049 public:
00050 G4int AddLogVolInfo(G4LogicalVolume* g4vxdlog, G4int startlayerNo,
00051 G4int sysNo, G4int be, G4int ns, G4int fsens);
00052
00053
00054 void SetLayerZeroCenterDepth(G4double cd) { layer0CenterDepth = cd; }
00055 void SetLayerThickness(G4double t) { layerThickness = t; }
00056
00057 protected:
00058
00059 G4int HCID;
00060
00061 LCDG4CalHitsCollection* _hitCollection;
00062
00063 std::map<G4LogicalVolume*,G4int> _maplayer;
00064
00065 std::map<G4LogicalVolume*,G4int> _mapsys;
00066
00067 std::map<G4LogicalVolume*,G4int> _mapbe;
00068
00069 std::map<G4LogicalVolume*,G4int> _mapns;
00070
00071 std::map<G4LogicalVolume*,G4int> _mapsens;
00072
00073
00074 std::map<G4int,LCDG4CalHit*> _cellhit;
00075
00076
00077
00078 G4double layer0CenterDepth;
00079 G4double layerThickness;
00080 G4int north, barend;
00081
00082
00083 int debugLevel;
00084
00085
00086
00087
00088
00089 unsigned int index[4];
00090 };
00091
00092 #endif