]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMisalignMaker.h
Merging THbtp and HBTP in one library. Comiplation on Windows/Cygwin
[u/mrichter/AliRoot.git] / ITS / AliITSMisalignMaker.h
1 #ifndef ALIITSMISALIGNMAKER_H
2 #define ALIITSMISALIGNMAKER_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$  */
7 //------------------------------------------------------------------------
8 //
9 // This class is a helper, producing ITS aligmnent objects.
10 // It provides also some useful functions
11 // See the parameters of the misalignment at the end of this script.
12 //
13 // Main author: L. Gaudichet
14 // Contact: andrea.dainese@lnl.infn.it
15 //
16 //------------------------------------------------------------------------
17
18 #include <TRandom3.h>
19 #include <TString.h>
20 #include <TClonesArray.h>
21
22
23 //-------------------------------------------------------------------------
24 class AliITSMisalignMaker : public TObject {
25   
26 public:
27   AliITSMisalignMaker();
28   
29   ~AliITSMisalignMaker() {};
30   
31   TClonesArray* GetArray() {return &fAlobj;}
32
33   void  SetSeed(Int_t seed) {fRnd.SetSeed(seed); return;}
34
35   Double_t GetUnif(Double_t x1,Double_t x2) {return fRnd.Uniform(x1,x2);}
36   
37   Int_t AddAlignObj(char* name,Double_t dx,Double_t dy,Double_t dz,
38                     Double_t dpsi,Double_t dtheta,Double_t dphi,
39                     Bool_t unif);
40
41   Int_t AddAlignObj(Int_t lay,Double_t dx,Double_t dy,Double_t dz,
42                     Double_t dpsi,Double_t dtheta,Double_t dphi,
43                     Bool_t unif);
44
45   Int_t AddAlignObj(Int_t lay,Int_t ladd,Double_t dx,Double_t dy,Double_t dz,
46                     Double_t dpsi,Double_t dtheta,Double_t dphi,
47                     Double_t xShift,Double_t yShift,Double_t zShift,
48                     Double_t psiShift,Double_t thetaShift,Double_t phiShift,
49                     Bool_t unif);
50
51   Int_t AddSectorAlignObj(Int_t sectMin,Int_t sectMax,
52                           Double_t dx,Double_t dy,Double_t dz,
53                           Double_t dpsi,Double_t dtheta,Double_t dphi,
54                           Double_t xShift,Double_t yShift,Double_t zShift,
55                           Double_t psiShift,Double_t thetaShift,Double_t phiShift,
56                           Bool_t unif);
57
58   const char*  GetSymbName(Int_t layer) const;
59   const char*  GetSymbName(Int_t layer,Int_t ladd) const;
60   const char*  GetSymbName(Int_t layer,Int_t ladd,Int_t mod) const;
61   const char*  GetHalfStaveLadderSymbName(Int_t layer,Int_t ladd,Int_t halfStave) const;
62   Double_t GaussCut(Double_t mean,Double_t sigma,Double_t cutn);
63   static const char*  GetParentSymName(const char* symname) ;
64   // const char*  GetSistersSymName(const char* symname) const;
65   static Bool_t GetLayerAndLevel(const char* symname, Int_t &layer, Int_t &level);
66   
67   static Int_t GetNLayers()             {return kNLayers;}
68   static Int_t GetNLadders(Int_t lay)   {return fgkNLadders[lay];}
69   static Int_t GetNDetectors(Int_t lay) {return fgkNDetectors[lay];}
70   static Int_t GetNSisters(const char* symname);
71   static Int_t GetNDaughters(const char* symname);
72
73 protected:
74   TRandom3     fRnd; // TRandom object
75   Int_t        fInd; // index of current AliAlignObjParams in fAlobj
76   TClonesArray fAlobj; // array of AliAlignObjParams
77   TString      fStrSPD; // name of SPD
78   TString      fStrSDD; // name of SDD
79   TString      fStrSSD; // name of SSD
80   TString      fStrStave; // name of SPD stave
81   TString      fStrHalfStave; // name of SPD half-stave
82   TString      fStrLadder; // name of SPD ladder
83   TString      fStrSector; // name of SPD sector
84   TString      fStrSensor; // name of sensitive volume
85
86 private:
87   enum {kNLayers = 6}; // The number of layers.
88   static const Int_t  fgkNLadders[kNLayers];  // Array of the number of ladders/layer(layer)
89   static const Int_t  fgkNDetectors[kNLayers];// Array of the number of detector/ladder(layer)
90
91   ClassDef(AliITSMisalignMaker,1)   //ITS Misalign Maker
92 };
93
94
95 #endif