Skip to content

Commit

Permalink
Merge pull request project8#6 from project8/revert-5-feature/eventmod
Browse files Browse the repository at this point in the history
Revert "Feature/eventmod"
  • Loading branch information
pslocum authored Jun 16, 2017
2 parents ae0e94e + 3bc2725 commit 6660bd5
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 106 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( Kasper )

Expand Down
10 changes: 4 additions & 6 deletions KEMField/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if( POLICY CMP0053 )
cmake_policy( SET CMP0053 OLD )
endif( POLICY CMP0053 )

project(KEMField)
include(KasperDefaults)

if(POLICY CMP0053)
cmake_policy(SET CMP0053 OLD)
endif()

# Module version
set(MODULE_VERSION_MAJOR 2)
set(MODULE_VERSION_MINOR 1)
Expand Down
3 changes: 0 additions & 3 deletions KGeoBag/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( KGeoBag )
include( KasperDefaults )
Expand Down
2 changes: 0 additions & 2 deletions Kassiopeia/Bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ set( BINDINGS_HEADER_FILES
# simulation
Simulation/Include/KSRootMagneticFieldBuilder.h
Simulation/Include/KSRootElectricFieldBuilder.h
Simulation/Include/KSRootEventModifierBuilder.h
Simulation/Include/KSRootGeneratorBuilder.h
Simulation/Include/KSRootTrajectoryBuilder.h
Simulation/Include/KSRootSpaceInteractionBuilder.h
Expand Down Expand Up @@ -372,7 +371,6 @@ set( BINDINGS_SOURCE_FILES
# simulation
Simulation/Source/KSRootMagneticFieldBuilder.cxx
Simulation/Source/KSRootElectricFieldBuilder.cxx
Simulation/Source/KSRootEventModifierBuilder.cxx
Simulation/Source/KSRootGeneratorBuilder.cxx
Simulation/Source/KSRootTrajectoryBuilder.cxx
Simulation/Source/KSRootSpaceInteractionBuilder.cxx
Expand Down
10 changes: 4 additions & 6 deletions Kassiopeia/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
# thank you! -dan.

cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if( POLICY CMP0053 )
cmake_policy( SET CMP0053 OLD )
endif( POLICY CMP0053 )

project( Kassiopeia )
include( KasperDefaults )

if(POLICY CMP0053)
cmake_policy(SET CMP0053 OLD)
endif()

# module version
set( MODULE_VERSION_MAJOR 3 )
set( MODULE_VERSION_MINOR 3 )
Expand Down
2 changes: 0 additions & 2 deletions Kassiopeia/Operators/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# header files
set( OPERATORS_HEADER_BASENAMES
KSEventModifier.h
KSOperatorsMessage.h
KSParticle.h
KSParticleFactory.h
Expand Down Expand Up @@ -31,7 +30,6 @@ endforeach( BASENAME )

# source files
set( OPERATORS_SOURCE_BASENAMES
KSEventModifier.cxx
KSOperatorsMessage.cxx
KSParticle.cxx
KSParticleFactory.cxx
Expand Down
5 changes: 1 addition & 4 deletions Kassiopeia/Operators/Include/KSEventModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace Kassiopeia
{

class KSEvent;

class KSEventModifier:
Expand All @@ -17,14 +16,12 @@ namespace Kassiopeia

public:


//returns true if any of the state variables of anEvent are changed
virtual bool ExecutePreEventModification( KSEvent& anEvent ) = 0;

//returns true if any of the state variables of anEvent are changed
virtual bool ExecutePostEventModification( KSEvent& anEvent ) = 0;

};
};

}

Expand Down
2 changes: 0 additions & 2 deletions Kassiopeia/Simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set( SIMULATION_HEADER_BASENAMES
KSTrack.h
KSStep.h
KSRootElectricField.h
KSRootEventModifier.h
KSRootMagneticField.h
KSRootStepModifier.h
KSRootTrackModifier.h
Expand Down Expand Up @@ -48,7 +47,6 @@ set( SIMULATION_SOURCE_BASENAMES
KSTrack.cxx
KSStep.cxx
KSRootElectricField.cxx
KSRootEventModifier.cxx
KSRootMagneticField.cxx
KSRootStepModifier.cxx
KSRootTrackModifier.cxx
Expand Down
3 changes: 1 addition & 2 deletions Kassiopeia/Simulation/Include/KSRootEventModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace Kassiopeia
//**********

public:

bool ExecutePreEventModification( KSEvent& anEvent );
bool ExecutePostEventModification( KSEvent& anEvent );

Expand All @@ -46,7 +45,6 @@ namespace Kassiopeia
//******

public:

void SetEvent( KSEvent* anEvent );

bool ExecutePreEventModification();
Expand All @@ -56,6 +54,7 @@ namespace Kassiopeia
virtual void PushDeupdateComponent();

private:

KSEvent* fEvent;
};

Expand Down
1 change: 0 additions & 1 deletion Kassiopeia/Simulation/Include/KSStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Kassiopeia
public:
K_REFS( std::string, TerminatorName )
K_REFS( bool, TerminatorFlag )
K_REFS( bool, PauseFlag ); // pls addition.

//**********
//trajectory
Expand Down
64 changes: 7 additions & 57 deletions Kassiopeia/Simulation/Source/KSRoot.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#include "LMCGlobalsDeclaration.hh" // pls addition
#include "LMCGlobalsDefinition.hh" // pls addition

#include "KSRoot.h"
#include "KSRunMessage.h"
#include "KSEventMessage.h"
Expand Down Expand Up @@ -265,6 +262,9 @@ namespace Kassiopeia
}
KSRoot::~KSRoot()
{
/*
* KToolbox takes care of destruction
*/
}

void KSRoot::Execute( KSSimulation* aSimulation )
Expand Down Expand Up @@ -379,42 +379,6 @@ namespace Kassiopeia
return;
}



void WakeAfterEvent(unsigned TotalEvents, unsigned EventsSoFar)
{
fEventInProgress = false;
if( TotalEvents == EventsSoFar-1 )
{
fRunInProgress = false;
fKassReadyCondition.notify_one();
}
fDigitizerCondition.notify_one(); // unlock
printf("Kass is waking after event\n");
return;
}



bool ReceivedEventStartCondition()
{
fKassEventReady = true;
fDigitizerCondition.notify_one(); // unlock if still locked.
if( fWaitBeforeEvent )
{

fKassReadyCondition.notify_one();
std::unique_lock< std::mutex >tLock( fMutex );
fPreEventCondition.wait( tLock );
fKassEventReady = false;
t_old = 0.; // reset time on digitizer.
return true;
}
return true; // check this. should return true if no wait.
}



void KSRoot::ExecuteRun()
{
// set random seed
Expand Down Expand Up @@ -459,17 +423,8 @@ namespace Kassiopeia
fEvent->ParentRunId() = fRun->GetRunId();

// execute event
printf("Kass is waiting for event trigger.\n");
if (ReceivedEventStartCondition())
{
// printf("testvar is %f\n", testvar); // pls
printf("Kass got the event trigger\n"); //getchar(); // pls
}

ExecuteEvent();

WakeAfterEvent(fRun->GetTotalEvents(), fSimulation->GetEvents()); // pls

// update run
fRun->TotalEvents() += 1;
fRun->TotalTracks() += fEvent->TotalTracks();
Expand All @@ -496,6 +451,7 @@ namespace Kassiopeia

// send report
runmsg( eNormal ) << "...run " << fRun->GetRunId() << " complete" << eom;

fStopRunSignal = false;
return;
}
Expand Down Expand Up @@ -523,9 +479,6 @@ namespace Kassiopeia
// generate primaries
fRootGenerator->ExecuteGeneration();

// execute post-step modification
fRootEventModifier->ExecutePreEventModification();

// send report
eventmsg( eNormal ) << "processing event " << fEvent->GetEventId() << " <" << fEvent->GetGeneratorName() << ">..." << eom;

Expand Down Expand Up @@ -555,6 +508,7 @@ namespace Kassiopeia
delete tParticle;
fEvent->ParticleQueue().pop_front();

// execute a track
ExecuteTrack();

// move particles in track queue to event queue
Expand Down Expand Up @@ -597,7 +551,6 @@ namespace Kassiopeia

void KSRoot::ExecuteTrack()
{

// reset track
fTrack->TrackId() = fTrackIndex;
fTrack->TotalSteps() = 0;
Expand Down Expand Up @@ -668,7 +621,6 @@ namespace Kassiopeia
fTrack->DiscreteEnergyChange() += fStep->DiscreteEnergyChange();
fTrack->DiscreteMomentumChange() += fStep->DiscreteMomentumChange();
fTrack->DiscreteSecondaries() += fStep->DiscreteSecondaries();

}
}

