Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GammaRayTelTrackerSD Class Reference

#include <GammaRayTelTrackerSD.hh>

Inheritance diagram for GammaRayTelTrackerSD:
Collaboration diagram for GammaRayTelTrackerSD:

Public Member Functions

 GammaRayTelTrackerSD (G4String)
 
 ~GammaRayTelTrackerSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *astep, G4TouchableHistory *ROHist)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Definition at line 51 of file GammaRayTelTrackerSD.hh.

Constructor & Destructor Documentation

GammaRayTelTrackerSD::GammaRayTelTrackerSD ( G4String  name)

Definition at line 54 of file GammaRayTelTrackerSD.cc.

55 {
57  Detector =
59 
60  G4int NbOfTKRTiles = Detector->GetNbOfTKRTiles();
61  NbOfTKRStrips = Detector->GetNbOfTKRStrips();
62  NbOfTKRLayers = Detector->GetNbOfTKRLayers();
63  NbOfTKRStrips = NbOfTKRStrips*NbOfTKRTiles;
64 
65  NbOfTKRChannels = NbOfTKRStrips* NbOfTKRTiles * NbOfTKRLayers;
66 
67  ThitXID = new G4int[NbOfTKRChannels];
68  ThitYID = new G4int[NbOfTKRChannels];
69  collectionName.insert("TrackerCollection");
70 }
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
int G4int
Definition: G4Types.hh:78
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

GammaRayTelTrackerSD::~GammaRayTelTrackerSD ( )

Definition at line 74 of file GammaRayTelTrackerSD.cc.

75 {
76  delete [] ThitXID;
77  delete [] ThitYID;
78 }

Member Function Documentation

void GammaRayTelTrackerSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 216 of file GammaRayTelTrackerSD.cc.

217 {}
void GammaRayTelTrackerSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 221 of file GammaRayTelTrackerSD.cc.

222 {}
void GammaRayTelTrackerSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 197 of file GammaRayTelTrackerSD.cc.

198 {
199  static G4int HCID = -1;
200  if(HCID<0)
201  {
203  }
204  HCE->AddHitsCollection(HCID,TrackerCollection);
205 
206 
207  for (G4int i=0;i<NbOfTKRChannels;i++)
208  {
209  ThitXID[i] = -1;
210  ThitYID[i] = -1;
211  };
212 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName

Here is the call graph for this function:

void GammaRayTelTrackerSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 82 of file GammaRayTelTrackerSD.cc.

83 {
84  TrackerCollection = new GammaRayTelTrackerHitsCollection
86 
87  for (G4int i=0;i<NbOfTKRChannels;i++)
88  {
89  ThitXID[i] = -1;
90  ThitYID[i] = -1;
91  };
92 }
int G4int
Definition: G4Types.hh:78
G4THitsCollection< GammaRayTelTrackerHit > GammaRayTelTrackerHitsCollection
G4CollectionNameVector collectionName
void GammaRayTelTrackerSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 226 of file GammaRayTelTrackerSD.cc.

227 {}
G4bool GammaRayTelTrackerSD::ProcessHits ( G4Step astep,
G4TouchableHistory ROHist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 96 of file GammaRayTelTrackerSD.cc.

97 {
98 
99  G4double edep = aStep->GetTotalEnergyDeposit();
100  if ((edep/keV == 0.)) return false;
101 
102  G4int StripTotal = Detector->GetNbOfTKRStrips();
103  G4int TileTotal = Detector->GetNbOfTKRTiles();
104 
105  // This TouchableHistory is used to obtain the physical volume
106  // of the hit
107  G4TouchableHistory* theTouchable
108  = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
109 
110  //G4VPhysicalVolume* phys_tile = theTouchable->GetVolume();
111 
112  G4VPhysicalVolume* plane = theTouchable->GetVolume(2);
113 
114  G4int PlaneNumber = 0;
115  PlaneNumber=plane->GetCopyNo();
116  G4String PlaneName = plane->GetName();
117 
118  // The hits sees now the real strip
119 
120  G4int StripNumber = 0;
121  G4VPhysicalVolume* strip = 0;
122  strip = theTouchable->GetVolume();
123 
124  G4String StripName = strip->GetName();
125  StripNumber= strip->GetCopyNo();
126 
127  G4VPhysicalVolume* tile = theTouchable->GetVolume(1);
128  G4int TileNumber = tile->GetCopyNo();
129  G4String TileName = tile->GetName();
130 
131  G4int NTile = (TileNumber%TileTotal);
132  G4int j=0;
133 
134  G4int NChannel = 0;
135 
136  for (j=0;j<TileTotal;j++)
137  {
138  if(NTile==j) StripNumber += StripTotal*NTile;
139  }
140 
141  NChannel = PlaneNumber*TileTotal*StripTotal + StripNumber;
142 
143  /* G4cout << NChannel << " Channel Number" << G4endl;
144  G4cout << " Plane Number = " << PlaneNumber << " " << PlaneName
145  << G4endl;
146  G4cout << StripName << " " << StripNumber << G4endl; */
147 
148  if (PlaneName == "TKRDetectorX" )
149  // The hit is on an X silicon plane
150  {
151  // This is a new hit
152  if (ThitXID[NChannel]==-1)
153  {
155  TrackerHit->SetPlaneType(1);
156  TrackerHit->AddSil(edep);
157  TrackerHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
158  TrackerHit->SetNSilPlane(PlaneNumber);
159  TrackerHit->SetNStrip(StripNumber);
160  ThitXID[NChannel] =
161  TrackerCollection->insert(TrackerHit) -1;
162  }
163  else // This is not new
164  {
165  (*TrackerCollection)[ThitXID[NChannel]]->AddSil(edep);
166  // G4cout << "X" << PlaneNumber << " " << StripNumber << G4endl;
167  }
168  }
169 
170  if (PlaneName == "TKRDetectorY")
171  // The hit is on an Y silicon plane
172  {
173  // This is a new hit
174  if (ThitYID[NChannel]==-1)
175  {
177  TrackerHit->SetPlaneType(0);
178  TrackerHit->AddSil(edep);
179  TrackerHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
180  TrackerHit->SetNSilPlane(PlaneNumber);
181  TrackerHit->SetNStrip(StripNumber);
182  ThitYID[NChannel] =
183  TrackerCollection->insert(TrackerHit)-1;
184  }
185  else // This is not new
186  {
187  (*TrackerCollection)[ThitYID[NChannel]]->AddSil(edep);
188  // G4cout << "Y" << PlaneNumber << " " << StripNumber << G4endl;
189  }
190  }
191 
192  return true;
193 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4int insert(T *aHit)
int G4int
Definition: G4Types.hh:78
const G4String & GetName() const
void SetPos(G4ThreeVector xyz)
virtual G4int GetCopyNo() const =0
double G4double
Definition: G4Types.hh:76
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:


The documentation for this class was generated from the following files: