00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "Riostream.h"
00027 #include "TObject.h"
00028 #include "TGeoMatrix.h"
00029 #include "TGeoPara.h"
00030 #include "TGeoArb8.h"
00031 #include "TGeoNode.h"
00032 #include "TGeoManager.h"
00033 #include "TMath.h"
00034
00035 #include "TGeoPatternFinder.h"
00036
00037 ClassImp(TGeoPatternFinder)
00038 ClassImp(TGeoPatternX)
00039 ClassImp(TGeoPatternY)
00040 ClassImp(TGeoPatternZ)
00041 ClassImp(TGeoPatternParaX)
00042 ClassImp(TGeoPatternParaY)
00043 ClassImp(TGeoPatternParaZ)
00044 ClassImp(TGeoPatternTrapZ)
00045 ClassImp(TGeoPatternCylR)
00046 ClassImp(TGeoPatternCylPhi)
00047 ClassImp(TGeoPatternSphR)
00048 ClassImp(TGeoPatternSphTheta)
00049 ClassImp(TGeoPatternSphPhi)
00050 ClassImp(TGeoPatternHoneycomb)
00051
00052
00053
00054 TGeoPatternFinder::TGeoPatternFinder()
00055 {
00056
00057 fMatrix = 0;
00058 fCurrent = -1;
00059 fNdivisions = 0;
00060 fDivIndex = 0;
00061 fStep = 0;
00062 fStart = 0;
00063 fEnd = 0;
00064 fVolume = 0;
00065 fNextIndex = -1;
00066 }
00067
00068
00069 TGeoPatternFinder::TGeoPatternFinder(TGeoVolume *vol, Int_t ndiv)
00070 {
00071
00072 fVolume = vol;
00073 fMatrix = 0;
00074 fCurrent = -1;
00075 fNdivisions = ndiv;
00076 fDivIndex = 0;
00077 fStep = 0;
00078 fStart = 0;
00079 fEnd = 0;
00080 fNextIndex = -1;
00081 }
00082
00083
00084 TGeoPatternFinder::TGeoPatternFinder(const TGeoPatternFinder& pf) :
00085 TObject(pf),
00086 fStep(pf.fStep),
00087 fStart(pf.fStart),
00088 fEnd(pf.fEnd),
00089 fCurrent(pf.fCurrent),
00090 fNdivisions(pf.fNdivisions),
00091 fDivIndex(pf.fDivIndex),
00092 fMatrix(pf.fMatrix),
00093 fVolume(pf.fVolume),
00094 fNextIndex(pf.fNextIndex)
00095 {
00096
00097 }
00098
00099
00100 TGeoPatternFinder& TGeoPatternFinder::operator=(const TGeoPatternFinder& pf)
00101 {
00102
00103 if(this!=&pf) {
00104 TObject::operator=(pf);
00105 fStep=pf.fStep;
00106 fStart=pf.fStart;
00107 fEnd=pf.fEnd;
00108 fCurrent=pf.fCurrent;
00109 fNdivisions=pf.fNdivisions;
00110 fDivIndex=pf.fDivIndex;
00111 fMatrix=pf.fMatrix;
00112 fVolume=pf.fVolume;
00113 fNextIndex = pf.fNextIndex;
00114 }
00115 return *this;
00116 }
00117
00118
00119 TGeoPatternFinder::~TGeoPatternFinder()
00120 {
00121
00122 }
00123
00124
00125 TGeoNode *TGeoPatternFinder::CdNext()
00126 {
00127
00128 if (fNextIndex < 0) return NULL;
00129 cd(fNextIndex);
00130 return GetNodeOffset(fCurrent);
00131 }
00132
00133
00134 TGeoPatternFinder *TGeoPatternFinder::MakeCopy(Bool_t)
00135 {
00136
00137 return NULL;
00138 }
00139
00140
00141
00142
00143
00144
00145 TGeoPatternX::TGeoPatternX()
00146 {
00147
00148 }
00149
00150
00151 TGeoPatternX::TGeoPatternX(TGeoVolume *vol, Int_t ndivisions)
00152 :TGeoPatternFinder(vol, ndivisions)
00153 {
00154
00155 Double_t dx = ((TGeoBBox*)vol->GetShape())->GetDX();
00156 fStart = -dx;
00157 fEnd = dx;
00158 fStep = 2*dx/ndivisions;
00159 fMatrix = new TGeoTranslation(0,0,0);
00160 fMatrix->RegisterYourself();
00161 }
00162
00163
00164 TGeoPatternX::TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00165 :TGeoPatternFinder(vol, ndivisions)
00166 {
00167
00168 Double_t dx = ((TGeoBBox*)vol->GetShape())->GetDX();
00169 fStart = -dx;
00170 fEnd = fStart + ndivisions*step;
00171 fStep = step;
00172 fMatrix = new TGeoTranslation(0,0,0);
00173 fMatrix->RegisterYourself();
00174 }
00175
00176
00177 TGeoPatternX::TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00178 :TGeoPatternFinder(vol, ndivisions)
00179 {
00180
00181 fStart = start;
00182 fEnd = end;
00183 fStep = (end - start)/ndivisions;
00184 fMatrix = new TGeoTranslation(0,0,0);
00185 fMatrix->RegisterYourself();
00186 }
00187
00188
00189 void TGeoPatternX::cd(Int_t idiv)
00190 {
00191
00192 fCurrent=idiv;
00193 fMatrix->SetDx(fStart+idiv*fStep+0.5*fStep);
00194 }
00195
00196
00197 TGeoPatternX::~TGeoPatternX()
00198 {
00199
00200 }
00201
00202
00203 Bool_t TGeoPatternX::IsOnBoundary(const Double_t *point) const
00204 {
00205
00206 Double_t seg = (point[0]-fStart)/fStep;
00207 Double_t diff = seg - Int_t(seg);
00208 if (diff>0.5) diff = 1.-diff;
00209 if (diff<1e-8) return kTRUE;
00210 return kFALSE;
00211 }
00212
00213
00214 TGeoNode *TGeoPatternX::FindNode(Double_t *point, const Double_t *dir)
00215 {
00216
00217 TGeoNode *node = 0;
00218 Int_t ind = (Int_t)(1.+(point[0]-fStart)/fStep) - 1;
00219 if (dir) {
00220 fNextIndex = ind;
00221 if (dir[0]>0) fNextIndex++;
00222 else fNextIndex--;
00223 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00224 }
00225 if ((ind<0) || (ind>=fNdivisions)) return node;
00226 node = GetNodeOffset(ind);
00227 cd(ind);
00228 return node;
00229 }
00230
00231
00232 Double_t TGeoPatternX::FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
00233 {
00234
00235
00236 indnext = -1;
00237 Double_t dist = TGeoShape::Big();
00238 if (TMath::Abs(dir[0])<TGeoShape::Tolerance()) return dist;
00239 if (fCurrent<0) {
00240 Error("FindNextBoundary", "Must call FindNode first");
00241 return dist;
00242 }
00243 Int_t inc = (dir[0]>0)?1:0;
00244 dist = (fStep*(fCurrent+inc)-point[0])/dir[0];
00245 if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
00246 if (!inc) inc = -1;
00247 indnext = fCurrent+inc;
00248 return dist;
00249 }
00250
00251
00252 TGeoPatternFinder *TGeoPatternX::MakeCopy(Bool_t reflect)
00253 {
00254
00255 TGeoPatternX *finder = new TGeoPatternX(*this);
00256 if (!reflect) return finder;
00257 Reflect();
00258 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00259 combi->ReflectZ(kTRUE);
00260 combi->ReflectZ(kFALSE);
00261 combi->RegisterYourself();
00262 fMatrix = combi;
00263 return finder;
00264 }
00265
00266
00267 void TGeoPatternX::SavePrimitive(ostream &out, Option_t * )
00268 {
00269
00270 Int_t iaxis = 1;
00271 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00272 }
00273
00274
00275
00276
00277
00278
00279
00280 TGeoPatternY::TGeoPatternY()
00281 {
00282
00283 }
00284
00285
00286 TGeoPatternY::TGeoPatternY(TGeoVolume *vol, Int_t ndivisions)
00287 :TGeoPatternFinder(vol, ndivisions)
00288 {
00289
00290 Double_t dy = ((TGeoBBox*)vol->GetShape())->GetDY();
00291 fStart = -dy;
00292 fEnd = dy;
00293 fStep = 2*dy/ndivisions;
00294 fMatrix = new TGeoTranslation(0,0,0);
00295 fMatrix->RegisterYourself();
00296 }
00297
00298
00299 TGeoPatternY::TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00300 :TGeoPatternFinder(vol, ndivisions)
00301 {
00302
00303 Double_t dy = ((TGeoBBox*)vol->GetShape())->GetDY();
00304 fStart = -dy;
00305 fEnd = fStart + ndivisions*step;
00306 fStep = step;
00307 fMatrix = new TGeoTranslation(0,0,0);
00308 fMatrix->RegisterYourself();
00309 }
00310
00311
00312 TGeoPatternY::TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00313 :TGeoPatternFinder(vol, ndivisions)
00314 {
00315
00316 fStart = start;
00317 fEnd = end;
00318 fStep = (end - start)/ndivisions;
00319 fMatrix = new TGeoTranslation(0,0,0);
00320 fMatrix->RegisterYourself();
00321 }
00322
00323
00324 TGeoPatternY::~TGeoPatternY()
00325 {
00326
00327 }
00328
00329
00330 void TGeoPatternY::cd(Int_t idiv)
00331 {
00332
00333 fCurrent=idiv;
00334 fMatrix->SetDy(fStart+idiv*fStep+0.5*fStep);
00335 }
00336
00337
00338 Bool_t TGeoPatternY::IsOnBoundary(const Double_t *point) const
00339 {
00340
00341 Double_t seg = (point[1]-fStart)/fStep;
00342 Double_t diff = seg - Int_t(seg);
00343 if (diff>0.5) diff = 1.-diff;
00344 if (diff<1e-8) return kTRUE;
00345 return kFALSE;
00346 }
00347
00348
00349 TGeoNode *TGeoPatternY::FindNode(Double_t *point, const Double_t *dir)
00350 {
00351
00352 TGeoNode *node = 0;
00353 Int_t ind = (Int_t)(1.+(point[1]-fStart)/fStep) - 1;
00354 if (dir) {
00355 fNextIndex = ind;
00356 if (dir[1]>0) fNextIndex++;
00357 else fNextIndex--;
00358 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00359 }
00360 if ((ind<0) || (ind>=fNdivisions)) return node;
00361 node = GetNodeOffset(ind);
00362 cd(ind);
00363 return node;
00364 }
00365
00366
00367 Double_t TGeoPatternY::FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
00368 {
00369
00370
00371 indnext = -1;
00372 Double_t dist = TGeoShape::Big();
00373 if (TMath::Abs(dir[1])<TGeoShape::Tolerance()) return dist;
00374 if (fCurrent<0) {
00375 Error("FindNextBoundary", "Must call FindNode first");
00376 return dist;
00377 }
00378 Int_t inc = (dir[1]>0)?1:0;
00379 dist = (fStep*(fCurrent+inc)-point[1])/dir[1];
00380 if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
00381 if (!inc) inc = -1;
00382 indnext = fCurrent+inc;
00383 return dist;
00384 }
00385
00386
00387 TGeoPatternFinder *TGeoPatternY::MakeCopy(Bool_t reflect)
00388 {
00389
00390 TGeoPatternY *finder = new TGeoPatternY(*this);
00391 if (!reflect) return finder;
00392 Reflect();
00393 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00394 combi->ReflectZ(kTRUE);
00395 combi->ReflectZ(kFALSE);
00396 combi->RegisterYourself();
00397 fMatrix = combi;
00398 return finder;
00399 }
00400
00401
00402 void TGeoPatternY::SavePrimitive(ostream &out, Option_t * )
00403 {
00404
00405 Int_t iaxis = 2;
00406 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00407 }
00408
00409
00410
00411
00412
00413
00414
00415 TGeoPatternZ::TGeoPatternZ()
00416 {
00417
00418 }
00419
00420 TGeoPatternZ::TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions)
00421 :TGeoPatternFinder(vol, ndivisions)
00422 {
00423
00424 Double_t dz = ((TGeoBBox*)vol->GetShape())->GetDZ();
00425 fStart = -dz;
00426 fEnd = dz;
00427 fStep = 2*dz/ndivisions;
00428 fMatrix = new TGeoTranslation(0,0,0);
00429 fMatrix->RegisterYourself();
00430 }
00431
00432 TGeoPatternZ::TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00433 :TGeoPatternFinder(vol, ndivisions)
00434 {
00435
00436 Double_t dz = ((TGeoBBox*)vol->GetShape())->GetDZ();
00437 fStart = -dz;
00438 fEnd = fStart + ndivisions*step;
00439 fStep = step;
00440 fMatrix = new TGeoTranslation(0,0,0);
00441 fMatrix->RegisterYourself();
00442 }
00443
00444 TGeoPatternZ::TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00445 :TGeoPatternFinder(vol, ndivisions)
00446 {
00447
00448 fStart = start;
00449 fEnd = end;
00450 fStep = (end - start)/ndivisions;
00451 fMatrix = new TGeoTranslation(0,0,0);
00452 fMatrix->RegisterYourself();
00453 }
00454
00455 TGeoPatternZ::~TGeoPatternZ()
00456 {
00457
00458 }
00459
00460 void TGeoPatternZ::cd(Int_t idiv)
00461 {
00462
00463 fCurrent=idiv;
00464 fMatrix->SetDz(((IsReflected())?-1.:1.)*(fStart+idiv*fStep+0.5*fStep));
00465 }
00466
00467
00468 Bool_t TGeoPatternZ::IsOnBoundary(const Double_t *point) const
00469 {
00470
00471 Double_t seg = (point[2]-fStart)/fStep;
00472 Double_t diff = seg - Int_t(seg);
00473 if (diff>0.5) diff = 1.-diff;
00474 if (diff<1e-8) return kTRUE;
00475 return kFALSE;
00476 }
00477
00478
00479 TGeoNode *TGeoPatternZ::FindNode(Double_t *point, const Double_t *dir)
00480 {
00481
00482 TGeoNode *node = 0;
00483 Int_t ind = (Int_t)(1.+(point[2]-fStart)/fStep) - 1;
00484 if (dir) {
00485 fNextIndex = ind;
00486 if (dir[2]>0) fNextIndex++;
00487 else fNextIndex--;
00488 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00489 }
00490 if ((ind<0) || (ind>=fNdivisions)) return node;
00491 node = GetNodeOffset(ind);
00492 cd(ind);
00493 return node;
00494 }
00495
00496
00497 Double_t TGeoPatternZ::FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
00498 {
00499
00500
00501 indnext = -1;
00502 Double_t dist = TGeoShape::Big();
00503 if (TMath::Abs(dir[2])<TGeoShape::Tolerance()) return dist;
00504 if (fCurrent<0) {
00505 Error("FindNextBoundary", "Must call FindNode first");
00506 return dist;
00507 }
00508 Int_t inc = (dir[2]>0)?1:0;
00509 dist = (fStep*(fCurrent+inc)-point[2])/dir[2];
00510 if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
00511 if (!inc) inc = -1;
00512 indnext = fCurrent+inc;
00513 return dist;
00514 }
00515
00516
00517 TGeoPatternFinder *TGeoPatternZ::MakeCopy(Bool_t reflect)
00518 {
00519
00520 TGeoPatternZ *finder = new TGeoPatternZ(*this);
00521 if (!reflect) return finder;
00522 Reflect();
00523 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00524 combi->ReflectZ(kTRUE);
00525 combi->ReflectZ(kFALSE);
00526 combi->RegisterYourself();
00527 fMatrix = combi;
00528 return finder;
00529 }
00530
00531
00532 void TGeoPatternZ::SavePrimitive(ostream &out, Option_t * )
00533 {
00534
00535 Int_t iaxis = 3;
00536 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00537 }
00538
00539
00540
00541
00542
00543
00544 TGeoPatternParaX::TGeoPatternParaX()
00545 {
00546
00547 }
00548
00549 TGeoPatternParaX::TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions)
00550 :TGeoPatternFinder(vol, ndivisions)
00551 {
00552
00553 Double_t dx = ((TGeoPara*)vol->GetShape())->GetX();
00554 fStart = -dx;
00555 fEnd = dx;
00556 fStep = 2*dx/ndivisions;
00557 fMatrix = new TGeoTranslation(0,0,0);
00558 fMatrix->RegisterYourself();
00559 }
00560
00561 TGeoPatternParaX::TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00562 :TGeoPatternFinder(vol, ndivisions)
00563 {
00564
00565 Double_t dx = ((TGeoPara*)vol->GetShape())->GetX();
00566 fStart = -dx;
00567 fEnd = fStart + ndivisions*step;
00568 fStep = step;
00569 fMatrix = new TGeoTranslation(0,0,0);
00570 fMatrix->RegisterYourself();
00571 }
00572
00573 TGeoPatternParaX::TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00574 :TGeoPatternFinder(vol, ndivisions)
00575 {
00576
00577 fStart = start;
00578 fEnd = end;
00579 fStep = (end - start)/ndivisions;
00580 fMatrix = new TGeoTranslation(0,0,0);
00581 fMatrix->RegisterYourself();
00582 }
00583
00584 TGeoPatternParaX::~TGeoPatternParaX()
00585 {
00586
00587 }
00588
00589 void TGeoPatternParaX::cd(Int_t idiv)
00590 {
00591
00592 fCurrent=idiv;
00593 fMatrix->SetDx(fStart+idiv*fStep+0.5*fStep);
00594 }
00595
00596
00597 Bool_t TGeoPatternParaX::IsOnBoundary(const Double_t *point) const
00598 {
00599
00600 Double_t txy = ((TGeoPara*)fVolume->GetShape())->GetTxy();
00601 Double_t txz = ((TGeoPara*)fVolume->GetShape())->GetTxz();
00602 Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
00603 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
00604 Double_t seg = (xt-fStart)/fStep;
00605 Double_t diff = seg - Int_t(seg);
00606 if (diff>0.5) diff = 1.-diff;
00607 if (diff<1e-8) return kTRUE;
00608 return kFALSE;
00609 }
00610
00611
00612 TGeoNode *TGeoPatternParaX::FindNode(Double_t *point, const Double_t *dir)
00613 {
00614
00615 TGeoNode *node = 0;
00616 Double_t txy = ((TGeoPara*)fVolume->GetShape())->GetTxy();
00617 Double_t txz = ((TGeoPara*)fVolume->GetShape())->GetTxz();
00618 Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
00619 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
00620 Int_t ind = (Int_t)(1.+(xt-fStart)/fStep)-1;
00621 if (dir) {
00622 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
00623 Double_t divdirx = 1./TMath::Sqrt(1.+ttsq);
00624 Double_t divdiry = -txy*divdirx;
00625 Double_t divdirz = -(txz-txy*tyz)*divdirx;
00626 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
00627 fNextIndex = ind;
00628 if (dot>0) fNextIndex++;
00629 else fNextIndex--;
00630 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00631 }
00632 if ((ind<0) || (ind>=fNdivisions)) return node;
00633 node = GetNodeOffset(ind);
00634 cd(ind);
00635 return node;
00636 }
00637
00638
00639 TGeoPatternFinder *TGeoPatternParaX::MakeCopy(Bool_t reflect)
00640 {
00641
00642 TGeoPatternParaX *finder = new TGeoPatternParaX(*this);
00643 if (!reflect) return finder;
00644 Reflect();
00645 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00646 combi->ReflectZ(kTRUE);
00647 combi->ReflectZ(kFALSE);
00648 combi->RegisterYourself();
00649 fMatrix = combi;
00650 return finder;
00651 }
00652
00653
00654 void TGeoPatternParaX::SavePrimitive(ostream &out, Option_t * )
00655 {
00656
00657 Int_t iaxis = 1;
00658 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00659 }
00660
00661
00662
00663
00664
00665
00666 TGeoPatternParaY::TGeoPatternParaY()
00667 {
00668
00669 fTxy = 0;
00670 }
00671
00672 TGeoPatternParaY::TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions)
00673 :TGeoPatternFinder(vol, ndivisions)
00674 {
00675
00676 fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
00677 Double_t dy = ((TGeoPara*)vol->GetShape())->GetY();
00678 fStart = -dy;
00679 fEnd = dy;
00680 fStep = 2*dy/ndivisions;
00681 fMatrix = new TGeoTranslation(0,0,0);
00682 fMatrix->RegisterYourself();
00683 }
00684
00685 TGeoPatternParaY::TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00686 :TGeoPatternFinder(vol, ndivisions)
00687 {
00688
00689 fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
00690 Double_t dy = ((TGeoPara*)vol->GetShape())->GetY();
00691 fStart = -dy;
00692 fEnd = fStart + ndivisions*step;
00693 fStep = step;
00694 fMatrix = new TGeoTranslation(0,0,0);
00695 fMatrix->RegisterYourself();
00696 }
00697
00698 TGeoPatternParaY::TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00699 :TGeoPatternFinder(vol, ndivisions)
00700 {
00701
00702 fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
00703 fStart = start;
00704 fEnd = end;
00705 fStep = (end - start)/ndivisions;
00706 fMatrix = new TGeoTranslation(0,0,0);
00707 fMatrix->RegisterYourself();
00708 }
00709
00710 TGeoPatternParaY::~TGeoPatternParaY()
00711 {
00712
00713 }
00714
00715 void TGeoPatternParaY::cd(Int_t idiv)
00716 {
00717
00718 fCurrent = idiv;
00719 Double_t dy = fStart+idiv*fStep+0.5*fStep;
00720 fMatrix->SetDx(fTxy*dy);
00721 fMatrix->SetDy(dy);
00722 }
00723
00724
00725 Bool_t TGeoPatternParaY::IsOnBoundary(const Double_t *point) const
00726 {
00727
00728 Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
00729 Double_t yt = point[1]-tyz*point[2];
00730 Double_t seg = (yt-fStart)/fStep;
00731 Double_t diff = seg - Int_t(seg);
00732 if (diff>0.5) diff = 1.-diff;
00733 if (diff<1e-8) return kTRUE;
00734 return kFALSE;
00735 }
00736
00737
00738 TGeoNode *TGeoPatternParaY::FindNode(Double_t *point, const Double_t *dir)
00739 {
00740
00741 TGeoNode *node = 0;
00742 Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
00743 Double_t yt = point[1]-tyz*point[2];
00744 Int_t ind = (Int_t)(1.+(yt-fStart)/fStep) - 1;
00745 if (dir) {
00746 Double_t divdiry = 1./TMath::Sqrt(1.+tyz*tyz);
00747 Double_t divdirz = -tyz*divdiry;
00748 Double_t dot = dir[1]*divdiry + dir[2]*divdirz;
00749 fNextIndex = ind;
00750 if (dot>0) fNextIndex++;
00751 else fNextIndex--;
00752 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00753 }
00754 if ((ind<0) || (ind>=fNdivisions)) return node;
00755 node = GetNodeOffset(ind);
00756 cd(ind);
00757 return node;
00758 }
00759
00760
00761 TGeoPatternFinder *TGeoPatternParaY::MakeCopy(Bool_t reflect)
00762 {
00763
00764 TGeoPatternParaY *finder = new TGeoPatternParaY(*this);
00765 if (!reflect) return finder;
00766 Reflect();
00767 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00768 combi->ReflectZ(kTRUE);
00769 combi->ReflectZ(kFALSE);
00770 combi->RegisterYourself();
00771 fMatrix = combi;
00772 return finder;
00773 }
00774
00775
00776 void TGeoPatternParaY::SavePrimitive(ostream &out, Option_t * )
00777 {
00778
00779 Int_t iaxis = 2;
00780 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00781 }
00782
00783
00784
00785
00786
00787
00788 TGeoPatternParaZ::TGeoPatternParaZ()
00789 {
00790
00791 fTxz = 0;
00792 fTyz = 0;
00793 }
00794
00795 TGeoPatternParaZ::TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions)
00796 :TGeoPatternFinder(vol, ndivisions)
00797 {
00798
00799 fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
00800 fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
00801 Double_t dz = ((TGeoPara*)vol->GetShape())->GetZ();
00802 fStart = -dz;
00803 fEnd = dz;
00804 fStep = 2*dz/ndivisions;
00805 fMatrix = new TGeoTranslation(0,0,0);
00806 fMatrix->RegisterYourself();
00807 }
00808
00809 TGeoPatternParaZ::TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00810 :TGeoPatternFinder(vol, ndivisions)
00811 {
00812
00813 fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
00814 fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
00815 Double_t dz = ((TGeoPara*)vol->GetShape())->GetZ();
00816 fStart = -dz;
00817 fEnd = fStart + ndivisions*step;
00818 fStep = step;
00819 fMatrix = new TGeoTranslation(0,0,0);
00820 fMatrix->RegisterYourself();
00821 }
00822
00823
00824 TGeoPatternParaZ::TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00825 :TGeoPatternFinder(vol, ndivisions)
00826 {
00827
00828 fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
00829 fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
00830 fStart = start;
00831 fEnd = end;
00832 fStep = (end - start)/ndivisions;
00833 fMatrix = new TGeoTranslation(0,0,0);
00834 fMatrix->RegisterYourself();
00835 }
00836
00837
00838 TGeoPatternParaZ::~TGeoPatternParaZ()
00839 {
00840
00841 }
00842
00843
00844 void TGeoPatternParaZ::cd(Int_t idiv)
00845 {
00846
00847 fCurrent = idiv;
00848 Double_t dz = fStart+idiv*fStep+0.5*fStep;
00849 fMatrix->SetDx(fTxz*dz);
00850 fMatrix->SetDy(fTyz*dz);
00851 fMatrix->SetDz((IsReflected())?-dz:dz);
00852 }
00853
00854
00855 Bool_t TGeoPatternParaZ::IsOnBoundary(const Double_t *point) const
00856 {
00857
00858 Double_t seg = (point[2]-fStart)/fStep;
00859 Double_t diff = seg - Int_t(seg);
00860 if (diff>0.5) diff = 1.-diff;
00861 if (diff<1e-8) return kTRUE;
00862 return kFALSE;
00863 }
00864
00865
00866 TGeoNode *TGeoPatternParaZ::FindNode(Double_t *point, const Double_t *dir)
00867 {
00868
00869 TGeoNode *node = 0;
00870 Double_t zt = point[2];
00871 Int_t ind = (Int_t)(1.+(zt-fStart)/fStep) - 1;
00872 if (dir) {
00873 fNextIndex = ind;
00874 if (dir[2]>0) fNextIndex++;
00875 else fNextIndex--;
00876 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
00877 }
00878 if ((ind<0) || (ind>=fNdivisions)) return node;
00879 node = GetNodeOffset(ind);
00880 cd(ind);
00881 return node;
00882 }
00883
00884
00885 TGeoPatternFinder *TGeoPatternParaZ::MakeCopy(Bool_t reflect)
00886 {
00887
00888 TGeoPatternParaZ *finder = new TGeoPatternParaZ(*this);
00889 if (!reflect) return finder;
00890 Reflect();
00891 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
00892 combi->ReflectZ(kTRUE);
00893 combi->ReflectZ(kFALSE);
00894 combi->RegisterYourself();
00895 fMatrix = combi;
00896 return finder;
00897 }
00898
00899
00900 void TGeoPatternParaZ::SavePrimitive(ostream &out, Option_t * )
00901 {
00902
00903 Int_t iaxis = 3;
00904 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
00905 }
00906
00907
00908
00909
00910
00911
00912 TGeoPatternTrapZ::TGeoPatternTrapZ()
00913 {
00914
00915 fTxz = 0;
00916 fTyz = 0;
00917 }
00918
00919 TGeoPatternTrapZ::TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions)
00920 :TGeoPatternFinder(vol, ndivisions)
00921 {
00922
00923 Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
00924 Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
00925 fTxz = TMath::Tan(theta*TMath::DegToRad())*TMath::Cos(phi*TMath::DegToRad());
00926 fTyz = TMath::Tan(theta*TMath::DegToRad())*TMath::Sin(phi*TMath::DegToRad());
00927 Double_t dz = ((TGeoArb8*)vol->GetShape())->GetDz();
00928 fStart = -dz;
00929 fEnd = dz;
00930 fStep = 2*dz/ndivisions;
00931 fMatrix = new TGeoTranslation(0,0,0);
00932 fMatrix->RegisterYourself();
00933 }
00934
00935 TGeoPatternTrapZ::TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t step)
00936 :TGeoPatternFinder(vol, ndivisions)
00937 {
00938
00939 Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
00940 Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
00941 fTxz = TMath::Tan(theta*TMath::DegToRad())*TMath::Cos(phi*TMath::DegToRad());
00942 fTyz = TMath::Tan(theta*TMath::DegToRad())*TMath::Sin(phi*TMath::DegToRad());
00943 Double_t dz = ((TGeoArb8*)vol->GetShape())->GetDz();
00944 fStart = -dz;
00945 fEnd = fStart + ndivisions*step;
00946 fStep = step;
00947 fMatrix = new TGeoTranslation(0,0,0);
00948 fMatrix->RegisterYourself();
00949 }
00950
00951 TGeoPatternTrapZ::TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
00952 :TGeoPatternFinder(vol, ndivisions)
00953 {
00954
00955 Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
00956 Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
00957 fTxz = TMath::Tan(theta*TMath::DegToRad())*TMath::Cos(phi*TMath::DegToRad());
00958 fTyz = TMath::Tan(theta*TMath::DegToRad())*TMath::Sin(phi*TMath::DegToRad());
00959 fStart = start;
00960 fEnd = end;
00961 fStep = (end - start)/ndivisions;
00962 fMatrix = new TGeoTranslation(0,0,0);
00963 fMatrix->RegisterYourself();
00964 }
00965
00966 TGeoPatternTrapZ::~TGeoPatternTrapZ()
00967 {
00968
00969 }
00970
00971 void TGeoPatternTrapZ::cd(Int_t idiv)
00972 {
00973
00974 fCurrent = idiv;
00975 Double_t dz = fStart+idiv*fStep+0.5*fStep;
00976 fMatrix->SetDx(fTxz*dz);
00977 fMatrix->SetDy(fTyz*dz);
00978 fMatrix->SetDz((IsReflected())?-dz:dz);
00979 }
00980
00981
00982 Bool_t TGeoPatternTrapZ::IsOnBoundary(const Double_t *point) const
00983 {
00984
00985 Double_t seg = (point[2]-fStart)/fStep;
00986 Double_t diff = seg - Int_t(seg);
00987 if (diff>0.5) diff = 1.-diff;
00988 if (diff<1e-8) return kTRUE;
00989 return kFALSE;
00990 }
00991
00992
00993 TGeoNode *TGeoPatternTrapZ::FindNode(Double_t *point, const Double_t *dir)
00994 {
00995
00996 TGeoNode *node = 0;
00997 Double_t zt = point[2];
00998 Int_t ind = (Int_t)(1. + (zt-fStart)/fStep) - 1;
00999 if (dir) {
01000 fNextIndex = ind;
01001 if (dir[2]>0) fNextIndex++;
01002 else fNextIndex--;
01003 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
01004 }
01005 if ((ind<0) || (ind>=fNdivisions)) return node;
01006 node = GetNodeOffset(ind);
01007 cd(ind);
01008 return node;
01009 }
01010
01011
01012 TGeoPatternFinder *TGeoPatternTrapZ::MakeCopy(Bool_t reflect)
01013 {
01014
01015 TGeoPatternTrapZ *finder = new TGeoPatternTrapZ(*this);
01016 if (!reflect) return finder;
01017 Reflect();
01018 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
01019 combi->ReflectZ(kTRUE);
01020 combi->ReflectZ(kFALSE);
01021 combi->RegisterYourself();
01022 fMatrix = combi;
01023 return finder;
01024 }
01025
01026
01027 void TGeoPatternTrapZ::SavePrimitive(ostream &out, Option_t * )
01028 {
01029
01030 Int_t iaxis = 3;
01031 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01032 }
01033
01034
01035
01036
01037
01038
01039
01040 TGeoPatternCylR::TGeoPatternCylR()
01041 {
01042
01043 fMatrix = 0;
01044 }
01045
01046 TGeoPatternCylR::TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions)
01047 :TGeoPatternFinder(vol, ndivisions)
01048 {
01049
01050 fMatrix = gGeoIdentity;
01051
01052 }
01053
01054 TGeoPatternCylR::TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t step)
01055 :TGeoPatternFinder(vol, ndivisions)
01056 {
01057
01058 fStep = step;
01059 fMatrix = gGeoIdentity;
01060
01061 }
01062
01063 TGeoPatternCylR::TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
01064 :TGeoPatternFinder(vol, ndivisions)
01065 {
01066
01067 fStart = start;
01068 fEnd = end;
01069 fStep = (end - start)/ndivisions;
01070 fMatrix = gGeoIdentity;
01071 }
01072
01073 TGeoPatternCylR::~TGeoPatternCylR()
01074 {
01075
01076 }
01077
01078
01079 Bool_t TGeoPatternCylR::IsOnBoundary(const Double_t *point) const
01080 {
01081
01082 Double_t r = TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
01083 Double_t seg = (r-fStart)/fStep;
01084 Double_t diff = seg - Int_t(seg);
01085 if (diff>0.5) diff = 1.-diff;
01086 if (diff<1e-8) return kTRUE;
01087 return kFALSE;
01088 }
01089
01090
01091 TGeoNode *TGeoPatternCylR::FindNode(Double_t *point, const Double_t *dir)
01092 {
01093
01094 if (!fMatrix) fMatrix = gGeoIdentity;
01095 TGeoNode *node = 0;
01096 Double_t r = TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
01097 Int_t ind = (Int_t)(1. + (r-fStart)/fStep) - 1;
01098 if (dir) {
01099 fNextIndex = ind;
01100 Double_t dot = point[0]*dir[0] + point[1]*dir[1];
01101 if (dot>0) fNextIndex++;
01102 else fNextIndex--;
01103 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
01104 }
01105 if ((ind<0) || (ind>=fNdivisions)) return node;
01106 node = GetNodeOffset(ind);
01107 cd(ind);
01108 return node;
01109 }
01110
01111
01112 TGeoPatternFinder *TGeoPatternCylR::MakeCopy(Bool_t reflect)
01113 {
01114
01115 TGeoPatternCylR *finder = new TGeoPatternCylR(*this);
01116 if (!reflect) return finder;
01117 Reflect();
01118 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
01119 combi->ReflectZ(kTRUE);
01120 combi->ReflectZ(kFALSE);
01121 combi->RegisterYourself();
01122 fMatrix = combi;
01123 return finder;
01124 }
01125
01126
01127 void TGeoPatternCylR::SavePrimitive(ostream &out, Option_t * )
01128 {
01129
01130 Int_t iaxis = 1;
01131 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01132 }
01133
01134
01135
01136
01137
01138
01139 TGeoPatternCylPhi::TGeoPatternCylPhi()
01140 {
01141
01142 fSinCos = 0;
01143 }
01144
01145 TGeoPatternCylPhi::TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions)
01146 :TGeoPatternFinder(vol, ndivisions)
01147 {
01148
01149
01150 fStart = 0;
01151 fEnd = 0;
01152 fStep = 0;
01153 fMatrix = 0;
01154 fSinCos = 0;
01155 }
01156
01157 TGeoPatternCylPhi::TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step)
01158 :TGeoPatternFinder(vol, ndivisions)
01159 {
01160
01161 fStep = step;
01162 fSinCos = 0;
01163
01164 }
01165
01166 TGeoPatternCylPhi::TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
01167 :TGeoPatternFinder(vol, ndivisions)
01168 {
01169
01170 fStart = start;
01171 if (fStart<0) fStart+=360;
01172 fEnd = end;
01173 if (fEnd<0) fEnd+=360;
01174 if ((end-start)<0)
01175 fStep = (end-start+360)/ndivisions;
01176 else
01177 fStep = (end-start)/ndivisions;
01178 fMatrix = new TGeoRotation();
01179 fMatrix->RegisterYourself();
01180 fSinCos = new Double_t[2*ndivisions];
01181 for (Int_t idiv = 0; idiv<ndivisions; idiv++) {
01182 fSinCos[2*idiv] = TMath::Sin(TMath::DegToRad()*(start+0.5*fStep+idiv*fStep));
01183 fSinCos[2*idiv+1] = TMath::Cos(TMath::DegToRad()*(start+0.5*fStep+idiv*fStep));
01184 }
01185 }
01186
01187 TGeoPatternCylPhi::~TGeoPatternCylPhi()
01188 {
01189
01190 if (fSinCos) delete [] fSinCos;
01191 }
01192
01193 void TGeoPatternCylPhi::cd(Int_t idiv)
01194 {
01195
01196 fCurrent = idiv;
01197 if (!fSinCos) {
01198 fSinCos = new Double_t[2*fNdivisions];
01199 for (Int_t i = 0; i<fNdivisions; i++) {
01200 fSinCos[2*i] = TMath::Sin(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
01201 fSinCos[2*i+1] = TMath::Cos(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
01202 }
01203 }
01204 ((TGeoRotation*)fMatrix)->FastRotZ(&fSinCos[2*idiv]);
01205 }
01206
01207
01208 Bool_t TGeoPatternCylPhi::IsOnBoundary(const Double_t *point) const
01209 {
01210
01211 Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
01212 if (phi<0) phi += 360;
01213 Double_t ddp = phi - fStart;
01214 if (ddp<0) ddp+=360;
01215 Double_t seg = ddp/fStep;
01216 Double_t diff = seg - Int_t(seg);
01217 if (diff>0.5) diff = 1.-diff;
01218 if (diff<1e-8) return kTRUE;
01219 return kFALSE;
01220 }
01221
01222
01223 TGeoNode *TGeoPatternCylPhi::FindNode(Double_t *point, const Double_t *dir)
01224 {
01225
01226 TGeoNode *node = 0;
01227 Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
01228 if (phi<0) phi += 360;
01229
01230 Double_t ddp = phi - fStart;
01231 if (ddp<0) ddp+=360;
01232
01233 Int_t ind = (Int_t)(1. + ddp/fStep) - 1;
01234 if (dir) {
01235 fNextIndex = ind;
01236 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
01237 if (dot>0) fNextIndex++;
01238 else fNextIndex--;
01239 if ((fNextIndex<0) || (fNextIndex>=fNdivisions)) fNextIndex = -1;
01240 }
01241 if ((ind<0) || (ind>=fNdivisions)) return node;
01242 node = GetNodeOffset(ind);
01243 cd(ind);
01244 return node;
01245 }
01246
01247
01248 TGeoPatternFinder *TGeoPatternCylPhi::MakeCopy(Bool_t reflect)
01249 {
01250
01251 TGeoPatternCylPhi *finder = new TGeoPatternCylPhi(*this);
01252 if (!reflect) return finder;
01253 Reflect();
01254 TGeoRotation *rot = new TGeoRotation(*fMatrix);
01255 rot->ReflectZ(kTRUE);
01256 rot->ReflectZ(kFALSE);
01257 rot->RegisterYourself();
01258 fMatrix = rot;
01259 return finder;
01260 }
01261
01262
01263 void TGeoPatternCylPhi::SavePrimitive(ostream &out, Option_t * )
01264 {
01265
01266 Int_t iaxis = 2;
01267 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01268 }
01269
01270
01271
01272
01273
01274
01275 TGeoPatternSphR::TGeoPatternSphR()
01276 {
01277
01278 }
01279
01280 TGeoPatternSphR::TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions)
01281 :TGeoPatternFinder(vol, ndivisions)
01282 {
01283
01284
01285 }
01286
01287 TGeoPatternSphR::TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t step)
01288 :TGeoPatternFinder(vol, ndivisions)
01289 {
01290
01291 fStep = step;
01292
01293 }
01294
01295 TGeoPatternSphR::TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
01296 :TGeoPatternFinder(vol, ndivisions)
01297 {
01298
01299 fStart = start;
01300 fEnd = end;
01301 fStep = (end - start)/ndivisions;
01302 }
01303
01304 TGeoPatternSphR::~TGeoPatternSphR()
01305 {
01306
01307 }
01308
01309 TGeoNode *TGeoPatternSphR::FindNode(Double_t * , const Double_t * )
01310 {
01311
01312 return 0;
01313 }
01314
01315
01316 TGeoPatternFinder *TGeoPatternSphR::MakeCopy(Bool_t reflect)
01317 {
01318
01319 TGeoPatternSphR *finder = new TGeoPatternSphR(*this);
01320 if (!reflect) return finder;
01321 Reflect();
01322 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
01323 combi->ReflectZ(kTRUE);
01324 combi->ReflectZ(kFALSE);
01325 combi->RegisterYourself();
01326 fMatrix = combi;
01327 return finder;
01328 }
01329
01330
01331 void TGeoPatternSphR::SavePrimitive(ostream &out, Option_t * )
01332 {
01333
01334 Int_t iaxis = 1;
01335 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01336 }
01337
01338
01339
01340
01341
01342
01343 TGeoPatternSphTheta::TGeoPatternSphTheta()
01344 {
01345
01346 }
01347
01348 TGeoPatternSphTheta::TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions)
01349 :TGeoPatternFinder(vol, ndivisions)
01350 {
01351
01352
01353 }
01354
01355 TGeoPatternSphTheta::TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t step)
01356 :TGeoPatternFinder(vol, ndivisions)
01357 {
01358
01359 fStep = step;
01360
01361 }
01362
01363 TGeoPatternSphTheta::TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
01364 :TGeoPatternFinder(vol, ndivisions)
01365 {
01366
01367 fStart = start;
01368 fEnd = end;
01369 fStep = (end - start)/ndivisions;
01370 }
01371
01372 TGeoPatternSphTheta::~TGeoPatternSphTheta()
01373 {
01374
01375 }
01376
01377 TGeoNode *TGeoPatternSphTheta::FindNode(Double_t * , const Double_t * )
01378 {
01379
01380 return 0;
01381 }
01382
01383
01384 TGeoPatternFinder *TGeoPatternSphTheta::MakeCopy(Bool_t reflect)
01385 {
01386
01387 TGeoPatternSphTheta *finder = new TGeoPatternSphTheta(*this);
01388 if (!reflect) return finder;
01389 Reflect();
01390 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
01391 combi->ReflectZ(kTRUE);
01392 combi->ReflectZ(kFALSE);
01393 combi->RegisterYourself();
01394 fMatrix = combi;
01395 return finder;
01396 }
01397
01398
01399 void TGeoPatternSphTheta::SavePrimitive(ostream &out, Option_t * )
01400 {
01401
01402 Int_t iaxis = 2;
01403 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01404 }
01405
01406
01407
01408
01409
01410
01411 TGeoPatternSphPhi::TGeoPatternSphPhi()
01412 {
01413
01414 }
01415
01416 TGeoPatternSphPhi::TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions)
01417 :TGeoPatternFinder(vol, ndivisions)
01418 {
01419
01420
01421 }
01422
01423 TGeoPatternSphPhi::TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step)
01424 :TGeoPatternFinder(vol, ndivisions)
01425 {
01426
01427 fStep = step;
01428
01429 }
01430
01431 TGeoPatternSphPhi::TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end)
01432 :TGeoPatternFinder(vol, ndivisions)
01433 {
01434
01435 fStart = start;
01436 fEnd = end;
01437 fStep = (end - start)/ndivisions;
01438 }
01439
01440 TGeoPatternSphPhi::~TGeoPatternSphPhi()
01441 {
01442
01443 }
01444
01445 TGeoNode *TGeoPatternSphPhi::FindNode(Double_t * , const Double_t * )
01446 {
01447
01448 return 0;
01449 }
01450
01451
01452 TGeoPatternFinder *TGeoPatternSphPhi::MakeCopy(Bool_t reflect)
01453 {
01454
01455 TGeoPatternSphPhi *finder = new TGeoPatternSphPhi(*this);
01456 if (!reflect) return finder;
01457 Reflect();
01458 TGeoCombiTrans *combi = new TGeoCombiTrans(*fMatrix);
01459 combi->ReflectZ(kTRUE);
01460 combi->ReflectZ(kFALSE);
01461 combi->RegisterYourself();
01462 fMatrix = combi;
01463 return finder;
01464 }
01465
01466
01467 void TGeoPatternSphPhi::SavePrimitive(ostream &out, Option_t * )
01468 {
01469
01470 Int_t iaxis = 3;
01471 out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
01472 }
01473
01474
01475
01476
01477
01478
01479 TGeoPatternHoneycomb::TGeoPatternHoneycomb()
01480 {
01481
01482 fNrows = 0;
01483 fAxisOnRows = 0;
01484 fNdivisions = 0;
01485 fStart = 0;
01486 }
01487
01488 TGeoPatternHoneycomb::TGeoPatternHoneycomb(TGeoVolume *vol, Int_t nrows)
01489 :TGeoPatternFinder(vol, nrows)
01490 {
01491
01492 fNrows = nrows;
01493 fAxisOnRows = 0;
01494 fNdivisions = 0;
01495 fStart = 0;
01496
01497 }
01498
01499 TGeoPatternHoneycomb::TGeoPatternHoneycomb(const TGeoPatternHoneycomb& pfh) :
01500 TGeoPatternFinder(pfh),
01501 fNrows(pfh.fNrows),
01502 fAxisOnRows(pfh.fAxisOnRows),
01503 fNdivisions(pfh.fNdivisions),
01504 fStart(pfh.fStart)
01505 {
01506
01507 }
01508
01509 TGeoPatternHoneycomb& TGeoPatternHoneycomb::operator=(const TGeoPatternHoneycomb& pfh)
01510 {
01511
01512 if(this!=&pfh) {
01513 TGeoPatternFinder::operator=(pfh);
01514 fNrows=pfh.fNrows;
01515 fAxisOnRows=pfh.fAxisOnRows;
01516 fNdivisions=pfh.fNdivisions;
01517 fStart=pfh.fStart;
01518 }
01519 return *this;
01520 }
01521
01522 TGeoPatternHoneycomb::~TGeoPatternHoneycomb()
01523 {
01524
01525 }
01526
01527 TGeoNode *TGeoPatternHoneycomb::FindNode(Double_t * , const Double_t * )
01528 {
01529
01530 return 0;
01531 }