]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDC.h
symmetric rms error
[u/mrichter/AliRoot.git] / ZDC / AliZDC.h
index 2e77ffe040a028e19a81c863719214010312aebf..580723fc338975ff7960fe65d5aee3f3842d9b74 100644 (file)
 /* $Id$ */
 
 ////////////////////////////////////////////////
-//  Manager and hits classes for set ZDC      //
+//  Manager and classes for set ZDC           //
 ////////////////////////////////////////////////
+
+#include <TSystem.h>
+
 #include "AliDetector.h"
-#include "AliHit.h"
+#include "AliZDCTrigger.h"
+#include "AliZDCChMap.h"
 
+class AliZDCPedestals;
+class AliZDCEnCalib;
+class AliZDCTowCalib;
  
 class AliZDC : public AliDetector {
 
 public:
   AliZDC();
   AliZDC(const char *name, const char *title);
-  virtual      ~AliZDC();
+  virtual       ~AliZDC();
+  AliZDC(const AliZDC&);
+  //
   virtual void  AddHit(Int_t track, Int_t *vol, Float_t *hits);
-  virtual void  BuildGeometry();
   virtual void  CreateGeometry() {}
   virtual void  CreateMaterials() {}
-  Int_t          DistancetoPrimitive(Int_t px, Int_t py);
   virtual Int_t IsVersion() const =0;
-  virtual void  StepManager();
-  virtual void  ResetHits(); 
+  virtual Float_t ZMin() const;        // Minimum overall dimension of the ZDC
+  virtual Float_t ZMax() const;        // Maximum overall dimension of the ZDC
+  virtual void  SetTreeAddress();
+  virtual void  MakeBranch(Option_t* opt);
+  virtual void  Hits2SDigits();
+  virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const;
+  virtual void  Digits2Raw();
+  virtual Bool_t Raw2SDigits(AliRawReader* rawReader);
+  Int_t   Pedestal(Int_t Detector, Int_t Quadrant, Int_t Res) const;
+  Int_t   ADCch2Phe(Int_t Detector, Int_t Quadrant, Int_t ADCVal, Int_t Res) const;
+  virtual void  StepManager() {}
+    
+  // Switching off the shower development in ZDCs
+  void  NoShower(){fNoShower=1;}
+  void  Shower()  {fNoShower=0;}
+  
+  virtual void SetVCollSideCAperture(Float_t /*aperture*/) {}
+  virtual void SetVCollSideCApertureNeg(Float_t /*aperture*/) {}
+  virtual void SetVCollSideCCentre(Float_t /*centre*/) {}
+  
+  virtual void SetVCollSideAAperture(Float_t /*aperture*/) {}
+  virtual void SetVCollSideAApertureNeg(Float_t /*aperture*/) {}
+  virtual void SetVCollSideACentre(Float_t /*centre*/) {}
+  
+  virtual void SetTCDDAperturePos(Float_t /*aperture*/) {}
+  virtual void SetTCDDApertureNeg(Float_t /*aperture*/) {}
+  
+  virtual void SetTDIAperturePos(Float_t /*aperture*/) {}
+  virtual void SetTDIApertureNeg(Float_t /*aperture*/) {}
+  
+  virtual void SetLumiLength(Float_t /*length*/) {}
+  
+  virtual void SetYZNC(Float_t /*yZNC*/) {}
+  virtual void SetYZNA(Float_t /*yZNA*/) {}
+  virtual void SetYZPC(Float_t /*yZPC*/) {}
+  virtual void SetYZPA(Float_t /*yZPA*/) {}
 
-protected:
-  // Parameters for hadronic calorimeters geometry
-  Float_t fDimZN[3];  // Dimensions of neutron detector
-  Float_t fDimZP[3];  // Dimensions of proton detector
-  Float_t fPosZN[3];  // Position of neutron detector
-  Float_t fPosZP[3];  // Position of proton detector
-  Float_t fFibZN[3];  // Fibers for neutron detector
-  Float_t fFibZP[3];  // Fibers for proton detector
-  Float_t fGrvZN[3];  // Grooves for neutron detector
-  Float_t fGrvZP[3];  // Grooves for proton detector
-  Int_t   fDivZN[3];  // Division for neutron detector
-  Int_t   fDivZP[3];  // Division for proton detector
-  Int_t   fTowZN[2];  // Tower for neutron detector
-  Int_t   fTowZP[2];  // Tower for proton detector
-  // Parameters for EM calorimeter geometry
-  Float_t fDimZEMPb;  // z-dimension of the Pb slice
-  Float_t fDimZEMAir; // scotch
-  Float_t fFibRadZEM; // External fiber radius (including cladding)
-  Float_t fFibZEM[3]; // Fibers for EM calorimeter
-  Float_t fDimZEM[6]; // Dimensions of EM detector
-  Float_t fPosZEM[3]; // Position of EM detector
-  Int_t   fDivZEM[3]; // Divisions for EM detector
+  //Calibration methods 
+  void    SetZDCCalibFName(const char *name);
+  char*   GetZDCCalibFName() const {return (char*)fZDCCalibFName.Data();}
+  AliZDCPedestals* GetPedCalib()   const  {return fPedCalib;}
+  AliZDCEnCalib*   GetECalibData() const  {return fEnCalibData;}
   
+  // Map from OCDB
+  AliZDCChMap*     GetChMap() const;
 
-   ClassDef(AliZDC,1)  // Zero Degree Calorimeter base class
-};
+  // Trigger
+  virtual AliTriggerDetector* CreateTriggerDetector() const
+       {return new AliZDCTrigger();}
 
-//_____________________________________________________________________________
-class AliZDChit : public AliHit {
+  
+  void  SetSpectatorsTrack() {fSpectatorTracked=0;}
+  Int_t SpectatorsTracked() const {return fSpectatorTracked;}
+  void  SetBeamEnergy(Float_t beamEnergy) {fBeamEnergy = beamEnergy;}
+  void  SetpAsystem() {fIspASystem = kTRUE;}
+  void  SetRELDISGenerator() {fIsRELDISgen = kTRUE;}
+  
+  void  SetOnlyZEM()           {fOnlyZEM=kTRUE;}
+  void  SetMotherFinding()     {fFindMother=kTRUE;}
 
-public:
-  Int_t      fVolume[2];    //Array of volumes
-  Float_t    fX;           //X-coord. in the hall RS
-  Float_t    fY;           //Y-coord. in the hall RS
-  Float_t    fZ;           //Z-coord. in the hall RS
-  Float_t    fPrimKinEn;    //Primary particle energy
-  Float_t    fXImpact;      //x-coord. of the impact point over the ZDC
-  Float_t    fYImpact;      //y-coord. of the impact point over the ZDC
-  Float_t    fSFlag;        //Secondary flag
-  Float_t    fLightPMQ;     //Cerenkov light produced in each quadrant
-  Float_t    fLightPMC;     //Cerenkov light seen by the common PM
-  Float_t    fEnergy;       //Total energy deposited in eV
+private:
+
+  AliZDC& operator = (const AliZDC&);
+
+protected:
+
+  Int_t        fNoShower;              // Flag to switch off the shower        
+
+  //Calibration data member 
+  AliZDCPedestals* fPedCalib;          //! Pedestal data for ZDC
+  AliZDCEnCalib*   fEnCalibData;       //! Energy data for ZDC
+  AliZDCTowCalib*  fTowCalibData;      //! Equalization data for ZDC
+
+  TString          fZDCCalibFName;     // Name of the ZDC calibration data
  
-public:
-  AliZDChit() {}
-  AliZDChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
-  AliZDChit(AliZDChit* oldhit) {*this=*oldhit;}
-  virtual ~AliZDChit() {}
-  virtual Int_t GetVolume(Int_t i) {return fVolume[i];}
-  virtual Float_t GetLightPMQ() {return fLightPMQ;}
-  virtual Float_t GetLightPMC() {return fLightPMC;}
-  virtual Float_t GetEnergy() {return fEnergy;}
-  Int_t operator == (AliZDChit &quad) {
-     Int_t i;
-     if(fTrack!=quad.GetTrack()) return 0;
-     for(i=0; i<2; i++) if(fVolume[i]!=quad.GetVolume(i)) return 0;
-     return 1;
-  }
-  virtual AliZDChit& operator + (AliZDChit &quad) {
-     fLightPMQ+=quad.GetLightPMQ();
-     fLightPMC+=quad.GetLightPMC();
-     fEnergy+=quad.GetEnergy();
-     return *this;
-  }
-  virtual void Print(Option_t *) {
-     printf(" -> HIT: vol[0] =  %d vol[1] =  %d Track: %d \n" 
-            "  hit[3] = %f, hit[4] = %f, hit[5] = %f, SFlag = %f\n"
-           "  PMQLight = %f, PMCLight = %f, Energy %f\n ", 
-           fVolume[0],fVolume[1],fTrack,fPrimKinEn,fXImpact,fYImpact,
-           fSFlag,fLightPMQ,fLightPMC,fEnergy);
-  }
-
-  ClassDef(AliZDChit,1)  // Hits for the Zero Degree Calorimeters
+  Int_t   fSpectatorTracked; // Are spectator tracked by generator? 0=NO
+  Float_t fBeamEnergy;      // beam energy from generator (AliGenZDC + RELDIS)
+  Bool_t  fIspASystem;       // Configuring pA collisions (MC only)
+  Bool_t  fIsRELDISgen;             // Is RELDIS used as generator
+  
+  Bool_t fOnlyZEM;          // build only ZEM (no had. calorimeters!)
+  Bool_t fFindMother;       // look for particle mothers in the stack in StepManager
+  
+  ClassDef(AliZDC,14)          // Zero Degree Calorimeter base class
 };
  
+// Calibration
+//_____________________________________________________________________________
+inline void AliZDC::SetZDCCalibFName(const char *name)  
+{ 
+  fZDCCalibFName = name;        
+  gSystem->ExpandPathName(fZDCCalibFName);
+}
+
+
 #endif