R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDataPropagator.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#include "FairLogger.h"
15#include <FairRootManager.h>
16
17#include "R3BDataPropagator.h"
18#include "R3BLogger.h"
19
20#include "TClonesArray.h"
21
23 : R3BDataPropagator("R3BDataPropagator", 1)
24{
25}
26
27R3BDataPropagator::R3BDataPropagator(const TString& name, Int_t iVerbose, const TString& namebranch)
28 : FairTask(name, iVerbose)
29 , fNameBranch(namebranch)
30 , fInputData(NULL)
31{
32}
33
35{
36 if (fInputData)
37 {
38 delete fInputData;
39 fInputData = NULL;
40 }
41}
42
44{
45 LOG(info) << "R3BDataPropagator::Init()";
46 FairRootManager* frm = FairRootManager::Instance();
47
48 fInputData = dynamic_cast<TClonesArray*>(frm->GetObject(fNameBranch));
49 if (!fInputData)
50 {
51 R3BLOG(fatal, "branch " << fNameBranch << "not found");
52 return kFATAL;
53 }
54 else
55 R3BLOG(info, "branch " << fNameBranch << " found");
56
57 frm->Register(fNameBranch, "Data", fInputData, kTRUE);
58
59 return kSUCCESS;
60}
61
62void R3BDataPropagator::Exec(Option_t* option) { return; }
63
ClassImp(R3BDataPropagator)
#define R3BLOG(severity, x)
Definition R3BLogger.h:35
virtual void Exec(Option_t *option) override
Method for event loop implementation.
virtual InitStatus Init() override
Method for task initialization.
virtual ~R3BDataPropagator()
Destructor.
R3BDataPropagator()
Default constructor.