9 #include "ERQTelescopeGeoComponentSingleSi.h" 11 #include "TGeoManager.h" 12 #include "TGeoMatrix.h" 13 #include <TDOMParser.h> 18 #include "FairLogger.h" 20 #include "ERTelescopeSetup.h" 25 void ERQTelescopeGeoComponentSingleSi::ConstructGeometryVolume(
void) {
27 auto* media = CreateMaterial(fMedia);
28 media->GetMaterial()->Print();
30 TGeoVolume* singleSiStrip;
31 fVolume = gGeoManager->MakeBox(this->GetVolumeName(), media, fSizeX / 2., fSizeY / 2., fSizeZ / 2.);
33 Double_t singleSiStripX = fSensX / fStripCount;
34 Double_t singleSiStripY = fSensY;
35 Double_t singleSiStripZ = fSensZ - fDeadLayerThicknessFrontSide - fDeadLayerThicknessBackSide;
36 singleSiStrip = gGeoManager->MakeBox(
"SensitiveSingleSiStrip", media, singleSiStripX / 2.,
37 singleSiStripY / 2., singleSiStripZ / 2.);
41 for (Int_t iStrip = 0; iStrip < fStripCount; iStrip++) {
42 Double_t transX = (-1) * fSensX / 2
43 + singleSiStripX/2. + iStrip*singleSiStripX;
44 Double_t transZ = (fDeadLayerThicknessFrontSide
45 - fDeadLayerThicknessBackSide)/2.;
46 fVolume->AddNode(singleSiStrip, iStrip,
new TGeoCombiTrans(transX, 0., transZ,
new TGeoRotation()));
48 if (fOrientAroundZ == OrientationAroundZ::Y) {
49 fRotation.RotateZ(90.);
53 void ERQTelescopeGeoComponentSingleSi::ParseXmlParameters() {
54 TString xmlFile = ERTelescopeSetup::Instance()->GetXMLParametersFile();
55 TDOMParser *domParser;
56 domParser =
new TDOMParser;
57 domParser->SetValidate(
false);
58 Int_t parsecode = domParser->ParseFile(xmlFile);
60 LOG(FATAL) << domParser->GetParseCodeMessage(parsecode) << FairLogger::FairLogger::endl;
63 TXMLNode *rootNode = domParser->GetXMLDocument()->GetRootNode();
64 TXMLNode *detPartNode = rootNode->GetChildren();
65 TXMLNode *SiTypeNodes;
66 for ( ; detPartNode; detPartNode = detPartNode->GetNextNode()) {
67 if (!strcasecmp(detPartNode->GetNodeName(),
"SiTypes")) {
68 SiTypeNodes = detPartNode->GetChildren();
69 for ( ; SiTypeNodes; SiTypeNodes = SiTypeNodes->GetNextNode()) {
70 if (!strcasecmp(SiTypeNodes->GetNodeName(),
"singleSiTypes")) {
71 TXMLNode* curNode = SiTypeNodes->GetChildren()->GetNextNode();
72 for(; curNode; curNode = curNode->GetNextNode()) {
75 if (curNode->HasAttributes()){
76 attrList = curNode->GetAttributes();
78 while ((attr=(TXMLAttr*)next())) {
79 if (!strcasecmp(
"id", attr->GetName())) {
87 if(!strcasecmp(fComponentId, attr->GetValue())) {
88 FillTwoSidedChannelAttribute(curNode->GetAttributes());
89 TXMLNode* curNode2 = curNode->GetChildren();
90 for(; curNode2; curNode2 = curNode2->GetNextNode()) {
91 if(!strcasecmp(curNode2->GetNodeName(),
"singleSiSize")) {
92 attrList = curNode2->GetAttributes();
94 TIter nextSizeAttr(attrList);
95 while ((attr=(TXMLAttr*)nextSizeAttr())) {
96 if (!strcasecmp(
"singleSiX", attr->GetName())) {
97 fSizeX = atof(attr->GetValue());
99 if (!strcasecmp(
"singleSiY", attr->GetName())) {
100 fSizeY = atof(attr->GetValue());
102 if (!strcasecmp(
"singleSiZ", attr->GetName())) {
103 fSizeZ = atof(attr->GetValue());
107 if(!strcasecmp(curNode2->GetNodeName(),
"singleSiSensAreaSize")) {
108 attrList = curNode2->GetAttributes();
110 TIter nextSensSizeAttr(attrList);
111 while ((attr=(TXMLAttr*)nextSensSizeAttr())) {
112 if (!strcasecmp(
"singleSiSensX", attr->GetName())) {
113 fSensX = atof(attr->GetValue());
115 if (!strcasecmp(
"singleSiSensY", attr->GetName())) {
116 fSensY = atof(attr->GetValue());
118 if (!strcasecmp(
"singleSiSensZ", attr->GetName())) {
119 fSensZ = atof(attr->GetValue());
123 if(!strcasecmp(curNode2->GetNodeName(),
"deadLayerThicknessFrontSide")) {
124 fDeadLayerThicknessFrontSide = atof(curNode2->GetText());
126 if(!strcasecmp(curNode2->GetNodeName(),
"deadLayerThicknessBackSide")) {
127 fDeadLayerThicknessBackSide = atof(curNode2->GetText());
129 if(!strcasecmp(curNode2->GetNodeName(),
"stripCount")) {
130 fStripCount = atof(curNode2->GetText());
132 if(!strcasecmp(curNode2->GetNodeName(),
"singleSiMedia")) {
133 fMedia = curNode2->GetText();