+//____________________________________________________________________
+void
+AliFMD3::SimpleGeometry(TList* nodes,
+ TNode* mother,
+ Int_t colour,
+ Double_t zMother)
+{
+ // We need to get the equation for the line that connects the
+ // outer circumfrences of the two rings, as well as for the line
+ // that connects the inner curcumfrences, so that we can project to
+ // where the honey-comb actually ends.
+ //
+ // we have
+ //
+ // y = a * x + b
+ // b = y - a * x;
+ //
+ // For the outer line, we have the two equations
+ //
+ // fOuterHoneyHighR = a * x1 + b;
+ // fInnerHoneyHighR = a * x2 + b;
+ //
+ // where
+ //
+ // x1 = (fOuterZ + fOuter->fSiThickness + fOuter->fPrintboardThickness
+ // + fOuter->fLegLength + fModuleSpacing)
+ // = fInner - fDz + fHoneycombThickness
+ // x2 = (fInnerZ + fInner->fSiThickness + fInner->fPrintboardThickness
+ // + fInner->fLegLength + fModuleSpacing)
+ //
+ // and
+ //
+ // a = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
+ //
+ //
+ CalculateDz();
+#if 1
+ Double_t x1 = (fOuterZ - (fOuter->GetSiThickness()
+ + fOuter->GetPrintboardThickness()
+ + fOuter->GetLegLength()
+ + fOuter->GetModuleSpacing()));
+ Double_t x2 = (fInnerZ - (fInner->GetSiThickness()
+ + fInner->GetPrintboardThickness()
+ + fInner->GetLegLength()
+ + fInner->GetModuleSpacing()));
+ Double_t ao = 0;
+ Double_t ao1 = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
+ Double_t ao2 = ((fOuter->GetHighR() - fInner->GetHighR())
+ / (fOuterZ - fInnerZ));
+ Double_t bo = 0;
+ if (ao2 > ao1) {
+ std::cout << "Wafer determinds the size" << std::endl;
+ ao = ao2;
+ bo = fInner->GetHighR() - ao * fInnerZ;
+ }
+ else {
+ ao = ao1;
+ bo = fOuterHoneyHighR - ao * x1;
+ }
+
+ Double_t y1o = ao * (fInnerZ - 2 * fDz) + bo;
+ Double_t y2o = ao * fInnerZ + bo;
+#endif
+ // We probably need to make a PCON here.
+ TShape* shape = new TCONS("FMD3", "FMD3", "", fDz,
+ fOuter->GetLowR(), y1o, /* fOuterHoneyHighR, */
+ fInner->GetLowR(), y2o, /* fInnerHoneyHighR, */
+ 0, 360);
+ mother->cd();
+ zMother = fInnerZ - fDz;
+ TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
+ node->SetVisibility(0);
+ nodes->Add(node);
+ AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
+}
+
+//____________________________________________________________________
+void
+AliFMD3::CalculateDz()
+{
+ if (fDz > 0) return;
+ fDz = (TMath::Abs(fInnerZ - fOuterZ)
+ + fOuter->GetSiThickness()
+ + fOuter->GetPrintboardThickness()
+ + fOuter->GetLegLength()
+ + fOuter->GetModuleSpacing()
+ + fHoneycombThickness) / 2;
+}