 |
ATLAS Offline Software
|
#include <FPGADataFormatTool.h>
|
| virtual StatusCode | initialize () override |
| |
| virtual StatusCode | convertPixelHitsToFPGADataFormat (const PixelRDO_Container &pixelRDO, std::vector< uint64_t > &encodedData, const std::vector< IdentifierHash > &hashList, const EventContext &ctx) const override |
| | Covert the Pixel RDOs to the test vector format as requited by FPGA EF tracking alogrithms. More...
|
| |
| virtual StatusCode | convertStripHitsToFPGADataFormat (const SCT_RDO_Container &stripRDO, std::vector< uint64_t > &encodedData, const std::vector< IdentifierHash > &hashList, const EventContext &ctx) const override |
| | Covert the Strip RDOs to the test vector format as requited by FPGA EF tracking alogrithms. More...
|
| |
| virtual StatusCode | convertFPGATracksToFPGADataFormat (const FPGATrackSimTrackCollection *tracks, std::vector< uint64_t > &encodedData, const EventContext &ctx) const override |
| |
| virtual StatusCode | convertFPGASliceToFPGADataFormat (const FPGATrackSimHitCollection *hitsInSlices, bool doPixel, bool doStrip, std::vector< uint64_t > &encodedData, const EventContext &ctx) const override |
| |
| virtual StatusCode | convertFPGAHitsToFPGADataFormat (const FPGATrackSimHitCollection *allHits, bool doPixel, bool doStrip, std::vector< uint64_t > &encodedData, const EventContext &ctx) const override |
| |
|
| StatusCode | convertPixelRDO (const PixelRDO_Container &pixelRDO, std::vector< uint64_t > &encodedData, const std::vector< IdentifierHash > &hashList, const EventContext &ctx) const |
| |
| StatusCode | convertStripRDO (const SCT_RDO_Container &stripRDO, std::vector< uint64_t > &encodedData, const std::vector< IdentifierHash > &hashList, const EventContext &ctx) const |
| |
| StatusCode | convertFPGATracks (const FPGATrackSimTrackCollection *tracks, std::vector< uint64_t > &encodedData, const EventContext &ctx) const |
| |
| StatusCode | convertFPGASlices (const FPGATrackSimHitCollection *hitsInSlices, bool doPixel, bool doStrip, std::vector< uint64_t > &encodedData, const EventContext &ctx) const |
| |
| StatusCode | convertFPGAHits (const FPGATrackSimHitCollection *hits, bool doPixel, bool doStrip, std::vector< uint64_t > &encodedData, const EventContext &ctx) const |
| |
| StatusCode | fillHeader (std::vector< uint64_t > &encodedData) const |
| |
| StatusCode | fillFooter (std::vector< uint64_t > &encodedData) const |
| |
| StatusCode | fillModuleHeader (const InDetDD::SiDetectorElement *sielement, std::vector< uint64_t > &encodedData) const |
| |
| void | fillHit (const FPGATrackSimHit *hit, bool isLast, bool isLastofSlice, std::vector< uint64_t > &encodedData) const |
| |
Definition at line 21 of file FPGADataFormatTool.h.
◆ convertFPGAHits()
| StatusCode FPGADataFormatTool::convertFPGAHits |
( |
const FPGATrackSimHitCollection * |
hits, |
|
|
bool |
doPixel, |
|
|
bool |
doStrip, |
|
|
std::vector< uint64_t > & |
encodedData, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
private |
Definition at line 152 of file FPGADataFormatTool.cxx.
163 std::map<unsigned int, std::vector<const FPGATrackSimHit*> > organizedHits;
165 for (
size_t i = 0;
i < allHits->size();
i++)
174 for (
const auto&
hits: organizedHits)
176 const auto& firstHit =
hits.second[0];
181 for(
const auto& hit:
hits.second)
184 fillHit(hit, isLast,
false, encodedData);
188 return StatusCode::SUCCESS;
◆ convertFPGAHitsToFPGADataFormat()
| StatusCode FPGADataFormatTool::convertFPGAHitsToFPGADataFormat |
( |
const FPGATrackSimHitCollection * |
allHits, |
|
|
bool |
doPixel, |
|
|
bool |
doStrip, |
|
|
std::vector< uint64_t > & |
encodedData, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
overridevirtual |
◆ convertFPGASlices()
| StatusCode FPGADataFormatTool::convertFPGASlices |
( |
const FPGATrackSimHitCollection * |
hitsInSlices, |
|
|
bool |
doPixel, |
|
|
bool |
doStrip, |
|
|
std::vector< uint64_t > & |
encodedData, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
private |
Definition at line 82 of file FPGADataFormatTool.cxx.
95 std::map<unsigned int, std::vector<const FPGATrackSimHit*> > organizedHits;
97 for (
size_t i = 0;
i < hitsinSlice->size();
i++)
106 unsigned int moduleCounter = 0;
107 for (
const auto&
hits: organizedHits)
109 const auto& firstHit =
hits.second[0];
114 for(
const auto& hit:
hits.second)
117 bool isLastofSlice = isLast && (moduleCounter + 1 == organizedHits.size());
118 fillHit(hit, isLast, isLastofSlice, encodedData);
124 return StatusCode::SUCCESS;
◆ convertFPGASliceToFPGADataFormat()
| StatusCode FPGADataFormatTool::convertFPGASliceToFPGADataFormat |
( |
const FPGATrackSimHitCollection * |
hitsInSlices, |
|
|
bool |
doPixel, |
|
|
bool |
doStrip, |
|
|
std::vector< uint64_t > & |
encodedData, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
overridevirtual |
◆ convertFPGATracks()
Definition at line 214 of file FPGADataFormatTool.cxx.
223 for(
const auto& hit:
track.getFPGATrackSimHits())
225 bitmask |= 2 << hit.getLayer();
265 std::remove_if(
hits.begin(),
hits.end(),
269 for(
unsigned int i = 0 ;
i <
hits.size();
i++)
271 const auto& hit =
hits[
i];
272 bool isLast = (
i+1 ==
hits.size());
273 fillHit(&hit, isLast,
false, encodedData);
280 return StatusCode::SUCCESS;
◆ convertFPGATracksToFPGADataFormat()
◆ convertPixelHitsToFPGADataFormat()
Covert the Pixel RDOs to the test vector format as requited by FPGA EF tracking alogrithms.
Definition at line 20 of file FPGADataFormatTool.cxx.
36 return StatusCode::SUCCESS;
◆ convertPixelRDO()
Definition at line 285 of file FPGADataFormatTool.cxx.
292 bool filledHeader =
false;
295 if (pixel_rdoCollection ==
nullptr) {
continue; }
304 if(hashList.size() > 0)
306 if(
std::find(hashList.begin(), hashList.end(), sielement->
identifyHash()) == hashList.end())
continue;
318 (pixelRawData == pixel_rdoCollection->back()),
321 pixelRawData->getToT(),
322 pixelRawData->getLVL1A(),
332 filledHeader =
false;
336 return StatusCode::SUCCESS;
◆ convertStripHitsToFPGADataFormat()
Covert the Strip RDOs to the test vector format as requited by FPGA EF tracking alogrithms.
Definition at line 39 of file FPGADataFormatTool.cxx.
54 return StatusCode::SUCCESS;
◆ convertStripRDO()
Definition at line 339 of file FPGADataFormatTool.cxx.
345 constexpr
int MaxChannelinStripRow = 128;
346 long unsigned int stripNumber = 0;
347 bool filledHeader =
false;
350 bool firstClusterFilled =
false;
353 if (SCT_Collection ==
nullptr) {
continue; }
355 std::map<int, bool> firedStrips;
356 std::map<int, const SCT_RDORawData*> firedStripsToRDO;
362 const Identifier rdoId = sctRawData->identify();
364 for (
int i = 0;
i < sctRawData->getGroupSize();
i++) {
365 firedStrips[baseLineStrip +
i] =
true;
366 firedStripsToRDO[baseLineStrip +
i] = sctRawData;
371 std::map<int, int> stripEncodingForITK;
372 std::map<int, const SCT_RDORawData* > stripEncodingForITKToRDO;
373 for (
const auto& [stripID, fired] : firedStrips) {
375 if (!fired)
continue;
378 std::bitset<3> hitMap;
379 int currChipID = stripID / MaxChannelinStripRow;
380 int maxStripIDForCurrChip = (currChipID + 1) * MaxChannelinStripRow;
382 for (
int i = 0;
i < 3;
i++) {
384 if ((stripID + 1 +
i) >= maxStripIDForCurrChip)
continue;
385 if (firedStrips.find(stripID + 1 +
i) != firedStrips.end()) {
386 if (firedStrips.at(stripID + 1 +
i)) {
388 firedStrips[stripID + 1 +
i] =
false;
396 stripEncodingForITK[stripID] =
static_cast<int>(hitMap.to_ulong());
397 stripEncodingForITKToRDO[stripID] = firedStripsToRDO[stripID];
401 firstClusterFilled =
false;
404 for (
const auto& [stripID,
encoding] : stripEncodingForITK) {
405 const SCT_RDORawData* sctRawData = stripEncodingForITKToRDO[stripID];
410 if(hashList.size() > 0)
412 if(
std::find(hashList.begin(), hashList.end(), sielement->
identifyHash()) == hashList.end())
continue;
422 int chipID = stripID / MaxChannelinStripRow;
423 int ITkStripID = stripID % MaxChannelinStripRow;
430 ITkStripID +=
offset * MaxChannelinStripRow;
433 bool lastBit = (stripNumber == stripEncodingForITK.size());
440 stripEncodingForITK.at(stripID),
447 if (!firstClusterFilled) {
448 packedWord = (
static_cast<uint64_t>(encodedCluster) << 32);
449 firstClusterFilled =
true;
451 packedWord |=
static_cast<uint64_t>(encodedCluster);
452 encodedData.push_back(packedWord);
453 firstClusterFilled =
false;
458 if (lastBit && firstClusterFilled) {
459 encodedData.push_back(packedWord);
464 filledHeader =
false;
467 return StatusCode::SUCCESS;
◆ fillFooter()
| StatusCode FPGADataFormatTool::fillFooter |
( |
std::vector< uint64_t > & |
encodedData | ) |
const |
|
private |
◆ fillHeader()
| StatusCode FPGADataFormatTool::fillHeader |
( |
std::vector< uint64_t > & |
encodedData | ) |
const |
|
private |
◆ fillHit()
| void FPGADataFormatTool::fillHit |
( |
const FPGATrackSimHit * |
hit, |
|
|
bool |
isLast, |
|
|
bool |
isLastofSlice, |
|
|
std::vector< uint64_t > & |
encodedData |
|
) |
| const |
|
private |
◆ fillModuleHeader()
◆ initialize()
| StatusCode FPGADataFormatTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ m_PIX_mgr
◆ m_pixelId
◆ m_SCT_mgr
◆ m_sctId
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const =0
access to individual elements using Identifier or IdentiferHash
int phi_index(const Identifier &id) const
int getEtaModule(bool old=false) const
std::string find(const std::string &s)
return a remapped string
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
int getCluster2ID() const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
value_type get_compact() const
Get the compact id.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
unsigned int getIdentifier() const
const FPGATrackSimHit getOriginalHit() const
int eta_index(const Identifier &id) const
unsigned getIdentifierHash() const
int getCluster1ID() const
int strip(const Identifier &id) const
int eta_module(const Identifier &id) const
virtual Identifier identify() const override final
virtual Identifier identify() const override final
identifier of this detector element (inline)