Expand Down Expand Up @@ -741,17 +693,15 @@ namespace Kassiopeia
fStep->SurfaceNavigationFlag() = false;

// send report
/*
if( fStep->GetStepId() % fSimulation->GetStepReportIteration() == 0 )
{
stepmsg( eNormal ) << "processing step " << fStep->GetStepId() << "... (";
stepmsg << "z = " << fStep->InitialParticle().GetPosition().Z() << ", ";
stepmsg( eNormal ) << "processing step " << fStep->GetStepId() << "... (";
stepmsg << "z = " << fStep->InitialParticle().GetPosition().Z() << ", ";
stepmsg << "r = " << fStep->InitialParticle().GetPosition().Perp() << ", ";
stepmsg << "k = " << fStep->InitialParticle().GetKineticEnergy_eV() << ", ";
stepmsg << "e = " << fStep->InitialParticle().GetKineticEnergy_eV() + (fStep->InitialParticle().GetCharge() / KConst::Q()) * fStep->InitialParticle().GetElectricPotential();
stepmsg << ")" << reom;
}
*/

// debug spritz
stepmsg_debug( "processing step " << fStep->GetStepId() << eom )
Expand Down
3 changes: 0 additions & 3 deletions Kassiopeia/Trajectories/Source/KSTrajTrajectoryAdiabatic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ namespace Kassiopeia
{
}



