This file is indexed.

/usr/include/root/TGeoPatternFinder.h is in libroot-geom-dev 5.34.19+dfsg-1.2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
// @(#)root/geom:$Id$
// Author: Andrei Gheata   30/10/01

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGeoPatternFinder
#define ROOT_TGeoPatternFinder

#ifndef ROOT_TObject
#include "TObject.h"
#endif

#ifndef ROOT_TGeoVolume
#include "TGeoVolume.h"
#endif


class TGeoMatrix;

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// TGeoPatternFinder - base finder class for patterns. A pattern is specifying 
//   a division type                                                          //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

class TGeoPatternFinder : public TObject
{
public:
   struct ThreadData_t
   {
      TGeoMatrix      *fMatrix;         //! generic matrix
      Int_t            fCurrent;        //! current division element
      Int_t            fNextIndex;      //! index of next node

      ThreadData_t();
      ~ThreadData_t();
   private:
      ThreadData_t(const ThreadData_t&); // Not implemented
      ThreadData_t& operator=(const ThreadData_t&); // Not implemented
   };
   ThreadData_t& GetThreadData()   const;
   void          ClearThreadData() const;
   void          CreateThreadData(Int_t nthreads);

protected :
   enum EGeoPatternFlags {
      kPatternReflected = BIT(14),
      kPatternSpacedOut = BIT(15)
   };   
   Double_t            fStep;           // division step length
   Double_t            fStart;          // starting point on divided axis
   Double_t            fEnd;            // ending point
   Int_t               fNdivisions;     // number of divisions
   Int_t               fDivIndex;       // index of first div. node
   TGeoVolume         *fVolume;         // volume to which applies

   mutable std::vector<ThreadData_t*> fThreadData; //! Vector of thread private transient data
   mutable Int_t                      fThreadSize; //! Size of the thread vector

protected:
   TGeoPatternFinder(const TGeoPatternFinder&); 
   TGeoPatternFinder& operator=(const TGeoPatternFinder&);

public:
   // constructors
   TGeoPatternFinder();
   TGeoPatternFinder(TGeoVolume *vol, Int_t ndiv);
   // destructor
   virtual ~TGeoPatternFinder();
   // methods
   virtual TGeoMatrix* CreateMatrix() const = 0;
   virtual void        cd(Int_t /*idiv*/) {}
   virtual TGeoNode   *CdNext();
   virtual TGeoNode   *FindNode(Double_t * /*point*/, const Double_t * /*dir*/=0) {return 0;} 
   virtual Int_t       GetByteCount() const {return 36;}
   Int_t               GetCurrent();//      {return fCurrent;}
   Int_t               GetDivIndex()     {return fDivIndex;}
   virtual Int_t       GetDivAxis()      {return 1;}
   virtual TGeoMatrix *GetMatrix();//       {return fMatrix;}
   Int_t               GetNdiv() const   {return fNdivisions;}
   Int_t               GetNext() const;//   {return fNextIndex;}
   TGeoNode           *GetNodeOffset(Int_t idiv) {return fVolume->GetNode(fDivIndex+idiv);}  
   Double_t            GetStart() const  {return fStart;}
   Double_t            GetStep() const   {return fStep;}
   Double_t            GetEnd() const    {return fEnd;}
   TGeoVolume         *GetVolume() const {return fVolume;}
   virtual Bool_t      IsOnBoundary(const Double_t * /*point*/) const {return kFALSE;}
   Bool_t              IsReflected() const {return TObject::TestBit(kPatternReflected);}
   Bool_t              IsSpacedOut() const {return TObject::TestBit(kPatternSpacedOut);}
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE) = 0;
   void                Reflect(Bool_t flag=kTRUE) {TObject::SetBit(kPatternReflected,flag);}
   void                SetDivIndex(Int_t index) {fDivIndex = index;}
   void                SetNext(Int_t index);//     {fNextIndex = index;}
   void                SetRange(Double_t start, Double_t step, Int_t ndivisions);
   void                SetSpacedOut(Bool_t flag) {TObject::SetBit(kPatternSpacedOut,flag);}
   void                SetVolume(TGeoVolume *vol) {fVolume = vol;}
   virtual void        UpdateMatrix(Int_t , TGeoHMatrix &) const {}

   ClassDef(TGeoPatternFinder, 4)              // patterns to divide volumes
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternX - a X axis divison pattern                                //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoTranslation;

