|
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.
50 info->nMappedHits_1st_layer[hit.getLayer()]++;
51 info->nMappedHits_1st_total++;
56 info->nClusters_1st_layer[cluster.getClusterEquiv().getLayer()]++;
57 info->nClusters_1st_total = clusters_1st.size();
60 info->nRoads_1st_total = roads_1st.size();
61 for (
const auto &
r : roads_1st) {
66 std::unordered_map<int, size_t> pattID_nTracks_1st;
67 std::unordered_map<int, size_t> pattID_nTracks_1st_passChi2;
68 std::unordered_map<int, size_t> pattID_nTracks_1st_afterOR;
70 std::unordered_map<int, size_t> sectID_nTracks_1st;
71 std::unordered_map<int, size_t> sectID_nTracks_1st_passChi2;
72 std::unordered_map<int, size_t> sectID_nTracks_1st_afterOR;
74 info->nTracks_1st_total = tracks_1st.size();
77 info->nTracks_1st_passChi2++;
78 pattID_nTracks_1st_passChi2[
t.getPatternID()]++;
79 sectID_nTracks_1st_passChi2[
t.getFirstSectorID()]++;
81 if (
t.passedOR() == 1) {
82 info->nTracks_1st_afterOR++;
83 pattID_nTracks_1st_afterOR[
t.getPatternID()]++;
84 sectID_nTracks_1st_afterOR[
t.getFirstSectorID()]++;
86 pattID_nTracks_1st[
t.getPatternID()]++;
87 sectID_nTracks_1st[
t.getFirstSectorID()]++;
89 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st) {
90 info->nTracks_1st_per_patt_total.push_back(ntrack);
92 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_passChi2) {
93 info->nTracks_1st_per_patt_passChi2.push_back(ntrack);
95 for (
const auto& [
ID, ntrack]: pattID_nTracks_1st_afterOR) {
96 info->nTracks_1st_per_patt_afterOR.push_back(ntrack);
99 info->nConstants_1st_fitter = sectID_nTracks_1st.size();
100 info->nConstants_1st_passChi2 = sectID_nTracks_1st_passChi2.size();
101 info->nConstants_1st_afterOR = sectID_nTracks_1st_afterOR.size();
104 info->nRoads_2nd_total = roads_2nd.size();
106 std::unordered_map<int, size_t> sectID_nTracks_2nd;
107 std::unordered_map<int, size_t> sectID_nTracks_2nd_passChi2;
108 std::unordered_map<int, size_t> sectID_nTracks_2nd_afterOR;
110 info->nTracks_2nd_total = tracks_2nd.size();
113 info->nTracks_2nd_passChi2++;
114 sectID_nTracks_2nd_passChi2[
t.getSecondSectorID()]++;
116 if (
t.passedOR() == 1) {
117 info->nTracks_2nd_afterOR++;
118 sectID_nTracks_2nd_afterOR[
t.getSecondSectorID()]++;
120 sectID_nTracks_2nd[
t.getSecondSectorID()]++;
123 info->nConstants_2nd_fitter = sectID_nTracks_2nd.size();
124 info->nConstants_2nd_passChi2 = sectID_nTracks_2nd_passChi2.size();
125 info->nConstants_2nd_afterOR = sectID_nTracks_2nd_afterOR.size();
133 if (
m_evtSel->passCuts(offline_t))
info->nOfflineTracks++;
136 if (
info->nOfflineTracks > 0) {
137 info->nTracks_1st_over_nOfflineTracks = (
float)tracks_1st.size() / (
float)
info->nOfflineTracks;
143 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 148 of file FPGATrackSimDataFlowTool.cxx.
170 for (
size_t n :
info.nTracks_1st_per_patt_total) {
173 for (
size_t n :
info.nTracks_1st_per_patt_passChi2) {
176 for (
size_t n :
info.nTracks_1st_per_patt_afterOR) {
200 if (
info.nOfflineTracks > 0) {
207 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 212 of file FPGATrackSimDataFlowTool.cxx.
222 m_dataFlowTeX <<
"\\documentclass[12pt]{article}" << std::endl;
226 m_dataFlowTeX <<
"\\begin{tabular}{|c|c|c|c|c|c|c|}" << std::endl;
228 m_dataFlowTeX <<
"Type & Stage & Mean & RMS & RMS95 & Min & Max \\\\" << std::endl;
294 std::string str_sample;
297 switch (
m_evtSel->getSampleType()) {
301 default : str_sample =
"";
break;
304 str_PU =
m_evtSel->checkPU() ?
" with pile-up" :
"";
320 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 409 of file FPGATrackSimDataFlowTool.cxx.
415 return StatusCode::SUCCESS;
428 std::string str_stage =
"", str_key =
key;
429 if (
key.find(
"_1st") != std::string::npos) {
431 str_key.erase(
key.find(
"_1st"), std::string(
"_1st").length());
433 else if (
key.find(
"_2nd") != std::string::npos) {
434 str_stage =
"SECOND";
435 str_key.erase(
key.find(
"_2nd"), std::string(
"_2nd").length());
438 str_stage =
"UNKNOWN";
441 double mean =
h->GetMean() / div;
442 double rms =
h->GetRMS() / div;
443 double rms95_n =
rms95(
h) / div;
457 std::string key_tex = str_key;
466 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 507 of file FPGATrackSimDataFlowTool.cxx.
509 int sigDigit =
v != 0 ? trunc(log10(fabs(
v))) : 0;
510 if (nSigDigits >= 1) {
511 double factor =
pow(10., nSigDigits - sigDigit - 1);
512 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 492 of file FPGATrackSimDataFlowTool.cxx.
494 double total =
h->Integral();
495 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
496 double partial =
h->Integral(1,
i);
497 if (partial / total > max_frac) {
498 max_value =
h->GetBinCenter(
i);
499 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)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>