VMC Examples Version 6.6
Loading...
Searching...
No Matches
VMC::TR::SensitiveDetector Class Reference

The absorber sensitive detector. More...

#include <SensitiveDetector.h>

Inheritance diagram for VMC::TR::SensitiveDetector:

Public Member Functions

 SensitiveDetector (const char *name)
 
 SensitiveDetector (const SensitiveDetector &origin)
 
 SensitiveDetector ()
 
virtual ~SensitiveDetector ()
 
void Initialize ()
 
Bool_t ProcessHits ()
 
void EndOfEvent ()
 
virtual void Print (Option_t *option="") const
 
void SetVerboseLevel (Int_t level)
 
Double_t GetEdep () const
 Return energy deposit.
 

Private Attributes

Double_t fEdep
 Energy deposit.
 
Int_t fAbsorberVolId
 The absorber volume Id.
 
Int_t fVerboseLevel
 Verbosity level.
 

Detailed Description

The absorber sensitive detector.

Date
18/12/2015
Author
I. Hrivnacova; IPN, Orsay

Definition at line 34 of file SensitiveDetector.h.

Constructor & Destructor Documentation

◆ SensitiveDetector() [1/3]

VMC::TR::SensitiveDetector::SensitiveDetector ( const char * name)

Standard constructor.

Parameters
nameThe sensitive detector name

Definition at line 35 of file SensitiveDetector.cxx.

36 : TNamed(name, ""), fEdep(0.), fAbsorberVolId(0), fVerboseLevel(1)
37{
38 /// Standard constructor.
39 /// \param name The sensitive detector name
40}
Int_t fVerboseLevel
Verbosity level.
Double_t fEdep
Energy deposit.
Int_t fAbsorberVolId
The absorber volume Id.

◆ SensitiveDetector() [2/3]

VMC::TR::SensitiveDetector::SensitiveDetector ( const SensitiveDetector & origin)

Copy constructor (for clonig on worker thread in MT mode). Create hits collection.

Parameters
originThe source object (on master).

Definition at line 43 of file SensitiveDetector.cxx.

44 : TNamed(origin),
45 fEdep(0.),
46 fAbsorberVolId(origin.fAbsorberVolId),
47 fVerboseLevel(origin.fVerboseLevel)
48{
49 /// Copy constructor (for clonig on worker thread in MT mode).
50 /// Create hits collection.
51 /// \param origin The source object (on master).
52}

◆ SensitiveDetector() [3/3]

VMC::TR::SensitiveDetector::SensitiveDetector ( )

Default constructor

Definition at line 55 of file SensitiveDetector.cxx.

57{
58 /// Default constructor
59}

◆ ~SensitiveDetector()

VMC::TR::SensitiveDetector::~SensitiveDetector ( )
virtual

Destructor

Definition at line 62 of file SensitiveDetector.cxx.

63{
64 /// Destructor
65}

Member Function Documentation

◆ Initialize()

void VMC::TR::SensitiveDetector::Initialize ( )

Set sensitive volumes.

Definition at line 72 of file SensitiveDetector.cxx.

73{
74 /// Set sensitive volumes.
75
76 fAbsorberVolId = gMC->VolId("Absorber");
77}

◆ ProcessHits()

Bool_t VMC::TR::SensitiveDetector::ProcessHits ( )

Account energy deposit.

Definition at line 80 of file SensitiveDetector.cxx.

81{
82 /// Account energy deposit.
83
84 Int_t copyNo;
85 Int_t id = gMC->CurrentVolID(copyNo);
86
87 if (id != fAbsorberVolId) return false;
88
89 fEdep += gMC->Edep();
90
91 return true;
92}

◆ EndOfEvent()

void VMC::TR::SensitiveDetector::EndOfEvent ( )

Print the enrgy deposit (if verbose) and reset hits afterwards.

Definition at line 95 of file SensitiveDetector.cxx.

96{
97 /// Print the enrgy deposit (if verbose) and reset hits afterwards.
98
99 if (fVerboseLevel > 1) Print();
100
101 // Reset the accumulated values.
102 fEdep = 0.;
103}
virtual void Print(Option_t *option="") const

◆ Print()

void VMC::TR::SensitiveDetector::Print ( Option_t * option = "") const
virtual

Print the energy deposit.

Definition at line 106 of file SensitiveDetector.cxx.

107{
108 /// Print the energy deposit.
109
110 cout << "\n-------->Edep: in this event [MeV]: " << fEdep * 1e+03 << endl
111 << endl;
112}

◆ SetVerboseLevel()

void VMC::TR::SensitiveDetector::SetVerboseLevel ( Int_t level)
inline

Set verbose level

Parameters
levelThe new verbose level value

Definition at line 65 of file SensitiveDetector.h.

66{
67 fVerboseLevel = level;
68}

◆ GetEdep()

Double_t VMC::TR::SensitiveDetector::GetEdep ( ) const
inline

Return energy deposit.

Definition at line 71 of file SensitiveDetector.h.

71{ return fEdep; }

Member Data Documentation

◆ fEdep

Double_t VMC::TR::SensitiveDetector::fEdep
private

Energy deposit.

Definition at line 56 of file SensitiveDetector.h.

◆ fAbsorberVolId

Int_t VMC::TR::SensitiveDetector::fAbsorberVolId
private

The absorber volume Id.

Definition at line 57 of file SensitiveDetector.h.

◆ fVerboseLevel

Int_t VMC::TR::SensitiveDetector::fVerboseLevel
private

Verbosity level.

Definition at line 58 of file SensitiveDetector.h.


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