Skip to content

Commit

Permalink
Merge pull request #142 from project8/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pslocum authored Apr 1, 2020
2 parents 383d703 + ce6101d commit b87958a
Show file tree
Hide file tree
Showing 66 changed files with 3,719 additions and 1,637 deletions.
10 changes: 9 additions & 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 1.15.10)
project( locust_mc VERSION 1.15.11)

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake )
include( PackageBuilder )
Expand Down Expand Up @@ -41,6 +41,7 @@ set (LOCUST_MC_INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}/Source/RxComponents/
${CMAKE_CURRENT_SOURCE_DIR}/Source/Transforms/
${CMAKE_CURRENT_SOURCE_DIR}/Source/Core/
${CMAKE_CURRENT_SOURCE_DIR}/Source/Distributions/
${CMAKE_CURRENT_SOURCE_DIR}/Source/Kassiopeia/
)

Expand Down Expand Up @@ -124,6 +125,13 @@ endif (locust_mc_BUILD_WITH_KASSIOPEIA)
# locust dependencies #
#######################

find_package(GSL REQUIRED)
if (GSL_FOUND)
pbuilder_add_ext_libraries( ${GSL_LIBRARIES} )
else (GSL_FOUND)
message(FATAL "GSL not found")
endif (GSL_FOUND)

# FFTW
find_package(FFTW REQUIRED)
if (NOT FFTW_THREADS_FOUND)
Expand Down
1 change: 1 addition & 0 deletions Data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set( LOCUST_MC_DATA_FILES
H2OscillatorStrength.txt
KrOscillatorStrength.txt
KrShakeParameters214.txt
)

pbuilder_install_data( ${LOCUST_MC_DATA_FILES} )
30 changes: 30 additions & 0 deletions Data/KrShakeParameters214.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#Parameters for Kr shakeup and shakeoff spectrum,,,,
#v214 rev. 2/15/20,,,,
#Index,"Amplitude, %",Binding (eV),Scale (eV) ,Width (eV)
0,100.0000,0,0,2.7
1,4.3476,19.8,0,2.7
2,2.1738,20.5,0,2.7
3,0.8329,21.7,0,2.7
4,0.4165,22.4,0,2.7
5,0.2999,22.9,0,2.7
6,0.1499,23.6,0,2.7
7,0.5997,23.6,0,2.7
8,0.2999,24.3,0,2.7
9,4.6334,26.1,11.2,2.7
10,2.3167,26.8,11.2,2.7
11,2.0752,38.6,0,3.1
12,0.4151,41,0,3.1
13,0.1038,42.5,0,3.1
14,0.1038,43.5,0,3.1
15,6.7121,46.6,42.4,3.1
16,0.0156,97.7,0,2.77
17,0.0104,99.1,0,2.77
18,4.4455,116,307,2.77
19,2.9606,117,307,2.77
20,0.0000,240,0,4.022
21,0.0000,249,0,3.93
22,1.0913,252,641,4.022
23,0.5456,261,641,3.93
24,0.2000,321,400,6.2
25,0.2000,1835,500,3.808
26,0.1000,1895,500,3.865
408 changes: 408 additions & 0 deletions Data/TransferFunctions/UncoupledHalfWaveeDipoleTF.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM project8/p8compute_dependencies:v0.9.0 as locust_common
ARG build_type=Release
ENV LOCUST_BUILD_TYPE=$build_type

ENV LOCUST_TAG=v1.15.10
ENV LOCUST_TAG=v1.15.11
ENV LOCUST_BUILD_PREFIX=/usr/local/p8/locust/$LOCUST_TAG

RUN mkdir -p $LOCUST_BUILD_PREFIX &&\
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Installation
- CMake (www.cmake.org) version 2.8 or higher
- FFTW3 (3.3 or newer)
- G++ version 4.5 or higher (if compiling with GCC)
- GSL (www.gnu.org/software/gsl)
- GSL (www.gnu.org/software/gsl) version 2.0 or higher
- HDF5 (required by Monarch3 and for outputing to HDF5 files)
- ROOT (www.cern.ch/root) version 5.24 or higher (6.x should work too)

