/root-5.34.01/geom/geom/inc/TGeoPatternFinder.h

# · C Header · 556 lines · 364 code · 65 blank · 127 comment · 0 complexity · 7567a8cd8ae02e9dd19c5c9cc36e1eba MD5 · raw file

  1. // @(#)root/geom:$Id: TGeoPatternFinder.h 43564 2012-03-30 07:09:37Z agheata $
  2. // Author: Andrei Gheata 30/10/01
  3. /*************************************************************************
  4. * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
  5. * All rights reserved. *
  6. * *
  7. * For the licensing terms see $ROOTSYS/LICENSE. *
  8. * For the list of contributors see $ROOTSYS/README/CREDITS. *
  9. *************************************************************************/
  10. #ifndef ROOT_TGeoPatternFinder
  11. #define ROOT_TGeoPatternFinder
  12. #ifndef ROOT_TObject
  13. #include "TObject.h"
  14. #endif
  15. #ifndef ROOT_TGeoVolume
  16. #include "TGeoVolume.h"
  17. #endif
  18. class TGeoMatrix;
  19. ////////////////////////////////////////////////////////////////////////////////
  20. // //
  21. // TGeoPatternFinder - base finder class for patterns. A pattern is specifying
  22. // a division type //
  23. // //
  24. ////////////////////////////////////////////////////////////////////////////////
  25. class TGeoPatternFinder : public TObject
  26. {
  27. public:
  28. struct ThreadData_t
  29. {
  30. TGeoMatrix *fMatrix; //! generic matrix
  31. Int_t fCurrent; //! current division element
  32. Int_t fNextIndex; //! index of next node
  33. ThreadData_t();
  34. ~ThreadData_t();
  35. };
  36. ThreadData_t& GetThreadData() const;
  37. void ClearThreadData() const;
  38. void CreateThreadData(Int_t nthreads);
  39. protected :
  40. enum EGeoPatternFlags {
  41. kPatternReflected = BIT(14),
  42. kPatternSpacedOut = BIT(15)
  43. };
  44. Double_t fStep; // division step length
  45. Double_t fStart; // starting point on divided axis
  46. Double_t fEnd; // ending point
  47. Int_t fNdivisions; // number of divisions
  48. Int_t fDivIndex; // index of first div. node
  49. TGeoVolume *fVolume; // volume to which applies
  50. mutable std::vector<ThreadData_t*> fThreadData; //! Vector of thread private transient data
  51. mutable Int_t fThreadSize; //! Size of the thread vector
  52. protected:
  53. TGeoPatternFinder(const TGeoPatternFinder&);
  54. TGeoPatternFinder& operator=(const TGeoPatternFinder&);
  55. public:
  56. // constructors
  57. TGeoPatternFinder();
  58. TGeoPatternFinder(TGeoVolume *vol, Int_t ndiv);
  59. // destructor
  60. virtual ~TGeoPatternFinder();
  61. // methods
  62. virtual TGeoMatrix* CreateMatrix() const = 0;
  63. virtual void cd(Int_t /*idiv*/) {}
  64. virtual TGeoNode *CdNext();
  65. virtual TGeoNode *FindNode(Double_t * /*point*/, const Double_t * /*dir*/=0) {return 0;}
  66. virtual Int_t GetByteCount() const {return 36;}
  67. Int_t GetCurrent();// {return fCurrent;}
  68. Int_t GetDivIndex() {return fDivIndex;}
  69. virtual Int_t GetDivAxis() {return 1;}
  70. virtual TGeoMatrix *GetMatrix();// {return fMatrix;}
  71. Int_t GetNdiv() const {return fNdivisions;}
  72. Int_t GetNext() const;// {return fNextIndex;}
  73. TGeoNode *GetNodeOffset(Int_t idiv) {return fVolume->GetNode(fDivIndex+idiv);}
  74. Double_t GetStart() const {return fStart;}
  75. Double_t GetStep() const {return fStep;}
  76. Double_t GetEnd() const {return fEnd;}
  77. TGeoVolume *GetVolume() const {return fVolume;}
  78. virtual Bool_t IsOnBoundary(const Double_t * /*point*/) const {return kFALSE;}
  79. Bool_t IsReflected() const {return TObject::TestBit(kPatternReflected);}
  80. Bool_t IsSpacedOut() const {return TObject::TestBit(kPatternSpacedOut);}
  81. virtual
  82. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE) = 0;
  83. void Reflect(Bool_t flag=kTRUE) {TObject::SetBit(kPatternReflected,flag);}
  84. void SetDivIndex(Int_t index) {fDivIndex = index;}
  85. void SetNext(Int_t index);// {fNextIndex = index;}
  86. void SetRange(Double_t start, Double_t step, Int_t ndivisions);
  87. void SetSpacedOut(Bool_t flag) {TObject::SetBit(kPatternSpacedOut,flag);}
  88. void SetVolume(TGeoVolume *vol) {fVolume = vol;}
  89. virtual void UpdateMatrix(Int_t , TGeoHMatrix &) const {}
  90. ClassDef(TGeoPatternFinder, 4) // patterns to divide volumes
  91. };
  92. ////////////////////////////////////////////////////////////////////////////
  93. // //
  94. // TGeoPatternX - a X axis divison pattern //
  95. // //
  96. ////////////////////////////////////////////////////////////////////////////
  97. class TGeoTranslation;
  98. class TGeoPatternX : public TGeoPatternFinder
  99. {
  100. public:
  101. // constructors
  102. TGeoPatternX();
  103. TGeoPatternX(TGeoVolume *vol, Int_t ndivisions);
  104. TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  105. TGeoPatternX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  106. TGeoPatternX(const TGeoPatternX &pf);
  107. TGeoPatternX& operator=(const TGeoPatternX&);
  108. // destructor
  109. virtual ~TGeoPatternX();
  110. // methods
  111. virtual TGeoMatrix* CreateMatrix() const;
  112. virtual void cd(Int_t idiv);
  113. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  114. virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
  115. virtual Int_t GetDivAxis() {return 1;}
  116. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  117. virtual
  118. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  119. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  120. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  121. ClassDef(TGeoPatternX, 1) // X division pattern
  122. };
  123. ////////////////////////////////////////////////////////////////////////////
  124. // //
  125. // TGeoPatternY - a Y axis divison pattern //
  126. // //
  127. ////////////////////////////////////////////////////////////////////////////
  128. class TGeoPatternY : public TGeoPatternFinder
  129. {
  130. public:
  131. // constructors
  132. TGeoPatternY();
  133. TGeoPatternY(TGeoVolume *vol, Int_t ndivisions);
  134. TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  135. TGeoPatternY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  136. TGeoPatternY(const TGeoPatternY &pf);
  137. TGeoPatternY& operator=(const TGeoPatternY&);
  138. // destructor
  139. virtual ~TGeoPatternY();
  140. // methods
  141. virtual TGeoMatrix* CreateMatrix() const;
  142. virtual void cd(Int_t idiv);
  143. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  144. virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
  145. virtual Int_t GetDivAxis() {return 2;}
  146. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  147. virtual
  148. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  149. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  150. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  151. ClassDef(TGeoPatternY, 1) // Y division pattern
  152. };
  153. ////////////////////////////////////////////////////////////////////////////
  154. // //
  155. // TGeoPatternZ - a Z axis divison pattern //
  156. // //
  157. ////////////////////////////////////////////////////////////////////////////
  158. class TGeoPatternZ : public TGeoPatternFinder
  159. {
  160. public:
  161. // constructors
  162. TGeoPatternZ();
  163. TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions);
  164. TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  165. TGeoPatternZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  166. TGeoPatternZ(const TGeoPatternZ &pf);
  167. TGeoPatternZ& operator=(const TGeoPatternZ&);
  168. // destructor
  169. virtual ~TGeoPatternZ();
  170. // methods
  171. virtual TGeoMatrix* CreateMatrix() const;
  172. virtual void cd(Int_t idiv);
  173. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  174. virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
  175. virtual Int_t GetDivAxis() {return 3;}
  176. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  177. virtual
  178. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  179. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  180. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  181. ClassDef(TGeoPatternZ, 1) // Z division pattern
  182. };
  183. ////////////////////////////////////////////////////////////////////////////
  184. // //
  185. // TGeoPatternParaX - a X axis divison pattern for PARA shapes //
  186. // //
  187. ////////////////////////////////////////////////////////////////////////////
  188. class TGeoPatternParaX : public TGeoPatternFinder
  189. {
  190. public:
  191. // constructors
  192. TGeoPatternParaX();
  193. TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions);
  194. TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  195. TGeoPatternParaX(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  196. TGeoPatternParaX(const TGeoPatternParaX &pf);
  197. TGeoPatternParaX& operator=(const TGeoPatternParaX&);
  198. // destructor
  199. virtual ~TGeoPatternParaX();
  200. // methods
  201. virtual TGeoMatrix* CreateMatrix() const;
  202. virtual void cd(Int_t idiv);
  203. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  204. virtual Int_t GetDivAxis() {return 1;}
  205. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  206. virtual
  207. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  208. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  209. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  210. ClassDef(TGeoPatternParaX, 1) // Para X division pattern
  211. };
  212. ////////////////////////////////////////////////////////////////////////////
  213. // //
  214. // TGeoPatternParaY - a Y axis divison pattern for PARA shapes //
  215. // //
  216. ////////////////////////////////////////////////////////////////////////////
  217. class TGeoPatternParaY : public TGeoPatternFinder
  218. {
  219. private :
  220. // data members
  221. Double_t fTxy; // tangent of alpha
  222. public:
  223. // constructors
  224. TGeoPatternParaY();
  225. TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions);
  226. TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  227. TGeoPatternParaY(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  228. TGeoPatternParaY(const TGeoPatternParaY &pf);
  229. TGeoPatternParaY& operator=(const TGeoPatternParaY&);
  230. // destructor
  231. virtual ~TGeoPatternParaY();
  232. // methods
  233. virtual TGeoMatrix* CreateMatrix() const;
  234. virtual void cd(Int_t idiv);
  235. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  236. virtual Int_t GetDivAxis() {return 2;}
  237. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  238. virtual
  239. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  240. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  241. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  242. ClassDef(TGeoPatternParaY, 1) // Para Y division pattern
  243. };
  244. ////////////////////////////////////////////////////////////////////////////
  245. // //
  246. // TGeoPatternParaZ - a Z axis divison pattern for PARA shapes //
  247. // //
  248. ////////////////////////////////////////////////////////////////////////////
  249. class TGeoPatternParaZ : public TGeoPatternFinder
  250. {
  251. private :
  252. // data members
  253. Double_t fTxz; // tangent of alpha xz
  254. Double_t fTyz; // tangent of alpha yz
  255. public:
  256. // constructors
  257. TGeoPatternParaZ();
  258. TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions);
  259. TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  260. TGeoPatternParaZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  261. TGeoPatternParaZ(const TGeoPatternParaZ &pf);
  262. TGeoPatternParaZ& operator=(const TGeoPatternParaZ&);
  263. // destructor
  264. virtual ~TGeoPatternParaZ();
  265. // methods
  266. virtual TGeoMatrix* CreateMatrix() const;
  267. virtual void cd(Int_t idiv);
  268. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  269. virtual Int_t GetDivAxis() {return 3;}
  270. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  271. virtual
  272. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  273. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  274. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  275. ClassDef(TGeoPatternParaZ, 1) // Para Z division pattern
  276. };
  277. ////////////////////////////////////////////////////////////////////////////
  278. // //
  279. // TGeoPatternTrapZ - a Z axis divison pattern for TRAP or GTRA shapes //
  280. // //
  281. ////////////////////////////////////////////////////////////////////////////
  282. class TGeoPatternTrapZ : public TGeoPatternFinder
  283. {
  284. private :
  285. // data members
  286. Double_t fTxz; // tangent of alpha xz
  287. Double_t fTyz; // tangent of alpha yz
  288. public:
  289. // constructors
  290. TGeoPatternTrapZ();
  291. TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions);
  292. TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  293. TGeoPatternTrapZ(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  294. TGeoPatternTrapZ(const TGeoPatternTrapZ &pf);
  295. TGeoPatternTrapZ& operator=(const TGeoPatternTrapZ&);
  296. // destructor
  297. virtual ~TGeoPatternTrapZ();
  298. // methods
  299. virtual TGeoMatrix* CreateMatrix() const;
  300. Double_t GetTxz() const {return fTxz;}
  301. Double_t GetTyz() const {return fTyz;}
  302. virtual void cd(Int_t idiv);
  303. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  304. virtual Int_t GetDivAxis() {return 3;}
  305. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  306. virtual
  307. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  308. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  309. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  310. ClassDef(TGeoPatternTrapZ, 1) // Trap od Gtra Z division pattern
  311. };
  312. ////////////////////////////////////////////////////////////////////////////
  313. // //
  314. // TGeoPatternCylR - a cylindrical R divison pattern //
  315. // //
  316. ////////////////////////////////////////////////////////////////////////////
  317. class TGeoPatternCylR : public TGeoPatternFinder
  318. {
  319. public:
  320. // constructors
  321. TGeoPatternCylR();
  322. TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions);
  323. TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  324. TGeoPatternCylR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  325. TGeoPatternCylR(const TGeoPatternCylR &pf);
  326. TGeoPatternCylR& operator=(const TGeoPatternCylR&);
  327. // destructor
  328. virtual ~TGeoPatternCylR();
  329. // methods
  330. virtual TGeoMatrix* CreateMatrix() const;
  331. virtual void cd(Int_t idiv);
  332. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  333. virtual Int_t GetDivAxis() {return 1;}
  334. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  335. virtual
  336. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  337. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  338. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  339. ClassDef(TGeoPatternCylR, 1) // Cylindrical R division pattern
  340. };
  341. ////////////////////////////////////////////////////////////////////////////
  342. // //
  343. // TGeoPatternCylPhi - a cylindrical phi divison pattern //
  344. // //
  345. ////////////////////////////////////////////////////////////////////////////
  346. class TGeoPatternCylPhi : public TGeoPatternFinder
  347. {
  348. private :
  349. // data members
  350. Double_t *fSinCos; //![2*fNdivisions] table of sines/cosines
  351. protected:
  352. TGeoPatternCylPhi(const TGeoPatternCylPhi& pfc)
  353. : TGeoPatternFinder(pfc), fSinCos(pfc.fSinCos) {CreateThreadData(1);}
  354. TGeoPatternCylPhi& operator=(const TGeoPatternCylPhi& pfc)
  355. {if(this!=&pfc) {TGeoPatternFinder::operator=(pfc); fSinCos=pfc.fSinCos; CreateThreadData(1);}
  356. return *this;}
  357. public:
  358. // constructors
  359. TGeoPatternCylPhi();
  360. TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions);
  361. TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  362. TGeoPatternCylPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  363. // destructor
  364. virtual ~TGeoPatternCylPhi();
  365. // methods
  366. virtual TGeoMatrix* CreateMatrix() const;
  367. virtual void cd(Int_t idiv);
  368. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  369. virtual Int_t GetDivAxis() {return 2;}
  370. virtual Bool_t IsOnBoundary(const Double_t *point) const;
  371. virtual
  372. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  373. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  374. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  375. ClassDef(TGeoPatternCylPhi, 1) // Cylindrical phi division pattern
  376. };
  377. ////////////////////////////////////////////////////////////////////////////
  378. // //
  379. // TGeoPatternSphR - a spherical R divison pattern //
  380. // //
  381. ////////////////////////////////////////////////////////////////////////////
  382. class TGeoPatternSphR : public TGeoPatternFinder
  383. {
  384. public:
  385. // constructors
  386. TGeoPatternSphR();
  387. TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions);
  388. TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  389. TGeoPatternSphR(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  390. TGeoPatternSphR(const TGeoPatternSphR &pf);
  391. TGeoPatternSphR& operator=(const TGeoPatternSphR&);
  392. // destructor
  393. virtual ~TGeoPatternSphR();
  394. // methods
  395. virtual TGeoMatrix* CreateMatrix() const;
  396. virtual void cd(Int_t idiv);
  397. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  398. virtual Int_t GetDivAxis() {return 1;}
  399. virtual
  400. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  401. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  402. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  403. ClassDef(TGeoPatternSphR, 1) // spherical R division pattern
  404. };
  405. ////////////////////////////////////////////////////////////////////////////
  406. // //
  407. // TGeoPatternSphTheta - a spherical theta divison pattern //
  408. // //
  409. ////////////////////////////////////////////////////////////////////////////
  410. class TGeoPatternSphTheta : public TGeoPatternFinder
  411. {
  412. public:
  413. // constructors
  414. TGeoPatternSphTheta();
  415. TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions);
  416. TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  417. TGeoPatternSphTheta(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  418. TGeoPatternSphTheta(const TGeoPatternSphTheta &pf);
  419. TGeoPatternSphTheta& operator=(const TGeoPatternSphTheta&);
  420. // destructor
  421. virtual ~TGeoPatternSphTheta();
  422. // methods
  423. virtual TGeoMatrix* CreateMatrix() const;
  424. virtual void cd(Int_t idiv);
  425. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  426. virtual Int_t GetDivAxis() {return 2;}
  427. virtual
  428. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  429. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  430. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  431. ClassDef(TGeoPatternSphTheta, 1) // spherical theta division pattern
  432. };
  433. ////////////////////////////////////////////////////////////////////////////
  434. // //
  435. // TGeoPatternSphPhi - a spherical phi divison pattern //
  436. // //
  437. ////////////////////////////////////////////////////////////////////////////
  438. class TGeoPatternSphPhi : public TGeoPatternFinder
  439. {
  440. public:
  441. // constructors
  442. TGeoPatternSphPhi();
  443. TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions);
  444. TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t step);
  445. TGeoPatternSphPhi(TGeoVolume *vol, Int_t ndivisions, Double_t start, Double_t end);
  446. TGeoPatternSphPhi(const TGeoPatternSphPhi &pf);
  447. TGeoPatternSphPhi& operator=(const TGeoPatternSphPhi&);
  448. // destructor
  449. virtual ~TGeoPatternSphPhi();
  450. // methods
  451. virtual TGeoMatrix* CreateMatrix() const;
  452. virtual void cd(Int_t idiv);
  453. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  454. virtual Int_t GetDivAxis() {return 3;}
  455. virtual
  456. TGeoPatternFinder *MakeCopy(Bool_t reflect=kFALSE);
  457. virtual void SavePrimitive(ostream &out, Option_t *option = "");
  458. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  459. ClassDef(TGeoPatternSphPhi, 1) // Spherical phi division pattern
  460. };
  461. ////////////////////////////////////////////////////////////////////////////
  462. // //
  463. // TGeoPatternHoneycomb - a divison pattern specialized for honeycombs //
  464. // //
  465. ////////////////////////////////////////////////////////////////////////////
  466. class TGeoPatternHoneycomb : public TGeoPatternFinder
  467. {
  468. private :
  469. // data members
  470. Int_t fNrows; // number of rows
  471. Int_t fAxisOnRows; // axis along each row
  472. Int_t *fNdivisions; // [fNrows] number of divisions for each row
  473. Double_t *fStart; // [fNrows] starting points for each row
  474. protected:
  475. TGeoPatternHoneycomb(const TGeoPatternHoneycomb&);
  476. TGeoPatternHoneycomb& operator=(const TGeoPatternHoneycomb&);
  477. public:
  478. // constructors
  479. TGeoPatternHoneycomb();
  480. TGeoPatternHoneycomb(TGeoVolume *vol, Int_t nrows);
  481. // destructor
  482. virtual ~TGeoPatternHoneycomb();
  483. // methods
  484. TGeoPatternFinder *MakeCopy(Bool_t) {return 0;}
  485. virtual TGeoMatrix* CreateMatrix() const;
  486. virtual void cd(Int_t idiv);
  487. virtual TGeoNode *FindNode(Double_t *point, const Double_t *dir=0);
  488. virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const;
  489. ClassDef(TGeoPatternHoneycomb, 1) // pattern for honeycomb divisions
  490. };
  491. #endif