Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
eRositaTrackerSD Class Reference

#include <eRositaTrackerSD.hh>

Inheritance diagram for eRositaTrackerSD:
G4VSensitiveDetector

Public Member Functions

 eRositaTrackerSD (G4String)
 
 ~eRositaTrackerSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *)
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
const G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
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 43 of file eRositaTrackerSD.hh.

Constructor & Destructor Documentation

eRositaTrackerSD::eRositaTrackerSD ( G4String  name)

Definition at line 45 of file eRositaTrackerSD.cc.

References G4VSensitiveDetector::collectionName, and G4CollectionNameVector::insert().

47 {
48  G4String HCname;
49  collectionName.insert(HCname="trackerCollection");
50 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
eRositaTrackerSD::~eRositaTrackerSD ( )

Definition at line 53 of file eRositaTrackerSD.cc.

53 { }

Member Function Documentation

void eRositaTrackerSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 97 of file eRositaTrackerSD.cc.

References G4THitsCollection< T >::entries(), G4cout, G4endl, and G4VSensitiveDetector::verboseLevel.

98 {
99  G4int NbHits = trackerCollection->entries();
100 
101  if (verboseLevel > 0)
102  {
103 
104  G4cout << std::endl
105  << "Hits Collection: in this event they are " << NbHits
106  << " hits in the tracker chambers: " << G4endl;
107  for (G4int i=0;i<NbHits;i++) (*trackerCollection)[i]->Print();
108 
109  }
110 
111  // ofstream out("ASCII");
112  //if (!out.is_open())
113  // {
114  // G4cout <<"...opening ASCII file failed";
115  // }
116 
117  double eTot = 0.;
118 
119  for (G4int i=0; i<NbHits; i++)
120  {
121  (*trackerCollection)[i]->PrintToFile();
122  eTot += (*trackerCollection)[i]->GetEdep();
123  };
124 
125 // if (eTot > 0.) AnalysisManager::Instance()->ScoreTot(eTot);
126 
127 //out.close();
128 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void eRositaTrackerSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 56 of file eRositaTrackerSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4SDManager::GetCollectionID(), G4SDManager::GetSDMpointer(), and G4VSensitiveDetector::SensitiveDetectorName.

57 {
58  trackerCollection = new eRositaTrackerHitsCollection
60  static G4int HCID = -1;
61  if (HCID < 0)
62  {
64  }
65  HCE->AddHitsCollection( HCID, trackerCollection );
66 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
G4THitsCollection< eRositaTrackerHit > eRositaTrackerHitsCollection
G4bool eRositaTrackerSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 69 of file eRositaTrackerSD.cc.

References G4Gamma::GammaDefinition(), G4Track::GetDefinition(), G4StepPoint::GetKineticEnergy(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4Step::GetTrack(), G4Track::GetTrackID(), G4THitsCollection< T >::insert(), eRositaTrackerHit::SetEdep(), eRositaTrackerHit::SetPos(), and eRositaTrackerHit::SetTrackID().

70 {
71  if(aStep->GetTrack()->GetDefinition() != G4Gamma::GammaDefinition()) return false;
72 
73 // G4double edep = aStep->GetTotalEnergyDeposit();
74  G4double edep = aStep->GetPreStepPoint()->GetKineticEnergy();
75 
76  if (edep == 0.) return false;
77 
78  eRositaTrackerHit* newHit = new eRositaTrackerHit();
79  newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
80  //newHit->SetChamberNb(aStep->GetPreStepPoint()->GetTouchableHandle()
81  // ->GetCopyNumber());
82  newHit->SetEdep(edep);
83  newHit->SetPos(aStep->GetPostStepPoint()->GetPosition());
84  trackerCollection->insert( newHit );
85 
86  //newHit->Print();
87  //newHit->Draw();
88 
89  //ofstream out("ASCII");
90  //newHit->PrintToFile(out);
91  //out.close();
92 
93  return true;
94 }
G4ParticleDefinition * GetDefinition() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4int GetTrackID() const
void SetTrackID(G4int track)
G4StepPoint * GetPostStepPoint() const
G4double GetKineticEnergy() const
double G4double
Definition: G4Types.hh:76
void SetEdep(G4double de)
G4Track * GetTrack() const
void SetPos(G4ThreeVector xyz)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81

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