Expand Down
42 changes: 40 additions & 2 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ set( LOCUST_MC_HEADER_FILES
Core/LMCHFSSResponseFileHandler.hh
Core/LMCFIRFileHandler.hh
Core/LMCTFFileHandler.hh

Distributions/LMCBaseDistribution.hh
Distributions/LMCDiracDistribution.hh
Distributions/LMCExponentialDistribution.hh
Distributions/LMCGaussianDistribution.hh
Distributions/LMCLorentzianDistribution.hh
Distributions/LMCRuddDistribution.hh
Distributions/LMCUniformDistribution.hh
Distributions/LMCKrComplexLineDistribution.hh
Distributions/LMCDistributionInterface.hh

Generators/LMCDigitizer.hh
Generators/LMCGaussianNoiseGenerator.hh
Expand All @@ -50,11 +60,21 @@ set( LOCUST_MC_HEADER_FILES
Transmitters/LMCTransmitter.hh
Transmitters/LMCAntennaSignalTransmitter.hh
Transmitters/LMCPlaneWaveTransmitter.hh
Transmitters/LMCTransmitterHardware.hh
Transmitters/LMCDipoleAntenna.hh
Transmitters/LMCTurnstileAntenna.hh

Transforms/LMCHilbertTransform.hh
Transforms/LMCComplexFFT.hh

RxComponents/LMCPowerCombiner.hh
RxComponents/LMCVoltageDivider.hh
RxComponents/LMCSlottedWaveguide.hh
RxComponents/LMCSinglePatch.hh
RxComponents/LMCCorporateFeed.hh
RxComponents/LMCsMatrix.hh
RxComponents/LMCUnitCell.hh
RxComponents/LMCSeriesFeed.hh
RxComponents/LMCReceiver.hh
RxComponents/LMCPatchAntenna.hh
RxComponents/LMCSlotAntenna.hh
Expand All @@ -76,6 +96,16 @@ set( LOCUST_MC_SOURCE_FILES
Core/LMCHFSSResponseFileHandler.cc
Core/LMCFIRFileHandler.cc
Core/LMCTFFileHandler.cc

Distributions/LMCBaseDistribution.cc
Distributions/LMCDiracDistribution.cc
Distributions/LMCExponentialDistribution.cc
Distributions/LMCGaussianDistribution.cc
Distributions/LMCLorentzianDistribution.cc
Distributions/LMCRuddDistribution.cc
Distributions/LMCUniformDistribution.cc
Distributions/LMCKrComplexLineDistribution.cc
Distributions/LMCDistributionInterface.cc

Generators/LMCDigitizer.cc
Generators/LMCGaussianNoiseGenerator.cc
Expand All @@ -91,11 +121,21 @@ set( LOCUST_MC_SOURCE_FILES
Transmitters/LMCAntennaSignalTransmitter.cc
Transmitters/LMCPlaneWaveTransmitter.cc
Transmitters/LMCFieldBuffer.cc
Transmitters/LMCTransmitterHardware.cc
Transmitters/LMCDipoleAntenna.cc
Transmitters/LMCTurnstileAntenna.cc

Transforms/LMCHilbertTransform.cc
Transforms/LMCComplexFFT.cc

RxComponents/LMCPowerCombiner.cc
RxComponents/LMCVoltageDivider.cc
RxComponents/LMCSlottedWaveguide.cc
RxComponents/LMCSinglePatch.cc
RxComponents/LMCCorporateFeed.cc
RxComponents/LMCsMatrix.cc
RxComponents/LMCUnitCell.cc
RxComponents/LMCSeriesFeed.cc
RxComponents/LMCReceiver.cc
RxComponents/LMCPatchAntenna.cc
RxComponents/LMCSlotAntenna.cc
Expand All @@ -108,7 +148,6 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA)

Generators/LMCFreeFieldSignalGenerator.hh
Generators/LMCKassSignalGenerator.hh
Generators/LMCTurnstileSignalGenerator.hh
Generators/LMCArraySignalGenerator.hh


Expand All @@ -133,7 +172,6 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA)
set( LOCUST_MC_SOURCE_FILES ${LOCUST_MC_SOURCE_FILES}
Generators/LMCFreeFieldSignalGenerator.cc
Generators/LMCKassSignalGenerator.cc
Generators/LMCTurnstileSignalGenerator.cc
Generators/LMCArraySignalGenerator.cc

Transmitters/LMCKassTransmitter.cc
Expand Down
30 changes: 22 additions & 8 deletions Source/Core/LMCHFSSResponseFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "logger.hh"

#include<unistd.h>

namespace locust
{
LOGGER( lmclog, "HFSSResponseFileHandlerCore" );
Expand Down Expand Up @@ -53,10 +55,13 @@ namespace locust
if(fFIRNBins<=0){
LERROR(lmclog,"Number of bins in the filter should be positive");
}
for(int i=0;i<fFIRNBins;++i)
{
convolution+=fFilter[i]*inputBuffer[i];
}
int firBinNumber=0;
for (auto it = inputBuffer.begin();it!=inputBuffer.end(); ++it)
{
convolution+=*(it)*fFilter[firBinNumber];
firBinNumber++;
}

return convolution;
}

Expand Down Expand Up @@ -124,16 +129,19 @@ namespace locust
fTFNBins=0;
if(!ends_with(fHFSSFilename,".txt"))
{
LERROR(lmclog,"The TF file should end in .txt");
LERROR(lmclog,"The TF file " << fHFSSFilename.c_str() <<"doesn't end in .txt");
return false;
}
double tfIndex;
double tfRealValue;
double tfImaginaryValue;
std::vector<std::complex<double>> tfArray;
// FILE *tfFile;
std::fstream tfFile(fHFSSFilename.c_str(),std::ios::in);
// tfFile=fopen(fHFSSFilename.c_str(),"r");
if (tfFile.fail())
{
LERROR(lmclog,"The TF file " << fHFSSFilename.c_str() <<" doesn't exist");
return false;
}
//logic copied from /LMCPatchSignalGenerator.cc
int totalcount=0;

Expand Down Expand Up @@ -201,13 +209,19 @@ namespace locust
fFIRNBins=0;
if(!ends_with(fHFSSFilename,".txt"))
{
LERROR(lmclog,"The FIR file should end in .txt");
LERROR(lmclog,"The FIR file " << fHFSSFilename.c_str() <<" doesn't end in .txt");
return false;
}
double firIndex;
double filterMagnitude;
FILE *firFile;
firFile=fopen(fHFSSFilename.c_str(),"r");

if(!access(fHFSSFilename.c_str(), F_OK ))
{
LERROR(lmclog,"The FIR file " << fHFSSFilename.c_str() <<" doesn't exist");
return false;
}
//logic copied from /LMCPatchSignalGenerator.cc
int count=0;

Expand Down
27 changes: 0 additions & 27 deletions Source/Core/LMCRunLengthCalculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,39 +142,12 @@ namespace locust
}



void RunLengthCalculator::Visit( const PlaneWaveSignalGenerator* )
{
// nothing to see here, move along, please
return;
}


void RunLengthCalculator::Visit( const AntennaSignalGenerator* )
{
// nothing to see here, move along, please
return;
}


void RunLengthCalculator::Visit( const TestSignalGenerator* )
{
// nothing to see here, move along, please
return;
}

void RunLengthCalculator::Visit( const DipoleSignalGenerator* )
{
// nothing to see here, move along, please
return;
}

void RunLengthCalculator::Visit( const TurnstileSignalGenerator* )
{
// nothing to see here, move along, please
return;
}


bool RunLengthCalculator::CalculateRunLength()
{
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/LMCRunLengthCalculator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,11 @@ namespace locust
void Visit( const ArraySignalGenerator* );
void Visit( const GaussianNoiseGenerator* );
void Visit( const FakeTrackSignalGenerator* );
void Visit( const PlaneWaveSignalGenerator* );
void Visit( const AntennaSignalGenerator* );
void Visit( const TestSignalGenerator* );
void Visit( const LowPassFilterFFTGenerator* );
void Visit( const HighPassFilterFFTGenerator* );
void Visit( const LocalOscillatorGenerator* );
void Visit( const DecimateSignalGenerator* );
void Visit( const DipoleSignalGenerator* );
void Visit( const TurnstileSignalGenerator* );
void Visit( const Digitizer* );

RunLengthState fState;
Expand Down
8 changes: 0 additions & 8 deletions Source/Core/LMCVisitor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace locust
class Generator;
class GaussianNoiseGenerator;
class FakeTrackSignalGenerator;
class PlaneWaveSignalGenerator;
class AntennaSignalGenerator;
class TestSignalGenerator;
class TestFIRFilterGenerator;
class LowPassFilterFFTGenerator;
Expand All @@ -23,8 +21,6 @@ namespace locust
class KassSignalGenerator;
class FreeFieldSignalGenerator;
class ArraySignalGenerator;
class DipoleSignalGenerator;
class TurnstileSignalGenerator;
class LocalOscillatorGenerator;
class DecimateSignalGenerator;

Expand All @@ -41,15 +37,11 @@ namespace locust
virtual void Visit( const ArraySignalGenerator* ) = 0;
virtual void Visit( const GaussianNoiseGenerator* ) = 0;
virtual void Visit( const FakeTrackSignalGenerator* ) = 0;
virtual void Visit( const PlaneWaveSignalGenerator* ) = 0;
virtual void Visit( const AntennaSignalGenerator* ) = 0;
virtual void Visit( const TestSignalGenerator* ) = 0;
virtual void Visit( const LowPassFilterFFTGenerator* ) = 0;
virtual void Visit( const HighPassFilterFFTGenerator* ) = 0;
virtual void Visit( const LocalOscillatorGenerator* ) = 0;
virtual void Visit( const DecimateSignalGenerator* ) = 0;
virtual void Visit( const DipoleSignalGenerator* ) = 0;
virtual void Visit( const TurnstileSignalGenerator* ) = 0;
virtual void Visit( const Digitizer* ) = 0;
};

Expand Down
25 changes: 25 additions & 0 deletions Source/Distributions/LMCBaseDistribution.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* LMCBaseDistribution.cc
*
* Created on: Mar 10, 2020
* Author: nbuzinsky
*/

#include "LMCBaseDistribution.hh"

namespace locust
{
BaseDistribution::BaseDistribution()
{
}

BaseDistribution::~BaseDistribution()
{
}

void BaseDistribution::SetRandomEngine(const std::shared_ptr<std::default_random_engine> &aEngine)
{
fRNEngine = aEngine;
}

} /* namespace locust */
Loading

0 comments on commit b87958a

Please sign in to comment.