24 AthMessaging(
Gaudi::svcLocator()->service< IMessageSvc >(
"MessageSvc" ),
"InDetMaterialVeto")
27 ATH_MSG_DEBUG(
"Building material rejection map from BeamPipe and PixelDetectorManager");
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.;
33 static constexpr double Rbinwidth_pixel = 6.;
34 for(
unsigned int i=1; i<=60; i++) bins_R[i+16] = 30 + Rbinwidth_pixel*i;
36 static constexpr int nbins_Z = 1000;
37 static constexpr double zmax = 3000.;
38 static constexpr double zbinwidth = 2*zmax/nbins_Z;
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);
46 double beamPipeRadius = 0.;
47 PVConstLink beamPipeTopVolume = beamPipeMgr->
getTreeTop(0);
48 const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
49 const GeoTube* beamPipeTube =
nullptr;
51 if (beamPipeLogVolume){
52 beamPipeTube =
dynamic_cast<const GeoTube*
>(beamPipeLogVolume->getShape());
55 for(
unsigned int i=0;i<beamPipeTopVolume->getNChildVols();i++){
57 if(beamPipeTopVolume->getNameOfChildVol(i)==
"SectionC03"){
58 PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
59 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
60 const GeoTube* childTube =
nullptr;
63 childTube =
dynamic_cast<const GeoTube*
>(childLogVolume->getShape());
65 beamPipeRadius = 0.5 * (childTube->getRMax()+childTube->getRMin());
77 ATH_MSG_DEBUG(
"BeamPipeRadius used for material rejection="<<beamPipeRadius);
86 double IPTRadius = -1.;
88 PVConstLink pixelTopVolume = pixelManager->
getTreeTop(0);
90 for(
unsigned int i=0;i<pixelTopVolume->getNChildVols();i++){
92 PVConstLink childTopVolume = pixelTopVolume->getChildVol(i);
93 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
94 const GeoTube* childTube =
nullptr;
97 childTube =
dynamic_cast<const GeoTube*
>(childLogVolume->getShape());
99 double radius = 0.5*(childTube->getRMin()+childTube->getRMax());
100 if(IPTRadius<0. || radius<IPTRadius) IPTRadius = radius;
106 ATH_MSG_DEBUG(
"IPTRadius used for material rejection="<<IPTRadius);
115 Identifier Pixel_ModuleID = (*iter)->identify();
124 double zMin_mod =
module->zMin();
125 double zMax_mod =
module->zMax();
126 double rMin_mod =
module->rMin();
127 double rMax_mod =
module->rMax();
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);
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);
145 double zMin_mod =
module->zMin();
146 double zMax_mod =
module->zMax();
147 double R = std::hypot(module->center().x(),module->center().y());
152 double rMin_mod =
module->rMin();
153 double rMax_mod =
module->rMax();
154 double z =
module->center().z();