Skip to content

Commit

Permalink
Merge pull request #314 from project8/feature/testScattering
Browse files Browse the repository at this point in the history
expand event types
  • Loading branch information
pslocum authored Apr 29, 2024
2 parents 6640344 + 4755c70 commit 04a9506
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
4 changes: 4 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}


Expand Down Expand Up @@ -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);
Expand Down
85 changes: 85 additions & 0 deletions Source/Kassiopeia/LMCTrackHold.cc
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions Source/Kassiopeia/LMCTrackHold.hh
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions Source/Kassiopeia/LMCTrackHoldBuilder.cc
Original file line number Diff line number Diff line change
@@ -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 */

34 changes: 34 additions & 0 deletions Source/Kassiopeia/LMCTrackHoldBuilder.hh
Original file line number Diff line number Diff line change
@@ -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_ */

0 comments on commit 04a9506

Please sign in to comment.