21 #include "GaudiKernel/SystemOfUnits.h"
33 unsigned const NUM_BCID = 3564;
41 struct MonitoredLSMatrices {
46 void publish(ToolHandle<GenericMonitoringTool>
const& monTool);
48 std::vector<double> beamLSMatrices;
49 std::vector<double> beamLSMatricesBCID;
56 unsigned const sizeBCID = 2*(2+1)/2 + 2 + 2 + 1;
58 if (beamLSMatrices.empty()) {
64 beamLSMatrices.resize(4*(4+1)/2 + 4 + 1 + 2 + 1);
68 beamLSMatricesBCID.resize(sizeBCID * NUM_BCID);
73 double const param[] = { -sin_phi0, cos_phi0, -
seed.z0*sin_phi0,
seed.z0*cos_phi0};
74 double d0_var =
seed.d0_var + beamSize*beamSize;
76 for (
int i = 0;
i < 4; ++
i) {
77 for (
int j = 0; j <=
i; ++ j) {
78 beamLSMatrices[
idx++] += param[
i]*param[j] / d0_var;
81 for (
int i = 0;
i < 4; ++
i) {
82 beamLSMatrices[
idx++] +=
seed.d0*param[
i] / d0_var;
85 beamLSMatrices[
idx++] +=
seed.z0;
87 beamLSMatrices[
idx++] += 1;
90 beamLSMatricesBCID[
idx++] += param[0]*param[0] / d0_var;
91 beamLSMatricesBCID[
idx++] += param[0]*param[1] / d0_var;
92 beamLSMatricesBCID[
idx++] += param[1]*param[1] / d0_var;
93 beamLSMatricesBCID[
idx++] +=
seed.d0*param[0] / d0_var;
94 beamLSMatricesBCID[
idx++] +=
seed.d0*param[1] / d0_var;
95 beamLSMatricesBCID[
idx++] +=
seed.z0;
97 beamLSMatricesBCID[
idx++] += 1;
100 void MonitoredLSMatrices::publish(ToolHandle<GenericMonitoringTool>
const& monTool)
102 if (not beamLSMatrices.empty()) {
129 return StatusCode::SUCCESS;
137 std::vector<TrackData> bsTracks;
139 eventID.bunch_crossing_id(), &bsTracks);
143 if (not bsTracks.empty()) {
155 ATH_MSG_DEBUG(
"Fill LS matrices with " << tracks.size() <<
" Trk::Track tracks");
156 MonitoredLSMatrices lsMatrices;
157 for (
auto&
track: tracks) {
164 ATH_MSG_DEBUG(
"Fill LL coefficients with " << tracks.size() <<
" Trk::Track tracks");
165 std::vector<double> poly_coeff;
167 for (
auto&
track: tracks) {
168 auto const&
par =
track->perigeeParameters()->parameters();
169 auto const&
cov =
track->perigeeParameters()->covariance();
172 if (not poly_coeff.empty()) {
184 ATH_MSG_DEBUG(
"Fill LS matrices with " << tracks.size() <<
" TrackData tracks");
185 MonitoredLSMatrices lsMatrices;
186 for (
auto&
track: tracks) {
192 ATH_MSG_DEBUG(
"Fill LL coefficients with " << tracks.size() <<
" TrackData tracks");
193 std::vector<double> poly_coeff;
195 for (
auto&
track: tracks) {