9 #include "ERQTelescopeGeoComponentCsI.h" 11 #include "TGeoManager.h" 12 #include "TGeoMatrix.h" 13 #include <TDOMParser.h> 18 #include "FairLogger.h" 20 #include "ERTelescopeSetup.h" 22 void ERQTelescopeGeoComponentCsI::ConstructGeometryVolume(
void) {
24 auto* media = CreateMaterial(fMedia);
25 Float_t fullX = fSizeX*fCubesCountX + fSplitSize*fCubesCountX;
26 Float_t fullY = fSizeY*fCubesCountY + fSplitSize*fCubesCountY;
28 fVolume = gGeoManager->MakeBox(this->GetVolumeName(),
35 TGeoVolume* shellCsI = gGeoManager->MakeBox(
"CsIBoxShell", media, fSizeX / 2,
39 TGeoVolume* boxCsISensitive = gGeoManager->MakeBox(
"SensitiveCsIBox", media, fSizeX / 2 - fDeadLayer,
40 fSizeY / 2 - fDeadLayer,
41 fSizeZ / 2 - fDeadLayer);
42 shellCsI->AddNode(boxCsISensitive, 1,
new TGeoCombiTrans(0, 0, 0,
new TGeoRotation()));
46 for (Int_t iCsIX = 0; iCsIX < fCubesCountX; iCsIX++) {
47 Double_t transX = -fullX/2 + fSizeX / 2. + fSplitSize / 2 + iCsIX *(fSizeX +fSplitSize);
48 for (Int_t iCsIY = 0; iCsIY < fCubesCountY; iCsIY++) {
49 Double_t transY = -fullY/2 + fSizeY / 2. + fSplitSize / 2 + iCsIY*(fSizeY + fSplitSize);
50 fVolume->AddNode(shellCsI, iBox++,
new TGeoCombiTrans(transX,
58 void ERQTelescopeGeoComponentCsI::ParseXmlParameters() {
59 TString xmlFile = ERTelescopeSetup::Instance()->GetXMLParametersFile();
60 TDOMParser *domParser;
62 domParser =
new TDOMParser;
63 domParser->SetValidate(
false);
65 Int_t parsecode = domParser->ParseFile(xmlFile);
67 LOG(FATAL) << domParser->GetParseCodeMessage(parsecode) << FairLogger::FairLogger::endl;
70 TXMLNode *rootNode = domParser->GetXMLDocument()->GetRootNode();
71 TXMLNode *detPartNode = rootNode->GetChildren();
72 for ( ; detPartNode; detPartNode = detPartNode->GetNextNode()) {
73 if (!strcasecmp(detPartNode->GetNodeName(),
"CsITypes")) {
74 TXMLNode* curNode = detPartNode->GetChildren()->GetNextNode();
75 for (; curNode; curNode = curNode->GetNextNode()) {
78 if (curNode->HasAttributes()) {
79 attrList = curNode->GetAttributes();
81 while ((attr=(TXMLAttr*)next())) {
82 if (!strcasecmp(
"id", attr->GetName())) {
90 if (!strcasecmp(fComponentId, attr->GetValue())) {
91 TXMLNode* curNode2 = curNode->GetChildren();
92 for (; curNode2; curNode2 = curNode2->GetNextNode()) {
93 if (!strcasecmp(curNode2->GetNodeName(),
"CsISize")) {
94 attrList = curNode2->GetAttributes();
96 TIter nextPlasticAttr(attrList);
97 while ((attr=(TXMLAttr*)nextPlasticAttr())) {
98 if (!strcasecmp(
"CsIX", attr->GetName())) {
99 fSizeX = atof(attr->GetValue());
101 if (!strcasecmp(
"CsIY", attr->GetName())) {
102 fSizeY = atof(attr->GetValue());
104 if (!strcasecmp(
"CsIZ", attr->GetName())) {
105 fSizeZ = atof(attr->GetValue());
109 if (!strcasecmp(curNode2->GetNodeName(),
"cubesCountX")) {
110 fCubesCountX = atof(curNode2->GetText());
112 if (!strcasecmp(curNode2->GetNodeName(),
"cubesCountY")) {
113 fCubesCountY = atof(curNode2->GetText());
115 if (!strcasecmp(curNode2->GetNodeName(),
"splitSize")) {
116 fSplitSize = atof(curNode2->GetText());
118 if (!strcasecmp(curNode2->GetNodeName(),
"deadLayer")) {
119 fDeadLayer = atof(curNode2->GetText());
121 if (!strcasecmp(curNode2->GetNodeName(),
"CsIMedia")) {
122 fMedia = curNode2->GetText();
131 TString ERQTelescopeGeoComponentCsI::GetBranchName(
132 ERDataObjectType objectType, OrientationAroundZ orientationAroundZ ,
133 ChannelSide side )
const {
134 return GetBranchNamePrefix(SensetiveType::CsI, objectType);
137 std::list<OrientationAroundZ> ERQTelescopeGeoComponentCsI::GetOrientationsAroundZ()
const {
138 return {OrientationAroundZ::X};
141 std::list<ChannelSide> ERQTelescopeGeoComponentCsI::GetChannelSides()
const {
142 return {ChannelSide::None};
145 Int_t ERQTelescopeGeoComponentCsI::GetChannelFromSensetiveNodePath(
146 const TString& path, OrientationAroundZ orientation )
const {
147 TString pathWithChannelPostfix = path;
148 pathWithChannelPostfix.Remove(pathWithChannelPostfix.Last(
'/'), pathWithChannelPostfix.Length());
149 const TString channelStr(pathWithChannelPostfix(pathWithChannelPostfix.Last(
'_') + 1,
150 pathWithChannelPostfix.Length()));
151 return channelStr.Atoi();