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
  • aksharma/cbmroot
  • m.deveaux/cbmroot
  • mkunold/cbmroot
  • h.darwish/cbmroot
  • pk.sharma_AT_vecc.gov.in/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
66 results
Show changes
Commits on Source (116)
Showing
with 2790 additions and 621 deletions
# exclude top level directories
# which are taken from other git repositories
# The / at the beginning is important, otherwise all directories
# containing the string are ignored
# containing the string are ignored
/geometry
/input
/parameters
......@@ -12,3 +12,6 @@ Dart*.cfg
# gdb Crash dumps
**/core_dump_*
# IDEs
.vscode
This diff is collapsed.
# Check if cmake has the required version
# Since flesnet requires 3.14.0 we should be consistent while we
# build it in the CbmRoot context
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
cmake_policy(VERSION 3.14...3.23)
Set(CTEST_SOURCE_DIRECTORY $ENV{SOURCEDIR})
Set(CTEST_BINARY_DIRECTORY $ENV{BUILDDIR})
Set(CTEST_SITE $ENV{SITE})
......@@ -21,9 +27,10 @@ Set(CTEST_BUILD_COMMAND "${BUILD_COMMAND} -i -k -j$ENV{number_of_processors}")
# Extract the FairRoot version from fairroot-config
# The version info is of the form Major.Minor.Patch e.g. 15.11.1 and
# is stored in the variable FairRoot_VERSION
Set(CMAKE_MODULE_PATH "${CTEST_SOURCE_DIRECTORY}/cmake/modules" ${CMAKE_MODULE_PATH})
Include(CbmMacros)
FairRootVersion()
#Set(CMAKE_MODULE_PATH "${CTEST_SOURCE_DIRECTORY}/cmake/modules" ${CMAKE_MODULE_PATH})
#set(FAIRROOTPATH $ENV{FAIRROOTPATH})
#Include(CbmMacros)
#FairRootVersion()
Set(CTEST_USE_LAUNCHERS 1)
......@@ -81,27 +88,20 @@ If(NOT _RETVAL)
)
If(${_CMakeModel} MATCHES Continuous)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
CTest_Submit(PARTS Update Configure Build)
Else()
CTest_Submit(PARTS Update Configure Build
BUILD_ID cdash_build_id
)
EndIf()
CTest_Submit(PARTS Update Configure Build
BUILD_ID cdash_build_id
)
if(${_NUM_ERROR} GREATER 0)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Else()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
EndIf()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
Message(STATUS "Build finished with ${_NUM_ERROR} errors")
message(FATAL_ERROR "Compilation failure")
endif()
......@@ -114,35 +114,23 @@ If(NOT _RETVAL)
)
If(${_CMakeModel} MATCHES Continuous)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
CTest_Submit(PARTS Test)
Else()
CTest_Submit(PARTS Test
BUILD_ID cdash_build_id
)
EndIf()
CTest_Submit(PARTS Test
BUILD_ID cdash_build_id
)
EndIf()
If(GCOV_COMMAND)
Ctest_Coverage(BUILD "${CTEST_BINARY_DIRECTORY}")
If(${_CMakeModel} MATCHES Continuous)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
CTest_Submit(PARTS Coverage)
Else()
CTest_Submit(PARTS Coverage
BUILD_ID cdash_build_id
)
EndIf()
CTest_Submit(PARTS Coverage
BUILD_ID cdash_build_id
)
EndIf()
EndIf()
Ctest_Upload(FILES ${CTEST_NOTES_FILES})
If(NOT ${_CMakeModel} MATCHES Continuous)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Ctest_Submit()
Else()
Ctest_Submit(BUILD_ID cdash_build_id)
EndIf()
Ctest_Submit(BUILD_ID cdash_build_id)
EndIf()
If(EXTRA_FLAGS MATCHES "INSTALL_PREFIX" AND EXTRA_FLAGS MATCHES "CBM_TEST_INSTALL" AND NOT _ctest_test_ret_val)
......@@ -159,47 +147,40 @@ If(NOT _RETVAL)
RESULTS_VARIABLE _install_ret_value
)
endif()
Else()
# if installation isn't tested the return value should be 0
set(_install_ret_value false)
EndIf()
Else()
# if installation isn't tested the return value should be 0
set(_install_ret_value false)
EndIf()
Message("_ctest_test_ret_val: ${_ctest_test_ret_val}")
Message("_install_ret_value: ${_install_ret_value}")
# Pipeline should fail also in case of failed tests
if (_ctest_test_ret_val OR _install_ret_value)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Else()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
EndIf()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
Message(FATAL_ERROR "Some tests failed.")
endif()
Else()
If(${CMAKE_VERSION} VERSION_LESS "3.14.0")
Ctest_Submit()
Else()
CTest_Submit(BUILD_ID cdash_build_id)
EndIf()
CTest_Submit(BUILD_ID cdash_build_id)
EndIf()
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Else()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
EndIf()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
......@@ -45,7 +45,7 @@ void CbmHistoServer::InitTask()
bool CbmHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
{
TObject* tempObject = nullptr;
Deserialize<RootSerializer>(*msg, tempObject);
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("MqHistos.root")
, fuHttpServerPort(8098)
, fArrayHisto()
, fvpsHistosFolder()
, fvpsCanvasConfig()
, fvHistos()
, fvCanvas()
, fNMessages(0)
, fServer(nullptr)
, fStopThread(false)
{
}
......@@ -308,8 +296,10 @@ void CbmMqHistoServer::UpdateHttpServer()
void CbmMqHistoServer::PostRun()
{
SaveHistograms();
fStopThread = true;
fThread.join();
SaveHistograms();
}
template<class HistoT>
......
......@@ -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);
......
......@@ -77,7 +77,7 @@ set(EXE_NAME HitBuilderTof)
set(SRCS CbmDeviceHitBuilderTof.cxx runHitBuilderTof.cxx)
set(DEPENDENCIES
${DEPENDENCIES_ALL}
# fles_ipc
# external::fles_ipc
CbmBase
CbmData
CbmTofBase
......
......@@ -78,6 +78,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 +136,11 @@ CbmDeviceHitBuilderTof::CbmDeviceHitBuilderTof()
, fvPulserOffset()
, fvPulserTimes()
, fhEvDetMul(NULL)
, fhEvDigiMul(NULL)
, fhEvRateIn(NULL)
, fhEvRateOut(NULL)
, fhPulMul(NULL)
, fhDigiTdif(NULL)
, fhPulserTimesRaw()
, fhPulserTimeRawEvo()
, fhPulserTimesCor()
......@@ -297,6 +304,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);
......@@ -366,7 +374,8 @@ Bool_t CbmDeviceHitBuilderTof::InitRootOutput()
// 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();
......@@ -475,9 +484,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;
}
}
......@@ -505,7 +512,18 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
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);
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);
......@@ -534,7 +552,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 +610,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 +676,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 +693,13 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
//if(!MergeClusters()) return kFALSE;
if (NULL != fOutRootFile) { // CbmEvent output to root file
fEvtHeader->SetEventTime((double) fEventHeader[4]);
rootMgr->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 +989,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,6 +1035,9 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
Int_t iSmType = CbmTofAddress::GetSmType(iUniqueId);
Int_t iSmId = CbmTofAddress::GetSmId(iUniqueId);
Int_t iRpcId = CbmTofAddress::GetRpcId(iUniqueId);
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),
......@@ -1046,7 +1116,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 +1514,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 +1551,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 +1740,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 +3812,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;
}
......
......@@ -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;
......
......@@ -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
......@@ -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 &
......
#!/bin/bash
# Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Florian Uhlig
$FAIRROOTPATH/bin/shmmonitor --cleanup
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=1
_iUnp=4
_batch=1
_pulmulmin=5
_pultotmin=50
_pultotmax=500
_puldetref=12 # TSR=022
#_puldetref=16 # TSR=032
#_tofftof=0.
_tofftof=-35.
if [[ $_reqmod -eq 1 ]]; then
_iUnp=1
fi
#_dirname=/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2018/input/$_runname/
_outdir=${VMCWORKDIR}/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="${_runname}_node8_*.tsa;${_runname}_node9_*.tsa"
_dirname="${VMCWORKDIR}/build/bin/MQ/topologies/tsaData2022"
#_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
#_mapfile=${VMCWORKDIR}/MQ/hitbuilder/MapTofGbtx.par
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2021/mTofPar.par
if [ $_runname -ge 707 ] && [ $_runname -lt 754 ]; then
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2020/mTofPar_2Stack.par
else
if [ $_runname -ge 754 ] && [ $_runname -lt 900 ]; then
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2020/mTofPar_3Stack.par
_puldetref=12 # TSR=022
else
if [ $_runname -ge 1079 ] && [ $_runname -lt 1086 ]; then
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2021/mTofPar2Stack.par
else
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2021/mTofCriPar.par
fi
fi
fi
#_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2018/etofPar.par
#_digibdffile=${VMCWORKDIR}/parameters/tof/v18j_cosmicHD.digibdf.par
#_digiparfile=${VMCWORKDIR}/parameters/tof/tof_v18j_cosmicHD.digi.par
_digibdffile=${VMCWORKDIR}/parameters/tof/tof_v21f_mcbm.digibdf.par
#_digiparfile=${VMCWORKDIR}/parameters/tof/tof_v19b_mcbm.digi.par
# ROOT files
#_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2018/tof_v18l_mCbm.par.root
#_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_01.par.root
#_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_02.par.root
_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_09.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"
PARAMETERSERVER+=" --file-severity info"
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ_${_runname}.out"
nohup ${VMCWORKDIR}/build/bin/MQ/parmq/$PARAMETERSERVER &
else
xterm -geometry 80x23+0+340 -hold -e ${VMCWORKDIR}/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,sndBufSize=10,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+=" --file-severity info"
#SAMPLER+=" --file-severity debug"
SAMPLER+=" --SelectComponents 0"
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl_${_runname}.out"
SAMPLER+=" --control static"
echo Sampler cmd:
echo ${VMCWORKDIR}/build/bin/MQ/source/$SAMPLER
nohup ${VMCWORKDIR}/build/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/source/$SAMPLER &
fi
while (( _iUnp > 0 )); do
UNPACKER="UnpackTofCri"
UNPACKER+=" --id unpack$_iUnp"
UNPACKER+=" --channel-config name=tofcomponent,type=pull,method=connect,rcvBufSize=2,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,sndBufSize=2,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+=" --file-severity info"
UNPACKER+=" --SelectComponents 0"
#UNPACKER+=" --ReqBeam 20486" # diamond -> 0x00005006 v14a
UNPACKER+=" --ReqBeam 10246" # diamond -> 0x00002806 v21a
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
-810)
UNPACKER+=" --ReqDet0 16406" # RPC 810 -> 0x00004016 v21a
#UNPACKER+=" --ReqDet1 10246" # diamond 500 -> 0x00002806 v21a
#UNPACKER+=" --ReqDet2 98358" # RPC 033 -> 0x00018036 v21a
#UNPACKER+=" --ReqDet3 12294" # RPC 600 -> 0x00003006 v21a
#UNPACKER+=" --ReqDet4 98374" # RPC 043 -> 0x00018046 v21a
;;
*)
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 ${VMCWORKDIR}/build/bin/MQ/unpacker/$UNPACKER &
#VALGRIND_UNP="valgrind -v --error-limit=no --tool=memcheck --leak-check=full --show-reachable=yes --log-file=valgrind_unp_log.txt"
VALGRIND_UNP="valgrind -v --error-limit=no --tool=massif --massif-out-file=massif_unp_log.out"
#nohup $VALGRIND_UNP ${VMCWORKDIR}/build/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
HITBUILDER+=" --channel-config name=tofdigis,type=pull,method=bind,rcvBufSize=4,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+=" --file-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+=" --RunId 1629444189" # tof_mcbm_beam_2021_07.par.root
HITBUILDER+=" --RunId 1648616420" # tof_mcbm_beam_2021_09.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 0"
HITBUILDER+=" --BRefDet 3"
HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 1"
HITBUILDER+=" --DutRpc 3"
HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 2"
HITBUILDER+=" --SelRpc 3"
HITBUILDER+=" --Sel2Type 0"
HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 3"
if [[ $_reqmod -eq 1 ]]; then
HITBUILDER+=" --Mode 1"
fi
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild_${_runname}.out"
nohup ${VMCWORKDIR}/build/bin/MQ/hitbuilder/$HITBUILDER &
else
xterm -geometry 120x23+1400+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/hitbuilder/$HITBUILDER &
fi
#!/bin/bash
# Copyright (C) 2020 PI-UHd,GSI
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Norbert Herrmann
$FAIRROOTPATH/bin/shmmonitor --cleanup
if [ -z "$1" ]; then
_runname="MCBM_cosmic_`date +%F`_`date +%T`"
else
_runname=$1
fi
if [ -z "$2" ]; then
_version=0
else
_version=$2
fi
if [ -z "$3" ]; then
_node="node8"
else
_node=$3
fi
_reqmod=0
_reqtint=50
_ntimeslices=-1
#_ntimeslices=100
_iUnp=1
_batch=1
_pulmode=0
_pulmulmin=18
_pultotmin=80
_pultotmax=500
_puldetref=12 # TSR=022
#_puldetref=16 # TSR=032
#_puldetref=17 # TSR=032
_tofftof=0.
#_tofftof=-30.
if [[ $_reqmod -eq 1 ]]; then
_iUnp=1
fi
_dirname=${VMCWORKDIR}/macro/beamtime/mcbm2021/input/$_runname/
#_outdir=${VMCWORKDIR}/macro/beamtime/hd2020/data/
_outdir=${VMCWORKDIR}/macro/beamtime/mcbm2021/data/
#_datapath=~/KRONOS/CBM/cbmroot/git/cbmroot
_filename=$_runname*.tsa
#_filename=${VMCWORKDIR}/macro/beamtime/hd2020/input/$_runname/*.tsa
#_outdir=$_datapath/macro/beamtime/mcbm2018/data/
#_filename="./tsaData/_pn05_*.tsa;./tsaData/_pn06_*.tsa;./tsaData/_pn07_*.tsa"
_digifile=$_runname.$_reqtint.$_reqmod.$_pulmode.$_version.$_node.root
# ASCII files
_mapfile=${VMCWORKDIR}/macro/beamtime/mcbm2021/mTofCriPar.par
_digibdffile=${VMCWORKDIR}/parameters/tof/tof_v21f_mcbm.digibdf.par
#_digiparfile=${VMCWORKDIR}/parameters/tof/tof_v21c_mcbm.digi.par
# ROOT files
#_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_07.par.root
#_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_07_surveyed.par.root
_geofile=${VMCWORKDIR}/macro/beamtime/mcbm2021/tof_mcbm_beam_2021_08.par.root
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:5005"
#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"
PARAMETERSERVER+=" --severity DEBUG"
#PARAMETERSERVER+=" --file-severity INFO"
if [[ $_batch = 1 ]]; then
PARAMETERSERVER+=" --control static"
PARAMETERSERVER+=" --log-to-file ParServ.out"
nohup ${VMCWORKDIR}/build/bin/MQ/parmq/$PARAMETERSERVER &
else
xterm -geometry 80x23+0+340 -hold -e ${VMCWORKDIR}/build/bin/MQ/parmq/$PARAMETERSERVER &
#xterm -geometry 80x23+500+0 -hold -e /home/cbm/starsoft/fairroot_v18.0.6-fairsoft_may18p1_root6/bin/$PARAMETERSERVER &
fi
SAMPLER="TsaMultiSamplerTof"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices $_ntimeslices"
#SAMPLER+=" --max-timeslices 1000000"
#SAMPLER+=" --flib-port 5556"
#SAMPLER+=" --flib-host $_node"
SAMPLER+=" --dirname $_dirname"
SAMPLER+=" --filename $_filename"
SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:5655"
SAMPLER+=" --channel-config name=syscmd,type=pub,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:5666"
#SAMPLER+=" --transport shmem"
#SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
#SAMPLER+=" --severity WARN"
SAMPLER+=" --severity INFO"
SAMPLER+=" --file-severity INFO"
#SAMPLER+=" --severity DEBUG"
SAMPLER+=" --SelectComponents 0"
if [[ $_batch = 1 ]]; then
SAMPLER+=" --log-to-file Sampl.out"
SAMPLER+=" --control static"
nohup ${VMCWORKDIR}/build/bin/MQ/source/$SAMPLER &
else
xterm -geometry 80x23+0+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/source/$SAMPLER &
fi
while (( _iUnp > 0 )); do
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:5655"
UNPACKER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:5005"
UNPACKER+=" --channel-config name=tofdigis,type=push,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:5656"
UNPACKER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:5666"
#UNPACKER+=" --transport shmem"
#UNPACKER+=" --severity DEBUG"
#UNPACKER+=" --severity INFO"
UNPACKER+=" --file-severity info"
UNPACKER+=" --SelectComponents 0"
UNPACKER+=" --ReqMode $_reqmod"
UNPACKER+=" --ReqTint $_reqtint"
UNPACKER+=" --PulserMode $_pulmode"
UNPACKER+=" --PulMulMin $_pulmulmin"
UNPACKER+=" --PulTotMin $_pultotmin"
UNPACKER+=" --PulTotMax $_pultotmax"
UNPACKER+=" --ToffTof $_tofftof"
UNPACKER+=" --RefModType -1"
UNPACKER+=" --RefModId 0"
UNPACKER+=" --RefCtrType 0"
UNPACKER+=" --RefCtrId 0"
if [[ $_batch = 1 ]]; then
UNPACKER+=" --control static"
UNPACKER+=" --log-to-file Unp$_iUnp.out"
nohup ${VMCWORKDIR}/build/bin/MQ/unpacker/$UNPACKER &
else
xterm -geometry 110x23+520+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/unpacker/$UNPACKER &
fi
(( _iUnp -= 1 ))
done
HITBUILDER="HitBuilderTof"
HITBUILDER+=" --id hitbuilder1"
HITBUILDER+=" --channel-config name=tofdigis,type=pull,method=bind,rateLogging=0,transport=zeromq,address=tcp://*:5656"
HITBUILDER+=" --channel-config name=parameters,type=req,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:5005"
HITBUILDER+=" --channel-config name=syscmd,type=sub,method=connect,rateLogging=0,transport=zeromq,address=tcp://127.0.0.1:5666"
#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+=" --file-severity INFO"
#HITBUILDER+=" --severity WARN"
HITBUILDER+=" --OutRootFile $_outdir$_digifile"
#HITBUILDER+=" --MaxEvent 10000000"
#HITBUILDER+=" --RunId 1581312162" # v20a
#HITBUILDER+=" --RunId 1597162455" # v20b
#HITBUILDER+=" --RunId 1621902311" # tof_mcbm_beam_2021_02.par.root
#HITBUILDER+=" --RunId 1629444189" # tof_mcbm_beam_2021_07.par.root
#HITBUILDER+=" --RunId 1639163969" # tof_mcbm_beam_2021_07_surveyed.par.root
HITBUILDER+=" --RunId 1647348218" # tof_mcbm_beam_2021_08.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 -1" # -1 = no beam counter
HITBUILDER+=" --BRefSm 0"
HITBUILDER+=" --BRefDet -1" # -1 = use ModMask
HITBUILDER+=" --DutType 0"
HITBUILDER+=" --DutSm 1"
HITBUILDER+=" --DutRpc 2"
HITBUILDER+=" --SelType 0"
HITBUILDER+=" --SelSm 2"
HITBUILDER+=" --SelRpc 2"
HITBUILDER+=" --Sel2Type 2"
HITBUILDER+=" --Sel2Sm 0"
HITBUILDER+=" --Sel2Rpc 2"
if [[ $_batch = 1 ]]; then
HITBUILDER+=" --control static"
HITBUILDER+=" --log-to-file HitBuild.out"
nohup ${VMCWORKDIR}/build/bin/MQ/hitbuilder/$HITBUILDER &
else
xterm -geometry 120x23+1400+0 -hold -e ${VMCWORKDIR}/build/bin/MQ/hitbuilder/$HITBUILDER &
fi
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQMcbmPulserMonitor2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQMcbmPulserMonitor2020.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQMcbmEvtBuilderWin2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQMcbmEvtBuilderWin2020.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQBuildRawEvents.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQBuildRawEvents.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBuildRawEvents2021.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBuildRawEvents2021.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQMcbmPulserMonitor2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQMcbmPulserMonitor2020.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQMcbmEvtBuilderWin2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQMcbmEvtBuilderWin2020.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQBuildRawEvents.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQBuildRawEvents.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBuildRawEvents2021.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBuildRawEvents2021.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBuildRawEventsCosmics2021.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBuildRawEventsCosmics2021.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBuildRawEvents2022.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBuildRawEvents2022.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBuildRawEvents2022.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBuildRawEvents2022.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startBmonMoni2022.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startBmonMoni2022.sh)
set(INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}
......@@ -48,6 +49,7 @@ set(INCLUDE_DIRECTORIES
Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
${ZeroMQ_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${FAIRROOT_INCLUDE_DIR}
......@@ -265,8 +267,38 @@ set(DEPENDENCIES
CbmBase
CbmData
Core
Gpad
Hist
Net
RHTTP
RIO
Tree
)
GENERATE_EXECUTABLE()
set(EXE_NAME BmonMonitor)
set(SRCS CbmDeviceBmonMonitor.cxx runBmonMonitor.cxx)
set(DEPENDENCIES
${DEPENDENCIES}
${FAIR_LIBS}
ParBase
${BOOST_LIBS}
external::fles_ipc
CbmFlibFlesTools
CbmBase
CbmRecoBase
CbmMuchReco
CbmPsdReco
CbmRichReco
CbmRecoSts
CbmTofReco
CbmTrdReco
CbmData
CbmSimSteer # for CbmSetup!
Core
RIO
Net
Hist
RHTTP
......@@ -288,6 +320,7 @@ configure_file(${MY_SOURCE_DIR}/startMQMcbmEvtBuilderWin2020.sh.in ${TMPDIR}/b
configure_file(${MY_SOURCE_DIR}/startMQBuildRawEvents.sh.in ${TMPDIR}/bin/MQ/topologies/install/startMQBuildRawEvents.sh)
configure_file(${MY_SOURCE_DIR}/startBuildRawEvents2021.sh.in ${TMPDIR}/bin/MQ/topologies/install/startBuildRawEvents2021.sh)
configure_file(${MY_SOURCE_DIR}/startBuildRawEventsCosmics2021.sh.in ${TMPDIR}/bin/MQ/topologies/install/startBuildRawEventsCosmics2021.sh)
configure_file(${MY_SOURCE_DIR}/startBmonMoni2022.sh.in ${TMPDIR}/bin/MQ/topologies/install/startBmonMoni2022.sh)
install(PROGRAMS ${TMPDIR}/bin/MQ/topologies/install/startMQMcbmPulserMonitor2020.sh
${TMPDIR}/bin/MQ/topologies/install/startMQMcbmEvtBuilderWin2020.sh
......
This diff is collapsed.
/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
/**
* CbmDeviceBmonMonitor.h
*
* @since 2022-05-23
* @author P.-A. Loizeau
*/
#ifndef CBMDEVICEBMONMONI_H_
#define CBMDEVICEBMONMONI_H_
#include "CbmMqTMessage.h"
#include "CbmTsEventHeader.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
#include "FairParGenericSet.h"
#include "Rtypes.h"
#include "TObjArray.h"
#include <chrono>
#include <map>
#include <vector>
class TList;
class CbmBmonUnpackConfig;
class TimesliceMetaData;
class CbmTrdSpadic;
class CbmDeviceBmonMonitor : public FairMQDevice {
public:
CbmDeviceBmonMonitor();
virtual ~CbmDeviceBmonMonitor();
protected:
virtual void InitTask();
bool ConditionalRun();
bool HandleCommand(FairMQMessagePtr&, int);
/** @brief Set the Bmon Unpack Config @param config */
void SetUnpackConfig(std::shared_ptr<CbmBmonUnpackConfig> config) { fBmonConfig = config; }
private:
/// Constants
static constexpr std::uint16_t fkFlesBmon = static_cast<std::uint16_t>(fles::SubsystemIdentifier::T0);
/// Control flags
Bool_t fbIgnoreOverlapMs = false; //! Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice
Bool_t fbComponentsAddedToList = kFALSE;
bool fbStartTimeSet = false;
/** @brief Flag if extended debug output is to be printed or not*/
bool fDoDebugPrints = false; //!
/** @brief Flag if performance profiling should be activated or not.*/
bool fDoPerfProf = false; //!
/** @brief Flag to Enable/disable a full time sorting. If off, time sorting happens per link/FLIM source */
bool fbOutputFullTimeSorting = false;
/// User settings parameters
std::string fsSetupName = "mcbm_beam_2021_07_surveyed";
uint32_t fuRunId = 1588;
/// ---> for selective unpacking
bool fbUnpBmon = true;
/// message queues
std::string fsChannelNameDataInput = "ts-request";
std::string fsChannelNameDataOutput = "unpts_0";
std::string fsChannelNameCommands = "commands";
std::string fsChannelNameHistosInput = "histogram-in";
/// Histograms management
uint32_t fuPublishFreqTs = 100;
double_t fdMinPublishTime = 0.5;
double_t fdMaxPublishTime = 5.0;
/// Parameters management
// TList* fParCList = nullptr;
Bool_t InitParameters(std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>* reqparvec);
/// Statistics & first TS rejection
uint64_t fulNumMessages = 0;
uint64_t fulTsCounter = 0;
std::chrono::system_clock::time_point fLastPublishTime = std::chrono::system_clock::now();
/** @brief Map to store a name for the unpackers and the processed amount of digis, key = fkFlesId*/
std::map<std::uint16_t, std::pair<std::string, size_t>> fNameMap = {}; //!
/** @brief Map to store the cpu and wall time, key = fkFlesId*/
std::map<std::uint16_t, std::pair<double, double>> fTimeMap = {}; //!
/** @brief Map to store the in and out data amount, key = fkFlesId*/
std::map<std::uint16_t, std::pair<double, double>> fDataSizeMap = {}; //!
/// Configuration of the unpackers. Provides the configured algorithm
std::shared_ptr<CbmBmonUnpackConfig> fBmonConfig = nullptr;
/// Pointer to the Timeslice header conatining start time and index
CbmTsEventHeader* fCbmTsEventHeader = nullptr;
/// Time offsets
std::vector<std::string> fvsSetTimeOffs = {};
/// TS MetaData storage: stable so should be moved somehow to parameters handling (not transmitted with each TS
size_t fuNbCoreMsPerTs = 0; //!
size_t fuNbOverMsPerTs = 0; //!
Double_t fdMsSizeInNs = 0; //! Size of a single MS, [nanoseconds]
Double_t fdTsCoreSizeInNs = -1.0; //! Total size of the core MS in a TS, [nanoseconds]
Double_t fdTsOverSizeInNs = -1.0; //! Total size of the overlap MS in a TS, [nanoseconds]
Double_t fdTsFullSizeInNs = -1.0; //! Total size of all MS in a TS, [nanoseconds]
TimesliceMetaData* fTsMetaData;
/// Array of histograms to send to the histogram server
TObjArray fArrayHisto = {};
/// Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server
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 "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 = {};
/// Flag indicating whether the histograms and canvases configurations were already published
bool fbConfigSent = false;
Bool_t InitContainers();
bool InitHistograms();
Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
void Finish();
bool SendUnpData();
bool SendHistoConfAndData();
bool SendHistograms();
std::shared_ptr<CbmTrdSpadic> GetTrdSpadic(bool useAvgBaseline);
/** @brief Sort a vector timewise vector type has to provide GetTime() */
template<typename TVecobj>
typename std::enable_if<std::is_same<TVecobj, std::nullptr_t>::value == true, void>::type
timesort(std::vector<TVecobj>* /*vec = nullptr*/)
{
LOG(debug)
<< "CbmDeviceBmonMonitor::timesort() got an object that has no member function GetTime(). Hence, we can and "
"will not timesort it!";
}
template<typename TVecobj>
typename std::enable_if<!std::is_member_function_pointer<decltype(&TVecobj::GetTime)>::value, void>::type
timesort(std::vector<TVecobj>* /*vec = nullptr*/)
{
LOG(debug) << "CbmDeviceBmonMonitor::timesort() " << TVecobj::Class_Name()
<< "is an object that has no member function GetTime(). Hence, we can and "
"will not timesort it!";
}
template<typename TVecobj>
typename std::enable_if<std::is_member_function_pointer<decltype(&TVecobj::GetTime)>::value, void>::type
timesort(std::vector<TVecobj>* vec = nullptr)
{
if (vec == nullptr) return;
std::sort(vec->begin(), vec->end(),
[](const TVecobj& a, const TVecobj& b) -> bool { return a.GetTime() < b.GetTime(); });
}
/**
* @brief Template for the unpacking call of a given algorithm.
*
* @tparam TAlgo Algorithm to be called
* @tparam TOutput Output element types
* @tparam TOptoutputs Optional output element types
* @param ts Timeslice
* @param icomp Component number
* @param algo Algorithm to be used for this component
* @param outtargetvec Target vector for the output elements
* @param optoutputvecs Target vectors for optional outputs
* @return std::pair<ndigis, std::pair<cputime, walltime>>
*/
template<class TConfig, class TOptOutA = std::nullptr_t, class TOptOutB = std::nullptr_t>
size_t unpack(const std::uint16_t subsysid, const fles::Timeslice* ts, std::uint16_t icomp, TConfig config,
std::vector<TOptOutA>* optouttargetvecA = nullptr, std::vector<TOptOutB>* optouttargetvecB = nullptr)
{
auto wallstarttime = std::chrono::high_resolution_clock::now();
std::clock_t cpustarttime = std::clock();
auto algo = config->GetUnpacker();
std::vector<TOptOutA> optoutAvec = {};
std::vector<TOptOutB> optoutBvec = {};
if (optouttargetvecA) { algo->SetOptOutAVec(&optoutAvec); }
if (optouttargetvecB) { algo->SetOptOutBVec(&optoutBvec); }
// Set the start time of the current TS for this algorithm
algo->SetTsStartTime(ts->start_time());
// Run the actual unpacking
auto digivec = algo->Unpack(ts, icomp);
// Check if we want to write the output to somewhere (in pure online monitoring mode for example this can/would/should be skipped)
if (config->GetOutputVec()) {
// Lets do some time-sorting if we are not doing it later
if (!fbOutputFullTimeSorting) timesort(&digivec);
// Transfer the data from the timeslice vector to the target branch vector
// Digis/default output retrieved as offered by the algorithm
for (auto digi : digivec)
config->GetOutputVec()->emplace_back(digi);
}
if (optouttargetvecA) {
// Lets do some timesorting
if (!fbOutputFullTimeSorting) timesort(&optoutAvec);
// Transfer the data from the timeslice vector to the target branch vector
for (auto optoutA : optoutAvec)
optouttargetvecA->emplace_back(optoutA);
}
if (optouttargetvecB) {
// Second opt output is not time sorted to allow non GetTime data container.
// Lets do some timesorting
timesort(&optoutAvec);
// Transfer the data from the timeslice vector to the target branch vector
for (auto optoutB : optoutBvec)
optouttargetvecB->emplace_back(optoutB);
}
std::clock_t cpuendtime = std::clock();
auto wallendtime = std::chrono::high_resolution_clock::now();
// Cpu time in [µs]
auto cputime = 1e6 * (cpuendtime - cpustarttime) / CLOCKS_PER_SEC;
algo->AddCpuTime(cputime);
// Real time in [µs]
auto walltime = std::chrono::duration<double, std::micro>(wallendtime - wallstarttime).count();
algo->AddWallTime(walltime);
// Check some numbers from this timeslice
size_t nDigis = digivec.size();
LOG(debug) << "Component " << icomp << " connected to config " << config->GetName() << " n-Digis " << nDigis
<< " processed in walltime(cputime) = " << walltime << "(" << cputime << cputime << ") µs"
<< "this timeslice.";
if (fDoPerfProf) {
auto timeit = fTimeMap.find(subsysid);
timeit->second.first += cputime;
timeit->second.second += walltime;
auto datait = fDataSizeMap.find(subsysid);
datait->second.first += ts->size_component(icomp) / 1.0e6;
datait->second.second += nDigis * algo->GetOutputObjSize() / 1.0e6;
fNameMap.find(subsysid)->second.second += nDigis;
}
return nDigis;
}
};
#endif /* CBMDEVICEMCBMUNPACK_H_ */
......@@ -12,6 +12,7 @@
#include "CbmDeviceBuildDigiEvents.h"
/// CBM headers
#include "CbmDigiEvent.h"
#include "CbmEvent.h"
#include "CbmFlesCanvasTools.h"
#include "CbmMQDefs.h"
......@@ -69,7 +70,10 @@ try {
fvsSetTrigMinNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMinNb");
fvsSetTrigMaxNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMaxNb");
fvsSetTrigMinLayersNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMinLayersNb");
fvsSetHistMaxDigiNb = fConfig->GetValue<std::vector<std::string>>("SetHistMaxDigiNb");
fbDoNotSend = fConfig->GetValue<bool>("DoNotSend");
fbDigiEventOutput = fConfig->GetValue<bool>("DigiEventOutput");
fsChannelNameDataInput = fConfig->GetValue<std::string>("TsNameIn");
fsChannelNameDataOutput = fConfig->GetValue<std::string>("EvtNameOut");
fsChannelNameHistosInput = fConfig->GetValue<std::string>("ChNameIn");
......@@ -137,7 +141,7 @@ try {
}
}
/// Extract detector to remove if any
/// Extract detector to remove if any
for (std::vector<std::string>::iterator itStrRem = fvsDelDet.begin();
itStrRem != fvsDelDet.end();
++itStrRem) {
......@@ -152,7 +156,8 @@ try {
continue;
}
}
/// Extract Trigger window to add if any
/// Extract Trigger window to add if any
for (std::vector<std::string>::iterator itStrTrigWin = fvsSetTrigWin.begin();
itStrTrigWin != fvsSetTrigWin.end();
++itStrTrigWin) {
......@@ -257,9 +262,9 @@ try {
/// Max number
charPosDel++;
UInt_t uMaxNb = std::stoul((*itStrMaxNb).substr(charPosDel));
Int_t iMaxNb = std::stol((*itStrMaxNb).substr(charPosDel));
fpAlgo->SetTriggerMaxNumber(selDet, uMaxNb);
fpAlgo->SetTriggerMaxNumber(selDet, iMaxNb);
}
/// Extract MinLayersNb for trigger if any
......@@ -294,6 +299,39 @@ try {
fpAlgo->SetTriggerMinLayersNumber(selDet, uMinLayersNb);
}
/// Extract Histograms Max Digi limits if any
for (std::vector<std::string>::iterator itStrHistMaxDigi = fvsSetHistMaxDigiNb.begin();
itStrHistMaxDigi != fvsSetHistMaxDigiNb.end();
++itStrHistMaxDigi) {
size_t charPosDel = (*itStrHistMaxDigi).find(',');
if (std::string::npos == charPosDel) {
LOG(info)
<< "CbmDeviceBuildDigiEvents::InitTask => "
<< "Trying to set Histos max Digi nb with invalid option pattern, ignored! "
<< " (Should be ECbmModuleId,dMaxDigiNb but instead found " << (*itStrHistMaxDigi)
<< " )";
continue;
}
/// Detector Enum Tag
std::string sSelDet = (*itStrHistMaxDigi).substr(0, charPosDel);
ECbmModuleId selDet = GetDetectorId(sSelDet);
if (ECbmModuleId::kNotExist == selDet) {
LOG(info)
<< "CbmDeviceBuildDigiEvents::InitTask => "
<< "Trying to set Histos max Digi nb for unsupported detector, ignored! "
<< sSelDet;
continue;
}
/// Min number
charPosDel++;
Double_t dHistMaxDigiNb = std::stod((*itStrHistMaxDigi).substr(charPosDel));
LOG(debug) << "set Histos max Digi nb to " << dHistMaxDigiNb;
fpAlgo->SetHistogramMaxDigiNb(selDet, dHistMaxDigiNb);
}
/// FIXME: Re-enable clang formatting after formatted lines
/* clang-format on */
......@@ -541,7 +579,14 @@ bool CbmDeviceBuildDigiEvents::HandleData(FairMQParts& parts, int /*index*/)
fpAlgo->ProcessTs();
/// Send events vector to ouput
if (!SendEvents(parts)) return false;
if (!fbDoNotSend) {
if (fbDigiEventOutput) {
if (!(SendDigiEvents(parts))) return false;
}
else {
if (!(SendEvents(parts))) return false;
}
}
/// Clear metadata
fTimeSliceMetaDataArray->Clear();
......@@ -628,6 +673,128 @@ bool CbmDeviceBuildDigiEvents::SendEvents(FairMQParts& partsIn)
return true;
}
bool CbmDeviceBuildDigiEvents::SendDigiEvents(FairMQParts& partsIn)
{
/// Get vector reference from algo
std::vector<CbmEvent*> vEvents = fpAlgo->GetEventVector();
/// Move CbmEvent from temporary vector to std::vector of full objects
LOG(debug) << "In Vector size: " << vEvents.size();
std::vector<CbmDigiEvent> vOutEvents;
vOutEvents.reserve(vEvents.size());
for (CbmEvent* event : vEvents) {
CbmDigiEvent selEvent;
selEvent.fTime = event->GetStartTime();
selEvent.fNumber = event->GetNumber();
/// FIXME: for pure digi based event, we select "continuous slices of digis"
/// => Copy block of [First Digi index, last digi index] with assign(it_start, it_stop)
/// FIXME: Keep TRD1D + TRD2D support, may lead to holes in the digi sequence!
/// => Would need to keep the loop
/// Get the proper order for block selection as TRD1D and TRD2D may insert indices in separate loops
/// => Needed to ensure that the start and stop of the block copy do not trigger a vector size exception
event->SortIndices();
/// for each detector, find the data in the Digi vectors and copy them
/// TODO: Template + loop on list of data types?
/// ==> T0
uint32_t uNbDigis = (0 < event->GetNofData(ECbmDataType::kT0Digi) ? event->GetNofData(ECbmDataType::kT0Digi) : 0);
if (uNbDigis) {
auto startIt = fvDigiT0->begin() + event->GetIndex(ECbmDataType::kT0Digi, 0);
auto stopIt = fvDigiT0->begin() + event->GetIndex(ECbmDataType::kT0Digi, uNbDigis - 1);
++stopIt;
selEvent.fData.fT0.fDigis.assign(startIt, stopIt);
}
/// ==> STS
uNbDigis = (0 < event->GetNofData(ECbmDataType::kStsDigi) ? event->GetNofData(ECbmDataType::kStsDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiSts->begin() + event->GetIndex(ECbmDataType::kStsDigi, 0);
auto stopIt = fvDigiSts->begin() + event->GetIndex(ECbmDataType::kStsDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fSts.fDigis.assign(startIt, stopIt);
}
/// ==> MUCH
uNbDigis = (0 < event->GetNofData(ECbmDataType::kMuchDigi) ? event->GetNofData(ECbmDataType::kMuchDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiMuch->begin() + event->GetIndex(ECbmDataType::kMuchDigi, 0);
auto stopIt = fvDigiMuch->begin() + event->GetIndex(ECbmDataType::kMuchDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fMuch.fDigis.assign(startIt, stopIt);
}
/// ==> TRD + TRD2D
uNbDigis = (0 < event->GetNofData(ECbmDataType::kTrdDigi) ? event->GetNofData(ECbmDataType::kTrdDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiTrd->begin() + event->GetIndex(ECbmDataType::kTrdDigi, 0);
auto stopIt = fvDigiTrd->begin() + event->GetIndex(ECbmDataType::kTrdDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fTrd.fDigis.assign(startIt, stopIt);
}
/// ==> TOF
uNbDigis = (0 < event->GetNofData(ECbmDataType::kTofDigi) ? event->GetNofData(ECbmDataType::kTofDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiTof->begin() + event->GetIndex(ECbmDataType::kTofDigi, 0);
auto stopIt = fvDigiTof->begin() + event->GetIndex(ECbmDataType::kTofDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fTof.fDigis.assign(startIt, stopIt);
}
/// ==> RICH
uNbDigis = (0 < event->GetNofData(ECbmDataType::kRichDigi) ? event->GetNofData(ECbmDataType::kRichDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiRich->begin() + event->GetIndex(ECbmDataType::kRichDigi, 0);
auto stopIt = fvDigiRich->begin() + event->GetIndex(ECbmDataType::kRichDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fRich.fDigis.assign(startIt, stopIt);
}
/// ==> PSD
uNbDigis = (0 < event->GetNofData(ECbmDataType::kPsdDigi) ? event->GetNofData(ECbmDataType::kPsdDigi) : 0);
if (uNbDigis) {
auto startIt = fvDigiPsd->begin() + event->GetIndex(ECbmDataType::kPsdDigi, 0);
auto stopIt = fvDigiPsd->begin() + event->GetIndex(ECbmDataType::kPsdDigi, uNbDigis - 1);
++stopIt;
selEvent.fData.fPsd.fDigis.assign(startIt, stopIt);
}
vOutEvents.push_back(std::move(selEvent));
}
LOG(debug) << "Out Vector size: " << vEvents.size();
/// Serialize the array of events into a single MQ message
std::stringstream ossEvt;
boost::archive::binary_oarchive oaEvt(ossEvt);
oaEvt << vOutEvents;
std::string* strMsgEvt = new std::string(ossEvt.str());
FairMQMessagePtr message(NewMessage(
const_cast<char*>(strMsgEvt->c_str()), // data
strMsgEvt->length(), // size
[](void*, void* object) { delete static_cast<std::string*>(object); },
strMsgEvt)); // object that manages the data
LOG(debug) << "Serializing done";
/// Make a new composed messaged with TsHeader + vector of Digi Event + TsMetaData
/// FIXME: Find out if possible to use only the boost serializer
FairMQParts partsOut;
partsOut.AddPart(std::move(partsIn.At(0))); // TsHeader
partsOut.AddPart(std::move(partsIn.At(partsIn.Size() - 1))); // TsMetaData
partsOut.AddPart(std::move(message)); // DigiEvent vector
LOG(debug) << "Message preparation done";
if (Send(partsOut, fsChannelNameDataOutput) < 0) {
LOG(error) << "Problem sending data to " << fsChannelNameDataOutput;
return false;
}
vOutEvents.clear();
return true;
}
bool CbmDeviceBuildDigiEvents::SendHistoConfAndData()
{
/// Prepare multiparts message and header
......@@ -707,23 +874,25 @@ bool CbmDeviceBuildDigiEvents::SendHistograms()
CbmDeviceBuildDigiEvents::~CbmDeviceBuildDigiEvents()
{
/// Clear metadata
delete fCbmTsEventHeader;
if (fCbmTsEventHeader) delete fCbmTsEventHeader;
/// Clear vectors
fvDigiT0->clear();
fvDigiSts->clear();
fvDigiMuch->clear();
fvDigiTrd->clear();
fvDigiTof->clear();
fvDigiRich->clear();
fvDigiPsd->clear();
if (fvDigiT0) fvDigiT0->clear();
if (fvDigiSts) fvDigiSts->clear();
if (fvDigiMuch) fvDigiMuch->clear();
if (fvDigiTrd) fvDigiTrd->clear();
if (fvDigiTof) fvDigiTof->clear();
if (fvDigiRich) fvDigiRich->clear();
if (fvDigiPsd) fvDigiPsd->clear();
/// Clear metadata
fTimeSliceMetaDataArray->Clear();
delete fTsMetaData;
if (fTimeSliceMetaDataArray) {
fTimeSliceMetaDataArray->Clear();
delete fTsMetaData;
delete fTimeSliceMetaDataArray;
delete fpAlgo;
delete fTimeSliceMetaDataArray;
}
if (fpAlgo) delete fpAlgo;
}
void CbmDeviceBuildDigiEvents::Finish() {}
......@@ -65,6 +65,10 @@ private:
std::vector<std::string> fvsSetTrigMinNb = {};
std::vector<std::string> fvsSetTrigMaxNb = {};
std::vector<std::string> fvsSetTrigMinLayersNb = {};
std::vector<std::string> fvsSetHistMaxDigiNb = {};
/// I/O control
bool fbDoNotSend = false;
bool fbDigiEventOutput = false;
/// message queues
std::string fsChannelNameDataInput = "unpts_0";
std::string fsChannelNameDataOutput = "events";
......@@ -130,6 +134,7 @@ private:
bool InitHistograms();
void Finish();
bool SendEvents(FairMQParts& partsIn);
bool SendDigiEvents(FairMQParts& partsIn);
bool SendHistoConfAndData();
bool SendHistograms();
};
......