1 #ifndef ALIITSV11GEOMCABLE_H
2 #define ALIITSV11GEOMCABLE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
11 #include <TObjArray.h>
13 //*************************************************************************
14 // Base class of cable classes
17 // Ludovic Gaudichet gaudichet@to.infn.it
18 //*************************************************************************
21 class AliITSv11GeomCable : public TNamed {
25 { fInitialNode = 0; fPointArray.SetOwner(); fDebug=0; };
26 AliITSv11GeomCable(const char* name);
27 AliITSv11GeomCable(const AliITSv11GeomCable &source);
28 AliITSv11GeomCable& operator=(const AliITSv11GeomCable &source);
30 virtual ~AliITSv11GeomCable();
31 void SetDebug(Int_t debug = 1) {fDebug = debug;};
33 void SetInitialNode(TGeoVolume *vol);
34 void ResetInitialNode();
36 void AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt, Double_t *coord);
37 virtual Int_t GetNCheckPoints() const;
38 virtual Int_t GetPoint(Int_t iCheckPt, Double_t *coord) const;
39 virtual Int_t GetVect(Int_t iCheckPt, Double_t *coord) const;
40 virtual TGeoVolume* GetVolume( Int_t iCheckPt ) const;
42 virtual Int_t GetCheckPoint( Int_t iCheckPt, Int_t nOccur,
43 Int_t motherLevel, Double_t *coord);
44 virtual Int_t GetCheckVect( Int_t iCheckPt, Int_t nOccur,
45 Int_t motherLevel, Double_t *coord);
46 virtual Int_t GetCheckVect( const Double_t *localCoord,
47 TGeoVolume *vol, Int_t nOccur,
48 Int_t motherLevel, Double_t *coord);
52 bool CheckDaughter(TGeoNode* node, Int_t i = 0);
53 void ResetCheckDaughter();
54 void CopyFrom(Double_t *c, const Double_t *o) const;
55 Double_t ScalProd(const Double_t *a, const Double_t *b) const;
57 static const Int_t fgkCableMaxNodeLevel = 50; // max. number of levels
58 static const Int_t fgkCableMaxLayer = 15; // max. number of layers
60 Int_t fDebug; // debug flag
61 Int_t fNodeInd[fgkCableMaxNodeLevel]; // index of nodes in the node tree
62 TObjArray fPointArray; // array of points
63 TObjArray fVolumeArray; // volumes containing the points
64 TGeoVolume *fCurrentVol; // volume to search in the node tree
65 TGeoNode *fInitialNode; // initial node to start searching
67 ClassDef(AliITSv11GeomCable,1)
70 inline Int_t AliITSv11GeomCable::GetNCheckPoints() const{
71 return fVolumeArray.GetEntriesFast(); };
73 inline void AliITSv11GeomCable::ResetCheckDaughter() {
74 for (Int_t i=0; i<fgkCableMaxNodeLevel; i++) fNodeInd[i] = -1; };
76 inline void AliITSv11GeomCable::CopyFrom(Double_t *c, const Double_t *o)
77 const { *(c++)=*(o++); *(c++)=*(o++); *c=*o; };
79 inline Double_t AliITSv11GeomCable::ScalProd(const Double_t *a,
80 const Double_t *b) const {
81 Double_t s = *(a++)*(*(b++)); s+=*(a++)*(*(b++)); s+=*a*(*b);