Commit in projects/slic/branches/v00-00-01_SLIC-218-dev on MAIN | |||
CMakeLists.txt | +4 | -4 | 2870 -> 2871 |
include/MCParticleManager.hh | +2 | -2 | 2870 -> 2871 |
/TrackManager.hh | +19 | -2 | 2870 -> 2871 |
/TrackSummary.hh | +7 | -3 | 2870 -> 2871 |
/TrackUtil.hh | +12 | 2870 -> 2871 | |
/UserTrackInformation.hh | +3 | -3 | 2870 -> 2871 |
src/EventAction.cc | +4 | -1 | 2870 -> 2871 |
/RunAction.cc | -7 | 2870 -> 2871 | |
/RunManager.cc | +1 | -1 | 2870 -> 2871 |
/TrackManager.cc | +8 | -5 | 2870 -> 2871 |
/TrackSummary.cc | +70 | -86 | 2870 -> 2871 |
/TrackingAction.cc | +20 | -21 | 2870 -> 2871 |
/UserTrackInformation.cc | +1 | -1 | 2870 -> 2871 |
+151 | -136 |
checkpoint work in progress on MCParticle handling code
--- projects/slic/branches/v00-00-01_SLIC-218-dev/CMakeLists.txt 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/CMakeLists.txt 2014-01-11 01:08:53 UTC (rev 2871) @@ -12,9 +12,9 @@
PROJECT( SLIC ) # project version
-SET( SLIC_VERSION_MAJOR 3 ) -SET( SLIC_VERSION_MINOR 1 ) -SET( SLIC_VERSION_PATCH 4 )
+SET( SLIC_VERSION_MAJOR 4 ) +SET( SLIC_VERSION_MINOR 0 ) +SET( SLIC_VERSION_PATCH 0 )
# option for enabling and disabling the logging system OPTION( ENABLE_SLIC_LOG "enable slic logging system" ON )
@@ -80,7 +80,7 @@
IF ( NOT HEPPDT_FOUND ) MESSAGE( FATAL_ERROR "HEPPDT was not found!" ) ELSE()
- MESSAGE( STATUS "Found HEPPDT: ${HEPPDT_ROOT}" )
+ MESSAGE( STATUS "Found HEPPDT: ${HEPPDT_DIR}" )
ENDIF() # configure files
--- projects/slic/branches/v00-00-01_SLIC-218-dev/include/MCParticleManager.hh 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/include/MCParticleManager.hh 2014-01-11 01:08:53 UTC (rev 2871) @@ -19,7 +19,7 @@
namespace slic {
-typedef map<G4int, MCParticle*> MCParticle2TrackIDMap_type;
+typedef map<G4int, MCParticle*> MCParticle2TrackIDMap;
class MCParticleManager : public Singleton<MCParticleManager> {
@@ -56,7 +56,7 @@
private:
- MCParticle2TrackIDMap_type _mcpMap;
+ MCParticle2TrackIDMap _mcpMap;
LCCollectionVec* _mcpVec; };
--- projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackManager.hh 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackManager.hh 2014-01-11 01:08:53 UTC (rev 2871) @@ -26,6 +26,7 @@
TrackManager() : Module("TrackManager") { _trackSummaries = new TrackSummaryVector;
+ _trackSummaryMap = new TrackSummaryMap;
} virtual ~TrackManager() {
@@ -42,17 +43,33 @@
_trackSummaries->clear(); }
- void saveTracks(const G4Event*, LCEvent*);
+ void saveTrackSummaries(const G4Event*, LCEvent*);
void clearTrackSummaries() {
+ /* Clear the vector. */
for (TrackSummaryVector::iterator it = _trackSummaries->begin(); it != _trackSummaries->end(); it++) { delete *it; } _trackSummaries->clear();
+ + /* Clear the map. */ + _trackSummaryMap->clear();
}
+ TrackSummaryMap* getTrackSummaryMap() { + return _trackSummaryMap; + } + + void registerTrackSummary(TrackSummary* trackSummary) { + (*_trackSummaryMap)[trackSummary->getTrackID()] = trackSummary; + } + + TrackSummary* findTrackSummary(G4int trackID) { + return (*_trackSummaryMap)[trackID]; + } +
private: TrackSummary* findFirstSavedAncestor(TrackSummary* trackSummary);
@@ -60,7 +77,7 @@
private: TrackSummaryVector* _trackSummaries;
-
+ TrackSummaryMap* _trackSummaryMap;
}; }
--- projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackSummary.hh 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackSummary.hh 2014-01-11 01:08:53 UTC (rev 2871) @@ -21,7 +21,10 @@
namespace slic { class TrackSummary;
+class TrackManager; +
typedef std::vector<TrackSummary*> TrackSummaryVector;
+typedef std::map<G4int, TrackSummary*> TrackSummaryMap;
class TrackSummary {
@@ -114,11 +117,11 @@
void setParentToBeSaved(); MCParticleImpl* getMCParticle() {
- return _theMCParticle;
+ return _mcparticle;
} void setMCParticle(MCParticleImpl* mcp) {
- _theMCParticle = mcp;
+ _mcparticle = mcp;
} void buildMCParticle();
@@ -147,9 +150,10 @@
G4int _parentTrackID; G4double _trackLength;
- MCParticleImpl* _theMCParticle;
+ MCParticleImpl* _mcparticle;
G4bool _mcParticleIsUpToDate;
+ static TrackManager* m_trackManager;
}; extern G4Allocator<TrackSummary> TrackSummaryAllocator;
--- projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackUtil.hh 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/include/TrackUtil.hh 2014-01-11 01:08:53 UTC (rev 2871) @@ -40,10 +40,22 @@
* @return The UserTrackInformation that was created for the track. */ static UserTrackInformation* setupUserTrackInformation(const G4Track* track, G4bool save) {
+ + /* Create new TrackSummary. */
TrackSummary* trackSummary = new TrackSummary(track, save);
+ + /* Add it to the master list. */
TrackManager::instance()->getTrackSummaries()->push_back(trackSummary);
+ + /* Associate it to its track ID. */ + (*TrackManager::instance()->getTrackSummaryMap())[track->GetTrackID()] = trackSummary; + + /* Create new UserTrackInformation. */
UserTrackInformation* trackInfo = new UserTrackInformation(trackSummary);
+ + /* Set the UserTrackInformation on the track. */
((G4Track*) track)->SetUserInformation(trackInfo);
+
return trackInfo; }
--- projects/slic/branches/v00-00-01_SLIC-218-dev/include/UserTrackInformation.hh 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/include/UserTrackInformation.hh 2014-01-11 01:08:53 UTC (rev 2871) @@ -41,16 +41,16 @@
TrackSummary* _trackSummary; };
-extern G4Allocator<UserTrackInformation> TrackInformationAllocator;
+extern G4Allocator<UserTrackInformation> UserTrackInformationAllocator;
inline void* UserTrackInformation::operator new(size_t) { void* trackInfo;
- trackInfo = (void*) TrackInformationAllocator.MallocSingle();
+ trackInfo = (void*) UserTrackInformationAllocator.MallocSingle();
return trackInfo; } inline void UserTrackInformation::operator delete(void *trackInfo) {
- TrackInformationAllocator.FreeSingle((UserTrackInformation*) trackInfo);
+ UserTrackInformationAllocator.FreeSingle((UserTrackInformation*) trackInfo);
} }
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/EventAction.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/EventAction.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -30,6 +30,9 @@
void EventAction::BeginOfEventAction(const G4Event *anEvent) {
+ // Reset the global TrackSummaryVector used for MCParticle output. + TrackManager::instance()->resetTrackSummaries(); +
/* Clear the MCParticle map from last event. */ MCParticleManager::instance()->clearMap();
@@ -40,7 +43,7 @@
void EventAction::EndOfEventAction(const G4Event *anEvent) { /* Save track information to MCParticle collection in LCIO output event. */
- TrackManager::instance()->saveTracks(anEvent, LcioManager::instance()->getCurrentLCEvent());
+ TrackManager::instance()->saveTrackSummaries(anEvent, LcioManager::instance()->getCurrentLCEvent());
// check aborted if (!SlicApplication::instance()->isAborting()) {
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/RunAction.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/RunAction.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -33,9 +33,6 @@
printBeginOfRunMessage( aRun ); #endif
- // Reset the global TrackSummaryVector used for MCParticle output. - TrackManager::instance()->resetTrackSummaries(); -
// Execute LcioManager's beginRun action. LcioManager::instance()->beginRun(aRun);
@@ -54,10 +51,6 @@
// LcioManager's action LcioManager::instance()->endRun(run);
- std::cout << "TrackManager has " - << TrackManager::instance()->getTrackSummaries()->size() - << " TrackSummary objects at end of run." << std::endl; -
// event source mgr EventSourceManager::instance()->endRun(run);
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/RunManager.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/RunManager.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -34,7 +34,7 @@
SetUserAction(new RunAction); SetUserAction(new EventAction); SetUserAction(new TrackingAction);
- SetUserAction(new SteppingAction);
+ //SetUserAction(new SteppingAction);
m_userActionsInitialized = true; }
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackManager.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackManager.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -16,7 +16,7 @@
namespace slic {
-void TrackManager::saveTracks(const G4Event* anEvent, LCEvent* lcEvent) {
+void TrackManager::saveTrackSummaries(const G4Event* anEvent, LCEvent* lcEvent) {
StdHepGenerator::LCIO2Geant4MapIterator it;
@@ -45,11 +45,10 @@
/* Get the MCParticle collection created by event generation. */ LCCollectionVec* mcpVec = MCParticleManager::instance()->getMCParticleCollection();
+ /* Save TrackSummary objects to LCIO collection. */
#ifdef SLIC_LOG
-
+ log() << LOG::always << "TrackManager processing " << _trackSummaries->size() << " TrackSummary objects." << LOG::done;
#endif
- - /* Save TrackSummary objects to LCIO collection. */
size_t l; TrackSummary* trackSummary; for (l = 0; l < _trackSummaries->size(); l++) {
@@ -88,6 +87,11 @@
/* Save the MCParticle collection into the event. */ lcEvent->addCollection((LCCollection*)mcpVec, "MCParticle");
+ +#ifdef SLIC_LOG + log() << LOG::always << "Saved " << mcpVec->getNumberOfElements() << " MCParticles." << LOG::done; +#endif +
} TrackSummary* TrackManager::findFirstSavedAncestor(TrackSummary* trackSummary) {
@@ -105,5 +109,4 @@
return parent; }
-
}
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackSummary.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackSummary.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -20,125 +20,118 @@
G4Allocator<TrackSummary> TrackSummaryAllocator;
+TrackManager* TrackSummary::m_trackManager = TrackManager::instance(); +
TrackSummary::TrackSummary(const G4Track* track, G4bool save, G4bool backScattering) :
- _parent(NULL), _save(save), _backScattering(backScattering), _theMCParticle(NULL), - _mcParticleIsUpToDate(false) {
+ _parent(NULL), _save(save), _backScattering(backScattering), _mcparticle(NULL), _mcParticleIsUpToDate(false) { + + /* Set information of track that is immutable. */
_charge = track->GetDefinition()->GetPDGCharge(); _mass = track->GetDynamicParticle()->GetMass(); _PDG = track->GetDefinition()->GetPDGEncoding(); _trackID = track->GetTrackID(); _parentTrackID = track->GetParentID();
+ + /* The momentum appears to be set correctly before tracking occurs so set here along with energy. */ + _momentum = track->GetMomentum(); + _energy = track->GetTotalEnergy();
} void TrackSummary::update(const G4Track* track) {
- // TODO: These need to be checked. - _momentum = track->GetVertexMomentumDirection(); - _energy = track->GetTotalEnergy(); // or kinetic E?
+ /* Set the vertex position. */
_vertex = track->GetVertexPosition();
- // update final track information
+ /* Set the end point. */
_endPoint = track->GetPosition();
+ + /* Set the track lenght. */
_trackLength = track->GetTrackLength();
- // hepEvtStatus == generator status in LCIO
+ /* Set the generator status. */
_hepEvtStatus = 0; if (_parentTrackID == 0) {
- const G4DecayProducts* thePreAssignedDecayProducts = track->GetDynamicParticle()->GetPreAssignedDecayProducts(); - if (thePreAssignedDecayProducts && thePreAssignedDecayProducts->entries() > 0)
+ const G4DecayProducts* preAssignedDecayProducts = track->GetDynamicParticle()->GetPreAssignedDecayProducts(); + if (preAssignedDecayProducts && preAssignedDecayProducts->entries() > 0)
_hepEvtStatus = 2; else _hepEvtStatus = 1; }
+ /* Initialize sim status. */ + _simstatus = 0; + + /* + * TODO: All settings after here in this function should be checked for correctness. + */ +
// Setting the simulator status as for LCIO, by the moment by hand // just adapting the beta LCIO code. // Remarks: // - with Mokka BITVertexIsNotEndpointOfParent is always false // because the endpoint is set always explicitly.
- // - BITDecayedInTracker and BITDecayedInCalorimeter not - // set, waiting for better understand about these bits. - // - _simstatus = 0; -
// endpoint always set explicitly by Mokka. _simstatus[MCParticle::BITEndpoint] = 1;
- // these folowwing pointers should always be not NULL but - // with Geant4 we never know... - // - const G4Step* theLastStep = track->GetStep(); - G4StepPoint* theLastPostStepPoint = NULL; - if(theLastStep) - theLastPostStepPoint = theLastStep->GetPostStepPoint();
+ /* + * Get the last step point. + */ + const G4Step* lastStep = track->GetStep(); + G4StepPoint* lastPostStepPoint = NULL; + if (lastStep) + lastPostStepPoint = lastStep->GetPostStepPoint();
// BITCreatedInSimulation and BITBackscatter has no sense except // if created by simulator.
- if(_hepEvtStatus == 0) - {
+ if (_hepEvtStatus == 0) {
//fg: BITCreatedInSimulation should only be set if MCParticle has been created // by Mokka/geant4 - now done in BuildMCParticle // _simstatus[ BITCreatedInSimulation ] = 1;
- if(getBackScattering()) _simstatus[MCParticle::BITBackscatter] = 1;
+ if (getBackScattering()) + _simstatus[MCParticle::BITBackscatter] = 1;
} // BITLeftDetector
- G4bool LeftDetector = false;
+ G4bool leftDetector = false;
//
- if(theLastPostStepPoint) - // - // Thanks to Predrag Krstonosic ([log in to unmask]) we realize that Geant4 never - // sets the fWorldBoundary step status even when the particle is leaving the detector - // world volume. As a turn around fix while Geant4 does't work correctly we - // replaced the test - // - // LeftDetector = (theLastPostStepPoint->GetStepStatus() == fWorldBoundary)) - // - // by - // - // LeftDetector = (theLastPostStepPoint->GetStepStatus() == fGeomBoundary)) - // - // in the TrackSummary::update() method. We suppose that normaly a track doens't - // finish in a Geometry boundary except if it's leaving the detector world volume, - // so it should works nice for the moment. - // - if((LeftDetector = (theLastPostStepPoint->GetStepStatus() == fGeomBoundary)))
+ if (lastPostStepPoint) + /** + * A Track will not be in geometry boundary unless it has left the world volume. + */ + if ((leftDetector = (lastPostStepPoint->GetStepStatus() == fGeomBoundary)))
_simstatus[MCParticle::BITLeftDetector] = 1; // BITStopped
- if(track->GetKineticEnergy() <= 0.) - _simstatus[ MCParticle::BITStopped] = 1;
+ if (track->GetKineticEnergy() <= 0.) + _simstatus[MCParticle::BITStopped] = 1;
G4bool insideTrackerRegion = TrackUtil::getRegionInformation(track)->getStoreSecondaries();
- G4VPhysicalVolume* volume = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->LocateGlobalPointAndSetup(track->GetPosition()); - G4Region* region = volume->GetLogicalVolume()->GetRegion(); - UserRegionInformation* regionInfo = dynamic_cast<UserRegionInformation*>(region->GetUserInformation()); - - if(insideTrackerRegion)
+ if (insideTrackerRegion)
_simstatus[MCParticle::BITDecayedInTracker] = 1; // BITDecayedInCalorimeter
- if(!insideTrackerRegion && !LeftDetector)
+ if (!insideTrackerRegion && !leftDetector)
_simstatus[MCParticle::BITDecayedInCalorimeter] = 1; // BITVertexIsNotEndpointOfParent // TrackSummary* myParent = findParent();
- if(myParent) - if(myParent->getEndPoint().isNear(getVertex())) - _simstatus[MCParticle::BITVertexIsNotEndpointOfParent] = 1;
+ if (myParent) + if (myParent->getEndPoint().isNear(getVertex())) + _simstatus[MCParticle::BITVertexIsNotEndpointOfParent] = 1;
} void TrackSummary::setParentToBeSaved() {
- if(!(_theMCParticle && _mcParticleIsUpToDate))
+ if (!(_mcparticle && _mcParticleIsUpToDate))
buildMCParticle(); else // In LCIO mode, if the theMCParticle exists we have already // passed by here. return;
+ // TODO: Check if this is being called and must be called...
TrackSummary* myParent = findParent(); if (myParent) {
@@ -147,65 +140,56 @@
myParent->_save = true; myParent->setParentToBeSaved();
- MCParticle* theParentMCParticle = myParent->getMCParticle();
+ MCParticle* theParentMCParticle = myParent->getMCParticle();
- // fg: need to check if particle already has this parent assigned ... - // this will be fixed in a future (>1.6) LCIO version - const MCParticleVec& parents = _theMCParticle->getParents();
+ // fg: need to check if particle already has this parent assigned ... + // this will be fixed in a future (>1.6) LCIO version
- if(std::find(parents.begin(), - parents.end(), - theParentMCParticle ) == parents.end() ) {
+ const MCParticleVec& parents = _mcparticle->getParents();
- // fix B.Vormwald: only add parent if particlke created in simulation - if (_theMCParticle->getGeneratorStatus()== 0) { - _theMCParticle->addParent( theParentMCParticle ); - }
+ if (std::find(parents.begin(), parents.end(), theParentMCParticle) == parents.end()) { + + // fix B.Vormwald: only add parent if particlke created in simulation + if (_mcparticle->getGeneratorStatus() == 0) { + _mcparticle->addParent(theParentMCParticle);
}
+ }
} } TrackSummary* TrackSummary::findParent() const {
- TrackSummary* trackSummary = NULL;
+ TrackSummary* trackSummary = 0;
if (_parentTrackID == 0) return trackSummary;
- TrackSummaryVector* tracks = TrackManager::instance()->getTrackSummaries(); - - G4int itr; - for (itr = tracks->size() - 1; itr >= 0; itr--) { - trackSummary = (*tracks)[itr]; - if (trackSummary && trackSummary->getTrackID() == _parentTrackID) - break; - } - return trackSummary;
+ return m_trackManager->findTrackSummary(_parentTrackID);
} void TrackSummary::buildMCParticle() { // if we have an MCParticle already we just need to update it // otherwise we need to create one ...
- if( _theMCParticle == 0 ) { - _theMCParticle = new MCParticleImpl;
+ if (_mcparticle == 0) { + _mcparticle = new MCParticleImpl;
_simstatus[MCParticle::BITCreatedInSimulation] = 1; // created in simulation
- _theMCParticle->setGeneratorStatus(getHepEvtStatus()); - _theMCParticle->setPDG(getPDG());
+ _mcparticle->setGeneratorStatus(getHepEvtStatus()); + _mcparticle->setPDG(getPDG());
}
- _theMCParticle->setCharge(getCharge());
+ _mcparticle->setCharge(getCharge());
/* Set endpoint. */ double endpoint[3]; endpoint[0] = getEndPoint()(0); endpoint[1] = getEndPoint()(1); endpoint[2] = getEndPoint()(2);
- _theMCParticle->setEndpoint(endpoint);
+ _mcparticle->setEndpoint(endpoint);
/* Set mass. */
- _theMCParticle->setMass(_mass / GeV);
+ _mcparticle->setMass(_mass / GeV);
/* Set simulator status. */
- _theMCParticle->setSimulatorStatus(getSimulatorStatus());
+ _mcparticle->setSimulatorStatus(getSimulatorStatus());
/* Set momentum. */ float p[3];
@@ -213,14 +197,14 @@
p[0] = theMomentum(0) / GeV; p[1] = theMomentum(1) / GeV; p[2] = theMomentum(2) / GeV;
- _theMCParticle->setMomentum(p);
+ _mcparticle->setMomentum(p);
/* Set vertex. */ double vertex[3]; vertex[0] = getVertex()(0); vertex[1] = getVertex()(1); vertex[2] = getVertex()(2);
- _theMCParticle->setVertex(vertex);
+ _mcparticle->setVertex(vertex);
/* Set up to date. */ _mcParticleIsUpToDate = true;
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackingAction.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/TrackingAction.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -1,9 +1,6 @@
// $Header: /nfs/slac/g/lcd/cvs/lcdroot/slic/src/TrackingAction.cc,v 1.14 2012-11-27 19:32:19 jeremy Exp $ #include "TrackingAction.hh"
-// LCDD -#include "lcdd/hits/TrackInformation.hh" -
// SLIC #include "TrackUtil.hh" #include "UserTrackInformation.hh"
@@ -16,43 +13,45 @@
void TrackingAction::PreUserTrackingAction(const G4Track* track) { G4bool isPrimary = (track->GetParentID() == 0);
- G4ThreeVector trackPosition = track->GetPosition();
UserRegionInformation* regionInfo = TrackUtil::getRegionInformation(track); G4bool insideTrackerRegion = regionInfo->getStoreSecondaries();
- G4bool decayInsideTracker = false; - TrackInformation* trackInfo = dynamic_cast<TrackInformation*>(track->GetUserInformation());
+ //G4bool decayInsideTracker = false; + UserTrackInformation* trackInfo = dynamic_cast<UserTrackInformation*>(track->GetUserInformation());
/* Track is primary? */
- if (!isPrimary) {
+ //if (!isPrimary) {
/* Inside tracker region? */
- if (insideTrackerRegion) { - const G4VProcess* theCreatorProcess = track->GetCreatorProcess();
+ //if (insideTrackerRegion) { + //const G4VProcess* theCreatorProcess = track->GetCreatorProcess();
/* Decay in tracker? */
- if (theCreatorProcess) - decayInsideTracker = theCreatorProcess->GetProcessName() == "Decay"; - } - }
+ //if (theCreatorProcess) + // decayInsideTracker = theCreatorProcess->GetProcessName() == "Decay"; + //} + //}
+ /* Default setting of not saving this track's information to the LCIO output. */ + G4bool save = false; +
/* Store trajectory? */
- TrackSummary* trackSummary = 0;
if (isPrimary || (insideTrackerRegion && track->GetKineticEnergy() > regionInfo->getThreshold())) {
+ /* These tracks should be saved. */ + save = true; +
/* Turn on trajectory storage in Geant4. */ fpTrackingManager->SetStoreTrajectory(true);
- - /* Setup the UserTrackInformation if it does not exist. */ - if (!trackInfo) { - TrackUtil::setupUserTrackInformation(track, true); - }
} /* Turn off trajectory storing. */ else { fpTrackingManager->SetStoreTrajectory(false);
- /* Setup track information, which will not be saved. */ - TrackUtil::setupUserTrackInformation(track, false);
}
+ + /* Setup the UserTrackInformation if it does not exist. */ + if (!trackInfo) { + TrackUtil::setupUserTrackInformation(track, save); + }
} void TrackingAction::PostUserTrackingAction(const G4Track* track) {
--- projects/slic/branches/v00-00-01_SLIC-218-dev/src/UserTrackInformation.cc 2014-01-11 00:46:42 UTC (rev 2870) +++ projects/slic/branches/v00-00-01_SLIC-218-dev/src/UserTrackInformation.cc 2014-01-11 01:08:53 UTC (rev 2871) @@ -1,6 +1,6 @@
#include "UserTrackInformation.hh" namespace slic {
-G4Allocator<UserTrackInformation> TrackInformationAllocator;
+G4Allocator<UserTrackInformation> UserTrackInformationAllocator;
}
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1