Skip to content
Snippets Groups Projects
Commit a4a612f0 authored by Whitmaur Robert Castiglioni's avatar Whitmaur Robert Castiglioni
Browse files

added better error handling and messages. removed unused function that

had its purpose taken by another func
 Changes to be committed:
	modified:   Trigger/EFTracking/FPGATrackSim/FPGATrackSimMaps/FPGATrackSimMaps/FPGATrackSimRegionMap.h
	modified:   Trigger/EFTracking/FPGATrackSim/FPGATrackSimMaps/src/FPGATrackSimMappingSvc.cxx
	modified:   Trigger/EFTracking/FPGATrackSim/FPGATrackSimMaps/src/FPGATrackSimRegionMap.cxx
parent ce620363
No related branches found
Tags release/24.0.69
15 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75127Draft: Seeder types rebase2 grid fix,!73952Multiple pmap Intergration
......@@ -103,7 +103,7 @@ class FPGATrackSimRegionMap
const std::vector<double>& getAvgRadii(unsigned region) const { return m_radii_map.at(region); };
private:
std::string m_filepath;
std::vector<std::unique_ptr<FPGATrackSimPlaneMap>> const & m_pmaps ;
int m_nregions = 0;
......
......@@ -55,19 +55,6 @@ StatusCode FPGATrackSimMappingSvc::checkAllocs()
return StatusCode::SUCCESS;
}
int FPGATrackSimMappingSvc::readPmapSize(std::ifstream& fileIn)
{
//int numberOfPmaps;
std::string line;
getline(fileIn, line);
std::istringstream sline(line);
sline >> m_numberOfPmaps;
if ( !(m_numberOfPmaps>0) ){
ATH_MSG_FATAL("Number of Pmaps is set to" << m_numberOfPmaps);
}
return m_numberOfPmaps;
}
int FPGATrackSimMappingSvc::countPmapSize(std::ifstream& fileIn)
{
//int numberOfPmaps;
......@@ -103,7 +90,6 @@ StatusCode FPGATrackSimMappingSvc::initialize()
throw ("FPGATrackSimPlaneMap Couldn't open " + filepath);
}
//readPmapSize(fin);
countPmapSize(fin);
fin.close();
fin.open(filepath);
......@@ -115,7 +101,6 @@ StatusCode FPGATrackSimMappingSvc::initialize()
fin.close();
fin.open(filepath);
//readPmapSize(fin);
ATH_MSG_DEBUG("Creating the 2nd stage plane map");
m_pmap_2nd = std::unique_ptr<FPGATrackSimPlaneMap>(new FPGATrackSimPlaneMap(fin, m_EvtSel->getRegionID(), 2));
......@@ -125,7 +110,6 @@ StatusCode FPGATrackSimMappingSvc::initialize()
m_rmap_1st = std::unique_ptr<FPGATrackSimRegionMap>(new FPGATrackSimRegionMap(m_pmap_vector_1st, PathResolverFindCalibFile(m_rmap_path.value())));
fin.open(filepath);
//readPmapSize(fin);
m_pmap_vector_2nd.push_back(std::unique_ptr<FPGATrackSimPlaneMap>(new FPGATrackSimPlaneMap(fin, m_EvtSel->getRegionID(), 1, m_layerOverrides)));
fin.close();
......
......@@ -36,6 +36,7 @@ FPGATrackSimRegionMap::FPGATrackSimRegionMap(const std::vector<std::unique_ptr<F
ANA_MSG_FATAL("Couldn't open " << filepath);
throw ("FPGATrackSimRegionMap Couldn't open " + filepath);
}
m_filepath=filepath;
// Reads the header of the file to resize all the vector members
allocateMap(fin);
......@@ -57,13 +58,18 @@ void FPGATrackSimRegionMap::allocateMap(ifstream & fin)
istringstream sline(line);
ok = ok && (sline >> towerKey >> m_nregions);
ok = ok && (towerKey == "towers");
if((m_filepath.size()-7)==m_filepath.find("subrmap")){
if(m_pmaps.size()!= m_nregions){
ANA_MSG_FATAL("Error Pmap slice size does not match Rmap: PMAP_SIZE:"<<m_pmaps.size()<<" RMAP_SIZE:"<<m_nregions);
throw ("Pmap slice size does not match Rmap:" );
}
}
if (!ok) ANA_MSG_FATAL("Error reading header");
m_map.resize(m_nregions);
//for (auto & vv : m_map)
for (int iRegion=0; iRegion<m_map.size(); iRegion++)
{
m_map.at(iRegion).resize(m_pmaps.at(0)->getNLogiLayers());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment