Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • le.koch/cbmroot
  • patrick.pfistner_AT_kit.edu/cbmroot
  • lena.rossel_AT_stud.uni-frankfurt.de/cbmroot
  • i.deppner/cbmroot
  • fweig/cbmroot
  • karpushkin_AT_inr.ru/cbmroot
  • v.akishina/cbmroot
  • rishat.sultanov_AT_cern.ch/cbmroot
  • l_fabe01_AT_uni-muenster.de/cbmroot
  • pwg-c2f/cbmroot
  • j.decuveland/cbmroot
  • a.toia/cbmroot
  • i.vassiliev/cbmroot
  • n.herrmann/cbmroot
  • o.lubynets/cbmroot
  • se.gorbunov/cbmroot
  • cornelius.riesen_AT_physik.uni-giessen.de/cbmroot
  • zhangqn17_AT_mails.tsinghua.edu.cn/cbmroot
  • bartosz.sobol/cbmroot
  • ajit.kumar/cbmroot
  • computing/cbmroot
  • a.agarwal_AT_vecc.gov.in/cbmroot
  • osingh/cbmroot
  • wielanek_AT_if.pw.edu.pl/cbmroot
  • malgorzata.karabowicz.stud_AT_pw.edu.pl/cbmroot
  • m.shiroya/cbmroot
  • s.roy/cbmroot
  • p.-a.loizeau/cbmroot
  • a.weber/cbmroot
  • ma.beyer/cbmroot
  • d.klein/cbmroot
  • d.smith/cbmroot
  • mvdsoft/cbmroot
  • d.spicker/cbmroot
  • y.h.leung/cbmroot
  • m.deveaux/cbmroot
  • mkunold/cbmroot
  • h.darwish/cbmroot
  • f_fido01_AT_uni-muenster.de/cbmroot
  • g.kozlov/cbmroot
  • d.emschermann/cbmroot
  • evgeny.lavrik/cbmroot
  • v.friese/cbmroot
  • f.uhlig/cbmroot
  • ebechtel_AT_ikf.uni-frankfurt.de/cbmroot
  • a.senger/cbmroot
  • praisig/cbmroot
  • s.lebedev/cbmroot
  • redelbach_AT_compeng.uni-frankfurt.de/cbmroot
  • p.subramani/cbmroot
  • a_meye37_AT_uni-muenster.de/cbmroot
  • om/cbmroot
  • o.golosov/cbmroot
  • l.chlad/cbmroot
  • a.bercuci/cbmroot
  • d.ramirez/cbmroot
  • v.singhal/cbmroot
  • h.schiller/cbmroot
  • apuntke/cbmroot
  • f.zorn/cbmroot
  • rubio_AT_physi.uni-heidelberg.de/cbmroot
  • p.chudoba/cbmroot
  • apuntke/mcbmroot
  • r.karabowicz/cbmroot
