MCPcopy Create free account
hub / github.com/Geant4/geant4 / SaveProject

Method SaveProject

examples/advanced/ChargeExchangeMC/src/CexmcRunManager.cc:329–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327
328
329void CexmcRunManager::SaveProject( void )
330{
331 if ( ! ProjectIsSaved() )
332 return;
333
334 /* save run data */
335 if ( ! physicsManager )
336 throw CexmcException( CexmcWeirdException );
337
338 CexmcSimpleDecayTableStore etaDecayTable(
339 G4Eta::Definition()->GetDecayTable() );
340 const CexmcPrimaryGeneratorAction * primaryGeneratorAction(
341 static_cast< const CexmcPrimaryGeneratorAction * >(
342 userPrimaryGeneratorAction ) );
343 CexmcPrimaryGeneratorAction * thePrimaryGeneratorAction(
344 const_cast< CexmcPrimaryGeneratorAction * >(
345 primaryGeneratorAction ) );
346 CexmcParticleGun * particleGun(
347 thePrimaryGeneratorAction->GetParticleGun() );
348
349 G4DigiManager * digiManager( G4DigiManager::GetDMpointer() );
350 CexmcEnergyDepositDigitizer * edDigitizer(
351 static_cast< CexmcEnergyDepositDigitizer * >(
352 digiManager->FindDigitizerModule( CexmcEDDigitizerName ) ) );
353 if ( ! edDigitizer )
354 throw CexmcException( CexmcWeirdException );
355
356 const CexmcEventAction * eventAction(
357 static_cast< const CexmcEventAction * >( userEventAction ) );
358 CexmcEventAction * theEventAction( const_cast< CexmcEventAction * >(
359 eventAction ) );
360 CexmcChargeExchangeReconstructor * reconstructor(
361 theEventAction->GetReconstructor() );
362
363 std::vector< G4double > calorimeterRegCuts( 4 );
364 if ( ProjectIsRead() )
365 {
366 calorimeterRegCuts = sObject.calorimeterRegCuts;
367 }
368 else
369 {
370 G4Region * region( G4RegionStore::GetInstance()->GetRegion(
371 CexmcCalorimeterRegionName ) );
372 if ( ! region )
373 throw CexmcException( CexmcCalorimeterRegionNotInitialized );
374
375 calorimeterRegCuts = region->GetProductionCuts()->GetProductionCuts();
376 }
377
378 CexmcNmbOfHitsInRanges nmbOfHitsSampled;
379 CexmcNmbOfHitsInRanges nmbOfHitsSampledFull;
380 CexmcNmbOfHitsInRanges nmbOfHitsTriggeredRealRange;
381 CexmcNmbOfHitsInRanges nmbOfHitsTriggeredRecRange;
382 CexmcNmbOfHitsInRanges nmbOfOrphanHits;
383 G4int nmbOfFalseHitsTriggeredEDT( 0 );
384 G4int nmbOfFalseHitsTriggeredRec( 0 );
385 G4int nmbOfSavedEvents( 0 );
386 G4int nmbOfSavedFastEvents( 0 );

Callers 1

mainFunction · 0.80

Calls 15

CexmcExceptionClass · 0.85
GetInstanceFunction · 0.85
FindDigitizerModuleMethod · 0.80
GetReconstructorMethod · 0.80
GetRegionMethod · 0.80
GetProductionCutsMethod · 0.80
GetNmbOfSavedEventsMethod · 0.80
GetProductionModelMethod · 0.80
IsFermiMotionOnMethod · 0.80

Tested by

no test coverage detected