|
ATLAS Offline Software
|
Communication with CondDB.
More...
#include <TRTDigCondBase.h>
|
| TRTDigCondBase (const TRTDigSettings *, const InDetDD::TRT_DetectorManager *, const TRT_ID *, int UseGasMix, ToolHandle< ITRT_StrawStatusSummaryTool > sumTool) |
| Constructor. More...
|
|
virtual | ~TRTDigCondBase () |
| Destructor. More...
|
|
void | initialize (CLHEP::HepRandomEngine *rndmEngine) |
|
float | strawAverageNoiseLevel () const |
| Get average noise level in straw. More...
|
|
unsigned int | totalNumberOfActiveStraws () const |
| Get total number of active straws. More...
|
|
void | getStrawData (const int &hitID, double &lowthreshold, double &noiseamplitude) const |
| Get straw data mixed condition is implemented function will return both Argon and Xenon straws (with according LT) for Argon LT ~300eV, for Argon ~100eV. More...
|
|
void | resetGetNextNoisyStraw () |
| For noise in unhit straws: Rewind straw list to start from beginning. More...
|
|
bool | getNextNoisyStraw (CLHEP::HepRandomEngine *, int &hitID, float &noiselevel) |
| For simulation of noise in unhit straws: get next noisy straw. More...
|
|
bool | crossTalkNoise (CLHEP::HepRandomEngine *) const |
|
bool | crossTalkNoiseOtherEnd (CLHEP::HepRandomEngine *) const |
|
void | resetGetNextStraw () |
| For looping over all straws: Rewind straw list to start from beginning. More...
|
|
bool | getNextStraw (int &hitID, float &noiselevel, float &noiseamp) |
| For looping over all straws: get next straw. More...
|
|
void | setRefinedStrawParameters (const int &hitID, const double &lowthreshold, const double &noiseamplitude) |
| Set straw parameters. More...
|
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
virtual void | setStrawStateInfo (Identifier &TRT_Identifier, const double &strawlength, double &noiselevel, double &relative_noiseamplitude, CLHEP::HepRandomEngine *rndmEngine)=0 |
| Get straw state info based on hitid and strawlength. More...
|
|
Communication with CondDB.
Definition at line 32 of file TRTDigCondBase.h.
◆ TRTDigCondBase()
◆ ~TRTDigCondBase()
virtual TRTDigCondBase::~TRTDigCondBase |
( |
| ) |
|
|
inlinevirtual |
◆ crossTalkNoise()
bool TRTDigCondBase::crossTalkNoise |
( |
CLHEP::HepRandomEngine * |
randengine | ) |
const |
◆ crossTalkNoiseOtherEnd()
bool TRTDigCondBase::crossTalkNoiseOtherEnd |
( |
CLHEP::HepRandomEngine * |
randengine | ) |
const |
◆ getNextNoisyStraw()
bool TRTDigCondBase::getNextNoisyStraw |
( |
CLHEP::HepRandomEngine * |
randengine, |
|
|
int & |
hitID, |
|
|
float & |
noiselevel |
|
) |
| |
For simulation of noise in unhit straws: get next noisy straw.
- Parameters
-
hitID | ID of next noisy straw |
noiselevel | noise level |
Definition at line 181 of file TRTDigCondBase.cxx.
184 if ( CLHEP::RandFlat::shoot(randengine, 0.0, 1.0) < noiselvl ) {
◆ getNextStraw()
bool TRTDigCondBase::getNextStraw |
( |
int & |
hitID, |
|
|
float & |
noiselevel, |
|
|
float & |
noiseamp |
|
) |
| |
|
inline |
For looping over all straws: get next straw.
- Parameters
-
hitID | ID of next straw |
lowthreshold | low threshold discrimenator setting |
noiseamplitude | noise amplitude |
Definition at line 214 of file TRTDigCondBase.h.
◆ getStrawData()
void TRTDigCondBase::getStrawData |
( |
const int & |
hitID, |
|
|
double & |
lowthreshold, |
|
|
double & |
noiseamplitude |
|
) |
| const |
|
inline |
Get straw data mixed condition is implemented function will return both Argon and Xenon straws (with according LT) for Argon LT ~300eV, for Argon ~100eV.
INLINES ////.
- Parameters
-
hitID | straw ID |
lowthreshold | low threshold discriminator level |
noiseamplitude | noise amplitude |
Definition at line 191 of file TRTDigCondBase.h.
195 std::lock_guard<std::mutex> lock(
m_mutex);
196 if (m_it_hitid_to_StrawState_Last->first != hitID)
199 lowthreshold = m_it_hitid_to_StrawState_Last->second.lowthreshold;
200 noiseamplitude = m_it_hitid_to_StrawState_Last->second.noiseamplitude;
◆ initialize()
void TRTDigCondBase::initialize |
( |
CLHEP::HepRandomEngine * |
rndmEngine | ) |
|
- Note
- Must be called exactly once before the class is used for anything.
Definition at line 64 of file TRTDigCondBase.cxx.
75 unsigned int strawcount(0);
76 unsigned int nBAA[3][3] = {{0}};
77 unsigned int nBAC[3][3] = {{0}};
78 unsigned int nECA[14][3] = {{0}};
79 unsigned int nECC[14][3] = {{0}};
83 const double strawLength((*it)->strawLength());
93 case -2: endcap = 1; isneg = 1;
break;
94 case -1: endcap = 0; isneg = 1;
break;
95 case 1: endcap = 0; isneg = 0;
break;
96 case 2: endcap = 1; isneg = 0;
break;
98 std::cout <<
"TRTDigitization::TRTDigCondBase::createListOfValidStraws "
99 <<
"FATAL - identifier problems - skipping detector element!!" << std::endl;
103 for (
unsigned int iStraw(0); iStraw <(*it)->nStraws(); ++iStraw) {
106 const int hitid(hitid_helper->buildHitId( endcap, isneg, ringwheel, phisector,
layer, iStraw));
108 const int statusHT =
m_sumTool->getStatusHT(strawId, Gaudi::Hive::currentContext());
112 double noiselevel, relative_noiseamplitude;
113 setStrawStateInfo( strawId, strawLength, noiselevel, relative_noiseamplitude, rndmEngine );
114 StrawState strawstate{};
115 strawstate.noiselevel = noiselevel;
117 strawstate.noiseamplitude= relative_noiseamplitude;
124 if (
side==+1 && ringwheel>=0 && ringwheel<=2 ) nBAA[ringwheel][strawGasType]++;
125 if (
side==-1 && ringwheel>=0 && ringwheel<=2 ) nBAC[ringwheel][strawGasType]++;
126 if (
side==+2 && ringwheel>=0 && ringwheel<=13 ) nECA[ringwheel][strawGasType]++;
127 if (
side==-2 && ringwheel>=0 && ringwheel<=13 ) nECC[ringwheel][strawGasType]++;
140 ATH_MSG_ERROR(
"TRTDigCondBase::initialize it seems that ALL straws are dead/masked! This wont work.");
147 if (
m_UseGasMix==0) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==0; using StatusHT to determine the gas geometry." << std::endl;
148 if (
m_UseGasMix==1) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==1; expect Xenon in the entire detector." << std::endl;
149 if (
m_UseGasMix==2) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==2; expect Krypton in the entire detector." << std::endl;
150 if (
m_UseGasMix==3) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==3; expect Argon in the entire detector." << std::endl;
151 if ( m_UseGasMix<0 || m_UseGasMix>3) {
152 std::cout <<
"TRTDigCondBase ERROR Gas Geometry: UseGasMix==" <<
m_UseGasMix <<
", must be 0,1,2or 3!" << std::endl;
155 std::cout <<
"TRTDigCondBase INFO Gas Geometry: strawcount=" << strawcount << std::endl;
157 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Xe] = " << nBAA[0][0] <<
" " << nBAA[1][0] <<
" " << nBAA[2][0] << std::endl;
158 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Kr] = " << nBAA[0][1] <<
" " << nBAA[1][1] <<
" " << nBAA[2][1] << std::endl;
159 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Ar] = " << nBAA[0][2] <<
" " << nBAA[1][2] <<
" " << nBAA[2][2] << std::endl;
161 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Xe] = " << nBAC[0][0] <<
" " << nBAC[1][0] <<
" " << nBAC[2][0] << std::endl;
162 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Kr] = " << nBAC[0][1] <<
" " << nBAC[1][1] <<
" " << nBAC[2][1] << std::endl;
163 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Ar] = " << nBAC[0][2] <<
" " << nBAC[1][2] <<
" " << nBAC[2][2] << std::endl;
165 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Xe] = ";
for (
auto &
i : nECA) std::cout <<
i[0] <<
" "; std::cout << std::endl;
166 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Kr] = ";
for (
auto &
i : nECA) std::cout <<
i[1] <<
" "; std::cout << std::endl;
167 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Ar] = ";
for (
auto &
i : nECA) std::cout <<
i[2] <<
" "; std::cout << std::endl;
169 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Xe] = ";
for (
auto &
i : nECC) std::cout <<
i[0] <<
" "; std::cout << std::endl;
170 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Kr] = ";
for (
auto &
i : nECC) std::cout <<
i[1] <<
" "; std::cout << std::endl;
171 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Ar] = ";
for (
auto &
i : nECC) std::cout <<
i[2] <<
" "; std::cout << std::endl;
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ resetGetNextNoisyStraw()
void TRTDigCondBase::resetGetNextNoisyStraw |
( |
| ) |
|
For noise in unhit straws: Rewind straw list to start from beginning.
Definition at line 176 of file TRTDigCondBase.cxx.
◆ resetGetNextStraw()
void TRTDigCondBase::resetGetNextStraw |
( |
| ) |
|
|
inline |
For looping over all straws: Rewind straw list to start from beginning.
Definition at line 209 of file TRTDigCondBase.h.
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setRefinedStrawParameters()
void TRTDigCondBase::setRefinedStrawParameters |
( |
const int & |
hitID, |
|
|
const double & |
lowthreshold, |
|
|
const double & |
noiseamplitude |
|
) |
| |
|
inline |
Set straw parameters.
- Parameters
-
hitID | ID of straw |
lowthreshold | low threshold discriminator setting |
noiseamplitude | noise amplitude |
Definition at line 231 of file TRTDigCondBase.h.
◆ setStrawStateInfo()
virtual void TRTDigCondBase::setStrawStateInfo |
( |
Identifier & |
TRT_Identifier, |
|
|
const double & |
strawlength, |
|
|
double & |
noiselevel, |
|
|
double & |
relative_noiseamplitude, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine |
|
) |
| |
|
protectedpure virtual |
Get straw state info based on hitid and strawlength.
- Note
- This must be overriden by the actual map provider
- Parameters
-
TRT_Identifier | Identifier of straw (input) |
strawlength | straw length (input) |
noiselevel | noise level this straw (e.g. 0.02 for 2%) |
relative_noiseamplitude | the relative noise amplitude as compared to other straws. The overall normalization doesn't matter as all noise amplitudes will be rescaled by the same factor. Should never be put to zero! |
Implemented in TRTDigCondFakeMap.
◆ strawAverageNoiseLevel()
float TRTDigCondBase::strawAverageNoiseLevel |
( |
| ) |
const |
◆ totalNumberOfActiveStraws()
unsigned int TRTDigCondBase::totalNumberOfActiveStraws |
( |
| ) |
const |
|
inline |
◆ ATLAS_THREAD_SAFE
std::map<int,StrawState>::const_iterator m_it_hitid_to_StrawState_Last TRTDigCondBase::ATLAS_THREAD_SAFE |
|
mutableprivate |
Iterator used for caching (ought to be called _Previous)
Definition at line 167 of file TRTDigCondBase.h.
◆ m_all_it_hitid_to_StrawState
std::map<int,StrawState>::iterator TRTDigCondBase::m_all_it_hitid_to_StrawState |
|
private |
◆ m_all_it_hitid_to_StrawState_previous
std::map<int,StrawState>::iterator TRTDigCondBase::m_all_it_hitid_to_StrawState_previous |
|
private |
◆ m_averageNoiseLevel
std::atomic<float> TRTDigCondBase::m_averageNoiseLevel |
|
mutableprivate |
◆ m_crosstalk_noiselevel
double TRTDigCondBase::m_crosstalk_noiselevel |
|
private |
◆ m_crosstalk_noiselevel_other_end
double TRTDigCondBase::m_crosstalk_noiselevel_other_end |
|
private |
◆ m_detmgr
◆ m_hitid_to_StrawState
std::map<int,StrawState> TRTDigCondBase::m_hitid_to_StrawState |
|
private |
◆ m_id_helper
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_it_hitid_to_StrawState
std::map<int,StrawState>::const_iterator TRTDigCondBase::m_it_hitid_to_StrawState |
|
private |
◆ m_it_hitid_to_StrawState_End
std::map<int,StrawState>::const_iterator TRTDigCondBase::m_it_hitid_to_StrawState_End |
|
private |
Iterator pointing to last straw in straw state map.
Definition at line 165 of file TRTDigCondBase.h.
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_mutex
std::mutex TRTDigCondBase::m_mutex |
|
mutableprivate |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_settings
◆ m_sumTool
◆ m_UseGasMix
int TRTDigCondBase::m_UseGasMix |
|
protected |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
double crossTalkNoiseLevelOtherEnd() const
double lowThresholdEC(int strawGasType) const
virtual void setStrawStateInfo(Identifier &TRT_Identifier, const double &strawlength, double &noiselevel, double &relative_noiseamplitude, CLHEP::HepRandomEngine *rndmEngine)=0
Get straw state info based on hitid and strawlength.
double crossTalkNoiseLevel() const
Get average cross talk noise level.
std::atomic< float > m_averageNoiseLevel
Average noise level.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
std::map< int, StrawState >::const_iterator m_it_hitid_to_StrawState_End
Iterator pointing to last straw in straw state map.
const TRT_ID * m_id_helper
AthMessaging()
Default constructor:
std::map< int, StrawState >::iterator m_all_it_hitid_to_StrawState
Iterator over straw state map.
unsigned int totalNumberOfActiveStraws() const
Get total number of active straws.
const TRTDigSettings * m_settings
std::map< int, StrawState >::const_iterator m_it_hitid_to_StrawState
Iterator over straw state map.
double lowThresholdBar(int strawGasType) const
Get discriminator setting for low threshold.
std::map< int, StrawState >::iterator m_all_it_hitid_to_StrawState_previous
Iterator used for caching.
double m_crosstalk_noiselevel_other_end
static const TRTHitIdHelper * GetHelper()
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
MsgStream & msg() const
The standard message stream.
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const
double m_crosstalk_noiselevel
std::map< int, StrawState > m_hitid_to_StrawState
Global map from straw ID to straw state.
int phi_module(const Identifier &id) const
std::string m_nm
Message source name.
int StrawGasType(int statusHT, int useGasMix, MsgStream *log)
void initMessaging() const
Initialize our message level and MessageSvc.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
const InDetDD::TRT_DetectorManager * m_detmgr
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: