]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMD.h
PHOS test suite including merging
[u/mrichter/AliRoot.git] / PMD / AliPMD.h
1 #ifndef PMD_H
2 #define PMD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////
9 //  Manager and hits classes for set:PMD      //
10 ////////////////////////////////////////////////
11  
12 #include "AliDetector.h"
13 #include "AliHit.h"
14 #include "AliPMDLoader.h"
15
16 class TClonesArray;
17 class TFile;
18 class AliPMDRecPoint;
19
20 class AliPMD : public AliDetector {
21   
22 protected:
23   Float_t fPar[4];           // pmdin, pmdout, thgas, thcell
24   Float_t fIn[5];            // thmin, thmax, zdist, thlow, thhigh
25   Float_t fGeo[3];           // wafer, edge, numqu
26   Float_t fPadSize[4];       // size of the pads
27   Int_t   fNumPads[4];       // number of the pads
28 public:
29   AliPMD();
30   AliPMD(const char *name, const char *title);
31
32   virtual AliLoader* MakeLoader(const char* topfoldername);
33
34   virtual      ~AliPMD();
35   virtual void  AddHit(Int_t, Int_t*, Float_t*);
36   virtual void  BuildGeometry();
37   virtual void  CreateGeometry() {}
38   virtual void  CreateMaterials() {}
39   Int_t         DistancetoPrimitive(Int_t, Int_t);
40   virtual Int_t IsVersion() const =0;
41   virtual void  SetPAR(Float_t, Float_t, Float_t, Float_t);
42   virtual void  SetIN(Float_t, Float_t, Float_t, Float_t, Float_t);
43   virtual void  SetGEO(Float_t, Float_t, Float_t);
44   virtual void  SetPadSize(Float_t, Float_t, Float_t, Float_t);
45   virtual void  StepManager();
46   virtual void  AddRecPoint(const AliPMDRecPoint &p);
47   virtual void  MakeBranch(Option_t* option);
48   virtual void  SetTreeAddress();
49   virtual void  ResetHits();
50   
51   virtual void  Hits2SDigits();
52
53  private:
54   TClonesArray* fRecPoints;   //! List of reconstructed hits
55   Int_t         fNRecPoints;  // Number of reconstructed hits
56   
57   ClassDef(AliPMD,2)  // Base Class for Photon Multiplicity Detector
58 };
59
60  
61  
62 //___________________________________________
63  
64 class AliPMDhit : public AliHit {
65 public:
66   Int_t      fVolume[8];  //array of volumes
67   Float_t    fEnergy;     //Total energy deposited in eV
68 public:
69   AliPMDhit() {}
70   AliPMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
71   AliPMDhit(AliPMDhit* oldhit) {*this=*oldhit;}
72   virtual ~AliPMDhit() {}
73   inline virtual Int_t GetVolume(Int_t i) {return fVolume[i];}
74   inline virtual Float_t GetEnergy() {return fEnergy;}
75   inline int operator == (AliPMDhit &cell) {
76     Int_t i;
77     if(fTrack!=cell.GetTrack()) return 0;
78     for (i=0; i<8; i++) if(fVolume[i]!=cell.GetVolume(i)) return 0;
79     return 1;
80   }
81   inline virtual AliPMDhit& operator + (AliPMDhit &cell) {
82     fEnergy+=cell.GetEnergy();
83     return *this;
84   }
85   virtual void Print(Option_t *) {
86     printf("PMD Cell %d %d %d %d\n   Primary %d -   Energy %f\n",
87            fVolume[0],fVolume[1],fVolume[2],fVolume[3],fTrack,fEnergy);
88   }
89
90   
91   ClassDef(AliPMDhit,1)  //Hits object for set:PMD
92 };
93 #endif