Hi Andrei, Thanks for your help. I just have a simple request since you are working on improvements. TGeoVolume's can be created by two methods 1) TGeoManager::Make****() where **** is the shape name or 2) TGeo****() *shape = new TGeo****() constructor TGeoVolume *volume = new TGeoVolume("name",shape,material); The advantage of 2) is that if you create a TGeoBBox you can use the method TGeoBBox::CouldBeCrossed() to quickly see if a track might cross that volume. If you use method 1) you do not have access to the TGeoBBox for that volume that was created and thus cannot call TGeoBBox::CouldBeCrossed() for that volume. Obviously, method 1) is preferred since it is much simpler. I have notice that there is a method TGeoShape::ComputeBBox(), but it does not return TGeoBBox. I assume that this is a method to be implemented in all the different shape classes and will return the TGeoBBox associated with each shape. If this TGeoBBox were available for each volume in the geometry then the CouldBeCrossed() method could be used. This would be my request. Thanks Kerry -----Original Message----- From: Andrei Gheata To: LEE, KERRY T. (JSC-SR) (UHCL) Cc: 'roottalk@pcroot.cern.ch ' Sent: 9/27/2002 4:06 AM Subject: Re: [ROOT] TGeoManager::FindNextBoundary() Hi Kerry, I am glad to see that people started to use the new geometry package. There is basically nothing wrong with your setup, the problem is that you were shooting your ray exactly parallel to the Z axis and there was a bug in TGeoBBox class related to this. In fact, I have several improvements related to the tracking algorithms in my current working version, as well as new features (boolean shapes, voxelization optimisations, ...). These will be available in CVS in the next one or two weeks, supporting I/O for the geometry classes. Anyway, I have slightly modified your simple macro that now looks like this : TestGeo.cxx { gInterpreter->ExecuteMacro("TeleGeo.cxx"); geom->CloseGeometry(); geom->SetVisLevel(4); top->Draw(); Double_t point[3], dircos[3]; point[0] = -8.984; point[1] = 0.0; point[2] = 7.8; Double_t theta = 180.; Double_t phi = 0.; Double_t degrad = TMath::Pi()/180.; // better this way dircos[0] = TMath::Sin(theta*degrad)*TMath::Cos(phi*degrad); dircos[1] = TMath::Sin(theta*degrad)*TMath::Sin(phi*degrad); dircos[2] = TMath::Cos(theta*degrad); printf("direction : %f %f %f\n", dircos[0], dircos[1], dircos[2]); geom->InitTrack(point,dircos); while (!geom->IsOutside()) { // you should use this to propagate till outside printf("current : %s\n", geom->GetPath()); geom->FindNextBoundary(); cout<<"Distance to Boundary is "<<geom->GetStep()<<" cm."<<endl; geom->Step(); } } this produces the following output with my working version : direction : 0.000000 0.000000 -1.000000 current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.18725 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/PSD1_1 Distance to Boundary is 0.0315 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 1.8735 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/PSD2_1 Distance to Boundary is 0.0315 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 1.1349 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/Brass_3 Distance to Boundary is 0.0127 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.1873 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/Brass_4 Distance to Boundary is 0.0127 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.76865 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/B1_1 Distance to Boundary is 0.5 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.158 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/B2_1 Distance to Boundary is 0.5 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.239 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/B3_1 Distance to Boundary is 0.5 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 0.158 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1/B4_1 Distance to Boundary is 0.5 cm. current : /TOP_1/MARIE_1/Outer_1/Inner_1 Distance to Boundary is 10.9645 cm. current : /TOP_1/MARIE_1/Outer_1 Distance to Boundary is 0.1905 cm. current : /TOP_1/MARIE_1 Distance to Boundary is 14.85 cm. current : /TOP_1 Distance to Boundary is 775 cm. which is correct. Shooting random rays at the level of your Inner volume also produces correct picture. Best regards, Andrei LEE, KERRY T. (JSC-SR) (UHCL) wrote: >Hi, > >I am trying to use the TGeoManager::FindNextBoundary() function to pass >tracks through my geometry to tell me how far I've traveled in a given >volume, by getting the step result from TGeoManager::GetStep(). After >passing through 1 or 2 volumes TGeoManager::GetStep() becomes 1e+30, when in >fact there are other volumes that should be intersected at a distance on the >order of 1.0. Am I doing something wrong? > >I am attaching the geometry file and the simple macro I used to step through >the geometry. > >I using ROOT v3.03.09 on Red Hat 7.1. > >Thanks >Kerry > > >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:11 MET