Loading [MathJax]/extensions/tex2jax.js
 |
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) {
58 if (std::popcount(
r->getHitLayers()) ==
static_cast<int>(
m_nLayers_1st) - 1)
59 info->nRoads_1st_7hits++;
60 if (std::popcount(
r->getHitLayers()) ==
static_cast<int>(
m_nLayers_1st))
61 info->nRoads_1st_8hits++;
64 std::unordered_map<int, size_t> pattID_nTracks_1st;
65 std::unordered_map<int, size_t> pattID_nTracks_1st_passChi2;
66 std::unordered_map<int, size_t> pattID_nTracks_1st_afterOR;
68 std::unordered_map<int, size_t> sectID_nTracks_1st;
69 std::unordered_map<int, size_t> sectID_nTracks_1st_passChi2;
70 std::unordered_map<int, size_t> sectID_nTracks_1st_afterOR;
72 info->nTracks_1st_total = tracks_1st.size();
75 info->nTracks_1st_passChi2++;
76 pattID_nTracks_1st_passChi2[
t.getPatternID()]++;
77 sectID_nTracks_1st_passChi2[
t.getFirstSectorID()]++;
79 if (
t.passedOR() == 1) {
80 info->nTracks_1st_afterOR++;
81 pattID_nTracks_1st_afterOR[
t.getPatternID()]++;
82 sectID_nTracks_1st_afterOR[
t.getFirstSectorID()]++;
84 pattID_nTracks_1st[
t.getPatternID()]++;
85 sectID_nTracks_1st[
t.getFirstSectorID()]++;
87 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st) {
88 info->nTracks_1st_per_patt_total.push_back(ntrack);
90 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_passChi2) {
91 info->nTracks_1st_per_patt_passChi2.push_back(ntrack);
93 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_afterOR) {
94 info->nTracks_1st_per_patt_afterOR.push_back(ntrack);
97 info->nConstants_1st_fitter = sectID_nTracks_1st.size();
98 info->nConstants_1st_passChi2 = sectID_nTracks_1st_passChi2.size();
99 info->nConstants_1st_afterOR = sectID_nTracks_1st_afterOR.size();
102 info->nRoads_2nd_total = roads_2nd.size();
104 std::unordered_map<int, size_t> sectID_nTracks_2nd;
105 std::unordered_map<int, size_t> sectID_nTracks_2nd_passChi2;
106 std::unordered_map<int, size_t> sectID_nTracks_2nd_afterOR;
108 info->nTracks_2nd_total = tracks_2nd.size();
111 info->nTracks_2nd_passChi2++;
112 sectID_nTracks_2nd_passChi2[
t.getSecondSectorID()]++;
114 if (
t.passedOR() == 1) {
115 info->nTracks_2nd_afterOR++;
116 sectID_nTracks_2nd_afterOR[
t.getSecondSectorID()]++;
118 sectID_nTracks_2nd[
t.getSecondSectorID()]++;
121 info->nConstants_2nd_fitter = sectID_nTracks_2nd.size();
122 info->nConstants_2nd_passChi2 = sectID_nTracks_2nd_passChi2.size();
123 info->nConstants_2nd_afterOR = sectID_nTracks_2nd_afterOR.size();
131 if (
m_evtSel->passCuts(offline_t))
info->nOfflineTracks++;
134 if (
info->nOfflineTracks > 0) {
135 info->nTracks_1st_over_nOfflineTracks = (
float)tracks_1st.size() / (
float)
info->nOfflineTracks;
141 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 146 of file FPGATrackSimDataFlowTool.cxx.
168 for (
size_t n :
info.nTracks_1st_per_patt_total) {
171 for (
size_t n :
info.nTracks_1st_per_patt_passChi2) {
174 for (
size_t n :
info.nTracks_1st_per_patt_afterOR) {
198 if (
info.nOfflineTracks > 0) {
205 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 210 of file FPGATrackSimDataFlowTool.cxx.
220 m_dataFlowTeX <<
"\\documentclass[12pt]{article}" << std::endl;
224 m_dataFlowTeX <<
"\\begin{tabular}{|c|c|c|c|c|c|c|}" << std::endl;
226 m_dataFlowTeX <<
"Type & Stage & Mean & RMS & RMS95 & Min & Max \\\\" << std::endl;
292 std::string str_sample;
295 switch (
m_evtSel->getSampleType()) {
299 default : str_sample =
"";
break;
302 str_PU =
m_evtSel->checkPU() ?
" with pile-up" :
"";
318 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 407 of file FPGATrackSimDataFlowTool.cxx.
413 return StatusCode::SUCCESS;
426 std::string str_stage =
"", str_key =
key;
427 if (
key.find(
"_1st") != std::string::npos) {
429 str_key.erase(
key.find(
"_1st"), std::string(
"_1st").length());
431 else if (
key.find(
"_2nd") != std::string::npos) {
432 str_stage =
"SECOND";
433 str_key.erase(
key.find(
"_2nd"), std::string(
"_2nd").length());
436 str_stage =
"UNKNOWN";
439 double mean =
h->GetMean() / div;
440 double rms =
h->GetRMS() / div;
441 double rms95_n =
rms95(
h) / div;
455 std::string key_tex = std::move(str_key);
464 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 505 of file FPGATrackSimDataFlowTool.cxx.
507 int sigDigit =
v != 0 ? trunc(log10(fabs(
v))) : 0;
508 if (nSigDigits >= 1) {
509 double factor =
pow(10., nSigDigits - sigDigit - 1);
510 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 490 of file FPGATrackSimDataFlowTool.cxx.
492 double total =
h->Integral();
493 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
494 double partial =
h->Integral(1,
i);
495 if (partial / total > max_frac) {
496 max_value =
h->GetBinCenter(
i);
497 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)
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>