CbmRoot
Loading...
Searching...
No Matches
HalCbmMCEventInterface.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023-2023 Warsaw University of Technology, Warsaw
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek [committer] */
5
7#include "HalCbmDetectorID.h"
8
9#include <FairMCEventHeader.h>
10
11#include <Hal/DataManager.h>
12#include <Hal/Event.h>
13#include <Hal/EventInterface.h>
14
15
17
19{
20 Hal::DataManager* manager = Hal::DataManager::Instance();
21 switch (fFormatType) {
23 manager->Register("CbmAnaTreeMcSourceContainer.", "CbmAnaTreeMcSourceContainer.", fDataContainer, write);
24 } break;
26 manager->Register("CbmMCTrack", "Tracks", fCbmMCtracks, write);
27 manager->Register("MCEventHeader", "Tracks", fEventHeader, write);
28 if (fStsMatches) manager->Register("StsTrackMatch", "Tracks", fStsMatches, write);
29 if (fTofMatches) manager->Register("TofHitMatch", "Tracks", fTofMatches, write);
30 if (fTrdMatches) manager->Register("TrdTrackMatch", "Tracks", fTrdMatches, write);
31 if (fRichMatches) manager->Register("RichRingMatch", "Tracks", fRichMatches, write);
32 if (fMuchMatches) manager->Register("MuchTrackMatch", "Tracks", fMuchMatches, write);
33 } break;
35 // DO nothing
36 } break;
37 }
38}
39
40void HalCbmMCEventInterface::FillTrackInterface(Hal::TrackInterface* /*track*/, Int_t /*index*/) {}
41
43{
44 switch (fFormatType) {
46 return fDataContainer->GetParticles()->GetNumberOfChannels();
47 } break;
49 return fCbmMCtracks->GetEntriesFast();
50 } break;
52 // DO nothing
53 } break;
54 }
55 return 0;
56}
57
58TObject* HalCbmMCEventInterface::GetRawTrackPointer(Int_t /*index*/) const { return nullptr; }
59
60TLorentzVector HalCbmMCEventInterface::GetVertexError() const { return TLorentzVector(0, 0, 0, 0); }
61
63{
64 switch (fFormatType) {
66 AnalysisTree::EventHeader* header = fDataContainer->GetEventHeader();
67 return TLorentzVector(header->GetVertexX(), header->GetVertexY(), header->GetVertexZ(), 0);
68 } break;
70 return TLorentzVector(fEventHeader->GetX(), fEventHeader->GetY(), fEventHeader->GetZ(), fEventHeader->GetT());
71 } break;
73 // DO nothing
74 } break;
75 }
76 return TLorentzVector(0, 0, 0, 0);
77}
78
80
82{
83 Hal::DataManager* manager = Hal::DataManager::Instance();
84 fDataContainer = (CbmAnaTreeMcSourceContainer*) manager->GetObject("CbmAnaTreeMcSourceContainer.");
85 if (fDataContainer) {
87 }
88 else {
89 fCbmMCtracks = (TClonesArray*) manager->GetObject("CbmMCTrack");
90 fEventHeader = (FairMCEventHeader*) manager->GetObject("MCEventHeader");
91 fStsMatches = (TClonesArray*) manager->GetObject("StsTrackMatch");
92 fTofMatches = (TClonesArray*) manager->GetObject("TofHitMatch");
93 fTrdMatches = (TClonesArray*) manager->GetObject("TrdTrackMatch");
94 fRichMatches = (TClonesArray*) manager->GetObject("RichRingMatch");
95 fMuchMatches = (TClonesArray*) manager->GetObject("MuchTrackMatch");
96 }
97}
AnalysisTree::EventHeader * GetEventHeader() const
AnalysisTree::Particles * GetParticles() const
virtual TLorentzVector GetVertexError() const
virtual void FillTrackInterface(Hal::TrackInterface *track, Int_t index)
virtual TLorentzVector GetVertex() const
FairMCEventHeader * fEventHeader
virtual Int_t GetTotalTrackNo() const
virtual TObject * GetRawTrackPointer(Int_t index) const
CbmAnaTreeMcSourceContainer * fDataContainer
virtual void ConnectToTreeInternal(eMode mode)