Line data Source code
1 : #ifndef ALIITSV11GEOMCABLE_H
2 : #define ALIITSV11GEOMCABLE_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 :
8 : class TGeoVolume;
9 : class TGeoNode;
10 :
11 : #include <TObjArray.h>
12 :
13 : //*************************************************************************
14 : // Base class of cable classes
15 : //
16 : //
17 : // Ludovic Gaudichet gaudichet@to.infn.it
18 : //*************************************************************************
19 :
20 :
21 : class AliITSv11GeomCable : public TNamed {
22 :
23 : public:
24 : AliITSv11GeomCable();
25 : AliITSv11GeomCable(const char* name);
26 :
27 : virtual ~AliITSv11GeomCable();
28 0 : void SetDebug(Int_t debug = 1) {fDebug = debug;};
29 :
30 : void SetInitialNode(TGeoVolume *vol);
31 : void ResetInitialNode();
32 :
33 : void AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt, Double_t *coord);
34 : virtual Int_t GetNCheckPoints() const;
35 : virtual Int_t GetPoint(Int_t iCheckPt, Double_t *coord) const;
36 : virtual Int_t GetVect(Int_t iCheckPt, Double_t *coord) const;
37 : virtual TGeoVolume* GetVolume( Int_t iCheckPt ) const;
38 :
39 : virtual Int_t GetCheckPoint( Int_t iCheckPt, Int_t nOccur,
40 : Int_t motherLevel, Double_t *coord);
41 : virtual Int_t GetCheckVect( Int_t iCheckPt, Int_t nOccur,
42 : Int_t motherLevel, Double_t *coord);
43 : virtual Int_t GetCheckVect( const Double_t *localCoord,
44 : TGeoVolume *vol, Int_t nOccur,
45 : Int_t motherLevel, Double_t *coord);
46 : void ResetPoints();
47 :
48 : protected:
49 : AliITSv11GeomCable(const AliITSv11GeomCable &source);
50 : AliITSv11GeomCable& operator=(const AliITSv11GeomCable &source);
51 : bool CheckDaughter(const TGeoNode* node, Int_t i = 0);
52 : void ResetCheckDaughter();
53 : void CopyFrom(Double_t *c, const Double_t *o) const;
54 : Double_t ScalProd(const Double_t *a, const Double_t *b) const;
55 :
56 : static const Int_t fgkCableMaxNodeLevel = 50; // max. number of levels
57 : static const Int_t fgkCableMaxLayer = 15; // max. number of layers
58 :
59 : Int_t fDebug; // debug flag
60 : Int_t fNodeInd[fgkCableMaxNodeLevel]; // index of nodes in the node tree
61 : TObjArray fPointArray; // array of points
62 : TObjArray fVolumeArray; // volumes containing the points
63 : TGeoVolume *fCurrentVol; // volume to search in the node tree
64 : TGeoNode *fInitialNode; // initial node to start searching
65 :
66 116 : ClassDef(AliITSv11GeomCable,1)
67 : };
68 :
69 : inline Int_t AliITSv11GeomCable::GetNCheckPoints() const{
70 184 : return fVolumeArray.GetEntriesFast(); }
71 :
72 : inline void AliITSv11GeomCable::ResetCheckDaughter() {
73 139464 : for (Int_t i=0; i<fgkCableMaxNodeLevel; i++) fNodeInd[i] = -1; }
74 :
75 : inline void AliITSv11GeomCable::CopyFrom(Double_t *c, const Double_t *o)
76 5584 : const { *(c++)=*(o++); *(c++)=*(o++); *c=*o; }
77 :
78 : inline Double_t AliITSv11GeomCable::ScalProd(const Double_t *a,
79 : const Double_t *b) const {
80 : Double_t s = *(a++)*(*(b++)); s+=*(a++)*(*(b++)); s+=*a*(*b);
81 : return s;
82 : }
83 :
84 :
85 :
86 :
87 :
88 : #endif
|