38 return StatusCode::SUCCESS;
44 std::vector<FPGATrackSimCluster>
const & clusters_1st,
45 const std::vector<std::shared_ptr<const FPGATrackSimRoad>> & roads_1st, std::vector<FPGATrackSimTrack>
const & tracks_1st,
46 const std::vector<std::shared_ptr<const FPGATrackSimRoad>> & roads_2nd, std::vector<FPGATrackSimTrack>
const & tracks_2nd)
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;
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;
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;
325 return StatusCode::SUCCESS;
365 std::string
hname =
"h_dataflow_" +
key;
372 h =
new TH1I(
hname.c_str(),
key.c_str(),
n + 1, -0.5,
n + 0.5);
389 h->SetBins(
max + 1, -0.5,
max + 0.5);
400 return StatusCode::SUCCESS;
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;
469 for (
unsigned i = 0;
i <
n;
i++) {
479 size_t pos =
data.find(toFind);
480 while (
pos != std::string::npos) {
481 data.replace(
pos, toFind.size(), replaceStr);
482 pos =
data.find(toFind,
pos + replaceStr.size());
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);
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;