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.;
32 bins_R[16] = 30.;
33 static constexpr double Rbinwidth_pixel = 6.;
34 for(
unsigned int i=1;
i<=60;
i++) bins_R[i+16] = 30 + Rbinwidth_pixel*i;
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);
42
43
44
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;
70 }
71
72 }
73
74 }
75 }
76
77 ATH_MSG_DEBUG(
"BeamPipeRadius used for material rejection="<<beamPipeRadius);
78
79
81
82
83
84
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
110
111
114
115 Identifier Pixel_ModuleID = (*iter)->identify();
116
119
120
122
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);
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);
140 }
141 }
142 }
143
145 double zMin_mod = module->zMin();
146 double zMax_mod = module->zMax();
147 double R = std::hypot(
module->center().x(),
module->center().y());
149 }
150
152 double rMin_mod = module->rMin();
153 double rMax_mod = module->rMax();
154 double z =
module->center().z();
156 }
157
158 }
159 }
160
161 }
AthMessaging()
Default constructor:
virtual PVConstLink getTreeTop(unsigned int i) const
DataModel_detail::const_iterator< DataVector > const_iterator
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)