ATLAS Offline Software
PartialEventBuildingInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAOD_ANALYSIS
7 
8 
10 }
12 }
13 
15  addROB(rob_id);
16 }
17 
19  m_robs.insert(rob_id);
20 }
21 void PartialEventBuildingInfo::add( const std::vector<uint32_t>& rob_ids ) {
22  addROBs(rob_ids);
23 }
24 
25 void PartialEventBuildingInfo::addROBs( const std::vector<uint32_t>& rob_ids ) {
26 
27  for ( std::vector<uint32_t>::const_iterator i = rob_ids.begin(); i != rob_ids.end(); ++i )
28  m_robs.insert(*i);
29 }
30 
31 void PartialEventBuildingInfo::get( std::vector<uint32_t>& rob_ids ) const {
32  getROBs(rob_ids);
33 }
34 
35 void PartialEventBuildingInfo::getROBs( std::vector<uint32_t>& rob_ids ) const {
36 
37  rob_ids.reserve(rob_ids.size()+m_robs.size()); // optimization, it is believed that m_robs can be big
38 
39  for ( std::set<uint32_t>::const_iterator i = m_robs.begin(); i != m_robs.end(); ++i )
40  rob_ids.push_back(*i);
41 }
42 
43 const std::set<uint32_t>& PartialEventBuildingInfo::getROBs() const {
44  return m_robs;
45 }
46 
47 
48 void PartialEventBuildingInfo::addSubDetector( eformat::SubDetector id ) {
49  m_subDetectors.insert(id);
50 }
51 
52 void PartialEventBuildingInfo::addSubDetector( std::vector<eformat::SubDetector> ids ) {
53  for ( std::vector<eformat::SubDetector>::const_iterator i = ids.begin(); i != ids.end(); ++i )
54  m_subDetectors.insert(*i);
55 }
56 
57 
58 void PartialEventBuildingInfo::addSubDetector( eformat::SubDetectorGroup id ) {
59  using namespace eformat;
60  switch(id) {
61  case PIXEL:
62  m_subDetectors.insert(PIXEL_BARREL);
63  m_subDetectors.insert(PIXEL_DISK);
64  m_subDetectors.insert(PIXEL_B_LAYER);
65  break;
66 
67  case SCT:
68  m_subDetectors.insert(SCT_BARREL_A_SIDE);
69  m_subDetectors.insert(SCT_BARREL_C_SIDE);
70  m_subDetectors.insert(SCT_ENDCAP_A_SIDE);
71  m_subDetectors.insert(SCT_ENDCAP_C_SIDE);
72  break;
73 
74  case TRT:
75  m_subDetectors.insert(TRT_ANCILLARY_CRATE);
76  m_subDetectors.insert(TRT_BARREL_A_SIDE);
77  m_subDetectors.insert(TRT_BARREL_C_SIDE);
78  m_subDetectors.insert(TRT_ENDCAP_A_SIDE);
79  m_subDetectors.insert(TRT_ENDCAP_C_SIDE);
80  break;
81 
82  case LAR:
83  m_subDetectors.insert(LAR_EM_BARREL_A_SIDE);
84  m_subDetectors.insert(LAR_EM_BARREL_C_SIDE);
85  m_subDetectors.insert(LAR_EM_ENDCAP_A_SIDE);
86  m_subDetectors.insert(LAR_EM_ENDCAP_C_SIDE);
87  m_subDetectors.insert(LAR_HAD_ENDCAP_A_SIDE);
88  m_subDetectors.insert(LAR_HAD_ENDCAP_C_SIDE);
89  m_subDetectors.insert(LAR_FCAL_A_SIDE);
90  m_subDetectors.insert(LAR_FCAL_C_SIDE);
91  break;
92 
93  case TILECAL:
94  m_subDetectors.insert(TILECAL_LASER_CRATE);
95  m_subDetectors.insert(TILECAL_BARREL_A_SIDE);
96  m_subDetectors.insert(TILECAL_BARREL_C_SIDE);
97  m_subDetectors.insert(TILECAL_EXT_A_SIDE);
98  m_subDetectors.insert(TILECAL_EXT_C_SIDE);
99  break;
100 
101  case MUON:
102  m_subDetectors.insert(MUON_ANCILLARY_CRATE);
103  m_subDetectors.insert(MUON_MDT_BARREL_A_SIDE);
104  m_subDetectors.insert(MUON_MDT_BARREL_C_SIDE);
105  m_subDetectors.insert(MUON_MDT_ENDCAP_A_SIDE);
106  m_subDetectors.insert(MUON_MDT_ENDCAP_C_SIDE);
107  m_subDetectors.insert(MUON_RPC_BARREL_A_SIDE);
108  m_subDetectors.insert(MUON_RPC_BARREL_C_SIDE);
109  m_subDetectors.insert(MUON_TGC_ENDCAP_A_SIDE);
110  m_subDetectors.insert(MUON_TGC_ENDCAP_C_SIDE);
111  m_subDetectors.insert(MUON_CSC_ENDCAP_A_SIDE);
112  m_subDetectors.insert(MUON_CSC_ENDCAP_C_SIDE);
113  break;
114 
115  case TDAQ:
116  m_subDetectors.insert(TDAQ_BEAM_CRATE);
117  m_subDetectors.insert(TDAQ_CALO_PREPROC);
118  m_subDetectors.insert(TDAQ_CALO_CLUSTER_PROC_DAQ);
119  m_subDetectors.insert(TDAQ_CALO_CLUSTER_PROC_ROI);
120  m_subDetectors.insert(TDAQ_CALO_JET_PROC_DAQ);
121  m_subDetectors.insert(TDAQ_CALO_JET_PROC_ROI);
122  m_subDetectors.insert(TDAQ_MUON_CTP_INTERFACE);
123  m_subDetectors.insert(TDAQ_CTP);
124  m_subDetectors.insert(TDAQ_L2SV);
125  m_subDetectors.insert(TDAQ_SFI);
126  m_subDetectors.insert(TDAQ_SFO);
127  m_subDetectors.insert(TDAQ_LVL2);
128  m_subDetectors.insert(TDAQ_EVENT_FILTER);
129  break;
130 
131  case FORWARD:
132  m_subDetectors.insert(FORWARD_BCM);
133  m_subDetectors.insert(FORWARD_LUCID);
134  m_subDetectors.insert(FORWARD_ZDC);
135  m_subDetectors.insert(FORWARD_ALPHA);
136  break;
137 
138  default:
139  // do nothing
140  break;
141  }
142 
143 }
144 
145 void PartialEventBuildingInfo::getSubDetectors( std::vector<eformat::SubDetector>& ids ) const {
146  for ( std::set<uint32_t>::const_iterator i = m_subDetectors.begin(); i != m_subDetectors.end(); ++i )
147  ids.push_back( eformat::helper::SourceIdentifier(*i).subdetector_id() );
148 }
149 
150 const std::set<uint32_t>& PartialEventBuildingInfo::getSubDetectors( ) const {
151  return m_subDetectors;
152 }
153 
155  m_robs.clear();
156  m_subDetectors.clear();
157 }
158 
160  m_robs.insert(peb.m_robs.begin(), peb.m_robs.end());
161  m_subDetectors.insert(peb.m_subDetectors.begin(), peb.m_subDetectors.end());
162 }
163 #endif //XAOD_ANALYSIS
eformat
Definition: L1CaloBsDecoderUtil.h:11
TRT
@ TRT
Definition: RegSelEnums.h:26
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PartialEventBuildingInfo::clear
void clear()
clears the list of ROBs and Dets
Definition: PartialEventBuildingInfo.cxx:154
PartialEventBuildingInfo
Definition: PartialEventBuildingInfo.h:14
PartialEventBuildingInfo::m_subDetectors
std::set< uint32_t > m_subDetectors
selected SubDetectors
Definition: PartialEventBuildingInfo.h:88
PartialEventBuildingInfo::add
void add(uint32_t rob_id)
adds ROB to be added to partially built event
Definition: PartialEventBuildingInfo.cxx:14
PartialEventBuildingInfo::merge
void merge(const PartialEventBuildingInfo &peb)
merges two PEBI objects I.e.
Definition: PartialEventBuildingInfo.cxx:159
PartialEventBuildingInfo::addSubDetector
void addSubDetector(eformat::SubDetector id)
add detector to be in partially built event
Definition: PartialEventBuildingInfo.cxx:48
PartialEventBuildingInfo::get
void get(std::vector< uint32_t > &rob_ids) const
gets back all ROBs added (fills up rob_ids vector given by reference)
Definition: PartialEventBuildingInfo.cxx:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
PartialEventBuildingInfo::getROBs
const std::set< uint32_t > & getROBs() const
gets back all ROBs added
Definition: PartialEventBuildingInfo.cxx:43
PartialEventBuildingInfo::addROB
void addROB(uint32_t rob_id)
adds ROB to be added to partially built event
Definition: PartialEventBuildingInfo.cxx:18
PartialEventBuildingInfo::~PartialEventBuildingInfo
~PartialEventBuildingInfo()
Definition: PartialEventBuildingInfo.cxx:11
FORWARD
#define FORWARD
Definition: ALFA_SvdCalc.h:34
MUON
xAOD::Muon MUON
D3PD INCLUDES.
Definition: TileCellFillerTool.h:37
PartialEventBuildingInfo::m_robs
std::set< uint32_t > m_robs
selected ROBs for partial event building
Definition: PartialEventBuildingInfo.h:87
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
PartialEventBuildingInfo::getSubDetectors
const std::set< uint32_t > & getSubDetectors() const
gets back all SubDetectorss added
Definition: PartialEventBuildingInfo.cxx:150
PartialEventBuildingInfo::PartialEventBuildingInfo
PartialEventBuildingInfo()
Definition: PartialEventBuildingInfo.cxx:9
LAR
@ LAR
Definition: RegSelEnums.h:27
PartialEventBuildingInfo::addROBs
void addROBs(const std::vector< uint32_t > &rob_ids)
adds collection of robs to partially built event
Definition: PartialEventBuildingInfo.cxx:25
SCT
@ SCT
Definition: RegSelEnums.h:25
PIXEL
@ PIXEL
Definition: RegSelEnums.h:24
PartialEventBuildingInfo.h