Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 

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 ( 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)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79

Here is the call graph for this function:

Member Function Documentation

void CexmcTrackPointsDigitizer::Digitize ( void  )
virtual

Implements G4VDigitizerModule.

Definition at line 83 of file CexmcTrackPointsDigitizer.cc.

84 {
85  InitializeData();
86 
87  G4int nCrystalsInColumn( calorimeterGeometry.nCrystalsInColumn );
88  G4int nCrystalsInRow( calorimeterGeometry.nCrystalsInRow );
89  G4double crystalWidth( calorimeterGeometry.crystalWidth );
90  G4double crystalHeight( calorimeterGeometry.crystalHeight );
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;
133  hasTriggered = targetTPOutputParticle.IsValid();
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(
151  targetTPOutputParticleDecayProductParticle[ 0 ].
152  trackId > 0 ? 1 : 0 );
153  targetTPOutputParticleDecayProductParticle[ index ] =
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 +
225  calorimeterTPLeft.positionLocal.x() );
226  calorimeterTPLeft.positionLocal.setY( yInCalorimeterOffset +
227  calorimeterTPLeft.positionLocal.y() );
228  break;
229  case CexmcRight :
230  calorimeterTPRight = *k->second;
231  calorimeterTPRight.positionLocal.setX( xInCalorimeterOffset +
232  calorimeterTPRight.positionLocal.x() );
233  calorimeterTPRight.positionLocal.setY( yInCalorimeterOffset +
234  calorimeterTPRight.positionLocal.y() );
235  break;
236  default :
237  break;
238  }
239  }
240  }
241 }
double x() const
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
static G4DigiManager * GetDMpointer()
int G4int
Definition: G4Types.hh:78
void setY(double)
void setX(double)
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
CexmcSide
Definition: CexmcCommon.hh:132
double y() const
G4bool IsValid(void) const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

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:

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

Definition at line 123 of file CexmcTrackPointsDigitizer.hh.

124 {
125  return targetTPBeamParticle;
126 }

Here is the caller graph for this function:

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

Definition at line 137 of file CexmcTrackPointsDigitizer.hh.

138 {
139  return targetTPNucleusParticle;
140 }

Here is the caller graph for this function:

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

Definition at line 130 of file CexmcTrackPointsDigitizer.hh.

131 {
132  return targetTPOutputParticle;
133 }

Here is the caller graph for this function:

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

Definition at line 144 of file CexmcTrackPointsDigitizer.hh.

146 {
147  if ( index == 1 )
148  return targetTPOutputParticleDecayProductParticle[ 1 ];
149 
150  return targetTPOutputParticleDecayProductParticle[ 0 ];
151 }
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:

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:

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:


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