CbmRoot
Loading...
Searching...
No Matches
CbmMCEventInfo.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMMCEVENTINFO_H
11#define CBMMCEVENTINFO_H 1
12
13#include "CbmLink.h"
14
15#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
16
17#include <cstdint>
18#include <string> // for string
19
34
35public:
41 CbmMCEventInfo(int32_t fileId = -1, int32_t eventId = -1, double time = 0.);
42
43
45 virtual ~CbmMCEventInfo();
46
47
51 int32_t GetFileId() const { return fFileId; }
52
53
57 int32_t GetEventId() const { return fEventId; }
58
59
63 double GetTime() const { return fTime; }
64
68 CbmLink GetCbmLink() const { return CbmLink(0., -1, fEventId, fFileId); }
69
71 std::string ToString() const;
72
73
75 bool operator<(const CbmMCEventInfo& other) const
76 {
77 if (fFileId == other.fFileId) return (fEventId < other.fEventId);
78 return (fFileId < other.fFileId);
79 }
80
81
82private:
83 int32_t fFileId;
84 int32_t fEventId;
85 double fTime;
86
88};
89
90
91#endif /* CBMMCEVENTINFO_H_ */
Allows to access an MC event in the source file.
CbmLink GetCbmLink() const
Event file and event indices as CbmLink @value Event time [ns].
virtual ~CbmMCEventInfo()
Destructor.
double GetTime() const
Event time @value Event time [ns].
ClassDef(CbmMCEventInfo, 1)
std::string ToString() const
CbmMCEventInfo(int32_t fileId=-1, int32_t eventId=-1, double time=0.)
Constructor.
int32_t GetFileId() const
File index @value File index.
int32_t GetEventId() const
Event index @value Event index.
bool operator<(const CbmMCEventInfo &other) const
Comparison operator.