diff --git a/CMakeLists.txt b/CMakeLists.txt index 0707fde0..16b48bc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required( VERSION 3.1 ) # Define the project cmake_policy( SET CMP0048 NEW ) # version in project() -project( locust_mc VERSION 2.8.2) +project( locust_mc VERSION 2.8.3) list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake ) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9689fbd5..27c80ea8 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -175,6 +175,8 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA) Kassiopeia/LMCFieldCalculator.hh Kassiopeia/LMCEventHold.hh Kassiopeia/LMCEventHoldBuilder.hh + Kassiopeia/LMCTrackHold.hh + Kassiopeia/LMCTrackHoldBuilder.hh Kassiopeia/LMCKassLocustInterface.hh Kassiopeia/LMCRunKassiopeia.hh Kassiopeia/LMCRunPause.hh @@ -211,6 +213,8 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA) Kassiopeia/LMCFieldCalculator.cc Kassiopeia/LMCEventHold.cc Kassiopeia/LMCEventHoldBuilder.cc + Kassiopeia/LMCTrackHold.cc + Kassiopeia/LMCTrackHoldBuilder.cc Kassiopeia/LMCKassLocustInterface.cc Kassiopeia/LMCRunKassiopeia.cc Kassiopeia/LMCRunPause.cc diff --git a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc index 9ebbb7fc..3a31e748 100644 --- a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc +++ b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc @@ -208,7 +208,7 @@ namespace locust double dt = aFinalParticle.GetTime() - anInitialParticle.GetTime(); fFieldCalculator->SetNFilterBinsRequired( dt ); UpdateTrackProperties( aFinalParticle, fInterface->fSampleIndex, 1 ); - LPROG(lmclog,"Updated track properties at sample " << fInterface->fSampleIndex ); + LPROG(lmclog,"Updated recorded track properties at sample " << fInterface->fSampleIndex ); } @@ -270,7 +270,7 @@ namespace locust LPROG(lmclog,"Checking the digitizer synchronization, tTriggerConfirm index = " << tTriggerConfirm ); } - if ( ( tTriggerConfirm > fInterface->fTriggerConfirm - 3) && ( fSampleIndex < fInterface->fFastRecordLength ) ) + if ( ( tTriggerConfirm > fInterface->fTriggerConfirm - 3) && ( fSampleIndex < fInterface->fFastRecordLength-1 ) ) { LPROG(lmclog,"Checking the digitizer synchronization, tTriggerConfirm index = " << tTriggerConfirm); LPROG(lmclog,"Checking the digitizer synchronization, at fast sample = " << fSampleIndex); diff --git a/Source/Kassiopeia/LMCTrackHold.cc b/Source/Kassiopeia/LMCTrackHold.cc new file mode 100644 index 00000000..125ce0f6 --- /dev/null +++ b/Source/Kassiopeia/LMCTrackHold.cc @@ -0,0 +1,85 @@ +/* + * LMCTrackHold.cc + * + * Created on: Apr 25, 2024 + * Author: pslocum + */ + +#include "logger.hh" +#include "LMCTrackHold.hh" + + +namespace locust +{ + + LOGGER( lmclog, "TrackHold" ); + + TrackHold::TrackHold() : + fTrackCounter( 0 ), + fInterface( KLInterfaceBootstrapper::get_instance()->GetInterface() ) + {} + + + TrackHold::TrackHold( const TrackHold& aOrig ) : KSComponent(), + fTrackCounter( 0 ), + fInterface( aOrig.fInterface ) + {} + + + TrackHold::~TrackHold() + { + } + + TrackHold* TrackHold::Clone() const + { + return new TrackHold( *this ); + } + + bool TrackHold::ConfigureByInterface() + { + + if (fInterface->fConfigureKass) + { + const scarab::param_node* aParam = fInterface->fConfigureKass->GetParameters(); + if (!this->Configure( *aParam )) + { + LERROR(lmclog,"Error configuring TrackHold class"); + return false; + } + } + else + { + LPROG(lmclog,"TrackHold class did not need to be configured."); + return true; + } + return true; + } + + bool TrackHold::Configure( const scarab::param_node& aParam ) + { + return true; + } + + + bool TrackHold::ExecutePreTrackModification(Kassiopeia::KSTrack &aTrack) + { + double tPitchAngle = aTrack.GetInitialParticle().GetPolarAngleToB(); + LWARN(lmclog,"LMCTrack " << fTrackCounter << " is starting, with instantaneous pitch angle " << tPitchAngle); + return true; + } + + bool TrackHold::ExecutePostTrackModification(Kassiopeia::KSTrack &aTrack) + { + double tPitchAngle = aTrack.GetFinalParticle().GetPolarAngleToB(); + double tTime = aTrack.GetFinalParticle().GetTime(); + LWARN(lmclog,"LMCTrack " << fTrackCounter << " is complete at Kass time " << tTime << ", with instantaneous pitch angle " << tPitchAngle); + fTrackCounter += 1; + return true; + } + + + + + + +} // namespace locust diff --git a/Source/Kassiopeia/LMCTrackHold.hh b/Source/Kassiopeia/LMCTrackHold.hh new file mode 100644 index 00000000..18edceac --- /dev/null +++ b/Source/Kassiopeia/LMCTrackHold.hh @@ -0,0 +1,56 @@ +/* + * LMCTrackHoldBuilder.cc + * + * Created on: Apr 25, 2024 + * Author: pslocum + */ + + +#ifndef LOCUST_LMCTRACKHOLD_HH_ +#define LOCUST_LMCTRACKHOLD_HH_ + +#include "KSTrackModifier.h" +#include "KSTrack.h" + +#include "KSComponentTemplate.h" +#include "LMCKassLocustInterface.hh" + + +namespace locust +{ + + class TrackHold : + public Kassiopeia::KSComponentTemplate< TrackHold, Kassiopeia::KSTrackModifier > + { + public: + TrackHold(); + TrackHold( const TrackHold& aOrig ); + virtual ~TrackHold(); + TrackHold* Clone() const; + + bool ConfigureByInterface(); + bool Configure( const scarab::param_node& aParam ); + + + + + public: + + virtual bool ExecutePreTrackModification(Kassiopeia::KSTrack &aTrack); + virtual bool ExecutePostTrackModification(Kassiopeia::KSTrack &aTrack); + + protected: + kl_interface_ptr_t fInterface; + + private: + + int fTrackCounter; + + +}; + +} /* namespace locust */ + + + +#endif diff --git a/Source/Kassiopeia/LMCTrackHoldBuilder.cc b/Source/Kassiopeia/LMCTrackHoldBuilder.cc new file mode 100644 index 00000000..cdb4dbe8 --- /dev/null +++ b/Source/Kassiopeia/LMCTrackHoldBuilder.cc @@ -0,0 +1,27 @@ +/* + * LMCTrackHoldBuilder.cc + * + * Created on: Apr 25, 2024 + * Author: pslocum + */ + +#include "LMCTrackHoldBuilder.hh" + +#include "KSRootBuilder.h" + +template< > +locust::TrackHoldBuilder::~KComplexElement() +{ +} + +namespace locust +{ + + STATICINT SLMCTrackHoldStructure = + locust::TrackHoldBuilder::Attribute< std::string >( "name" ); + + STATICINT sLMCTrackHold = + katrin::KSRootBuilder::ComplexElement< locust::TrackHold >( "mod_track_hold" ); + +} /* namespace locust */ + diff --git a/Source/Kassiopeia/LMCTrackHoldBuilder.hh b/Source/Kassiopeia/LMCTrackHoldBuilder.hh new file mode 100644 index 00000000..eb4b2859 --- /dev/null +++ b/Source/Kassiopeia/LMCTrackHoldBuilder.hh @@ -0,0 +1,34 @@ +/* + * LMCTrackHoldBuilder.hh + * + * Created on: Mar 13, 2016 + * Author: nsoblath + */ + +#ifndef LOCUST_LMCTRACKHOLDBUILDER_HH_ +#define LOCUST_LMCTRACKHOLDBUILDER_HH_ + +#include "KComplexElement.hh" + +#include "LMCTrackHold.hh" + +namespace locust +{ + + typedef katrin::KComplexElement< locust::TrackHold > TrackHoldBuilder; + +} /* namespace locust */ + +template< > +inline bool locust::TrackHoldBuilder::AddAttribute(KContainer *aContainer) +{ + if( aContainer->GetName() == "name" ) + { + aContainer->CopyTo( fObject, &KNamed::SetName ); + return true; + } + return false; +} + + +#endif /* LOCUST_LMCTRACKHOLDBUILDER_HH_ */