Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
*~
*.log
*.save
*.tmp
*.hist
\#*\#
core.*
*.vcxproj*
Expand Down
87 changes: 87 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ======================================================================
# otsdaq-mu2e-sync main build file
#
# cd .../path/to/build/directory
# source .../path/to/otsdaq-mu2e-sync/ups/setup_for_development
# buildtool
# ======================================================================

cmake_minimum_required (VERSION 3.19 FATAL_ERROR)

find_package(cetmodules 3.16.00 REQUIRED)

project(otsdaq-mu2e-sync VERSION 1.00.00)

include(CetCMakeEnv)
cet_cmake_env()
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

cet_set_compiler_flags(DIAGS VIGILANT
WERROR
NO_UNDEFINED
EXTRA_FLAGS -pedantic -Wno-unused-parameter -Wno-ignored-qualifiers
)


string(TOUPPER ${CMAKE_BUILD_TYPE} BTYPE_UC)
if(BTYPE_UC STREQUAL DEBUG)
add_definitions(-DDEBUGME)
if(DEFINED ENV{USE_ASAN})
if($ENV{USE_ASAN} GREATER 0)
message("!!! Address Sanitizer Activated!!!")
message("!!! Note: To run, add 'export ASAN_OPTIONS=verify_asan_link_order=0' to setup !!!")
add_compile_options(-fsanitize=address -Wno-unused-command-line-argument)
add_link_options(-lasan)
endif()
endif()
if(DEFINED ENV{USE_TSAN})
if($ENV{USE_TSAN} GREATER 0)
message("!!! Thread Sanitizer Activated!!!")
add_compile_options(-fsanitize=thread -Wno-unused-command-line-argument -Wno-tsan)
add_link_options(-ltsan)
endif()
endif()
if(DEFINED ENV{USE_UBSAN})
if($ENV{USE_UBSAN} GREATER 0)
message("!!! \"Undefined Behavior\" Sanitizer Activated!!!")
add_compile_options(-fsanitize=undefined -Wno-unused-command-line-argument)
add_link_options(-lubsan)
endif()
endif()
if(DEFINED ENV{USE_GCOV})
add_compile_options(-fprofile-arcs -ftest-coverage --coverage)
add_link_options(--coverage)
endif()
endif()

#exeption stack trace
if(DEFINED ENV{USE_EXCEPTIONSTACKTRACE})
if($ENV{USE_EXCEPTIONSTACKTRACE} GREATER 0)
message("!!! Exception StackTrace Activated!!!")
add_definitions(-D EXCEPTIONSTACKTRACE)
set( EXCEPTIONSTACKTRACE_LIB artdaq-core_Utilities_ExceptionStackTrace )
add_compile_options( -rdynamic -Wno-unused-command-line-argument )
add_link_options( -rdynamic )
endif()
endif()

#cet_report_compiler_flags()

# these are minimum required versions, not the actual product versions
find_package(otsdaq-mu2e 1.02.00 REQUIRED)

# Mu2e Offline Extra setup
find_package(Offline v11_00_00 REQUIRED)
include_directories($ENV{BTRK_INC} $ENV{KINKAL_INC})
link_directories($ENV{BTRK_LIB} $ENV{KINKAL_LIB})

# XDAQ Extra setup
include_directories($ENV{XDAQ_ROOT}/include/linux $ENV{XDAQ_ROOT}/include)
link_directories($ENV{XDAQ_ROOT}/lib)

include(BuildPlugins)

# Code
add_subdirectory(otsdaq-mu2e-sync)

cet_cmake_config()
101 changes: 101 additions & 0 deletions CMakeLists.txt~
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# ======================================================================
# otsdaq-mu2e-sync main build file
#
# cd .../path/to/build/directory
# source .../path/to/otsdaq-mu2e-sync/ups/setup_for_development
# buildtool
# ======================================================================

cmake_minimum_required (VERSION 3.19 FATAL_ERROR)

find_package(cetmodules 3.16.00 REQUIRED)

project(otsdaq-mu2e-sync VERSION 6.00.00)

include(CetCMakeEnv)
cet_cmake_env()
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

cet_set_compiler_flags(DIAGS VIGILANT
WERROR
NO_UNDEFINED
EXTRA_FLAGS -pedantic -Wno-unused-parameter -Wno-ignored-qualifiers
)


string(TOUPPER ${CMAKE_BUILD_TYPE} BTYPE_UC)
if(BTYPE_UC STREQUAL DEBUG)
add_definitions(-DDEBUGME)
if(DEFINED ENV{USE_ASAN})
if($ENV{USE_ASAN} GREATER 0)
message("!!! Address Sanitizer Activated!!!")
message("!!! Note: To run, add 'export ASAN_OPTIONS=verify_asan_link_order=0' to setup !!!")
add_compile_options(-fsanitize=address -Wno-unused-command-line-argument)
add_link_options(-lasan)
endif()
endif()
if(DEFINED ENV{USE_TSAN})
if($ENV{USE_TSAN} GREATER 0)
message("!!! Thread Sanitizer Activated!!!")
add_compile_options(-fsanitize=thread -Wno-unused-command-line-argument -Wno-tsan)
add_link_options(-ltsan)
endif()
endif()
if(DEFINED ENV{USE_UBSAN})
if($ENV{USE_UBSAN} GREATER 0)
message("!!! \"Undefined Behavior\" Sanitizer Activated!!!")
add_compile_options(-fsanitize=undefined -Wno-unused-command-line-argument)
add_link_options(-lubsan)
endif()
endif()
if(DEFINED ENV{USE_GCOV})
add_compile_options(-fprofile-arcs -ftest-coverage --coverage)
add_link_options(--coverage)
endif()
endif()

