#include <ScalerUnpack.h>
Definition at line 17 of file ScalerUnpack.h.
◆ ScalerUnpack() [1/2]
ScalerUnpack::ScalerUnpack |
( |
| ) |
|
|
default |
◆ ~ScalerUnpack()
ScalerUnpack::~ScalerUnpack |
( |
| ) |
|
|
virtualdefault |
◆ ScalerUnpack() [2/2]
◆ DoUnpack()
Bool_t ScalerUnpack::DoUnpack |
( |
Int_t * |
data, |
|
|
Int_t |
size |
|
) |
| |
|
overridevirtual |
Process an MBS sub-event.
Reimplemented from ShipUnpack.
Definition at line 47 of file ScalerUnpack.cxx.
48{
49 static_assert(
sizeof(
ScalarFrame) == 88,
"Scaler frame size incorrect!");
51 LOG(DEBUG) << "ScalerUnpack : Unpacking frame... size/bytes = " << size ;
52 LOG(DEBUG) <<
"PSW = " <<
df->PSW ;
53 LOG(DEBUG) <<
"SPW = " <<
df->SPW ;
54 LOG(DEBUG) <<
"POT from SPS = " <<
df->scalars[0] ;
55 LOG(DEBUG) <<
"S1raw = " <<
df->scalars[1] ;
56 LOG(DEBUG) <<
"S1strobed = " <<
df->scalars[2] ;
57 LOG(DEBUG) <<
"S1*S2 TrgRaw = " <<
df->scalars[3] ;
58 LOG(DEBUG) <<
"S1*S2 TrgStrobed = " <<
df->scalars[4] ;
59 for (
auto i : ROOT::MakeSeq(
df->getSliceCount())) {
60 LOG(DEBUG) <<
"Slice " <<
i <<
"= " <<
df->slices[
i] ;
61 }
62 auto f =
fMan->GetOutFile();
63 tree =
dynamic_cast<TTree *
>(
f->Get(
"scalers"));
64 if (
tree ==
nullptr) {
65 tree =
new TTree(
"scalers",
"scalers");
66 }
67 tree->Branch(
"PSW", &(
df->PSW));
68 tree->Branch(
"SPW", &(
df->SPW));
69 for (auto i : ROOT::MakeSeq(16)) {
70 switch (i) {
71 case 11: {
76 LOG(INFO) <<
"David: " <<
fDavid ;
77 LOG(INFO) <<
"Goliath: " <<
fGoliath ;
78 break;
79 }
80 case 12:
81 LOG(INFO) <<
"Spill type: " <<
df->scalars[
i] ;
82 tree->Branch(
"spill_type", &(
df->scalars[i]));
83 break;
84 default:
tree->Branch(TString::Format(
"SC%.2d", i), &(
df->scalars[i]));
85 }
86 }
87 auto slices =
df->getSliceCount() > 0 ? std::vector<uint32_t>(
df->slices,
df->slices +
df->getSliceCount())
88 : std::vector<uint32_t>();
89 tree->Branch(
"slices",
"vector<uint32_t>", &slices);
91 tree->Write(
"", TObject::kOverwrite);
92 return kTRUE;
93}
◆ GetPartition()
uint16_t ScalerUnpack::GetPartition |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Init()
Bool_t ScalerUnpack::Init |
( |
| ) |
|
|
overridevirtual |
Initialization. Called once, before the event loop.
Reimplemented from ShipUnpack.
Definition at line 23 of file ScalerUnpack.cxx.
24{
26 fMan = FairRootManager::Instance();
27 return kTRUE;
28}
virtual void Register() override
◆ operator=()
◆ Register()
void ScalerUnpack::Register |
( |
| ) |
|
|
overrideprotectedvirtual |
Register the output structures.
Reimplemented from ShipUnpack.
Definition at line 31 of file ScalerUnpack.cxx.
32{
33 LOG(DEBUG) << "ScalerUnpack : Registering..." ;
34}
◆ Reset()
void ScalerUnpack::Reset |
( |
| ) |
|
|
overridevirtual |
Clear the output structures.
Reimplemented from ShipUnpack.
Definition at line 96 of file ScalerUnpack.cxx.
97{
98 LOG(DEBUG) << "ScalerUnpack : Clearing Data Structure" ;
99}
◆ fDavid
int ScalerUnpack::fDavid = 0 |
|
private |
◆ fGoliath
int ScalerUnpack::fGoliath = 0 |
|
private |
◆ fMan
FairRootManager* ScalerUnpack::fMan = nullptr |
|
private |
◆ fPartitionId
uint16_t ScalerUnpack::fPartitionId = 0x8100 |
|
private |
◆ tree
TTree* ScalerUnpack::tree = nullptr |
|
private |
The documentation for this class was generated from the following files: