Geant4  10.02.p03
CexmcTrackPointsDigitizer Class Reference

#include <CexmcTrackPointsDigitizer.hh>

Inheritance diagram for CexmcTrackPointsDigitizer:
Collaboration diagram for CexmcTrackPointsDigitizer:

Public Member Functions

 CexmcTrackPointsDigitizer (const G4String &name)
 
void Digitize (void)
 
const CexmcTrackPointInfoGetMonitorTP (void) const
 
const CexmcTrackPointInfoGetTargetTPBeamParticle (void) const
 
const CexmcTrackPointInfoGetTargetTPOutputParticle (void) const
 
const CexmcTrackPointInfoGetTargetTPNucleusParticle (void) const
 
const CexmcTrackPointInfoGetTargetTPOutputParticleDecayProductParticle (G4int index) const
 
const CexmcTrackPointInfoGetVetoCounterTPLeft (void) const
 
const CexmcTrackPointInfoGetVetoCounterTPRight (void) const
 
const CexmcTrackPointInfoGetCalorimeterTPLeft (void) const
 
const CexmcTrackPointInfoGetCalorimeterTPRight (void) const
 
G4bool HasTriggered (void) const
 
- 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)
 

Private Member Functions

void InitializeData (void)
 

Private Attributes

CexmcTrackPointInfo monitorTP
 
CexmcTrackPointInfo targetTPBeamParticle
 
CexmcTrackPointInfo targetTPOutputParticle
 
CexmcTrackPointInfo targetTPNucleusParticle
 
CexmcTrackPointInfo targetTPOutputParticleDecayProductParticle [2]
 
CexmcTrackPointInfo vetoCounterTPLeft
 
CexmcTrackPointInfo vetoCounterTPRight
 
CexmcTrackPointInfo calorimeterTPLeft
 
CexmcTrackPointInfo calorimeterTPRight
 
G4bool hasTriggered
 
CexmcSetup::CalorimeterGeometryData calorimeterGeometry
 

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 54 of file CexmcTrackPointsDigitizer.hh.

Constructor & Destructor Documentation

◆ CexmcTrackPointsDigitizer()

CexmcTrackPointsDigitizer::CexmcTrackPointsDigitizer ( const G4String name)
explicit

Definition at line 55 of file CexmcTrackPointsDigitizer.cc.

55  :
56  G4VDigitizerModule( name ), hasTriggered( false )
57 {
58  G4RunManager * runManager( G4RunManager::GetRunManager() );
59  const CexmcSetup * setup( static_cast< const CexmcSetup * >(
60  runManager->GetUserDetectorConstruction() ) );
61  calorimeterGeometry = setup->GetCalorimeterGeometry();
62 }
G4VDigitizerModule(G4String modName)
CexmcSetup::CalorimeterGeometryData calorimeterGeometry
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
Here is the call graph for this function:

Member Function Documentation

◆ Digitize()

void CexmcTrackPointsDigitizer::Digitize ( void  )
virtual

Implements G4VDigitizerModule.

Definition at line 83 of file CexmcTrackPointsDigitizer.cc.

84 {
86 
87  G4int nCrystalsInColumn( calorimeterGeometry.nCrystalsInColumn );
88  G4int nCrystalsInRow( calorimeterGeometry.nCrystalsInRow );
91 
92  G4DigiManager * digiManager( G4DigiManager::GetDMpointer() );
93  G4int hcId( digiManager->GetHitsCollectionID(
97  hitsCollection( static_cast< const CexmcTrackPointsCollection * >(
98  digiManager->GetHitsCollection( hcId ) ) );
99 
100  if ( hitsCollection )
101  {
102  for ( CexmcTrackPointsCollectionData::iterator
103  k( hitsCollection->GetMap()->begin() );
104  k != hitsCollection->GetMap()->end(); ++k )
105  {
106  monitorTP = *k->second;
107  break;
108  }
109  }
110 
111  hcId = digiManager->GetHitsCollectionID(
113  "/" + CexmcDetectorTypeName[ CexmcTPDetector ] );
114  hitsCollection = static_cast< const CexmcTrackPointsCollection * >(
115  digiManager->GetHitsCollection( hcId ) );
116 
117  if ( hitsCollection )
118  {
119  for ( CexmcTrackPointsCollectionData::iterator
120  k( hitsCollection->GetMap()->begin() );
121  k != hitsCollection->GetMap()->end(); ++k )
122  {
123  do
124  {
125  if ( k->second->trackType == CexmcBeamParticleTrack )
126  {
127  targetTPBeamParticle = *k->second;
128  break;
129  }
130  if ( k->second->trackType == CexmcOutputParticleTrack )
131  {
132  targetTPOutputParticle = *k->second;
134  break;
135  }
136  if ( k->second->trackType == CexmcNucleusParticleTrack )
137  {
138  targetTPNucleusParticle = *k->second;
139  break;
140  }
141  if ( k->second->trackType ==
143  {
144  /* NB: if there are more than 2 output particle's decay
145  * products then the chosen particles may differ from those
146  * which entered calorimeters; however this is not a
147  * critical issue as far as information about decay products
148  * is not necessary in reconstruction and only used in some
149  * histograming */
150  G4int index(
152  trackId > 0 ? 1 : 0 );
154  *k->second;
155  break;
156  }
157  } while ( false );
158  }
159  }
160 
161  hcId = digiManager->GetHitsCollectionID(
163  "/" + CexmcDetectorTypeName[ CexmcTPDetector ] );
164  hitsCollection = static_cast< const CexmcTrackPointsCollection * >(
165  digiManager->GetHitsCollection( hcId ) );
166 
167  if ( hitsCollection )
168  {
169  for ( CexmcTrackPointsCollectionData::iterator
170  k( hitsCollection->GetMap()->begin() );
171  k != hitsCollection->GetMap()->end(); ++k )
172  {
173  if ( k->second->trackType != CexmcOutputParticleDecayProductTrack )
174  continue;
175 
176  G4int index( k->first );
178  index ) );
179  switch ( side )
180  {
181  case CexmcLeft :
182  vetoCounterTPLeft = *k->second;
183  break;
184  case CexmcRight :
185  vetoCounterTPRight = *k->second;
186  break;
187  default :
188  break;
189  }
190  }
191  }
192 
193  hcId = digiManager->GetHitsCollectionID(
195  "/" + CexmcDetectorTypeName[ CexmcTPDetector ] );
196  hitsCollection = static_cast< const CexmcTrackPointsCollection * >(
197  digiManager->GetHitsCollection( hcId ) );
198 
199  if ( hitsCollection )
200  {
201  for ( CexmcTrackPointsCollectionData::iterator
202  k( hitsCollection->GetMap()->begin() );
203  k != hitsCollection->GetMap()->end(); ++k )
204  {
205  if ( k->second->trackType != CexmcOutputParticleDecayProductTrack )
206  continue;
207 
208  G4int index( k->first );
210  index ) );
213  index ) );
214  G4double xInCalorimeterOffset(
215  ( G4double( column ) - G4double( nCrystalsInRow ) / 2 ) *
216  crystalWidth + crystalWidth / 2 );
217  G4double yInCalorimeterOffset(
218  ( G4double( row ) - G4double( nCrystalsInColumn ) / 2 ) *
219  crystalHeight + crystalHeight / 2 );
220  switch ( side )
221  {
222  case CexmcLeft :
223  calorimeterTPLeft = *k->second;
224  calorimeterTPLeft.positionLocal.setX( xInCalorimeterOffset +
226  calorimeterTPLeft.positionLocal.setY( yInCalorimeterOffset +
228  break;
229  case CexmcRight :
230  calorimeterTPRight = *k->second;
231  calorimeterTPRight.positionLocal.setX( xInCalorimeterOffset +
233  calorimeterTPRight.positionLocal.setY( yInCalorimeterOffset +
235  break;
236  default :
237  break;
238  }
239  }
240  }
241 }
Int_t index
G4bool IsValid(void) const
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
static G4DigiManager * GetDMpointer()
CexmcTrackPointInfo targetTPNucleusParticle
int G4int
Definition: G4Types.hh:78
void setY(double)
void setX(double)
CexmcSetup::CalorimeterGeometryData calorimeterGeometry
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
double x() const
CexmcSide
Definition: CexmcCommon.hh:132
double y() const
CexmcTrackPointInfo targetTPOutputParticle
CexmcTrackPointInfo targetTPBeamParticle
double G4double
Definition: G4Types.hh:76
CexmcTrackPointInfo targetTPOutputParticleDecayProductParticle[2]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCalorimeterTPLeft()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetCalorimeterTPLeft ( void  ) const
inline

Definition at line 169 of file CexmcTrackPointsDigitizer.hh.

170 {
171  return calorimeterTPLeft;
172 }
Here is the caller graph for this function:

◆ GetCalorimeterTPRight()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetCalorimeterTPRight ( void  ) const
inline

Definition at line 176 of file CexmcTrackPointsDigitizer.hh.

177 {
178  return calorimeterTPRight;
179 }
Here is the caller graph for this function:

◆ GetMonitorTP()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetMonitorTP ( void  ) const
inline

Definition at line 116 of file CexmcTrackPointsDigitizer.hh.

117 {
118  return monitorTP;
119 }
Here is the caller graph for this function:

◆ GetTargetTPBeamParticle()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetTargetTPBeamParticle ( void  ) const
inline

Definition at line 123 of file CexmcTrackPointsDigitizer.hh.

124 {
125  return targetTPBeamParticle;
126 }
CexmcTrackPointInfo targetTPBeamParticle
Here is the caller graph for this function:

◆ GetTargetTPNucleusParticle()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetTargetTPNucleusParticle ( void  ) const
inline

Definition at line 137 of file CexmcTrackPointsDigitizer.hh.

138 {
140 }
CexmcTrackPointInfo targetTPNucleusParticle
Here is the caller graph for this function:

◆ GetTargetTPOutputParticle()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetTargetTPOutputParticle ( void  ) const
inline

Definition at line 130 of file CexmcTrackPointsDigitizer.hh.

131 {
132  return targetTPOutputParticle;
133 }
CexmcTrackPointInfo targetTPOutputParticle
Here is the caller graph for this function:

◆ GetTargetTPOutputParticleDecayProductParticle()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetTargetTPOutputParticleDecayProductParticle ( G4int  index) const
inline

Definition at line 144 of file CexmcTrackPointsDigitizer.hh.

146 {
147  if ( index == 1 )
149 
151 }
Int_t index
CexmcTrackPointInfo targetTPOutputParticleDecayProductParticle[2]

◆ GetVetoCounterTPLeft()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetVetoCounterTPLeft ( void  ) const
inline

Definition at line 155 of file CexmcTrackPointsDigitizer.hh.

156 {
157  return vetoCounterTPLeft;
158 }
Here is the caller graph for this function:

◆ GetVetoCounterTPRight()

const CexmcTrackPointInfo & CexmcTrackPointsDigitizer::GetVetoCounterTPRight ( void  ) const
inline

Definition at line 162 of file CexmcTrackPointsDigitizer.hh.

163 {
164  return vetoCounterTPRight;
165 }
Here is the caller graph for this function:

◆ HasTriggered()

G4bool CexmcTrackPointsDigitizer::HasTriggered ( void  ) const
inline

Definition at line 182 of file CexmcTrackPointsDigitizer.hh.

183 {
184  return hasTriggered;
185 }
Here is the caller graph for this function:

◆ InitializeData()

void CexmcTrackPointsDigitizer::InitializeData ( void  )
private

Definition at line 65 of file CexmcTrackPointsDigitizer.cc.

66 {
79  hasTriggered = false;
80 }
const G4int CexmcInvalidTrackId(-1)
CexmcTrackPointInfo targetTPNucleusParticle
CexmcTrackPointInfo targetTPOutputParticle
CexmcTrackPointInfo targetTPBeamParticle
CexmcTrackPointInfo targetTPOutputParticleDecayProductParticle[2]
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ calorimeterGeometry

CexmcSetup::CalorimeterGeometryData CexmcTrackPointsDigitizer::calorimeterGeometry
private

Definition at line 111 of file CexmcTrackPointsDigitizer.hh.

◆ calorimeterTPLeft

CexmcTrackPointInfo CexmcTrackPointsDigitizer::calorimeterTPLeft
private

Definition at line 104 of file CexmcTrackPointsDigitizer.hh.

◆ calorimeterTPRight

CexmcTrackPointInfo CexmcTrackPointsDigitizer::calorimeterTPRight
private

Definition at line 106 of file CexmcTrackPointsDigitizer.hh.

◆ hasTriggered

G4bool CexmcTrackPointsDigitizer::hasTriggered
private

Definition at line 108 of file CexmcTrackPointsDigitizer.hh.

◆ monitorTP

CexmcTrackPointInfo CexmcTrackPointsDigitizer::monitorTP
private

Definition at line 90 of file CexmcTrackPointsDigitizer.hh.

◆ targetTPBeamParticle

CexmcTrackPointInfo CexmcTrackPointsDigitizer::targetTPBeamParticle
private

Definition at line 92 of file CexmcTrackPointsDigitizer.hh.

◆ targetTPNucleusParticle

CexmcTrackPointInfo CexmcTrackPointsDigitizer::targetTPNucleusParticle
private

Definition at line 96 of file CexmcTrackPointsDigitizer.hh.

◆ targetTPOutputParticle

CexmcTrackPointInfo CexmcTrackPointsDigitizer::targetTPOutputParticle
private

Definition at line 94 of file CexmcTrackPointsDigitizer.hh.

◆ targetTPOutputParticleDecayProductParticle

CexmcTrackPointInfo CexmcTrackPointsDigitizer::targetTPOutputParticleDecayProductParticle[2]
private

Definition at line 98 of file CexmcTrackPointsDigitizer.hh.

◆ vetoCounterTPLeft

CexmcTrackPointInfo CexmcTrackPointsDigitizer::vetoCounterTPLeft
private

Definition at line 100 of file CexmcTrackPointsDigitizer.hh.

◆ vetoCounterTPRight

CexmcTrackPointInfo CexmcTrackPointsDigitizer::vetoCounterTPRight
private

Definition at line 102 of file CexmcTrackPointsDigitizer.hh.


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