|
ATLAS Offline Software
|
#include <FPGATrackSimDataFlowTool.h>
|
| FPGATrackSimDataFlowTool (std::string const &, std::string const &, IInterface const *) |
|
virtual | ~FPGATrackSimDataFlowTool ()=default |
|
virtual StatusCode | initialize () override |
|
StatusCode | calculateDataFlow (FPGATrackSimDataFlowInfo *info, FPGATrackSimLogicalEventInputHeader const *header_1st, std::vector< FPGATrackSimCluster > const &clusters_1st, const std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads_1st, std::vector< FPGATrackSimTrack > const &tracks_1st, const std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads_2nd, std::vector< FPGATrackSimTrack > const &tracks_2nd) |
|
StatusCode | getDataFlowInfo (FPGATrackSimDataFlowInfo const &info) |
|
virtual StatusCode | finalize () override |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | makeDataFlowTable () |
|
StatusCode | addDataFlow (float const n, std::string const &key, bool const isInt=true) |
|
StatusCode | printDataFlow (std::string const &key, int const div=1) |
|
void | addTableBreak (unsigned const n=1) |
|
void | findAndReplaceAll (std::string &data, std::string const &toFind, std::string const &replaceStr) const |
|
void | setMaxAcceptance (TH1 *h, double const max_frac, double &max_value) const |
|
double | roundTo (double const v, int const nSigDigits) const |
|
void | setHistDir (std::string const &dir) |
|
std::string const & | getHistDir () |
|
void | clearHistDir () |
|
StatusCode | regHist (std::string const &dir, TH1 *h) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
ServiceHandle< ITHistSvc > | m_tHistSvc {this,"THistSvc","THistSvc"} |
|
ServiceHandle< IFPGATrackSimMappingSvc > | m_FPGATrackSimMapping {this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"} |
|
ServiceHandle< IFPGATrackSimEventSelectionSvc > | m_evtSel {this,"FPGATrackSimEventSelectionSvc","FPGATrackSimEventSelectionSvc"} |
|
Gaudi::Property< bool > | m_runSecondStage {this, "RunSecondStage", false, "flag to enable running the second stage fitting"} |
|
Gaudi::Property< std::string > | m_outputtag {this, "outputTag", "", "Extra string to use in output folder names - default none"} |
|
Gaudi::Property< float > | m_cut_chi2ndof {this, "Chi2ndofCut", 40., "cut on Chi2 of FPGATrackSimTrack"} |
|
std::string const | m_dataFlowTxtName = "./dataflow.txt" |
|
std::string const | m_dataFlowTeXName = "./dataflow.tex" |
|
std::ofstream | m_dataFlowTxt |
|
std::ofstream | m_dataFlowTeX |
|
std::string | m_dir |
|
size_t | m_nEvents = 0 |
|
unsigned | m_nLayers_1st = 0U |
|
unsigned const | m_nSigDigits = 2 |
|
unsigned const | m_tableTypeWidth = 32 |
|
unsigned const | m_tableDataWidth = 9 |
|
double const | m_max_frac = 0.99 |
|
std::unordered_map< std::string, int > | m_dataFlowDataI_min |
|
std::unordered_map< std::string, int > | m_dataFlowDataI_max |
|
std::unordered_map< std::string, float > | m_dataFlowDataF_min |
|
std::unordered_map< std::string, float > | m_dataFlowDataF_max |
|
std::unordered_map< std::string, TH1I * > | m_dataFlowHistsI |
|
std::unordered_map< std::string, TH1F * > | m_dataFlowHistsF |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 26 of file FPGATrackSimDataFlowTool.h.
◆ StoreGateSvc_t
◆ FPGATrackSimDataFlowTool()
FPGATrackSimDataFlowTool::FPGATrackSimDataFlowTool |
( |
std::string const & |
algname, |
|
|
std::string const & |
name, |
|
|
IInterface const * |
ifc |
|
) |
| |
◆ ~FPGATrackSimDataFlowTool()
virtual FPGATrackSimDataFlowTool::~FPGATrackSimDataFlowTool |
( |
| ) |
|
|
virtualdefault |
◆ addDataFlow()
StatusCode FPGATrackSimDataFlowTool::addDataFlow |
( |
float const |
n, |
|
|
std::string const & |
key, |
|
|
bool const |
isInt = true |
|
) |
| |
|
private |
◆ addTableBreak()
void FPGATrackSimDataFlowTool::addTableBreak |
( |
unsigned const |
n = 1 | ) |
|
|
private |
◆ calculateDataFlow()
Definition at line 43 of file FPGATrackSimDataFlowTool.cxx.
49 for (
int i=0;
i<header_1st->towers().at(0).nHits();
i++) {
50 info->nMappedHits_1st_total++;
54 info->nClusters_1st_total = clusters_1st.size();
56 info->nRoads_1st_total = roads_1st.size();
57 for (
const auto &
r : roads_1st) {
62 std::unordered_map<int, size_t> pattID_nTracks_1st;
63 std::unordered_map<int, size_t> pattID_nTracks_1st_passChi2;
64 std::unordered_map<int, size_t> pattID_nTracks_1st_afterOR;
66 std::unordered_map<int, size_t> sectID_nTracks_1st;
67 std::unordered_map<int, size_t> sectID_nTracks_1st_passChi2;
68 std::unordered_map<int, size_t> sectID_nTracks_1st_afterOR;
70 info->nTracks_1st_total = tracks_1st.size();
73 info->nTracks_1st_passChi2++;
74 pattID_nTracks_1st_passChi2[
t.getPatternID()]++;
75 sectID_nTracks_1st_passChi2[
t.getFirstSectorID()]++;
77 if (
t.passedOR() == 1) {
78 info->nTracks_1st_afterOR++;
79 pattID_nTracks_1st_afterOR[
t.getPatternID()]++;
80 sectID_nTracks_1st_afterOR[
t.getFirstSectorID()]++;
82 pattID_nTracks_1st[
t.getPatternID()]++;
83 sectID_nTracks_1st[
t.getFirstSectorID()]++;
85 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st) {
86 info->nTracks_1st_per_patt_total.push_back(ntrack);
88 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_passChi2) {
89 info->nTracks_1st_per_patt_passChi2.push_back(ntrack);
91 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_afterOR) {
92 info->nTracks_1st_per_patt_afterOR.push_back(ntrack);
95 info->nConstants_1st_fitter = sectID_nTracks_1st.size();
96 info->nConstants_1st_passChi2 = sectID_nTracks_1st_passChi2.size();
97 info->nConstants_1st_afterOR = sectID_nTracks_1st_afterOR.size();
100 info->nRoads_2nd_total = roads_2nd.size();
102 std::unordered_map<int, size_t> sectID_nTracks_2nd;
103 std::unordered_map<int, size_t> sectID_nTracks_2nd_passChi2;
104 std::unordered_map<int, size_t> sectID_nTracks_2nd_afterOR;
106 info->nTracks_2nd_total = tracks_2nd.size();
109 info->nTracks_2nd_passChi2++;
110 sectID_nTracks_2nd_passChi2[
t.getSecondSectorID()]++;
112 if (
t.passedOR() == 1) {
113 info->nTracks_2nd_afterOR++;
114 sectID_nTracks_2nd_afterOR[
t.getSecondSectorID()]++;
116 sectID_nTracks_2nd[
t.getSecondSectorID()]++;
119 info->nConstants_2nd_fitter = sectID_nTracks_2nd.size();
120 info->nConstants_2nd_passChi2 = sectID_nTracks_2nd_passChi2.size();
121 info->nConstants_2nd_afterOR = sectID_nTracks_2nd_afterOR.size();
129 if (
m_evtSel->passCuts(offline_t))
info->nOfflineTracks++;
132 if (
info->nOfflineTracks > 0) {
133 info->nTracks_1st_over_nOfflineTracks = (
float)tracks_1st.size() / (
float)
info->nOfflineTracks;
139 return StatusCode::SUCCESS;
◆ clearHistDir()
void FPGATrackSimDataFlowTool::clearHistDir |
( |
| ) |
|
|
inlineprivate |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ finalize()
StatusCode FPGATrackSimDataFlowTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ findAndReplaceAll()
void FPGATrackSimDataFlowTool::findAndReplaceAll |
( |
std::string & |
data, |
|
|
std::string const & |
toFind, |
|
|
std::string const & |
replaceStr |
|
) |
| const |
|
private |
◆ getDataFlowInfo()
Definition at line 144 of file FPGATrackSimDataFlowTool.cxx.
166 for (
size_t n :
info.nTracks_1st_per_patt_total) {
169 for (
size_t n :
info.nTracks_1st_per_patt_passChi2) {
172 for (
size_t n :
info.nTracks_1st_per_patt_afterOR) {
196 if (
info.nOfflineTracks > 0) {
203 return StatusCode::SUCCESS;
◆ getHistDir()
std::string const& FPGATrackSimDataFlowTool::getHistDir |
( |
| ) |
|
|
inlineprivate |
◆ initialize()
StatusCode FPGATrackSimDataFlowTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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.
◆ makeDataFlowTable()
StatusCode FPGATrackSimDataFlowTool::makeDataFlowTable |
( |
| ) |
|
|
private |
Definition at line 208 of file FPGATrackSimDataFlowTool.cxx.
218 m_dataFlowTeX <<
"\\documentclass[12pt]{article}" << std::endl;
222 m_dataFlowTeX <<
"\\begin{tabular}{|c|c|c|c|c|c|c|}" << std::endl;
224 m_dataFlowTeX <<
"Type & Stage & Mean & RMS & RMS95 & Min & Max \\\\" << std::endl;
290 std::string str_sample;
293 switch (
m_evtSel->getSampleType()) {
297 default : str_sample =
"";
break;
300 str_PU =
m_evtSel->checkPU() ?
" with pile-up" :
"";
316 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ printDataFlow()
StatusCode FPGATrackSimDataFlowTool::printDataFlow |
( |
std::string const & |
key, |
|
|
int const |
div = 1 |
|
) |
| |
|
private |
Definition at line 405 of file FPGATrackSimDataFlowTool.cxx.
411 return StatusCode::SUCCESS;
424 std::string str_stage =
"", str_key =
key;
425 if (
key.find(
"_1st") != std::string::npos) {
427 str_key.erase(
key.find(
"_1st"), std::string(
"_1st").length());
429 else if (
key.find(
"_2nd") != std::string::npos) {
430 str_stage =
"SECOND";
431 str_key.erase(
key.find(
"_2nd"), std::string(
"_2nd").length());
434 str_stage =
"UNKNOWN";
437 double mean =
h->GetMean() / div;
438 double rms =
h->GetRMS() / div;
439 double rms95_n =
rms95(
h) / div;
453 std::string key_tex = str_key;
462 return StatusCode::SUCCESS;
◆ regHist()
StatusCode FPGATrackSimDataFlowTool::regHist |
( |
std::string const & |
dir, |
|
|
TH1 * |
h |
|
) |
| |
|
inlineprivate |
◆ renounce()
◆ renounceArray()
◆ roundTo()
double FPGATrackSimDataFlowTool::roundTo |
( |
double const |
v, |
|
|
int const |
nSigDigits |
|
) |
| const |
|
private |
Definition at line 503 of file FPGATrackSimDataFlowTool.cxx.
505 int sigDigit =
v != 0 ? trunc(log10(fabs(
v))) : 0;
506 if (nSigDigits >= 1) {
507 double factor =
pow(10., nSigDigits - sigDigit - 1);
508 return round(
v * factor) / factor;
◆ setHistDir()
void FPGATrackSimDataFlowTool::setHistDir |
( |
std::string const & |
dir | ) |
|
|
inlineprivate |
◆ setMaxAcceptance()
void FPGATrackSimDataFlowTool::setMaxAcceptance |
( |
TH1 * |
h, |
|
|
double const |
max_frac, |
|
|
double & |
max_value |
|
) |
| const |
|
private |
Definition at line 488 of file FPGATrackSimDataFlowTool.cxx.
490 double total =
h->Integral();
491 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
492 double partial =
h->Integral(1,
i);
493 if (partial / total > max_frac) {
494 max_value =
h->GetBinCenter(
i);
495 h->GetXaxis()->SetRange(1,
i);
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_cut_chi2ndof
Gaudi::Property<float> FPGATrackSimDataFlowTool::m_cut_chi2ndof {this, "Chi2ndofCut", 40., "cut on Chi2 of FPGATrackSimTrack"} |
|
private |
◆ m_dataFlowDataF_max
std::unordered_map<std::string, float> FPGATrackSimDataFlowTool::m_dataFlowDataF_max |
|
private |
◆ m_dataFlowDataF_min
std::unordered_map<std::string, float> FPGATrackSimDataFlowTool::m_dataFlowDataF_min |
|
private |
◆ m_dataFlowDataI_max
std::unordered_map<std::string, int> FPGATrackSimDataFlowTool::m_dataFlowDataI_max |
|
private |
◆ m_dataFlowDataI_min
std::unordered_map<std::string, int> FPGATrackSimDataFlowTool::m_dataFlowDataI_min |
|
private |
◆ m_dataFlowHistsF
std::unordered_map<std::string, TH1F*> FPGATrackSimDataFlowTool::m_dataFlowHistsF |
|
private |
◆ m_dataFlowHistsI
std::unordered_map<std::string, TH1I*> FPGATrackSimDataFlowTool::m_dataFlowHistsI |
|
private |
◆ m_dataFlowTeX
std::ofstream FPGATrackSimDataFlowTool::m_dataFlowTeX |
|
private |
◆ m_dataFlowTeXName
std::string const FPGATrackSimDataFlowTool::m_dataFlowTeXName = "./dataflow.tex" |
|
private |
◆ m_dataFlowTxt
std::ofstream FPGATrackSimDataFlowTool::m_dataFlowTxt |
|
private |
◆ m_dataFlowTxtName
std::string const FPGATrackSimDataFlowTool::m_dataFlowTxtName = "./dataflow.txt" |
|
private |
◆ m_detStore
◆ m_dir
std::string FPGATrackSimDataFlowTool::m_dir |
|
private |
◆ m_evtSel
◆ m_evtStore
◆ m_FPGATrackSimMapping
◆ m_max_frac
double const FPGATrackSimDataFlowTool::m_max_frac = 0.99 |
|
private |
◆ m_nEvents
size_t FPGATrackSimDataFlowTool::m_nEvents = 0 |
|
private |
◆ m_nLayers_1st
unsigned FPGATrackSimDataFlowTool::m_nLayers_1st = 0U |
|
private |
◆ m_nSigDigits
unsigned const FPGATrackSimDataFlowTool::m_nSigDigits = 2 |
|
private |
◆ m_outputtag
Gaudi::Property<std::string> FPGATrackSimDataFlowTool::m_outputtag {this, "outputTag", "", "Extra string to use in output folder names - default none"} |
|
private |
◆ m_runSecondStage
Gaudi::Property<bool> FPGATrackSimDataFlowTool::m_runSecondStage {this, "RunSecondStage", false, "flag to enable running the second stage fitting"} |
|
private |
◆ m_tableDataWidth
unsigned const FPGATrackSimDataFlowTool::m_tableDataWidth = 9 |
|
private |
◆ m_tableTypeWidth
unsigned const FPGATrackSimDataFlowTool::m_tableTypeWidth = 32 |
|
private |
◆ m_tHistSvc
ServiceHandle<ITHistSvc> FPGATrackSimDataFlowTool::m_tHistSvc {this,"THistSvc","THistSvc"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
char data[hepevt_bytes_allocation_ATLAS]
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
std::vector< Identifier > ID
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
float round(const float toRound, const unsigned int decimals)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual void setOwner(IDataHandleHolder *o)=0
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
constexpr unsigned count_ones(unsigned x)
Count number of set bits.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string to_string(const DetectorType &type)
double rms95(TH1 const *h)
This function is used to calculate RMS95 value for 1D histograms.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
constexpr int pow(int base, int exp) noexcept
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>