class TGeoPatternX : public TGeoPatternFinder 
{
public:
   // constructors
   TGeoPatternX();
   TGeoPatternX(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternX(const TGeoPatternX &pf);
   TGeoPatternX& operator=(const TGeoPatternX&);

   // destructor
   virtual ~TGeoPatternX();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0);
   virtual Double_t    FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
   virtual Int_t       GetDivAxis()      {return 1;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternX, 1)              // X division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternY - a Y axis divison pattern                                //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternY : public TGeoPatternFinder
{
public:
   // constructors
   TGeoPatternY();
   TGeoPatternY(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternY(const TGeoPatternY &pf);
   TGeoPatternY& operator=(const TGeoPatternY&);
   // destructor
   virtual ~TGeoPatternY();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Double_t    FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
   virtual Int_t       GetDivAxis()      {return 2;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternY, 1)              // Y division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternZ - a Z axis divison pattern                                //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternZ : public TGeoPatternFinder
{
public:
   // constructors
   TGeoPatternZ();
   TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternZ(const TGeoPatternZ &pf);
   TGeoPatternZ& operator=(const TGeoPatternZ&);
   // destructor
   virtual ~TGeoPatternZ();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Double_t    FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
   virtual Int_t       GetDivAxis()      {return 3;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternZ, 1)              // Z division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternParaX - a X axis divison pattern for PARA shapes            //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternParaX : public TGeoPatternFinder 
{
public:
   // constructors
   TGeoPatternParaX();
   TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternParaX(const TGeoPatternParaX &pf);
   TGeoPatternParaX& operator=(const TGeoPatternParaX&);

   // destructor
   virtual ~TGeoPatternParaX();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0);
   virtual Int_t       GetDivAxis()      {return 1;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternParaX, 1)              // Para X division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternParaY - a Y axis divison pattern for PARA shapes            //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternParaY : public TGeoPatternFinder 
{
private :
// data members
   Double_t         fTxy;      // tangent of alpha
public:
   // constructors
   TGeoPatternParaY();
   TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternParaY(const TGeoPatternParaY &pf);
   TGeoPatternParaY& operator=(const TGeoPatternParaY&);

   // destructor
   virtual ~TGeoPatternParaY();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0);
   virtual Int_t       GetDivAxis()      {return 2;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternParaY, 1)              // Para Y division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternParaZ - a Z axis divison pattern for PARA shapes            //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternParaZ : public TGeoPatternFinder 
{
private :
// data members
   Double_t            fTxz;  // tangent of alpha xz
   Double_t            fTyz;  // tangent of alpha yz
public:
   // constructors
   TGeoPatternParaZ();
   TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternParaZ(const TGeoPatternParaZ &pf);
   TGeoPatternParaZ& operator=(const TGeoPatternParaZ&);

   // destructor
   virtual ~TGeoPatternParaZ();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0);
   virtual Int_t       GetDivAxis()      {return 3;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternParaZ, 1)              // Para Z division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternTrapZ - a Z axis divison pattern for TRAP or GTRA shapes    //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternTrapZ : public TGeoPatternFinder 
{
private :
// data members
   Double_t            fTxz;  // tangent of alpha xz
   Double_t            fTyz;  // tangent of alpha yz
public:
   // constructors
   TGeoPatternTrapZ();
   TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternTrapZ(const TGeoPatternTrapZ &pf);
   TGeoPatternTrapZ& operator=(const TGeoPatternTrapZ&);

   // destructor
   virtual ~TGeoPatternTrapZ();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   Double_t            GetTxz() const {return fTxz;}
   Double_t            GetTyz() const {return fTyz;}
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0);
   virtual Int_t       GetDivAxis()      {return 3;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternTrapZ, 1)              // Trap od Gtra Z division pattern
};


////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternCylR - a cylindrical R divison pattern                      //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternCylR : public TGeoPatternFinder
{
public:
   // constructors
   TGeoPatternCylR();
   TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternCylR(const TGeoPatternCylR &pf);
   TGeoPatternCylR& operator=(const TGeoPatternCylR&);
   // destructor
   virtual ~TGeoPatternCylR();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Int_t       GetDivAxis()      {return 1;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternCylR, 1)              // Cylindrical R division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternCylPhi - a cylindrical phi divison pattern                  //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternCylPhi : public TGeoPatternFinder
{
private :
// data members
   Double_t           *fSinCos;          //![2*fNdivisions] table of sines/cosines

protected:
   TGeoPatternCylPhi(const TGeoPatternCylPhi& pfc) 
     : TGeoPatternFinder(pfc), fSinCos(pfc.fSinCos) {CreateThreadData(1);}
   TGeoPatternCylPhi& operator=(const TGeoPatternCylPhi& pfc)
     {if(this!=&pfc) {TGeoPatternFinder::operator=(pfc); fSinCos=pfc.fSinCos; CreateThreadData(1);}
     return *this;}

public:
   // constructors
   TGeoPatternCylPhi();
   TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   // destructor
   virtual ~TGeoPatternCylPhi();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Int_t       GetDivAxis()      {return 2;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternCylPhi, 1)              // Cylindrical phi division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternSphR - a spherical R divison pattern                        //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternSphR : public TGeoPatternFinder
{
public:
   // constructors
   TGeoPatternSphR();
   TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternSphR(const TGeoPatternSphR &pf);
   TGeoPatternSphR& operator=(const TGeoPatternSphR&);
   // destructor
   virtual ~TGeoPatternSphR();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Int_t       GetDivAxis()      {return 1;}
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternSphR, 1)              // spherical R division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternSphTheta - a spherical theta divison pattern                //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternSphTheta : public TGeoPatternFinder
{
public:
   // constructors
   TGeoPatternSphTheta();
   TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   TGeoPatternSphTheta(const TGeoPatternSphTheta &pf);
   TGeoPatternSphTheta& operator=(const TGeoPatternSphTheta&);
   // destructor
   virtual ~TGeoPatternSphTheta();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Int_t       GetDivAxis()      {return 3;}
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternSphTheta, 1)              // spherical theta division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternSphPhi - a spherical phi divison pattern                    //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternSphPhi : public TGeoPatternFinder
{
private:
	Double_t           *fSinCos;         //! Sincos table

protected:
   TGeoPatternSphPhi(const TGeoPatternSphPhi& pfc); // Not implemented 
   TGeoPatternSphPhi& operator=(const TGeoPatternSphPhi& pfc); // Not implemented
   Double_t           *CreateSinCos();
public:
   // constructors
   TGeoPatternSphPhi();
   TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions);
   TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step);
   TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
   // destructor
   virtual ~TGeoPatternSphPhi();
   // methods
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual Int_t       GetDivAxis()      {return 2;}
   virtual Bool_t      IsOnBoundary(const Double_t *point) const;
   virtual 
   TGeoPatternFinder  *MakeCopy(Bool_t reflect=kFALSE);
   virtual void        SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternSphPhi, 1)              // Spherical phi division pattern
};

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TGeoPatternHoneycomb - a divison pattern specialized for honeycombs    //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

class TGeoPatternHoneycomb : public TGeoPatternFinder
{
private :
// data members
   Int_t               fNrows;                  // number of rows
   Int_t               fAxisOnRows;             // axis along each row
   Int_t              *fNdivisions;             // [fNrows] number of divisions for each row
   Double_t           *fStart;                  // [fNrows] starting points for each row

protected:
   TGeoPatternHoneycomb(const TGeoPatternHoneycomb&);
   TGeoPatternHoneycomb& operator=(const TGeoPatternHoneycomb&);

public:
   // constructors
   TGeoPatternHoneycomb();
   TGeoPatternHoneycomb(TGeoVolume *vol, Int_t nrows);
   // destructor
   virtual ~TGeoPatternHoneycomb();
   // methods
   TGeoPatternFinder  *MakeCopy(Bool_t) {return 0;}
   virtual TGeoMatrix* CreateMatrix() const;
   virtual void        cd(Int_t idiv);
   virtual TGeoNode   *FindNode(Double_t *point, const Double_t *dir=0); 
   virtual void        UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;

   ClassDef(TGeoPatternHoneycomb, 1)             // pattern for honeycomb divisions
};

#endif