64 results
Show changes
Showing
with 1509 additions and 468 deletions
/* Copyright (C) 2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
#ifndef CBMMQTMESSAGE_H_
#define CBMMQTMESSAGE_H_
#include "TMessage.h"
// special class to expose protected TMessage constructor
class CbmMqTMessage : public TMessage {
public:
CbmMqTMessage(void* buf, Int_t len) : TMessage(buf, len) { ResetBit(kIsOwner); }
};
#endif /* CBMMQTMESSAGE_H_ */
...@@ -26,7 +26,7 @@ Set(SYSTEM_INCLUDE_DIRECTORIES ...@@ -26,7 +26,7 @@ Set(SYSTEM_INCLUDE_DIRECTORIES
${FAIRMQ_INCLUDE_DIR} ${FAIRMQ_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}/options ${FAIRMQ_INCLUDE_DIR}/options
${IPC_INCLUDE_DIRECTORY} ${FLES_IPC_INCLUDE_DIRECTORY}
${CBMROOT_SOURCE_DIR}/external/cppzmq ${CBMROOT_SOURCE_DIR}/external/cppzmq
) )
...@@ -66,13 +66,18 @@ If(FAIRLOGGER_FOUND) ...@@ -66,13 +66,18 @@ If(FAIRLOGGER_FOUND)
) )
EndIf() EndIf()
set(EXE_NAME EventBuilderEtofStar2019) # Dependencies common to all executables
set(SRCS CbmDeviceEventBuilderEtofStar2019.cxx runEventBuilderEtofStar2019.cxx) set(DEPENDENCIES_ALL
set(DEPENDENCIES
${DEPENDENCIES} ${DEPENDENCIES}
${FAIR_LIBS} ${FAIR_LIBS}
${BOOST_LIBS} ${BOOST_LIBS}
fles_ipc )
set(EXE_NAME EventBuilderEtofStar2019)
set(SRCS CbmDeviceEventBuilderEtofStar2019.cxx runEventBuilderEtofStar2019.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL}
external::fles_ipc
CbmFlibStar2019 CbmFlibStar2019
CbmFlibMcbm2018 CbmFlibMcbm2018
CbmBase CbmBase
...@@ -94,10 +99,8 @@ Set(NO_DICT_SRCS ...@@ -94,10 +99,8 @@ Set(NO_DICT_SRCS
# Mask warning from file provided by STAR # Mask warning from file provided by STAR
SET_SOURCE_FILES_PROPERTIES(${CBMROOT_SOURCE_DIR}/fles/star2017/unpacker/star_rhicf.c PROPERTIES COMPILE_FLAGS -Wno-pointer-sign) SET_SOURCE_FILES_PROPERTIES(${CBMROOT_SOURCE_DIR}/fles/star2017/unpacker/star_rhicf.c PROPERTIES COMPILE_FLAGS -Wno-pointer-sign)
set(DEPENDENCIES set(DEPENDENCIES
${DEPENDENCIES} ${DEPENDENCIES_ALL}
${FAIR_LIBS} external::fles_ipc
${BOOST_LIBS}
fles_ipc
CbmFlibStar2019 CbmFlibStar2019
CbmFlibMcbm2018 CbmFlibMcbm2018
CbmBase CbmBase
......
...@@ -137,7 +137,7 @@ Bool_t CbmDeviceEventBuilderEtofStar2019::InitContainers() ...@@ -137,7 +137,7 @@ Bool_t CbmDeviceEventBuilderEtofStar2019::InitContainers()
if (Send(req, "parameters") > 0) { if (Send(req, "parameters") > 0) {
if (Receive(rep, "parameters") >= 0) { if (Receive(rep, "parameters") >= 0) {
if (rep->GetSize() != 0) { if (rep->GetSize() != 0) {
CbmMQTMessage tmsg(rep->GetData(), rep->GetSize()); CbmMqTMessage tmsg(rep->GetData(), rep->GetSize());
fUnpackPar = dynamic_cast<CbmStar2019TofPar*>(tmsg.ReadObject(tmsg.GetClass())); fUnpackPar = dynamic_cast<CbmStar2019TofPar*>(tmsg.ReadObject(tmsg.GetClass()));
LOG(info) << "Received unpack parameter from parmq server: " << fUnpackPar; LOG(info) << "Received unpack parameter from parmq server: " << fUnpackPar;
fUnpackPar->Print(); fUnpackPar->Print();
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ #ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ #define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp" #include "Timeslice.hpp"
#include "FairMQDevice.h" #include "FairMQDevice.h"
...@@ -86,10 +88,4 @@ private: ...@@ -86,10 +88,4 @@ private:
const UInt_t kuBinDumpEndWord = 0xFAEBDEEF; const UInt_t kuBinDumpEndWord = 0xFAEBDEEF;
}; };
// special class to expose protected TMessage constructor
class CbmMQTMessage : public TMessage {
public:
CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) { ResetBit(kIsOwner); }
};
#endif /* CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ */ #endif /* CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ */
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#ifndef CBMDEVICETRIGGERHANDLERETOF_H_ #ifndef CBMDEVICETRIGGERHANDLERETOF_H_
#define CBMDEVICETRIGGERHANDLERETOF_H_ #define CBMDEVICETRIGGERHANDLERETOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofStarData2019.h" #include "CbmTofStarData2019.h"
#include "MicrosliceDescriptor.hpp" #include "MicrosliceDescriptor.hpp"
...@@ -20,12 +21,10 @@ ...@@ -20,12 +21,10 @@
#include "FairMQDevice.h" #include "FairMQDevice.h"
#include "Rtypes.h" #include "Rtypes.h"
#include "TMessage.h"
#include <map> #include <map>
#include <vector> #include <vector>
class CbmMQTMessage;
// Relevant TOF classes // Relevant TOF classes
extern "C" int star_rhicf_write(unsigned int trg_word, void* dta, int bytes); extern "C" int star_rhicf_write(unsigned int trg_word, void* dta, int bytes);
...@@ -78,10 +77,4 @@ private: ...@@ -78,10 +77,4 @@ private:
// histograms // histograms
}; };
// special class to expose protected TMessage constructor
class CbmMQTMessage : public TMessage {
public:
CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) { ResetBit(kIsOwner); }
};
#endif /* CBMDEVICETRIGGERHANDLERETOF_H_ */ #endif /* CBMDEVICETRIGGERHANDLERETOF_H_ */
...@@ -6,89 +6,49 @@ ...@@ -6,89 +6,49 @@
# copied verbatim in the file "LICENSE" # # copied verbatim in the file "LICENSE" #
################################################################################ ################################################################################
Set(INCLUDE_DIRECTORIES set(INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CBMROOT_SOURCE_DIR}/fles/flestools
) )
Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${Boost_INCLUDE_DIR}
${FAIRROOT_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}/options
${FAIRLOGGER_INCLUDE_DIR}
)
Include_Directories(${INCLUDE_DIRECTORIES})
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
Set(LINK_DIRECTORIES
${Boost_LIBRARY_DIRS}
${FAIRROOT_LIBRARY_DIR}
${ROOT_LIBRARY_DIR}
)
Link_Directories(${LINK_DIRECTORIES})
set(FAIR_LIBS
FairMQ
)
If(FAIRLOGGER_FOUND)
set(FAIR_LIBS
${FAIR_LIBS}
FairLogger
)
EndIf()
Set(BOOST_LIBS
${Boost_SYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
)
If(UNIX AND NOT APPLE) If(UNIX AND NOT APPLE)
List(APPEND BOOST_LIBS pthread) List(APPEND BOOST_LIBS pthread)
EndIf() EndIf()
If(FairRoot_VERSION VERSION_LESS 18.2.0) # Set the install path within the build directory
Add_Definitions(-DHAVE_RootDeserializer) set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/MQ/histogramServer")
EndIf() # Set the install path within the installation directory
set(BIN_DESTINATION bin/MQ/histogramServer)
set(DEPENDENCIES_ALL set(PUBLIC_DEPS
${DEPENDENCIES} ROOT::Core
${FAIR_LIBS} ROOT::RHTTP
${BOOST_LIBS} )
)
set(PRIVATE_DEPS
CbmFlibFlesTools
FairRoot::Base
FairMQ::FairMQ
ROOT::Gpad
ROOT::Hist
ROOT::Net
ROOT::RIO
)
set(EXE_NAME HistoServer) set(EXE_NAME HistoServer)
set(SRCS CbmHistoServer.cxx runCbmHistoServer.cxx) set(SRCS CbmHistoServer.cxx runCbmHistoServer.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL}
${FAIR_LIBS}
fles_ipc
Core
RIO
Net
Hist
RHTTP
)
GENERATE_EXECUTABLE()
set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/MQ/histogramServer") set(PUBLIC_DEPENDENCIES ${PUBLIC_DEPS})
set(PRIVATE_DEPENDENCIES ${PRIVATE_DEPS})
set(INTERFACE_DEPENDENCIES ${INTERFACE_DEPS})
generate_cbm_executable()
set(EXE_NAME MqHistoServer) set(EXE_NAME MqHistoServer)
set(SRCS CbmMqHistoServer.cxx runCbmMqHistoServer.cxx) set(SRCS CbmMqHistoServer.cxx runCbmMqHistoServer.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL} set(PUBLIC_DEPENDENCIES ${PUBLIC_DEPS})
${FAIR_LIBS} set(PRIVATE_DEPENDENCIES ${PRIVATE_DEPS})
CbmFlibFlesTools set(INTERFACE_DEPENDENCIES ${INTERFACE_DEPS})
Core
RIO generate_cbm_executable()
Net
Hist
Gpad
RHTTP
)
GENERATE_EXECUTABLE()
...@@ -45,11 +45,7 @@ void CbmHistoServer::InitTask() ...@@ -45,11 +45,7 @@ void CbmHistoServer::InitTask()
bool CbmHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/) bool CbmHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
{ {
TObject* tempObject = nullptr; TObject* tempObject = nullptr;
#ifdef HAVE_RootDeserializer RootSerializer().Deserialize(*msg, tempObject);
Deserialize<RootDeserializer>(*msg, tempObject);
#else
Deserialize<RootSerializer>(*msg, tempObject);
#endif
if (TString(tempObject->ClassName()).EqualTo("TObjArray")) { if (TString(tempObject->ClassName()).EqualTo("TObjArray")) {
std::lock_guard<std::mutex> lk(mtx); std::lock_guard<std::mutex> lk(mtx);
......
...@@ -35,19 +35,7 @@ Bool_t bMqHistoServerSaveHistos = kFALSE; ...@@ -35,19 +35,7 @@ Bool_t bMqHistoServerSaveHistos = kFALSE;
*/ */
CbmMqHistoServer::CbmMqHistoServer() CbmMqHistoServer::CbmMqHistoServer()
: FairMQDevice() : FairMQDevice()
, fsChannelNameHistosInput("histogram-in")
, fsChannelNameHistosConfig("histo-conf")
, fsChannelNameCanvasConfig("canvas-conf")
, fsHistoFileName("HistosMonitorPulser.root")
, fuHttpServerPort(8098)
, fArrayHisto() , fArrayHisto()
, fvpsHistosFolder()
, fvpsCanvasConfig()
, fvHistos()
, fvCanvas()
, fNMessages(0)
, fServer(nullptr)
, fStopThread(false)
{ {
} }
...@@ -87,9 +75,11 @@ void CbmMqHistoServer::InitTask() ...@@ -87,9 +75,11 @@ void CbmMqHistoServer::InitTask()
bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/) bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
{ {
LOG(debug) << "CbmMqHistoServer::ReceiveData => Processing histograms update";
TObject* tempObject = nullptr; TObject* tempObject = nullptr;
Deserialize<RootSerializer>(*msg, tempObject); // Deserialize<RootSerializer>(*msg, tempObject);
RootSerializer().Deserialize(*msg, tempObject);
if (TString(tempObject->ClassName()).EqualTo("TObjArray")) { if (TString(tempObject->ClassName()).EqualTo("TObjArray")) {
std::lock_guard<std::mutex> lk(mtx); std::lock_guard<std::mutex> lk(mtx);
...@@ -110,12 +100,14 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/) ...@@ -110,12 +100,14 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
LOG(warning) << "Unsupported object type for " << pObj->GetName(); LOG(warning) << "Unsupported object type for " << pObj->GetName();
} // for (Int_t i = 0; i < arrayHisto->GetEntriesFast(); i++) } // for (Int_t i = 0; i < arrayHisto->GetEntriesFast(); i++)
LOG(debug) << "CbmMqHistoServer::ReceiveData => Deleting array";
/// Need to use Delete instead of Clear to avoid memory leak!!! /// Need to use Delete instead of Clear to avoid memory leak!!!
arrayHisto->Delete(); arrayHisto->Delete();
/// If new histos received, try to prepare as many canvases as possible /// If new histos received, try to prepare as many canvases as possible
/// Should be expensive on start and cheap afterward /// Should be expensive on start and cheap afterward
if (!fbAllCanvasReady) { if (!fbAllCanvasReady) {
LOG(debug) << "CbmMqHistoServer::ReceiveData => Checking for canvases updates";
for (uint32_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv) { for (uint32_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv) {
/// Jump canvases already ready /// Jump canvases already ready
if (fvbCanvasReady[uCanv]) continue; if (fvbCanvasReady[uCanv]) continue;
...@@ -148,6 +140,8 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/) ...@@ -148,6 +140,8 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
bMqHistoServerSaveHistos = kFALSE; bMqHistoServerSaveHistos = kFALSE;
} // if( bMqHistoServerSaveHistos ) } // if( bMqHistoServerSaveHistos )
*/ */
LOG(debug) << "CbmMqHistoServer::ReceiveData => Finished processing histograms update";
return true; return true;
} }
...@@ -155,7 +149,9 @@ bool CbmMqHistoServer::ReceiveHistoConfig(FairMQMessagePtr& msg, int /*index*/) ...@@ -155,7 +149,9 @@ bool CbmMqHistoServer::ReceiveHistoConfig(FairMQMessagePtr& msg, int /*index*/)
{ {
std::pair<std::string, std::string> tempObject; std::pair<std::string, std::string> tempObject;
Deserialize<BoostSerializer<std::pair<std::string, std::string>>>(*msg, tempObject); // Deserialize<BoostSerializer<std::pair<std::string, std::string>>>(*msg, tempObject);
BoostSerializer<std::pair<std::string, std::string>>().Deserialize(*msg, tempObject);
LOG(info) << " Received configuration for histo " << tempObject.first << " : " << tempObject.second; LOG(info) << " Received configuration for histo " << tempObject.first << " : " << tempObject.second;
...@@ -185,7 +181,8 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/) ...@@ -185,7 +181,8 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/)
{ {
std::pair<std::string, std::string> tempObject; std::pair<std::string, std::string> tempObject;
Deserialize<BoostSerializer<std::pair<std::string, std::string>>>(*msg, tempObject); // Deserialize<BoostSerializer<std::pair<std::string, std::string>>>(*msg, tempObject);
BoostSerializer<std::pair<std::string, std::string>>().Deserialize(*msg, tempObject);
LOG(info) << " Received configuration for canvas " << tempObject.first << " : " << tempObject.second; LOG(info) << " Received configuration for canvas " << tempObject.first << " : " << tempObject.second;
...@@ -197,7 +194,7 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/) ...@@ -197,7 +194,7 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/)
} // for( UInt_t uPrevCanv = 0; uPrevCanv < fvpsCanvasConfig.size(); ++uPrevCanv ) } // for( UInt_t uPrevCanv = 0; uPrevCanv < fvpsCanvasConfig.size(); ++uPrevCanv )
if (uPrevCanv < fvpsCanvasConfig.size()) { if (uPrevCanv < fvpsCanvasConfig.size()) {
LOG(warning) << " Ignored new configuration for histo " << tempObject.first LOG(warning) << " Ignored new configuration for Canvas " << tempObject.first
<< " due to previously received one: " << tempObject.second; << " due to previously received one: " << tempObject.second;
/// Not sure if we should return false here... /// Not sure if we should return false here...
} // if( uPrevCanv < fvpsCanvasConfig.size() ) } // if( uPrevCanv < fvpsCanvasConfig.size() )
...@@ -218,7 +215,7 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/) ...@@ -218,7 +215,7 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Reject anything but a at least Header + Histo Config + Canvas Config + Histo Data /// Reject anything but a at least Header + Histo Config + Canvas Config + Histo Data
if (parts.Size() < 4) { if (parts.Size() < 4) {
if (1 == parts.Size()) { if (1 == parts.Size()) {
/// PAL, 09/04/2021, Debug message catching missed method overlad/polymorphism: /// PAL, 09/04/2021, Debug message catching missed method overload/polymorphism:
/// contrary to my expectation, if 2 method bound to same channel, one with FairMQMessagePtr and one with /// contrary to my expectation, if 2 method bound to same channel, one with FairMQMessagePtr and one with
/// FairMQParts, all messages go to multipart version and FairMQMessagePtr is converted to size 1 FairMQParts /// FairMQParts, all messages go to multipart version and FairMQMessagePtr is converted to size 1 FairMQParts
LOG(debug) << "CbmMqHistoServer::ReceiveConfigAndData => only 1 parts found in input, " LOG(debug) << "CbmMqHistoServer::ReceiveConfigAndData => only 1 parts found in input, "
...@@ -233,14 +230,33 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/) ...@@ -233,14 +230,33 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Header contains a pair of /// Header contains a pair of
std::pair<uint32_t, uint32_t> pairHeader; std::pair<uint32_t, uint32_t> pairHeader;
Deserialize<BoostSerializer<std::pair<uint32_t, uint32_t>>>(*parts.At(0), pairHeader); // Deserialize<BoostSerializer<std::pair<uint32_t, uint32_t>>>(*parts.At(0), pairHeader);
BoostSerializer<std::pair<uint32_t, uint32_t>>().Deserialize(*parts.At(0), pairHeader);
LOG(info) << "CbmMqHistoServer::ReceiveConfigAndData => Received configuration for " << pairHeader.first LOG(info) << "CbmMqHistoServer::ReceiveConfigAndData => Received configuration for " << pairHeader.first
<< " histos and " << pairHeader.second << " canvases"; << " histos and " << pairHeader.second << " canvases";
if (static_cast<size_t>(parts.Size()) != 1 + pairHeader.first + pairHeader.second + 1) { uint32_t uOffsetHistoConfig = pairHeader.first;
if (0 == pairHeader.first) {
uOffsetHistoConfig = 1;
if (0 < (parts.At(uOffsetHistoConfig))->GetSize()) {
LOG(fatal) << "CbmMqHistoServer::ReceiveConfigAndData => No histo config expected but corresponding message is"
<< " not empty: " << (parts.At(uOffsetHistoConfig))->GetSize();
}
}
uint32_t uOffsetCanvasConfig = pairHeader.second;
if (0 == pairHeader.second) {
uOffsetCanvasConfig = 1;
if (0 < (parts.At(uOffsetHistoConfig + uOffsetCanvasConfig))->GetSize()) {
LOG(fatal) << "CbmMqHistoServer::ReceiveConfigAndData => No Canvas config expected but corresponding message is"
<< " not empty: " << (parts.At(uOffsetHistoConfig + uOffsetCanvasConfig))->GetSize();
}
}
if (static_cast<size_t>(parts.Size()) != 1 + uOffsetHistoConfig + uOffsetCanvasConfig + 1) {
LOG(fatal) << "CbmMqHistoServer::ReceiveConfigAndData => Number of parts not matching header: " << parts.Size() LOG(fatal) << "CbmMqHistoServer::ReceiveConfigAndData => Number of parts not matching header: " << parts.Size()
<< " instead of " << 1 + pairHeader.first + pairHeader.second + 1; << " instead of " << 1 + uOffsetHistoConfig + uOffsetCanvasConfig + 1;
} // if( parts.Size() != 1 + pairHeader.first + pairHeader.second ) } // if( parts.Size() != 1 + pairHeader.first + pairHeader.second )
/// Decode parts for histograms configuration /// Decode parts for histograms configuration
...@@ -250,11 +266,14 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/) ...@@ -250,11 +266,14 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Decode parts for histograms configuration /// Decode parts for histograms configuration
for (uint32_t uCanv = 0; uCanv < pairHeader.second; ++uCanv) { for (uint32_t uCanv = 0; uCanv < pairHeader.second; ++uCanv) {
ReceiveCanvasConfig(parts.At(1 + pairHeader.first + uCanv), 0); ReceiveCanvasConfig(parts.At(1 + uOffsetHistoConfig + uCanv), 0);
} // for (UInt_t uCanv = 0; uCanv < pairHeader.second; ++uCanv) } // for (UInt_t uCanv = 0; uCanv < pairHeader.second; ++uCanv)
/// Decode the histograms data now that the configuration is loaded /// Decode the histograms data now that the configuration is loaded
ReceiveData(parts.At(1 + pairHeader.first + pairHeader.second), 0); ReceiveData(parts.At(1 + uOffsetHistoConfig + uOffsetCanvasConfig), 0);
LOG(info) << "CbmMqHistoServer::ReceiveConfigAndData => Finished processing composed message with " << parts.Size()
<< " parts";
return true; return true;
} }
...@@ -277,8 +296,10 @@ void CbmMqHistoServer::UpdateHttpServer() ...@@ -277,8 +296,10 @@ void CbmMqHistoServer::UpdateHttpServer()
void CbmMqHistoServer::PostRun() void CbmMqHistoServer::PostRun()
{ {
SaveHistograms();
fStopThread = true; fStopThread = true;
fThread.join(); fThread.join();
SaveHistograms();
} }
template<class HistoT> template<class HistoT>
...@@ -352,6 +373,7 @@ bool CbmMqHistoServer::ResetHistograms() ...@@ -352,6 +373,7 @@ bool CbmMqHistoServer::ResetHistograms()
} }
bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
{ {
LOG(debug) << " Extracting configuration for canvas index " << uCanvIdx;
CanvasConfig conf(ExtractCanvasConfigFromString(fvpsCanvasConfig[uCanvIdx].second)); CanvasConfig conf(ExtractCanvasConfigFromString(fvpsCanvasConfig[uCanvIdx].second));
/// First check if all objects to be drawn are present /// First check if all objects to be drawn are present
...@@ -369,6 +391,8 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) ...@@ -369,6 +391,8 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
} // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx ) } // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx )
} // for( uint32_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx ) } // for( uint32_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx )
LOG(info) << " All histos found for canvas " << conf.GetName().data() << ", now preparing it";
/// Create new canvas and pads /// Create new canvas and pads
TCanvas* pNewCanv = new TCanvas(conf.GetName().data(), conf.GetTitle().data()); TCanvas* pNewCanv = new TCanvas(conf.GetName().data(), conf.GetTitle().data());
pNewCanv->Divide(conf.GetNbPadsX(), conf.GetNbPadsY()); pNewCanv->Divide(conf.GetNbPadsX(), conf.GetNbPadsY());
...@@ -400,7 +424,10 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) ...@@ -400,7 +424,10 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
dynamic_cast<TH1*>(pObj)->Draw(conf.GetOption(uPadIdx, uObjIdx).data()); dynamic_cast<TH1*>(pObj)->Draw(conf.GetOption(uPadIdx, uObjIdx).data());
} // if( nullptr != dynamic_cast< TH1 *>( pObj ) ) } // if( nullptr != dynamic_cast< TH1 *>( pObj ) )
else else
LOG(warning) << "Unsupported object type for " << sName << " when preparing canvas " << conf.GetName(); LOG(warning) << " Unsupported object type for " << sName << " when preparing canvas " << conf.GetName();
LOG(info) << " Configured histo " << sName << " on pad " << (1 + uPadIdx) << " for canvas "
<< conf.GetName().data();
} // if( "nullptr" != sName ) } // if( "nullptr" != sName )
} // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx ) } // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx )
} // for( uint32_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx ) } // for( uint32_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx )
...@@ -409,7 +436,7 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx) ...@@ -409,7 +436,7 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
fServer->Register(Form("/%s", fvCanvas[uCanvIdx].second.data()), fvCanvas[uCanvIdx].first); fServer->Register(Form("/%s", fvCanvas[uCanvIdx].second.data()), fvCanvas[uCanvIdx].first);
fvbCanvasRegistered[uCanvIdx] = true; fvbCanvasRegistered[uCanvIdx] = true;
LOG(info) << "registered canvas " << fvCanvas[uCanvIdx].first->GetName() << " in folder " LOG(info) << " Registered canvas " << fvCanvas[uCanvIdx].first->GetName() << " in folder "
<< fvCanvas[uCanvIdx].second; << fvCanvas[uCanvIdx].second;
/// Update flag telling whether all known canvases are registered /// Update flag telling whether all known canvases are registered
...@@ -436,6 +463,8 @@ bool CbmMqHistoServer::SaveHistograms() ...@@ -436,6 +463,8 @@ bool CbmMqHistoServer::SaveHistograms()
// open separate histo file in recreate mode // open separate histo file in recreate mode
histoFile = new TFile(fsHistoFileName.data(), "RECREATE"); histoFile = new TFile(fsHistoFileName.data(), "RECREATE");
LOG(info) << "Save Histos in file " << fsHistoFileName.data();
if (nullptr == histoFile) return false; if (nullptr == histoFile) return false;
/// Register the histos in the HTTP server /// Register the histos in the HTTP server
......
...@@ -42,37 +42,37 @@ protected: ...@@ -42,37 +42,37 @@ protected:
private: private:
/// Parameters /// Parameters
std::string fsChannelNameHistosInput; std::string fsChannelNameHistosInput = "histogram-in";
std::string fsChannelNameHistosConfig; std::string fsChannelNameHistosConfig = "histo-conf";
std::string fsChannelNameCanvasConfig; std::string fsChannelNameCanvasConfig = "canvas-conf";
std::string fsHistoFileName; std::string fsHistoFileName = "MqHistos.root";
uint32_t fuHttpServerPort; uint32_t fuHttpServerPort = 8098;
/// Array of histograms with unique names /// Array of histograms with unique names
TObjArray fArrayHisto; TObjArray fArrayHisto;
/// Vector of string with ( HistoName, FolderPath ) to send to the histogram server /// Vector of string with ( HistoName, FolderPath ) to send to the histogram server
std::vector<std::pair<std::string, std::string>> fvpsHistosFolder; std::vector<std::pair<std::string, std::string>> fvpsHistosFolder = {};
/// Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server /// Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server
/// Format of Can config is "Name;Title;NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)" /// Format of Can config is "Name;Title;NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)"
/// Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)" /// Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)"
std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig; std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {};
std::vector<bool> fvbCanvasReady; std::vector<bool> fvbCanvasReady = {};
bool fbAllCanvasReady; bool fbAllCanvasReady = false;
std::vector<std::pair<TNamed*, std::string>> fvHistos; //! Vector of Histos pointers and folder path std::vector<std::pair<TNamed*, std::string>> fvHistos = {}; //! Vector of Histos pointers and folder path
std::vector<bool> fvbHistoRegistered; std::vector<bool> fvbHistoRegistered = {};
bool fbAllHistosRegistered; bool fbAllHistosRegistered = false;
std::vector<std::pair<TCanvas*, std::string>> fvCanvas; //! Vector of Canvas pointers and folder path std::vector<std::pair<TCanvas*, std::string>> fvCanvas = {}; //! Vector of Canvas pointers and folder path
std::vector<bool> fvbCanvasRegistered; std::vector<bool> fvbCanvasRegistered = {};
bool fbAllCanvasRegistered; bool fbAllCanvasRegistered = false;
/// Internal status /// Internal status
int fNMessages; int fNMessages = 0;
THttpServer* fServer; THttpServer* fServer = nullptr;
std::thread fThread; std::thread fThread;
bool fStopThread; bool fStopThread = false;
template<class HistoT> template<class HistoT>
bool ReadHistogram(HistoT* pHist); bool ReadHistogram(HistoT* pHist);
......
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQSamplerUnpackerParserverHitBuilder.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQSamplerUnpackerParserverHitBuilder.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQSamplerUnpackerParserverHitBuilder.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQSamplerUnpackerParserverHitBuilder.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQ_Mcbm.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQ_Mcbm.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQ_Mcbm.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQ_Mcbm.sh)
set(INCLUDE_DIRECTORIES set(INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CBMDATA_DIR} )
${CBMDATA_DIR}/base
${CBMDATA_DIR}/tof
${CBMBASE_DIR}
${CBMDETECTORBASE_DIR}/tof
)
Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${ZeroMQ_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${FAIRROOT_INCLUDE_DIR}
${FAIRLOGGER_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}/options
${VMC_INCLUDE_DIRS}
${IPC_INCLUDE_DIRECTORY}
${CBMROOT_SOURCE_DIR}/external/cppzmq
${CBMROOT_SOURCE_DIR}/reco/detectors/tof
)
include_directories(${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
${Boost_LIBRARY_DIRS}
)
link_directories(${LINK_DIRECTORIES})
# Set the install path within the build directory
set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/MQ/hitbuilder") set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/MQ/hitbuilder")
# Set the install path within the installation directory
set(BIN_DESTINATION bin/MQ/hitbuilder)
Set(BOOST_LIBS
${Boost_SYSTEM_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_LOG_LIBRARY}
)
If(UNIX AND NOT APPLE) If(UNIX AND NOT APPLE)
List(APPEND BOOST_LIBS pthread) List(APPEND BOOST_LIBS pthread)
EndIf() EndIf()
set(FAIR_LIBS
Base
ParBase
${FAIRMQ_LIBS}
)
If(FAIRLOGGER_FOUND)
set(FAIR_LIBS
${FAIR_LIBS}
FairLogger
)
EndIf()
set(EXE_NAME HitBuilderTof) set(EXE_NAME HitBuilderTof)
set(SRCS CbmDeviceHitBuilderTof.cxx runHitBuilderTof.cxx) set(SRCS CbmDeviceHitBuilderTof.cxx runHitBuilderTof.cxx)
set(DEPENDENCIES set(PUBLIC_DEPENDENCIES
${DEPENDENCIES}
# FairMQ
${FAIR_LIBS}
${BOOST_LIBS}
# fles_ipc
CbmBase
CbmData CbmData
CbmTofBase CbmTofBase
Geom CbmMQBase
Core FairRoot::Base
MathCore ROOT::Geom
Tree
Physics )
RIO
Net set(PRIVATE_DEPENDENCIES
Hist CbmBase
) CbmTofReco
GENERATE_EXECUTABLE() FairRoot::ParBase
FairRoot::Online
ROOT::Core
ROOT::Graf
ROOT::Hist
ROOT::MathCore
ROOT::Minuit
ROOT::Physics
)
set(INTERFACE_DEPENDENCIES
FairMQ::FairMQ
external::fles_ipc
ROOT::Net
ROOT::RIO
ROOT::Tree
)
generate_cbm_executable()
# Set the correct variables for the installation
set(VMCWORKDIR ${CMAKE_INSTALL_PREFIX}/share/cbmroot)
set(MY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CURRENT_SOURCE_DIR ${VMCWORKDIR}/input)
set(TMPDIR "${CMAKE_BINARY_DIR}")
set(CMAKE_BINARY_DIR ${CMAKE_INSTALL_PREFIX})
# Configure file for installation directory
configure_file(${MY_SOURCE_DIR}/startMQSamplerUnpackerParserverHitBuilder.sh.in ${TMPDIR}/bin/MQ/topologies/install/startMQSamplerUnpackerParserverHitBuilder.sh)
configure_file(${MY_SOURCE_DIR}/startMQ_Mcbm.sh.in ${TMPDIR}/bin/MQ/topologies/install/startMQ_Mcbm.sh)
install(PROGRAMS ${TMPDIR}/bin/MQ/topologies/install/startMQSamplerUnpackerParserverHitBuilder.sh
${TMPDIR}/bin/MQ/topologies/install/startMQ_Mcbm.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/MQ/topologies
)
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "FairRootManager.h" #include "FairRootManager.h"
#include "FairRunOnline.h" #include "FairRunOnline.h"
#include "FairRuntimeDb.h" #include "FairRuntimeDb.h"
#include "FairSource.h"
// ROOT Classes and includes // ROOT Classes and includes
#include "TClonesArray.h" #include "TClonesArray.h"
...@@ -55,7 +56,6 @@ ...@@ -55,7 +56,6 @@
#include "TROOT.h" #include "TROOT.h"
#include "TRandom3.h" #include "TRandom3.h"
#include "TVector3.h" #include "TVector3.h"
#include <thread> // this_thread::sleep_for
#include <boost/archive/binary_iarchive.hpp> #include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp> #include <boost/archive/binary_oarchive.hpp>
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <iomanip> #include <iomanip>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <thread> // this_thread::sleep_for
struct InitTaskError : std::runtime_error { struct InitTaskError : std::runtime_error {
using std::runtime_error::runtime_error; using std::runtime_error::runtime_error;
}; };
...@@ -78,6 +79,9 @@ static Double_t StartAnalysisTime = 0.; ...@@ -78,6 +79,9 @@ static Double_t StartAnalysisTime = 0.;
//const Double_t cLight = 29.9792; // in cm/ns //const Double_t cLight = 29.9792; // in cm/ns
static FairRootManager* rootMgr = NULL; static FairRootManager* rootMgr = NULL;
static Int_t iRunId = 1; static Int_t iRunId = 1;
static Int_t SelMask = DetMask;
static Double_t dTstart = 0.;
static Double_t dTmax = 0.;
CbmTofDigi* pRef; CbmTofDigi* pRef;
CbmTofDigi* pRefCal; CbmTofDigi* pRefCal;
...@@ -133,7 +137,11 @@ CbmDeviceHitBuilderTof::CbmDeviceHitBuilderTof() ...@@ -133,7 +137,11 @@ CbmDeviceHitBuilderTof::CbmDeviceHitBuilderTof()
, fvPulserOffset() , fvPulserOffset()
, fvPulserTimes() , fvPulserTimes()
, fhEvDetMul(NULL) , fhEvDetMul(NULL)
, fhEvDigiMul(NULL)
, fhEvRateIn(NULL)
, fhEvRateOut(NULL)
, fhPulMul(NULL) , fhPulMul(NULL)
, fhDigiTdif(NULL)
, fhPulserTimesRaw() , fhPulserTimesRaw()
, fhPulserTimeRawEvo() , fhPulserTimeRawEvo()
, fhPulserTimesCor() , fhPulserTimesCor()
...@@ -297,6 +305,7 @@ Bool_t CbmDeviceHitBuilderTof::InitWorkspace() ...@@ -297,6 +305,7 @@ Bool_t CbmDeviceHitBuilderTof::InitWorkspace()
fiPulDetRef = fConfig->GetValue<uint64_t>("PulDetRef"); fiPulDetRef = fConfig->GetValue<uint64_t>("PulDetRef");
fiPulTotMin = fConfig->GetValue<uint64_t>("PulTotMin"); fiPulTotMin = fConfig->GetValue<uint64_t>("PulTotMin");
fiPulTotMax = fConfig->GetValue<uint64_t>("PulTotMax"); fiPulTotMax = fConfig->GetValue<uint64_t>("PulTotMax");
dTmax = (Double_t) fConfig->GetValue<uint64_t>("ReqTint");
//fTofCalDigisColl = new TClonesArray("CbmTofDigi", 100); //fTofCalDigisColl = new TClonesArray("CbmTofDigi", 100);
//fTofCalDigisCollOut = new TClonesArray("CbmTofDigi", 100); //fTofCalDigisCollOut = new TClonesArray("CbmTofDigi", 100);
...@@ -362,11 +371,13 @@ Bool_t CbmDeviceHitBuilderTof::InitRootOutput() ...@@ -362,11 +371,13 @@ Bool_t CbmDeviceHitBuilderTof::InitRootOutput()
fEvtHeader = new FairEventHeader(); fEvtHeader = new FairEventHeader();
fEvtHeader->SetRunId(iRunId); fEvtHeader->SetRunId(iRunId);
rootMgr->Register("EventHeader.", "Event", fEvtHeader, kTRUE); rootMgr->Register("EventHeader.", "Event", fEvtHeader, kTRUE);
rootMgr->FillEventHeader(fEvtHeader); auto source = rootMgr->GetSource();
if (source) { source->FillEventHeader(fEvtHeader); }
// rootMgr->Register("CbmTofDigi", "Tof raw Digi", fTofCalDigisColl, kTRUE); // rootMgr->Register("CbmTofDigi", "Tof raw Digi", fTofCalDigisColl, kTRUE);
// fOutRootFile->cd(); // fOutRootFile->cd();
rootMgr->RegisterAny("TofCalDigi", fTofCalDigiVec, kTRUE); // rootMgr->RegisterAny("TofCalDigi", fTofCalDigiVec, kTRUE);
rootMgr->RegisterAny("TofDigi", fTofCalDigiVec, kTRUE);
TTree* outTree = new TTree(FairRootManager::GetTreeName(), "/cbmout", 99); TTree* outTree = new TTree(FairRootManager::GetTreeName(), "/cbmout", 99);
LOG(info) << "define Tree " << outTree->GetName(); LOG(info) << "define Tree " << outTree->GetName();
...@@ -427,7 +438,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers() ...@@ -427,7 +438,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
if (Send(req, Channel) > 0) { if (Send(req, Channel) > 0) {
if (Receive(rep, Channel) >= 0) { if (Receive(rep, Channel) >= 0) {
if (rep->GetSize() != 0) { if (rep->GetSize() != 0) {
CbmMQTMessage tmsg(rep->GetData(), rep->GetSize()); CbmMqTMessage tmsg(rep->GetData(), rep->GetSize());
switch (iSet) { switch (iSet) {
case 0: case 0:
fDigiPar = static_cast<CbmTofDigiPar*>(tmsg.ReadObject(tmsg.GetClass())); fDigiPar = static_cast<CbmTofDigiPar*>(tmsg.ReadObject(tmsg.GetClass()));
...@@ -475,9 +486,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers() ...@@ -475,9 +486,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
tofDigiPar->Init(); tofDigiPar->Init();
fDigiPar = (CbmTofDigiPar*) (fRtdb->getContainer("CbmTofDigiPar")); fDigiPar = (CbmTofDigiPar*) (fRtdb->getContainer("CbmTofDigiPar"));
if (NULL == fDigiPar) { if (NULL == fDigiPar) {
LOG(error) << "CbmTofEventClusterizer::InitParameters => " LOG(error) << "CbmTofEventClusterizer::InitParameters => Could not obtain CbmTofDigiPar";
"Could not obtain "
"the CbmTofDigiPar ";
return kFALSE; return kFALSE;
} }
} }
...@@ -502,11 +511,22 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers() ...@@ -502,11 +511,22 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
if (!InitCalibParameter()) return kFALSE; // ChangeState(PAUSE); // for debugging if (!InitCalibParameter()) return kFALSE; // ChangeState(PAUSE); // for debugging
fDutAddr = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId); fDutAddr = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId);
fSelAddr = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId); fSelAddr = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId);
fSel2Addr = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id); fSel2Addr = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id);
fiBeamRefAddr = CbmTofAddress::GetUniqueAddress(fiBeamRefSm, fiBeamRefDet, 0, 0, fiBeamRefType); if (fiBeamRefType > -1) {
iIndexDut = fDigiBdfPar->GetDetInd(fDutAddr); if (fiBeamRefDet > -1) {
fiBeamRefAddr = CbmTofAddress::GetUniqueAddress(fiBeamRefSm, fiBeamRefDet, 0, 0, fiBeamRefType);
}
else {
SelMask = ModMask;
fiBeamRefAddr = CbmTofAddress::GetUniqueAddress(fiBeamRefSm, 0, 0, 0, fiBeamRefType);
}
}
else
fiBeamRefAddr = -1;
iIndexDut = fDigiBdfPar->GetDetInd(fDutAddr);
LOG(info) << Form("Use Dut 0x%08x, Sel 0x%08x, Sel2 0x%08x, BRef 0x%08x", fDutAddr, fSelAddr, fSel2Addr, LOG(info) << Form("Use Dut 0x%08x, Sel 0x%08x, Sel2 0x%08x, BRef 0x%08x", fDutAddr, fSelAddr, fSel2Addr,
fiBeamRefAddr); fiBeamRefAddr);
return initOK; return initOK;
...@@ -534,7 +554,8 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/) ...@@ -534,7 +554,8 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
std::istringstream issE(msgStrE); std::istringstream issE(msgStrE);
boost::archive::binary_iarchive inputArchiveE(issE); boost::archive::binary_iarchive inputArchiveE(issE);
inputArchiveE >> fEventHeader; inputArchiveE >> fEventHeader;
LOG(debug) << "EventHeader: " << fEventHeader[0] << " " << fEventHeader[1] << " " << fEventHeader[2]; LOG(debug) << "EventHeader: " << fEventHeader[0] << " " << fEventHeader[1] << " " << fEventHeader[2] << " "
<< fEventHeader[3] << " " << fEventHeader[4];
fiNDigiIn = 0; fiNDigiIn = 0;
// LOG(debug) << "Received message # "<< fNumMessages // LOG(debug) << "Received message # "<< fNumMessages
...@@ -591,6 +612,38 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/) ...@@ -591,6 +612,38 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
fvDigiIn.resize(fiNDigiIn); fvDigiIn.resize(fiNDigiIn);
for (int iDigi = 0; iDigi < fiNDigiIn; iDigi++) { for (int iDigi = 0; iDigi < fiNDigiIn; iDigi++) {
fvDigiIn[iDigi] = *vdigi[iDigi]; fvDigiIn[iDigi] = *vdigi[iDigi];
// Remap Digis for v21a_cosmicHD
if (1) {
int iSmType = 8;
int iSm = -1;
int iRpc = 0;
int iDetId = 0;
CbmTofDigi* pDigi = &fvDigiIn[iDigi];
if (pDigi->GetType() == 6 && pDigi->GetRpc() == 1) {
switch ((int) (pDigi->GetChannel() * 2 + pDigi->GetSide())) {
case 62: //800
iSm = 0;
break;
case 46: //810
iSm = 1;
break;
case 22: //820
iSm = 2;
break;
case 2: //830
iSm = 3;
break;
default:;
}
if (iSm > -1) {
iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType);
pDigi->SetAddress(iDetId);
}
}
} //remapping end
delete vdigi[iDigi]; delete vdigi[iDigi];
} }
vdigi.clear(); vdigi.clear();
...@@ -625,6 +678,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/) ...@@ -625,6 +678,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
fdEvent++; fdEvent++;
fhEvDetMul->Fill((Double_t) fEventHeader[1]); fhEvDetMul->Fill((Double_t) fEventHeader[1]);
fhEvDigiMul->Fill(fiNDigiIn);
if (fiNDigiIn > 0) {
if (dTstart == 0) {
dTstart = fvDigiIn[0].GetTime() + fEventHeader[4];
LOG(info) << "Start time set to " << dTstart / 1.E9 << " sec ";
}
fhEvRateIn->Fill((fvDigiIn[0].GetTime() + fEventHeader[4] - dTstart) / 1.E9);
}
if (!InspectRawDigis()) return kFALSE; if (!InspectRawDigis()) return kFALSE;
if (fiPulserMode > 0) if (fiPulserMode > 0)
...@@ -634,11 +695,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/) ...@@ -634,11 +695,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
//if(!MergeClusters()) return kFALSE; //if(!MergeClusters()) return kFALSE;
if (NULL != fOutRootFile) { // CbmEvent output to root file if (NULL != fOutRootFile) { // CbmEvent output to root file
rootMgr->FillEventHeader(fEvtHeader); fEvtHeader->SetEventTime((double) fEventHeader[4]);
auto source = rootMgr->GetSource();
if (source) { source->FillEventHeader(fEvtHeader); }
//LOG(info) << "Fill WriteOutBuffer with rootMgr at " << rootMgr; //LOG(info) << "Fill WriteOutBuffer with rootMgr at " << rootMgr;
fOutRootFile->cd(); fOutRootFile->cd();
rootMgr->Fill(); rootMgr->Fill();
rootMgr->StoreWriteoutBufferData(rootMgr->GetEventTime()); rootMgr->StoreWriteoutBufferData(rootMgr->GetEventTime());
fhEvRateOut->Fill((fvDigiIn[0].GetTime() + fEventHeader[4] - dTstart) / 1.E9);
//rootMgr->StoreAllWriteoutBufferData(); //rootMgr->StoreAllWriteoutBufferData();
rootMgr->DeleteOldWriteoutBufferData(); rootMgr->DeleteOldWriteoutBufferData();
if ((Int_t) fdEvent == fiMaxEvent) { if ((Int_t) fdEvent == fiMaxEvent) {
...@@ -928,31 +992,37 @@ void CbmDeviceHitBuilderTof::CreateHistograms() ...@@ -928,31 +992,37 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
TDirectory* oldir = gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager! TDirectory* oldir = gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
gROOT->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager ! gROOT->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
// process event header info // process event header info
fhEvDetMul = new TH1F("hEvDetMul", "Detector multiplicity of Selector; Mul", 50, 0, 50); fhEvDetMul = new TH1F("hEvDetMul", "Detector multiplicity of Selector; Mul", 50, 0, 50);
fhPulMul = new TH1F("hPulMul", "Pulser multiplicity; Mul", 110, 0, 110); fhEvDigiMul = new TH1F("hEvDigiMul", "Digi multiplicity of Selector; Mul", 1000, 0, 10000);
fhEvRateIn = new TH1F("hEvRateIn", "Incoming Event rate; time (s); rate (Hz)", 10000, 0, 10000);
fhEvRateOut = new TH1F("hEvRateOut", "Outgoing Event rate; time (s); rate (Hz)", 10000, 0, 10000);
fhPulMul = new TH1F("hPulMul", "Pulser multiplicity; Mul", 110, 0, 110);
fhDigiTdif = new TH1F("hDigiTdif", "Digi time difference; #Deltat ns)", 8000, -20, 20);
Int_t iNDet = 0; Int_t iNDet = 0;
dTmax *= 2; // cover full range of selector
for (Int_t iModTyp = 0; iModTyp < 10; iModTyp++) for (Int_t iModTyp = 0; iModTyp < 10; iModTyp++)
iNDet += fDigiBdfPar->GetNbSm(iModTyp) * fDigiBdfPar->GetNbRpc(iModTyp); iNDet += fDigiBdfPar->GetNbSm(iModTyp) * fDigiBdfPar->GetNbRpc(iModTyp);
fhPulserTimesRaw = new TH2F(Form("hPulserTimesRaw"), Form("Pulser Times uncorrected; Det# []; t - t0 [ns]"), fhPulserTimesRaw = new TH2F(Form("hPulserTimesRaw"), Form("Pulser Times uncorrected; Det# []; t - t0 [ns]"),
iNDet * 2, 0, iNDet * 2, 999, -100., 100.); iNDet * 2, 0, iNDet * 2, 999, -dTmax, dTmax);
fhPulserTimeRawEvo.resize(iNDet * 2); fhPulserTimeRawEvo.resize(iNDet * 2);
for (Int_t iDetSide = 0; iDetSide < iNDet * 2; iDetSide++) { for (Int_t iDetSide = 0; iDetSide < iNDet * 2; iDetSide++) {
fhPulserTimeRawEvo[iDetSide] = new TProfile( fhPulserTimeRawEvo[iDetSide] = new TProfile(
Form("hPulserTimeRawEvo_%d", iDetSide), Form("hPulserTimeRawEvo_%d", iDetSide),
Form("Raw Pulser TimeEvolution %d; PulserEvent# ; DeltaT [ns] ", iDetSide), 1000, 0., 1.E5, -100., 100.); Form("Raw Pulser TimeEvolution %d; PulserEvent# ; DeltaT [ns] ", iDetSide), 1000, 0., 1.E5, -dTmax, dTmax);
} }
fhPulserTimesCor = new TH2F(Form("hPulserTimesCor"), Form("Pulser Times corrected; Det# []; t - t0 [ns]"), iNDet * 2, fhPulserTimesCor = new TH2F(Form("hPulserTimesCor"), Form("Pulser Times corrected; Det# []; t - t0 [ns]"), iNDet * 2,
0, iNDet * 2, 999, -10., 10.); 0, iNDet * 2, 999, -10., 10.);
fhDigiTimesRaw = new TH2F(Form("hDigiTimesRaw"), Form("Digi Times uncorrected; Det# []; t - t0 [ns]"), iNDet * 2, 0, fhDigiTimesRaw = new TH2F(Form("hDigiTimesRaw"), Form("Digi Times uncorrected; Det# []; t - t0 [ns]"), iNDet * 2, 0,
iNDet * 2, 999, -100., 100.); iNDet * 2, 999, -dTmax, dTmax);
fhDigiTimesCor = new TH2F(Form("hDigiTimesCor"), Form("Digi Times corrected; Det# []; t - t0 [ns]"), iNDet * 2, 0, fhDigiTimesCor = new TH2F(Form("hDigiTimesCor"), Form("Digi Times corrected; Det# []; t - t0 [ns]"), iNDet * 2, 0,
iNDet * 2, 999, -100., 100.); iNDet * 2, 999, -dTmax, dTmax);
fhBucDigiCor = new TH2F(Form("hBucDigiCor"), Form("Buc Digi Correlation; ch1 []; ch2 []"), 128, 0, 128, 128, 0, 128); fhBucDigiCor = new TH2F(Form("hBucDigiCor"), Form("Buc Digi Correlation; ch1 []; ch2 []"), 128, 0, 128, 128, 0, 128);
...@@ -968,7 +1038,10 @@ void CbmDeviceHitBuilderTof::CreateHistograms() ...@@ -968,7 +1038,10 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
Int_t iSmType = CbmTofAddress::GetSmType(iUniqueId); Int_t iSmType = CbmTofAddress::GetSmType(iUniqueId);
Int_t iSmId = CbmTofAddress::GetSmId(iUniqueId); Int_t iSmId = CbmTofAddress::GetSmId(iUniqueId);
Int_t iRpcId = CbmTofAddress::GetRpcId(iUniqueId); Int_t iRpcId = CbmTofAddress::GetRpcId(iUniqueId);
fhRpcDigiTot[iDetIndx] = new TH2F( LOG(info) << "Index map entry " << iDetIndx << ": TSR " << iSmType << iSmId << iRpcId
<< Form(", addr 0x%08x", iUniqueId);
fhRpcDigiTot[iDetIndx] = new TH2F(
Form("hDigiTot_SmT%01d_sm%03d_rpc%03d", iSmType, iSmId, iRpcId), Form("hDigiTot_SmT%01d_sm%03d_rpc%03d", iSmType, iSmId, iRpcId),
Form("Digi Tot of Rpc #%03d in Sm %03d of type %d; digi 0; digi 1", iRpcId, iSmId, iSmType), Form("Digi Tot of Rpc #%03d in Sm %03d of type %d; digi 0; digi 1", iRpcId, iSmId, iSmType),
2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 0, 2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 256, 0, 256); 2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 0, 2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 256, 0, 256);
...@@ -1046,7 +1119,7 @@ void CbmDeviceHitBuilderTof::CreateHistograms() ...@@ -1046,7 +1119,7 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
fhSmCluFpar[iS][iPar] = new TProfile(Form("cl_SmT%01d_Fpar%1d", iS, iPar), fhSmCluFpar[iS][iPar] = new TProfile(Form("cl_SmT%01d_Fpar%1d", iS, iPar),
Form("Clu Fpar %d in SmType %d; Sm+Rpc# []; value ", iPar, iS), Form("Clu Fpar %d in SmType %d; Sm+Rpc# []; value ", iPar, iS),
fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), 0, fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), 0,
fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), -100., 100.); fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), -dTmax, dTmax);
} }
else else
fhSmCluFpar[iS][iPar] = (TProfile*) hFparcur->Clone(); fhSmCluFpar[iS][iPar] = (TProfile*) hFparcur->Clone();
...@@ -1444,28 +1517,26 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis() ...@@ -1444,28 +1517,26 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis()
for (Int_t iDigInd = 0; iDigInd < fiNDigiIn; iDigInd++) { for (Int_t iDigInd = 0; iDigInd < fiNDigiIn; iDigInd++) {
CbmTofDigi* pDigi = &fvDigiIn[iDigInd]; CbmTofDigi* pDigi = &fvDigiIn[iDigInd];
//LOG(debug)<<iDigInd<<" "<<pDigi; //LOG(debug)<<iDigInd<<" "<<pDigi;
Int_t iAddr = pDigi->GetAddress() & DetMask;
Int_t iDetIndx = fDigiBdfPar->GetDetInd(iAddr);
/* /*
LOG(debug)<<iDigInd LOG(info)<<iDigInd
//<<Form(" Address : 0x%08x ",pDigi->GetAddress()) //<<Form(" Address : 0x%08x ",pDigi->GetAddress())
<<" TSRC " << pDigi->GetType() <<Form(" TSRCS %d%d%d%02d%d ", (int)pDigi->GetType(),
<< pDigi->GetSm() (int)pDigi->GetSm(),(int)pDigi->GetRpc(),(int)pDigi->GetChannel(),(int)pDigi->GetSide())
<< pDigi->GetRpc() <<" : " << Form("Ind %2d, T %15.3f, Tot %5.1f",iDetIndx,pDigi->GetTime(),pDigi->GetTot());
<< pDigi->GetChannel()
<<" S " << pDigi->GetSide()
<<" : " << pDigi->ToString();
*/ */
Int_t iAddr = pDigi->GetAddress() & DetMask;
if (iAddr == fiBeamRefAddr) { if (fiBeamRefAddr < 0 || iAddr == fiBeamRefAddr) {
//LOG(debug) << Form("Ref digi found for 0x%08x, Mask 0x%08x ", fiBeamRefAddr, DetMask); //LOG(debug) << Form("Ref digi found for 0x%08x, Mask 0x%08x ", fiBeamRefAddr, DetMask);
if (NULL == pRef) pRef = pDigi; if (NULL == pRef) pRef = pDigi;
else { else {
if (pDigi->GetTime() < pRef->GetTime()) pRef = pDigi; if (pDigi->GetTime() < pRef->GetTime()) pRef = pDigi;
} }
} }
Int_t iDetIndx = fDigiBdfPar->GetDetInd(iAddr);
if (fDigiBdfPar->GetNbDet() - 1 < iDetIndx || iDetIndx < 0) { if (fDigiBdfPar->GetNbDet() - 1 < iDetIndx || iDetIndx < 0) {
LOG(debug) << Form(" Wrong DetIndx %d >< %d,0 ", iDetIndx, fDigiBdfPar->GetNbDet()); LOG(warn) << Form(" Wrong DetIndx %d >< %d,0 ", iDetIndx, fDigiBdfPar->GetNbDet());
break; break;
} }
...@@ -1483,12 +1554,20 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis() ...@@ -1483,12 +1554,20 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis()
// for (Int_t iDigI2 =iDigInd+1; iDigI2<iNbTofDigi;iDigI2++){ // for (Int_t iDigI2 =iDigInd+1; iDigI2<iNbTofDigi;iDigI2++){
for (Int_t iDigI2 = 0; iDigI2 < iNbTofDigi; iDigI2++) { for (Int_t iDigI2 = 0; iDigI2 < iNbTofDigi; iDigI2++) {
CbmTofDigi* pDigi2 = &fvDigiIn[iDigI2]; CbmTofDigi* pDigi2 = &fvDigiIn[iDigI2];
if (pDigi != pDigi2) { fhDigiTdif->Fill(pDigi->GetTime() - pDigi2->GetTime()); }
if (pDigi->GetAddress() != pDigi2->GetAddress()) if (pDigi->GetAddress() != pDigi2->GetAddress())
if (pDigi->GetType() == 6 && pDigi2->GetType() == 6) if (pDigi->GetType() == 6 && pDigi2->GetType() == 6)
fhBucDigiCor->Fill(pDigi->GetRpc() * 64 + pDigi->GetChannel() * 2 + pDigi->GetSide(), fhBucDigiCor->Fill(pDigi->GetRpc() * 64 + pDigi->GetChannel() * 2 + pDigi->GetSide(),
pDigi2->GetRpc() * 64 + pDigi2->GetChannel() * 2 + pDigi2->GetSide()); pDigi2->GetRpc() * 64 + pDigi2->GetChannel() * 2 + pDigi2->GetSide());
if (iDetIndx == fDigiBdfPar->GetDetInd(pDigi2->GetAddress())) { if (iDetIndx == fDigiBdfPar->GetDetInd(pDigi2->GetAddress())) {
/*
LOG(info) <<" Correlate DetIndx "<<iDetIndx
<<Form(", TSRCS %d%d%d%02d%d ", (int)pDigi->GetType(),
(int)pDigi->GetSm(),(int)pDigi->GetRpc(),(int)pDigi->GetChannel(),(int)pDigi->GetSide())
<<Form(" with %d%d%d%02d%d ", (int)pDigi2->GetType(),
(int)pDigi2->GetSm(),(int)pDigi2->GetRpc(),(int)pDigi2->GetChannel(),(int)pDigi2->GetSide());
*/
if (0. == pDigi->GetSide() && 1. == pDigi2->GetSide()) { if (0. == pDigi->GetSide() && 1. == pDigi2->GetSide()) {
fhRpcDigiCor[iDetIndx]->Fill(pDigi->GetChannel(), pDigi2->GetChannel()); fhRpcDigiCor[iDetIndx]->Fill(pDigi->GetChannel(), pDigi2->GetChannel());
} }
...@@ -1664,6 +1743,7 @@ Bool_t CbmDeviceHitBuilderTof::CalibRawDigis() ...@@ -1664,6 +1743,7 @@ Bool_t CbmDeviceHitBuilderTof::CalibRawDigis()
<<Form("%f",pDigi->GetTime())<<" " <<Form("%f",pDigi->GetTime())<<" "
<<pDigi->GetTot(); <<pDigi->GetTot();
*/ */
if (fbPs2Ns) { if (fbPs2Ns) {
pCalDigi->SetTime(pCalDigi->GetTime() / 1000.); // for backward compatibility pCalDigi->SetTime(pCalDigi->GetTime() / 1000.); // for backward compatibility
pCalDigi->SetTot(pCalDigi->GetTot() / 1000.); // for backward compatibility pCalDigi->SetTot(pCalDigi->GetTot() / 1000.); // for backward compatibility
...@@ -3735,7 +3815,7 @@ Bool_t CbmDeviceHitBuilderTof::MonitorPulser() ...@@ -3735,7 +3815,7 @@ Bool_t CbmDeviceHitBuilderTof::MonitorPulser()
} }
if (iDigi0 == -1) { if (iDigi0 == -1) {
LOG(error) << Form("Pulser reference %d not found in pulser event %d of mul %d, return", iDet0, iNPulserFound, LOG(debug) << Form("Pulser reference %d not found in pulser event %d of mul %d, return", iDet0, iNPulserFound,
fiNDigiIn); fiNDigiIn);
return kTRUE; return kTRUE;
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#ifndef CBMDEVICEHITBUILDERTOF_H_ #ifndef CBMDEVICEHITBUILDERTOF_H_
#define CBMDEVICEHITBUILDERTOF_H_ #define CBMDEVICEHITBUILDERTOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofAddress.h" // in cbmdata/tof #include "CbmTofAddress.h" // in cbmdata/tof
#include "CbmTofGeoHandler.h" // in tof/TofTools #include "CbmTofGeoHandler.h" // in tof/TofTools
...@@ -30,7 +31,6 @@ ...@@ -30,7 +31,6 @@
#include <map> #include <map>
#include <vector> #include <vector>
class CbmMQTMessage;
class CbmHistManager; class CbmHistManager;
// Relevant TOF classes // Relevant TOF classes
class CbmTofDigi; class CbmTofDigi;
...@@ -119,7 +119,7 @@ private: ...@@ -119,7 +119,7 @@ private:
// Input variables // Input variables
Int_t fiNDigiIn; Int_t fiNDigiIn;
std::vector<CbmTofDigi> fvDigiIn; std::vector<CbmTofDigi> fvDigiIn;
std::vector<int> fEventHeader; std::vector<uint64_t> fEventHeader;
FairEventHeader* fEvtHeader; FairEventHeader* fEvtHeader;
// Output variables // Output variables
...@@ -180,7 +180,11 @@ private: ...@@ -180,7 +180,11 @@ private:
// histograms // histograms
TH1* fhEvDetMul; TH1* fhEvDetMul;
TH1* fhEvDigiMul;
TH1* fhEvRateIn;
TH1* fhEvRateOut;
TH1* fhPulMul; TH1* fhPulMul;
TH1* fhDigiTdif;
TH2* fhPulserTimesRaw; TH2* fhPulserTimesRaw;
std::vector<TProfile*> fhPulserTimeRawEvo; std::vector<TProfile*> fhPulserTimeRawEvo;
TH2* fhPulserTimesCor; TH2* fhPulserTimesCor;
...@@ -286,10 +290,4 @@ private: ...@@ -286,10 +290,4 @@ private:
TFile* fOutRootFile; // pointer to root output file TFile* fOutRootFile; // pointer to root output file
}; };
// special class to expose protected TMessage constructor
class CbmMQTMessage : public TMessage {
public:
CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) { ResetBit(kIsOwner); }
};
#endif /* CBMDEVICEHITBUILDERTOF_H_ */ #endif /* CBMDEVICEHITBUILDERTOF_H_ */
/* Copyright (C) 2018 PI-UHd, GSI
SPDX-License-Identifier: GPL-3.0-only
Authors: E. Cordier, Norbert Herrmann [committer] */
/**
* \file CbmTofHit.h
* \author E. Cordier
* Modified by D. Gonzalez-Diaz 06/09/06
* Modified by A.Lebedev 26/05/09
* Modified by nh 16/12/12
* Modified by A.Lebedev 15/05/13
**/
#ifndef CBMTOFHIT_H_
#define CBMTOFHIT_H_
#include "CbmPixelHit.h"
#include "TMath.h"
#include <boost/serialization/access.hpp>
#include <boost/serialization/base_object.hpp>
class CbmTofHit : public CbmPixelHit {
public:
/**
* \brief Default constructor.
**/
CbmTofHit();
/**
* \brief Constructor with hit parameters (1b).
**/
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t time, Double_t dtime, Int_t flag,
Int_t channel);
/**
* \brief Constructor with hit parameters (1a).
**/
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof, Int_t flag, Int_t channel);
/**
* \brief Constructor with hit parameters (1).
**/
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof, Int_t flag);
/**
* \brief Constructor with hit parameters (2) [not the flag]
**/
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof);
/**
* \brief Destructor.
**/
virtual ~CbmTofHit();
/**
* \brief Inherited from CbmBaseHit.
*/
virtual std::string ToString() const;
/**
* \brief Inherited from CbmBaseHit.
*/
Int_t GetPlaneId() const { return 0; }
/** Accessors **/
Int_t GetFlag() const { return fFlag; }
Int_t GetCh() const { return fChannel; }
Double_t GetR() const { return TMath::Sqrt(GetX() * GetX() + GetY() * GetY() + GetZ() * GetZ()); }
Double_t GetRt() const { return TMath::Sqrt(GetX() * GetX() + GetY() * GetY()); }
Double_t GetCosThe() const { return GetZ() / GetR(); }
Double_t GetSinThe() const { return TMath::Sqrt(GetX() * GetX() + GetY() * GetY()) / GetR(); }
Double_t GetCosPhi() const { return GetX() / GetRt(); }
Double_t GetSinPhi() const { return GetY() / GetRt(); }
/** Modifiers **/
void SetFlag(Int_t flag) { fFlag = flag; };
// Make this method otherwise inherited from CbmHit through CbmPixelHit
// private to prevent its usage
Int_t GetRefId() const __attribute__((deprecated)) { return -1; }
// Field is instead used to store the number of strips used to generate the hit
Int_t GetClusterSize() { return CbmHit::GetRefId(); }
private:
Int_t fFlag; ///< Flag for general purposes [TDC, event tagging...]
Int_t fChannel; ///< Channel identifier
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& fFlag;
ar& fChannel;
}
ClassDef(CbmTofHit, 4)
};
#endif
...@@ -20,6 +20,8 @@ void addCustomOptions(bpo::options_description& options) ...@@ -20,6 +20,8 @@ void addCustomOptions(bpo::options_description& options)
options.add_options()("PulTotMin", bpo::value<uint64_t>()->default_value(0), "Min Tot value"); options.add_options()("PulTotMin", bpo::value<uint64_t>()->default_value(0), "Min Tot value");
options.add_options()("PulTotMax", bpo::value<uint64_t>()->default_value(0), "Max Tot value"); options.add_options()("PulTotMax", bpo::value<uint64_t>()->default_value(0), "Max Tot value");
options.add_options()("ReqTint", bpo::value<uint64_t>()->default_value(50), "Coincidence time interval");
options.add_options()("DutType", bpo::value<uint64_t>()->default_value(0), "Dut type identifier"); options.add_options()("DutType", bpo::value<uint64_t>()->default_value(0), "Dut type identifier");
options.add_options()("DutSm", bpo::value<uint64_t>()->default_value(0), "Dut module number"); options.add_options()("DutSm", bpo::value<uint64_t>()->default_value(0), "Dut module number");
options.add_options()("DutRpc", bpo::value<uint64_t>()->default_value(1), "Dut counter number"); options.add_options()("DutRpc", bpo::value<uint64_t>()->default_value(1), "Dut counter number");
......
#!/bin/bash
#SBATCH -J MQevb
#SBATCH -D /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/topologies
#SBATCH --time=6-00:00:00
#SBATCH --mem=4000
#SBATCH --partition=long
X=$((${SLURM_ARRAY_TASK_ID} - 0))
XXX=$(printf "%03d" "$X")
#$FAIRROOTPATH/bin/shmmonitor --cleanup
node=`hostname`
nodeStatus=`ps uaxwww | grep parmq`
nodeOK=`echo $nodeStatus | grep ParServ`
if [[ $nodeOK != "" ]]; then
echo parmq already running on node $node: $nodeOK, exiting ...
exit 0
fi
echo node check on $node passed, stop eventually relict processes
./stop_MQ.sh
#exit 0 ## debug exit
if [ -z "$1" ]; then
_runname="359"
else
_runname=$1
fi
if [ -z "$2" ]; then
_reqmod=-193
else
_reqmod=$2
fi
if [ -z "$3" ]; then
_pulmode=1
else
_pulmode=$3
fi
if [ -z "$4" ]; then
_reqtint=100
else
_reqtint=$4
fi
_Opt=$5
#_ntimeslices=-1
_ntimeslices=10000
_iUnp=4
_batch=1
_pulmulmin=5
_pultotmin=50
_pultotmax=500
#_puldetref=12 # TSR=022
#_puldetref=16 # TSR=032
_puldetref=16 # TSR=031
#_tofftof=0.
_tofftof=-35.
if [[ $_reqmod -eq 1 ]]; then
_iUnp=1
fi
#_dirname=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/input/$_runname/
_outdir=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/data/
#_datapath=~/KRONOS/CBM/cbmroot/trunk
#_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/
#_outdir=$_datapath/macro/beamtime/mcbm2018/data/
#_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa"
#_filename="./tsaData2020/${_runname}_pn02_*.tsa;./tsaData2020/${_runname}_pn04_*.tsa;./tsaData2020/${_runname}_pn05_*.tsa;./tsaData2020/${_runname}_pn06_*.tsa;./tsaData2020/${_runname}_pn08_*.tsa;./tsaData2020/${_runname}_pn10_*.tsa;./tsaData2020/${_runname}_pn11_*.tsa;./tsaData2020/${_runname}_pn12_*.tsa;./tsaData2020/${_runname}_pn13_*.tsa;./tsaData2020/${_runname}_pn15_*.tsa"
if [ $_runname -lt 1400 ]; then
_dirname=""
_filename="./tsaData2021/${_runname}_node8_*.tsa;./tsaData2021/${_runname}_node9_*.tsa"
_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21b_mcbm.digibdf.par
else
if [ $_runname -lt 1384 ]; then
_dirname=`ls -d /lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/input06/r${_runname}*` # double stack AFCK
else
_dirname=`ls -d /lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/inp07/r${_runname}*` # triple stack AFCK
fi
_filename="r${_runname}*.tsa"
_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21c_mcbm.digibdf.par
echo dir: $_dirname
echo file: $_filename
fi
_digifile=$_runname.$_reqtint.$_reqmod.${_pulmode}${_Opt}.root
# ASCII files
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/MQ/hitbuilder/MapTofGbtx.par
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar.par
if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_2Stack.par
else
if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_3Stack.par
_puldetref=12 # TSR=022
else
if [ $_runname -ge 1079 ] && [ $_runname -lt 1086 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar2Stack.par
else
if [ $_runname -lt 1172 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524_DirectBeam.par
else
if [ $_runname -lt 1600 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524.par
else
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524.par
fi
fi
fi
fi
fi
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/etofPar.par
#_digibdffile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/v18j_cosmicHD.digibdf.par
#_digiparfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v18j_cosmicHD.digi.par
#_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21a_mcbm.digibdf.par
#_digiparfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v19b_mcbm.digi.par
# ROOT files
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root
_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_02.par.root
# MQ ports
_pPar=5603
_pSam=5613
_pCmd=5623
_pDig=5633
#rm -v nohup.out
#rm -v *log
rm all_*
PARAMETERSERVER="parmq-server"
echo pkill $PARAMETERSERVER
pkill -9 $PARAMETERSERVER
sleep 1
PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --channel-name parameters"
PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
#PARAMETERSERVER+=" --libs-to-load libCbmTof;libCbmFlibMcbm2018"
#PARAMETERSERVER+=" --first-input-name $_mapfile;$_digiparfile;$_digibdffile"
PARAMETERSERVER+=" --first-input-name $_mapfile;$_digibdffile"
PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
else
xterm -geometry 80x23+0+340 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
#xterm -geometry 80x23+500+0 -hold -e /cvmfs/fairroot.gsi.de/fairroot/v18.0.6_fairsoft-may18/bin/$PARAMETERSERVER &
fi
echo Started ParameterServer
SAMPLER="TsaMultiSamplerTof"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices $_ntimeslices"
#SAMPLER+=" --max-timeslices 1000000"
#SAMPLER+=" --flib-port 10"
SAMPLER+=" --dirname $_dirname"
SAMPLER+=" --filename $_filename"
#SAMPLER+=" --flib-host myHost"
SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pSam"
SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pCmd"
#SAMPLER+=" --transport shmem"
#SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
#SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG"
SAMPLER+=" --SelectComponents 1"
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl_${_runname}.out"
SAMPLER+=" --control static"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
fi
echo Started Sampler
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018"
UNPACKER+=" --id unpack$_iUnp"
UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pSam"
UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pDig"
UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd"
#UNPACKER+=" --transport shmem"
#UNPACKER+=" --severity DEBUG"
UNPACKER+=" --severity INFO"
UNPACKER+=" --SelectComponents 1"
if [[ $_reqmod -gt 10 ]]; then
echo define ReqBeam
#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a
UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
fi
if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqMode 0"
case $_reqmod in
0)
;;
-1)
UNPACKER+=" --ReqDet0 10246" # diamond -> 0x00002806 v21a
UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a
UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a
;;
-2)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 131126" # RPC 032
UNPACKER+=" --ReqDet2 131142" # RPC 042
;; # for ceramics
-3)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 196662" # RPC 033
UNPACKER+=" --ReqDet2 196678" # RPC 043
;; # for BUC
-4) # v21a address mode
UNPACKER+=" --ReqDet0 10246" # diamond
UNPACKER+=" --ReqDet1 65542" # RPC 002
UNPACKER+=" --ReqDet2 65574" # RPC 022
;;
-190)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 36870" # RPC 900
UNPACKER+=" --ReqDet3 102406" # RPC 901
;; # for double stack calibration
-191)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 24582" # RPC 600
UNPACKER+=" --ReqDet3 90118" # RPC 601
;; # for USTC counter analysis
-192)
UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 36870" # RPC 900
UNPACKER+=" --ReqDet2 102406" # RPC 901
;; # for double stack calibration
-193) BeamBeam
UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 24582" # RPC 600
UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis
-194)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 24582" # RPC 600
UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis
*)
echo ReqMode $_reqmod not yet defined, exiting
exit 1
;;
esac;
else
UNPACKER+=" --ReqMode $_reqmod"
fi
UNPACKER+=" --ReqTint $_reqtint"
UNPACKER+=" --PulserMode $_pulmode"
UNPACKER+=" --PulMulMin $_pulmulmin"
UNPACKER+=" --PulTotMin $_pultotmin"
UNPACKER+=" --PulTotMax $_pultotmax"
UNPACKER+=" --ToffTof $_tofftof"
UNPACKER+=" --RefModType 5"
UNPACKER+=" --RefModId 0"
UNPACKER+=" --RefCtrType 0"
UNPACKER+=" --RefCtrId 0"
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp${_iUnp}_${_runname}.out"
#echo nohup $UNPACKER
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
#echo execute interactively in a separate console: /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER
#read -p "Continue? (Y/N): "confirm && [[ $confirm == [yY] ]]
else
xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
echo Started Unpacker
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
HITBUILDER+=" --channel-config name=tofdigis,type=pull,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pDig"
HITBUILDER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
HITBUILDER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd"
#HITBUILDER+=" --channel-config name=tofhits,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5557"
#HITBUILDER+=" --channel-config name=tofcalib,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5558"
#HITBUILDER+=" --transport shmem"
#HITBUILDER+=" --severity DEBUG"
HITBUILDER+=" --severity INFO"
#HITBUILDER+=" --severity WARN"
HITBUILDER+=" --OutRootFile $_outdir$_digifile"
#HITBUILDER+=" --MaxEvent 10000000"
#HITBUILDER+=" --RunId 1552883952"
#HITBUILDER+=" --RunId 1614415472" # tof_mcbm_beam_2021_01.par.root
HITBUILDER+=" --RunId 1621902311" # tof_mcbm_beam_2021_02.par.root
HITBUILDER+=" --PulserMode $_pulmode"
HITBUILDER+=" --PulMulMin $_pulmulmin"
HITBUILDER+=" --PulTotMin $_pultotmin"
HITBUILDER+=" --PulTotMax $_pultotmax"
HITBUILDER+=" --PulDetRef $_puldetref"
HITBUILDER+=" --ReqTint $_reqtint"
#HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006
HITBUILDER+=" --BRefType 0"
HITBUILDER+=" --BRefSm 4"
HITBUILDER+=" --BRefDet 1"
HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 3"
HITBUILDER+=" --DutRpc 1"
HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 4"
HITBUILDER+=" --SelRpc 1"
HITBUILDER+=" --Sel2Type 5"
HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 0"
if [[ $_reqmod -eq 1 ]]; then
HITBUILDER+=" --Mode 1"
fi
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
else
xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
fi
echo Started HitBuilder
# show daughter processes
ps
# wait for completion
RUNTIMEMAX=28000
DeltaTime=120
RunTime=0
while [ $RunTime -lt $RUNTIMEMAX ]; do
PROC=`ps uaxww | grep Hit`
ProcRunning=`echo $PROC | grep Builder`
if [[ $ProcRunning != "" ]]; then
(( Runtime += DeltaTime ))
sleep $DeltaTime
else
echo No HitBuilder in $PROC
break;
fi
done
#sleep 14400 # 4h
#sleep 28000 # 8h
echo kill all MQ processes
./stop_MQ.sh
echo done
#!/bin/bash
#SBATCH -J MQevb
#SBATCH -D /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/topologies
#SBATCH --time=6-00:00:00
#SBATCH --mem=4000
#SBATCH --partition=long
X=$((${SLURM_ARRAY_TASK_ID} - 0))
XXX=$(printf "%03d" "$X")
#$FAIRROOTPATH/bin/shmmonitor --cleanup
node=`hostname`
nodeStatus=`ps uaxwww | grep parmq`
nodeOK=`echo $nodeStatus | grep ParServ`
if [[ $nodeOK != "" ]]; then
echo parmq already running on node $node: $nodeOK, exiting ...
exit 0
fi
echo node check on $node passed, stop eventually relict processes
./stop_MQ.sh
#exit 0 ## debug exit
if [ -z "$1" ]; then
_runname="359"
else
_runname=$1
fi
if [ -z "$2" ]; then
_reqmod=-193
else
_reqmod=$2
fi
if [ -z "$3" ]; then
_pulmode=1
else
_pulmode=$3
fi
if [ -z "$4" ]; then
_reqtint=100
else
_reqtint=$4
fi
_Opt=$5
_ntimeslices=-1
#_ntimeslices=10000
_iUnp=1
_batch=1
_pulmulmin=5
_pultotmin=50
_pultotmax=500
#_puldetref=12 # TSR=022
#_puldetref=16 # TSR=032
_puldetref=16 # TSR=031
#_tofftof=0.
_tofftof=-35.
if [[ $_reqmod -eq 1 ]]; then
_iUnp=1
fi
#_dirname=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/input/$_runname/
_outdir=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/data/
#_datapath=~/KRONOS/CBM/cbmroot/trunk
#_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/
#_outdir=$_datapath/macro/beamtime/mcbm2018/data/
#_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa"
#_filename="./tsaData2020/${_runname}_pn02_*.tsa;./tsaData2020/${_runname}_pn04_*.tsa;./tsaData2020/${_runname}_pn05_*.tsa;./tsaData2020/${_runname}_pn06_*.tsa;./tsaData2020/${_runname}_pn08_*.tsa;./tsaData2020/${_runname}_pn10_*.tsa;./tsaData2020/${_runname}_pn11_*.tsa;./tsaData2020/${_runname}_pn12_*.tsa;./tsaData2020/${_runname}_pn13_*.tsa;./tsaData2020/${_runname}_pn15_*.tsa"
if [ $_runname -lt 1400 ]; then
_dirname=""
_filename="./tsaData2021/${_runname}_node8_*.tsa;./tsaData2021/${_runname}_node9_*.tsa"
_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21b_mcbm.digibdf.par
else
if [ $_runname -lt 1384 ]; then
_dirname=`ls -d /lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/input06/r${_runname}*` # double stack AFCK
else
_dirname=`ls -d /lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/inp07/r${_runname}*` # triple stack AFCK
fi
_filename="r${_runname}*.tsa"
_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21c_mcbm.digibdf.par
echo dir: $_dirname
echo file: $_filename
fi
_digifile=$_runname.$_reqtint.$_reqmod.${_pulmode}${_Opt}.root
# ASCII files
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/MQ/hitbuilder/MapTofGbtx.par
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar.par
if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_2Stack.par
else
if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_3Stack.par
_puldetref=12 # TSR=022
else
if [ $_runname -ge 1079 ] && [ $_runname -lt 1086 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar2Stack.par
else
if [ $_runname -lt 1172 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524_DirectBeam.par
else
if [ $_runname -lt 1600 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524.par
else
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar_20210524.par
fi
fi
fi
fi
fi
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/etofPar.par
#_digibdffile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/v18j_cosmicHD.digibdf.par
#_digiparfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v18j_cosmicHD.digi.par
#_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21a_mcbm.digibdf.par
#_digiparfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v19b_mcbm.digi.par
# ROOT files
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root
_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_02.par.root
# MQ ports
_pPar=5603
_pSam=5613
_pCmd=5623
_pDig=5633
#rm -v nohup.out
#rm -v *log
rm all_*
PARAMETERSERVER="parmq-server"
echo pkill $PARAMETERSERVER
pkill -9 $PARAMETERSERVER
sleep 1
PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --channel-name parameters"
PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
#PARAMETERSERVER+=" --libs-to-load libCbmTof;libCbmFlibMcbm2018"
#PARAMETERSERVER+=" --first-input-name $_mapfile;$_digiparfile;$_digibdffile"
PARAMETERSERVER+=" --first-input-name $_mapfile;$_digibdffile"
PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
else
xterm -geometry 80x23+0+340 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
#xterm -geometry 80x23+500+0 -hold -e /cvmfs/fairroot.gsi.de/fairroot/v18.0.6_fairsoft-may18/bin/$PARAMETERSERVER &
fi
echo Started ParameterServer
SAMPLER="TsaMultiSamplerTof"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices $_ntimeslices"
#SAMPLER+=" --max-timeslices 1000000"
#SAMPLER+=" --flib-port 10"
#SAMPLER+=" --dirname $_dirname"
SAMPLER+=" --filename $_filename"
#SAMPLER+=" --flib-host myHost"
SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pSam"
SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pCmd"
#SAMPLER+=" --transport shmem"
#SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
#SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG"
SAMPLER+=" --SelectComponents 1"
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl_${_runname}.out"
SAMPLER+=" --control static"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
fi
echo Started Sampler
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018"
UNPACKER+=" --id unpack$_iUnp"
UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pSam"
UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pDig"
UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd"
#UNPACKER+=" --transport shmem"
#UNPACKER+=" --severity DEBUG"
UNPACKER+=" --severity INFO"
UNPACKER+=" --SelectComponents 1"
if [[ $_reqmod -gt 10 ]]; then
echo define ReqBeam
#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a
UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
fi
if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqMode 0"
case $_reqmod in
0)
;;
-1)
UNPACKER+=" --ReqDet0 10246" # diamond -> 0x00002806 v21a
UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a
UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a
;;
-2)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 131126" # RPC 032
UNPACKER+=" --ReqDet2 131142" # RPC 042
;; # for ceramics
-3)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 196662" # RPC 033
UNPACKER+=" --ReqDet2 196678" # RPC 043
;; # for BUC
-4) # v21a address mode
UNPACKER+=" --ReqDet0 10246" # diamond
UNPACKER+=" --ReqDet1 65542" # RPC 002
UNPACKER+=" --ReqDet2 65574" # RPC 022
;;
-190)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 36870" # RPC 900
UNPACKER+=" --ReqDet3 102406" # RPC 901
;; # for double stack calibration
-191)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 24582" # RPC 600
UNPACKER+=" --ReqDet3 90118" # RPC 601
;; # for USTC counter analysis
-192)
UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 36870" # RPC 900
UNPACKER+=" --ReqDet2 102406" # RPC 901
;; # for double stack calibration
-193) BeamBeam
UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 24582" # RPC 600
UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis
-194)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 24582" # RPC 600
UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis
*)
echo ReqMode $_reqmod not yet defined, exiting
exit 1
;;
esac;
else
UNPACKER+=" --ReqMode $_reqmod"
fi
UNPACKER+=" --ReqTint $_reqtint"
UNPACKER+=" --PulserMode $_pulmode"
UNPACKER+=" --PulMulMin $_pulmulmin"
UNPACKER+=" --PulTotMin $_pultotmin"
UNPACKER+=" --PulTotMax $_pultotmax"
UNPACKER+=" --ToffTof $_tofftof"
UNPACKER+=" --RefModType 5"
UNPACKER+=" --RefModId 0"
UNPACKER+=" --RefCtrType 0"
UNPACKER+=" --RefCtrId 0"
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp${_iUnp}_${_runname}.out"
#echo nohup $UNPACKER
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
#echo execute interactively in a separate console: /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER
#read -p "Continue? (Y/N): "confirm && [[ $confirm == [yY] ]]
else
xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
echo Started Unpacker
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
HITBUILDER+=" --channel-config name=tofdigis,type=pull,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:$_pDig"
HITBUILDER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
HITBUILDER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd"
#HITBUILDER+=" --channel-config name=tofhits,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5557"
#HITBUILDER+=" --channel-config name=tofcalib,type=push,method=bind,transport=shmem,address=tcp://127.0.0.1:5558"
#HITBUILDER+=" --transport shmem"
#HITBUILDER+=" --severity DEBUG"
HITBUILDER+=" --severity INFO"
#HITBUILDER+=" --severity WARN"
HITBUILDER+=" --OutRootFile $_outdir$_digifile"
#HITBUILDER+=" --MaxEvent 10000000"
#HITBUILDER+=" --RunId 1552883952"
#HITBUILDER+=" --RunId 1614415472" # tof_mcbm_beam_2021_01.par.root
HITBUILDER+=" --RunId 1621902311" # tof_mcbm_beam_2021_02.par.root
HITBUILDER+=" --PulserMode $_pulmode"
HITBUILDER+=" --PulMulMin $_pulmulmin"
HITBUILDER+=" --PulTotMin $_pultotmin"
HITBUILDER+=" --PulTotMax $_pultotmax"
HITBUILDER+=" --PulDetRef $_puldetref"
HITBUILDER+=" --ReqTint $_reqtint"
#HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006
HITBUILDER+=" --BRefType 0"
HITBUILDER+=" --BRefSm 4"
HITBUILDER+=" --BRefDet 1"
HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 3"
HITBUILDER+=" --DutRpc 1"
HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 4"
HITBUILDER+=" --SelRpc 1"
HITBUILDER+=" --Sel2Type 5"
HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 0"
if [[ $_reqmod -eq 1 ]]; then
HITBUILDER+=" --Mode 1"
fi
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
else
xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
fi
echo Started HitBuilder
# show daughter processes
ps
# wait for completion
RUNTIMEMAX=28000
DeltaTime=120
RunTime=0
while [ $RunTime -lt $RUNTIMEMAX ]; do
PROC=`ps uaxww | grep Hit`
ProcRunning=`echo $PROC | grep Builder`
if [[ $ProcRunning != "" ]]; then
(( Runtime += DeltaTime ))
sleep $DeltaTime
else
echo No HitBuilder in $PROC
break;
fi
done
#sleep 14400 # 4h
#sleep 28000 # 8h
echo kill all MQ processes
./stop_MQ.sh
echo done
#!/bin/bash #!/bin/bash
Running=`ps uaxww | grep HitB` Running=`ps uaxww | grep HitB`
if [[ $Running == *"hitbuilder1"* ]]; then if [[ $Running == *"hitbuilder1"* ]]; then
echo Hitbuilder is still running, wait or cleanup! echo Hitbuilder is still running, wait or cleanup!
exit 1 exit 1
fi fi
$FAIRROOTPATH/bin/shmmonitor --cleanup if [ -e @SIMPATH@/bin/fairmq-shmmonitor ]; then
@SIMPATH@/bin/fairmq-shmmonitor --cleanup
fi
if [ -z "$1" ]; then if [ -z "$1" ]; then
_runname="r0088_20180905_1602" _runname="r0088_20180905_1602"
else else
_runname=$1 _runname=$1
fi fi
_reqmod=3 _reqmod=3
_reqtint=100 _reqtint=100
_batch=1 _batch=1
_iUnp=6 _iUnp=6
...@@ -25,18 +26,18 @@ _dirname=@VMCWORKDIR@/macro/beamtime/star2019/input/$_runname/ ...@@ -25,18 +26,18 @@ _dirname=@VMCWORKDIR@/macro/beamtime/star2019/input/$_runname/
_filename=$_runname_*.tsa _filename=$_runname_*.tsa
_digifile=$_runname.$_reqtint.$_reqmod.root _digifile=$_runname.$_reqtint.$_reqmod.root
# ASCII files # ASCII files
_mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par _mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par
#_digibdffile=@CMAKE_CURRENT_SOURCE_DIR@/v18j_cosmicHD.digibdf.par #_digibdffile=@CMAKE_CURRENT_SOURCE_DIR@/v18j_cosmicHD.digibdf.par
#_digiparfile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18j_cosmicHD.digi.par #_digiparfile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18j_cosmicHD.digi.par
_digibdffile=@VMCWORKDIR@/parameters/tof/v18_star_cosmics.digibdf.par _digibdffile=@VMCWORKDIR@/parameters/tof/v18_star_cosmics.digibdf.par
_digiparfile=@VMCWORKDIR@/parameters/tof/tof_v18_star_cosmics.digi.par _digiparfile=@VMCWORKDIR@/parameters/tof/tof_v18_star_cosmics.digi.par
# ROOT files # ROOT files
#_geofile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18j_cosmicHD.par.root #_geofile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18j_cosmicHD.par.root
_geofile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18_star_cosmics.par.root _geofile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18_star_cosmics.par.root
rm -v nohup.out rm -v nohup.out
rm -v *log rm -v *log
rm all_* rm all_*
...@@ -53,7 +54,7 @@ PARAMETERSERVER+=" --first-input-type ASCII" ...@@ -53,7 +54,7 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile" PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT" PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --verbosity INFO" PARAMETERSERVER+=" --verbosity INFO"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static" PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out" PARAMETERSERVER+=" --log-to-file ParServ.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER & nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
...@@ -78,14 +79,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad ...@@ -78,14 +79,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad
#SAMPLER+=" --verbosity WARN" #SAMPLER+=" --verbosity WARN"
SAMPLER+=" --verbosity INFO" SAMPLER+=" --verbosity INFO"
#SAMPLER+=" --verbosity DEBUG" #SAMPLER+=" --verbosity DEBUG"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out" SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --control static" SAMPLER+=" --control static"
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER & nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else else
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER & xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
fi fi
while (( _iUnp > 0 )); do while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018" UNPACKER="UnpackTofMcbm2018"
...@@ -117,16 +118,16 @@ UNPACKER+=" --ReqDet14 131110" ...@@ -117,16 +118,16 @@ UNPACKER+=" --ReqDet14 131110"
UNPACKER+=" --ReqDet15 131126" UNPACKER+=" --ReqDet15 131126"
UNPACKER+=" --ReqDet16 131142" UNPACKER+=" --ReqDet16 131142"
UNPACKER+=" --ReqDet17 131158" UNPACKER+=" --ReqDet17 131158"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static" UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp.out" UNPACKER+=" --log-to-file Unp.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER & nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER & xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
fi fi
(( _iUnp -= 1 )) (( _iUnp -= 1 ))
done done
HITBUILDER="HitBuilderTof" HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1" HITBUILDER+=" --id hitbuilder1"
...@@ -144,7 +145,7 @@ HITBUILDER+=" --OutRootFile $_digifile" ...@@ -144,7 +145,7 @@ HITBUILDER+=" --OutRootFile $_digifile"
HITBUILDER+=" --RunId 1538835959" HITBUILDER+=" --RunId 1538835959"
#HITBUILDER+=" --RunId 1536669562" #HITBUILDER+=" --RunId 1536669562"
#HITBUILDER+=" --RunId 1537898701" #HITBUILDER+=" --RunId 1537898701"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static" HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out" HITBUILDER+=" --log-to-file HitBuild.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER & nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER &
......
#!/bin/bash #!/bin/bash
$FAIRROOTPATH/bin/shmmonitor --cleanup if [ -e @SIMPATH@/bin/fairmq-shmmonitor ]; then
@SIMPATH@/bin/fairmq-shmmonitor --cleanup
fi
if [ -z "$1" ]; then if [ -z "$1" ]; then
_runname="r0088_20180905_1602" _runname="r0088_20180905_1602"
else else
_runname=$1 _runname=$1
fi fi
_reqmod=3 _reqmod=3
_reqtint=50 _reqtint=50
_ntimeslices=-1 _ntimeslices=-1
_iUnp=4 _iUnp=4
_batch=1 _batch=1
_pulmode=1 _pulmode=1
_pulmulmin=9 _pulmulmin=9
_pultotmin=50 _pultotmin=50
#_tshiftref=0. #_tshiftref=0.
_tshiftref=-35. _tshiftref=-35.
#_dirname=@VMCWORKDIR@/macro/beamtime/mcbm2018/input/$_runname/ #_dirname=@VMCWORKDIR@/macro/beamtime/mcbm2018/input/$_runname/
_outdir=@VMCWORKDIR@/macro/beamtime/mcbm2018/data/ _outdir=@VMCWORKDIR@/macro/beamtime/mcbm2018/data/
#_datapath=~/KRONOS/CBM/cbmroot/trunk #_datapath=~/KRONOS/CBM/cbmroot/trunk
#_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/ #_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/
#_outdir=$_datapath/macro/beamtime/mcbm2018/data/ #_outdir=$_datapath/macro/beamtime/mcbm2018/data/
_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa" _filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa"
_digifile=$_runname.$_reqtint.$_reqmod.$_pulmode.root _digifile=$_runname.$_reqtint.$_reqmod.$_pulmode.root
# ASCII files # ASCII files
#_mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par #_mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par
_mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par _mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par
#_mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/etofPar.par #_mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/etofPar.par
...@@ -36,10 +38,10 @@ _mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par ...@@ -36,10 +38,10 @@ _mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par
_digibdffile=@VMCWORKDIR@/parameters/tof/v18l_mCbm.digibdf.par _digibdffile=@VMCWORKDIR@/parameters/tof/v18l_mCbm.digibdf.par
_digiparfile=@VMCWORKDIR@/parameters/tof/tof_v18l_mCbm.digi.par _digiparfile=@VMCWORKDIR@/parameters/tof/tof_v18l_mCbm.digi.par
# ROOT files # ROOT files
_geofile=@VMCWORKDIR@/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root _geofile=@VMCWORKDIR@/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
rm -v nohup.out rm -v nohup.out
rm -v *log rm -v *log
rm all_* rm all_*
...@@ -57,7 +59,7 @@ PARAMETERSERVER+=" --first-input-type ASCII" ...@@ -57,7 +59,7 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile" PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT" PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO" PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static" PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out" PARAMETERSERVER+=" --log-to-file ParServ.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER & nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
...@@ -82,14 +84,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad ...@@ -82,14 +84,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad
#SAMPLER+=" --severity WARN" #SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO" SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG" #SAMPLER+=" --severity DEBUG"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out" SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --control static" SAMPLER+=" --control static"
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER & nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else else
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER & xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
fi fi
while (( _iUnp > 0 )); do while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018" UNPACKER="UnpackTofMcbm2018"
...@@ -107,16 +109,16 @@ UNPACKER+=" --PulserMode $_pulmode" ...@@ -107,16 +109,16 @@ UNPACKER+=" --PulserMode $_pulmode"
UNPACKER+=" --PulMulMin $_pulmulmin" UNPACKER+=" --PulMulMin $_pulmulmin"
UNPACKER+=" --PulTotMin $_pultotmin" UNPACKER+=" --PulTotMin $_pultotmin"
UNPACKER+=" --TShiftRef $_tshiftref" UNPACKER+=" --TShiftRef $_tshiftref"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static" UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp.out" UNPACKER+=" --log-to-file Unp.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER & nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER & xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
fi fi
(( _iUnp -= 1 )) (( _iUnp -= 1 ))
done done
HITBUILDER="HitBuilderTof" HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1" HITBUILDER+=" --id hitbuilder1"
...@@ -148,7 +150,7 @@ HITBUILDER+=" --Sel2Type 0" ...@@ -148,7 +150,7 @@ HITBUILDER+=" --Sel2Type 0"
HITBUILDER+=" --Sel2Sm 2" HITBUILDER+=" --Sel2Sm 2"
HITBUILDER+=" --Sel2Rpc 2" HITBUILDER+=" --Sel2Rpc 2"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static" HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out" HITBUILDER+=" --log-to-file HitBuild.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER & nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER &
......
...@@ -5,44 +5,44 @@ ...@@ -5,44 +5,44 @@
$FAIRROOTPATH/bin/shmmonitor --cleanup $FAIRROOTPATH/bin/shmmonitor --cleanup
if [ -z "$1" ]; then if [ -z "$1" ]; then
_runname="359" _runname="359"
else else
_runname=$1 _runname=$1
fi fi
if [ -z "$2" ]; then if [ -z "$2" ]; then
_reqmod=-193 _reqmod=-193
else else
_reqmod=$2 _reqmod=$2
fi fi
if [ -z "$3" ]; then if [ -z "$3" ]; then
_pulmode=1 _pulmode=1
else else
_pulmode=$3 _pulmode=$3
fi fi
if [ -z "$4" ]; then if [ -z "$4" ]; then
_reqtint=100 _reqtint=100
else else
_reqtint=$4 _reqtint=$4
fi fi
_Opt=$5 _Opt=$5
_ntimeslices=-1 #_ntimeslices=-1
#_ntimeslices=10000 _ntimeslices=100000
_iUnp=1 _iUnp=4
_batch=1 _batch=1
_pulmulmin=5 _pulmulmin=5
_pultotmin=50 _pultotmin=50
_pultotmax=500 _pultotmax=500
#_puldetref=12 # TSR=022 _puldetref=12 # TSR=022
_puldetref=16 # TSR=032 #_puldetref=16 # TSR=032
#_tofftof=0. #_tofftof=0.
_tofftof=-35. _tofftof=-35.
if [[ $_reqmod -eq 1 ]]; then if [[ $_reqmod -eq 1 ]]; then
_iUnp=1 _iUnp=1
...@@ -53,36 +53,42 @@ _outdir=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/data/ ...@@ -53,36 +53,42 @@ _outdir=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/data/
#_datapath=~/KRONOS/CBM/cbmroot/trunk #_datapath=~/KRONOS/CBM/cbmroot/trunk
#_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/ #_dirname=$_datapath/macro/beamtime/mcbm2018/input/$_runname/
#_outdir=$_datapath/macro/beamtime/mcbm2018/data/ #_outdir=$_datapath/macro/beamtime/mcbm2018/data/
#_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa" #_filename="./tsaData/${_runname}_pn05_*.tsa;./tsaData/${_runname}_pn06_*.tsa;./tsaData/${_runname}_pn07_*.tsa"
#_filename="./tsaData2020/${_runname}_pn02_*.tsa;./tsaData2020/${_runname}_pn04_*.tsa;./tsaData2020/${_runname}_pn05_*.tsa;./tsaData2020/${_runname}_pn06_*.tsa;./tsaData2020/${_runname}_pn08_*.tsa;./tsaData2020/${_runname}_pn10_*.tsa;./tsaData2020/${_runname}_pn11_*.tsa;./tsaData2020/${_runname}_pn12_*.tsa;./tsaData2020/${_runname}_pn13_*.tsa;./tsaData2020/${_runname}_pn15_*.tsa" #_filename="./tsaData2020/${_runname}_pn02_*.tsa;./tsaData2020/${_runname}_pn04_*.tsa;./tsaData2020/${_runname}_pn05_*.tsa;./tsaData2020/${_runname}_pn06_*.tsa;./tsaData2020/${_runname}_pn08_*.tsa;./tsaData2020/${_runname}_pn10_*.tsa;./tsaData2020/${_runname}_pn11_*.tsa;./tsaData2020/${_runname}_pn12_*.tsa;./tsaData2020/${_runname}_pn13_*.tsa;./tsaData2020/${_runname}_pn15_*.tsa"
_filename="./tsaData2021/${_runname}_node8_*.tsa;./tsaData2021/${_runname}_node9_*.tsa" #_filename="./tsaData2021/${_runname}_node8_*.tsa;./tsaData2021/${_runname}_node9_*.tsa"
_filename="./input07/${_runname}_node8_1_*.tsa;./input07/${_runname}_node9_1_*.tsa;./input07/${_runname}_node8_2_*.tsa;./input07/${_runname}_node9_2_*.tsa;./input07/${_runname}_node8_3_*.tsa;./input07/${_runname}_node9_3_*.tsa;./input07/${_runname}_node8_4_*.tsa;./input07/${_runname}_node9_4_*.tsa;./input07/${_runname}_node8_5_*.tsa;./input07/${_runname}_node9_5_*.tsa"
#_filename="./input07/${_runname}*"
_digifile=$_runname.$_reqtint.$_reqmod.${_pulmode}${_Opt}.root _digifile=$_runname.$_reqtint.$_reqmod.${_pulmode}${_Opt}.root
# ASCII files # ASCII files
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/MQ/hitbuilder/MapTofGbtx.par #_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/MQ/hitbuilder/MapTofGbtx.par
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar.par _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar.par
if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_2Stack.par _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_2Stack.par
else else
if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_3Stack.par _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2020/mTofPar_3Stack.par
_puldetref=12 # TSR=022 _puldetref=12 # TSR=022
else else
if [ $_runname -ge 1079 ] && [ $_runname -lt 10000 ]; then if [ $_runname -ge 1079 ] && [ $_runname -lt 1086 ]; then
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar2Stack.par _mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofPar2Stack.par
else
_mapfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/mTofParCri.par
fi fi
fi fi
fi fi
#_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/etofPar.par #_mapfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/etofPar.par
#_digibdffile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/v18j_cosmicHD.digibdf.par #_digibdffile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/v18j_cosmicHD.digibdf.par
#_digiparfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v18j_cosmicHD.digi.par #_digiparfile=/lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v18j_cosmicHD.digi.par
_digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21a_mcbm.digibdf.par _digibdffile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v21c_mcbm.digibdf.par
#_digiparfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v19b_mcbm.digi.par #_digiparfile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/parameters/tof/tof_v19b_mcbm.digi.par
# ROOT files # ROOT files
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root #_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root #_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root
#_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_02.par.root
_geofile=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_07.par.root
# MQ ports # MQ ports
_pPar=5603 _pPar=5603
...@@ -90,14 +96,13 @@ _pSam=5613 ...@@ -90,14 +96,13 @@ _pSam=5613
_pCmd=5623 _pCmd=5623
_pDig=5633 _pDig=5633
rm -v nohup.out #rm -v nohup.out
rm -v *log #rm -v *log
rm all_* rm all_*
PARAMETERSERVER="parmq-server" PARAMETERSERVER="parmq-server"
echo pkill $PARAMETERSERVER echo pkill $PARAMETERSERVER
pkill -9 $PARAMETERSERVER pkill -9 $PARAMETERSERVER
pkill -9 $PARAMETERSERVER
sleep 1 sleep 1
PARAMETERSERVER+=" --id parmq-server" PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --channel-name parameters" PARAMETERSERVER+=" --channel-name parameters"
...@@ -109,15 +114,17 @@ PARAMETERSERVER+=" --first-input-type ASCII" ...@@ -109,15 +114,17 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile" PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT" PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO" PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static" PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out" PARAMETERSERVER+=" --log-to-file ParServ_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER & nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
else else
xterm -geometry 80x23+0+340 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER & xterm -geometry 80x23+0+340 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/parmq/$PARAMETERSERVER &
#xterm -geometry 80x23+500+0 -hold -e /cvmfs/fairroot.gsi.de/fairroot/v18.0.6_fairsoft-may18/bin/$PARAMETERSERVER & #xterm -geometry 80x23+500+0 -hold -e /cvmfs/fairroot.gsi.de/fairroot/v18.0.6_fairsoft-may18/bin/$PARAMETERSERVER &
fi fi
echo Started ParameterServer
SAMPLER="TsaMultiSamplerTof" SAMPLER="TsaMultiSamplerTof"
SAMPLER+=" --id sampler1" SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices $_ntimeslices" SAMPLER+=" --max-timeslices $_ntimeslices"
...@@ -134,18 +141,18 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,trans ...@@ -134,18 +141,18 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,trans
#SAMPLER+=" --severity WARN" #SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO" SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG" #SAMPLER+=" --severity DEBUG"
SAMPLER+=" --SelectComponents 1" SAMPLER+=" --SelectComponents 0"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out" SAMPLER+=" --log-to-file Sampl_${_runname}.out"
SAMPLER+=" --control static" SAMPLER+=" --control static"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER & nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
else else
xterm -geometry 80x23+0+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER & xterm -geometry 80x23+0+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/source/$SAMPLER &
fi fi
while (( _iUnp > 0 )); do while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018" UNPACKER="UnpackTofCri"
UNPACKER+=" --id unpack$_iUnp" UNPACKER+=" --id unpack$_iUnp"
UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pSam" UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pSam"
UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar" UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pPar"
...@@ -153,10 +160,10 @@ UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging= ...@@ -153,10 +160,10 @@ UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging=
UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd" UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:$_pCmd"
#UNPACKER+=" --transport shmem" #UNPACKER+=" --transport shmem"
#UNPACKER+=" --severity DEBUG" #UNPACKER+=" --severity DEBUG"
UNPACKER+=" --severity INFO" UNPACKER+=" --severity INFO"
UNPACKER+=" --SelectComponents 1" UNPACKER+=" --SelectComponents 0"
#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a #UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a
UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a #UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
if [[ $_reqmod -lt 1 ]]; then if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqMode 0" UNPACKER+=" --ReqMode 0"
case $_reqmod in case $_reqmod in
...@@ -167,7 +174,7 @@ if [[ $_reqmod -lt 1 ]]; then ...@@ -167,7 +174,7 @@ if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a
UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a
;; ;;
-2) -2)
UNPACKER+=" --ReqDet0 20486" # diamond UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 131126" # RPC 032 UNPACKER+=" --ReqDet1 131126" # RPC 032
UNPACKER+=" --ReqDet2 131142" # RPC 042 UNPACKER+=" --ReqDet2 131142" # RPC 042
...@@ -178,28 +185,28 @@ if [[ $_reqmod -lt 1 ]]; then ...@@ -178,28 +185,28 @@ if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqDet1 196662" # RPC 033 UNPACKER+=" --ReqDet1 196662" # RPC 033
UNPACKER+=" --ReqDet2 196678" # RPC 043 UNPACKER+=" --ReqDet2 196678" # RPC 043
;; # for BUC ;; # for BUC
-4) # v21a address mode -4) # v21a address mode
UNPACKER+=" --ReqDet0 10246" # diamond UNPACKER+=" --ReqDet0 10246" # diamond
UNPACKER+=" --ReqDet1 65542" # RPC 002 UNPACKER+=" --ReqDet1 65542" # RPC 002
UNPACKER+=" --ReqDet2 65574" # RPC 022 UNPACKER+=" --ReqDet2 65574" # RPC 022
;; ;;
-190) -190)
UNPACKER+=" --ReqDet0 20486" # diamond UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041 UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 36870" # RPC 900 UNPACKER+=" --ReqDet2 36870" # RPC 900
UNPACKER+=" --ReqDet3 102406" # RPC 901 UNPACKER+=" --ReqDet3 102406" # RPC 901
;; # for double stack calibration ;; # for double stack calibration
-191) -191)
UNPACKER+=" --ReqDet0 20486" # diamond UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 65606" # RPC 041 UNPACKER+=" --ReqDet1 65606" # RPC 041
UNPACKER+=" --ReqDet2 24582" # RPC 600 UNPACKER+=" --ReqDet2 24582" # RPC 600
UNPACKER+=" --ReqDet3 90118" # RPC 601 UNPACKER+=" --ReqDet3 90118" # RPC 601
;; # for USTC counter analysis ;; # for USTC counter analysis
-192) -192)
UNPACKER+=" --ReqDet0 65606" # RPC 041 UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 36870" # RPC 900 UNPACKER+=" --ReqDet1 36870" # RPC 900
UNPACKER+=" --ReqDet2 102406" # RPC 901 UNPACKER+=" --ReqDet2 102406" # RPC 901
...@@ -211,12 +218,12 @@ if [[ $_reqmod -lt 1 ]]; then ...@@ -211,12 +218,12 @@ if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqDet2 90118" # RPC 601 UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis ;; # for USTC counter analysis
-194) -194)
UNPACKER+=" --ReqDet0 20486" # diamond UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 24582" # RPC 600 UNPACKER+=" --ReqDet1 24582" # RPC 600
UNPACKER+=" --ReqDet2 90118" # RPC 601 UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis ;; # for USTC counter analysis
*) *)
echo ReqMode $_reqmod not yet defined, exiting echo ReqMode $_reqmod not yet defined, exiting
exit 1 exit 1
...@@ -235,17 +242,17 @@ UNPACKER+=" --RefModType 5" ...@@ -235,17 +242,17 @@ UNPACKER+=" --RefModType 5"
UNPACKER+=" --RefModId 0" UNPACKER+=" --RefModId 0"
UNPACKER+=" --RefCtrType 0" UNPACKER+=" --RefCtrType 0"
UNPACKER+=" --RefCtrId 0" UNPACKER+=" --RefCtrId 0"
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static" UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp$_iUnp.out" UNPACKER+=" --log-to-file Unp${_iUnp}_${_runname}.out"
#echo nohup $UNPACKER #echo nohup $UNPACKER
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER & nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
else else
xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER & xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
fi fi
(( _iUnp -= 1 )) (( _iUnp -= 1 ))
done done
HITBUILDER="HitBuilderTof" HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1" HITBUILDER+=" --id hitbuilder1"
...@@ -261,7 +268,9 @@ HITBUILDER+=" --severity INFO" ...@@ -261,7 +268,9 @@ HITBUILDER+=" --severity INFO"
HITBUILDER+=" --OutRootFile $_outdir$_digifile" HITBUILDER+=" --OutRootFile $_outdir$_digifile"
#HITBUILDER+=" --MaxEvent 10000000" #HITBUILDER+=" --MaxEvent 10000000"
#HITBUILDER+=" --RunId 1552883952" #HITBUILDER+=" --RunId 1552883952"
HITBUILDER+=" --RunId 1614415472" #HITBUILDER+=" --RunId 1614415472" # tof_mcbm_beam_2021_01.par.root
#HITBUILDER+=" --RunId 1621902311" # tof_mcbm_beam_2021_02.par.root
HITBUILDER+=" --RunId 1629444189" # tof_mcbm_beam_2021_07.par.root
HITBUILDER+=" --PulserMode $_pulmode" HITBUILDER+=" --PulserMode $_pulmode"
HITBUILDER+=" --PulMulMin $_pulmulmin" HITBUILDER+=" --PulMulMin $_pulmulmin"
HITBUILDER+=" --PulTotMin $_pultotmin" HITBUILDER+=" --PulTotMin $_pultotmin"
...@@ -269,25 +278,25 @@ HITBUILDER+=" --PulTotMax $_pultotmax" ...@@ -269,25 +278,25 @@ HITBUILDER+=" --PulTotMax $_pultotmax"
HITBUILDER+=" --PulDetRef $_puldetref" HITBUILDER+=" --PulDetRef $_puldetref"
HITBUILDER+=" --ReqTint $_reqtint" HITBUILDER+=" --ReqTint $_reqtint"
#HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006 #HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006
HITBUILDER+=" --BRefType 5" HITBUILDER+=" --BRefType 0"
HITBUILDER+=" --BRefSm 0" HITBUILDER+=" --BRefSm 0"
HITBUILDER+=" --BRefDet 0" HITBUILDER+=" --BRefDet 3"
HITBUILDER+=" --DutType 0" HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 3" HITBUILDER+=" --DutSm 1"
HITBUILDER+=" --DutRpc 1" HITBUILDER+=" --DutRpc 3"
HITBUILDER+=" --SelType 0" HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 4" HITBUILDER+=" --SelSm 2"
HITBUILDER+=" --SelRpc 1" HITBUILDER+=" --SelRpc 3"
HITBUILDER+=" --Sel2Type 5" HITBUILDER+=" --Sel2Type 0"
HITBUILDER+=" --Sel2Sm 0" HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 0" HITBUILDER+=" --Sel2Rpc 3"
if [[ $_reqmod -eq 1 ]]; then if [[ $_reqmod -eq 1 ]]; then
HITBUILDER+=" --Mode 1" HITBUILDER+=" --Mode 1"
fi fi
if [[ $_batch = 1 ]]; then if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static" HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out" HITBUILDER+=" --log-to-file HitBuild_${_runname}.out"
nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER & nohup /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
else else
xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER & xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
......
This diff is collapsed.