#exeption stack trace
if(DEFINED ENV{USE_EXCEPTIONSTACKTRACE})
if($ENV{USE_EXCEPTIONSTACKTRACE} GREATER 0)
message("!!! Exception StackTrace Activated!!!")
add_definitions(-D EXCEPTIONSTACKTRACE)
set( EXCEPTIONSTACKTRACE_LIB artdaq-core_Utilities_ExceptionStackTrace )
add_compile_options( -rdynamic -Wno-unused-command-line-argument )
add_link_options( -rdynamic )
endif()
endif()

#cet_report_compiler_flags()

# these are minimum required versions, not the actual product versions
find_package(otsdaq-mu2e 1.02.00 REQUIRED)

#find_package(art_root_io 1.10.01 REQUIRED)

# Mu2e Offline Extra setup
find_package(Offline v11_00_00 REQUIRED)
include_directories($ENV{BTRK_INC} $ENV{KINKAL_INC})
link_directories($ENV{BTRK_LIB} $ENV{KINKAL_LIB})

# XDAQ Extra setup
include_directories($ENV{XDAQ_ROOT}/include/linux $ENV{XDAQ_ROOT}/include)
link_directories($ENV{XDAQ_ROOT}/lib)


include(BuildPlugins)

# Code
add_subdirectory(otsdaq-mu2e-sync)

# Useful scripts
add_subdirectory(tools)

# Test Programs
add_subdirectory(test)

# Documentation directory
#add_subdirectory(doc)

install(DIRECTORY test DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/otsdaq-mu2e-sync)

cet_cmake_config()
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# otsdaq-mu2e-sync
# otsdaq-mu2e-dqm

This package is a part of the Mu2e TDAQ Suite

Expand All @@ -22,3 +22,64 @@ This package is a part of the Mu2e TDAQ Suite

# Additional Documentation (Package-Specific)

Here is a bit of information about this Repo and its use:

# Log in From on mu2edaq01

```
$ ssh -X mu2edaq13
$ cd ~test_stand/ots_agg
$ source setup_ots.sh
$ mz
```
# Create the directory from this Repo
```
$ create repo via:
$ UpdateOTS.sh --pullall
$ source ots_get_and_fix_repo.sh otsdaq-mu2e-sync
$ mz
```

# Too push code to this repo:
```
$ git status
$ git add NEW_STUFF
$ git commit -m "Information about new stuff"
$ git push origin develop (develop is branch name here)
```
# To Clone this repo
```
$ mrb gitCheckout -d mu2e_otsdaq_sync http://cdcvs.fnal.gov/projects/mu2e-otsdaq-sync
```
# Modify CMake files in order to compile
```
$ cp CMakeLists.txt
```
from mu2e trigger directory. Will need to add in similar files to each subdirectory. Check for places we might need to change things.

Also remember to add in the new directory to the Head CMakeList.txt in srcs:

```
$ cd YOUR_TOP_DIRECTORY_NAME/srcs
$ EDITOR_NAME CMakeList.txt
```
Copy another package block and change the name :

```
set(otsdaq_mu2e_sync_not_in_ups true)
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/otsdaq_mu2e_sync )
include_directories ( $ENV{MRB_BUILDDIR}/otsdaq_mu2e_sync )

```
# Clean Build:
```
$ mz
```

# To Use this Repo to make your own ARTMODULE with Vizualizer:

- The example I created is inside ArtModule - it is called Prototype module.
- In that module you will see how we connect to the TCP. Here only 1 TH1F is filled and Broadcast.
- The Histograms have there own class - ProtoTypeHist - in there you have to book and initiate all the RootObjects.
- The Consumer for this example is in DataProcessorPlugins - see dqmMu2eHistoConsumer_processor.cc to see how the consumer reads the root object using only the name. You must have a class member of the same type as you filled in you module. There is o need to rename or rebook (that's why we have the class).
- To add in Mu2e DataProducts you need to make sure you add in the Mu2e libraries- see ArtModule/CMakeList for examples.
1 change: 1 addition & 0 deletions otsdaq-mu2e-sync/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
19 changes: 19 additions & 0 deletions otsdaq-mu2e-sync/ArtModules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

cet_build_plugin(SyncAna art::module LIBRARIES REG
art_root_io::TFileService_service
artdaq-core-mu2e::Data
canvas::canvas
otsdaq-mu2e::ArtModules
otsdaq::NetworkUtilities
Offline::Mu2eUtilities
Offline::RecoDataProducts
ROOT::Hist
ROOT::Tree
ROOT::Core
ROOT::RIO
ROOT::Gui
)

install_headers()
install_source()
install_fhicl(SUBDIRS fcl)
Loading
Loading