ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetMaterialVeto Class Reference

#include <InDetMaterialVeto.h>

Inheritance diagram for InDet::InDetMaterialVeto:
Collaboration diagram for InDet::InDetMaterialVeto:

Public Member Functions

 InDetMaterialVeto (const BeamPipeDetectorManager *beamPipeMgr, const InDetDD::PixelDetectorManager *pixelManager)
std::unique_ptr< TH2D > ITkPixMaterialMap ()
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::unique_ptr< TH2D > m_ITkPixMaterialMap
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 29 of file InDetMaterialVeto.h.

Constructor & Destructor Documentation

◆ InDetMaterialVeto()

InDet::InDetMaterialVeto::InDetMaterialVeto ( const BeamPipeDetectorManager * beamPipeMgr,
const InDetDD::PixelDetectorManager * pixelManager )

Definition at line 22 of file InDetMaterialVeto.cxx.

23 :
24 AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"InDetMaterialVeto")
25 {
26
27 ATH_MSG_DEBUG("Building material rejection map from BeamPipe and PixelDetectorManager");
28
29 static constexpr int nbins_R = 76;
30 double bins_R[nbins_R+1];
31 for(unsigned int i=0; i<=15; i++) bins_R[i] = 2*i - 1.; // 2 mm bin width below R=29 mm, centered on R=24 mm (beampipe)
32 bins_R[16] = 30.; // 29-30 makes junction with pixel bins, veto IPT R=29.3 mm
33 static constexpr double Rbinwidth_pixel = 6.;
34 for(unsigned int i=1; i<=60; i++) bins_R[i+16] = 30 + Rbinwidth_pixel*i; // 6 mm bin width beyond R=30 mm
35
36 static constexpr int nbins_Z = 1000;
37 static constexpr double zmax = 3000.;
38 static constexpr double zbinwidth = 2*zmax/nbins_Z;
39
40 std::string mapName = "ITkMaterialMap";
41 m_ITkPixMaterialMap = std::make_unique<TH2D>(mapName.c_str(),mapName.c_str(),nbins_Z,-zmax,zmax,nbins_R,bins_R); // x-axis = global z coordinates, -3240 mm to +3240 mm, 6 mm bin width / y-axis = global R coordinates, variable bin width
42
43
44 // Retrieve the beam pipe radius from the SectionC03 volume
45
46 double beamPipeRadius = 0.;
47 PVConstLink beamPipeTopVolume = beamPipeMgr->getTreeTop(0);
48 const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
49 const GeoTube* beamPipeTube = nullptr;
50
51 if (beamPipeLogVolume){
52 beamPipeTube = dynamic_cast<const GeoTube*>(beamPipeLogVolume->getShape());
53 if (beamPipeTube){
54
55 for(unsigned int i=0;i<beamPipeTopVolume->getNChildVols();i++){
56
57 if(beamPipeTopVolume->getNameOfChildVol(i)=="SectionC03"){
58 PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
59 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
60 const GeoTube* childTube = nullptr;
61
62 if (childLogVolume){
63 childTube = dynamic_cast<const GeoTube*>(childLogVolume->getShape());
64 if (childTube){
65 beamPipeRadius = 0.5 * (childTube->getRMax()+childTube->getRMin());
66 }
67 }
68
69 break; //Exit loop after SectionC03 is found
70 }
71
72 } // Loop over child volumes
73
74 }
75 } // if(beamPipeLogVolume)
76
77 ATH_MSG_DEBUG("BeamPipeRadius used for material rejection="<<beamPipeRadius);
78
79 // Fill map with beam pipe radius for all z
80 for(double z = -zmax + 0.5*zbinwidth; z<zmax; z+=zbinwidth) m_ITkPixMaterialMap->Fill(z,beamPipeRadius);
81
82
83 // Retrieve IPT radius
84 // Labelled as anonymous volume so taken as pixel volume with smallest radius
85
86 double IPTRadius = -1.;
87
88 PVConstLink pixelTopVolume = pixelManager->getTreeTop(0);
89
90 for(unsigned int i=0;i<pixelTopVolume->getNChildVols();i++){
91
92 PVConstLink childTopVolume = pixelTopVolume->getChildVol(i);
93 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
94 const GeoTube* childTube = nullptr;
95
96 if (childLogVolume){
97 childTube = dynamic_cast<const GeoTube*>(childLogVolume->getShape());
98 if (childTube){
99 double radius = 0.5*(childTube->getRMin()+childTube->getRMax());
100 if(IPTRadius<0. || radius<IPTRadius) IPTRadius = radius;
101 }
102 }
103
104 }
105
106 ATH_MSG_DEBUG("IPTRadius used for material rejection="<<IPTRadius);
107
108 // Fill map with IPT radius for all z
109 for(double z = -zmax + 0.5*zbinwidth; z<zmax; z+=zbinwidth) m_ITkPixMaterialMap->Fill(z,IPTRadius);
110
111
113 for (iter = pixelManager->getDetectorElementBegin(); iter != pixelManager->getDetectorElementEnd(); ++iter) {
114 // get the ID
115 Identifier Pixel_ModuleID = (*iter)->identify();
116 // check the validity
117 if (Pixel_ModuleID.is_valid()) {
118 const InDetDD::SiDetectorElement *module = pixelManager->getDetectorElement(Pixel_ModuleID);
119
120 //Take into account full module extent
121 InDetDD::DetectorType type = module->design().type();
122
123 if(type==InDetDD::PixelInclined){
124 double zMin_mod = module->zMin();
125 double zMax_mod = module->zMax();
126 double rMin_mod = module->rMin();
127 double rMax_mod = module->rMax();
128 if(zMin_mod>0){
129 double alpha = (rMin_mod-rMax_mod)/(zMax_mod-zMin_mod);
130 for(double z=zMin_mod; z<=zMax_mod; z+=zbinwidth){
131 double R = rMax_mod + alpha*(z-zMin_mod);
132 m_ITkPixMaterialMap->Fill(z,R);
133 }
134 }
135 else{
136 double alpha = (rMax_mod-rMin_mod)/(zMax_mod-zMin_mod);
137 for(double z=zMin_mod; z<=zMax_mod; z+=zbinwidth){
138 double R = rMin_mod + alpha*(z-zMin_mod);
139 m_ITkPixMaterialMap->Fill(z,R);
140 }
141 }
142 }
143
144 else if(type==InDetDD::PixelBarrel){
145 double zMin_mod = module->zMin();
146 double zMax_mod = module->zMax();
147 double R = std::hypot(module->center().x(),module->center().y());
148 for(double z=zMin_mod; z<=zMax_mod; z+=zbinwidth) m_ITkPixMaterialMap->Fill(z,R);
149 }
150
151 else if(type==InDetDD::PixelEndcap){
152 double rMin_mod = module->rMin();
153 double rMax_mod = module->rMax();
154 double z = module->center().z();
155 for(double R=rMin_mod; R<=rMax_mod; R+=Rbinwidth_pixel) m_ITkPixMaterialMap->Fill(z,R);
156 }
157
158 }
159 } // end loop over pixel modules
160
161 }
#define ATH_MSG_DEBUG(x)
#define z
AthMessaging()
Default constructor:
virtual PVConstLink getTreeTop(unsigned int i) const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
bool is_valid() const
Check if id is in a valid state.
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const override
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const override
virtual PVConstLink getTreeTop(unsigned int i) const override
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
std::unique_ptr< TH2D > m_ITkPixMaterialMap
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)

Member Function Documentation

◆ 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.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ ITkPixMaterialMap()

std::unique_ptr< TH2D > InDet::InDetMaterialVeto::ITkPixMaterialMap ( )
inline

Definition at line 34 of file InDetMaterialVeto.h.

34{ return std::move(m_ITkPixMaterialMap); }

◆ 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 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ 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 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_ITkPixMaterialMap

std::unique_ptr<TH2D> InDet::InDetMaterialVeto::m_ITkPixMaterialMap
private

Definition at line 37 of file InDetMaterialVeto.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ 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_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files: