ATLAS Offline Software
Loading...
Searching...
No Matches
LATOMEMapping.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "ByteStreamData/RawEvent.h" //for OFFLINE_FRAGMENTS_NAMESPACE
8#include <iostream>
9#include <fstream>
10
11
12using namespace OFFLINE_FRAGMENTS_NAMESPACE;
13
14typedef std::map<int, HWIdentifier> latome_map;
15
16void add_to_map(latome_map* map, int value, int key) {
17 HWIdentifier identifier(value);
18 (*map)[key] = identifier;
19}
20
21void LATOMEMapping::fill(latome_map *toFill, std::string inputfile) {
22 std::ifstream ifs(inputfile);
23 if (ifs.fail()) std::cout << "Fail to read" << inputfile << std::endl;
24 int value, key;
25 while (ifs >> value >> key) {
26 if (value != -999) add_to_map(toFill, value, key);
27 }
28}
void add_to_map(latome_map *map, int value, int key)
std::map< int, HWIdentifier > latome_map
Tool to get LATOME SC and SCID mapping file and fill std::map variable with it.
static void fill(std::map< int, HWIdentifier > *toFill, std::string inputfile)
STL class.