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

#include <GammaRayTelDigitizer.hh>

Inheritance diagram for GammaRayTelDigitizer:
Collaboration diagram for GammaRayTelDigitizer:

Public Member Functions

 GammaRayTelDigitizer (G4String name)
 
 ~GammaRayTelDigitizer ()
 
void Digitize ()
 
void SetThreshold (G4double val)
 
- Public Member Functions inherited from G4VDigitizerModule
 G4VDigitizerModule (G4String modName)
 
virtual ~G4VDigitizerModule ()
 
int operator== (const G4VDigitizerModule &right) const
 
int operator!= (const G4VDigitizerModule &right) const
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int i) const
 
G4String GetName () const
 
void SetVerboseLevel (G4int val)
 

Additional Inherited Members

- Protected Member Functions inherited from G4VDigitizerModule
void StoreDigiCollection (G4VDigiCollection *aDC)
 
void StoreDigiCollection (G4int DCID, G4VDigiCollection *aDC)
 
- Protected Attributes inherited from G4VDigitizerModule
G4DigiManagerDigiManager
 
G4String moduleName
 
std::vector< G4StringcollectionName
 
G4int verboseLevel
 

Detailed Description

Definition at line 51 of file GammaRayTelDigitizer.hh.

Constructor & Destructor Documentation

GammaRayTelDigitizer::GammaRayTelDigitizer ( G4String  name)

Definition at line 57 of file GammaRayTelDigitizer.cc.

58  :G4VDigitizerModule(name)
59 {
60 
61 
62  G4String colName = "DigitsCollection";
63  collectionName.push_back(colName);
64  Energy_Threshold = 120.*keV;
65  TotalEnergy = 0.;
66  ACDThreshold = 15*keV;
67 
68 //create a messenger for this class
69  digiMessenger = new GammaRayTelDigitizerMessenger(this);
70 
71 }
G4VDigitizerModule(G4String modName)
std::vector< G4String > collectionName
static constexpr double keV
Definition: G4SIunits.hh:216
GammaRayTelDigitizer::~GammaRayTelDigitizer ( )

Definition at line 75 of file GammaRayTelDigitizer.cc.

76 {
77  delete digiMessenger;
78 }

Member Function Documentation

void GammaRayTelDigitizer::Digitize ( void  )
virtual

Implements G4VDigitizerModule.

Definition at line 82 of file GammaRayTelDigitizer.cc.

83 {
84  DigitsCollection = new GammaRayTelDigitsCollection
85  ("GammaRayTelDigitizer","DigitsCollection"); // to create the Digi Collection
86 
88 
89  G4int THCID; // TrackerCollection
90  G4int CHCID; // CalorimeterCollection
91  G4int AHCID; // AnticoincidenceCollection
92 
93  TotalEnergy = 0.; // at each event
94 
95  // TKR Hits collection
96 
97  THCID = DigiMan->GetHitsCollectionID("TrackerCollection");
100  (DigiMan->GetHitsCollection(THCID));
101 
102 
103  // CAL Hits collection
104 
105  CHCID = DigiMan->GetHitsCollectionID("CalorimeterCollection");
108  (DigiMan->GetHitsCollection(CHCID));
109 
110  // ACD Hits collection
111 
112  AHCID = DigiMan->GetHitsCollectionID("AnticoincidenceCollection");
115  (DigiMan->GetHitsCollection(AHCID));
116 
117 
118  if (THC)
119  {
120  G4int n_hit = THC->entries();
121 
122  for (G4int i=0;i<n_hit;i++)
123  {
124  G4double ESil = (*THC)[i]->GetEdepSil();
125  G4int NStrip = (*THC)[i]->GetNStrip();
126  G4int NPlane = (*THC)[i]->GetNSilPlane();
127  G4int IsX = (*THC)[i]->GetPlaneType();
128 
129  // digi generation only if energy deposit greater than threshold
130 
131  if (ESil>Energy_Threshold)
132  {
133  GammaRayTelDigi* Digi = new GammaRayTelDigi();
134  Digi->SetPlaneNumber(NPlane);
135  Digi->SetPlaneType(IsX);
136  Digi->SetStripNumber(NStrip);
137  Digi->SetDigiType(0);
138  Digi->SetEnergy(0.);
139  DigitsCollection->insert(Digi);
140  }
141  }
142  }
143  if (CHC)
144  {
145  G4int n_hit = CHC->entries();
146 
147  for (G4int i=0;i<n_hit;i++)
148  {
149  TotalEnergy +=(*CHC)[i]->GetEdepCAL();
150  }
151  // digi generation only if energy deposit greater than 0.
152 
153  if (TotalEnergy>0.)
154  {
155  GammaRayTelDigi* Digi = new GammaRayTelDigi();
156  Digi->SetPlaneNumber(0);
157  Digi->SetPlaneType(0);
158  Digi->SetStripNumber(0);
159  Digi->SetDigiType(1);
160  Digi->SetEnergy(TotalEnergy);
161  DigitsCollection->insert(Digi);
162  }
163 
164  }
165 
166  if (AHC)
167  {
168  G4int n_hit = AHC->entries();
169 
170  for (G4int i=0;i<n_hit;i++)
171  {
172  G4double energy = (*AHC)[i]->GetEdepACD();
173  G4int type = (*AHC)[i]->GetACDTileNumber();
174 
175  // digi generation only if energy deposit greater than 0.
176 
177  if (energy>ACDThreshold)
178  {
179  GammaRayTelDigi* Digi = new GammaRayTelDigi();
180  Digi->SetPlaneNumber(0);
181  Digi->SetPlaneType(0);
182  Digi->SetStripNumber(type);
183  Digi->SetDigiType(2);
184  Digi->SetEnergy(energy);
185  DigitsCollection->insert(Digi);
186  }
187 
188  }
189  }
190 
191  if (THC||AHC||CHC){
192  G4cout << "Number of digits in this event = "
193  << DigitsCollection->entries()
194  // << " " << DigitsCollection->GetName()
195  // << " " << DigitsCollection->GetDMname()
196  << G4endl;
197  }
198 
199  StoreDigiCollection(DigitsCollection);
200 
201  G4int DCID = -1;
202  if(DCID<0)
203  {
204  // DigiMan->List();
205  DCID = DigiMan->GetDigiCollectionID("GammaRayTelDigitizer/DigitsCollection");
206  }
207 
208 
209 }
G4int insert(T *aHit)
void SetStripNumber(G4int StripNum)
static G4DigiManager * GetDMpointer()
G4int entries() const
void SetPlaneType(G4int PlaneTyp)
const G4VHitsCollection * GetHitsCollection(G4int HCID, G4int eventID=0)
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetHitsCollectionID(G4String HCname)
G4int entries() const
void SetEnergy(G4double Ene)
void SetPlaneNumber(G4int PlaneNum)
G4int GetDigiCollectionID(G4String DCname)
G4double energy(const ThreeVector &p, const G4double m)
void StoreDigiCollection(G4VDigiCollection *aDC)
G4TDigiCollection< GammaRayTelDigi > GammaRayTelDigitsCollection
#define G4endl
Definition: G4ios.hh:61
void SetDigiType(G4int DigiID)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void GammaRayTelDigitizer::SetThreshold ( G4double  val)
inline

Definition at line 59 of file GammaRayTelDigitizer.hh.

59 { Energy_Threshold = val;}

Here is the caller graph for this function:


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