Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Alain Loizeau
cbmroot
Commits
30adbcea
Commit
30adbcea
authored
Oct 15, 2021
by
Pierre-Alain Loizeau
Committed by
Florian Uhlig
Oct 29, 2021
Browse files
MQ: Replace copy-paste declaration of message class by base header
parent
21e02957
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
40 additions
and
87 deletions
+40
-87
MQ/base/CbmMqTMessage.h
MQ/base/CbmMqTMessage.h
+16
-0
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.cxx
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.cxx
+1
-1
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.h
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.h
+2
-6
MQ/eTOF/CbmDeviceTriggerHandlerEtof.h
MQ/eTOF/CbmDeviceTriggerHandlerEtof.h
+1
-8
MQ/hitbuilder/CMakeLists.txt
MQ/hitbuilder/CMakeLists.txt
+3
-2
MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
+1
-1
MQ/hitbuilder/CbmDeviceHitBuilderTof.h
MQ/hitbuilder/CbmDeviceHitBuilderTof.h
+1
-7
MQ/mcbm/CbmDeviceBuildRawEvents.h
MQ/mcbm/CbmDeviceBuildRawEvents.h
+0
-8
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.cxx
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.cxx
+1
-1
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.h
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.h
+1
-8
MQ/mcbm/CbmDeviceMcbmEventSink.cxx
MQ/mcbm/CbmDeviceMcbmEventSink.cxx
+1
-1
MQ/mcbm/CbmDeviceMcbmEventSink.h
MQ/mcbm/CbmDeviceMcbmEventSink.h
+1
-8
MQ/mcbm/CbmDeviceMcbmMonitorPulser.cxx
MQ/mcbm/CbmDeviceMcbmMonitorPulser.cxx
+1
-1
MQ/mcbm/CbmDeviceMcbmMonitorPulser.h
MQ/mcbm/CbmDeviceMcbmMonitorPulser.h
+1
-8
MQ/mcbm/CbmDeviceMcbmUnpack.cxx
MQ/mcbm/CbmDeviceMcbmUnpack.cxx
+1
-1
MQ/mcbm/CbmDeviceMcbmUnpack.h
MQ/mcbm/CbmDeviceMcbmUnpack.h
+2
-8
MQ/monitor/CbmDeviceMonitorPsd.cxx
MQ/monitor/CbmDeviceMonitorPsd.cxx
+1
-1
MQ/monitor/CbmDeviceMonitorPsd.h
MQ/monitor/CbmDeviceMonitorPsd.h
+2
-8
MQ/monitor/CbmDeviceMonitorReqT0.cxx
MQ/monitor/CbmDeviceMonitorReqT0.cxx
+1
-1
MQ/monitor/CbmDeviceMonitorReqT0.h
MQ/monitor/CbmDeviceMonitorReqT0.h
+2
-8
No files found.
MQ/base/CbmMqTMessage.h
0 → 100644
View file @
30adbcea
/* Copyright (C) 2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
#ifndef CBMMQTMESSAGE_H_
#define CBMMQTMESSAGE_H_
#include "TMessage.h"
// special class to expose protected TMessage constructor
class
CbmMqTMessage
:
public
TMessage
{
public:
CbmMqTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMMQTMESSAGE_H_ */
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.cxx
View file @
30adbcea
...
...
@@ -137,7 +137,7 @@ Bool_t CbmDeviceEventBuilderEtofStar2019::InitContainers()
if
(
Send
(
req
,
"parameters"
)
>
0
)
{
if
(
Receive
(
rep
,
"parameters"
)
>=
0
)
{
if
(
rep
->
GetSize
()
!=
0
)
{
CbmM
Q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
CbmM
q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
fUnpackPar
=
dynamic_cast
<
CbmStar2019TofPar
*>
(
tmsg
.
ReadObject
(
tmsg
.
GetClass
()));
LOG
(
info
)
<<
"Received unpack parameter from parmq server: "
<<
fUnpackPar
;
fUnpackPar
->
Print
();
...
...
MQ/eTOF/CbmDeviceEventBuilderEtofStar2019.h
View file @
30adbcea
...
...
@@ -10,6 +10,8 @@
#ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
...
...
@@ -86,10 +88,4 @@ private:
const
UInt_t
kuBinDumpEndWord
=
0xFAEBDEEF
;
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ */
MQ/eTOF/CbmDeviceTriggerHandlerEtof.h
View file @
30adbcea
...
...
@@ -12,6 +12,7 @@
#ifndef CBMDEVICETRIGGERHANDLERETOF_H_
#define CBMDEVICETRIGGERHANDLERETOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofStarData2019.h"
#include "MicrosliceDescriptor.hpp"
...
...
@@ -20,12 +21,10 @@
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include <map>
#include <vector>
class
CbmMQTMessage
;
// Relevant TOF classes
extern
"C"
int
star_rhicf_write
(
unsigned
int
trg_word
,
void
*
dta
,
int
bytes
);
...
...
@@ -78,10 +77,4 @@ private:
// histograms
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICETRIGGERHANDLERETOF_H_ */
MQ/hitbuilder/CMakeLists.txt
View file @
30adbcea
...
...
@@ -9,6 +9,7 @@ set(INCLUDE_DIRECTORIES
${
CBMDATA_DIR
}
/tof
${
CBMBASE_DIR
}
${
CBMDETECTORBASE_DIR
}
/tof
${
CBMROOT_SOURCE_DIR
}
/MQ/base
)
Set
(
SYSTEM_INCLUDE_DIRECTORIES
...
...
@@ -22,7 +23,7 @@ Set(SYSTEM_INCLUDE_DIRECTORIES
${
VMC_INCLUDE_DIRS
}
${
IPC_INCLUDE_DIRECTORY
}
${
CBMROOT_SOURCE_DIR
}
/external/cppzmq
${
CBMROOT_SOURCE_DIR
}
/external/cppzmq
${
CBMROOT_SOURCE_DIR
}
/reco/detectors/tof
)
...
...
@@ -74,7 +75,7 @@ set(DEPENDENCIES
CbmBase
CbmData
CbmTofBase
Geom
Geom
Core
MathCore
Tree
...
...
MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
View file @
30adbcea
...
...
@@ -427,7 +427,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
if
(
Send
(
req
,
Channel
)
>
0
)
{
if
(
Receive
(
rep
,
Channel
)
>=
0
)
{
if
(
rep
->
GetSize
()
!=
0
)
{
CbmM
Q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
CbmM
q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
switch
(
iSet
)
{
case
0
:
fDigiPar
=
static_cast
<
CbmTofDigiPar
*>
(
tmsg
.
ReadObject
(
tmsg
.
GetClass
()));
...
...
MQ/hitbuilder/CbmDeviceHitBuilderTof.h
View file @
30adbcea
...
...
@@ -12,6 +12,7 @@
#ifndef CBMDEVICEHITBUILDERTOF_H_
#define CBMDEVICEHITBUILDERTOF_H_
#include "CbmMqTMessage.h"
#include "CbmTofAddress.h" // in cbmdata/tof
#include "CbmTofGeoHandler.h" // in tof/TofTools
...
...
@@ -30,7 +31,6 @@
#include <map>
#include <vector>
class
CbmMQTMessage
;
class
CbmHistManager
;
// Relevant TOF classes
class
CbmTofDigi
;
...
...
@@ -286,10 +286,4 @@ private:
TFile
*
fOutRootFile
;
// pointer to root output file
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEHITBUILDERTOF_H_ */
MQ/mcbm/CbmDeviceBuildRawEvents.h
View file @
30adbcea
...
...
@@ -26,7 +26,6 @@
/// FAIRSOFT headers (geant, boost, ...)
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
/// C/C++ headers
...
...
@@ -129,11 +128,4 @@ private:
bool
SendHistograms
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEBUILDRAWEVENTS_H_ */
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.cxx
View file @
30adbcea
...
...
@@ -442,7 +442,7 @@ Bool_t CbmDeviceMcbmEventBuilderWin::InitParameters( TList* fParCList )
{
if( 0 != rep->GetSize() )
{
CbmM
Q
TMessage tmsg( rep->GetData(), rep->GetSize() );
CbmM
q
TMessage tmsg( rep->GetData(), rep->GetSize() );
newObj = static_cast< FairParGenericSet* >( tmsg.ReadObject( tmsg.GetClass() ) );
LOG( info ) << "Received unpack parameter from the server:";
newObj->print();
...
...
MQ/mcbm/CbmDeviceMcbmEventBuilderWin.h
View file @
30adbcea
...
...
@@ -14,6 +14,7 @@
/// CBM headers
#include "CbmMcbm2019TimeWinEventBuilderAlgo.h"
#include "CbmMqTMessage.h"
#include "CbmMuchBeamTimeDigi.h"
#include "CbmPsdDigi.h"
#include "CbmRichDigi.h"
...
...
@@ -26,7 +27,6 @@
/// FAIRSOFT headers (geant, boost, ...)
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
/// C/C++ headers
...
...
@@ -134,11 +134,4 @@ private:
bool
SendHistograms
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMCBMEVTBUILDERWIN_H_ */
MQ/mcbm/CbmDeviceMcbmEventSink.cxx
View file @
30adbcea
...
...
@@ -302,7 +302,7 @@ Bool_t CbmDeviceMcbmEventSink::InitParameters( TList* fParCList )
{
if( 0 != rep->GetSize() )
{
CbmM
Q
TMessage tmsg( rep->GetData(), rep->GetSize() );
CbmM
q
TMessage tmsg( rep->GetData(), rep->GetSize() );
newObj = static_cast< FairParGenericSet* >( tmsg.ReadObject( tmsg.GetClass() ) );
LOG( info ) << "Received unpack parameter from the server:";
newObj->print();
...
...
MQ/mcbm/CbmDeviceMcbmEventSink.h
View file @
30adbcea
...
...
@@ -14,6 +14,7 @@
/// CBM headers
#include "CbmEvent.h"
#include "CbmMqTMessage.h"
#include "CbmMuchBeamTimeDigi.h"
#include "CbmPsdDigi.h"
#include "CbmRichDigi.h"
...
...
@@ -29,7 +30,6 @@
/// FAIRSOFT headers (geant, boost, ...)
#include "Rtypes.h"
#include "TClonesArray.h"
#include "TMessage.h"
#include "TObjArray.h"
/// C/C++ headers
...
...
@@ -160,11 +160,4 @@ private:
void
Finish
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMCBMEVTSINK_H_ */
MQ/mcbm/CbmDeviceMcbmMonitorPulser.cxx
View file @
30adbcea
...
...
@@ -150,7 +150,7 @@ Bool_t CbmDeviceMcbmMonitorPulser::InitContainers()
if ( Send(req, "parameters") > 0 ) {
if ( Receive( rep, "parameters" ) >= 0) {
if ( rep->GetSize() != 0 ) {
CbmM
Q
TMessage tmsg( rep->GetData(), rep->GetSize() );
CbmM
q
TMessage tmsg( rep->GetData(), rep->GetSize() );
newObj = static_cast< FairParGenericSet* >( tmsg.ReadObject( tmsg.GetClass() ) );
LOG( info ) << "Received unpack parameter from the server:";
newObj->print();
...
...
MQ/mcbm/CbmDeviceMcbmMonitorPulser.h
View file @
30adbcea
...
...
@@ -12,6 +12,7 @@
#ifndef CBMDEVICEMCBMMONITORPULSER_H_
#define CBMDEVICEMCBMMONITORPULSER_H_
#include "CbmMqTMessage.h"
#include "CbmMuchBeamTimeDigi.h"
#include "CbmPsdDigi.h"
#include "CbmRichDigi.h"
...
...
@@ -22,7 +23,6 @@
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
#include <chrono>
...
...
@@ -262,11 +262,4 @@ private:
/*********************** SHOULD GO IN ALGO ****************************/
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMCBMMONITORPULSER_H_ */
MQ/mcbm/CbmDeviceMcbmUnpack.cxx
View file @
30adbcea
...
...
@@ -219,7 +219,7 @@ Bool_t CbmDeviceMcbmUnpack::InitParameters(TList* fParCList)
if
(
Send
(
req
,
"parameters"
)
>
0
)
{
if
(
Receive
(
rep
,
"parameters"
)
>=
0
)
{
if
(
0
!=
rep
->
GetSize
())
{
CbmM
Q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
CbmM
q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
newObj
=
static_cast
<
FairParGenericSet
*>
(
tmsg
.
ReadObject
(
tmsg
.
GetClass
()));
LOG
(
info
)
<<
"Received unpack parameter from the server:"
;
newObj
->
print
();
...
...
MQ/mcbm/CbmDeviceMcbmUnpack.h
View file @
30adbcea
...
...
@@ -12,12 +12,13 @@
#ifndef CBMDEVICEMCBMUNPACK_H_
#define CBMDEVICEMCBMUNPACK_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
#include <map>
...
...
@@ -101,11 +102,4 @@ private:
bool
SendUnpData
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMCBMUNPACK_H_ */
MQ/monitor/CbmDeviceMonitorPsd.cxx
View file @
30adbcea
...
...
@@ -165,7 +165,7 @@ Bool_t CbmDeviceMonitorPsd::InitContainers()
if
(
Send
(
req
,
"parameters"
)
>
0
)
{
if
(
Receive
(
rep
,
"parameters"
)
>=
0
)
{
if
(
rep
->
GetSize
()
!=
0
)
{
CbmM
Q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
CbmM
q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
newObj
=
static_cast
<
FairParGenericSet
*>
(
tmsg
.
ReadObject
(
tmsg
.
GetClass
()));
LOG
(
info
)
<<
"Received unpack parameter from the server:"
;
newObj
->
print
();
...
...
MQ/monitor/CbmDeviceMonitorPsd.h
View file @
30adbcea
...
...
@@ -13,12 +13,13 @@
#ifndef CBMDEVICEMONITORPSD_H_
#define CBMDEVICEMONITORPSD_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
#include <chrono>
...
...
@@ -95,11 +96,4 @@ private:
bool
SendHistograms
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMONITORPSD_H_ */
MQ/monitor/CbmDeviceMonitorReqT0.cxx
View file @
30adbcea
...
...
@@ -112,7 +112,7 @@ bool CbmDeviceMonitorReqT0::InitContainers()
if
(
Send
(
req
,
"parameters"
)
>
0
)
{
if
(
Receive
(
rep
,
"parameters"
)
>=
0
)
{
if
(
rep
->
GetSize
()
!=
0
)
{
CbmM
Q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
CbmM
q
TMessage
tmsg
(
rep
->
GetData
(),
rep
->
GetSize
());
newObj
=
static_cast
<
FairParGenericSet
*>
(
tmsg
.
ReadObject
(
tmsg
.
GetClass
()));
LOG
(
info
)
<<
"Received unpack parameter from the server:"
;
newObj
->
print
();
...
...
MQ/monitor/CbmDeviceMonitorReqT0.h
View file @
30adbcea
...
...
@@ -5,12 +5,13 @@
#ifndef CBMDEVICEMONITORREQT0_H_
#define CBMDEVICEMONITORREQT0_H_
#include "CbmMqTMessage.h"
#include "Timeslice.hpp"
#include "FairMQDevice.h"
#include "Rtypes.h"
#include "TMessage.h"
#include "TObjArray.h"
#include <chrono>
...
...
@@ -82,11 +83,4 @@ private:
bool
SendHistograms
();
};
// special class to expose protected TMessage constructor
class
CbmMQTMessage
:
public
TMessage
{
public:
CbmMQTMessage
(
void
*
buf
,
Int_t
len
)
:
TMessage
(
buf
,
len
)
{
ResetBit
(
kIsOwner
);
}
};
#endif
/* CBMDEVICEMONITORREQT0_H_ */
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment