24 #include "GaudiKernel/ITHistSvc.h"
38 return StatusCode::SUCCESS;
45 TString folderId = tvol ? tvol->
volumeName() : std::string(
"Unknown");
55 if (!lMaterial)
return StatusCode::SUCCESS;
64 float centerX = lCenter.x();
65 float centerY = lCenter.y();
66 float centerZ = lCenter.z();
89 bins0 = lBinUtility ? lBinUtility->
max(0)+1 : 1;
90 bins1 = lBinUtility ? lBinUtility->
max(1)+1 : 1;
95 TString hName = ( lType == 1 ) ?
"CylinderLayer_" :
"DiscLayer_";
99 TString
info =
"_Information";
101 TH2F* lMaterialHist = lType == 1 ?
102 new TH2F(hName+pXo, hName, bins0, -
M_PI*dim0,
M_PI*dim0, bins1, -dim1, dim1) :
103 new TH2F(hName+pXo, hName, bins0, dim0, dim1, bins1, -
M_PI,
M_PI);
105 TTree* lTreeInformation =
new TTree(hName+
info,hName);
106 lTreeInformation->Branch(
"LayerCenterX", ¢erX,
"cX/F");
107 lTreeInformation->Branch(
"LayerCenterY", ¢erY,
"cY/F");
108 lTreeInformation->Branch(
"LayerCenterZ", ¢erZ,
"cZ/F");
109 lTreeInformation->Branch(
"LayerIndex", &lIndex,
"idx/I");
111 lTreeInformation->Branch(
"Radius", &dim0,
"r/F");
112 lTreeInformation->Branch(
"HalflengthZ", &dim1,
"hz/F");
113 lTreeInformation->Branch(
"BinsRPhi", &bins0,
"bin0/I");
114 lTreeInformation->Branch(
"BinsHalfZ", &bins1,
"bin1/I");
115 }
else if (lType == 2){
116 lTreeInformation->Branch(
"InnerRadius", &dim0,
"rmin/F");
117 lTreeInformation->Branch(
"OuterRadius", &dim1,
"rmax/F");
118 lTreeInformation->Branch(
"BinsR", &bins0,
"bin0/I");
119 lTreeInformation->Branch(
"BinsPhi", &bins1,
"bin1/I");
123 TString regHistName =
folderName+
"/"+hName+
"/"+hName+pXo;
126 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
129 if ( (tHistSvc->regTree(std::string(regTreeName.Data()),lTreeInformation)).isFailure() ){
132 lTreeInformation->Fill();
134 if ( (tHistSvc->regHist(std::string(regHistName.Data()),lMaterialHist)).isFailure() ){
140 for (
int ib0 = 0; ib0 < bins0; ++ib0 )
141 for (
int ib1 = 0; ib1 < bins1; ++ib1 ){
145 lMaterialHist->SetBinContent(ib0+1,ib1+1,mps->
thicknessInX0());
149 return StatusCode::SUCCESS;
154 return StatusCode::SUCCESS;