CbmRoot
Loading...
Searching...
No Matches
CaDebugger.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
9
10/*
11root -l CAdebug.root
12TNtuple *n = (TNtuple*) gDirectory->FindObjectAny("triplets")
13n->Draw("chi2")
14*/
15
16#include "CaDebugger.h"
17
18#include "CaDefines.h"
19
20#include <cstdarg>
21#include <iostream>
22#include <memory>
23#include <string>
24
26{
27 class DummyDebugger : public Debugger {
28 public:
30
31 ~DummyDebugger() override = default;
32
33 void Write() override { LOG(error) << "CADebugger: calling empty Write()!! from the base class"; }
34
35 void AddNtuple(const char*, const char*) override
36 {
37 LOG(error) << "CADebugger: calling empty AddNtuple()!! from the base class";
38 }
39
40 void FillNtuple(const char*, float[]) override
41 {
42 LOG(error) << "CADebugger: calling empty FillNtuple()!! from the base class";
43 }
44 };
45
46
47 std::shared_ptr<Debugger> gInstance;
48
50 {
51 if (!gInstance) {
52 gInstance.reset(new DummyDebugger);
53 }
54 return *gInstance;
55 }
56
57 void Debugger::SetInstance(std::shared_ptr<Debugger> instance) { gInstance = instance; }
58
59
60} // namespace cbm::algo::ca::utils
Tracking Debugger class (implementation)
Macros for the CA tracking algorithm.
Debugger()=default
Default constructor.
static Debugger & Instance()
Instance.
static void SetInstance(std::shared_ptr< Debugger > instance)
Set instance.
void FillNtuple(const char *, float[]) override
Add an entry to ntuple.
void Write() override
Write ntuples to the file.
void AddNtuple(const char *, const char *) override
Set new ntuple.
std::shared_ptr< Debugger > gInstance