]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSv11GeomCable.h
SSD QA - Updates from Panos Christakoglou and Boris Hippolyte
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeomCable.h
CommitLineData
b7943f00 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
8class TGeoVolume;
9class 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
21class AliITSv11GeomCable : public TNamed {
22
23 public:
33ddec7d 24 AliITSv11GeomCable();
b7943f00 25 AliITSv11GeomCable(const char* name);
26 AliITSv11GeomCable(const AliITSv11GeomCable &source);
27 AliITSv11GeomCable& operator=(const AliITSv11GeomCable &source);
28
29 virtual ~AliITSv11GeomCable();
30 void SetDebug(Int_t debug = 1) {fDebug = debug;};
31
32 void SetInitialNode(TGeoVolume *vol);
33 void ResetInitialNode();
34
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;
40
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);
48 void ResetPoints();
49
50 protected:
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;
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 ClassDef(AliITSv11GeomCable,1)
67};
68
69inline Int_t AliITSv11GeomCable::GetNCheckPoints() const{
531d6cdc 70 return fVolumeArray.GetEntriesFast(); }
b7943f00 71
72inline void AliITSv11GeomCable::ResetCheckDaughter() {
531d6cdc 73 for (Int_t i=0; i<fgkCableMaxNodeLevel; i++) fNodeInd[i] = -1; }
b7943f00 74
75inline void AliITSv11GeomCable::CopyFrom(Double_t *c, const Double_t *o)
531d6cdc 76const { *(c++)=*(o++); *(c++)=*(o++); *c=*o; }
b7943f00 77
78inline 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;
531d6cdc 82}
b7943f00 83
84
85
86
87
88#endif