]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMD.h
fdc9ced316d56e873eb539a06f0013accdbeefff
[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  private:
52   TClonesArray* fRecPoints;   //! List of reconstructed hits
53   Int_t         fNRecPoints;  // Number of reconstructed hits
54   
55   ClassDef(AliPMD,2)  // Base Class for Photon Multiplicity Detector
56 };
57
58  
59  
60 //___________________________________________
61  
62 class AliPMDhit : public AliHit {
63 public:
64   Int_t      fVolume[8];  //array of volumes
65   Float_t    fEnergy;     //Total energy deposited in eV
66 public:
67   AliPMDhit() {}
68   AliPMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
69   AliPMDhit(AliPMDhit* oldhit) {*this=*oldhit;}
70   virtual ~AliPMDhit() {}
71   inline virtual Int_t GetVolume(Int_t i) {return fVolume[i];}
72   inline virtual Float_t GetEnergy() {return fEnergy;}
73   inline int operator == (AliPMDhit &cell) {
74     Int_t i;
75     if(fTrack!=cell.GetTrack()) return 0;
76     for (i=0; i<4; i++) if(fVolume[i]!=cell.GetVolume(i)) return 0;
77     return 1;
78   }
79   inline virtual AliPMDhit& operator + (AliPMDhit &cell) {
80     fEnergy+=cell.GetEnergy();
81     return *this;
82   }
83   virtual void Print(Option_t *) {
84     printf("PMD Cell %d %d %d %d\n   Primary %d -   Energy %f\n",
85            fVolume[0],fVolume[1],fVolume[2],fVolume[3],fTrack,fEnergy);
86   }
87
88   
89   ClassDef(AliPMDhit,1)  //Hits object for set:PMD
90 };
91 #endif