CbmRoot
Loading...
Searching...
No Matches
CbmMuchFindTracks.cxx
Go to the documentation of this file.
1/* Copyright (C) 2007-2016 St. Petersburg Polytechnic University, St. Petersburg
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Ryzhinskiy [committer], Andrey Lebedev, Florian Uhlig */
4
9#include "CbmMuchFindTracks.h"
10
11#include "CbmMuchTrackFinder.h"
12#include "FairRootManager.h"
13#include "TClonesArray.h"
14
15#include <iostream>
16
17// ----- Default constructor -------------------------------------------
18CbmMuchFindTracks::CbmMuchFindTracks() : FairTask(), fFinder(NULL), fTrackArray(NULL), fNofTracks(0) {}
19// -------------------------------------------------------------------------
20
21// ----- Standard constructor ------------------------------------------
22CbmMuchFindTracks::CbmMuchFindTracks(const char* name, const char*, CbmMuchTrackFinder* finder)
23 : FairTask(name)
24 , fFinder(finder)
25 , fTrackArray(NULL)
26 , fNofTracks(0)
27{
28}
29// -------------------------------------------------------------------------
30
31// ----- Destructor ----------------------------------------------------
33// -------------------------------------------------------------------------
34
35// ----- Public method Init (abstract in base class) --------------------
37{
38 // Check for Track finder
39 if (fFinder == NULL) LOG(fatal) << GetName() << "::Init: No track finder selected!";
40
41 // Get and check FairRootManager
42 FairRootManager* ioman = FairRootManager::Instance();
43 if (ioman == NULL) LOG(fatal) << GetName() << "::Init: RootManager not instantised!";
44
45 // Create and register MuchTrack array
46 fTrackArray = new TClonesArray("CbmMuchTrack", 100);
47 ioman->Register("MuchTrack", "Much", fTrackArray, IsOutputBranchPersistent("MuchTrack"));
48
49 fFinder->Init();
50 return kSUCCESS;
51}
52// -------------------------------------------------------------------------
53
54// ----- SetParContainers -------------------------------------------------
56// -------------------------------------------------------------------------
57
58// ----- Public method Exec --------------------------------------------
60{
61 fTrackArray->Delete();
62
64}
65// -------------------------------------------------------------------------
66
67// ----- Public method Finish ------------------------------------------
69// -------------------------------------------------------------------------
70
ClassImp(CbmMuchFindTracks)
virtual void Exec(Option_t *opt)
CbmMuchTrackFinder * fFinder
virtual void SetParContainers()
virtual InitStatus Init()
TClonesArray * fTrackArray
virtual Int_t DoFind(TClonesArray *trackArray)=0