ATLAS Offline Software
L1TopoDataMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
5 // L1TopoDataMaker.cxx,
7 
14 #include "TrigT1Result/EMTauRoI.h"
18 
19 #include <vector>
20 
21 
22 
25 {}
26 
30 {}
31 
32 
34 void
36 
40  const std::vector<ROIB::EMTauResult> &emTauResult = roibResult->eMTauResult();
41  makeCPCMXTopoData(emTauResult, topoData) ;
42 
43  return;
44 }
45 
47 void
48 LVL1::L1TopoDataMaker::makeCPCMXTopoData(const std::vector<ROIB::EMTauResult> & roibData, DataVector<CPCMXTopoData>* topoData) const {
49 
50  // Clear collection before filling
51  topoData->clear();
52 
57  std::vector<uint32_t> roiWords;
58 
59  for (const ROIB::EMTauResult & emtauResult : roibData) {
60  for (const ROIB::EMTauRoI & roi : emtauResult.roIVec() ) {
61  roiWords.push_back( roi.roIWord() );
62  }
63  }
64 
65 
69  for (int crate = 0; crate < 4; ++crate) {
70  for (int cmx = 0; cmx < 2; ++cmx) {
71  CPCMXTopoData* link = new CPCMXTopoData(crate, cmx, roiWords);
72  topoData->push_back(link);
73  }
74  }
75 
76  return;
77 }
78 
79 
81 void
83 
87  const std::vector<ROIB::JetEnergyResult> &jetEnergyResult = roibResult->jetEnergyResult();
88  makeJetCMXTopoData(jetEnergyResult, topoData) ;
89 
90  return;
91 }
92 
94 void
95 LVL1::L1TopoDataMaker::makeJetCMXTopoData(const std::vector<ROIB::JetEnergyResult> & roibData, DataVector<JetCMXTopoData>* topoData) const {
96 
97  // Clear collection before filling
98  topoData->clear();
99 
104  std::vector<uint32_t> roiWords;
105 
106  for (std::vector<ROIB::JetEnergyResult>::const_iterator itResult = roibData.begin(); itResult != roibData.end(); ++itResult) {
107  const std::vector<ROIB::JetEnergyRoI> rois = (*itResult).roIVec();
108  for (std::vector<ROIB::JetEnergyRoI>::const_iterator itRoI = rois.begin(); itRoI != rois.end(); ++itRoI) {
109  uint32_t roiWord = (*itRoI).roIWord();
110  if ((roiWord & 0xe0000000) == 0) roiWords.push_back(roiWord);
111  }
112  }
113 
117  for (int crate = 0; crate < 2; ++crate) {
118  JetCMXTopoData* link = new JetCMXTopoData(crate, roiWords);
119  topoData->push_back(link);
120  }
121 
122  return;
123 }
124 
125 
127 void
129 
133  const std::vector< ROIB::JetEnergyResult > &jetEnergyResult = roibResult->jetEnergyResult();
134  makeEnergyTopoData(jetEnergyResult, topoData) ;
135 
136  return;
137 }
138 
140 void
141 LVL1::L1TopoDataMaker::makeEnergyTopoData(const std::vector<ROIB::JetEnergyResult> & roibData, EnergyTopoData* topoData) const {
142 
143 
148  std::vector<uint32_t> roiWords;
149 
150  for (std::vector<ROIB::JetEnergyResult>::const_iterator itResult = roibData.begin(); itResult != roibData.end(); ++itResult) {
151  const std::vector<ROIB::JetEnergyRoI> rois = (*itResult).roIVec();
152  for (std::vector<ROIB::JetEnergyRoI>::const_iterator itRoI = rois.begin(); itRoI != rois.end(); ++itRoI) {
153  uint32_t roiWord = (*itRoI).roIWord();
154  if ((roiWord & 0xc0000000) == 0x40000000) roiWords.push_back(roiWord);
155  }
156  }
157 
160  topoData->addRoIs(roiWords);
161 
162  return;
163 }
LVL1::EnergyTopoData::addRoIs
void addRoIs(const std::vector< uint32_t > &roiWords)
Definition: EnergyTopoData.cxx:70
LVL1::L1TopoDataMaker::~L1TopoDataMaker
virtual ~L1TopoDataMaker()
default destructor
Definition: L1TopoDataMaker.cxx:29
ROIB::EMTauResult
Definition: EMTauResult.h:25
ROIB::RoIBResult
Class holding the LVL1 RoIB result build by the RoIBuilder.
Definition: RoIBResult.h:47
JetCMXTopoData.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RoIBResult.h
ROIB::RoIBResult::jetEnergyResult
const std::vector< JetEnergyResult > & jetEnergyResult() const
Gets the jet/energy part of the L1 RDO.
Definition: RoIBResult.cxx:64
JetEnergyResult.h
JetEnergyRoI.h
CPCMXTopoData.h
ROIB::RoIBResult::eMTauResult
const std::vector< EMTauResult > & eMTauResult() const
Gets the egamma part of the L1 RDO.
Definition: RoIBResult.cxx:68
LVL1::L1TopoDataMaker::makeCPCMXTopoData
virtual void makeCPCMXTopoData(const ROIB::RoIBResult *roibResult, DataVector< CPCMXTopoData > *topoData) const
Fill DataVector of CPCMXTopoData from RoIBResult.
Definition: L1TopoDataMaker.cxx:35
LVL1::L1TopoDataMaker::L1TopoDataMaker
L1TopoDataMaker()
Constructor.
Definition: L1TopoDataMaker.cxx:24
LVL1::L1TopoDataMaker::makeJetCMXTopoData
virtual void makeJetCMXTopoData(const ROIB::RoIBResult *roibResult, DataVector< JetCMXTopoData > *topoData) const
Fill DataVector of JetCMXTopoData from RoIBResult.
Definition: L1TopoDataMaker.cxx:82
L1TopoDataMaker.h
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
EMTauRoI.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
LVL1::EnergyTopoData
This class defines the Ex/Ey/ET data transferred from the EnergySum CMX to the L1Topo processors.
Definition: EnergyTopoData.h:31
DataVector::clear
void clear()
Erase all the elements in the collection.
LVL1::JetCMXTopoData
Definition: JetCMXTopoData.h:22
LVL1::L1TopoDataMaker::makeEnergyTopoData
virtual void makeEnergyTopoData(const ROIB::RoIBResult *roibResult, EnergyTopoData *topoData) const
Fill EnergyTopoData from RoIBResult.
Definition: L1TopoDataMaker.cxx:128
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TrigT1CaloDefs.h
ROIB::EMTauRoI
Definition: EMTauRoI.h:20
TriggerTest.rois
rois
Definition: TriggerTest.py:23
EnergyTopoData.h
EMTauResult.h
LVL1::CPCMXTopoData
Definition: CPCMXTopoData.h:22