ATLAS Offline Software
Loading...
Searching...
No Matches
TRTDigCondFakeMap.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "TRTDigCondFakeMap.h"
6#include "TRTDigSettings.h"
7#include "TRTDigiHelper.h"
8
9// For the Athena-based random numbers.
10#include "CLHEP/Random/RandFlat.h"
11#include "CLHEP/Random/RandGaussZiggurat.h"
12#include "CLHEP/Random/RandomEngine.h"
13
14// Units
15#include "CLHEP/Units/SystemOfUnits.h"
16
17//helpers for identifiers and hitids:
19
20#include <cmath>
21#include <cstdlib>
22#include <utility>
23
24//________________________________________________________________________________
26 const InDetDD::TRT_DetectorManager* detmgr,
27 const TRT_ID* trt_id,
28 int UseGasMix,
29 ToolHandle<ITRT_StrawStatusSummaryTool> sumTool
30 )
31: TRTDigCondBase(digset, detmgr, trt_id, UseGasMix, std::move(sumTool))
32{
33 m_average_noiselevel = m_settings->averageNoiseLevel();
34}
35
36
37//________________________________________________________________________________
39 const double& strawlength,
40 double& noiselevel,
41 double& relative_noiseamplitude,
42 CLHEP::HepRandomEngine* rndmEngine) {
43
44 noiselevel = m_average_noiselevel; // Not used here, but returned to caller
45
46 // 5% relative fluctuation is hard-coded here
47 double relnoiseamp = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 1.00, 0.05 );
48 while (relnoiseamp < 0.10) { relnoiseamp = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 1.00, 0.05 ); }
49
50 // Anatoli says we need to scale the noise amplitude of Kr,Ar according to LT_(Kr,Ar)/LT_Xe
51 MsgStream* amsg = &(msg());
52 const int statusHT = m_sumTool->getStatusHT(TRT_Identifier, Gaudi::Hive::currentContext());
53 const int strawGasType = TRTDigiHelper::StrawGasType(statusHT,m_UseGasMix, amsg);
54 bool isBar = abs(m_id_helper->barrel_ec(TRT_Identifier))==1;
55 double averagenoiseampforstrawlength = ( ( (800.)/(100*CLHEP::cm) ) * strawlength + 2100.0 ) / 2500.0;
56
57 if ( isBar ) {
58 averagenoiseampforstrawlength *= ( m_settings->lowThresholdBar(strawGasType)/m_settings->lowThresholdBar(0) );
59 } else {
60 averagenoiseampforstrawlength *= ( m_settings->lowThresholdEC(strawGasType)/m_settings->lowThresholdEC(0) );
61 }
62
63 relative_noiseamplitude = relnoiseamp * averagenoiseampforstrawlength;
64}
This is an Identifier helper class for the TRT subdetector.
MsgStream & msg() const
The standard message stream.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
const TRT_ID * m_id_helper
const TRTDigSettings * m_settings
TRTDigCondBase(const TRTDigSettings *, const InDetDD::TRT_DetectorManager *, const TRT_ID *, int UseGasMix, ToolHandle< ITRT_StrawStatusSummaryTool > sumTool)
Constructor.
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
TRTDigCondFakeMap(const TRTDigSettings *, const InDetDD::TRT_DetectorManager *, const TRT_ID *trt_id, int UseGasMix, ToolHandle< ITRT_StrawStatusSummaryTool > sumTool)
Constructor.
float m_average_noiselevel
Average noise level.
void setStrawStateInfo(Identifier &TRT_Identifier, const double &strawlength, double &noiselevel, double &relative_noiseamplitude, CLHEP::HepRandomEngine *rndmEngine)
Get straw state info based on hitid and strawlength.
Class containing parameters and settings used by TRT digitization.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
int StrawGasType(int statusHT, int useGasMix, MsgStream *log)
STL namespace.