32 return StatusCode::SUCCESS;
42 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
54 ATH_MSG_DEBUG(
"SP monitoring, handle validity " << spCountsHandle.isValid());
55 if (!spCountsHandle.isValid())
58 return StatusCode::SUCCESS;
60 if (spCountsHandle->size() == 0)
62 return StatusCode::SUCCESS;
71 if (trigDecTool->isPassed(trig, TrigDefs::requireDecision))
74 auto pixelCL =
Scalar(
"PixelCL", spCountsHandle->at(0)->getDetail<
int>(
"pixCL"));
75 auto PixBarr_SP =
Scalar(
"PixBarr_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLBarrel"));
76 auto PixECA_SP =
Scalar(
"PixECA_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLEndcapA"));
77 auto PixECC_SP =
Scalar(
"PixECC_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLEndcapC"));
79 auto SctTot =
Scalar(
"SctTot", spCountsHandle->at(0)->getDetail<
int>(
"sctSP"));
80 auto SctBarr_SP =
Scalar(
"SctBarr_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPBarrel"));
81 auto SctECA_SP =
Scalar(
"SctECA_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPEndcapA"));
82 auto SctECC_SP =
Scalar(
"SctECC_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPEndcapC"));
84 fill(trig +
"_SpacePoints", pixelCL, PixBarr_SP, PixECA_SP, PixECC_SP, SctTot, SctBarr_SP, SctECA_SP, SctECC_SP);
90 return StatusCode::SUCCESS;
100 if (!trkCountsHandle.isValid())
103 return StatusCode::SUCCESS;
106 if (trkCountsHandle->size() == 0)
108 return StatusCode::SUCCESS;
111 auto nTrkOnline =
Scalar(
"nTrkOnline", trkCountsHandle->at(0)->getDetail<
int>(
"ntrks"));
112 std::vector<int> counts = trkCountsHandle->at(0)->getDetail<std::vector<int>>(
"counts");
114 int countTrkVtxOnline = -1;
115 auto countsOnline =
Collection(
"countsOnline", counts);
116 const std::vector<float> ptCutValues = trkCountsHandle->at(0)->getDetail<std::vector<float>>(
"pTcuts");
117 const std::vector<float> z0CutValues = trkCountsHandle->at(0)->getDetail<std::vector<float>>(
"z0cuts");
118 const std::vector<float> vtxCutValues = trkCountsHandle->at(0)->getDetail<std::vector<float>>(
"vertexZcuts");
121 for (
size_t i = 0;
i < countsOnline.size(); ++
i) {
122 std::ostringstream
s;
123 s <<
"pt: " << ptCutValues[
i];
124 s <<
" z0: " << z0CutValues[
i];
125 auto vtxCut = vtxCutValues[
i];
126 s <<
" vtx-z: " << vtxCut;
129 countTrkVtxOnline = counts[
i];
133 auto nTrkOnlineVtx =
Scalar(
"nTrkOnlineVtx", countTrkVtxOnline);
137 const float priVtxZ = priVtx ==
nullptr ? 999 : priVtx->
z();
139 auto offlineVtxZ =
Scalar(
"offlineVtxZ", priVtxZ);
142 int countPassing = 0;
143 int countPassingVtx = 0;
149 for (
const auto trk : *offlineTrkHandle) {
150 if (track_selector(trk) and std::abs(trk->pt()) >
m_minPt) {
157 ATH_MSG_DEBUG(
"::monitorTrkCounts countPassing = " << countPassing);
161 float maxWeight = -1;
165 for (
auto vertex : *zFinderDataHandle) {
166 float weight =
vertex->getDetail<
float>(
"zfinder_vtx_weight");
169 zPos =
vertex->getDetail<
float>(
"zfinder_vtx_z");
173 auto zFinderWeight =
Scalar(
"zFinderWeight", maxWeight);
174 auto zFinderVtxZ =
Scalar(
"zFinderVtxZ", zPos);
175 auto onlineOfflineVtxDelta =
Scalar(
"onlineOfflineVtxDelta", priVtxZ - zPos);
177 auto nTrkOffline =
Scalar(
"nTrkOffline", countPassing);
178 auto nTrkOfflineVtx =
Scalar(
"nTrkOfflineVtx", countPassingVtx);
179 auto nAllTrkOffline =
Scalar(
"nAllTrkOffline", offlineTrkHandle->size());
180 auto trkMask =
Collection(
"trkMask", *offlineTrkHandle, [&](
const auto& trk) {
return track_selector(trk); });
181 auto trkPt =
Collection(
"trkPt", *offlineTrkHandle, [](
const auto& trk) {
return trk->pt() * 1.
e-3; });
182 auto trkEta =
Collection(
"trkEta", *offlineTrkHandle, [](
const auto& trk) {
return trk->eta(); });
183 auto trkPhi =
Collection(
"trkPhi", *offlineTrkHandle, [](
const auto& trk) {
return trk->phi(); });
184 auto trkD0 =
Collection(
"trkD0", *offlineTrkHandle, [](
const auto& trk) {
return trk->d0(); });
185 auto trkZ0 =
Collection(
"trkZ0", *offlineTrkHandle, [](
const auto& trk) {
return trk->z0(); });
186 auto trkZ0wrtPV =
Collection(
"trkZ0wrtPV", *offlineTrkHandle, [priVtx](
const auto& trk) {
187 return (priVtx !=
nullptr) ?
Utils::z0wrtPV(trk, priVtx) : -999; });
192 for (
int bit = 0; bit < 32; bit++)
193 nhits += (
pattern & (1
u << bit) ? 1 : 0);
196 auto trkHits =
Collection(
"trkHits", *offlineTrkHandle, getNhits);
198 auto onlTrkPt =
Collection(
"onlTrkPt", *onlineTrkHandle, [](
const auto& trk) {
return trk->pt() * 1.
e-3; });
199 auto onlTrkEta =
Collection(
"onlTrkEta", *onlineTrkHandle, [](
const auto& trk) {
return trk->eta(); });
200 auto onlTrkPhi =
Collection(
"onlTrkPhi", *onlineTrkHandle, [](
const auto& trk) {
return trk->phi(); });
201 auto onlTrkD0 =
Collection(
"onlTrkD0", *onlineTrkHandle, [](
const auto& trk) {
return trk->d0(); });
202 auto onlTrkZ0 =
Collection(
"onlTrkZ0", *onlineTrkHandle, [](
const auto& trk) {
return trk->z0(); });
203 auto onlTrkHits =
Collection(
"onlTrkHits", *onlineTrkHandle, getNhits);
207 auto nMBTrkTrkOfflineRatio =
Scalar(
"trkSelOfflineRatio", (offlineTrkHandle->size() == 0 ? -1 :
static_cast<double>(nTrkOffline) / offlineTrkHandle->size()));
210 ATH_MSG_DEBUG(
"L1TE monitoring, handle validity " << L1TEHandle.isValid());
211 float sum_roi_sumEt = 0.;
212 if (!L1TEHandle.isValid()) sum_roi_sumEt = -1.;
213 else sum_roi_sumEt =
static_cast<float>(L1TEHandle->energyT()) * 1.
e-3;
214 auto L1sumEt =
Scalar(
"L1sumEt", sum_roi_sumEt);
217 ATH_MSG_DEBUG(
"SP monitoring, handle validity " << spCountsHandle.isValid());
218 if (!spCountsHandle.isValid())
221 return StatusCode::SUCCESS;
223 if (spCountsHandle->size() == 0)
225 return StatusCode::SUCCESS;
230 if (trigDecTool->isPassed(trig, TrigDefs::requireDecision))
233 auto pixelCL =
Scalar(
"PixelCL", spCountsHandle->at(0)->getDetail<
int>(
"pixCL"));
234 auto PixBarr_SP =
Scalar(
"PixBarr_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLBarrel"));
235 auto PixECA_SP =
Scalar(
"PixECA_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLEndcapA"));
236 auto PixECC_SP =
Scalar(
"PixECC_SP", spCountsHandle->at(0)->getDetail<
int>(
"pixCLEndcapC"));
238 auto SctTot =
Scalar(
"SctTot", spCountsHandle->at(0)->getDetail<
int>(
"sctSP"));
239 auto SctBarr_SP =
Scalar(
"SctBarr_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPBarrel"));
240 auto SctECA_SP =
Scalar(
"SctECA_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPEndcapA"));
241 auto SctECC_SP =
Scalar(
"SctECC_SP", spCountsHandle->at(0)->getDetail<
int>(
"sctSPEndcapC"));
243 ATH_MSG_DEBUG(
"::monitorTrkCounts Chain " << trig <<
" " << (trigDecTool->isPassed(trig, TrigDefs::requireDecision) ?
"passed" :
"did not pass"));
246 double nTrkRatio = offlineTrkHandle->size() > 0 ?
static_cast<double>(offlineTrkHandle->size()) /
static_cast<double>(trkCountsHandle->at(0)->getDetail<
int>(
"ntrks")) : -1.0;
247 auto trkRatio =
Scalar(
"nTrkRatio", nTrkRatio);
248 fill(trig +
"_Tracking", nTrkOffline, nTrkOfflineVtx, nAllTrkOffline, nTrkOnline, trkRatio, nMBTrkTrkOfflineRatio, pixelCL,
249 PixBarr_SP, PixECA_SP, PixECC_SP,
250 SctTot, SctBarr_SP, SctECA_SP, SctECC_SP,
252 countsOnline, countsOnlineNames,
253 trkMask, trkPt, trkEta, trkPhi, trkD0, trkZ0, trkZ0wrtPV, trkHits,
254 onlTrkPt, onlTrkEta, onlTrkPhi, onlTrkHits, onlTrkD0, onlTrkZ0,
255 zFinderWeight, zFinderVtxZ, offlineVtxZ, onlineOfflineVtxDelta,
260 const unsigned int passBits = trigDecTool->isPassedBits(trig);
261 if ((!(
passBits & TrigDefs::EF_prescaled)) && (
passBits & TrigDefs::L1_isPassedAfterVeto)) {
262 auto decision =
Scalar<int>(
"decision", trigDecTool->isPassed(trig, TrigDefs::requireDecision) ? 1 : 0);
263 fill(trig +
"_Tracking", nTrkOffline, nAllTrkOffline, nTrkOnline, decision);
268 return StatusCode::SUCCESS;