ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_CablingData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5//
6// TRT_CablingData class - class for TRT Mapping storing
7// A.Zalite
8//
9#ifndef TRT_CABLINGDATA_H
10#define TRT_CABLINGDATA_H
11
12#include "Identifier/Identifier.h"
14#include <map>
15#include <vector>
16#include <stdint.h>
17
19
20public:
21 //Constructor
23
24 //Destructor
25 virtual ~TRT_CablingData();
26
27 // Initialize m_identifierForAllStraws with zeros (TB case)
28 void zero_identifierForAllStraws(int rod, const std::vector<Identifier>& tempbuff);
29
30 // Initialize m_identifierHashForAllStraws with zeros (TB case)
31 void zero_identifierHashForAllStraws(int rod, const std::vector<IdentifierHash>& tempbuff);
32
33 // Set value of Identifier for each straw (TB case)
34 void set_identifierForAllStraws(int rod, int bufferPosition,
35 Identifier strawID);
36
37 // Set value of Identifier for each straw (DC1, DC2)
39
40 // Set value of IdentifierHash for each straw (TB case)
41 void set_identifierHashForAllStraws(int rod, int bufferPosition,
42 IdentifierHash hashId);
43
44 // Set value of IdentifierHash for each straw (DC1, DC2)
46
47 // Get value of Identifier for each straw (TB case)
48 Identifier get_identifierForAllStraws(int rod, int bufferPosition) const;
49
50 // Get value of IdentifierHash for each straw (TB case)
51 IdentifierHash get_identifierHashForAllStraws(int rod, int bufferPosition) const;
52
53 // Get value of Identifier for each straw (DC1, DC2)
55
56 // Get value of IdentifierHash for each straw (DC1, DC2)
58
59 // Get buffer offset from Identifier
60 uint32_t get_BufferOffset( Identifier StrawId );
61
62
63 // Add collection IDs for ROB
64 void add_collID(uint32_t rob_id, std::vector<IdentifierHash> * vectID);
65
66 // Get Identifiers of Collections for the given ROBID
67 const std::vector<IdentifierHash>& get_collID(int shift);
68
69 // Add SourceID
70 void add_allRobs(uint32_t sidROB);
71
72 // Get all RODIDs for TRT
73 const std::vector<uint32_t>& get_allRods() const;
74
75private:
76 // Source ID for all robs
77 std::vector<uint32_t> m_allRobs;
78
79 // Identifiers for all straws
80 std::vector<Identifier> m_identifierForAllStraws;
81
82 // Hashed Identifiers for all straws;
83 std::vector<IdentifierHash> m_identifierHashForAllStraws;
84
85 // Buffer Offsets for all Identifiers;
86 struct idpair
87 {
88 idpair (const Identifier& a, uint32_t b)
89 : first (a), second (b) {}
90 bool operator< (const idpair& other) const { return first < other.first; }
91 bool operator< (const Identifier& other) const { return first < other; }
93 uint32_t second;
94 };
97
98
99 // Identifiers for all Collections for RODs
100 std::map< uint32_t, std::vector<IdentifierHash> *> m_collID;
101
102 typedef std::pair<Identifier, IdentifierHash> idandhash_t;
103 typedef std::vector<idandhash_t> offsetvec_t;
104 typedef std::vector<offsetvec_t> rodvec_t;
105 typedef std::map<unsigned int, rodvec_t> rodmap_t;
107
108 idandhash_t& find_idandhash (int rod, int bufferPosition);
109 const idandhash_t& find_idandhash (int rod, int bufferPosition) const;
110};
111
112#endif // TRT_CABLINGDATA_H
This is a "hash" representation of an Identifier.
std::vector< offsetvec_t > rodvec_t
void set_identifierHashForAllStraws(int rod, int bufferPosition, IdentifierHash hashId)
rodmap_t m_rodoffset_to_id
std::vector< uint32_t > m_allRobs
const std::vector< uint32_t > & get_allRods() const
std::pair< Identifier, IdentifierHash > idandhash_t
std::vector< idpair > m_BufferOffsetForAllIdentifiers
virtual ~TRT_CablingData()
void add_allRobs(uint32_t sidROB)
void set_identifierForAllStraws(int rod, int bufferPosition, Identifier strawID)
std::vector< IdentifierHash > m_identifierHashForAllStraws
std::map< unsigned int, rodvec_t > rodmap_t
Identifier get_identifierForAllStraws(int rod, int bufferPosition) const
void add_collID(uint32_t rob_id, std::vector< IdentifierHash > *vectID)
std::vector< idandhash_t > offsetvec_t
uint32_t get_BufferOffset(Identifier StrawId)
idandhash_t & find_idandhash(int rod, int bufferPosition)
void zero_identifierHashForAllStraws(int rod, const std::vector< IdentifierHash > &tempbuff)
std::vector< Identifier > m_identifierForAllStraws
const std::vector< IdentifierHash > & get_collID(int shift)
IdentifierHash get_identifierHashForAllStraws(int rod, int bufferPosition) const
void zero_identifierForAllStraws(int rod, const std::vector< Identifier > &tempbuff)
std::map< uint32_t, std::vector< IdentifierHash > * > m_collID
bool operator<(const idpair &other) const
idpair(const Identifier &a, uint32_t b)