CbmRoot
Loading...
Searching...
No Matches
CaMcLinkKey.h
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#ifndef CaMcLinkKey_h
11#define CaMcLinkKey_h 1
12
13#include "CaDefs.h"
14
15#include <boost/functional/hash.hpp>
16
17namespace cbm::algo::ca
18{
19 struct McLinkKey {
24 McLinkKey(int index, int event, int file) : fIndex(index), fEvent(event), fFile(file) {}
25
27 friend bool operator==(const McLinkKey& lhs, const McLinkKey& rhs)
28 {
29 return lhs.fFile == rhs.fFile && lhs.fEvent == rhs.fEvent && lhs.fIndex == rhs.fIndex;
30 }
31
35 };
36} // namespace cbm::algo::ca
37
38namespace std
39{
41 template<>
42 struct hash<cbm::algo::ca::McLinkKey> {
43 std::size_t operator()(const cbm::algo::ca::McLinkKey& key) const
44 {
45 std::size_t res = 0;
46 boost::hash_combine(res, key.fFile);
47 boost::hash_combine(res, key.fEvent);
48 boost::hash_combine(res, key.fIndex);
49 return res;
50 }
51 };
52} // namespace std
53
54#endif // CaMcLinkKey_h
Compile-time constants definition for the CA tracking algorithm.
constexpr T2 Undef
Undefined values.
Definition CaDefs.h:117
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
Hash for CbmL1LinkKey.
McLinkKey(int index, int event, int file)
Definition CaMcLinkKey.h:24
int fEvent
Index of MC event.
Definition CaMcLinkKey.h:33
friend bool operator==(const McLinkKey &lhs, const McLinkKey &rhs)
Comparison operator.
Definition CaMcLinkKey.h:27
int fIndex
Index of MC point/track in external data structures.
Definition CaMcLinkKey.h:32
int fFile
Index of MC file.
Definition CaMcLinkKey.h:34
std::size_t operator()(const cbm::algo::ca::McLinkKey &key) const
Definition CaMcLinkKey.h:43