Skip to content

Commit

Permalink
Merge pull request #14 from Mu2e/pgirotti/caloSidet2
Browse files Browse the repository at this point in the history
updates for copying config files and using loopkup cet lib
  • Loading branch information
eflumerf authored Oct 16, 2024
2 parents ca63135 + 479b3b4 commit 6c9b6da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ endif()
#FILE(COPY ServiceData DESTINATION Data)
#INSTALL(DIRECTORY ServiceData DESTINATION ${product}/${version}/Data)

#FILE(COPY boardConfig/nominal DESTINATION .)
#INSTALL(DIRECTORY boardConfig/nominal DESTINATION . FILE_PERMISSIONS USE_SOURCE_PERMISSIONS DIRECTORY_PERMISSIONS USE_SOURCE_PERMISSIONS)
FILE(COPY boardConfig/nominal DESTINATION boardConfig)
install(DIRECTORY boardConfig/nominal DESTINATION boardConfig FILE_PERMISSIONS USE_SOURCE_PERMISSIONS DIRECTORY_PERMISSIONS USE_SOURCE_PERMISSIONS)


cet_cmake_config()
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@


#include "otsdaq/Macros/InterfacePluginMacros.h"

#include "cetlib/filepath_maker.h"

#include <fstream>
#include <cstring>

Expand Down Expand Up @@ -633,19 +636,17 @@ void ROCCalorimeterInterface::ConfigureLink(std::string conf, bool hvonoff, bool
{

DTCLib::roc_address_t address = 147;
DTCLib::roc_data_t readVal;
DTCLib::roc_data_t readVal;
readVal = readRegister(address);

//to do:
//std::string filename = std::string(__ENV__("CALORIMETER_CONF_DIR")) + "/" + buff;
//fix it asking to ryan or eric..

std::string filename = std::string("/home/mu2ecalo/ots_spack/srcs/otsdaq-mu2e-calorimeter/boardConfig/boardMap.conf");
std::ifstream confMap(filename);
// std::string filename = std::string("/home/mu2ecalo/ots_spack/srcs/otsdaq-mu2e-calorimeter/boardConfig/boardMap.conf");
cet::filepath_lookup_after1 lookup_policy("MU2E_CALORIMETER_CONFIG_PATH");
auto file_path = lookup_policy("boardMap.config");//FIXME! THIS NEEDS TO BE A VARIABLE
std::ifstream confMap(file_path);

if(!confMap.is_open())
{
__FE_SS__ << "Could not open file: " << filename << __E__;
__FE_SS__ << "Could not open file: " << file_path << __E__;
__FE_SS_THROW__;;
}

Expand Down

0 comments on commit 6c9b6da

Please sign in to comment.