36 m_vxContainerWithBeamConstraint(false),
75 float scaleFactor = 1.;
82 if ( !(beamSpotHandle.isValid()) ) {
83 ATH_MSG_ERROR(
"InDetGlobalBeamSpotMonAlg: BeamSpot container "<< beamSpotHandle.key() <<
" could not be found.");
84 return StatusCode::RECOVERABLE;
86 ATH_MSG_DEBUG(
"InDetGlobalBeamSpotMonAlg: BeamSpot container "<< beamSpotHandle.fullKey() <<
" is found.");
99 beamTiltX = beamSpotHandle->beamTilt(0);
100 beamTiltY = beamSpotHandle->beamTilt(1);
105 fill(bsGroup,beamSpotX_m);
106 fill(bsGroup,beamSpotY_m);
107 fill(bsGroup,beamSpotZ_m);
108 fill(bsGroup,beamTiltX_m);
109 fill(bsGroup,beamTiltY_m);
111 ATH_MSG_DEBUG(
"InDetGlobalBeamSpotMonAlg: Beamspot x0 = " << beamSpotX_m <<
", y0 = " << beamSpotY_m <<
", z0 = " << beamSpotZ_m <<
", tiltX = " << beamTiltX_m <<
", tiltY = " << beamTiltY_m);
117 if(!(trackCollection.isValid())){
119 return StatusCode::SUCCESS;
131 ATH_MSG_DEBUG(
"InDetGlobalBeamSpotMonAlg: NULL track pointer in collection" );
136 const Trk::Perigee* perigee = &(tpb->perigeeParameters());
140 ATH_MSG_DEBUG(
"InDetGlobalBeamSpotMonAlg: NULL track->perigeeParameters pointer " );
148 float charge = perigee->charge();
149 float z0 = perigee->parameters()[
Trk::z0];
151 float d0 = perigee->parameters()[
Trk::d0];
168 fill(bsGroup, trkD_m, trkDPhi_m);
169 fill(bsGroup, trkD_m);
176 float trkbeamlineTiltX=tpb->beamlineTiltX();
177 float trkbeamlineTiltY=tpb->beamlineTiltY();
178 float trkbeamspotx=tpb->vx();
179 float trkbeamspoty=tpb->vy();
180 float trkbeamspotz=tpb->vz();
182 float beamX = (beamSpotX-trkbeamspotx) +
std::tan(beamTiltX-trkbeamlineTiltX) * (
z0-beamSpotZ+trkbeamspotz);
183 float beamY = (beamSpotY-trkbeamspoty) +
std::tan(beamTiltY-trkbeamlineTiltY) * (
z0-beamSpotZ+trkbeamspotz);
188 fill(bsGroup, trkDPhiCorr_m, trkDCorr_m);
189 fill(bsGroup, trkDCorr_m);
194 fill(bsGroup,trkNPt_m);
204 if (!handle_vxContainer.isValid()) {
206 return StatusCode::SUCCESS;
208 auto vertexContainer = handle_vxContainer.cptr();
211 fill(bsGroup, pvN_m);
216 for(
const auto & vtx : *vertexContainer) {
218 if ( !vtx )
continue;
226 if (vtx->numberDoF() <= 0)
continue;
229 if(vtx->covariancePosition()(0,0) < 0)
continue;
230 if(vtx->covariancePosition()(1,1) < 0)
continue;
231 if(vtx->covariancePosition()(2,2) < 0)
continue;
234 float x = vtx->position().x();
235 float y = vtx->position().y();
236 float z = vtx->position().z();
237 float beamX = beamSpotX +
std::tan(beamTiltX) * (
z-beamSpotZ);
238 float beamY = beamSpotY +
std::tan(beamTiltY) * (
z-beamSpotZ);
239 float beamZ = beamSpotZ;
242 fill(bsGroup, pvXbeam_m);
245 fill(bsGroup, pvYbeam_m);
248 fill(bsGroup, pvZbeam_m);
251 fill(bsGroup, pvErrX_m);
254 fill(bsGroup, pvErrY_m);
257 fill(bsGroup, pvErrZ_m);
260 fill(bsGroup, pvNTracks_m);
263 fill(bsGroup, pvChiSqDof_m);
268 fill(bsGroup, pvX_m, pvZ_m);
269 fill(bsGroup, pvY_m, pvZ_m);
270 fill(bsGroup, pvY_m, pvX_m);
273 for (
unsigned int trkIter=0; trkIter!=vtx->nTrackParticles(); ++trkIter) {
276 ATH_MSG_DEBUG (
"InDetGlobalBeamSpotMonAlg: Could not retrieve track particle.");
282 fill(bsGroup, pvTrackPt_m);
283 fill(bsGroup, pvTrackEta_m);
289 fill(bsGroup, pvNPriVtx_m);
290 fill(bsGroup, pvNPileupVtx_m);
293 return StatusCode::SUCCESS;