CbmRoot
CbmMuchFindTracks.cxx
Go to the documentation of this file.
1 
5 #include "CbmMuchFindTracks.h"
6 
7 #include "CbmMuchTrackFinder.h"
8 
9 #include "FairRootManager.h"
10 
11 #include "TClonesArray.h"
12 
13 #include <iostream>
14 
15 // ----- Default constructor -------------------------------------------
17  : FairTask(), fFinder(NULL), fTrackArray(NULL), fNofTracks(0) {}
18 // -------------------------------------------------------------------------
19 
20 // ----- Standard constructor ------------------------------------------
22  const char*,
23  CbmMuchTrackFinder* finder)
24  : FairTask(name), fFinder(finder), fTrackArray(NULL), fNofTracks(0) {}
25 // -------------------------------------------------------------------------
26 
27 // ----- Destructor ----------------------------------------------------
29 // -------------------------------------------------------------------------
30 
31 // ----- Public method Init (abstract in base class) --------------------
33  // Check for Track finder
34  if (fFinder == NULL)
35  Fatal("CbmMuchFindTracks::Init", "No track finder selected!");
36 
37  // Get and check FairRootManager
38  FairRootManager* ioman = FairRootManager::Instance();
39  if (ioman == NULL)
40  Fatal("CbmMuchFindTracks::Init", "RootManager not instantised!");
41 
42  // Create and register MuchTrack array
43  fTrackArray = new TClonesArray("CbmMuchTrack", 100);
44  ioman->Register(
45  "MuchTrack", "Much", fTrackArray, IsOutputBranchPersistent("MuchTrack"));
46 
47  fFinder->Init();
48  return kSUCCESS;
49 }
50 // -------------------------------------------------------------------------
51 
52 // ----- SetParContainers -------------------------------------------------
54 // -------------------------------------------------------------------------
55 
56 // ----- Public method Exec --------------------------------------------
57 void CbmMuchFindTracks::Exec(Option_t*) {
58  fTrackArray->Delete();
59 
61 }
62 // -------------------------------------------------------------------------
63 
64 // ----- Public method Finish ------------------------------------------
66 // -------------------------------------------------------------------------
67 
CbmMuchTrackFinder.h
CbmMuchFindTracks::Init
virtual InitStatus Init()
Definition: CbmMuchFindTracks.cxx:32
CbmMuchTrackFinder::Init
virtual void Init()
Definition: CbmMuchTrackFinder.h:28
CbmMuchFindTracks::~CbmMuchFindTracks
virtual ~CbmMuchFindTracks()
Definition: CbmMuchFindTracks.cxx:28
CbmMuchTrackFinder
Definition: CbmMuchTrackFinder.h:15
ClassImp
ClassImp(CbmMuchFindTracks)
CbmMuchFindTracks::Finish
virtual void Finish()
Definition: CbmMuchFindTracks.cxx:65
CbmMuchFindTracks
Definition: CbmMuchFindTracks.h:20
CbmMuchFindTracks::fTrackArray
TClonesArray * fTrackArray
Definition: CbmMuchFindTracks.h:58
CbmMuchFindTracks::fNofTracks
Int_t fNofTracks
Definition: CbmMuchFindTracks.h:59
CbmMuchTrackFinder::DoFind
virtual Int_t DoFind(TClonesArray *trackArray)=0
CbmMuchFindTracks::Exec
virtual void Exec(Option_t *opt)
Definition: CbmMuchFindTracks.cxx:57
CbmMuchFindTracks::fFinder
CbmMuchTrackFinder * fFinder
Definition: CbmMuchFindTracks.h:54
CbmMuchFindTracks::SetParContainers
virtual void SetParContainers()
Definition: CbmMuchFindTracks.cxx:53
CbmMuchFindTracks.h
CbmMuchFindTracks::CbmMuchFindTracks
CbmMuchFindTracks()
Definition: CbmMuchFindTracks.cxx:16