ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDriftCircleErrorStrategy.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUON_MUONRIOONTRACK_MUONDRIFTCIRCLEERRORSTRATEGY_H
6#define MUON_MUONRIOONTRACK_MUONDRIFTCIRCLEERRORSTRATEGY_H
7
8#include <bitset>
9#include "GaudiKernel/MsgStream.h"
10#include <iostream>
11
12namespace Muon {
13typedef std::bitset<23> MuonDriftCircleErrorStrategyInput;
14
16public:
17 enum Strategy {Moore=0, Muon=1, UnknownStrategy=0x7}; // FIXME - better names
18 enum CreationParameter{ BroadError=3,// Bit 3. Create with broad errors.
19 ScaledError, // Error scaling is turned on (this is applied after eveyrthing else)
33 };
34 static constexpr std::size_t nCalibWindowBits = 4;
37 void setStrategy(Strategy);
38 void setParameter(CreationParameter, bool value);
39 void setCalibWindow(unsigned long);
40
42 unsigned long calibWindow() const;
43 Strategy strategy() const;
44
46
47private:
49};
50}
51
52inline
53void
55 unsigned int holder = static_cast<unsigned int>(st);
56 m_bits[0] = holder&0x1;
57 m_bits[1] = holder&0x2;
58 m_bits[2] = holder&0x4;
59}
60
61inline
62void
66
67inline
68void
70 std::bitset<nCalibWindowBits> tmpconfig(config);
71
72 // Copy temporary bitset into m_bits
73 // Should do this with std::copy
74 for (std::size_t itmp=0,i=FirstCalibWindowBit; itmp<nCalibWindowBits; ++itmp,++i) {
75 m_bits[i] = tmpconfig[itmp];
76 }
77
78}
79
80inline
81bool
85
86inline
87unsigned long
89 std::bitset<nCalibWindowBits> tmpconfig;
90
91 // Copy relevant part of m_bits into temporary bitset
92 // Should do this with std::copy
93 for (std::size_t itmp=0,i=FirstCalibWindowBit; itmp<nCalibWindowBits; ++itmp,++i) {
94 tmpconfig[itmp] = m_bits[i];
95 }
96
97 return tmpconfig.to_ulong();
98}
99
100inline
103 switch (m_bits.to_ulong()&0x7){
104 case 0:
105 return Moore;
106 case 1:
107 return Muon;
108 default:
109 return UnknownStrategy;
110 }
111 return UnknownStrategy;
112}
113
114inline std::ostream& operator << ( std::ostream& sl, const Muon::MuonDriftCircleErrorStrategy& mdces)
115{
116 sl << "MuonDriftCircleErrorStrategy with strategy ";
118 switch (mdces.strategy()){
119 case 0:
120 sl << "Moore";
121 break;
122 case 1:
123 sl << "Muon";
124 break;
125 default:
126 sl << "Unknown Strategy";
127 }
128 sl << " and configuration bits " << myBits;
129 sl << " including CalibWindow " << mdces.calibWindow() << std::endl;
130 return sl;
131}
132
133inline MsgStream& operator << ( MsgStream& sl, const Muon::MuonDriftCircleErrorStrategy& mdces)
134{
135 sl << "MuonDriftCircleErrorStrategy with strategy ";
137 switch (mdces.strategy()){
138 case 0:
139 sl << "Moore";
140 break;
141 case 1:
142 sl << "Muon";
143 break;
144 default:
145 sl << "Unknown Strategy";
146 }
147 sl << " and configuration bits " << myBits;
148 sl << " including CalibWindow " << mdces.calibWindow() << std::endl;
149 return sl;
150}
151
152
153#endif
void setStrategy(Strategy)
Select the strategy to be used - only one can be set at a time.
bool creationParameter(CreationParameter) const
MuonDriftCircleErrorStrategyInput m_bits
0,1,2 are reserved for Strategy, 3-16 are Creation parameters, 17-20 are calib window bits
static constexpr std::size_t nCalibWindowBits
Allows up to 16 configurations to be recorded.
const MuonDriftCircleErrorStrategyInput & getBits() const
unsigned long calibWindow() const
Returns calibration configuration.
void setParameter(CreationParameter, bool value)
void setCalibWindow(unsigned long)
Only the first nCalibWindowBits bits will be stored!
MuonDriftCircleErrorStrategy(const MuonDriftCircleErrorStrategyInput &bits)
first 3 bits are Strategy, then come CreationParameter, last four are calib window bits
@ StationError
A term is added to account for misaligned.
@ T0Refit
A special error was applied to account for the T0 refit (user defined via jobProperties)
@ FixedError
A fixed error is given to this hit (user defined via jobProperties)
@ MagFieldCorrection
Magnetic field correction was applied in calibration.
@ SlewCorrection
Slewing correction was applied in calibration.
@ FirstCalibWindowBit
First bit recording the calibration configuration.
@ TofCorrection
Time of flight correction was applied in calibration.
@ BackgroundCorrection
Background correction was applied in calibration.
@ PropCorrection
Propagation correction was applied in calibration.
@ TempCorrection
Temperature correction was applied in calibration.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
std::bitset< 23 > MuonDriftCircleErrorStrategyInput