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
${FAIRMQ_INCLUDE_DIR}
${FAIRMQ_INCLUDE_DIR}/options
${IPC_INCLUDE_DIRECTORY}
${FLES_IPC_INCLUDE_DIRECTORY}
${CBMROOT_SOURCE_DIR}/external/cppzmq
)
......@@ -66,13 +66,18 @@ If(FAIRLOGGER_FOUND)
)
EndIf()
set(EXE_NAME EventBuilderEtofStar2019)
set(SRCS CbmDeviceEventBuilderEtofStar2019.cxx runEventBuilderEtofStar2019.cxx)
set(DEPENDENCIES
# Dependencies common to all executables
set(DEPENDENCIES_ALL
${DEPENDENCIES}
${FAIR_LIBS}
${BOOST_LIBS}
fles_ipc
)
set(EXE_NAME EventBuilderEtofStar2019)
set(SRCS CbmDeviceEventBuilderEtofStar2019.cxx runEventBuilderEtofStar2019.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL}
external::fles_ipc
CbmFlibStar2019
CbmFlibMcbm2018
CbmBase
......@@ -94,10 +99,8 @@ Set(NO_DICT_SRCS
# 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(DEPENDENCIES
${DEPENDENCIES}
${FAIR_LIBS}
${BOOST_LIBS}
fles_ipc
${DEPENDENCIES_ALL}
external::fles_ipc
CbmFlibStar2019
CbmFlibMcbm2018
CbmBase
......
......@@ -137,7 +137,7 @@ Bool_t CbmDeviceEventBuilderEtofStar2019::InitContainers()
if (Send(req, "parameters") > 0) {
if (Receive(rep, "parameters") >= 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()));
LOG(info) << "Received unpack parameter from parmq server: " << fUnpackPar;
fUnpackPar->Print();
......
......@@ -10,6 +10,8 @@
#ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
......@@ -86,10 +88,4 @@ private:
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_ */
......@@ -12,6 +12,7 @@
#ifndef CBMDEVICETRIGGERHANDLERETOF_H_
#define CBMDEVICETRIGGERHANDLERETOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofStarData2019.h"
#include "MicrosliceDescriptor.hpp"
......@@ -20,12 +21,10 @@
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include <map>
#include <vector>
class CbmMQTMessage;
// Relevant TOF classes
extern "C" int star_rhicf_write(unsigned int trg_word, void* dta, int bytes);
......@@ -78,10 +77,4 @@ private:
// 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_ */
......@@ -6,89 +6,49 @@
# copied verbatim in the file "LICENSE" #
################################################################################
Set(INCLUDE_DIRECTORIES
set(INCLUDE_DIRECTORIES
${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)
List(APPEND BOOST_LIBS pthread)
EndIf()
If(FairRoot_VERSION VERSION_LESS 18.2.0)
Add_Definitions(-DHAVE_RootDeserializer)
EndIf()
# Set the install path within the build directory
set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/MQ/histogramServer")
# Set the install path within the installation directory
set(BIN_DESTINATION bin/MQ/histogramServer)
set(DEPENDENCIES_ALL
${DEPENDENCIES}
${FAIR_LIBS}
${BOOST_LIBS}
)
set(PUBLIC_DEPS
ROOT::Core
ROOT::RHTTP
)
set(PRIVATE_DEPS
CbmFlibFlesTools
FairRoot::Base
FairMQ::FairMQ
ROOT::Gpad
ROOT::Hist
ROOT::Net
ROOT::RIO
)
set(EXE_NAME HistoServer)
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(SRCS CbmMqHistoServer.cxx runCbmMqHistoServer.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL}
${FAIR_LIBS}
CbmFlibFlesTools
Core
RIO
Net
Hist
Gpad
RHTTP
)
GENERATE_EXECUTABLE()
set(PUBLIC_DEPENDENCIES ${PUBLIC_DEPS})
set(PRIVATE_DEPENDENCIES ${PRIVATE_DEPS})
set(INTERFACE_DEPENDENCIES ${INTERFACE_DEPS})
generate_cbm_executable()
......@@ -45,11 +45,7 @@ void CbmHistoServer::InitTask()
bool CbmHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
{
TObject* tempObject = nullptr;
#ifdef HAVE_RootDeserializer
Deserialize<RootDeserializer>(*msg, tempObject);
#else
Deserialize<RootSerializer>(*msg, tempObject);
#endif
RootSerializer().Deserialize(*msg, tempObject);
if (TString(tempObject->ClassName()).EqualTo("TObjArray")) {
std::lock_guard<std::mutex> lk(mtx);
......
......@@ -35,19 +35,7 @@ Bool_t bMqHistoServerSaveHistos = kFALSE;
*/
CbmMqHistoServer::CbmMqHistoServer()
: FairMQDevice()
, fsChannelNameHistosInput("histogram-in")
, fsChannelNameHistosConfig("histo-conf")
, fsChannelNameCanvasConfig("canvas-conf")
, fsHistoFileName("HistosMonitorPulser.root")
, fuHttpServerPort(8098)
, fArrayHisto()
, fvpsHistosFolder()
, fvpsCanvasConfig()
, fvHistos()
, fvCanvas()
, fNMessages(0)
, fServer(nullptr)
, fStopThread(false)
{
}
......@@ -87,9 +75,11 @@ void CbmMqHistoServer::InitTask()
bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
{
LOG(debug) << "CbmMqHistoServer::ReceiveData => Processing histograms update";
TObject* tempObject = nullptr;
Deserialize<RootSerializer>(*msg, tempObject);
// Deserialize<RootSerializer>(*msg, tempObject);
RootSerializer().Deserialize(*msg, tempObject);
if (TString(tempObject->ClassName()).EqualTo("TObjArray")) {
std::lock_guard<std::mutex> lk(mtx);
......@@ -110,12 +100,14 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
LOG(warning) << "Unsupported object type for " << pObj->GetName();
} // 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!!!
arrayHisto->Delete();
/// If new histos received, try to prepare as many canvases as possible
/// Should be expensive on start and cheap afterward
if (!fbAllCanvasReady) {
LOG(debug) << "CbmMqHistoServer::ReceiveData => Checking for canvases updates";
for (uint32_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv) {
/// Jump canvases already ready
if (fvbCanvasReady[uCanv]) continue;
......@@ -148,6 +140,8 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
bMqHistoServerSaveHistos = kFALSE;
} // if( bMqHistoServerSaveHistos )
*/
LOG(debug) << "CbmMqHistoServer::ReceiveData => Finished processing histograms update";
return true;
}
......@@ -155,7 +149,9 @@ bool CbmMqHistoServer::ReceiveHistoConfig(FairMQMessagePtr& msg, int /*index*/)
{
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;
......@@ -185,7 +181,8 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/)
{
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;
......@@ -197,7 +194,7 @@ bool CbmMqHistoServer::ReceiveCanvasConfig(FairMQMessagePtr& msg, int /*index*/)
} // for( UInt_t uPrevCanv = 0; uPrevCanv < fvpsCanvasConfig.size(); ++uPrevCanv )
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;
/// Not sure if we should return false here...
} // if( uPrevCanv < fvpsCanvasConfig.size() )
......@@ -218,7 +215,7 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Reject anything but a at least Header + Histo Config + Canvas Config + Histo Data
if (parts.Size() < 4) {
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
/// 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, "
......@@ -233,14 +230,33 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Header contains a pair of
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
<< " 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()
<< " instead of " << 1 + pairHeader.first + pairHeader.second + 1;
<< " instead of " << 1 + uOffsetHistoConfig + uOffsetCanvasConfig + 1;
} // if( parts.Size() != 1 + pairHeader.first + pairHeader.second )
/// Decode parts for histograms configuration
......@@ -250,11 +266,14 @@ bool CbmMqHistoServer::ReceiveConfigAndData(FairMQParts& parts, int /*index*/)
/// Decode parts for histograms configuration
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)
/// 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;
}
......@@ -277,8 +296,10 @@ void CbmMqHistoServer::UpdateHttpServer()
void CbmMqHistoServer::PostRun()
{
SaveHistograms();
fStopThread = true;
fThread.join();
SaveHistograms();
}
template<class HistoT>
......@@ -352,6 +373,7 @@ bool CbmMqHistoServer::ResetHistograms()
}
bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
{
LOG(debug) << " Extracting configuration for canvas index " << uCanvIdx;
CanvasConfig conf(ExtractCanvasConfigFromString(fvpsCanvasConfig[uCanvIdx].second));
/// First check if all objects to be drawn are present
......@@ -369,6 +391,8 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
} // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx )
} // 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
TCanvas* pNewCanv = new TCanvas(conf.GetName().data(), conf.GetTitle().data());
pNewCanv->Divide(conf.GetNbPadsX(), conf.GetNbPadsY());
......@@ -400,7 +424,10 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
dynamic_cast<TH1*>(pObj)->Draw(conf.GetOption(uPadIdx, uObjIdx).data());
} // if( nullptr != dynamic_cast< TH1 *>( pObj ) )
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 )
} // for( uint32_t uObjIdx = 0; uObjIdx < uNbObj; ++uObjIdx )
} // for( uint32_t uPadIdx = 0; uPadIdx < uNbPads; ++uPadIdx )
......@@ -409,7 +436,7 @@ bool CbmMqHistoServer::PrepareCanvas(uint32_t uCanvIdx)
fServer->Register(Form("/%s", fvCanvas[uCanvIdx].second.data()), fvCanvas[uCanvIdx].first);
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;
/// Update flag telling whether all known canvases are registered
......@@ -436,6 +463,8 @@ bool CbmMqHistoServer::SaveHistograms()
// open separate histo file in recreate mode
histoFile = new TFile(fsHistoFileName.data(), "RECREATE");
LOG(info) << "Save Histos in file " << fsHistoFileName.data();
if (nullptr == histoFile) return false;
/// Register the histos in the HTTP server
......
......@@ -42,37 +42,37 @@ protected:
private:
/// Parameters
std::string fsChannelNameHistosInput;
std::string fsChannelNameHistosConfig;
std::string fsChannelNameCanvasConfig;
std::string fsHistoFileName;
uint32_t fuHttpServerPort;
std::string fsChannelNameHistosInput = "histogram-in";
std::string fsChannelNameHistosConfig = "histo-conf";
std::string fsChannelNameCanvasConfig = "canvas-conf";
std::string fsHistoFileName = "MqHistos.root";
uint32_t fuHttpServerPort = 8098;
/// Array of histograms with unique names
TObjArray fArrayHisto;
/// 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
/// 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)"
std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig;
std::vector<bool> fvbCanvasReady;
bool fbAllCanvasReady;
std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {};
std::vector<bool> fvbCanvasReady = {};
bool fbAllCanvasReady = false;
std::vector<std::pair<TNamed*, std::string>> fvHistos; //! Vector of Histos pointers and folder path
std::vector<bool> fvbHistoRegistered;
bool fbAllHistosRegistered;
std::vector<std::pair<TCanvas*, std::string>> fvCanvas; //! Vector of Canvas pointers and folder path
std::vector<bool> fvbCanvasRegistered;
bool fbAllCanvasRegistered;
std::vector<std::pair<TNamed*, std::string>> fvHistos = {}; //! Vector of Histos pointers and folder path
std::vector<bool> fvbHistoRegistered = {};
bool fbAllHistosRegistered = false;
std::vector<std::pair<TCanvas*, std::string>> fvCanvas = {}; //! Vector of Canvas pointers and folder path
std::vector<bool> fvbCanvasRegistered = {};
bool fbAllCanvasRegistered = false;
/// Internal status
int fNMessages;
int fNMessages = 0;
THttpServer* fServer;
THttpServer* fServer = nullptr;
std::thread fThread;
bool fStopThread;
bool fStopThread = false;
template<class HistoT>
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}/startMQ_Mcbm.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQ_Mcbm.sh)
set(INCLUDE_DIRECTORIES
${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 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)
List(APPEND BOOST_LIBS pthread)
EndIf()
set(FAIR_LIBS
Base
ParBase
${FAIRMQ_LIBS}
)
If(FAIRLOGGER_FOUND)
set(FAIR_LIBS
${FAIR_LIBS}
FairLogger
)
EndIf()
set(EXE_NAME HitBuilderTof)
set(SRCS CbmDeviceHitBuilderTof.cxx runHitBuilderTof.cxx)
set(DEPENDENCIES
${DEPENDENCIES}
# FairMQ
${FAIR_LIBS}
${BOOST_LIBS}
# fles_ipc
CbmBase
set(PUBLIC_DEPENDENCIES
CbmData
CbmTofBase
Geom
Core
MathCore
Tree
Physics
RIO
Net
Hist
)
GENERATE_EXECUTABLE()
CbmMQBase
FairRoot::Base
ROOT::Geom
)
set(PRIVATE_DEPENDENCIES
CbmBase
CbmTofReco
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 @@
#include "FairRootManager.h"
#include "FairRunOnline.h"
#include "FairRuntimeDb.h"
#include "FairSource.h"
// ROOT Classes and includes
#include "TClonesArray.h"
......@@ -55,7 +56,6 @@
#include "TROOT.h"
#include "TRandom3.h"
#include "TVector3.h"
#include <thread> // this_thread::sleep_for
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
......@@ -65,6 +65,7 @@
#include <iomanip>
#include <stdexcept>
#include <string>
#include <thread> // this_thread::sleep_for
struct InitTaskError : std::runtime_error {
using std::runtime_error::runtime_error;
};
......@@ -78,6 +79,9 @@ static Double_t StartAnalysisTime = 0.;
//const Double_t cLight = 29.9792; // in cm/ns
static FairRootManager* rootMgr = NULL;
static Int_t iRunId = 1;
static Int_t SelMask = DetMask;
static Double_t dTstart = 0.;
static Double_t dTmax = 0.;
CbmTofDigi* pRef;
CbmTofDigi* pRefCal;
......@@ -133,7 +137,11 @@ CbmDeviceHitBuilderTof::CbmDeviceHitBuilderTof()
, fvPulserOffset()
, fvPulserTimes()
, fhEvDetMul(NULL)
, fhEvDigiMul(NULL)
, fhEvRateIn(NULL)
, fhEvRateOut(NULL)
, fhPulMul(NULL)
, fhDigiTdif(NULL)
, fhPulserTimesRaw()
, fhPulserTimeRawEvo()
, fhPulserTimesCor()
......@@ -297,6 +305,7 @@ Bool_t CbmDeviceHitBuilderTof::InitWorkspace()
fiPulDetRef = fConfig->GetValue<uint64_t>("PulDetRef");
fiPulTotMin = fConfig->GetValue<uint64_t>("PulTotMin");
fiPulTotMax = fConfig->GetValue<uint64_t>("PulTotMax");
dTmax = (Double_t) fConfig->GetValue<uint64_t>("ReqTint");
//fTofCalDigisColl = new TClonesArray("CbmTofDigi", 100);
//fTofCalDigisCollOut = new TClonesArray("CbmTofDigi", 100);
......@@ -362,11 +371,13 @@ Bool_t CbmDeviceHitBuilderTof::InitRootOutput()
fEvtHeader = new FairEventHeader();
fEvtHeader->SetRunId(iRunId);
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);
// 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);
LOG(info) << "define Tree " << outTree->GetName();
......@@ -427,7 +438,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
if (Send(req, Channel) > 0) {
if (Receive(rep, Channel) >= 0) {
if (rep->GetSize() != 0) {
CbmMQTMessage tmsg(rep->GetData(), rep->GetSize());
CbmMqTMessage tmsg(rep->GetData(), rep->GetSize());
switch (iSet) {
case 0:
fDigiPar = static_cast<CbmTofDigiPar*>(tmsg.ReadObject(tmsg.GetClass()));
......@@ -475,9 +486,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
tofDigiPar->Init();
fDigiPar = (CbmTofDigiPar*) (fRtdb->getContainer("CbmTofDigiPar"));
if (NULL == fDigiPar) {
LOG(error) << "CbmTofEventClusterizer::InitParameters => "
"Could not obtain "
"the CbmTofDigiPar ";
LOG(error) << "CbmTofEventClusterizer::InitParameters => Could not obtain CbmTofDigiPar";
return kFALSE;
}
}
......@@ -502,11 +511,22 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
if (!InitCalibParameter()) return kFALSE; // ChangeState(PAUSE); // for debugging
fDutAddr = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId);
fSelAddr = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId);
fSel2Addr = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id);
fiBeamRefAddr = CbmTofAddress::GetUniqueAddress(fiBeamRefSm, fiBeamRefDet, 0, 0, fiBeamRefType);
iIndexDut = fDigiBdfPar->GetDetInd(fDutAddr);
fDutAddr = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId);
fSelAddr = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId);
fSel2Addr = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id);
if (fiBeamRefType > -1) {
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,
fiBeamRefAddr);
return initOK;
......@@ -534,7 +554,8 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
std::istringstream issE(msgStrE);
boost::archive::binary_iarchive inputArchiveE(issE);
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;
// LOG(debug) << "Received message # "<< fNumMessages
......@@ -591,6 +612,38 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
fvDigiIn.resize(fiNDigiIn);
for (int iDigi = 0; iDigi < fiNDigiIn; 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];
}
vdigi.clear();
......@@ -625,6 +678,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
fdEvent++;
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 (fiPulserMode > 0)
......@@ -634,11 +695,14 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
//if(!MergeClusters()) return kFALSE;
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;
fOutRootFile->cd();
rootMgr->Fill();
rootMgr->StoreWriteoutBufferData(rootMgr->GetEventTime());
fhEvRateOut->Fill((fvDigiIn[0].GetTime() + fEventHeader[4] - dTstart) / 1.E9);
//rootMgr->StoreAllWriteoutBufferData();
rootMgr->DeleteOldWriteoutBufferData();
if ((Int_t) fdEvent == fiMaxEvent) {
......@@ -928,31 +992,37 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
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 !
// process event header info
fhEvDetMul = new TH1F("hEvDetMul", "Detector multiplicity of Selector; Mul", 50, 0, 50);
fhPulMul = new TH1F("hPulMul", "Pulser multiplicity; Mul", 110, 0, 110);
fhEvDetMul = new TH1F("hEvDetMul", "Detector multiplicity of Selector; Mul", 50, 0, 50);
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;
dTmax *= 2; // cover full range of selector
for (Int_t iModTyp = 0; iModTyp < 10; iModTyp++)
iNDet += fDigiBdfPar->GetNbSm(iModTyp) * fDigiBdfPar->GetNbRpc(iModTyp);
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);
for (Int_t iDetSide = 0; iDetSide < iNDet * 2; iDetSide++) {
fhPulserTimeRawEvo[iDetSide] = new TProfile(
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,
0, iNDet * 2, 999, -10., 10.);
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,
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);
......@@ -968,7 +1038,10 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
Int_t iSmType = CbmTofAddress::GetSmType(iUniqueId);
Int_t iSmId = CbmTofAddress::GetSmId(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("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);
......@@ -1046,7 +1119,7 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
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),
fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), 0,
fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), -100., 100.);
fDigiBdfPar->GetNbSm(iS) * fDigiBdfPar->GetNbRpc(iS), -dTmax, dTmax);
}
else
fhSmCluFpar[iS][iPar] = (TProfile*) hFparcur->Clone();
......@@ -1444,28 +1517,26 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis()
for (Int_t iDigInd = 0; iDigInd < fiNDigiIn; iDigInd++) {
CbmTofDigi* pDigi = &fvDigiIn[iDigInd];
//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())
<<" TSRC " << pDigi->GetType()
<< pDigi->GetSm()
<< pDigi->GetRpc()
<< pDigi->GetChannel()
<<" S " << pDigi->GetSide()
<<" : " << pDigi->ToString();
<<Form(" TSRCS %d%d%d%02d%d ", (int)pDigi->GetType(),
(int)pDigi->GetSm(),(int)pDigi->GetRpc(),(int)pDigi->GetChannel(),(int)pDigi->GetSide())
<<" : " << Form("Ind %2d, T %15.3f, Tot %5.1f",iDetIndx,pDigi->GetTime(),pDigi->GetTot());
*/
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);
if (NULL == pRef) pRef = pDigi;
else {
if (pDigi->GetTime() < pRef->GetTime()) pRef = pDigi;
}
}
Int_t iDetIndx = fDigiBdfPar->GetDetInd(iAddr);
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;
}
......@@ -1483,12 +1554,20 @@ Bool_t CbmDeviceHitBuilderTof::InspectRawDigis()
// for (Int_t iDigI2 =iDigInd+1; iDigI2<iNbTofDigi;iDigI2++){
for (Int_t iDigI2 = 0; iDigI2 < iNbTofDigi; iDigI2++) {
CbmTofDigi* pDigi2 = &fvDigiIn[iDigI2];
if (pDigi != pDigi2) { fhDigiTdif->Fill(pDigi->GetTime() - pDigi2->GetTime()); }
if (pDigi->GetAddress() != pDigi2->GetAddress())
if (pDigi->GetType() == 6 && pDigi2->GetType() == 6)
fhBucDigiCor->Fill(pDigi->GetRpc() * 64 + pDigi->GetChannel() * 2 + pDigi->GetSide(),
pDigi2->GetRpc() * 64 + pDigi2->GetChannel() * 2 + pDigi2->GetSide());
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()) {
fhRpcDigiCor[iDetIndx]->Fill(pDigi->GetChannel(), pDigi2->GetChannel());
}
......@@ -1664,6 +1743,7 @@ Bool_t CbmDeviceHitBuilderTof::CalibRawDigis()
<<Form("%f",pDigi->GetTime())<<" "
<<pDigi->GetTot();
*/
if (fbPs2Ns) {
pCalDigi->SetTime(pCalDigi->GetTime() / 1000.); // for backward compatibility
pCalDigi->SetTot(pCalDigi->GetTot() / 1000.); // for backward compatibility
......@@ -3735,7 +3815,7 @@ Bool_t CbmDeviceHitBuilderTof::MonitorPulser()
}
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);
return kTRUE;
}
......
......@@ -12,6 +12,7 @@
#ifndef CBMDEVICEHITBUILDERTOF_H_
#define CBMDEVICEHITBUILDERTOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofAddress.h" // in cbmdata/tof
#include "CbmTofGeoHandler.h" // in tof/TofTools
......@@ -30,7 +31,6 @@
#include <map>
#include <vector>
class CbmMQTMessage;
class CbmHistManager;
// Relevant TOF classes
class CbmTofDigi;
......@@ -119,7 +119,7 @@ private:
// Input variables
Int_t fiNDigiIn;
std::vector<CbmTofDigi> fvDigiIn;
std::vector<int> fEventHeader;
std::vector<uint64_t> fEventHeader;
FairEventHeader* fEvtHeader;
// Output variables
......@@ -180,7 +180,11 @@ private:
// histograms
TH1* fhEvDetMul;
TH1* fhEvDigiMul;
TH1* fhEvRateIn;
TH1* fhEvRateOut;
TH1* fhPulMul;
TH1* fhDigiTdif;
TH2* fhPulserTimesRaw;
std::vector<TProfile*> fhPulserTimeRawEvo;
TH2* fhPulserTimesCor;
......@@ -286,10 +290,4 @@ private:
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_ */
/* 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)
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()("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()("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");
......
#!/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
Running=`ps uaxww | grep HitB`
if [[ $Running == *"hitbuilder1"* ]]; then
if [[ $Running == *"hitbuilder1"* ]]; then
echo Hitbuilder is still running, wait or cleanup!
exit 1
exit 1
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"
else
else
_runname=$1
fi
_reqmod=3
_reqtint=100
_reqmod=3
_reqtint=100
_batch=1
_iUnp=6
......@@ -25,18 +26,18 @@ _dirname=@VMCWORKDIR@/macro/beamtime/star2019/input/$_runname/
_filename=$_runname_*.tsa
_digifile=$_runname.$_reqtint.$_reqmod.root
# ASCII files
# ASCII files
_mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par
#_digibdffile=@CMAKE_CURRENT_SOURCE_DIR@/v18j_cosmicHD.digibdf.par
#_digiparfile=@CMAKE_CURRENT_SOURCE_DIR@/tof_v18j_cosmicHD.digi.par
_digibdffile=@VMCWORKDIR@/parameters/tof/v18_star_cosmics.digibdf.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_v18_star_cosmics.par.root
rm -v nohup.out
rm -v nohup.out
rm -v *log
rm all_*
......@@ -53,7 +54,7 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --verbosity INFO"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
......@@ -78,14 +79,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad
#SAMPLER+=" --verbosity WARN"
SAMPLER+=" --verbosity INFO"
#SAMPLER+=" --verbosity DEBUG"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --control static"
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
fi
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018"
......@@ -117,16 +118,16 @@ UNPACKER+=" --ReqDet14 131110"
UNPACKER+=" --ReqDet15 131126"
UNPACKER+=" --ReqDet16 131142"
UNPACKER+=" --ReqDet17 131158"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
done
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
......@@ -144,7 +145,7 @@ HITBUILDER+=" --OutRootFile $_digifile"
HITBUILDER+=" --RunId 1538835959"
#HITBUILDER+=" --RunId 1536669562"
#HITBUILDER+=" --RunId 1537898701"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER &
......
#!/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"
else
else
_runname=$1
fi
_reqmod=3
_reqtint=50
_ntimeslices=-1
_iUnp=4
_batch=1
_pulmode=1
_pulmode=1
_pulmulmin=9
_pultotmin=50
#_tshiftref=0.
_tshiftref=-35.
#_tshiftref=0.
_tshiftref=-35.
#_dirname=@VMCWORKDIR@/macro/beamtime/mcbm2018/input/$_runname/
_outdir=@VMCWORKDIR@/macro/beamtime/mcbm2018/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"
_digifile=$_runname.$_reqtint.$_reqmod.$_pulmode.root
# ASCII files
# ASCII files
#_mapfile=@CMAKE_CURRENT_SOURCE_DIR@/MapTofGbtx.par
_mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par
#_mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/etofPar.par
......@@ -36,10 +38,10 @@ _mapfile=@VMCWORKDIR@/macro/beamtime/mcbm2018/mTofPar.par
_digibdffile=@VMCWORKDIR@/parameters/tof/v18l_mCbm.digibdf.par
_digiparfile=@VMCWORKDIR@/parameters/tof/tof_v18l_mCbm.digi.par
# ROOT files
# ROOT files
_geofile=@VMCWORKDIR@/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
rm -v nohup.out
rm -v nohup.out
rm -v *log
rm all_*
......@@ -57,7 +59,7 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
......@@ -82,14 +84,14 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,transport=zeromq,ad
#SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --control static"
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else
nohup @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
fi
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018"
......@@ -107,16 +109,16 @@ UNPACKER+=" --PulserMode $_pulmode"
UNPACKER+=" --PulMulMin $_pulmulmin"
UNPACKER+=" --PulTotMin $_pultotmin"
UNPACKER+=" --TShiftRef $_tshiftref"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
done
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
......@@ -148,7 +150,7 @@ HITBUILDER+=" --Sel2Type 0"
HITBUILDER+=" --Sel2Sm 2"
HITBUILDER+=" --Sel2Rpc 2"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out"
nohup @CMAKE_BINARY_DIR@/bin/MQ/hitbuilder/$HITBUILDER &
......
......@@ -5,44 +5,44 @@
$FAIRROOTPATH/bin/shmmonitor --cleanup
if [ -z "$1" ]; then
if [ -z "$1" ]; then
_runname="359"
else
else
_runname=$1
fi
if [ -z "$2" ]; then
if [ -z "$2" ]; then
_reqmod=-193
else
else
_reqmod=$2
fi
if [ -z "$3" ]; then
if [ -z "$3" ]; then
_pulmode=1
else
else
_pulmode=$3
fi
if [ -z "$4" ]; then
if [ -z "$4" ]; then
_reqtint=100
else
_reqtint=$4
_reqtint=$4
fi
_Opt=$5
_ntimeslices=-1
#_ntimeslices=10000
_iUnp=1
#_ntimeslices=-1
_ntimeslices=100000
_iUnp=4
_batch=1
_pulmulmin=5
_pultotmin=50
_pultotmax=500
#_puldetref=12 # TSR=022
_puldetref=16 # TSR=032
_puldetref=12 # TSR=022
#_puldetref=16 # TSR=032
#_tofftof=0.
_tofftof=-35.
#_tofftof=0.
_tofftof=-35.
if [[ $_reqmod -eq 1 ]]; then
_iUnp=1
......@@ -53,36 +53,42 @@ _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"
_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
# ASCII files
# 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
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
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 10000 ]; then
else
if [ $_runname -ge 1079 ] && [ $_runname -lt 1086 ]; then
_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
#_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
_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
# 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/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
_pPar=5603
......@@ -90,14 +96,13 @@ _pSam=5613
_pCmd=5623
_pDig=5633
rm -v nohup.out
rm -v *log
#rm -v nohup.out
#rm -v *log
rm all_*
PARAMETERSERVER="parmq-server"
echo pkill $PARAMETERSERVER
pkill -9 $PARAMETERSERVER
pkill -9 $PARAMETERSERVER
sleep 1
PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --channel-name parameters"
......@@ -109,15 +114,17 @@ PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --second-input-name $_geofile"
PARAMETERSERVER+=" --second-input-type ROOT"
PARAMETERSERVER+=" --severity INFO"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
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 &
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"
......@@ -134,18 +141,18 @@ SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,trans
#SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO"
#SAMPLER+=" --severity DEBUG"
SAMPLER+=" --SelectComponents 1"
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --SelectComponents 0"
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
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
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofMcbm2018"
UNPACKER="UnpackTofCri"
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"
......@@ -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+=" --transport shmem"
#UNPACKER+=" --severity DEBUG"
UNPACKER+=" --severity INFO"
UNPACKER+=" --SelectComponents 1"
UNPACKER+=" --severity INFO"
UNPACKER+=" --SelectComponents 0"
#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a
UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
#UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqMode 0"
case $_reqmod in
......@@ -167,7 +174,7 @@ if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqDet1 32822" # RPC 031 -> 0x00008036 v21a
UNPACKER+=" --ReqDet2 32838" # RPC 041 -> 0x00008046 v21a
;;
-2)
-2)
UNPACKER+=" --ReqDet0 20486" # diamond
UNPACKER+=" --ReqDet1 131126" # RPC 032
UNPACKER+=" --ReqDet2 131142" # RPC 042
......@@ -178,28 +185,28 @@ if [[ $_reqmod -lt 1 ]]; then
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
UNPACKER+=" --ReqDet1 65542" # RPC 002
UNPACKER+=" --ReqDet2 65574" # RPC 022
;;
-190)
-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)
-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)
-192)
UNPACKER+=" --ReqDet0 65606" # RPC 041
UNPACKER+=" --ReqDet1 36870" # RPC 900
UNPACKER+=" --ReqDet2 102406" # RPC 901
......@@ -211,12 +218,12 @@ if [[ $_reqmod -lt 1 ]]; then
UNPACKER+=" --ReqDet2 90118" # RPC 601
;; # for USTC counter analysis
-194)
-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
......@@ -235,17 +242,17 @@ UNPACKER+=" --RefModType 5"
UNPACKER+=" --RefModId 0"
UNPACKER+=" --RefCtrType 0"
UNPACKER+=" --RefCtrId 0"
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp$_iUnp.out"
#echo nohup $UNPACKER
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 &
else
xterm -geometry 110x23+520+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/unpacker/$UNPACKER &
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
done
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
......@@ -261,7 +268,9 @@ HITBUILDER+=" --severity INFO"
HITBUILDER+=" --OutRootFile $_outdir$_digifile"
#HITBUILDER+=" --MaxEvent 10000000"
#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+=" --PulMulMin $_pulmulmin"
HITBUILDER+=" --PulTotMin $_pultotmin"
......@@ -269,25 +278,25 @@ HITBUILDER+=" --PulTotMax $_pultotmax"
HITBUILDER+=" --PulDetRef $_puldetref"
HITBUILDER+=" --ReqTint $_reqtint"
#HITBUILDER+=" --ReqBeam 20486" # diamond -> 0x00005006
HITBUILDER+=" --BRefType 5"
HITBUILDER+=" --BRefType 0"
HITBUILDER+=" --BRefSm 0"
HITBUILDER+=" --BRefDet 0"
HITBUILDER+=" --BRefDet 3"
HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 3"
HITBUILDER+=" --DutRpc 1"
HITBUILDER+=" --DutSm 1"
HITBUILDER+=" --DutRpc 3"
HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 4"
HITBUILDER+=" --SelRpc 1"
HITBUILDER+=" --Sel2Type 5"
HITBUILDER+=" --SelSm 2"
HITBUILDER+=" --SelRpc 3"
HITBUILDER+=" --Sel2Type 0"
HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 0"
HITBUILDER+=" --Sel2Rpc 3"
if [[ $_reqmod -eq 1 ]]; then
HITBUILDER+=" --Mode 1"
fi
if [[ $_batch = 1 ]]; then
if [[ $_batch = 1 ]]; then
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 &
else
xterm -geometry 120x23+1400+0 -hold -e /lustre/nyx/cbm/users/nh/CBM/cbmroot/trunk/build/bin/MQ/hitbuilder/$HITBUILDER &
......
This diff is collapsed.