]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDC.h
Major code revision
[u/mrichter/AliRoot.git] / ZDC / AliZDC.h
1 #ifndef ALIZDC_H
2 #define ALIZDC_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 ZDC      //
10 ////////////////////////////////////////////////
11  
12 #include "AliDetector.h"
13 #include "AliHit.h"
14
15  
16 class AliZDC : public AliDetector {
17
18 public:
19   AliZDC();
20   AliZDC(const char *name, const char *title);
21   virtual      ~AliZDC();
22   virtual void  AddHit(Int_t track, Int_t *vol, Float_t *hits);
23   virtual void  BuildGeometry();
24   virtual void  CreateGeometry() {}
25   virtual void  CreateMaterials() {}
26   Int_t          DistancetoPrimitive(Int_t px, Int_t py);
27   virtual Int_t IsVersion() const =0;
28   virtual void  StepManager();
29   virtual void  ResetHits(); 
30
31 protected:
32   // Parameters for hadronic calorimeters geometry
33   Float_t fDimZN[3];  // Dimensions of neutron detector
34   Float_t fDimZP[3];  // Dimensions of proton detector
35   Float_t fPosZN[3];  // Position of neutron detector
36   Float_t fPosZP[3];  // Position of proton detector
37   Float_t fFibZN[3];  // Fibers for neutron detector
38   Float_t fFibZP[3];  // Fibers for proton detector
39   Float_t fGrvZN[3];  // Grooves for neutron detector
40   Float_t fGrvZP[3];  // Grooves for proton detector
41   Int_t   fDivZN[3];  // Division for neutron detector
42   Int_t   fDivZP[3];  // Division for proton detector
43   Int_t   fTowZN[2];  // Tower for neutron detector
44   Int_t   fTowZP[2];  // Tower for proton detector
45   // Parameters for EM calorimeter geometry
46   Float_t fDimZEMPb;  // z-dimension of the Pb slice
47   Float_t fDimZEMAir; // scotch
48   Float_t fFibRadZEM; // External fiber radius (including cladding)
49   Float_t fFibZEM[3]; // Fibers for EM calorimeter
50   Float_t fDimZEM[6]; // Dimensions of EM detector
51   Float_t fPosZEM[3]; // Position of EM detector
52   Int_t   fDivZEM[3]; // Divisions for EM detector
53   
54
55    ClassDef(AliZDC,1)  // Zero Degree Calorimeter base class
56 };
57
58 //_____________________________________________________________________________
59 class AliZDChit : public AliHit {
60
61 public:
62   Int_t      fVolume[2];    //Array of volumes
63   Float_t    fX;            //X-coord. in the hall RS
64   Float_t    fY;            //Y-coord. in the hall RS
65   Float_t    fZ;            //Z-coord. in the hall RS
66   Float_t    fPrimKinEn;    //Primary particle energy
67   Float_t    fXImpact;      //x-coord. of the impact point over the ZDC
68   Float_t    fYImpact;      //y-coord. of the impact point over the ZDC
69   Float_t    fSFlag;        //Secondary flag
70   Float_t    fLightPMQ;     //Cerenkov light produced in each quadrant
71   Float_t    fLightPMC;     //Cerenkov light seen by the common PM
72   Float_t    fEnergy;       //Total energy deposited in eV
73  
74 public:
75   AliZDChit() {}
76   AliZDChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
77   AliZDChit(AliZDChit* oldhit) {*this=*oldhit;}
78   virtual ~AliZDChit() {}
79   virtual Int_t GetVolume(Int_t i) {return fVolume[i];}
80   virtual Float_t GetLightPMQ() {return fLightPMQ;}
81   virtual Float_t GetLightPMC() {return fLightPMC;}
82   virtual Float_t GetEnergy() {return fEnergy;}
83   Int_t operator == (AliZDChit &quad) {
84      Int_t i;
85      if(fTrack!=quad.GetTrack()) return 0;
86      for(i=0; i<2; i++) if(fVolume[i]!=quad.GetVolume(i)) return 0;
87      return 1;
88   }
89   virtual AliZDChit& operator + (AliZDChit &quad) {
90      fLightPMQ+=quad.GetLightPMQ();
91      fLightPMC+=quad.GetLightPMC();
92      fEnergy+=quad.GetEnergy();
93      return *this;
94   }
95   virtual void Print(Option_t *) {
96      printf(" -> HIT: vol[0] =  %d vol[1] =  %d Track: %d \n" 
97             "  hit[3] = %f, hit[4] = %f, hit[5] = %f, SFlag = %f\n"
98             "  PMQLight = %f, PMCLight = %f, Energy %f\n ", 
99             fVolume[0],fVolume[1],fTrack,fPrimKinEn,fXImpact,fYImpact,
100             fSFlag,fLightPMQ,fLightPMC,fEnergy);
101   }
102
103   ClassDef(AliZDChit,1)  // Hits for the Zero Degree Calorimeters
104 };
105  
106 #endif