// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @author Sandro Wenzel
#ifndef ALICEO2_DEVICES_HITMERGER_H_
#define ALICEO2_DEVICES_HITMERGER_H_
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "FairSystemInfo.h"
#include "O2HitMerger.h"
#include "O2SimDevice.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "CommonUtils/ShmManager.h"
#include
#include
#include
#include
#include
#include
#include
#include "SimPublishChannelHelper.h"
#ifdef ENABLE_UPGRADES
#include
#include
#include
#include
#include
#include
#include
#include
#include
#endif
#include
namespace o2
{
namespace devices
{
// Function communicating to primary particle server that it is now safe to shutdown.
// From the perspective of o2-sim, this is the case when all configs have been propagated and the system
// is running ok: For instance after the HitMerger is initialized and got it's first data from Geant workers.
bool primaryServer_sendShutdownPermission(fair::mq::Channel& channel)
{
std::unique_ptr request(channel.NewSimpleMessage((int)o2::O2PrimaryServerInfoRequest::AllowShutdown));
std::unique_ptr reply(channel.NewMessage());
int timeoutinMS = 100;
if (channel.Send(request, timeoutinMS) > 0) {
LOG(info) 0) {
// the answer is a simple ack with a status code
LOG(info)