void KSTrajTrajectoryAdiabatic::SetIntegrator( KSTrajAdiabaticIntegrator* anIntegrator )
{
if( fIntegrator == NULL )
Expand All @@ -64,7 +62,6 @@ namespace Kassiopeia
trajmsg( eError ) << "cannot set integrator in <" << this->GetName() << "> with <" << anIntegrator << ">" << eom;
return;
}

void KSTrajTrajectoryAdiabatic::ClearIntegrator( KSTrajAdiabaticIntegrator* anIntegrator )
{
if( fIntegrator == anIntegrator )
Expand Down
3 changes: 0 additions & 3 deletions Kommon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
cmake_minimum_required( VERSION 2.8.6 )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

project( Kommon )
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/GoogleTest/cmake )
Expand Down
7 changes: 0 additions & 7 deletions Kommon/Core/Initialization/KVariableProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ namespace katrin
delete fLocalMap;
}

void KVariableProcessor::SetExternalMap( const VariableMap& anExternalMap )
{
delete fExternalMap;
fExternalMap = new VariableMap( anExternalMap );
return;
}

void KVariableProcessor::ProcessToken( KBeginFileToken* aToken )
{
if( fElementState == eElementInactive )
Expand Down
2 changes: 0 additions & 2 deletions Kommon/Core/Initialization/KVariableProcessor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ namespace katrin
KVariableProcessor( const VariableMap& anExternalMap );
virtual ~KVariableProcessor();

void SetExternalMap( const VariableMap& anExternalMap );

virtual void ProcessToken( KBeginFileToken* aToken );
virtual void ProcessToken( KBeginElementToken* aToken );
virtual void ProcessToken( KBeginAttributeToken* aToken );
Expand Down
5 changes: 2 additions & 3 deletions Kommon/cmake/KasperDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ endmacro(set_path)
include(CMakeDependentOption)
include(MacroParseArguments)

cmake_policy( SET CMP0011 NEW )
if( ${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} )

if( "${Kasper_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}" )
set(STANDALONE true)

# use this section to modifiy initial values of builtin CMAKE variables
Expand Down Expand Up @@ -177,7 +176,7 @@ macro(kasper_find_module NAME)
set( VERSION "0" )
endif()

find_package( ${NAME} ${VERSION} REQUIRED NO_MODULE HINTS ${Kasper_BINARY_DIR}/${NAME} )
find_package( ${NAME} ${VERSION} REQUIRED NO_MODULE )
#message("${NAME}_INCLUDE_DIRS: ${${NAME}_INCLUDE_DIRS}")
kasper_internal_include_directories( ${${NAME}_INCLUDE_DIRS} )
#kasper_external_include_directories( ${${NAME}_INCLUDE_DIRS} )
Expand Down

0 comments on commit 6660bd5

Please sign in to comment.