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

#include <GammaRayTelAnticoincidenceSD.hh>

Inheritance diagram for GammaRayTelAnticoincidenceSD:
Collaboration diagram for GammaRayTelAnticoincidenceSD:

Public Member Functions

 GammaRayTelAnticoincidenceSD (G4String)
 
 ~GammaRayTelAnticoincidenceSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *astep, G4TouchableHistory *)
 
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 GammaRayTelAnticoincidenceSD.hh.

Constructor & Destructor Documentation

GammaRayTelAnticoincidenceSD::GammaRayTelAnticoincidenceSD ( G4String  name)

Definition at line 52 of file GammaRayTelAnticoincidenceSD.cc.

54 {
56  Detector =
58 
59  NbOfACDLateralTiles = Detector->GetNbOfACDLateralTiles();
60  NbOfACDTopTiles = Detector->GetNbOfACDTopTiles();
61 
62  G4cout << NbOfACDLateralTiles << " LAT " << G4endl;
63  G4cout << NbOfACDTopTiles << " TOP " << G4endl;
64 
65  HitLateralID = new G4int[NbOfACDLateralTiles];
66  HitTopID = new G4int[NbOfACDTopTiles];
67  collectionName.insert("AnticoincidenceCollection");
68 }
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4VSensitiveDetector(G4String name)
#define G4endl
Definition: G4ios.hh:61
G4CollectionNameVector collectionName

Here is the call graph for this function:

GammaRayTelAnticoincidenceSD::~GammaRayTelAnticoincidenceSD ( )

Definition at line 72 of file GammaRayTelAnticoincidenceSD.cc.

73 {
74  delete [] HitLateralID;
75  delete [] HitTopID;
76 }

Member Function Documentation

void GammaRayTelAnticoincidenceSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 210 of file GammaRayTelAnticoincidenceSD.cc.

211 {}
void GammaRayTelAnticoincidenceSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 215 of file GammaRayTelAnticoincidenceSD.cc.

216 {}
void GammaRayTelAnticoincidenceSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 186 of file GammaRayTelAnticoincidenceSD.cc.

187 {
188  static G4int HCID = -1;
189  if(HCID<0)
190  {
192  }
193  HCE->AddHitsCollection(HCID,AnticoincidenceCollection);
194 
195  for (G4int i=0;i<NbOfACDLateralTiles;i++)
196  {
197  HitLateralID[i] = -1;
198  };
199 
200  for (G4int j=0;j<NbOfACDTopTiles;j++)
201  {
202 
203  HitTopID[j] = -1;
204  };
205 
206 }
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 GammaRayTelAnticoincidenceSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 80 of file GammaRayTelAnticoincidenceSD.cc.

81 {
82  AnticoincidenceCollection = new GammaRayTelAnticoincidenceHitsCollection
84  for (G4int i=0;i<NbOfACDLateralTiles;i++)
85  {
86  HitLateralID[i] = -1;
87  };
88 
89  for (G4int j=0;j<NbOfACDTopTiles;j++)
90  {
91 
92  HitTopID[j] = -1;
93  };
94 }
int G4int
Definition: G4Types.hh:78
G4THitsCollection< GammaRayTelAnticoincidenceHit > GammaRayTelAnticoincidenceHitsCollection
G4CollectionNameVector collectionName
void GammaRayTelAnticoincidenceSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 220 of file GammaRayTelAnticoincidenceSD.cc.

221 {}
G4bool GammaRayTelAnticoincidenceSD::ProcessHits ( G4Step astep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 98 of file GammaRayTelAnticoincidenceSD.cc.

99 {
100 
101  G4double edep = aStep->GetTotalEnergyDeposit();
102  if ((edep/keV == 0.)) return false;
103 
104  // This TouchableHistory is used to obtain the physical volume
105  // of the hit
106  G4TouchableHistory* theTouchable
107  = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
108 
109  G4VPhysicalVolume* acd_tile = theTouchable->GetVolume();
110 
111  G4int ACDTileNumber=acd_tile->GetCopyNo();
112  G4String ACDTileName = acd_tile->GetName();
113 
114  // G4cout << ACDTileName << " " << edep/keV << G4endl;
115 
116  if (ACDTileName == "ACT" )
117  // The hit is on an top ACD tile (ACDType 0)
118  {
119  // This is a new hit
120  if (HitTopID[ACDTileNumber]==-1)
121  {
123  AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
124  AnticoincidenceHit->SetACDType(0);
125  AnticoincidenceHit->AddEnergy(edep);
126  AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
127  AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
128  HitTopID[ACDTileNumber] =
129  AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
130  }
131  else // This is not new
132  {
133  (*AnticoincidenceCollection)
134  [HitTopID[ACDTileNumber]]->AddEnergy(edep);
135  }
136  }
137 
138  if (ACDTileName == "ACL1")
139  // The hit is on an lateral (left-right) ACD tile (ACDType 1)
140  {
141  // This is a new hit
142  if (HitLateralID[ACDTileNumber]==-1)
143  {
145  AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
146  AnticoincidenceHit->SetACDType(1);
147  AnticoincidenceHit->AddEnergy(edep);
148  AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
149  AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
150  HitLateralID[ACDTileNumber] =
151  AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
152  }
153  else // This is not new
154  {
155  (*AnticoincidenceCollection)
156  [HitLateralID[ACDTileNumber]]->AddEnergy(edep);
157  }
158  }
159 
160  if (ACDTileName == "ACL2")
161  // The hit is on an lateral (rear - front) ACD tile (ACDType 2)
162  {
163  // This is a new hit
164  if (HitLateralID[ACDTileNumber]==-1)
165  {
167  AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
168  AnticoincidenceHit->SetACDType(2);
169  AnticoincidenceHit->AddEnergy(edep);
170  AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
171  AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
172  HitLateralID[ACDTileNumber] =
173  AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
174  }
175  else // This is not new
176  {
177  (*AnticoincidenceCollection)
178  [HitLateralID[ACDTileNumber]]->AddEnergy(edep);
179  }
180  }
181  return true;
182 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4int insert(T *aHit)
int G4int
Definition: G4Types.hh:78
const G4String & GetName() const
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: