ATLAS Offline Software
Loading...
Searching...
No Matches
DisplacedJetBeamspotInfo.h
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT2DJTRIG_BEAMSPOT_H
5#define TRIGT2DJTRIG_BEAMSPOT_H
6
8
9//keep all code for handling the beamspot info in the displaced jet trigger in one place
10//Two tools under different hypo algs use this info so better to only write once
12{
13public:
14 DisplacedJetBeamspotInfo(const InDet::BeamSpotData* beamspot = nullptr): m_bs_data(beamspot) {}
15
16 //m_errPar { sigmaX, sigmaY, sigmaZ, tiltX, tiltY, sigmaXY }, so sigma x = 0 sigma y = 1 sigma xy has a helper
17 float sigmaX(){
18 if(!is_available()){
19 return 0.0;
20 }
21
22 return m_bs_data->beamSigma(0);
23 }
24
25 float sigmaY(){
26 if(!is_available()){
27 return 0.0;
28 }
29
30 return m_bs_data->beamSigma(1);
31 }
32
33 float sigmaXY(){
34 if(!is_available()){
35 return 0.0;
36 }
37
38 return m_bs_data->beamSigmaXY();
39 }
40
41private:
43
45 if(m_bs_data == nullptr){
46 return false;
47 }
48
49 //check if the beamspot info is valid and should be used
50 //info from https://twiki.cern.ch/twiki/bin/view/Atlas/CoolBeamSpotParameters
51 int beamSpotBitMap = m_bs_data->beamStatus();
52 bool isOnlineBeamspot = ((beamSpotBitMap & 0x4) == 0x4);
53
54 //offline/mc -> assume to be valid
55 if(!isOnlineBeamspot){
56 return true;
57 }
58
59 //check if the beamspot has converged
60 if((beamSpotBitMap&0x3) == 0x3){
61 //beamspot has converged
62 return true;
63 }
64
65 return false;
66 }
67};
68
69 #endif //> !TRIGT2MINBIAS_TRACKCOUNTHYPOTOOL_H
const InDet::BeamSpotData * m_bs_data
DisplacedJetBeamspotInfo(const InDet::BeamSpotData *beamspot=nullptr)