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 AliITSv11GeomCable(const char* name);
26 AliITSv11GeomCable(const AliITSv11GeomCable &source);
27 AliITSv11GeomCable& operator=(const AliITSv11GeomCable &source);
29 virtual ~AliITSv11GeomCable();
30 void SetDebug(Int_t debug = 1) {fDebug = debug;};
32 void SetInitialNode(TGeoVolume *vol);
33 void ResetInitialNode();
35 void AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt, Double_t *coord);
36 virtual Int_t GetNCheckPoints() const;
37 virtual Int_t GetPoint(Int_t iCheckPt, Double_t *coord) const;
38 virtual Int_t GetVect(Int_t iCheckPt, Double_t *coord) const;
39 virtual TGeoVolume* GetVolume( Int_t iCheckPt ) const;
41 virtual Int_t GetCheckPoint( Int_t iCheckPt, Int_t nOccur,
42 Int_t motherLevel, Double_t *coord);
43 virtual Int_t GetCheckVect( Int_t iCheckPt, Int_t nOccur,
44 Int_t motherLevel, Double_t *coord);
45 virtual Int_t GetCheckVect( const Double_t *localCoord,
46 TGeoVolume *vol, Int_t nOccur,
47 Int_t motherLevel, Double_t *coord);
51 bool CheckDaughter(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;
56 static const Int_t fgkCableMaxNodeLevel = 50; // max. number of levels
57 static const Int_t fgkCableMaxLayer = 15; // max. number of layers
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
66 ClassDef(AliITSv11GeomCable,1)
69 inline Int_t AliITSv11GeomCable::GetNCheckPoints() const{
70 return fVolumeArray.GetEntriesFast(); }
72 inline void AliITSv11GeomCable::ResetCheckDaughter() {
73 for (Int_t i=0; i<fgkCableMaxNodeLevel; i++) fNodeInd[i] = -1; }
75 inline void AliITSv11GeomCable::CopyFrom(Double_t *c, const Double_t *o)
76 const { *(c++)=*(o++); *(c++)=*(o++); *c=*o; }
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);