Commit d8293c94 authored by dino's avatar dino
Browse files

femul built using CMake

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@975 170316e4-aea8-4b27-aad4-0380ec0519c9
parent d57cea2a
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(femul)
# select the off-line version
ADD_DEFINITIONS(-DNRV_TYPE=NRV_OFFLINE)
# select one of the 2 options
IF(1)
# c stuff compiled as C++ (as we do in the ACQ)
ADD_DEFINITIONS(-x c++)
else()
# c stuff compiles as C --> mgt_inizialize and mgt_process_event defined
# as 'extern "C"' in TrackingFilterOFT.cpp and TrackingFilterMGT.cpp
ADD_DEFINITIONS(-DUSING_CMAKE)
endif()
# enable the vectorized version of the PSA FOM-loop
ADD_DEFINITIONS(-msse4)
SET(ADFDIR "../myADF0.2")
SET(PRISMA "../PRISMA/src/lib_prisma")
SET(ACTORS "..")
SET(FEMDIR ".")
INCLUDE_DIRECTORIES(
${ACTORS}/common
${ACTORS}/producers/Crystal ${ACTORS}/producers/Crystal/includeATCA
${ACTORS}/producers/AncillaryTCP
${ACTORS}/filters/Preprocessing ${ACTORS}/filters/Preprocessing/includePrePSA
${ACTORS}/filters/Ancillary ${ACTORS}/filters/Ancillary/includeVME
${ACTORS}/filters/PSA ${ACTORS}/filters/PSA/includePSA
${ACTORS}/filters/Tracking ${ACTORS}/filters/Tracking/includeOFT ${ACTORS}/filters/Tracking/includeMGT
${ACTORS}/builders
${ADFDIR} ${ADFDIR}/standalone
${PRISMA}/include
/usr/include/boost
/usr/include/skstream-0.3 /usr/lib/skstream-0.3/include
#${ACTORS}/producers/Basic
#${ACTORS}/consumers/Basic
)
SET(actors_SRCS
${ACTORS}/common/cycleServer.cpp
${ACTORS}/common/misc.cpp
${ACTORS}/common/mwdlib.cpp
${ACTORS}/producers/Crystal/CrystalProducer.cpp
${ACTORS}/producers/Crystal/CrystalProducerATCA.cpp
${ACTORS}/producers/Crystal/includeATCA/mezzanine.cpp
${ACTORS}/producers/Crystal/includeATCA/fileATCA.cpp
${ACTORS}/producers/AncillaryTCP/AncillaryProducerTCP.cpp
${ACTORS}/filters/Preprocessing/PreprocessingFilter.cpp
${ACTORS}/filters/Preprocessing/PreprocessingFilterPSA.cpp
${ACTORS}/filters/Ancillary/AncillaryFilter.cpp
${ACTORS}/filters/Ancillary/AncillaryFilterVME.cpp
${ACTORS}/filters/Ancillary/AncillaryFilterATCA.cpp
${ACTORS}/filters/Ancillary/includeVME/Converter.cpp
${ACTORS}/filters/PSA/PSAFilter.cpp
${ACTORS}/filters/PSA/PSAFilterGridSearch.cpp
${ACTORS}/filters/PSA/includePSA/SignalBasis.cpp
${ACTORS}/filters/Tracking/TrackingFilter.cpp
${ACTORS}/filters/Tracking/TrackingFilterOFT.cpp
${ACTORS}/filters/Tracking/TrackingFilterMGT.cpp
${ACTORS}/filters/Tracking/includeOFT/tracking_cluster.c
${ACTORS}/filters/Tracking/includeOFT/tracking_data_manip.c
${ACTORS}/filters/Tracking/includeOFT/tracking_events.c
${ACTORS}/filters/Tracking/includeOFT/tracking_physics.c
${ACTORS}/filters/Tracking/includeOFT/tracking_utilitaires.c
${ACTORS}/filters/Tracking/includeMGT/mgt.c
${ACTORS}/filters/Tracking/includeMGT/mgt_eclust.c
${ACTORS}/filters/Tracking/includeMGT/mgt_etrack.c
${ACTORS}/filters/Tracking/includeMGT/mgt_event.c
${ACTORS}/filters/Tracking/includeMGT/mgt_geoagata.c
${ACTORS}/filters/Tracking/includeMGT/mgt_vectorlib.c
${ACTORS}/builders/EventBuilder.cpp
)
SET(adf_SRCS
${ADFDIR}/ADFConfig.cpp
${ADFDIR}/ADFObjects.cpp
${ADFDIR}/AgataConfigurationFrame.cpp
${ADFDIR}/AgataFrameFactory.cpp
${ADFDIR}/AgataKeyFactory.cpp
${ADFDIR}/AgataRawFrame.cpp
${ADFDIR}/BaseBuffer.cpp
${ADFDIR}/BufferIO.cpp
${ADFDIR}/CompositeFrame.cpp
${ADFDIR}/ConfAgent.cpp
${ADFDIR}/ConfigurationFrame.cpp
${ADFDIR}/Counter.cpp
${ADFDIR}/CrystalFrame.cpp
${ADFDIR}/DataHandling.cpp
${ADFDIR}/DefaultKeyFactory.cpp
${ADFDIR}/FactoryItem.cpp
${ADFDIR}/Frame.cpp
${ADFDIR}/FrameBlock.cpp
${ADFDIR}/FrameFactory.cpp
${ADFDIR}/FrameIO.cpp
${ADFDIR}/GenericFrame.cpp
${ADFDIR}/GObject.cpp
${ADFDIR}/Hits.cpp
${ADFDIR}/Key.cpp
${ADFDIR}/KeyFactory.cpp
${ADFDIR}/MetaFrame.cpp
${ADFDIR}/NarvalInterface.cpp
${ADFDIR}/Signals.cpp
${ADFDIR}/Trigger.cpp
${ADFDIR}/Version.cpp
${ADFDIR}/standalone/CentralLog.cpp
${ADFDIR}/standalone/LogCollector.cpp
${ADFDIR}/standalone/LogMessage.cpp
${ADFDIR}/BasicAFC.cpp
${ADFDIR}/BasicAFP.cpp
)
SET(PRISMA_SRCS
${PRISMA}/src/prismaManager.cc
${PRISMA}/src/banGate.cc
${PRISMA}/src/banManager.cc
${PRISMA}/src/calCoef.cc
${PRISMA}/src/calManager.cc
${PRISMA}/src/CGaspBuffer.cc
${PRISMA}/src/ConfigurationFile.cc
${PRISMA}/src/detData.cc
${PRISMA}/src/fastSolver.cc
${PRISMA}/src/fullEvent.cc
${PRISMA}/src/massCalculator.cc
${PRISMA}/src/prismaIonCh.cc
${PRISMA}/src/prismaMcp.cc
${PRISMA}/src/prismaPPAC.cc
${PRISMA}/src/prismaSide.cc
${PRISMA}/src/RandomGenerator.cc
${PRISMA}/src/Vectors.cc
${PRISMA}/src/zedCalculator.cc
)
SET(femul_SRCS ${FEMDIR}/femul.cpp ${adf_SRCS} ${actors_SRCS} ${PRISMA_SRCS} )
ADD_EXECUTABLE(femul ${femul_SRCS})
IF(WIN32)
TARGET_LINK_LIBRARIES(femul /lib/libboost_thread-mt.a)
ELSE()
TARGET_LINK_LIBRARIES(femul /usr/lib/libboost_thread-mt.so)
ENDIF()
#MESSAGE("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
#
#IF(WIN32)
# MESSAGE("WIN32")
#ELSE(WIN32)
# MESSAGE("not WIN32")
#ENDIF(WIN32)
......@@ -314,11 +314,11 @@ int main(int argc, char **argv)
chClosed = new bool [TOTCHAINS];
#endif
#if ( OS_TYPE == OS_WINDOWS ) || ( !defined(WCT_THREADED) && !defined(PSA_THREADED) )
//#if ( OS_TYPE == OS_WINDOWS ) || ( !defined(WCT_THREADED) && !defined(PSA_THREADED) )
// CNTRL_C can be used to stop execution
signal(SIGINT, catch_int);
printf("\nAnalysis can be terminated by typing CTRL_C\n\n");
#endif
//#endif
//#define DO_IT_AGAIN_LOOP // enable this symbol to test the stop/start loop in main()
#ifdef DO_IT_AGAIN_LOOP
......@@ -488,12 +488,14 @@ void numparams(char * cmd, int nn)
bool checkADFpath()
{
string adfpath = getenv("ADF_CONF_PATH");
if(adfpath.size()) {
string adfpath;
if(getenv("ADF_CONF_PATH")) {
adfpath = getenv("ADF_CONF_PATH");
forceTailSlash(adfpath);
adfpath += "ADF.conf";
}
else {
cout << "\nWARNING: ADF_CONF_PATH is not set. Looking into cwd";
adfpath = "./ADF.conf";
}
......@@ -501,7 +503,7 @@ bool checkADFpath()
if(found)
cout << "\n The ADF configuration file is\n " << adfpath;
else
cout << "\nWARNING: The ADF configuration file ADF.conf is neither in $ADF_CONF_PATH nor in cwd";
cout << "\nERROR: The ADF configuration file ADF.conf was not found.";
cout << endl << endl;
return found;
......
......@@ -9,10 +9,13 @@ const double METRIC = 0.3; // norm for the figure of merit
const int RMETRIC = 64*1024; // max tabulated deviation !!!!!!!!! DOES NOT WORK WITH SHORT IF > 65536 !!!!!!!!!!!!!!
const int NMETRIC = 2*RMETRIC; // positive and negative
//#define USE_SSE_VERSION // uncomment to use SSE intrinsics for the innermost figure-of-merit loop (at the moment works only in WINDOWS)
#define USE_SSE_VERSION // uncomment to use SSE intrinsics for the innermost figure-of-merit loop (at the moment works only in WINDOWS)
#define USE_SSE_VERSION // uncomment to use SSE intrinsics for the innermost figure-of-merit loop
// at the moment, the vectorized version works only in Windows
#if defined(USE_SSE_VERSION) && !(defined(__GNUC__) || defined(_MSC_VER))
// the vectorized version does not work with the cygwin gcc compiler
#if defined(USE_SSE_VERSION) && (OS_TYPE==OS_CYGWIN)
# undef USE_SSE_VERSION
#endif
......
......@@ -1191,8 +1191,9 @@ bool SignalBasis::ReadXtalkCoeffs(string cname, bool verbose)
const float nonvalid = -1.e20f;
for(segseen = 0; segseen < 36; segseen++) {
// with the natural order it dies using gcc -O3
for(seggate = 0; seggate < 36; seggate++) {
for(segseen = 0; segseen < 36; segseen++) {
xTalkProp[segseen][seggate] = nonvalid;
}
}
......
......@@ -9,12 +9,12 @@
using namespace std;
using namespace ADF;
#ifdef _MSC_VER // this symbol is defined in the Microsoft compiler
#if defined(_MSC_VER) || defined(USING_CMAKE) // *.c stuff compiled using C
extern "C" {
int mgt_initialize();
void mgt_process_event(MgtStruct *mydata, unsigned int *error_code);
}
#else
#else // *.c stuff compiled using C++
void mgt_process_event(MgtStruct *mydata, unsigned int *error_code);
int mgt_initialize();
#endif
......
......@@ -9,12 +9,12 @@
using namespace std;
using namespace ADF;
#ifdef _MSC_VER // this symbol is defined in the Microsoft compiler
#if defined(_MSC_VER) || defined(USING_CMAKE) // *.c stuff compiled using C
extern "C" {
void process_event(OftStruct *mydata, unsigned int *error_code);
void initialize_oft();
}
#else
#else // *.c stuff compiled using C++
void process_event(OftStruct *mydata, unsigned int *error_code);
void initialize_oft();
#endif
......
//
// This is a (probably too fast) porting of the mgt tracking program to the AGATA/Narval environment.
// From the point of view of programming style the result is rather orrible (most of the non-needed original code
// is simply commented out and the initialization parts are modified as if we were reading an Oft_Hits file) but it works.
// The good news is that the core parts (mgt_clust and mgt_etrack) have practically not been touched, and
// this means that it should not be too difficult do clean it up from the unused stuff.
// From the point of view of programming style the result is rather horrible (most of the not-needed
// original code is simply commented-out and the initialization parts are modified as if we were
// reading an Oft_Hits file), but it works.
// The good news is that the core parts (mgt_clust and mgt_etrack) have practically not been touched,
// and this means that it should not be too difficult to clean it up from the unused stuff.
//
// Dino Bazzacco August 2010
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment