ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimMapMakerAlg Class Reference

#include <FPGATrackSimMapMakerAlg.h>

Inheritance diagram for FPGATrackSimMapMakerAlg:

Classes

struct  Module

Public Types

typedef std::tuple< SiliconTech, DetectorZone, int, int, int > FPGATrackSimModuleId

Public Member Functions

 FPGATrackSimMapMakerAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~FPGATrackSimMapMakerAlg ()=default
StatusCode initialize () override
StatusCode execute () override
StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode readInputs (bool &done)
StatusCode writePmapAndRmap (std::vector< FPGATrackSimHit > const &pbHits, std::vector< FPGATrackSimHit > const &peHits, std::vector< FPGATrackSimHit > const &sbHits, std::vector< FPGATrackSimHit > const &seHits, int region)
StatusCode writeSubrmap (std::vector< FPGATrackSimHit > const &allHits)
StatusCode writeEtaPatterns ()
StatusCode writeRadiiFile (std::vector< FPGATrackSimHit > const &allHits)
StatusCode writeMedianZFile (std::vector< FPGATrackSimHit > const &allHits)
void drawSlices (std::vector< FPGATrackSimHit > const &allHits)
bool isOnKeyLayer (int keynum, SiliconTech det, DetectorZone bec, int lyr)
int findPlane (const std::vector< std::vector< std::string > > *planes, const std::string &test)
std::string makeRmapLines (std::vector< FPGATrackSimHit > const &hits, SiliconTech det, DetectorZone bec, int max)
std::string makeSubrmapLines (std::vector< Module * > const &allmods, SiliconTech det, DetectorZone bec, int max)
void parseKeyString ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IFPGATrackSimEventInputHeaderToolm_hitInputTool { this, "InputTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimInputTool", "HitInput Tool" }
ToolHandle< IFPGATrackSimInputToolm_hitSGInputTool {this, "SGInputTool", "", "Input tool from SG"}
ServiceHandle< IFPGATrackSimEventSelectionSvcm_evtSel {this, "eventSelector", "", "Event selection Svc"}
FPGATrackSimEventInputHeader m_eventHeader
Gaudi::Property< int > m_maxEvents {this, "maxEvents", 10000, "Max Events"}
Gaudi::Property< int > m_region {this, "region", 0, "Region"}
Gaudi::Property< float > m_trim {this, "trim", 0.1, "trim modules with less than given percent of tracks"}
Gaudi::Property< std::string > m_outFileName {this, "OutFileName", "", "naming convention for maps"}
Gaudi::Property< std::string > m_keystring {this, "KeyString", "strip,barrel,2", "key layer to use for subrmap"}
Gaudi::Property< std::string > m_keystring2 {this, "KeyString2", "", "second key layer for 2D slicing"}
Gaudi::Property< int > m_nSlices {this, "nSlices", -1, "default is full granularity/maximum number of slices possible"}
Gaudi::Property< float > m_globalTrim {this, "globalTrim", 0.1, "Trimming applied globally to the key layer before determining slice boundaries"}
Gaudi::Property< std::string > m_description {this, "description", "", "tag description"}
Gaudi::Property< std::string > m_geoTag {this, "GeometryVersion", "ATLAS-P2-ITK-22-02-00", "Geometry tag that this set of maps is for. TODO can we store/read from wrappers?"}
Gaudi::Property< bool > m_remapModules {this, "remapModules", false, "Allow maps to be drawn that slice modules more finely, by remapping module indices"}
Gaudi::Property< bool > m_drawSlices {this, "drawSlices", false, "Draw the huge 2D slice histograms"}
FPGATrackSimModuleRelabelm_moduleRelabel = nullptr
std::map< FPGATrackSimModuleId, Modulem_modules
std::map< int, std::vector< Module * > > m_track2modules
std::map< int, std::vector< Module * > > m_slice2modules
std::map< int, int > m_track2slice
std::vector< FPGATrackSimHitm_pbHits
std::vector< FPGATrackSimHitm_peHits
std::vector< FPGATrackSimHitm_sbHits
std::vector< FPGATrackSimHitm_seHits
std::vector< FPGATrackSimHitm_allHits
int m_pbmax = -1
int m_sbmax = -1
std::vector< int > m_pemax = {-1,-1}
std::vector< int > m_semax = {-1,-1}
const std::vector< std::vector< std::string > > * m_planes {}
const std::vector< std::vector< std::string > > * m_planes2 {}
const std::vector< std::vector< std::string > > m_planes_generic
const std::vector< std::vector< std::string > > m_planes2_generic
Gaudi::Property< std::vector< std::vector< std::string > > > m_overridePlanes {this, "planes", m_planes_generic, "Logical layer assignments" }
Gaudi::Property< std::vector< std::vector< std::string > > > m_overridePlanes2 {this, "planes2", m_planes2_generic, "Logical layer assignments" }
std::map< std::string, std::set< int > > m_keylayer
std::map< std::string, std::set< int > > m_keylayer2
bool m_key2 = false
std::map< int, int > m_key_etamods
std::set< int > m_key_etamods2
std::set< int > m_usedTracks
std::vector< std::vector< std::vector< float > > > m_radii
std::vector< std::vector< std::vector< float > > > m_z
std::ofstream m_pmap
std::ofstream m_rmap
std::ofstream m_subrmap
std::ofstream m_etapat
std::ofstream m_radfile
std::ofstream m_zedfile
std::unique_ptr< TFile > m_monitorFile {}
const std::vector< uint32_t > m_diskIndex = {0,17,47,58,66}
std::map< std::string, SiliconTechm_det2tech = { {"pixel",SiliconTech::pixel}, {"strip",SiliconTech::strip} }
std::map< std::string, DetectorZonem_bec2zone = { {"barrel",DetectorZone::barrel}, {"posEndcap",DetectorZone::posEndcap}, {"negEndcap",DetectorZone::negEndcap} }
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 33 of file FPGATrackSimMapMakerAlg.h.

Member Typedef Documentation

◆ FPGATrackSimModuleId

Definition at line 36 of file FPGATrackSimMapMakerAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimMapMakerAlg()

FPGATrackSimMapMakerAlg::FPGATrackSimMapMakerAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 17 of file FPGATrackSimMapMakerAlg.cxx.

17 :
18 AthAlgorithm(name, pSvcLocator)
19{
20}
AthAlgorithm()
Default constructor:

◆ ~FPGATrackSimMapMakerAlg()

virtual FPGATrackSimMapMakerAlg::~FPGATrackSimMapMakerAlg ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ drawSlices()

void FPGATrackSimMapMakerAlg::drawSlices ( std::vector< FPGATrackSimHit > const & allHits)
private

Definition at line 724 of file FPGATrackSimMapMakerAlg.cxx.

725{
726 m_monitorFile->cd();
727
728 std::vector<TH2F*> h_slicemap;
729 char *hname = new char[20];
730
731 for (unsigned i = 0; i < (unsigned)m_nSlices.value(); i++)
732 {
733 sprintf(hname,"rz_slice%u",i);
734 // This should just default to the entire range, I think.
735 // The user can reduce the binning.
736 TH2F *h = new TH2F(hname,hname,7000,-3500,3500,1200,0,1200);
737 h_slicemap.push_back(h);
738 }
739
740 for (const auto& hit: allHits)
741 {
742 if (m_usedTracks.find(hit.getEventIndex()) == m_usedTracks.end()) continue; // skip if we don't use this track
743 int s = m_track2slice[hit.getEventIndex()];
744 h_slicemap[s]->Fill(hit.getZ(),hit.getR());
745 }
746
747 for (int i = 0; i < m_nSlices.value(); i++)
748 h_slicemap[i]->Write();
749
750 delete [] hname;
751}
std::unique_ptr< TFile > m_monitorFile
std::map< int, int > m_track2slice
Gaudi::Property< int > m_nSlices
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode FPGATrackSimMapMakerAlg::execute ( )
override

Definition at line 69 of file FPGATrackSimMapMakerAlg.cxx.

70{
71 // Read inputs
72 bool done = false;
73 ATH_CHECK(readInputs(done));
74
75 if (done) {
76 SmartIF<IEventProcessor> appMgr{service("ApplicationMgr")};
77 if (!appMgr) {
78 ATH_MSG_ERROR("Failed to retrieve ApplicationMgr as IEventProcessor");
79 return StatusCode::FAILURE;
80 }
81 return appMgr->stopRun();
82 }
83
84 // Reset data pointers
85 m_eventHeader.reset();
86
87 return StatusCode::SUCCESS;
88}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
FPGATrackSimEventInputHeader m_eventHeader
StatusCode readInputs(bool &done)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode FPGATrackSimMapMakerAlg::finalize ( )
override

Definition at line 706 of file FPGATrackSimMapMakerAlg.cxx.

707{
708 // Write the output
714 m_monitorFile.reset();
715 delete m_moduleRelabel;
716 m_moduleRelabel = nullptr;
717 return StatusCode::SUCCESS;
718}
StatusCode writePmapAndRmap(std::vector< FPGATrackSimHit > const &pbHits, std::vector< FPGATrackSimHit > const &peHits, std::vector< FPGATrackSimHit > const &sbHits, std::vector< FPGATrackSimHit > const &seHits, int region)
StatusCode writeRadiiFile(std::vector< FPGATrackSimHit > const &allHits)
std::vector< FPGATrackSimHit > m_sbHits
std::vector< FPGATrackSimHit > m_seHits
std::vector< FPGATrackSimHit > m_pbHits
StatusCode writeMedianZFile(std::vector< FPGATrackSimHit > const &allHits)
FPGATrackSimModuleRelabel * m_moduleRelabel
Gaudi::Property< int > m_region
std::vector< FPGATrackSimHit > m_peHits
std::vector< FPGATrackSimHit > m_allHits
StatusCode writeSubrmap(std::vector< FPGATrackSimHit > const &allHits)

◆ findPlane()

int FPGATrackSimMapMakerAlg::findPlane ( const std::vector< std::vector< std::string > > * planes,
const std::string & test )
private

Definition at line 768 of file FPGATrackSimMapMakerAlg.cxx.

769{
770 int pcounter = 0;
771 for (auto& plane : *planes) {
772 for (auto& layer : plane) {
773 if (test == layer) return pcounter;
774 }
775 pcounter ++;
776 }
777 return -1;
778}

◆ initialize()

StatusCode FPGATrackSimMapMakerAlg::initialize ( )
override

Definition at line 23 of file FPGATrackSimMapMakerAlg.cxx.

24{
25
26 m_monitorFile.reset (new TFile((m_outFileName.value() + "region" + std::to_string(m_region) + ".root").c_str(), "RECREATE"));
27 std::stringstream ss(m_description);
28 std::string line;
29 ATH_MSG_INFO("Tag config:");
30 if (m_description.value() != "")
31 while (std::getline(ss, line, '\n'))
32 ATH_MSG_INFO('\t' << line);
33
34 // reset Hit and Module vectors
35 m_pbHits.clear(); m_peHits.clear(); m_sbHits.clear(); m_seHits.clear(); m_allHits.clear();
36 m_track2modules.clear(); m_track2slice.clear(); m_slice2modules.clear();
37 m_key_etamods.clear(); m_key_etamods2.clear(); m_usedTracks.clear();
38 m_radii.clear(); m_keylayer.clear(); m_keylayer2.clear();
39 m_modules.clear();
40
41 // Set up the module relabel tool.
42 m_moduleRelabel = new FPGATrackSimModuleRelabel(m_geoTag.value(), m_remapModules);
43
44 // We need to select this before calling parseKeyString() in case the user
45 // has specified a plane (logical layer) as the keystring.
46 // If running with the new regions. Don't use the hardcoded layer assignments. Use either a generic one
47 // or one passed in via a flag.
48 ATH_MSG_INFO("Using Python configuration for regions. All pixel layers -> first stage, all strip layers -> second stage");
49 m_planes = &(m_overridePlanes.value());
50 m_planes2 = &(m_overridePlanes2.value());
51
53 ATH_CHECK(m_evtSel.retrieve());
54
55 ATH_CHECK(m_hitSGInputTool.retrieve(EnableTool{!m_hitSGInputTool.empty()}));
56 ATH_CHECK(m_hitInputTool.retrieve(EnableTool{!m_hitInputTool.empty()}));
57
58 ATH_MSG_DEBUG("initialize() Instantiating root objects");
59 ATH_MSG_DEBUG("initialize() Finished");
60
61
62 return StatusCode::SUCCESS;
63}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
static Double_t ss
ToolHandle< IFPGATrackSimInputTool > m_hitSGInputTool
std::vector< std::vector< std::vector< float > > > m_radii
std::map< std::string, std::set< int > > m_keylayer2
std::map< std::string, std::set< int > > m_keylayer
Gaudi::Property< std::string > m_description
std::map< FPGATrackSimModuleId, Module > m_modules
Gaudi::Property< std::string > m_outFileName
const std::vector< std::vector< std::string > > * m_planes
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_hitInputTool
std::map< int, std::vector< Module * > > m_track2modules
Gaudi::Property< std::vector< std::vector< std::string > > > m_overridePlanes
Gaudi::Property< bool > m_remapModules
const std::vector< std::vector< std::string > > * m_planes2
std::map< int, int > m_key_etamods
Gaudi::Property< std::vector< std::vector< std::string > > > m_overridePlanes2
Gaudi::Property< std::string > m_geoTag
std::map< int, std::vector< Module * > > m_slice2modules
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_evtSel

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isOnKeyLayer()

bool FPGATrackSimMapMakerAlg::isOnKeyLayer ( int keynum,
SiliconTech det,
DetectorZone bec,
int lyr )
private

Definition at line 753 of file FPGATrackSimMapMakerAlg.cxx.

754{
755 int det = static_cast<int>(t_det);
756 int bec = static_cast<int>(t_bec);
757 if (keynum == 1)
758 if (m_keylayer["det"].find(det) != m_keylayer["det"].end() && m_keylayer["bec"].find(bec) != m_keylayer["bec"].end() && m_keylayer["lyr"].find(lyr) != m_keylayer["lyr"].end())
759 return true;
760
761 if (keynum == 2)
762 if (m_keylayer2["det"].find(det) != m_keylayer2["det"].end() && m_keylayer2["bec"].find(bec) != m_keylayer2["bec"].end() && m_keylayer2["lyr"].find(lyr) != m_keylayer2["lyr"].end())
763 return true;
764
765 return false;
766}
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138

◆ makeRmapLines()

std::string FPGATrackSimMapMakerAlg::makeRmapLines ( std::vector< FPGATrackSimHit > const & hits,
SiliconTech det,
DetectorZone bec,
int max )
private

Definition at line 780 of file FPGATrackSimMapMakerAlg.cxx.

781{
782 std::stringstream rmap_line;
783 std::set<int> etas, phis;
784
785 for(int lyr = 0; lyr <= max; lyr++)
786 {
787 etas.clear();
788 phis.clear();
789 for (const auto& hit: hits)
790 {
791 if(static_cast<int>(hit.getPhysLayer()) == lyr && hit.getDetectorZone() == bec) // cast from uint to int just to remove Wsign-compare warnings
792 {
793 etas.insert(hit.getEtaModule());
794 phis.insert(hit.getPhiModule());
795 }
796 }
797 if (etas.size() != 0) rmap_line << static_cast<int>(det) << " " << static_cast<int>(bec) << " " << lyr << " " << *phis.begin() << " " << *phis.rbegin() << " " << phis.size() << " " << *etas.begin() << " " << *etas.rbegin() << " " << etas.size() << "\n";
798 else rmap_line << static_cast<int>(det) << " " << static_cast<int>(bec) << " " << lyr << " 0 0 0 0 0 0\n";
799
800 }
801
802 return rmap_line.str();
803}
#define max(a, b)
Definition cfImp.cxx:41

◆ makeSubrmapLines()

std::string FPGATrackSimMapMakerAlg::makeSubrmapLines ( std::vector< Module * > const & allmods,
SiliconTech det,
DetectorZone bec,
int max )
private

Definition at line 903 of file FPGATrackSimMapMakerAlg.cxx.

904{
905 std::stringstream subrmap_line;
906 std::set<int> etas, phis;
907
908 std::vector<Module*> mods;
909 for (auto* mod: allmods) // just want modules in pb/pe/sb/se etc, not all at once
910 if (mod->det == det && mod->bec == bec) mods.push_back(mod);
911
912 for(int lyr = 0; lyr <= max; lyr++)
913 {
914 etas.clear();
915 phis.clear();
916 for (auto mod: mods)
917 {
918 if(mod->lyr == lyr)
919 {
920 etas.insert(mod->eta);
921 phis.insert(mod->phi);
922 }
923 }
924 if (etas.size() != 0) subrmap_line << static_cast<int>(det) << " " << static_cast<int>(bec) << " " << lyr << " " << *phis.begin() << " " << *phis.rbegin() << " " << phis.size() << " " << *etas.begin() << " " << *etas.rbegin() << " " << etas.size() << "\n";
925 else subrmap_line << static_cast<int>(det) << " " << static_cast<int>(bec) << " " << lyr << " 0 0 0 0 0 0\n";
926
927 }
928
929 return subrmap_line.str();
930}

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ parseKeyString()

void FPGATrackSimMapMakerAlg::parseKeyString ( )
private

Definition at line 805 of file FPGATrackSimMapMakerAlg.cxx.

806{
807 // Parse keystring and define the Key Layer
808 std::string delimiter = ",";
809 std::string s = m_keystring.value();
810 std::string det, bec, lyr;
811 std::map <std::string, std::vector<std::string>> abrevs = { {"pb",{"pixel","barrel"}}, {"pe",{"pixel","endcap"}}, {"sb",{"strip","barrel"}}, {"se",{"strip","endcap"}} };
812 if( s.find(delimiter) != std::string::npos) // keylayer format is 'strip,barrel,4'
813 {
814 try {
815 std::string det = s.substr(0, s.find(delimiter));
816 s.erase(0, s.find(delimiter) + delimiter.length());
817 std::string bec = s.substr(0, s.find(delimiter));
818 s.erase(0, s.find(delimiter) + delimiter.length());
819 std::string lyr = s.substr(0, s.find(delimiter));
820 s.erase(0, s.find(delimiter) + delimiter.length());
821 m_keylayer["det"].insert(static_cast<int>(m_det2tech[det]));
822 m_keylayer["bec"].insert(static_cast<int>(m_bec2zone[bec]));
823 m_keylayer["lyr"].insert(std::stoi(lyr));
824 ATH_MSG_INFO("Using key layer: " << m_keystring.value());
825 } catch (...){
826 ATH_MSG_ERROR("Invalid KeyString: '" << m_keystring.value() << "'." << "Accepted formats are 'strip,posEndcap,2', 'pixel,barrel,3', or 'plane 0'");
827 }
828 }
829 else // keylayer format is 'plane 0'
830 {
831 std::string delimiter = " ";
832 try {
833 s.erase(0, s.find(delimiter) + delimiter.length());
834 std::string plane = s.substr(0, s.find(delimiter));
835 std::vector<std::string> s = (m_planes)->at(std::stoi(plane));
836 for (unsigned i = 0; i < s.size(); i++){
837 std::string reg = s[i].substr(0, 2);
838 std::vector<std::string> zone = abrevs[reg];
839 if (s[i].back() == '+') zone[1] = "posEndcap";
840 if (s[i].back() == '-') zone[1] = "negEndcap";
841 s[i].erase(std::remove(s[i].begin(), s[i].end(), '+'), s[i].end());
842 s[i].erase(std::remove(s[i].begin(), s[i].end(), '-'), s[i].end());
843 std::string lyr = s[i].substr(2);
844 m_keylayer["det"].insert(static_cast<int>(m_det2tech[zone[0]]));
845 m_keylayer["bec"].insert(static_cast<int>(m_bec2zone[zone[1]]));
846 m_keylayer["lyr"].insert(std::stoi(lyr));
847 }
848 ATH_MSG_INFO("Using key layer (in plane X format) " << m_keystring.value());
849 } catch (...){
850 ATH_MSG_ERROR("Invalid KeyString: '" << m_keystring.value() << "'." << "Accepted formats are 'strip,posEndcap,2', 'pixel,barrel,3', or 'plane 0'");
851 }
852 }
853
854 // if 2D slicing
855 if (m_keystring2.value() != "")
856 {
857 m_key2 = true;
858 std::string s = m_keystring2.value();
859 if( s.find(delimiter) != std::string::npos) // keylayer format is 'strip,barrel,8'
860 {
861 try {
862 std::string det = s.substr(0, s.find(delimiter));
863 s.erase(0, s.find(delimiter) + delimiter.length());
864 std::string bec = s.substr(0, s.find(delimiter));
865 s.erase(0, s.find(delimiter) + delimiter.length());
866 std::string lyr = s.substr(0, s.find(delimiter));
867 s.erase(0, s.find(delimiter) + delimiter.length());
868 m_keylayer2["det"].insert(static_cast<int>(m_det2tech[det]));
869 m_keylayer2["bec"].insert(static_cast<int>(m_bec2zone[bec]));
870 m_keylayer2["lyr"].insert(std::stoi(lyr));
871 ATH_MSG_INFO("Using key layer (2D): " << m_keystring2.value());
872 } catch (...){
873 ATH_MSG_ERROR("Invalid KeyString2: '" << m_keystring2.value() << "'." << "Accepted formats are 'strip,posEndcap,2', 'pixel,barrel,3', or 'plane 0'");
874 }
875 }
876 else // keylayer format is 'plane 0'
877 {
878 std::string delimiter = " ";
879 try {
880 s.erase(0, s.find(delimiter) + delimiter.length());
881 std::string plane = s.substr(0, s.find(delimiter));
882 std::vector<std::string> s = (m_planes)->at(std::stoi(plane));
883 for (unsigned i = 0; i < s.size(); i++){
884 std::string reg = s[i].substr(0, 2);
885 std::vector<std::string> zone = abrevs[reg];
886 if (s[i].back() == '+') zone[1] = "posEndcap";
887 if (s[i].back() == '-') zone[1] = "negEndcap";
888 s[i].erase(std::remove(s[i].begin(), s[i].end(), '+'), s[i].end());
889 s[i].erase(std::remove(s[i].begin(), s[i].end(), '-'), s[i].end());
890 std::string lyr = s[i].substr(2);
891 m_keylayer2["det"].insert(static_cast<int>(m_det2tech[zone[0]]));
892 m_keylayer2["bec"].insert(static_cast<int>(m_bec2zone[zone[1]]));
893 m_keylayer2["lyr"].insert(std::stoi(lyr));
894 }
895 ATH_MSG_INFO("Using key layer (2D) (in plane X format): " << m_keystring2.value());
896 } catch (...){
897 ATH_MSG_ERROR("Invalid KeyString2: '" << m_keystring2.value() << "'." << "Accepted formats are 'strip,posEndcap,2', 'pixel,barrel,3', or 'plane 0'");
898 }
899 }
900 }
901}
std::map< std::string, SiliconTech > m_det2tech
Gaudi::Property< std::string > m_keystring2
Gaudi::Property< std::string > m_keystring
std::map< std::string, DetectorZone > m_bec2zone
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.

◆ readInputs()

StatusCode FPGATrackSimMapMakerAlg::readInputs ( bool & done)
private

Definition at line 96 of file FPGATrackSimMapMakerAlg.cxx.

97{
98 // Read primary input
99 if ( !m_hitSGInputTool.empty()) {
100 ATH_CHECK(m_hitSGInputTool->readData(&m_eventHeader, Gaudi::Hive::currentContext()));
101 ATH_MSG_DEBUG("Loaded " << m_eventHeader.nHits() << " hits in event header from SG");
102 }
103 else {
104 ATH_CHECK(m_hitInputTool->readData(&m_eventHeader, done));
105 if (done)
106 {
107 ATH_MSG_INFO("Cannot read more events from file, returning");
108 return StatusCode::SUCCESS; // end of loop over events
109 }
110 }
111
112 // Ask the event selection service if this event really falls within the region.
113 if (!m_evtSel->selectEvent(&m_eventHeader))
114 {
115 ATH_MSG_DEBUG("Event skipped by: " << m_evtSel->name());
116 return StatusCode::SUCCESS;
117 }
118
119 FPGATrackSimEventInfo eventinfo = m_eventHeader.event();
120 ATH_MSG_DEBUG ("Getting Event " << eventinfo);
121
122 for (auto hit: m_eventHeader.hits()) // fill track to modules map and hit vectors
123 {
124 // barcode cut: these hits are not associated with our single muon tracks
125 if (hit.getBarcodePt() == 0) continue;
126
127 SiliconTech det = hit.getDetType();
128 DetectorZone bec = hit.getDetectorZone();
129 int lyr = hit.getPhysLayer();
130 int eta = hit.getEtaModule();
131 int phi = hit.getPhiModule();
132
133 if (hit.isPixel() && hit.isBarrel()) {
134 m_pbHits.push_back(hit);
135 if (lyr > m_pbmax) m_pbmax = lyr;
136 }
137 else if (hit.isPixel() && !hit.isBarrel()) {
138 // Perform the layer + module number remapping using our tool.
139 m_moduleRelabel->remap(hit);
140 eta = hit.getEtaModule();
141 lyr = hit.getPhysLayer();
142
143 m_peHits.push_back(hit);
144 if (bec == DetectorZone::posEndcap && lyr > m_pemax[0]) m_pemax[0] = lyr;
145 if (bec == DetectorZone::negEndcap && lyr > m_pemax[1]) m_pemax[1] = lyr;
146 }
147 else if (!hit.isPixel() && hit.isBarrel()) {
148 m_sbHits.push_back(hit);
149 if (lyr > m_sbmax) m_sbmax = lyr;
150 }
151 else if (!hit.isPixel() && !hit.isBarrel()) {
152 m_seHits.push_back(hit);
153 if (bec == DetectorZone::posEndcap && lyr > m_semax[0]) m_semax[0] = lyr;
154 if (bec == DetectorZone::negEndcap && lyr > m_semax[1]) m_semax[1] = lyr;
155 }
156 else ATH_MSG_ERROR("Invalid Region");
157
158 // keep track of all etamods on the key layer for slicing
159 if (isOnKeyLayer(1,det,bec,lyr)) {
160 if (m_key_etamods.count(eta) == 0) {
161 m_key_etamods.insert(std::pair<int, int>(eta, 1));
162 } else {
163 m_key_etamods[eta] += 1;
164 }
165 }
166
167 if (m_key2) // if doing 2D slicing
168 if (isOnKeyLayer(2,det,bec,lyr)) m_key_etamods2.insert(eta);
169
170 // Keep a global record of all modules as we see them, indexed by the ID tuple.
171 Module mod = Module(det, bec, lyr, eta, phi);
172 if (m_modules.count(mod.moduleId()) == 0) {
173 m_modules.insert(std::pair<FPGATrackSimModuleId, Module>(mod.moduleId(), mod));
174 }
175 Module* modref = &(m_modules[mod.moduleId()]);
176
177 if (std::find(m_track2modules[hit.getEventIndex()].begin(), m_track2modules[hit.getEventIndex()].end(), modref) == m_track2modules[hit.getEventIndex()].end())
178 m_track2modules[hit.getEventIndex()].push_back(modref);
179 m_allHits.push_back(hit);
180 }
181
182 return StatusCode::SUCCESS;
183}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
SiliconTech
DetectorZone
bool isOnKeyLayer(int keynum, SiliconTech det, DetectorZone bec, int lyr)

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeEtaPatterns()

StatusCode FPGATrackSimMapMakerAlg::writeEtaPatterns ( )
private

Definition at line 508 of file FPGATrackSimMapMakerAlg.cxx.

509{
510 std::string slicingType = "";
511 if (m_key2) slicingType = "2D";
512
513 std::string etapat_path = m_outFileName.value() + "region" + std::to_string(m_region) + ".patt";
514
515 ATH_MSG_INFO("Creating eta patterns file: " << etapat_path);
516 m_etapat.open(etapat_path, std::ofstream::out);
517
518 // assign logical layer to each module
519 for (auto& pair: m_track2modules) {
520 for (auto& m: pair.second)
521 {
522 if (m->det == SiliconTech::pixel && m->bec == DetectorZone::barrel) m->plane = findPlane(m_planes, "pb" + std::to_string(m->lyr));
523 if (m->det == SiliconTech::pixel && m->bec == DetectorZone::posEndcap) m->plane = findPlane(m_planes, "pe" + std::to_string(m->lyr) + "+");
524 if (m->det == SiliconTech::pixel && m->bec == DetectorZone::negEndcap) m->plane = findPlane(m_planes, "pe" + std::to_string(m->lyr) + "-");
525
526 if (m->det == SiliconTech::strip && m->bec == DetectorZone::barrel) m->plane = findPlane(m_planes, "sb" + std::to_string(m->lyr));
527 if (m->det == SiliconTech::strip && m->bec == DetectorZone::posEndcap) m->plane = findPlane(m_planes, "se" + std::to_string(m->lyr) + "+");
528 if (m->det == SiliconTech::strip && m->bec == DetectorZone::negEndcap) m->plane = findPlane(m_planes, "se" + std::to_string(m->lyr) + "-");
529 }
530 }
531
532 for(auto trk: m_usedTracks)
533 {
534 std::stringstream track_etapatts;
535 unsigned planesDone = 0;
536 for (unsigned p = 0; p < (m_planes)->size(); p++)
537 {
538 for (const Module* m : m_track2modules[trk]) {
539 if (m->plane == static_cast<int>(p))
540 {
541 track_etapatts << std::to_string(static_cast<int>(m->det)) << "\t" << std::to_string(static_cast<int>(m->bec)) << "\t" << std::to_string(m->eta) << "\t\t";
542 planesDone++;
543 break;
544 }
545 }
546 }
547 if (planesDone == (m_planes)->size())
548 m_etapat << track_etapatts.str() << "\n";
549
550 }
551 m_etapat.close();
552 return StatusCode::SUCCESS;
553}
int findPlane(const std::vector< std::vector< std::string > > *planes, const std::string &test)

◆ writeMedianZFile()

StatusCode FPGATrackSimMapMakerAlg::writeMedianZFile ( std::vector< FPGATrackSimHit > const & allHits)
private

Definition at line 625 of file FPGATrackSimMapMakerAlg.cxx.

626{
627 // calculate median z. We do this globally and slice-by-slice.
628 m_z.resize(m_nSlices.value(), std::vector<std::vector<float>>((m_planes2)->size(),std::vector<float>(0)));
629 for (const auto& hit: allHits)
630 {
631 SiliconTech det = hit.getDetType();
632 DetectorZone bec = hit.getDetectorZone();
633 int lyr = hit.getPhysLayer();
634 int slice = m_track2slice[hit.getEventIndex()];
635 int plane = -1;
636 if (det == SiliconTech::pixel && bec == DetectorZone::barrel) plane = findPlane(m_planes2, "pb" + std::to_string(lyr));
637 if (det == SiliconTech::pixel && bec == DetectorZone::posEndcap) plane = findPlane(m_planes2, "pe" + std::to_string(lyr) + "+");
638 if (det == SiliconTech::pixel && bec == DetectorZone::negEndcap) plane = findPlane(m_planes2, "pe" + std::to_string(lyr) + "-");
639 if (det == SiliconTech::strip && bec == DetectorZone::barrel) plane = findPlane(m_planes2, "sb" + std::to_string(lyr));
640 if (det == SiliconTech::strip && bec == DetectorZone::posEndcap) plane = findPlane(m_planes2, "se" + std::to_string(lyr) + "+");
641 if (det == SiliconTech::strip && bec == DetectorZone::negEndcap) plane = findPlane(m_planes2, "se" + std::to_string(lyr) + "-");
642
643 if (plane != -1) {
644 m_z[slice][plane].push_back(hit.getZ());
645 }
646 }
647
648 // print file
649 std::string zed_path = m_outFileName.value() + "region" + std::to_string(m_region) + "_z.txt";
650
651 ATH_MSG_INFO("Creating median z file: " << zed_path);
652 m_zedfile.open(zed_path, std::ofstream::out);
653 for (int s = 0; s < m_nSlices.value(); s++){
654 m_zedfile << std::to_string(s) << " ";
655 for (unsigned p = 0; p < (m_planes2)->size(); p++){
656 if (m_z[s][p].size() != 0){
657 float minZ = *std::min_element(m_z[s][p].begin(), m_z[s][p].end());
658 float maxZ = *std::max_element(m_z[s][p].begin(), m_z[s][p].end());
659 float median = (minZ + maxZ)/2;
660 m_zedfile << std::setprecision(3) << std::fixed << median << " ";
661 } else {
662 int median = -1;
663 m_zedfile << median << " ";
664 }
665 }
666 m_zedfile << std::endl;
667 }
668
669 // Now do this globally. Note: should this be meanZ instead of medianZ in the forward region?
670 m_zedfile << -1 << " ";
671 for (unsigned p = 0; p < (m_planes2)->size(); p++) {
672 float minZ = 0;
673 float maxZ = 0;
674 bool doneInitial = false;
675 for (int s = 0; s < m_nSlices.value(); s++) {
676 if (m_z[s][p].size() != 0) {
677 float newMinZ = *std::min_element(m_z[s][p].begin(), m_z[s][p].end());
678 float newMaxZ = *std::max_element(m_z[s][p].begin(), m_z[s][p].end());
679 // slightly clunky, but z can be positive and negative so there's not a sane initial/placeholder value.
680 if (doneInitial) {
681 minZ = std::min(minZ, newMinZ);
682 maxZ = std::max(maxZ, newMaxZ);
683 } else {
684 minZ = newMinZ;
685 maxZ = newMaxZ;
686 doneInitial = true;
687 }
688 }
689 }
690 if (doneInitial) {
691 float median = (minZ + maxZ)/2;
692 m_zedfile << std::setprecision(3) << std::fixed << median << " ";
693 } else {
694 int median = -1;
695 m_zedfile << median << " ";
696 }
697 }
698 m_zedfile << std::endl;
699
700 m_zedfile.close();
701
702 return StatusCode::SUCCESS;
703}
std::vector< std::vector< std::vector< float > > > m_z
float median(std::vector< float > &Vec)

◆ writePmapAndRmap()

StatusCode FPGATrackSimMapMakerAlg::writePmapAndRmap ( std::vector< FPGATrackSimHit > const & pbHits,
std::vector< FPGATrackSimHit > const & peHits,
std::vector< FPGATrackSimHit > const & sbHits,
std::vector< FPGATrackSimHit > const & seHits,
int region )
private

Definition at line 191 of file FPGATrackSimMapMakerAlg.cxx.

192{
193 // Plane Map
194
195 // to avoid vector _M_range_check errors, print at least one line for each DetectorZone
196 if (m_pbmax == -1) m_pbmax = 0;
197 if (m_sbmax == -1) m_sbmax = 0;
198 if (m_pemax[0] == -1) m_pemax[0] = 0;
199 if (m_pemax[1] == -1) m_pemax[1] = 0;
200 if (m_semax[0] == -1) m_semax[0] = 0;
201 if (m_semax[1] == -1) m_semax[1] = 0;
202
203 std::string pmap_path = m_outFileName.value() + "region" + std::to_string(m_region) + ".pmap";
204 ATH_MSG_INFO("Creating pmap: " << pmap_path);
205 m_pmap.open(pmap_path, std::ofstream::out);
206
207 m_pmap << m_geoTag.value() << "\n" << m_planes->size() << " logical_s1\n" << m_planes2->size() << " logical_s2\n";
208 m_pmap << m_pbmax+1 << " pixel barrel \n" << m_pemax[0]+1 << " pixel endcap+ \n" << m_pemax[1]+1 << " pixel endcap- \n";
209 m_pmap << m_sbmax+1 << " SCT barrel \n" << m_semax[0]+1 << " SCT endcap+\n" << m_semax[1]+1 << " SCT endcap-\n";
210 m_pmap << "! silicon endCap physDisk physLayer ['stereo' stripSide <strip only>] 'plane1' logiLayer1 'plane2' logiLayer2\n";
211 m_pmap << "\nregion " << reg << "\n";
212
213 int p1,p2;
214 for (int lyr = 0; lyr <= m_pbmax; lyr++) { // Pixel Barrel
215 p1 = findPlane(m_planes, "pb" + std::to_string(lyr));
216 p2 = findPlane(m_planes2, "pb" + std::to_string(lyr));
217 m_pmap << "pixel 0 -1 " << lyr << " plane1 " << p1 << " plane2 " << p2 << "\n";
218 }
219 for (int lyr = 0; lyr <= m_pemax[0]; lyr++) { // Pixel Postive Endap
220 p1 = findPlane(m_planes, "pe" + std::to_string(lyr) + "+");
221 p2 = findPlane(m_planes2, "pe" + std::to_string(lyr) + "+");
222 m_pmap << "pixel 1 " << lyr << " " << lyr << " plane1 " << p1 << " plane2 " << p2 << "\n";
223 }
224 for (int lyr = 0; lyr <= m_pemax[1]; lyr++) { // Pixel Negative Endcap
225 p1 = findPlane(m_planes, "pe" + std::to_string(lyr) + "-");
226 p2 = findPlane(m_planes2, "pe" + std::to_string(lyr) + "-");
227 m_pmap << "pixel 2 " << lyr << " " << lyr << " plane1 " << p1 << " plane2 " << p2 << "\n";
228 }
229 for (int lyr = 0; lyr <= m_sbmax; lyr++) { // Strip Barrel
230 p1 = findPlane(m_planes, "sb" + std::to_string(lyr));
231 p2 = findPlane(m_planes2, "sb" + std::to_string(lyr));
232 m_pmap << "SCT 0 -1 " << lyr << " stereo " << lyr % 2 << " plane1 " << p1 << " plane2 " << p2 << "\n";
233 }
234 for (int lyr = 0; lyr <= m_semax[0]; lyr++) { // Strip Positive Endcap
235 p1 = findPlane(m_planes, "se" + std::to_string(lyr) + "+");
236 p2 = findPlane(m_planes2, "se" + std::to_string(lyr) + "+");
237 m_pmap << "SCT 1 " << lyr/2 << " " << lyr << " stereo " << lyr % 2 << " plane1 " << p1 << " plane2 " << p2 << "\n";
238 }
239 for (int lyr = 0; lyr <= m_semax[1]; lyr++) { // Strip Negative Endcap
240 p1 = findPlane(m_planes, "se" + std::to_string(lyr) + "-");
241 p2 = findPlane(m_planes2, "se" + std::to_string(lyr) + "-");
242 m_pmap << "SCT 2 " << lyr/2 << " " << lyr << " stereo " << lyr % 2 << " plane1 " << p1 << " plane2 " << p2 << "\n";
243 }
244
245 // Region Map
246 std::string rmap_path = m_outFileName.value() + "region" + std::to_string(m_region) + ".rmap";
247 ATH_MSG_INFO("Creating rmap: " << rmap_path);
248 m_rmap.open(rmap_path, std::ofstream::out);
249 m_rmap << "towers 1 phi 16\n\n0\n";
250
254
258
259 m_pmap.close();
260 m_rmap.close();
261
262 // Step 1: Read the entire contents of the file
263 std::ifstream inputFile(pmap_path);
264 if (!inputFile) {
265 ATH_MSG_ERROR("Error: Unable to open file for reading: " << pmap_path);
266 return StatusCode::FAILURE;
267 }
268
269 std::ostringstream buffer;
270 buffer << inputFile.rdbuf(); // Reading the entire file into the stringstream
271 std::string fileContent = buffer.str();
272 inputFile.close();
273
274 // Step 2: Concatenate the content n times
275 std::string newContent;
276 for (int i = 0; i < m_nSlices; ++i) {
277 newContent += fileContent;
278 newContent += '\n';
279 }
280
281 // Step 3: Write the new content back to the same file
282 std::ofstream outputFile(pmap_path);
283 if (!outputFile) {
284 ATH_MSG_ERROR("Error: Unable to open file for writing: " << pmap_path);
285 return StatusCode::FAILURE;
286 }
287
288 outputFile << newContent;
289 outputFile.close();
290
291 return StatusCode::SUCCESS;
292}
std::string makeRmapLines(std::vector< FPGATrackSimHit > const &hits, SiliconTech det, DetectorZone bec, int max)

◆ writeRadiiFile()

StatusCode FPGATrackSimMapMakerAlg::writeRadiiFile ( std::vector< FPGATrackSimHit > const & allHits)
private

Definition at line 555 of file FPGATrackSimMapMakerAlg.cxx.

556{
557 // calculate mean radii.
558 m_radii.resize(m_nSlices.value(), std::vector<std::vector<float>>(m_planes2->size(),std::vector<float>(0)));
559 for (const auto& hit: allHits)
560 {
561 SiliconTech det = hit.getDetType();
562 DetectorZone bec = hit.getDetectorZone();
563 int lyr = hit.getPhysLayer();
564 int slice = m_track2slice[hit.getEventIndex()];
565 int plane = -1;
566 if (det == SiliconTech::pixel && bec == DetectorZone::barrel) plane = findPlane(m_planes2, "pb" + std::to_string(lyr));
567 if (det == SiliconTech::pixel && bec == DetectorZone::posEndcap) plane = findPlane(m_planes2, "pe" + std::to_string(lyr) + "+");
568 if (det == SiliconTech::pixel && bec == DetectorZone::negEndcap) plane = findPlane(m_planes2, "pe" + std::to_string(lyr) + "-");
569 if (det == SiliconTech::strip && bec == DetectorZone::barrel) plane = findPlane(m_planes2, "sb" + std::to_string(lyr));
570 if (det == SiliconTech::strip && bec == DetectorZone::posEndcap) plane = findPlane(m_planes2, "se" + std::to_string(lyr) + "+");
571 if (det == SiliconTech::strip && bec == DetectorZone::negEndcap) plane = findPlane(m_planes2, "se" + std::to_string(lyr) + "-");
572
573 if (plane != -1) {
574 m_radii[slice][plane].push_back(hit.getR());
575 }
576 }
577
578 // print file
579 std::string radii_path = m_outFileName.value() + "region" + std::to_string(m_region) + "_radii.txt";
580
581 ATH_MSG_INFO("Creating radii file: " << radii_path);
582 m_radfile.open(radii_path, std::ofstream::out);
583 for (int s = 0; s < m_nSlices.value(); s++){
584 m_radfile << std::to_string(s) << " ";
585 for (unsigned p = 0; p < (m_planes2)->size(); p++){
586 if (m_radii[s][p].size() != 0){
587 // "If left to type inference, op operates on values of the same type as
588 // init which can result in unwanted casting of the iterator elements."
589 // https://en.cppreference.com/w/cpp/algorithm/accumulate
590 float avg = std::accumulate(m_radii[s][p].begin(), m_radii[s][p].end(), 0.0f) / float(m_radii[s][p].size());
591 m_radfile << std::setprecision(3) << std::fixed << avg << " ";
592 } else {
593 int avg = -1;
594 m_radfile << avg << " ";
595 }
596 }
597 m_radfile << "\n";
598 }
599
600 // Calculate global mean radii by reversing the order of the above two loops.
601 m_radfile << -1 << " ";
602 for (unsigned p = 0; p < (m_planes2)->size(); p++) {
603 float avg = 0;
604 int count = 0;
605 for (int s = 0; s < m_nSlices.value(); s++) {
606 if (m_radii[s][p].size() != 0) {
607 avg = std::accumulate(m_radii[s][p].begin(), m_radii[s][p].end(), avg);
608 count += m_radii[s][p].size();
609 }
610 }
611 if (count > 0) {
612 avg /= float(count);
613 m_radfile << std::setprecision(3) << std::fixed << avg << " ";
614 } else {
615 m_radfile << -1 << " ";
616 }
617 }
618 m_radfile << std::endl;
619
620 m_radfile.close();
621
622 return StatusCode::SUCCESS;
623}
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
avg(a, b)
Definition Recovery.py:79

◆ writeSubrmap()

StatusCode FPGATrackSimMapMakerAlg::writeSubrmap ( std::vector< FPGATrackSimHit > const & allHits)
private

Definition at line 294 of file FPGATrackSimMapMakerAlg.cxx.

295{
296 /* ---------- Create z-slices ---------- */
297
298 // BEFORE DOING ANYTHING ELSE, apply global trimming to m_key_etamods.
299 std::set<int> key_etamods;
300 // First, sum up the total number of hits in the key layer. There should be a one-liner for this...
301 float total_hits = 0;
302 for (auto const &etamod : m_key_etamods) {
303 total_hits += etamod.second;
304 }
305 ATH_MSG_INFO("Found " << total_hits << " hits in the key layer, applying global trim factor of " << m_globalTrim << "%");
306 if (total_hits == 0)[[unlikely]]{
307 ATH_MSG_ERROR("FPGATrackSimMapMakerAlg::writeSubrmap: Failure due to zero total hits.");
308 return StatusCode::FAILURE;
309 }
310 // Then, do the trim.
311 for (auto const &etamod : m_key_etamods) {
312 if (m_globalTrim == 0 || ((etamod.second / total_hits) >= m_globalTrim*0.01)) {
313 key_etamods.insert(etamod.first);
314 } else {
315 ATH_MSG_INFO("Eta module " << etamod.first << " only contains " << etamod.second << " out of " << total_hits << " hits, excluding from slices.");
316 }
317 }
318
319 if (m_nSlices.value() == -1) m_nSlices.value() = key_etamods.size(); //default is full granularity slicing
320 float etasPerSlice = float(key_etamods.size())/m_nSlices.value();
321 std::vector<std::vector<int>> key_modules_for_slices; // indexed by slice, holds module eta values
322
323 // easier to use vector than set, convert m_key_etamods into key_etas
324 std::vector<int> key_etas;
325 std::vector<int> key_etas2; // used if 2D slicing
326 key_etas.insert(key_etas.end(), key_etamods.begin(), key_etamods.end());
327
328 for (unsigned i = 0; i < key_etas.size(); i++)
329 {
330 if (i >= (key_modules_for_slices.size() * etasPerSlice)) key_modules_for_slices.push_back(std::vector<int>());
331 key_modules_for_slices.back().push_back(key_etas[i]);
332 }
333
334 std::map<int, int> keymod2slice;
335 for (unsigned s = 0; s < key_modules_for_slices.size(); s++)
336 for (unsigned e = 0; e < key_modules_for_slices[s].size(); e++)
337 keymod2slice[key_modules_for_slices[s][e]] = s;
338
339 std::string key = m_keystring.value();
340 key.erase(std::remove(key.begin(), key.end(), ','), key.end());
341 key.erase(std::remove(key.begin(), key.end(), ' '), key.end());
342 std::string key2 = m_keystring2.value();
343 key2.erase(std::remove(key2.begin(), key2.end(), ','), key2.end());
344 key2.erase(std::remove(key2.begin(), key2.end(), ' '), key2.end());
345
346 ATH_MSG_INFO("Doing z-slicing");
347 if (key_etamods.size() == 0) ATH_MSG_ERROR("Found 0 slices using the keystring: '" << m_keystring << "'");
348 ATH_MSG_INFO("Nslices = " << std::to_string(m_nSlices.value()) << ":");
349
350 std::stringstream eta_slices;
351 for (unsigned s = 0; s < key_modules_for_slices.size(); s++){
352 for (unsigned e = 0; e < key_modules_for_slices[s].size(); e++){
353 eta_slices << key_modules_for_slices[s][e] << " ";
354 }
355 eta_slices << ", ";
356 }
357 ATH_MSG_INFO(eta_slices.str());
358
359 // 2D key layer slicing
360 if (m_key2)
361 { // make new slices from combinations of keylayer1 slices and keylayer2 slices
362
363 /*------------- setup keylayer2 keymodule to slice map -------------- */
364 std::vector<std::vector<int>> key_modules_for_slices2;
365 float etasPerSlice2 = float(m_key_etamods2.size())/m_nSlices.value();
366 key_etas2.insert(key_etas2.end(), m_key_etamods2.begin(), m_key_etamods2.end());
367 for (unsigned i = 0; i < key_etas2.size(); i++)
368 {
369 if (i >= (key_modules_for_slices2.size() * etasPerSlice2)) key_modules_for_slices2.push_back(std::vector<int>());
370 key_modules_for_slices2.back().push_back(key_etas2[i]);
371 }
372
373 std::map<int, int> keymod2slice2;
374 for (unsigned s = 0; s < key_modules_for_slices2.size(); s++)
375 for (unsigned e = 0; e < key_modules_for_slices2[s].size(); e++)
376 keymod2slice2[key_modules_for_slices2[s][e]] = s;
377 /*----------------------------------------------------------------- */
378
379 int new_nSlice = m_nSlices.value();
380 for (int s1 = 0; s1 < m_nSlices.value(); s1++){ // loop over keylayer1's slices
381 for (int s2 = 0; s2 < m_nSlices.value(); s2++){ // loop over keylayer2's slices
382
383 for (auto& pair: m_track2modules) // track loop
384 {
385 if (m_usedTracks.find(pair.first) != m_usedTracks.end()) continue; // skip if already assigned a slice to this track
386 bool key1 = false;
387 bool key2 = false;
388 for (auto& m: pair.second) // module loop
389 {
390 if (isOnKeyLayer(1,m->det,m->bec,m->lyr))
391 if (keymod2slice[m->eta] == s1) key1 = true;
392
393 if (isOnKeyLayer(2,m->det,m->bec,m->lyr))
394 if (keymod2slice2[m->eta] == s2) key2 = true;
395 }
396
397 if (key1 && key2)
398 {
399 int newSlice = m_nSlices.value()*s1 + s2;
400 m_track2slice[pair.first] = newSlice;
401 m_usedTracks.insert(pair.first);
402 if (newSlice + 1 > new_nSlice) new_nSlice = newSlice + 1; // find max slice, to set new total number of slices
403 }
404 }
405 }
406 }
407 m_nSlices.value() = new_nSlice;
408 ATH_MSG_INFO("These slices were further divided based on the key layer 2: '" << key2 << "'. Now nSlices = " << m_nSlices.value());
409 ATH_MSG_INFO("Using " << m_usedTracks.size() << " tracks out of " << m_maxEvents << ". The rest were missing a hit in one or both of the key layers");
410 }
411
412
413 // 1D key layer slicing
414 else
415 {
416 for (const FPGATrackSimHit& hit: allHits) // Fill the track to slice map
417 {
418 if (m_usedTracks.find(hit.getEventIndex()) != m_usedTracks.end()) continue; // skip if already done a hit from this track
419 if (isOnKeyLayer(1,hit.getDetType(),hit.getDetectorZone(), hit.getPhysLayer()))
420 { // if hit is in key layer, add it's barcode to the map
421 if (keymod2slice.count(hit.getEtaModule()) > 0) {
422 int s = keymod2slice[hit.getEtaModule()];
423 m_track2slice[hit.getEventIndex()] = s;
424 m_usedTracks.insert(hit.getEventIndex());
425 }
426 }
427 }
428 ATH_MSG_INFO("Using " << m_usedTracks.size() << " tracks out of " << m_maxEvents << ". The rest missed the key layer");
429 }
430
431 std::string subrmap_path = m_outFileName.value() + "region" + std::to_string(m_region) + ".subrmap";
432
433 ATH_MSG_INFO("Creating subrmap: " << subrmap_path);
434 m_subrmap.open(subrmap_path, std::ofstream::out);
435 m_subrmap << "towers " << m_nSlices.value() << " phi 16\n\n";
436
437 // Resize numTracks vector to be equal to the number of slices
438 // Now that this just stores module pointers we could loop over m_modules instead.
439 for (auto& pair: m_track2modules) {
440 for (Module* m: pair.second) {
441 if (m->numTracks.empty()) {
442 m->numTracks.resize(m_nSlices.value(), 0);
443 }
444 }
445 }
446
447
448 // Count tracks per slice
449 ATH_MSG_INFO("Counting number of tracks per slice.");
450 std::vector<std::vector<int>> slicedTracks (m_nSlices.value()); // vector of tracks, indexed by slice
451 for (auto trk: m_usedTracks) {
452 int s = m_track2slice[trk];
453 slicedTracks[s].push_back(trk);
454 std::vector<Module*> mods = m_track2modules[trk];
455 for (Module* mod: mods) {
456 mod->numTracks[s]++;
457 }
458 }
459
460 if (m_drawSlices)
461 drawSlices(allHits);
462
463 // Now do trimming and Fill slice2module map
464 int trimmed = 0;
465 for (int s = 0; s < m_nSlices.value(); s++) {
466 ATH_MSG_INFO("Applying local trimming in slice " << s);
467 for (auto trk : slicedTracks[s]) {
468 auto it = std::remove_if (m_track2modules[trk].begin(),
469 m_track2modules[trk].end(),
470 [&] (const Module* m) {
471 return 100 * ( float(m->numTracks[s]) / float(slicedTracks[s].size()) ) < m_trim;
472 });
473 trimmed += m_track2modules[trk].end() - it;
474 m_track2modules[trk].erase (it, m_track2modules[trk].end());
475
476 ATH_MSG_DEBUG("About to query trk2slice");
477 int s = m_track2slice[trk];
478 ATH_MSG_DEBUG("Queried trk2slice.");
479 // add all modules from track to slices
480 if (m_track2modules[trk].size() > 0) {
481 ATH_MSG_DEBUG("About to insert trk2modules");
483 ATH_MSG_DEBUG("Inserted trk2modules.");
484 }
485 }
486 }
487 ATH_MSG_INFO("Trimmed off " << trimmed << " modules that were hit by less than " << m_trim << "% of tracks");
488
489 /* ---------- Print z-slice map ---------- */
490
491 for (int s = 0; s < m_nSlices.value(); s++)
492 {
493 m_subrmap << s << "\n";
497
501 m_subrmap << "\n\n";
502 }
503
504 m_subrmap.close();
505 return StatusCode::SUCCESS;
506}
Gaudi::Property< float > m_trim
std::string makeSubrmapLines(std::vector< Module * > const &allmods, SiliconTech det, DetectorZone bec, int max)
Gaudi::Property< float > m_globalTrim
Gaudi::Property< bool > m_drawSlices
Gaudi::Property< int > m_maxEvents
void drawSlices(std::vector< FPGATrackSimHit > const &allHits)
etamod(flags, cells_name, *args, **kw)
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
#define unlikely(x)

Member Data Documentation

◆ m_allHits

std::vector<FPGATrackSimHit> FPGATrackSimMapMakerAlg::m_allHits
private

Definition at line 104 of file FPGATrackSimMapMakerAlg.h.

◆ m_bec2zone

std::map<std::string, DetectorZone> FPGATrackSimMapMakerAlg::m_bec2zone = { {"barrel",DetectorZone::barrel}, {"posEndcap",DetectorZone::posEndcap}, {"negEndcap",DetectorZone::negEndcap} }
private

Definition at line 186 of file FPGATrackSimMapMakerAlg.h.

186{ {"barrel",DetectorZone::barrel}, {"posEndcap",DetectorZone::posEndcap}, {"negEndcap",DetectorZone::negEndcap} };

◆ m_description

Gaudi::Property<std::string> FPGATrackSimMapMakerAlg::m_description {this, "description", "", "tag description"}
private

Definition at line 90 of file FPGATrackSimMapMakerAlg.h.

90{this, "description", "", "tag description"};

◆ m_det2tech

std::map<std::string, SiliconTech> FPGATrackSimMapMakerAlg::m_det2tech = { {"pixel",SiliconTech::pixel}, {"strip",SiliconTech::strip} }
private

Definition at line 185 of file FPGATrackSimMapMakerAlg.h.

185{ {"pixel",SiliconTech::pixel}, {"strip",SiliconTech::strip} }; // for parsing KeyString

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_diskIndex

const std::vector<uint32_t> FPGATrackSimMapMakerAlg::m_diskIndex = {0,17,47,58,66}
private

Definition at line 174 of file FPGATrackSimMapMakerAlg.h.

174{0,17,47,58,66}; // number of disks per layer in ATLAS-P2-ITK-22-02-00: [17, 30, 11, 8, 9] --> [0,17,47,58,66]

◆ m_drawSlices

Gaudi::Property<bool> FPGATrackSimMapMakerAlg::m_drawSlices {this, "drawSlices", false, "Draw the huge 2D slice histograms"}
private

Definition at line 93 of file FPGATrackSimMapMakerAlg.h.

93{this, "drawSlices", false, "Draw the huge 2D slice histograms"};

◆ m_etapat

std::ofstream FPGATrackSimMapMakerAlg::m_etapat
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.

◆ m_eventHeader

FPGATrackSimEventInputHeader FPGATrackSimMapMakerAlg::m_eventHeader
private

Definition at line 52 of file FPGATrackSimMapMakerAlg.h.

◆ m_evtSel

ServiceHandle<IFPGATrackSimEventSelectionSvc> FPGATrackSimMapMakerAlg::m_evtSel {this, "eventSelector", "", "Event selection Svc"}
private

Definition at line 50 of file FPGATrackSimMapMakerAlg.h.

50{this, "eventSelector", "", "Event selection Svc"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_geoTag

Gaudi::Property<std::string> FPGATrackSimMapMakerAlg::m_geoTag {this, "GeometryVersion", "ATLAS-P2-ITK-22-02-00", "Geometry tag that this set of maps is for. TODO can we store/read from wrappers?"}
private

Definition at line 91 of file FPGATrackSimMapMakerAlg.h.

91{this, "GeometryVersion", "ATLAS-P2-ITK-22-02-00", "Geometry tag that this set of maps is for. TODO can we store/read from wrappers?"};

◆ m_globalTrim

Gaudi::Property<float> FPGATrackSimMapMakerAlg::m_globalTrim {this, "globalTrim", 0.1, "Trimming applied globally to the key layer before determining slice boundaries"}
private

Definition at line 89 of file FPGATrackSimMapMakerAlg.h.

89{this, "globalTrim", 0.1, "Trimming applied globally to the key layer before determining slice boundaries"};

◆ m_hitInputTool

ToolHandle<IFPGATrackSimEventInputHeaderTool> FPGATrackSimMapMakerAlg::m_hitInputTool { this, "InputTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimInputTool", "HitInput Tool" }
private

Definition at line 47 of file FPGATrackSimMapMakerAlg.h.

47{ this, "InputTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimInputTool", "HitInput Tool" };

◆ m_hitSGInputTool

ToolHandle<IFPGATrackSimInputTool> FPGATrackSimMapMakerAlg::m_hitSGInputTool {this, "SGInputTool", "", "Input tool from SG"}
private

Definition at line 48 of file FPGATrackSimMapMakerAlg.h.

48{this, "SGInputTool", "", "Input tool from SG"};

◆ m_key2

bool FPGATrackSimMapMakerAlg::m_key2 = false
private

Definition at line 162 of file FPGATrackSimMapMakerAlg.h.

◆ m_key_etamods

std::map<int, int> FPGATrackSimMapMakerAlg::m_key_etamods
private

Definition at line 163 of file FPGATrackSimMapMakerAlg.h.

◆ m_key_etamods2

std::set<int> FPGATrackSimMapMakerAlg::m_key_etamods2
private

Definition at line 164 of file FPGATrackSimMapMakerAlg.h.

◆ m_keylayer

std::map<std::string, std::set<int> > FPGATrackSimMapMakerAlg::m_keylayer
private

Definition at line 159 of file FPGATrackSimMapMakerAlg.h.

◆ m_keylayer2

std::map<std::string, std::set<int> > FPGATrackSimMapMakerAlg::m_keylayer2
private

Definition at line 160 of file FPGATrackSimMapMakerAlg.h.

◆ m_keystring

Gaudi::Property<std::string> FPGATrackSimMapMakerAlg::m_keystring {this, "KeyString", "strip,barrel,2", "key layer to use for subrmap"}
private

Definition at line 86 of file FPGATrackSimMapMakerAlg.h.

86{this, "KeyString", "strip,barrel,2", "key layer to use for subrmap"};

◆ m_keystring2

Gaudi::Property<std::string> FPGATrackSimMapMakerAlg::m_keystring2 {this, "KeyString2", "", "second key layer for 2D slicing"}
private

Definition at line 87 of file FPGATrackSimMapMakerAlg.h.

87{this, "KeyString2", "", "second key layer for 2D slicing"};

◆ m_maxEvents

Gaudi::Property<int> FPGATrackSimMapMakerAlg::m_maxEvents {this, "maxEvents", 10000, "Max Events"}
private

Definition at line 82 of file FPGATrackSimMapMakerAlg.h.

82{this, "maxEvents", 10000, "Max Events"};

◆ m_moduleRelabel

FPGATrackSimModuleRelabel* FPGATrackSimMapMakerAlg::m_moduleRelabel = nullptr
private

Definition at line 96 of file FPGATrackSimMapMakerAlg.h.

◆ m_modules

std::map<FPGATrackSimModuleId, Module> FPGATrackSimMapMakerAlg::m_modules
private

Definition at line 99 of file FPGATrackSimMapMakerAlg.h.

◆ m_monitorFile

std::unique_ptr<TFile> FPGATrackSimMapMakerAlg::m_monitorFile {}
private

Definition at line 170 of file FPGATrackSimMapMakerAlg.h.

170{};

◆ m_nSlices

Gaudi::Property<int> FPGATrackSimMapMakerAlg::m_nSlices {this, "nSlices", -1, "default is full granularity/maximum number of slices possible"}
private

Definition at line 88 of file FPGATrackSimMapMakerAlg.h.

88{this, "nSlices", -1, "default is full granularity/maximum number of slices possible"};

◆ m_outFileName

Gaudi::Property<std::string> FPGATrackSimMapMakerAlg::m_outFileName {this, "OutFileName", "", "naming convention for maps"}
private

Definition at line 85 of file FPGATrackSimMapMakerAlg.h.

85{this, "OutFileName", "", "naming convention for maps"};

◆ m_overridePlanes

Gaudi::Property<std::vector<std::vector<std::string> > > FPGATrackSimMapMakerAlg::m_overridePlanes {this, "planes", m_planes_generic, "Logical layer assignments" }
private

Definition at line 156 of file FPGATrackSimMapMakerAlg.h.

156{this, "planes", m_planes_generic, "Logical layer assignments" };
const std::vector< std::vector< std::string > > m_planes_generic

◆ m_overridePlanes2

Gaudi::Property<std::vector<std::vector<std::string> > > FPGATrackSimMapMakerAlg::m_overridePlanes2 {this, "planes2", m_planes2_generic, "Logical layer assignments" }
private

Definition at line 157 of file FPGATrackSimMapMakerAlg.h.

157{this, "planes2", m_planes2_generic, "Logical layer assignments" };
const std::vector< std::vector< std::string > > m_planes2_generic

◆ m_pbHits

std::vector<FPGATrackSimHit> FPGATrackSimMapMakerAlg::m_pbHits
private

Definition at line 104 of file FPGATrackSimMapMakerAlg.h.

◆ m_pbmax

int FPGATrackSimMapMakerAlg::m_pbmax = -1
private

Definition at line 106 of file FPGATrackSimMapMakerAlg.h.

◆ m_peHits

std::vector<FPGATrackSimHit> FPGATrackSimMapMakerAlg::m_peHits
private

Definition at line 104 of file FPGATrackSimMapMakerAlg.h.

◆ m_pemax

std::vector<int> FPGATrackSimMapMakerAlg::m_pemax = {-1,-1}
private

Definition at line 108 of file FPGATrackSimMapMakerAlg.h.

108{-1,-1}; // [positive endcap maxLayer, negative endcap maxLayer]

◆ m_planes

const std::vector<std::vector<std::string> >* FPGATrackSimMapMakerAlg::m_planes {}
private

Definition at line 118 of file FPGATrackSimMapMakerAlg.h.

118{};

◆ m_planes2

const std::vector<std::vector<std::string> >* FPGATrackSimMapMakerAlg::m_planes2 {}
private

Definition at line 119 of file FPGATrackSimMapMakerAlg.h.

119{};

◆ m_planes2_generic

const std::vector<std::vector<std::string> > FPGATrackSimMapMakerAlg::m_planes2_generic
private
Initial value:
= {
{"pb0", "pe0+","pe1+","pe2+","pe3+","pe4+","pe5+", "pe6+", "pe7+", "pe8+", "pe9+","pe10+","pe11+", "pe12+", "pe13+", "pe14+", "pe15+", "pe16+", },
{"pb1", "pe19+", "pe23+", "pe25+", },
{"pb2", "pe31+", "pe32+", "pe33+", "pe34+", "pe35+", "pe36+", "pe37+", "pe38+", "pe39+", "pe40+",
"pe41+", "pe42+", "pe43+", "pe44+", "pe45+", "pe46+",
"pe47+", "pe48+", "pe49+", "pe50+", "pe51+", "pe52+", "pe53+", "pe54+", "pe55+", "pe56+", },
{"pb3", "pe57+","pe58+","pe59+", "pe60+", "pe61+", "pe62+", "pe63+", "pe64+", "pe65+", "pe66+","pe67+","pe68+","pe69+"},
{"pb4", "pe70+","pe71+","pe72+", "pe73+", "pe74+", "pe75+", "pe76+", "pe77+", "pe78+", "pe79+",
"pe80+","pe81+","pe82+", "pe83+", "pe84+", "pe85+", "pe86+", "pe87+", "pe88+", "pe89+",},
{"sb0", "se4+", "se0+"},
{"sb1", "se5+", "se1+"},
{"sb2", "se6+", "se2+"},
{"sb3", "se7+", "se3+"},
{"sb4", "se8+"},
{"sb5", "se9+"},
{"sb6", "se10+"},
{"sb7", "se11+"}
}

Definition at line 136 of file FPGATrackSimMapMakerAlg.h.

136 {
137 {"pb0", "pe0+","pe1+","pe2+","pe3+","pe4+","pe5+", "pe6+", "pe7+", "pe8+", "pe9+","pe10+","pe11+", "pe12+", "pe13+", "pe14+", "pe15+", "pe16+", },
138 {"pb1", "pe19+", "pe23+", "pe25+", },
139 {"pb2", "pe31+", "pe32+", "pe33+", "pe34+", "pe35+", "pe36+", "pe37+", "pe38+", "pe39+", "pe40+",
140 "pe41+", "pe42+", "pe43+", "pe44+", "pe45+", "pe46+",
141 "pe47+", "pe48+", "pe49+", "pe50+", "pe51+", "pe52+", "pe53+", "pe54+", "pe55+", "pe56+", },
142 {"pb3", "pe57+","pe58+","pe59+", "pe60+", "pe61+", "pe62+", "pe63+", "pe64+", "pe65+", "pe66+","pe67+","pe68+","pe69+"},
143 {"pb4", "pe70+","pe71+","pe72+", "pe73+", "pe74+", "pe75+", "pe76+", "pe77+", "pe78+", "pe79+",
144 "pe80+","pe81+","pe82+", "pe83+", "pe84+", "pe85+", "pe86+", "pe87+", "pe88+", "pe89+",},
145 {"sb0", "se4+", "se0+"},
146 {"sb1", "se5+", "se1+"},
147 {"sb2", "se6+", "se2+"},
148 {"sb3", "se7+", "se3+"},
149 {"sb4", "se8+"},
150 {"sb5", "se9+"},
151 {"sb6", "se10+"},
152 {"sb7", "se11+"}
153 };

◆ m_planes_generic

const std::vector<std::vector<std::string> > FPGATrackSimMapMakerAlg::m_planes_generic
private
Initial value:
= {
{"pb0", "pe0+","pe1+","pe2+","pe3+","pe4+","pe5+", "pe6+", "pe7+", "pe8+", "pe9+","pe10+","pe11+", "pe12+", "pe13+", "pe14+", "pe15+", "pe16+", },
{"pb1", "pe19+", "pe23+", "pe25+", },
{"pb2", "pe31+", "pe32+", "pe33+", "pe34+", "pe35+", "pe36+", "pe37+", "pe38+", "pe39+", "pe40+",
"pe41+", "pe42+", "pe43+", "pe44+", "pe45+", "pe46+",
"pe47+", "pe48+", "pe49+", "pe50+", "pe51+", "pe52+", "pe53+", "pe54+", "pe55+", "pe56+", },
{"pb3", "pe57+","pe58+","pe59+", "pe60+", "pe61+", "pe62+", "pe63+", "pe64+", "pe65+", "pe66+","pe67+","pe68+","pe69+"},
{"pb4", "pe70+","pe71+","pe72+", "pe73+", "pe74+", "pe75+", "pe76+", "pe77+", "pe78+", "pe79+",
"pe80+","pe81+","pe82+", "pe83+", "pe84+", "pe85+", "pe86+", "pe87+", "pe88+", "pe89+",}
}

Definition at line 124 of file FPGATrackSimMapMakerAlg.h.

124 {
125 {"pb0", "pe0+","pe1+","pe2+","pe3+","pe4+","pe5+", "pe6+", "pe7+", "pe8+", "pe9+","pe10+","pe11+", "pe12+", "pe13+", "pe14+", "pe15+", "pe16+", },
126 {"pb1", "pe19+", "pe23+", "pe25+", },
127 {"pb2", "pe31+", "pe32+", "pe33+", "pe34+", "pe35+", "pe36+", "pe37+", "pe38+", "pe39+", "pe40+",
128 "pe41+", "pe42+", "pe43+", "pe44+", "pe45+", "pe46+",
129 "pe47+", "pe48+", "pe49+", "pe50+", "pe51+", "pe52+", "pe53+", "pe54+", "pe55+", "pe56+", },
130 {"pb3", "pe57+","pe58+","pe59+", "pe60+", "pe61+", "pe62+", "pe63+", "pe64+", "pe65+", "pe66+","pe67+","pe68+","pe69+"},
131 {"pb4", "pe70+","pe71+","pe72+", "pe73+", "pe74+", "pe75+", "pe76+", "pe77+", "pe78+", "pe79+",
132 "pe80+","pe81+","pe82+", "pe83+", "pe84+", "pe85+", "pe86+", "pe87+", "pe88+", "pe89+",}
133 };

◆ m_pmap

std::ofstream FPGATrackSimMapMakerAlg::m_pmap
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.

◆ m_radfile

std::ofstream FPGATrackSimMapMakerAlg::m_radfile
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.

◆ m_radii

std::vector<std::vector < std::vector<float> > > FPGATrackSimMapMakerAlg::m_radii
private

Definition at line 166 of file FPGATrackSimMapMakerAlg.h.

◆ m_region

Gaudi::Property<int> FPGATrackSimMapMakerAlg::m_region {this, "region", 0, "Region"}
private

Definition at line 83 of file FPGATrackSimMapMakerAlg.h.

83{this, "region", 0, "Region"};

◆ m_remapModules

Gaudi::Property<bool> FPGATrackSimMapMakerAlg::m_remapModules {this, "remapModules", false, "Allow maps to be drawn that slice modules more finely, by remapping module indices"}
private

Definition at line 92 of file FPGATrackSimMapMakerAlg.h.

92{this, "remapModules", false, "Allow maps to be drawn that slice modules more finely, by remapping module indices"};

◆ m_rmap

std::ofstream FPGATrackSimMapMakerAlg::m_rmap
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.

◆ m_sbHits

std::vector<FPGATrackSimHit> FPGATrackSimMapMakerAlg::m_sbHits
private

Definition at line 104 of file FPGATrackSimMapMakerAlg.h.

◆ m_sbmax

int FPGATrackSimMapMakerAlg::m_sbmax = -1
private

Definition at line 107 of file FPGATrackSimMapMakerAlg.h.

◆ m_seHits

std::vector<FPGATrackSimHit> FPGATrackSimMapMakerAlg::m_seHits
private

Definition at line 104 of file FPGATrackSimMapMakerAlg.h.

◆ m_semax

std::vector<int> FPGATrackSimMapMakerAlg::m_semax = {-1,-1}
private

Definition at line 109 of file FPGATrackSimMapMakerAlg.h.

109{-1,-1};

◆ m_slice2modules

std::map<int, std::vector<Module*> > FPGATrackSimMapMakerAlg::m_slice2modules
private

Definition at line 100 of file FPGATrackSimMapMakerAlg.h.

◆ m_subrmap

std::ofstream FPGATrackSimMapMakerAlg::m_subrmap
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.

◆ m_track2modules

std::map<int, std::vector<Module*> > FPGATrackSimMapMakerAlg::m_track2modules
private

Definition at line 100 of file FPGATrackSimMapMakerAlg.h.

◆ m_track2slice

std::map<int, int> FPGATrackSimMapMakerAlg::m_track2slice
private

Definition at line 101 of file FPGATrackSimMapMakerAlg.h.

◆ m_trim

Gaudi::Property<float> FPGATrackSimMapMakerAlg::m_trim {this, "trim", 0.1, "trim modules with less than given percent of tracks"}
private

Definition at line 84 of file FPGATrackSimMapMakerAlg.h.

84{this, "trim", 0.1, "trim modules with less than given percent of tracks"};

◆ m_usedTracks

std::set<int> FPGATrackSimMapMakerAlg::m_usedTracks
private

Definition at line 165 of file FPGATrackSimMapMakerAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z

std::vector<std::vector < std::vector<float> > > FPGATrackSimMapMakerAlg::m_z
private

Definition at line 167 of file FPGATrackSimMapMakerAlg.h.

◆ m_zedfile

std::ofstream FPGATrackSimMapMakerAlg::m_zedfile
private

Definition at line 169 of file FPGATrackSimMapMakerAlg.h.


The documentation for this class was generated from the following files: