Hello,
I’ve just resumed working on a small ROOT project (using v4.03.02) using the geometry facilities of ROOT.
My problem is to shift around a volume via TGeoPhysicalNode::Align() which contains two daughters. I do not know how this is supposed to be coded, as just creating one physical node for the mother and aligning it doesn’t work.
Like this:
//geometry creation
top = gGeoManager->MakeBox("TOP",Vac,2 * meter, 2 * meter, 2 * meter);
sct = gGeoManager->MakeBox("SCT",Vac,10 * cm,10 * cm,1 * cm);
sct_wafer = gGeoManager->MakeTrap("SCT_Wafer", Si, ModuleHalfLenghtZ, ...
combi1 = new TGeoCombiTrans(0, 0, 482.5 * micron, r_phi);
combi2 = new TGeoCombiTrans(0, 0, -482.5 * micron,stereo);
sct->AddNode(sct_wafer,1,combi1);
sct->AddNode(sct_wafer,2,combi2); //sct contains two daughters
top->AddNode(sct,1);
gGeoManager->SetTopVolume(top);
gGeoManager->CloseGeometry();
node = gGeoManager->MakePhysicalNode("/TOP_1/SCT_1");
//aligning - to be called often
if (node->IsAligned())
{
ph = (TGeoCombiTrans*)node->GetNode()->GetMatrix();
} else {
ph = new TGeoCombiTrans();
}
ph->SetTranslation(SCT_Pos_x,SCT_Pos_y,SCT_Pos_z);
node-> Align(ph);
I’ve also tried to create PhysicalNodes for the daughters as well with no noticeable effect. Maybe I don’t really understand the hint in the documentation of TGeoPhysicalNode::Align()
The simplest solution would be to align just the two daughters instead of the mother volume… Is there a more elegant way, as this gets rather complicated for more than just two daughter volumes?
Thanks very much
Tobias