New detector AD
authorhristov <Peter.Hristov@cern.ch>
Wed, 15 Jan 2014 17:55:37 +0000 (18:55 +0100)
committerhristov <Peter.Hristov@cern.ch>
Wed, 15 Jan 2014 17:55:37 +0000 (18:55 +0100)
57 files changed:
AD/ADbaseLinkDef.h [new file with mode: 0644]
AD/ADrecLinkDef.h [new file with mode: 0644]
AD/ADsimLinkDef.h [new file with mode: 0644]
AD/AliAD.cxx [new file with mode: 0644]
AD/AliAD.h [new file with mode: 0644]
AD/AliADCalibData.cxx [new file with mode: 0644]
AD/AliADCalibData.h [new file with mode: 0644]
AD/AliADDigitizer.cxx [new file with mode: 0644]
AD/AliADDigitizer.h [new file with mode: 0644]
AD/AliADLoader.cxx [new file with mode: 0644]
AD/AliADLoader.h [new file with mode: 0644]
AD/AliADRecoParam.cxx [new file with mode: 0644]
AD/AliADRecoParam.h [new file with mode: 0644]
AD/AliADReconstructor.cxx [new file with mode: 0644]
AD/AliADReconstructor.h [new file with mode: 0644]
AD/AliADSDigit.cxx [new file with mode: 0644]
AD/AliADSDigit.h [new file with mode: 0644]
AD/AliADTrigger.cxx [new file with mode: 0644]
AD/AliADTrigger.h [new file with mode: 0644]
AD/AliADdigit.cxx [new file with mode: 0644]
AD/AliADdigit.h [new file with mode: 0644]
AD/AliADhit.cxx [new file with mode: 0644]
AD/AliADhit.h [new file with mode: 0644]
AD/AliADv1.cxx [new file with mode: 0644]
AD/AliADv1.h [new file with mode: 0644]
AD/CMakelibADbase.pkg [new file with mode: 0644]
AD/CMakelibADrec.pkg [new file with mode: 0644]
AD/CMakelibADsim.pkg [new file with mode: 0644]
AD/MakeADZeroMisAlignment.C [new file with mode: 0644]
AD/macros/DBStorageCalib.C [new file with mode: 0644]
ALIROOT/CMakebinaliroot.pkg
CMakeLists.txt
CTestConfig.cmake
EVE/EveBase/AliEveEventManager.cxx
EVE/EveBase/AliEveEventManager.h
EVE/alice-macros/ad_hits.C [new file with mode: 0644]
EVE/alice-macros/geom_ad.C [new file with mode: 0644]
OCDB/AD/Align/Data/Run0_999999999_v0_s0.root [new file with mode: 0644]
OCDB/AD/Calib/Data/Run0_9999999_v0_s0.root [new file with mode: 0644]
OCDB/AD/Calib/RecoParam/Run0_9999999_v0_s0.root [new file with mode: 0644]
OCDB/GRP/Geometry/Data/Run0_999999999_v0_s0.root
STEER/CMakelibESD.pkg
STEER/ESD/AliESD.cxx
STEER/ESD/AliESD.h
STEER/ESD/AliESDAD.cxx [new file with mode: 0644]
STEER/ESD/AliESDAD.h [new file with mode: 0644]
STEER/ESD/AliESDEvent.cxx
STEER/ESD/AliESDEvent.h
STEER/ESDLinkDef.h
STEER/STEER/AliGeomManager.cxx
STEER/STEER/AliGeomManager.h
STEER/STEER/AliRecoParam.h
STEER/STEER/AliReconstruction.cxx
STEER/STEER/AliReconstruction.h
STEER/STEER/AliSimulation.cxx
STEER/STEER/AliSimulation.h
test/ppbench/Config.C

diff --git a/AD/ADbaseLinkDef.h b/AD/ADbaseLinkDef.h
new file mode 100644 (file)
index 0000000..e2e4fda
--- /dev/null
@@ -0,0 +1,24 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class  AliADLoader+;
+#pragma link C++ class  AliADdigit+;
+#pragma link C++ class  AliADSDigit+;
+#pragma link C++ class  AliADCalibData+;
+//#pragma link C++ class  AliADCalibData+;
+//#pragma link C++ class  AliADPreprocessor+;
+//#pragma link C++ class  AliADDataDCS+;
+//#pragma link C++ class  AliADQAChecker+;
+//#pragma link C++ class  AliADMisAligner+;
+//#pragma link C++ class  AliADLogicalSignal+;
+//#pragma link C++ class  AliADTrending+;
+//#pragma link C++ class  AliADDataFEE+;
+//#pragma link C++ class  AliADTriggerSimulator+;
+//#pragma link C++ class  AliADTriggerData+;
+
+#endif
diff --git a/AD/ADrecLinkDef.h b/AD/ADrecLinkDef.h
new file mode 100644 (file)
index 0000000..da6d6d0
--- /dev/null
@@ -0,0 +1,13 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class  AliADReconstructor+;
+#pragma link C++ class  AliADTrigger+;
+#pragma link C++ class  AliADRecoParam+;
+
+#endif
diff --git a/AD/ADsimLinkDef.h b/AD/ADsimLinkDef.h
new file mode 100644 (file)
index 0000000..45af65d
--- /dev/null
@@ -0,0 +1,14 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class  AliAD+;
+#pragma link C++ class  AliADv1+;
+#pragma link C++ class  AliADhit+;
+#pragma link C++ class  AliADDigitizer+;
+
+#endif
diff --git a/AD/AliAD.cxx b/AD/AliAD.cxx
new file mode 100644 (file)
index 0000000..d370296
--- /dev/null
@@ -0,0 +1,271 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliAD.cxx  $ */
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//                  AD (ALICE Diffractive)  Detector                     //
+//                                                                       //
+//  This class contains the base procedures for the AD  detector         //
+//  All comments should be sent to :                                     //
+//                                                                       //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+
+// --- Standard libraries ---
+#include <Riostream.h>
+#include <stdlib.h>
+
+// --- ROOT libraries ---
+#include <TNamed.h>
+#include "TROOT.h"
+#include "TFile.h"
+#include "TNetFile.h"
+#include "TRandom.h"
+#include "TTree.h"
+#include "TBranch.h"
+#include "TClonesArray.h"
+#include "TGeoGlobalMagField.h"
+#include "AliMagF.h"
+#include "TStopwatch.h"
+#include "TParameter.h"
+#include "TF1.h"
+
+// --- AliRoot header files ---
+#include "AliRun.h"
+#include "AliMC.h"
+#include "AliAD.h"
+#include "AliADhit.h"
+#include "AliADLoader.h"
+#include "AliADDigitizer.h"
+#include "AliDigitizationInput.h"
+#include "AliADdigit.h"
+#include "AliADSDigit.h"
+#include "AliDAQ.h"
+#include "AliRawReader.h"
+#include "AliCDBManager.h"
+#include "AliCDBEntry.h"
+#include "AliADReconstructor.h"
+
+ClassImp(AliAD)
+ //__________________________________________________________________
+AliAD::AliAD()
+   : AliDetector(),
+     fSetADAToInstalled(0),
+     fSetADCToInstalled(0)
+{
+       /// Default Constructor
+    
+
+}
+
+//_____________________________________________________________________________
+AliAD::AliAD(const char *name, const char *title)
+   : AliDetector(name,title),
+     fSetADAToInstalled(kTRUE),
+     fSetADCToInstalled(kTRUE)
+
+{
+  
+   // Standard constructor for AD Detector
+  
+
+}
+
+//_____________________________________________________________________________
+AliAD::~AliAD()
+{
+   //
+   // Default destructor for AD Detector
+   //
+  
+}
+
+//_____________________________________________________________________________
+void AliAD::CreateMaterials()
+{
+   //
+   // MATERIALS FOR ADC AND ADA
+   //
+   
+   // Parameters for simulation scope for ADA and ADC (stolen from AliVZEROv7::CreateMaterials )
+   Int_t    fieldType       = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();     // Field type 
+   Double_t maxField        = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();       // Field max.
+   Double_t maxBending      = 10;    // Max Angle
+   Double_t maxStepSize     = 0.01;  // Max step size 
+   Double_t maxEnergyLoss   = 1;     // Max Delta E
+   Double_t precision       = 0.003; // Precision
+   Double_t minStepSize     = 0.003; // Minimum step size 
+   Float_t  density,  as[11], zs[11], ws[11];
+   Double_t radLength, absLength, a_ad, z_ad;
+   Int_t    id;
+   
+   //
+   // Parameters  for AD scintillator: NE-102 (BC400)
+   //
+   // NE-102, has the following properties : (from internet, need better reference)
+   //    Density : ca. 1.03 g/cm3
+   //    Electrons/cm3: 3.39 x 10^23
+   //    H atoms/cm3: 5.28 x 10^22
+   //    C atoms/cm3: 4.78 x 10^22
+   //    Ratio of H to C : 1.104 .
+   //    wavelength of emission : ~4.23 nm.
+   //    Decay time : ~2.4 ns.
+   //    Luminescent efficiency : typically 18% of NaI(Tl)
+   //    Photons/MeV: 2.5 x 10^4 
+   //
+   // H                // C 
+   as[0] = 1.00794;    as[1] = 12.011;
+   zs[0] = 1.;         zs[1] = 6.;
+   ws[0] = 5.23;       ws[1] = 4.74;
+   density = 1.032;
+   id      = 1;
+   AliMixture( id, "NE102", as, zs, density, -2, ws );
+   AliMedium( id, "NE102", id, 1, fieldType, maxField, maxBending, maxStepSize,
+              maxEnergyLoss, precision, minStepSize );
+
+   //
+   // Parameters for lightGuide:  
+   //     TODO check material 
+   // Should be Poly(methyl methacrylate) (PMMA) acrylic 
+   // (C5O2H8)n 
+   // Density  1.18 g/cm3
+   // Mixture PMMA    Aeff=12.3994 Zeff=6.23653 rho=1.18 radlen=34.0677 intlen=63.3073
+   // Element #0 : C  Z=  6.00 A= 12.01 w= 0.600 natoms=5
+   // Element #1 : H  Z=  1.00 A=  1.01 w= 0.081 natoms=8
+   // Element #2 : O  Z=  8.00 A= 16.00 w= 0.320 natoms=2
+
+   // Carbon          Hydrogen          Oxygen
+   as[0] = 12.0107;   as[1] = 1.00794;  as[2] = 15.9994;
+   zs[0] = 6.;        zs[1] = 1.;       zs[2] = 8.;
+   ws[0] = 0.60;      ws[1] = 0.081;    ws[2] = 0.32;
+   density = 1.18;
+   id      = 2;
+   AliMixture( id, "PMMA", as, zs, density, 3, ws );
+   AliMedium( id,"PMMA", id, 1, fieldType, maxField, maxBending, maxStepSize,
+              maxEnergyLoss, precision, minStepSize );
+
+   
+   // mu-metal
+   // Niquel          Iron              Molybdenum        Manganese
+   as[0] = 58.6934;   as[1] = 55.845;   as[2] = 95.94;    as[3] = 54.9380;  
+   zs[0] = 28.;       zs[1] = 26.;      zs[2] = 42.;      zs[3] = 25.;   
+   ws[0] = 0.802;     ws[1] = 0.14079;  ws[2] = 0.0485;   ws[3] = 0.005;
+   // Silicon         Chromium          Cobalt            Aluminium
+   as[4] = 28.0855;   as[5] = 51.9961;  as[6] = 58.9332;  as[7] = 26.981539;   
+   zs[4] = 14.;       zs[5] = 24.;      zs[6] = 27.;      zs[7] = 13.;   
+   ws[4] = 0.003;     ws[5] = 0.0002;   ws[6] = 0.0002;   ws[7] = 0.0001;
+   // Carbon          Phosphorus        Sulfur
+   as[8] = 12.0107;   as[9] = 30.97376; as[10] = 32.066;
+   zs[8] = 6.;        zs[9] = 15.;      zs[10] = 16.;
+   ws[8] = 0.00015;   ws[9] = 0.00005;  ws[10] = 0.00001;
+   density = 8.25;
+   id      = 3;
+   AliMixture( id, "MuMetal", as, zs, density, 11, ws );
+   AliMedium( id,"MuMetal", id, 1, fieldType, maxField, maxBending, maxStepSize,
+              maxEnergyLoss, precision, minStepSize );
+
+   // Parameters for ADCPMA: Aluminium
+   a_ad = 26.98; 
+   z_ad = 13.00;
+   density   = 2.7;
+   radLength = 8.9;
+   absLength = 37.2;
+   id = 4;
+   AliMaterial (id, "Alum",  a_ad, z_ad, density, radLength, absLength, 0, 0 );
+   AliMedium( id, "Alum", id, 1, fieldType, maxField, maxBending, maxStepSize,
+              maxEnergyLoss, precision, minStepSize );
+
+   // Parameters for ADCPMG: Glass for the simulation Aluminium 
+   // TODO fix material
+   a_ad = 26.98; 
+   z_ad = 13.00;
+   density   = 2.7;
+   radLength = 8.9;
+   absLength = 37.2;
+   id = 5;
+   AliMaterial( id, "Glass",  a_ad, z_ad, density, radLength, absLength, 0, 0 );
+   AliMedium( id, "Glass", id, 1, fieldType, maxField, maxBending, maxStepSize,
+              maxEnergyLoss, precision, minStepSize );
+
+
+}
+//_____________________________________________________________________________
+void AliAD::SetTreeAddress()
+{
+   //
+   // Sets tree address for hits.
+   //
+
+       TBranch *branch;
+       char branchname[20];
+       snprintf(branchname,19,"%s",GetName());
+       // Branch address for hit tree
+       TTree *treeH = fLoader->TreeH();
+       if (treeH ) 
+       {
+               branch = treeH->GetBranch(branchname);
+               if (branch) branch->SetAddress(&fHits);
+       }
+}
+
+
+//_____________________________________________________________________________
+void AliAD::MakeBranch(Option_t* opt)
+{
+       const char* oH = strstr(opt,"H");
+       if (fLoader->TreeH() && oH && (fHits==0x0))
+       {
+               fHits = new TClonesArray("AliADhit",1000);
+               fNhits = 0;
+       }
+       AliDetector::MakeBranch(opt);
+}
+//_____________________________________________________________________________
+AliLoader* AliAD::MakeLoader(const char* topfoldername)
+{ 
+   AliDebug(1,Form("Creating AliADLoader, Top folder is %s ",topfoldername));
+   fLoader = new AliADLoader(GetName(),topfoldername);
+   return fLoader;
+}
+
+//_____________________________________________________________________________
+AliDigitizer* AliAD::CreateDigitizer(AliDigitizationInput* digInput) const
+{
+   //
+   // Creates a digitizer for AD
+   //
+   return new AliADDigitizer(digInput);
+}
+
+//_____________________________________________________________________________
+
+void AliAD::Digits2Raw()
+{
+       // produces raw data from digits
+       // for AD not implemented yet (needs detailed hardware info)
+}
+
+//_____________________________________________________________________________
+
+Bool_t AliAD::Raw2SDigits(AliRawReader* rawReader)
+{
+       // reads raw data to produce digits
+       // for AD not implemented yet (needs detailed hardware info)
+       return kTRUE;
+}
diff --git a/AD/AliAD.h b/AD/AliAD.h
new file mode 100644 (file)
index 0000000..16d2c87
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef ALIAD_H
+#define ALIAD_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+//////////////////////////////////////////////////
+//  Manager and hits classes for set : AD       //
+//////////////////////////////////////////////////
+
+#include "AliDetector.h"
+#include "AliADLoader.h"
+#include "AliADDigitizer.h"
+#include "AliADTrigger.h"
+
+  
+class AliAD : public AliDetector {
+public:
+
+                        AliAD();
+                        AliAD(const char *name, const char *title);
+  virtual              ~AliAD();
+  virtual      void    CreateMaterials();
+  virtual      Int_t     IsVersion() const { return -1;}
+  virtual      TString   Version() { return TString("");}
+  virtual      void     SetTreeAddress();  
+  virtual      void MakeBranch(Option_t* opt = "");
+  virtual      AliLoader*    MakeLoader(const char* topfoldername);
+  AliDigitizer*  CreateDigitizer(AliDigitizationInput* digInput) const;
+  virtual AliTriggerDetector* CreateTriggerDetector() const { return new AliADTrigger();}
+  
+  virtual      void     Digits2Raw();
+  virtual    Bool_t     Raw2SDigits(AliRawReader*);
+  virtual    void      SetADAToInstalled(Bool_t b){fSetADAToInstalled = b;}
+  virtual    void      SetADCToInstalled(Bool_t b){fSetADCToInstalled = b;}
+  virtual    Bool_t    GetADAToInstalled() const {return fSetADAToInstalled;}
+  virtual    Bool_t    GetADCToInstalled() const {return fSetADCToInstalled;}
+
+
+private:
+                       AliAD(const AliAD&); 
+                       AliAD& operator = (const AliAD&); 
+  Bool_t       fSetADAToInstalled; 
+  Bool_t       fSetADCToInstalled; 
+
+
+  ClassDef(AliAD,1)  // Base Class for the AD detector
+};
+
+#endif
diff --git a/AD/AliADCalibData.cxx b/AD/AliADCalibData.cxx
new file mode 100644 (file)
index 0000000..ed515fa
--- /dev/null
@@ -0,0 +1,137 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliADCalibData.cxx,                                            */
+
+
+#include "AliADCalibData.h"
+#include "TList.h"
+#include "TCanvas.h"
+
+ClassImp(AliADCalibData)
+
+
+//________________________________________________________________
+AliADCalibData::AliADCalibData()
+{
+       for (Int_t imod = 0; imod < 60; imod++)
+       {
+               fEfficiencies[imod]=0.;
+               fRates[imod]=0.;
+               fModulesActivity[imod]=0.;
+       } 
+}
+
+//________________________________________________________________
+void AliADCalibData::Reset()
+{
+  
+}
+
+//________________________________________________________________
+AliADCalibData::AliADCalibData(const char* name) :
+  TNamed()
+{
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+
+}
+
+//________________________________________________________________
+AliADCalibData::AliADCalibData(const AliADCalibData& calibda) :
+  TNamed(calibda)
+{
+// copy constructor
+
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  
+  // there are 60 modules. Note that number of first module is 1 (one)
+  for(int t=0; t<60; t++) 
+  {
+       fEfficiencies[t] =calibda.GetEfficiency(t);
+       fRates[t] = calibda.GetRate(t);
+       fModulesActivity[t] = calibda.GetModuleActivity(t);
+  }
+}
+//_______________________________________________________________
+void AliADCalibData::Draw(Option_t *)
+{
+
+  //fHits->Draw();
+
+}
+//________________________________________________________________
+AliADCalibData &AliADCalibData::operator =(const AliADCalibData& calibda)
+{
+// assignment operator
+
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  // there are 60 modules. Note that number of first module is 1 (one)
+  for(int t=0; t<60; t++) 
+  {
+       fEfficiencies[t] =calibda.GetEfficiency(t);
+       fRates[t] = calibda.GetRate(t);
+       fModulesActivity[t] = calibda.GetModuleActivity(t);
+  }
+  return *this;
+}
+//_______________________________________________________________
+/*void AliADCalibData::AddHisto(TH1D *fHist)
+{
+    
+
+
+ = (TH1D*)fHist->Clone("hnew");
+
+     
+   
+}
+*/
+
+//________________________________________________________________
+AliADCalibData::~AliADCalibData()
+{
+  
+}
+
+                                                                                   
+
+//________________________________________________________________
+void AliADCalibData::SetEfficiencies(Float_t* Eff)
+{
+  // there are 60 modules. Note that number of first module is 1 (one)
+  if(Eff) for(int t=0; t<60; t++) fEfficiencies[t] = Eff[t];
+  else for(int t=0; t<60; t++) fEfficiencies[t] = 0.0;
+}
+
+void AliADCalibData::SetRates(Float_t* Rt)
+{
+   if(Rt) for (int t=0;t<60; t++) fRates[t] = Rt[t];
+else for (int t=0;t<60; t++) fRates[t] = 0.0;
+}
+
+void AliADCalibData::SetModulesActivity(Float_t* Mac)
+{
+       if(Mac) for (int t=0;t<60;t++) fModulesActivity[t] = Mac[t];
+       else for (int t=0;t<60;t++) fModulesActivity[t] = 0.0;
+}
+
diff --git a/AD/AliADCalibData.h b/AD/AliADCalibData.h
new file mode 100644 (file)
index 0000000..7645813
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef ALIADCALIBDATA_H
+#define ALIADCALIBDATA_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include "TNamed.h"
+#include "TH1D.h"
+class AliADCalibData: public TNamed {
+
+ public:
+  AliADCalibData();
+  AliADCalibData(const char* name);
+  
+  AliADCalibData(const AliADCalibData &calibda);
+  AliADCalibData& operator= (const AliADCalibData &calibda);
+  virtual ~AliADCalibData();
+  void Reset();
+
+  Float_t* GetEfficiencies() const { return (float*)fEfficiencies; }
+  Float_t  GetEfficiency(Int_t i) const { return fEfficiencies[i-1];}
+  Float_t* GetRates() const {return (float*)fRates;}
+  Float_t GetRate(Int_t i) const {return fRates[i-1];}
+  Float_t* GetModulesActivity() const {return (float*)fModulesActivity;}
+  Float_t GetModuleActivity(Int_t i) const {return fModulesActivity[i-1];}
+ // TList*  GetHistos()const {return Hist;} 
+  void SetRates(Float_t* Rt);
+  void SetRate(Float_t rate, Int_t mod){fRates[mod-1]=rate;}
+  void SetEfficiencies(Float_t* Eff);
+  void SetEfficiency(Float_t eff, Int_t mod) {fEfficiencies[mod-1]=eff;}
+  void Draw(Option_t *option="");
+  void SetModulesActivity(Float_t* Mac);
+  void SetModuleActivity(Float_t mac,Int_t mod){fModulesActivity[mod-1]=mac;}
+
+
+ protected:
+  Float_t fEfficiencies[60];
+  Float_t fRates[60];
+  Float_t fModulesActivity[60];
+
+  ClassDef(AliADCalibData,1)    // AD Calibration data
+};
+
+#endif
+
diff --git a/AD/AliADDigitizer.cxx b/AD/AliADDigitizer.cxx
new file mode 100644 (file)
index 0000000..945e2d5
--- /dev/null
@@ -0,0 +1,227 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+/* $Id: AliADDigitizer.cxx  $ */
+
+///_________________________________________________________________________
+///
+/// This class constructs Digits out of Hits
+///
+///
+
+// --- Standard library ---
+
+// --- ROOT system ---
+#include <TMath.h>
+#include <TTree.h>
+#include <TMap.h>
+#include <TGeoManager.h>
+#include <TGeoPhysicalNode.h>
+#include <AliGeomManager.h>
+#include <TRandom.h>
+#include <TF1.h>
+#include <TH1F.h>
+
+// --- AliRoot header files ---
+#include "AliRun.h"
+#include "AliAD.h"
+#include "AliADhit.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliGRPObject.h"
+#include "AliDigitizationInput.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCDBEntry.h"
+//#include "AliADCalibData.h"
+#include "AliCTPTimeParams.h"
+#include "AliLHCClockPhase.h"
+#include "AliADdigit.h"
+#include "AliADDigitizer.h"
+//#include "AliADSDigit.h"
+
+ClassImp(AliADDigitizer)
+
+//____________________________________________________________________________ 
+AliADDigitizer::AliADDigitizer()
+  :AliDigitizer(),
+   fNdigits(0),
+   fDigits(0)
+{
+  // default constructor
+}
+
+//____________________________________________________________________________ 
+AliADDigitizer::AliADDigitizer(AliDigitizationInput* digInput)
+  :AliDigitizer(digInput),
+   fNdigits(0),
+   fDigits(0)
+{
+  // constructor
+}
+           
+//____________________________________________________________________________ 
+AliADDigitizer::~AliADDigitizer()
+{
+  // destructor
+  
+  if (fDigits) {
+    fDigits->Delete();
+    delete fDigits;
+    fDigits=0; 
+  }
+
+}
+
+//____________________________________________________________________________ 
+Bool_t AliADDigitizer::Init()
+{
+       fDigits = new TClonesArray ("AliADdigit",1000);
+       return kTRUE;
+}
+//____________________________________________________________________________ 
+
+void AliADDigitizer::Digitize(Option_t* /*option*/) 
+{   
+   // Creates digits from hits
+       // tem. variables
+  Int_t modules[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+  Int_t moduls[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+  Int_t mods;
+
+       // loaders
+
+       AliRunLoader* outRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName());
+       if (!outRunLoader)
+       {
+               Error("Exec","Can not get output Run Loader");
+               return;
+       }
+       AliLoader* outLoader = outRunLoader->GetLoader("ADLoader");
+       if (!outLoader)
+       {
+               Error("Exec","Can not get output AD Loader");
+               return;
+       }
+  
+       outLoader->LoadDigits("update");
+       if (!outLoader->TreeD()) outLoader->MakeTree("D");
+       outLoader->MakeDigitsContainer();
+       TTree* treeD = outLoader->TreeD();
+       Int_t bufsize = 16000;
+       treeD->Branch("ADdigit",&fDigits, bufsize);
+
+       const Float_t eMin = 0;//1.52; //! MeVs, minimum energy
+       // loop over inputs
+
+       for (Int_t iInput=0; iInput < fDigInput->GetNinputs();iInput++)
+       {
+               AliRunLoader* runLoader = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iInput));
+               AliLoader* loader = runLoader->GetLoader("ADLoader");
+               if (!loader)
+               {
+                       Error("Exec","Can not get AD Loader for input %d",iInput);
+                       continue;
+               }
+               if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
+               AliAD* ad = (AliAD*) runLoader->GetAliRun()->GetDetector("AD");
+               if (!ad)
+               {
+                       Error("Exec","No AD detector for input %d",iInput);
+                       continue;
+               }
+               loader->LoadHits();
+               TTree* treeH = loader->TreeH();
+               if (!treeH)
+               {
+                       Error("Exec","Cannot get TreeH for input %d",iInput);
+                       continue;
+               }
+               TClonesArray* hits = ad->Hits();
+
+               // here I loop over tracks
+               Int_t nTracks = (Int_t) treeH->GetEntries();
+               for (Int_t iTrack=0; iTrack < nTracks; iTrack++)
+               {
+                       ad->ResetHits();
+                       treeH->GetEvent(iTrack);
+                       Int_t nHits = hits->GetEntriesFast();
+                       // here comes the loop over AD hits
+                       for (Int_t iHit=0; iHit < nHits; iHit++)
+                       {
+                               AliADhit* hit = (AliADhit *)hits->UncheckedAt(iHit);
+                               Float_t eloss_mev = hit->GetEloss()*1000.0;
+                               Int_t module = hit->GetModule();
+                               //cout << "Module AD!!! " << module << endl;
+                               // at some point we shoukd have some calib objects to set real theresholds 
+                               // simple checking on hit, minimum energy at scintillator pad should be > 1.52 MeV's
+                               if (eloss_mev > eMin)
+                               {
+                                 modules[module] = 1;//cout << "energy: " << eloss_mev << endl;
+                               }else modules[module] = 0;
+                       }// end loop over hits
+               } // endo loop over tracks
+               for (Int_t i=0; i<16; i++)
+               {
+                       moduls[i] = modules[i];
+                       //cout << "iModule: " << i <<  " AD hits: " << moduls[i] << endl;
+               }
+
+               loader->UnloadHits();
+
+       } // end loop over inputs
+
+       // here I add the hits to the TreeD
+
+       Int_t tracks[3] = {-1,-1,-1};
+       for (Int_t i=0; i<16; i++)
+       {
+               if (moduls[i]==1)
+               {
+                       mods = i;
+                       AddDigit(tracks,mods,mods);
+               }
+       }
+       treeD->Fill();
+       outLoader->WriteDigits("OVERWRITE");
+       outLoader->UnloadDigits();
+       ResetDigit();
+}
+
+//____________________________________________________________________________
+void AliADDigitizer::AddDigit(Int_t* track, Int_t module, Float_t cell) 
+{  
+   // Adds Digit 
+   TClonesArray &ldigits = *fDigits;  
+   new(ldigits[fNdigits++]) AliADdigit(track,module,cell);
+}
+//____________________________________________________________________________
+void AliADDigitizer::AddDigit(Int_t* modul,Float_t cell) 
+{  
+   // Adds Digit 
+   TClonesArray &ldigits = *fDigits;  
+   new(ldigits[fNdigits++]) AliADdigit(modul,cell);
+}
+
+//____________________________________________________________________________
+void AliADDigitizer::ResetDigit()
+{
+   // Clears Digits
+   fNdigits = 0;
+   if (fDigits) fDigits->Delete();
+}
+
diff --git a/AD/AliADDigitizer.h b/AD/AliADDigitizer.h
new file mode 100644 (file)
index 0000000..78e2dd0
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIADDigitizer_H
+#define ALIADDigitizer_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+  
+///_________________________________________________________________________
+///
+///  Class for making Digits in AD 
+///_________________________________________________________________________   
+
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliDigitizer.h"
+
+// #include "AliADConst.h"
+
+class TClonesArray;
+class AliDigitizationInput;
+class AliCDBManager;
+class AliCDBStorage;
+
+class AliADDigitizer: public AliDigitizer {
+
+public:
+                    AliADDigitizer() ;                              // default constructor
+                    AliADDigitizer(AliDigitizationInput* digInput); // constructor
+  virtual          ~AliADDigitizer() ;              // destructor
+
+  virtual Bool_t    Init();
+  virtual void      Digitize(Option_t* option=0);
+  void AddDigit(Int_t* track, Int_t module, Float_t cell);
+  void AddDigit(Int_t* modul, Float_t cell);   
+
+            void    ResetDigit();
+            
+private:
+                    AliADDigitizer(const AliADDigitizer& /*digitizer*/); 
+                    AliADDigitizer& operator = (const AliADDigitizer& /*digitizer*/); 
+  
+
+           Int_t    fNdigits;           //! Number of digits
+    TClonesArray*   fDigits;            //! List of digits
+
+   ClassDef(AliADDigitizer,1)     // digitizer for AD
+
+};
+
+#endif // AliADDigitizer_H
diff --git a/AD/AliADLoader.cxx b/AD/AliADLoader.cxx
new file mode 100644 (file)
index 0000000..a0050b3
--- /dev/null
@@ -0,0 +1,37 @@
+/////////////////////////////////////////////////////////////////////
+//                                                                 //
+//  Class AliADLoader                                              //
+//                                                                 //
+//  Base class for ADLoaders.                                      //
+//  Loader provides base I/O facilities for standard data.         //
+//  Each detector has a loader data member.                        //
+//  Loader is accessible via folder structure as well.             //
+//                                                                 //
+/////////////////////////////////////////////////////////////////////
+
+#include "AliADLoader.h"
+#include "AliLog.h"
+
+const TString AliADLoader::fgkDefaultHitsFileName      = "AD.Hits.root";
+const TString AliADLoader::fgkDefaultDigitsFileName    = "AD.Digits.root";
+
+ClassImp(AliADLoader)
+
+//_____________________________________________________________________________
+AliADLoader::AliADLoader()
+{ 
+   // Default constructor
+}
+
+//_____________________________________________________________________________
+AliADLoader::AliADLoader(const Char_t *name,const Char_t *topfoldername)
+   :AliLoader(name,topfoldername)
+{
+   AliDebug( 1, Form("Name = %s; topfolder = %s", name, topfoldername) );
+}
+
+//_____________________________________________________________________________
+AliADLoader::AliADLoader(const Char_t *name,TFolder *topfolder)
+   :AliLoader(name,topfolder)
+{
+}
diff --git a/AD/AliADLoader.h b/AD/AliADLoader.h
new file mode 100644 (file)
index 0000000..84fb042
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef ALIADLOADER_H
+#define ALIADLOADER_H
+
+/////////////////////////////////////////////////////////////////////
+//                                                                 //
+// Base class for ADloaders.                                       //                                          
+// Loader provides base I/O facilities for standard data.          //
+// Each detector has a loader data member.                         //
+// Loader is always accessible via folder structure as well.       // 
+//                                                                 //
+/////////////////////////////////////////////////////////////////////
+
+#include "AliLoader.h"
+
+class AliADLoader: public AliLoader {
+   
+public:
+                  AliADLoader();
+                  AliADLoader(const Char_t *name,const Char_t *topfoldername);
+                  AliADLoader(const Char_t *name,TFolder *topfolder);    
+    virtual      ~AliADLoader() {};
+    
+                  AliADLoader & operator = (const AliADLoader & ) {return *this;}
+    
+private:
+    static const TString fgkDefaultHitsFileName;      //! Default Name for hit file
+    static const TString fgkDefaultDigitsFileName;    //! Default Name for digit file
+
+   ClassDef(AliADLoader,1)
+      
+};
+#endif
diff --git a/AD/AliADRecoParam.cxx b/AD/AliADRecoParam.cxx
new file mode 100644 (file)
index 0000000..cbf156f
--- /dev/null
@@ -0,0 +1,188 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+/**************************************************************************************
+
+       AD's RecoParams Version 1.0
+
+       In this version we only consider:
+
+       ->) The AD's Trigger Mode (Single Muon Trigger or Multi Muon Trigger)
+       ->) The AD's Trigger Mask (Same in SMT and MMT)
+       
+       In Runs PbPb, pp, and cosmics by default we have the same RecoParams.
+
+       From: 
+               Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> @ CERN
+               FCFM, BUAP. Puebla, Mexico
+
+       Further comments:
+
+               Arturo Fernandez <afernan@mail.cern.ch> 
+
+       March 2nd. 2009 
+
+       NOTE: Please suggest improvements if needed.
+
+**************************************************************************************/
+
+#include "AliLog.h"
+
+#include "AliADRecoParam.h"
+
+ClassImp(AliADRecoParam)
+
+//_____________________________________________________________________________
+AliADRecoParam::AliADRecoParam():
+  AliDetectorRecoParam()
+//  fAcordeSingleMuonTrigger(kFALSE),
+//  fAcordeMultiMuonTrigger(kFALSE),
+//  fAcordeWord0(0x00000000),
+//  fAcordeWord1(0x00000000),
+//  fAcordeWord2(0x00000000),
+//  fAcordeWord3(0x00000000)       
+{
+       // AD's RecoParam constructor
+        SetNameTitle("AD","AD");
+        AliInfo(Form("Empty object for AD RecoParam"));
+}
+
+
+//____________________________________________________________________________
+AliADRecoParam::AliADRecoParam(const AliADRecoParam &p):
+  AliDetectorRecoParam(p)
+//  fAcordeSingleMuonTrigger(p.fAcordeSingleMuonTrigger),
+//  fAcordeMultiMuonTrigger(p.fAcordeMultiMuonTrigger),
+//  fAcordeWord0(p.fAcordeWord0),
+//  fAcordeWord1(p.fAcordeWord1),
+//  fAcordeWord2(p.fAcordeWord2),
+//  fAcordeWord3(p.fAcordeWord3)
+{
+       // Copy of constructor
+}
+
+//_____________________________________________________________________________
+AliADRecoParam& AliADRecoParam::operator=(const AliADRecoParam &p)
+{
+       // AD's RecoParam Assign Operator
+
+       if (this == &p)
+       return *this;
+  
+       AliDetectorRecoParam::operator=(p);
+/*     fAcordeSingleMuonTrigger=p.fAcordeSingleMuonTrigger;
+       fAcordeMultiMuonTrigger=p.fAcordeMultiMuonTrigger;      
+       fAcordeWord0=p.fAcordeWord0;
+       fAcordeWord1=p.fAcordeWord1;
+       fAcordeWord2=p.fAcordeWord2;
+       fAcordeWord3=p.fAcordeWord3;
+  */   
+       return *this;
+}
+//_____________________________________________________________________________
+AliADRecoParam::~AliADRecoParam() 
+{
+       // AD's RecoParam destructor
+}
+
+//_____________________________________________________________________________
+/*
+AliADRecoParam *AliADRecoParam::GetPbPbparam()
+{
+       // Set AD's default reconstruction parameters for PbPb 
+  
+       AliADRecoParam *acordeRecoParam = new AliADRecoParam();
+
+       // fAcordeTriggerMode = "AD_SINGLE" for AD's Single Muon Trigger
+       // fAcordeTriggerMode = "AD_MULTI" for AD's Multi Muon Trigger
+       
+       // By now we set fAcordeSingeMuonTrigger as default
+
+       acordeRecoParam->fAcordeSingleMuonTrigger=kTRUE; // Enable AD_SINGLE
+       acordeRecoParam->fAcordeMultiMuonTrigger=kFALSE; // Disable AD_MULTI
+       acordeRecoParam->fAcordeWord0 = 0x3FFFFFFF; // [1..30] AD's modules in AD_SINGLE
+       acordeRecoParam->fAcordeWord1 = 0x7FFFFFFF; // [31..60] AD's modules in AD_SINGLE
+       acordeRecoParam->fAcordeWord2 = 0xBFFFFFFF; // [1..30] AD's modules in AD_MULTI
+       acordeRecoParam->fAcordeWord3 = 0xFFFFFFFF; // [31..60] AD's modules in AD_MULTI
+       return acordeRecoParam;
+}
+
+//_____________________________________________________________________________
+AliADRecoParam *AliADRecoParam::GetPPparam()
+{
+       // Set AD's default reconstruction parameters for PbPb 
+  
+        AliADRecoParam *acordeRecoParam = new AliADRecoParam();
+
+        // fAcordeTriggerMode = "AD_SINGLE" for AD's Single Muon Trigger
+        // fAcordeTriggerMode = "AD_MULTI" for AD's Multi Muon Trigger
+        
+        // By now we set fAcordeSingeMuonTrigger as default
+
+        acordeRecoParam->fAcordeSingleMuonTrigger=kTRUE; // Enable AD_SINGLE
+        acordeRecoParam->fAcordeMultiMuonTrigger=kFALSE; // Disable AD_MULTI
+        acordeRecoParam->fAcordeWord0 = 0x3FFFFFFF; // [1..30] AD's modules in AD_SINGLE
+        acordeRecoParam->fAcordeWord1 = 0x7FFFFFFF; // [31..60] AD's modules in AD_SINGLE
+        acordeRecoParam->fAcordeWord2 = 0xBFFFFFFF; // [1..30] AD's modules in AD_MULTI
+        acordeRecoParam->fAcordeWord3 = 0xFFFFFFFF; // [31..60] AD's modules in AD_MULTI
+        return acordeRecoParam;
+}
+
+//_____________________________________________________________________________
+AliADRecoParam *AliADRecoParam::GetCosmicMuonParam()
+{
+        // Set AD's default reconstruction parameters for PbPb 
+  
+        AliADRecoParam *acordeRecoParam = new AliADRecoParam();
+
+        // fAcordeTriggerMode = "AD_SINGLE" for AD's Single Muon Trigger
+        // fAcordeTriggerMode = "AD_MULTI" for AD's Multi Muon Trigger
+        
+        // By now we set fAcordeSingeMuonTrigger as default
+
+        acordeRecoParam->fAcordeSingleMuonTrigger=kTRUE; // Enable AD_SINGLE
+        acordeRecoParam->fAcordeMultiMuonTrigger=kFALSE; // Disable AD_MULTI
+        acordeRecoParam->fAcordeWord0 = 0x3FFFFFFF; // [1..30] AD's modules in AD_SINGLE
+        acordeRecoParam->fAcordeWord1 = 0x7FFFFFFF; // [31..60] AD's modules in AD_SINGLE
+        acordeRecoParam->fAcordeWord2 = 0xBFFFFFFF; // [1..30] AD's modules in AD_MULTI
+        acordeRecoParam->fAcordeWord3 = 0xFFFFFFFF; // [31..60] AD's modules in AD_MULTI
+        return acordeRecoParam;
+}
+*/
+//_____________________________________________________________________________
+void AliADRecoParam::PrintParameters() const
+{
+       // Printing of the used AD reconstruction parameters
+
+ //    AliInfo(Form("AD's Single Muon Trigger Mode: %b", fAcordeSingleMuonTrigger));
+//     AliInfo(Form("AD's Multi Muon Trigger Mode: %b", fAcordeMultiMuonTrigger));
+//     if(fAcordeSingleMuonTrigger==kTRUE)
+//     {
+//             AliInfo(Form("AD's Trigger Mask: 0x%08x 0x%08x",fAcordeWord0,fAcordeWord1));
+//     }
+//     if(fAcordeMultiMuonTrigger==kTRUE)
+//     {
+  //              AliInfo(Form("AD's Trigger Mask: 0x%08x 0x%08x",fAcordeWord2,fAcordeWord3));
+
+//     }
+
+
+       AliInfo(Form("Empty object for AD RecoParam"));
+
+
+}
diff --git a/AD/AliADRecoParam.h b/AD/AliADRecoParam.h
new file mode 100644 (file)
index 0000000..70d5c2e
--- /dev/null
@@ -0,0 +1,94 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+/**************************************************************************************
+
+        AD's RecoParams Version 1.0
+
+        In this version we only consider:
+
+        ->) The AD's Trigger Mode (Single Muon Trigger or Multi Muon Trigger)
+        ->) The AD's Trigger Mask (Same in SMT and MMT)
+        
+        In Runs PbPb, pp, and cosmics by default we have the same RecoParams.
+
+        From: 
+               Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> @ CERN
+               FCFM, BUAP. Puebla, Mexico
+        
+       Further comments:
+
+               Arturo Fernandez <afernan@mail.cern.ch>
+
+        March 2nd. 2009 
+
+        NOTE: Please suggest improvements if needed.
+
+**************************************************************************************/
+
+
+#ifndef ALIADRECOPARAM_H
+#define ALIADRECOPARAM_H
+
+#include "AliDetectorRecoParam.h"
+
+class AliADRecoParam : public AliDetectorRecoParam
+{
+ public: 
+  AliADRecoParam();
+  AliADRecoParam(const AliADRecoParam &p); // Copy constructor 
+  AliADRecoParam& operator=(const AliADRecoParam &p); // Assignment operator
+  virtual ~AliADRecoParam();
+
+  virtual void PrintParameters() const;
+
+  //Getters
+/* 
+  Bool_t   GetAcordeSingleMuonTrigger()    const  {return fAcordeSingleMuonTrigger;}
+  Bool_t   GetAcordeMultiMuonTrigger()     const  {return fAcordeMultiMuonTrigger;}
+  UInt_t   GetAcordeWord0()    const  {return fAcordeWord0;}
+  UInt_t   GetAcordeWord1()    const  {return fAcordeWord1;}
+  UInt_t   GetAcordeWord2()    const  {return fAcordeWord2;}
+  UInt_t   GetAcordeWord3()    const  {return fAcordeWord3;}
+
+
+  //Setters
+
+  void   SetAcordeSingleMuonTrigger(Bool_t flag)        {fAcordeSingleMuonTrigger=flag;}
+  void   SetAcordeMultiMuonTrigger(Bool_t flag)  {fAcordeMultiMuonTrigger=flag;}
+  void   SetAcordeWord0(UInt_t flag)  {fAcordeWord0=flag;}
+  void   SetAcordeWord1(UInt_t flag)  {fAcordeWord1=flag;}
+  void   SetAcordeWord2(UInt_t flag)  {fAcordeWord2=flag;}
+  void   SetAcordeWord3(UInt_t flag)  {fAcordeWord3=flag;}
+
+
+
+  static   AliADRecoParam *GetPbPbparam();       // reco param for PbPb.
+  static   AliADRecoParam *GetPPparam();         // reco param for PP
+  static   AliADRecoParam *GetCosmicMuonParam(); // reco param for cosmic muons
+private:
+
+  Bool_t fAcordeSingleMuonTrigger; // kTRUE if AD triggered in Singe Muon Mode
+  Bool_t fAcordeMultiMuonTrigger; // kTRUE if AD triggered in Multi Muon Mode
+  UInt_t fAcordeWord0; // [1..30] Acorde's Modules in Single Muon Trigger
+  UInt_t fAcordeWord1; // [31..60] Acorde's Modules in Single Muon Trigger
+  UInt_t fAcordeWord2; // [1..30] Acorde's Modules in Multi Muon Trigger
+  UInt_t fAcordeWord3; // [31..60] Acorde's Modules in Multi Muon Trigger
+*/
+  ClassDef(AliADRecoParam, 1)
+};
+#endif
diff --git a/AD/AliADReconstructor.cxx b/AD/AliADReconstructor.cxx
new file mode 100644 (file)
index 0000000..65351d3
--- /dev/null
@@ -0,0 +1,119 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliADReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  Class for AD reconstruction                                         //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReader.h"
+
+#include "AliADReconstructor.h"
+#include "AliESDEvent.h"
+#include "AliADdigit.h"
+
+ClassImp(AliADReconstructor)
+
+AliADReconstructor:: AliADReconstructor():
+  AliReconstructor(),
+  fESDAD(0x0),
+  fDigitsArray(0)
+{
+  // Default constructor  
+  // Get calibration data
+
+}
+
+//_____________________________________________________________________________
+AliADReconstructor& AliADReconstructor::operator = 
+  (const AliADReconstructor& /*reconstructor*/)
+{
+// assignment operator
+
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliADReconstructor::~AliADReconstructor()
+{
+// destructor
+  delete fESDAD;
+  delete fDigitsArray;
+}
+
+//_____________________________________________________________________________
+void AliADReconstructor::Init()
+{
+// initializer
+    fESDAD  = new AliESDAD;
+}
+
+void AliADReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
+{
+
+  printf("Converting digits for AD .. not implemented \n");
+}
+
+void AliADReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
+{
+
+  printf("Running AD Reconstruction \n");
+
+  // fills ESD with AD Digits
+
+  if (!digitsTree)
+    {
+      AliError("No digits tree!");
+      return;
+    }
+
+  TBranch* digitBranch = digitsTree->GetBranch("ADdigit");
+  if (!digitBranch) {
+    AliError("No AD digits branch found!");
+    return;
+  }
+  digitBranch->SetAddress(&fDigitsArray);
+
+  digitsTree->GetEvent(0);
+
+  Bool_t ADHits[16];
+  for(Int_t i = 0; i < 16; i++) { ADHits[i] = kFALSE; }
+
+  Int_t nDigits = fDigitsArray->GetEntriesFast();
+    
+  for (Int_t d=0; d<nDigits; d++) {    
+    AliADdigit* digit = (AliADdigit*) fDigitsArray->At(d);
+    Int_t module = digit->GetCell();
+ //   printf("AD Module: %d\n",module);
+    ADHits[module] = kTRUE;
+  }  
+  if (!esd) {
+       AliError("NO AD ESD branch found!");
+       return;
+}
+  fESDAD->SetADBitCell(ADHits);
+
+  if (esd)
+    {
+      AliDebug(1, Form("Writing AD data to ESD Tree"));
+      esd->SetADData(fESDAD);
+    }
+
+  fDigitsArray->Clear();
+}
+
+
diff --git a/AD/AliADReconstructor.h b/AD/AliADReconstructor.h
new file mode 100644 (file)
index 0000000..1024850
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef ALIADRECONSTRUCTOR_H
+#define ALIADRECONSTRUCTOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.*/
+/* See cxx source for full Copyright notice                              */
+/* $Id: AliADReconstructor.h 20956 2007-09-26 14:22:18Z cvetan $  */
+
+///////////////////////////////////////////////////////////////////////////
+///                                                                      //
+/// class for AD reconstruction                                       //
+///                                                                      //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliReconstructor.h"
+#include "AliLog.h"
+
+class AliESDAD;
+class AliESDEvent;
+
+class AliADReconstructor: public AliReconstructor {
+public:
+  AliADReconstructor();
+  virtual ~AliADReconstructor();
+  virtual void   Init();
+  
+  virtual void   Reconstruct(AliRawReader* /*rawReader*/, 
+                            TTree* /*clustersTree*/) const {
+    AliError("Method not implemented"); return;};
+  virtual void   Reconstruct(TTree*, TTree*) const {return;};
+  
+  virtual void   FillESD(TTree* digitsTree, TTree* /*clustersTree*/, 
+                        AliESDEvent* esd) const;
+
+  virtual void   FillESD(AliRawReader* /*rawReader*/, TTree* /*clustersTree*/, 
+                        AliESDEvent* /*esd*/) const { 
+    AliError("Method not implemented"); return;};
+  
+  virtual Bool_t HasDigitConversion() const { return kTRUE; }
+  virtual void ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const;
+
+
+protected:
+
+  AliESDAD*        fESDAD;      // AD ESD object  
+
+private:
+  AliADReconstructor(const AliADReconstructor&); //Not implemented
+  AliADReconstructor& operator = (const AliADReconstructor&); //Not implemented
+  
+
+  mutable TClonesArray *fDigitsArray;  // clones-array for ConvertDigits() and FillESD()
+
+  ClassDef(AliADReconstructor, 1)  // class for the AD reconstruction
+};
+
+#endif
diff --git a/AD/AliADSDigit.cxx b/AD/AliADSDigit.cxx
new file mode 100644 (file)
index 0000000..748d087
--- /dev/null
@@ -0,0 +1,73 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+#include "AliADSDigit.h"
+
+ClassImp(AliADSDigit)
+
+//__________________________________________________________________________
+AliADSDigit::AliADSDigit()
+   :AliDigit(),
+    fPMNumber(0),
+    fNBins(0),
+    fCharges(NULL)
+{
+  // Standard default
+  // constructor 
+}
+
+//__________________________________________________________________________
+AliADSDigit::AliADSDigit(Int_t pmnumber,
+                         Int_t nbins, 
+                         Float_t *charges,
+                         Int_t *labels)
+  :AliDigit(),
+   fPMNumber(pmnumber),
+   fNBins(nbins),
+   fCharges(NULL)
+{  
+  // Constructor
+  // Used in the digitizer
+  fCharges = new Float_t[fNBins];
+  if (charges) {
+    for(Int_t i = 0; i < fNBins; ++i)
+      fCharges[i] = charges[i];
+  }
+  else {
+    for(Int_t i = 0; i < fNBins; ++i)
+      fCharges[i] = 0;
+  }
+
+  if (labels)
+    for(Int_t iTrack = 0; iTrack < 3; ++iTrack) fTracks[iTrack] = labels[iTrack];
+}
+
+//__________________________________________________________________________
+AliADSDigit::~AliADSDigit()
+{
+  // Destructor
+  // Delete the charges array if it was allocated
+  if (fCharges) {
+    delete [] fCharges;
+    fCharges = NULL;
+  }
+}
+
+//__________________________________________________________________________
+void AliADSDigit::Print(const Option_t*) const
+{
+    // Dumps digit object
+    Dump();
+}
diff --git a/AD/AliADSDigit.h b/AD/AliADSDigit.h
new file mode 100644 (file)
index 0000000..7307fc5
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef ALIADSDIGIT_H
+#define ALIADSDIGIT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include "AliDigit.h"
+
+//_____________________________________________________________________________
+class AliADSDigit: public AliDigit  {
+
+ public:
+                        AliADSDigit();
+                        AliADSDigit(Int_t pmnumber,
+                                    Int_t nbins, 
+                                    Float_t *charges,
+                                    Int_t *labels = 0);
+    virtual            ~AliADSDigit();
+
+    virtual void        Print(const Option_t* option="") const;
+
+    Int_t               PMNumber()   const {return fPMNumber;}
+    Int_t               GetNBins()   const {return fNBins;}
+    Float_t*            GetCharges() const {return fCharges;}
+
+  private:
+                        AliADSDigit(const AliADSDigit& /*sdigit*/); 
+                        AliADSDigit& operator = (const AliADSDigit& /*sdigit*/); 
+
+    Int_t               fPMNumber;      // PhotoMultiplier number (0 to 63)
+    Int_t               fNBins;         // Number of charge bins
+    Float_t*            fCharges;       //[fNBins] Array with charges
+
+    ClassDef(AliADSDigit,1)  // AD SDigit class
+};
+
+#endif
diff --git a/AD/AliADTrigger.cxx b/AD/AliADTrigger.cxx
new file mode 100644 (file)
index 0000000..e10b293
--- /dev/null
@@ -0,0 +1,96 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+/* $Id: AliADTrigger.cxx 49869 2011-05-18 04:49:51Z hristov $ */
+// ---------------------
+// Class AliADTrigger
+// ---------------------
+// Top class to simulate the AD trigger response
+// This class is only used for interface with AliTriggerDetector
+// Its create and Set  Inputs of the CTP
+//
+
+
+#include <TClonesArray.h>
+#include <TTree.h>
+
+#include "AliRun.h"
+#include "AliLoader.h"
+#include "AliLog.h"
+#include "AliRunLoader.h"
+#include "AliTriggerInput.h"
+
+#include "AliADdigit.h"
+#include "AliADTrigger.h"
+
+//______________________________________________________________________
+ClassImp(AliADTrigger)
+
+//______________________________________________________________________
+
+AliADTrigger::AliADTrigger():AliTriggerDetector()
+{
+   SetName("AD");
+   CreateInputs();
+}
+//______________________________________________________________________
+void AliADTrigger::CreateInputs()
+{
+   // Do not create inputs again!!
+   if( fInputs.GetEntriesFast() > 0 ) return;
+
+   fInputs.AddLast( new AliTriggerInput( "AD_ADA", "AD", 0 ) );
+   fInputs.AddLast( new AliTriggerInput( "AD_ADD","AD", 0 ) );
+   fInputs.AddLast( new AliTriggerInput( "AD_ADA2", "AD", 0 ) );
+   fInputs.AddLast( new AliTriggerInput( "AD_ADD2","AD", 0 ) );
+}
+
+//______________________________________________________________________
+void AliADTrigger::Trigger()
+{
+  //  ********** Get run loader for the current event **********
+   AliRunLoader* runLoader = AliRunLoader::Instance();
+
+   AliLoader* loader = runLoader->GetLoader( "ADLoader" );
+
+   if(!loader) {
+      AliError("Can not get AD loader");
+      return;
+   }
+   loader->LoadDigits("update");
+   TTree* vzeroDigitsTree = loader->TreeD();
+
+   if (!vzeroDigitsTree) {
+      AliError("Can not get the AD digit tree");
+      return;
+   }
+   TClonesArray* vzeroDigits = NULL;
+   TBranch* digitBranch = vzeroDigitsTree->GetBranch("ADDigit");
+   digitBranch->SetAddress(&vzeroDigits);
+   
+   // Check trigger contitions
+   // .... Ex. number of digit over threshold
+   //
+   
+   loader->UnloadDigits();     
+
+
+   //   if(  )  SetInput( "AD_ADA" );
+   //   if(  )  SetInput( "AD_ADD" );
+
+  return;
+}
+
+
+
diff --git a/AD/AliADTrigger.h b/AD/AliADTrigger.h
new file mode 100644 (file)
index 0000000..25360ee
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef ALIADTrigger_H
+#define ALIADTrigger_H
+// ---------------------
+// Class AliADTrigger
+// ---------------------
+// Top class to simulate the AD trigger response
+// This class is only used for interface with AliTriggerDetector
+// Its create and Set  Inputs of the CTP
+// The Calculation of the trigger response is done into AliADTriggerSimulator
+//
+
+
+#include "AliTriggerDetector.h"
+
+class AliADTrigger : public AliTriggerDetector
+{
+ public:
+                   AliADTrigger();   // constructor
+   virtual        ~AliADTrigger(){}  // destructor
+   virtual void    CreateInputs();
+   virtual void    Trigger();
+
+   ClassDef( AliADTrigger, 1 )  // AD Trigger Detector class
+};
+
+#endif // AliADTrigger_H
+
+
diff --git a/AD/AliADdigit.cxx b/AD/AliADdigit.cxx
new file mode 100644 (file)
index 0000000..8057d0e
--- /dev/null
@@ -0,0 +1,67 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+#include "AliADdigit.h"
+
+ClassImp(AliADdigit)
+
+//__________________________________________________________________________
+AliADdigit::AliADdigit()
+   :AliDigit(),
+    fModule(0),
+    fCell(0)
+
+{
+  // Standard default
+  // constructor 
+}
+
+//__________________________________________________________________________
+AliADdigit::AliADdigit(Int_t module, Float_t cellPad)
+       : AliDigit(),
+       fModule(module),
+       fCell(cellPad)
+{
+}
+
+//__________________________________________________________________________
+AliADdigit::AliADdigit(Int_t* tracks, Int_t  module, Float_t cellPad)
+       :AliDigit(tracks),
+       fModule(module),
+       fCell(cellPad)
+{
+}
+//__________________________________________________________________________
+AliADdigit::AliADdigit(Int_t* module, Float_t cellPad)
+       : AliDigit(module),
+         fModule(0),
+         fCell(cellPad)
+{
+}
+//__________________________________________________________________________
+AliADdigit::~AliADdigit()
+{
+  //
+  //
+  //
+}
+
+
+//__________________________________________________________________________
+void AliADdigit::Print(const Option_t*) const
+{
+    // Dumps digit object
+    Dump();
+}
diff --git a/AD/AliADdigit.h b/AD/AliADdigit.h
new file mode 100644 (file)
index 0000000..48d35d5
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef ALIADDIGIT_H
+#define ALIADDIGIT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliADdigit.h  $ */
+
+#include "AliDigit.h"
+
+//_____________________________________________________________________________
+class AliADdigit: public AliDigit  {
+
+public:
+                   AliADdigit();
+                  AliADdigit(Int_t* tracks, Int_t module, Float_t cell);
+                  AliADdigit(Int_t* module, Float_t cell);
+                  AliADdigit(Int_t module, Float_t cell);
+  virtual          ~AliADdigit();
+  virtual void      Print(const Option_t* option="") const;
+
+  Int_t GetModule() const {return fModule;}
+  Float_t GetCell() const {return fCell;}
+
+    
+private:
+  Int_t fModule; //! module producing the digit 
+  Float_t           fCell;                  // Time of Flight
+
+  ClassDef(AliADdigit,1)  // AD Digit class
+};
+//typedef AliADdigit AliADdigit;
+#endif
diff --git a/AD/AliADhit.cxx b/AD/AliADhit.cxx
new file mode 100644 (file)
index 0000000..5fe559c
--- /dev/null
@@ -0,0 +1,81 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliADhit.cxx  $ */
+
+//_________________________________________________________________________
+//
+//      Hit class for AD detector   
+//  
+//_________________________________________________________________________
+
+
+#include "AliADhit.h"
+
+ClassImp(AliADhit)
+
+//_____________________________________________________________________________
+AliADhit::AliADhit()
+  : AliHit(), 
+  fModule(0),
+  fEk(0.),
+  fPt(0.),
+  fPx(0.),
+  fPy(0.),
+  fPz(0.),
+  fTof(0.),
+  fTleng(0.),
+  fEloss(0.),
+  fNphot(0),
+  fCell(0),
+  fPrimary(0),
+  fPDG(0),
+  fPDGMother(0)
+{
+   // Default constructor
+}
+
+//_____________________________________________________________________________
+AliADhit::AliADhit(Int_t shunt, Int_t track, Int_t* vol, Float_t* hits)
+  : AliHit(shunt, track),
+  fModule(vol[4]),
+  fEk(hits[3]),
+  fPt(hits[4]),
+  fPx(hits[5]),
+  fPy(hits[6]),
+  fPz(hits[7]),
+  fTof(hits[8]),
+  fTleng(hits[9]),
+  fEloss(hits[10]),
+  fNphot(vol[3]),
+  fCell(vol[4]),         
+  fPrimary(vol[0]),
+  fPDG(vol[1]),
+  fPDGMother(vol[2])
+{
+   // Constructor
+   fX           = hits[0];      // X position of hit
+   fY           = hits[1];      // Y position of hit
+   fZ           = hits[2];      // Z position of hit   
+}
+//_____________________________________________________________________________
+AliADhit::~AliADhit()
+{
+  //
+  // Default destructor.
+  //
+}
+
+
diff --git a/AD/AliADhit.h b/AD/AliADhit.h
new file mode 100644 (file)
index 0000000..a3e5d19
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef ALIADHIT_H
+#define ALIADHIT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliADhit.h  $ */
+
+////////////////////////////////////////////////
+//                                            //
+//  Manager and hits classes for set : AD     //
+//                                            //
+////////////////////////////////////////////////
+#include "AliHit.h"
+#include "TObjArray.h"
+
+class AliADhit : public AliHit {
+public:
+                    AliADhit();
+                    AliADhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
+  virtual          ~AliADhit();
+         Int_t     GetModule()    const { return fModule; }
+          Float_t   GetEnergy()    const { return fEk; }
+          Float_t   GetPt()        const { return fPt; }
+          Float_t   GetPx()        const { return fPx; }
+          Float_t   GetPy()        const { return fPy; }
+          Float_t   GetPz()        const { return fPz; }
+          Float_t   GetTof()       const { return fTof; };
+          Float_t   GetTrackleng() const { return fTleng; }
+          Float_t   GetEloss()     const { return fEloss; }
+            Int_t   GetNphot()     const { return fNphot; }
+            Int_t   GetCell()      const { return fCell; }
+            Int_t   GetTrackStatus()    const { return fPrimary; }
+            Int_t   GetTrackPDG()       const { return fPDG; }
+            Int_t   GetTrackPDGMother() const { return fPDGMother; }
+protected:
+         Float_t fModule;        
+          Float_t   fEk;            // kinetic energy of the entering particle
+          Float_t   fPt;            // Local transverse momentum of the particle
+          Float_t   fPx;            // Local Px momentum of the particle
+          Float_t   fPy;            // Local Py momentum of the particle
+          Float_t   fPz;            // Local Pz momentum of the particle
+          Float_t   fTof;           // Particle time of flight wrt vertex
+          Float_t   fTleng;         // Track length in ADA or ADD detector
+          Float_t   fEloss;         // Energy loss in AD detector
+            Int_t   fNphot;         // Number of photons created by current hit 
+            Int_t   fCell;          // Scintillator cell (Sector Number) (ADA1 = 10-14, ADA2 = 20-24, ADC1 = 30-34, ADC2 = 40-44)
+
+   // The following are for fast analysis, but nor really needed, can be retrive from AliStack with track ID on fTrack
+            Int_t   fPrimary;       // flag (track primary or secondary)
+            Int_t   fPDG;           // PDG code
+            Int_t   fPDGMother;     // PDG code of the mother
+            
+private:
+  ClassDef(AliADhit,1) //  Hits for detector AD
+};
+
+#endif
diff --git a/AD/AliADv1.cxx b/AD/AliADv1.cxx
new file mode 100644 (file)
index 0000000..d0f0867
--- /dev/null
@@ -0,0 +1,606 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliAD.cxx  $ */
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//                  AD (ALICE Diffractive)  Detector                     //
+//                                                                       //
+//  This class contains the base procedures for the AD  detector         //
+//  Default geometry of 2013: 16 modules                                 //
+//  All comments should be sent to :                                     //
+//                                                                       //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+// --- Standard libraries ---
+#include <Riostream.h>
+
+// --- ROOT libraries ---
+#include <TMath.h>
+#include <TString.h>
+#include <TVirtualMC.h>
+#include <TGeoManager.h>
+#include <TGeoMatrix.h>
+#include <TGeoTube.h>
+#include <TGeoCone.h>
+#include <TGeoShape.h>
+#include <TTree.h>
+#include <TSystem.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoMaterial.h>
+#include <TGeoMedium.h>
+#include <TGeoVolume.h>
+#include <TGeoArb8.h>
+#include <TClonesArray.h>
+#include <TGeoTrd2.h>
+#include <TParticle.h>
+
+#include <TH2F.h>
+#include <TCanvas.h>
+
+// --- AliRoot header files ---
+
+
+#include "AliADhit.h"
+#include "AliADdigit.h"
+#include "AliADv1.h"
+#include "AliLog.h"
+#include "AliConst.h"
+#include "AliMagF.h"
+#include "AliRun.h"
+#include "AliMC.h"
+
+
+ClassImp(AliADv1)
+//__________________________________________________________________
+AliADv1::AliADv1()
+  : AliAD(),
+  fADCLightYield(93.75),
+  fADCPhotoCathodeEfficiency(0.18),
+  fADALightYield(93.75),
+  fADAPhotoCathodeEfficiency(0.18)
+
+{
+   // Default Constructor
+    fHits = 0;
+}
+
+//_____________________________________________________________________________
+AliADv1::AliADv1(const char *name, const char *title) : 
+  AliAD(name,title),  
+  fADCLightYield(93.75),
+  fADCPhotoCathodeEfficiency(0.18),
+  fADALightYield(93.75),
+  fADAPhotoCathodeEfficiency(0.18)
+{
+   // Standard constructor for AD Detector
+  
+   AliModule* pipe = gAlice->GetModule("PIPE");
+   if( (!pipe) ) {
+      Error("Constructor","AD needs PIPE!!!\n");
+      exit(1);
+   } 
+   fHits = new TClonesArray("AliADhit",400);
+   gAlice->GetMCApp()->AddHitList(fHits);
+}
+
+//_____________________________________________________________________________
+AliADv1::~AliADv1()
+{
+       // default destructor
+}
+//_____________________________________________________________________________
+void AliADv1::Init()
+{
+  // Initialise L3 magnet after it has been built
+  Int_t i;
+  if(AliLog::GetGlobalDebugLevel()>0) {
+    printf("\n%s: ",ClassName());
+    for(i=0;i<35;i++) printf("*");
+    printf(" ADv1_INIT ");
+    for(i=0;i<35;i++) printf("*");
+    printf("\n%s: ",ClassName());
+    for(i=0;i<80;i++) printf("*");
+    printf("\n");
+  }
+}
+
+//_____________________________________________________________________________
+void AliADv1::CreateGeometry()
+{
+  //
+  // Create the geometry for the AD arrays
+  //
+  
+  CreateAD();
+  
+}
+
+
+//_____________________________________________________________________________
+void AliADv1::CreateAD()
+{
+
+       // here we create AD: ADA & ADC
+
+       // Get ALICE volume
+
+       TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
+
+       // Define the mother volume for AD
+
+       TGeoVolume *ad = new TGeoVolumeAssembly("AD");
+
+       // Get medium
+
+       TGeoMedium *medADASci           = gGeoManager->GetMedium("AD_NE102"); // AD Scin. 
+       TGeoMedium *medADALG            = gGeoManager->GetMedium("AD_PMMA");  // lightGuide
+       TGeoMedium *medADAPMGlass       = gGeoManager->GetMedium("AD_Glass"); // Glass for Aluminium simulation
+       TGeoMedium *medADAPMAlum        = gGeoManager->GetMedium("AD_Alum");  // Aluminium 
+
+
+       ///  ADA Scintillator Pad Measures
+       const Double_t kADATriangleSide   = 7.8;   //
+       const Double_t kADACellSide       = 20.0;
+       const Double_t kADACellThickness  = 2.0;  // Half thickness
+       const int kColorADA = kGreen;
+
+       // Creation of the Box's pad
+
+       new TGeoBBox( "ADAbox", kADACellSide/2.0-kADATriangleSide/2., kADACellSide/2.0, kADACellThickness );
+       const Double_t boxSide2 = kADACellSide/2.0-kADATriangleSide/2.;
+       new TGeoBBox( "ADAbox1", kADATriangleSide/2., boxSide2, kADACellThickness );
+       
+       // translation
+
+       TGeoTranslation *trada2 = new TGeoTranslation( -kADACellSide/2.0,  kADACellSide/2.0 - boxSide2, 0. );
+       trada2->SetName( "trada2" );
+       trada2->RegisterYourself();
+
+       TGeoArb8* sADAtriang = new TGeoArb8( "ADAtriang", kADACellThickness );
+       for ( int iz = 0; iz < 2; iz++ ) {
+               sADAtriang->SetVertex( 0+iz*4, kADACellSide/2.0, kADACellSide/2.0 );
+               sADAtriang->SetVertex( 1+iz*4, kADACellSide/2.0, (kADACellSide/2.0)-kADATriangleSide );
+               sADAtriang->SetVertex( 2+iz*4, kADACellSide/2.0, (kADACellSide/2.0)-kADATriangleSide );
+               sADAtriang->SetVertex( 3+iz*4, kADACellSide/2.0-kADATriangleSide, kADACellSide/2.0 );
+       }    
+       TGeoTranslation *trada1 = new TGeoTranslation( -kADACellSide+kADATriangleSide/2. , -kADACellSide+kADATriangleSide, 0. );
+       trada1->SetName( "trada1" );
+       trada1->RegisterYourself();
+
+       TGeoCompositeShape *sADA1 = new TGeoCompositeShape ( "sADA1s1", "ADAbox+(ADAbox1:trada2)+(ADAtriang:trada1)" );
+       TGeoVolume *vADA1 = new TGeoVolume( "ADApad", sADA1, medADASci );
+       vADA1->SetLineColor( kColorADA ); 
+
+       /// Light guide
+       Double_t kADALGThickness   = 2.0; // Half thickness
+       Double_t kADALGSideScint   = 20.0;
+       Double_t kADALGHeigth      = TMath::Sqrt( kADALGSideScint*kADALGSideScint - (10.5 * 10.5) );
+       Double_t kADALGSideCoupling = 3.0; 
+       const int kColorADALG = kYellow;
+         // Triangle
+       TGeoTrd2* sADALGtriang = new TGeoTrd2( kADALGThickness, kADALGThickness, kADALGSideScint/2., kADALGSideCoupling/2., kADALGHeigth/2.0);
+       TGeoVolume *vADALGtriang = new TGeoVolume( "ADALG", sADALGtriang, medADALG );
+       vADALGtriang->SetLineColor( kColorADALG ); 
+
+       // Coupling
+       Double_t kADALGCoupling = 5.0; 
+       TGeoTube* sADACouplTube = new TGeoTube( "ADACouplTube", 0, 1.4, kADALGCoupling/2. );
+       TGeoVolume * vADACoupling = new TGeoVolume( "ADACoupling", sADACouplTube, medADALG );
+       vADACoupling->SetLineColor( kColorADALG ); 
+   
+       TGeoVolume * vADALG1  = new TGeoVolumeAssembly( "ADALG" );
+       vADALG1->AddNode( vADALGtriang, 1 );   
+       vADALG1->AddNode( vADACoupling, 1, new TGeoTranslation(0., 0., kADALGHeigth/2.+kADALGCoupling/2.) );   
+       vADALG1->SetLineColor( kColorADALG ); 
+      
+       /// PMT  Hamamatsu R5946
+       Double_t kADAPMR1 = 1.95;          // 3.9 cm diameter
+       Double_t kADAPMR2 = 2.15;          // + 2 mm?? aluminium case 
+       Double_t kADAPMlength = 6.4;      // 5 cm PMT + 1.4 socket 
+       const int kColorPMG   = kWhite;
+       const int kColorPMA   = kGray;
+       TGeoTube *sADAPMg1   = new TGeoTube( "sADAPMg", 0., kADAPMR1, kADAPMlength/2. );
+       TGeoVolume *vADAPMg1 = new TGeoVolume( "ADAPMg", sADAPMg1, medADAPMGlass );
+       vADAPMg1->SetLineColor( kColorPMG );
+       TGeoTube *sADAPMa1   = new TGeoTube( "ADAPMa", kADAPMR1, kADAPMR2, kADAPMlength/2. );
+       TGeoVolume *vADAPMa1 = new TGeoVolume( "ADAPMa", sADAPMa1, medADAPMAlum );
+       vADAPMa1->SetLineColor( kColorPMA );
+       TGeoVolume *vADAPM1  = new TGeoVolumeAssembly("ADAPM");
+       vADAPM1->AddNode( vADAPMg1, 1 );
+       vADAPM1->AddNode( vADAPMa1, 1 );
+       /// Sector (Assembly:  Scintillator Pad + Light guide + PM )
+       TGeoVolume *secADA  = new TGeoVolumeAssembly( "ADAsec" ); 
+       // Add PAD
+       secADA->AddNode( vADA1, 1, new TGeoTranslation( kADACellSide/2.0+kADATriangleSide/2. + 0.05, kADACellSide/2.0 + 0.05, 0. ) );
+       // Add Light Guide
+       TGeoCombiTrans *transrot = new TGeoCombiTrans( kADACellSide + kADALGHeigth/2.0 + 0.05, kADALGSideScint/2.0 + 0.05, 0., 
+                                                  new TGeoRotation("rot",90.,90.,90.) );
+       secADA->AddNode( vADALG1, 1, transrot );   
+       // Add PM
+       transrot = new TGeoCombiTrans( kADACellSide + kADALGHeigth  + kADALGCoupling + kADAPMlength/2. + 0.05, kADACellSide/2.0 + 0.05, 0, 
+                                  new TGeoRotation("rot",90.,90.,0.) );
+       secADA->AddNode(vADAPM1, 1, transrot);
+
+       // TODO: Add mechanical support
+   
+       /// Assembling ADA adding 4 sectors                                       //  Sectors
+       TGeoVolume *vADAarray = new TGeoVolumeAssembly( "ADA" );                  //        ^ y
+       vADAarray->AddNode( secADA, 1 );                                          //        |   
+       vADAarray->AddNode( secADA, 2, new TGeoRotation("rot",0.  , 180.,0.) );   //   4    |   1
+       vADAarray->AddNode( secADA, 3, new TGeoRotation("rot",180., 0.,  0.) );   // --------------->  x     
+       vADAarray->AddNode( secADA, 4, new TGeoRotation("rot",180., 180.,0.) );   //   3    |   2
+        TGeoRotation *rotADA90 = new TGeoRotation("adarot",90,0,0);
+       // here I add ADA to AD volume
+       const Float_t kPosADA = 1700.0;
+       ad->AddNode(vADAarray,1, new TGeoCombiTrans("ada",0,0,kPosADA,rotADA90));                                                                     //        |
+       if (GetADAToInstalled())
+       {
+               const Float_t kPosADA2 = 1695.0;
+               ad->AddNode(vADAarray,2, new TGeoCombiTrans("ada",0,0,kPosADA2,rotADA90));
+       }
+
+       // Creation of ADC
+
+       // Get Medium for ADC (in principle is the same as ADA, but I keep the previous variables)
+
+       TGeoMedium *medADCSci     = gGeoManager->GetMedium("AD_NE102");
+       TGeoMedium *medADCLG      = gGeoManager->GetMedium("AD_PMMA");
+       TGeoMedium *medADCPMGlass = gGeoManager->GetMedium("AD_Glass");
+       TGeoMedium *medADCPMAlum  = gGeoManager->GetMedium("AD_Alum");
+       /// Creation of assembly of one ADC sector
+       /// ADC Scintillator Pad 
+       const Double_t kADCCellSide = 30.;
+       const Double_t kADCCellThickness = 4.0;
+       const int kColorADC = kGreen;
+   
+       new TGeoBBox( "ADCbox0", kADCCellSide/4.0, kADCCellSide/2.0, kADCCellThickness/2.0 );
+       new TGeoBBox( "ADCbox1", kADCCellSide/4.0, kADCCellSide/4.0, kADCCellThickness/2.0 );
+       new TGeoBBox( "ADCbox2", 2.5, 5.5, kADCCellThickness/2.0 );
+       TGeoTranslation *tradd1 = new TGeoTranslation( -kADCCellSide/2.0, kADCCellSide/4.0, 0. );
+       TGeoTranslation *tradd2 = new TGeoTranslation( -kADCCellSide/4.0 - 2.5, -kADCCellSide/2.0 + 5.5 , 0. );
+       tradd1->SetName( "tradd1" );
+       tradd2->SetName( "tradd2" );
+       tradd1->RegisterYourself();
+       tradd2->RegisterYourself();
+       TGeoCompositeShape *sADC1 = new TGeoCompositeShape ( "sADCpad", "ADCbox0+(ADCbox1:tradd1)+(ADCbox2:tradd2)" );
+       TGeoVolume *vADC = new TGeoVolume( "ADCpad", sADC1, medADCSci );      
+       vADC->SetLineColor( kColorADC );
+
+       /// Light guide
+       const Double_t kADCLGThickness    = 4.0;
+       const Double_t kADCLGHeigth       = 28.95;        // Dist from scint to coupling
+       const Double_t kADCLGSideScint    = kADCCellSide; // 30.0 
+       const Double_t kADCLGSideCoupling = 4.0; 
+       const int kColorADCLG = kYellow;
+  
+       // Triangle
+       TGeoTrd2* sADCLGtriang = new TGeoTrd2( kADCLGThickness/2., kADCLGThickness/2., kADCLGSideScint/2., kADCLGSideCoupling/2., kADCLGHeigth/2.0);
+       TGeoVolume *vADCLGtriang = new TGeoVolume( "ADCLG", sADCLGtriang, medADCLG );
+       vADCLGtriang->SetLineColor( kColorADCLG ); 
+
+       // Coupling
+       Double_t kADCLGCoupling = 10.0; // Total lenght
+       new TGeoCone( "ADCCouplCone", kADCLGCoupling/4., 0, kADCLGSideCoupling/TMath::Sqrt(2.), 0, 1.4 );
+       new TGeoBBox( "ADCCouplBox", kADCLGSideCoupling/2., kADCLGSideCoupling/2., kADCLGCoupling/4. );
+       new TGeoTube( "ADCCouplTube", 0, 1.4, kADCLGCoupling/4. );
+       TGeoTranslation *tradd3 = new TGeoTranslation(0, 0, kADCLGCoupling/2. );
+       tradd3->SetName( "tradd3" );
+       tradd3->RegisterYourself();
+   
+       TGeoCompositeShape * sADCCoupling = new TGeoCompositeShape ( "sADCCoupling", "ADCCouplBox * ADCCouplCone + (ADCCouplTube:tradd3)" );
+       TGeoVolume * vADCCoupling = new TGeoVolume( "ADCCoupling", sADCCoupling, medADCLG );
+       vADCCoupling->SetLineColor( kColorADCLG ); 
+   
+       TGeoVolume * vADCLG  = new TGeoVolumeAssembly( "ADCLG" );
+       vADCLG->AddNode( vADCLGtriang, 1 );   
+       vADCLG->AddNode( vADCCoupling, 1, new TGeoTranslation(0., 0., kADCLGHeigth/2.+kADCLGCoupling/4.) );   
+       vADCLG->SetLineColor( kColorADCLG ); 
+   
+       /// PM  Hamamatsu R5946  
+       const Double_t kADCPMR1 = 1.95;          // 3.9 cm diameter
+       const Double_t kADCPMR2 = 2.15;          // + 2 mm?? aluminium case 
+       const Double_t kADCPMlength = 6.4;       // 5 cm PMT + 1.4 socket 
+       //const int kColorPMG   = kWhite;
+       ////const int kColorPMA   = kGray;
+       TGeoTube *sADCPMg   = new TGeoTube( "sADCPMg", 0., kADCPMR1, kADCPMlength/2. );
+       TGeoVolume *vADCPMg = new TGeoVolume( "ADCPMg", sADCPMg, medADCPMGlass );
+       vADCPMg->SetLineColor(kColorPMG);
+       TGeoTube *sADCPMa   = new TGeoTube( "ADCPMa", kADCPMR1, kADCPMR2, kADCPMlength/2. );
+       TGeoVolume *vADCPMa = new TGeoVolume( "ADCPMa", sADCPMa, medADCPMAlum );
+       vADCPMa->SetLineColor( kColorPMA );
+       TGeoVolume *vADCPM  = new TGeoVolumeAssembly( "ADCPM" );
+       vADCPM->AddNode( vADCPMg, 1 );
+       vADCPM->AddNode( vADCPMa, 1 );
+
+       /// Sector (Asembly:  Scintillator Pad + Light guide + PM )
+       TGeoVolume *secADC  = new TGeoVolumeAssembly("ADCsec");
+       // Add PAD
+       TGeoCombiTrans *transrot1 = new TGeoCombiTrans( 3*kADCCellSide/4.0, kADCCellSide/2.0, 0., new TGeoRotation("rot",0.,0.,0.) );
+       secADC->AddNode( vADC, 1, transrot1 );
+       // Add Light Guide
+       transrot1 = new TGeoCombiTrans( kADCCellSide + kADCLGHeigth/2.0, kADCLGSideScint/2.0, 0., new TGeoRotation("rot",90.,90.,90.) );
+       secADC->AddNode( vADCLG, 1, transrot1 );
+       // Add PM
+       transrot1 = new TGeoCombiTrans( kADCCellSide + kADCLGHeigth  + kADCLGCoupling + kADCPMlength/2., kADCCellSide/2.0, 0, new TGeoRotation("rot",90.,90.,0.) );
+       secADC->AddNode( vADCPM, 1, transrot1 );
+
+       // TODO: Add mechanical support
+
+       /// Assembling ADC adding the 4 sectors                                   //  Sectors
+       TGeoVolume *vADCarray = new TGeoVolumeAssembly("ADC");                    //        ^ y
+       vADCarray->AddNode( secADC, 1 );                                          //        |   
+       vADCarray->AddNode( secADC, 2, new TGeoRotation("rot", 0.  , 180., 0.) ); //   4    |   1
+       vADCarray->AddNode( secADC, 3, new TGeoRotation("rot", 180., 0.,   0.) ); // --------------->  x  
+       vADCarray->AddNode( secADC, 4, new TGeoRotation("rot", 180., 180., 0.) ); //   3    |   2
+                                                                             //        |
+       // here I add ADC to AD volume
+
+       //const Float_t kPosADC = -1902.75;  // -1902.75 (with 4cm thick) puts the ADC just next to the YSAA3_CC_BLOCK
+       const Float_t kPosADC = -1900.0;
+       ad->AddNode(vADCarray,3,new TGeoTranslation(0,0,kPosADC));
+       // add second array
+       if (GetADCToInstalled())
+       {
+               const Float_t kPosADC2 = -1895.0;
+               ad->AddNode(vADCarray,4,new TGeoTranslation(0,0,kPosADC2));
+       }
+
+       // at the end, I add "AD" volume into ALICE
+
+       alice->AddNode(ad,1);
+}
+
+//_____________________________________________________________________________
+void AliADv1::AddAlignableVolumes() const
+{
+   //
+   // Create entries for alignable volumes associating the symbolic volume
+   // name with the corresponding volume path. Needs to be syncronized with
+   // eventual changes in the geometry.
+   //
+   // ADA and ADC 
+
+
+   
+   TString volpath1 = "/ALIC_1/AD_1/ADC_3";
+   TString volpath2 = "/ALIC_1/AD_1/ADC_4";
+   TString volpath3 = "/ALIC_1/AD_1/ADA_1";
+   TString volpath4 = "/ALIC_1/AD_1/ADA_2";
+   TString symname1 = "AD/ADC3";
+   TString symname2 = "AD/ADC4"; 
+   TString symname3 = "AD/ADA1";
+   TString symname4 = "AD/ADA2"; 
+   
+   if ( !gGeoManager->SetAlignableEntry(symname1.Data(), volpath1.Data()) )
+      AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname1.Data(), volpath1.Data()) );
+   if ( GetADCToInstalled() && !gGeoManager->SetAlignableEntry(symname2.Data(), volpath2.Data()) )
+      AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname2.Data(), volpath2.Data()) );
+   if ( !gGeoManager->SetAlignableEntry(symname3.Data(), volpath3.Data()) )
+      AliFatal(Form( "Alignable entry %s not created. Volume path %s not valid", symname3.Data(), volpath3.Data()) );
+   if ( GetADAToInstalled() && !gGeoManager->SetAlignableEntry(symname4.Data(), volpath4.Data()) )
+      AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname4.Data(), volpath4.Data()) );
+   
+}
+
+
+//_____________________________________________________________________________
+void AliADv1::StepManager()
+{
+
+   //
+   // Routine called at every step in the AD
+   //
+
+   // ADA and ADC static Variables         //
+   //static  Int_t   numStep_ad = 0;         //
+//   static  Int_t   vol_ad[2];              //
+  
+   /////////////////////////////////////////////////////////////////////////
+   // ADA and ADC
+   /////////////////////////////////////////////////////////////////////////
+      
+      
+   // Get sensitive volumes id (scintillator pads)
+   static Int_t idADA = gMC->VolId( "ADApad" );
+   static Int_t idADC = gMC->VolId( "ADCpad" );
+   
+   // We keep only charged tracks : 
+   // if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;   
+   // We keep charged and non-charged tracks : 
+   if ( !gMC->IsTrackAlive() ) return;   
+   
+   Int_t copy;
+   Int_t current_volid = gMC->CurrentVolID( copy );
+
+   // check is the track is in a sensitive volume
+   if( current_volid != idADA && current_volid != idADC ) {
+      return; // not in the sensitive volume 
+   }
+   
+   // First read the position, otherwise weird reults! //ecv
+   Double_t s[3];
+   Float_t  x[3];
+   gMC->TrackPosition( s[0], s[1], s[2] );
+   for ( Int_t j=0; j<3; j++ ) x[j] = s[j];
+   
+   // Set detectro type: ADA or ADC
+   Int_t detType = (current_volid == idADA ) ? 0 : 1;
+   
+   // Get sector copy (1,2,3,4) ( 1 level up from pad )
+   Int_t sect;
+   gMC->CurrentVolOffID( 1, sect );
+
+   // Get Detector copy (1,2) ( 2 levels up from pad )
+   Int_t detc;
+   gMC->CurrentVolOffID( 2, detc );
+   
+   // Sector number 
+   // ADA1 = 10-14
+   // ADA2 = 20-24
+   // ADC1 = 30-34
+   // ADC2 = 40-44
+   Int_t sectorNumber_AD = detType*20 + detc*10 + sect;
+   
+   Double_t lightYield_ad;
+   Double_t photoCathodeEfficiency;
+  
+   if( detType == 1 )  {
+      lightYield_ad          = fADCLightYield;
+      photoCathodeEfficiency = fADCPhotoCathodeEfficiency;
+   } else  {
+      lightYield_ad          = fADALightYield;
+      photoCathodeEfficiency = fADAPhotoCathodeEfficiency;
+   }
+      
+   Float_t destep_ad = gMC->Edep();
+   Float_t step_ad   = gMC->TrackStep();
+   Int_t  nPhotonsInStep_ad = Int_t( destep_ad / (lightYield_ad * 1e-9) ); 
+   nPhotonsInStep_ad = gRandom->Poisson( nPhotonsInStep_ad );
+   
+   static  Float_t eloss_ad    = 0.;
+   static  Float_t tlength_ad  = 0.;   
+   static  Int_t   nPhotons_ad = 0;      
+   static  Float_t hits_ad[11];            
+   static  Int_t   vol_ad[5];
+
+   eloss_ad   += destep_ad;
+   tlength_ad += step_ad;  
+   if ( gMC->IsTrackEntering() ) { 
+      nPhotons_ad = nPhotonsInStep_ad;
+      Double_t p[4];
+      gMC->TrackMomentum( p[0], p[1], p[2], p[3] );
+      Float_t pt  = TMath::Sqrt( p[0]*p[0] + p[1]*p[1] + p[2]*p[2] ); 
+      TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
+      Int_t imo = par->GetFirstMother();
+      Int_t pdgMo = 0;
+      if ( imo > 0 ) {
+         TParticle * pmot = gAlice->GetMCApp()->Particle(imo);
+         pdgMo = pmot->GetPdgCode();
+      }
+
+      // Set integer values
+      vol_ad[0]  = par->GetStatusCode();    // secondary flag //ecv
+      vol_ad[1]  = par->GetPdgCode();       // PDG code
+      vol_ad[2]  = pdgMo;                   // PDG of the mother
+      // Set float values
+      hits_ad[0]  = x[0];     // X
+      hits_ad[1]  = x[1];     // Y 
+      hits_ad[2]  = x[2];     // Z       
+      hits_ad[3]  = p[3];     // kinetic energy of the entering particle
+      hits_ad[4]  = pt;       // Pt
+      hits_ad[5]  = p[0];     // Px
+      hits_ad[6]  = p[1];     // Py
+      hits_ad[7]  = p[2];     // Pz
+      hits_ad[8]  = 1.0e09*gMC->TrackTime(); // in ns!
+  
+      tlength_ad = 0.0;
+      eloss_ad   = 0.0; 
+      
+      return; // without return, we count 2 times nPhotonsInStep_ad !!!???
+   }
+   
+   nPhotons_ad += nPhotonsInStep_ad;
+
+   if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared() ) {
+
+      // Set integer values
+      vol_ad[3]  = nPhotons_ad;
+       // brutal correction for ADA_1
+      if (sectorNumber_AD==11) sectorNumber_AD=0;
+      if (sectorNumber_AD==12) sectorNumber_AD=1;
+      if (sectorNumber_AD==13) sectorNumber_AD=2;
+      if (sectorNumber_AD==14) sectorNumber_AD=3;
+
+       // same for ADA_2
+      if (sectorNumber_AD==21) sectorNumber_AD=4;
+      if (sectorNumber_AD==22) sectorNumber_AD=5;
+      if (sectorNumber_AD==23) sectorNumber_AD=6;
+      if (sectorNumber_AD==24) sectorNumber_AD=7;
+
+       // brutal correction for ADC_3
+      if (sectorNumber_AD==51) sectorNumber_AD=8;
+      if (sectorNumber_AD==52) sectorNumber_AD=9;
+      if (sectorNumber_AD==53) sectorNumber_AD=10;
+      if (sectorNumber_AD==54) sectorNumber_AD=11;
+
+       // same for ADC_4
+      if (sectorNumber_AD==61) sectorNumber_AD=12;
+      if (sectorNumber_AD==62) sectorNumber_AD=13;
+      if (sectorNumber_AD==63) sectorNumber_AD=14;
+      if (sectorNumber_AD==64) sectorNumber_AD=15;
+
+
+      vol_ad[4]  = sectorNumber_AD;  // sector number (scintillator ID)
+      // Set float values
+      hits_ad[9]  = tlength_ad;    // track lenght inside ADC or ADA
+      hits_ad[10] = eloss_ad;      // energy loss
+      Int_t track = gAlice->GetMCApp()->GetCurrentTrackNumber();
+      AddHit( track, vol_ad, hits_ad ); // <-- this is in AliAD.cxx
+      tlength_ad        = 0.0;
+      eloss_ad          = 0.0; 
+      nPhotons_ad       = 0;
+   }
+       
+   //   Do we need track reference ????
+   // if( gMC->IsTrackEntering() || gMC->IsTrackExiting() ) {
+   //    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), 49);
+   // }
+}
+//_________________________________________________________
+void AliADv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
+{
+       TClonesArray &lhits = *fHits;
+       new(lhits[fNhits++]) AliADhit(fIshunt,track,vol,hits);
+}
+//_________________________________________________________
+void AliADv1::AddDigits(Int_t* track, Int_t module, Float_t time)
+{
+       TClonesArray &ldigits = *fDigits;
+       new(ldigits[fNdigits++]) AliADdigit(track,module,time);
+}
+//_________________________________________________________
+void AliADv1::MakeBranch(Option_t *option)
+{
+
+       // Create branches in the current tree
+       TString branchname(Form("%s",GetName()));
+       AliDebug(2,Form("fBufferSize = %d",fBufferSize));
+       const char *cH = strstr(option,"H");
+       if (fHits && fLoader->TreeH() && cH)
+       {
+               fLoader->TreeH()->Branch(branchname.Data(),&fHits,fBufferSize);
+               AliDebug(2,Form("Making Branch %s for hits",branchname.Data()));
+       }
+       const char *cD = strstr(option,"D");
+       if (fDigits   && fLoader->TreeD() && cD) 
+       {
+               fLoader->TreeD()->Branch(branchname.Data(),&fDigits, fBufferSize);
+               AliDebug(2,Form("Making Branch %s for digits",branchname.Data()));
+       }  
+}
diff --git a/AD/AliADv1.h b/AD/AliADv1.h
new file mode 100644 (file)
index 0000000..e9dd293
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef ALIADV1_H
+#define ALIADV1_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+//////////////////////////////////////////////////
+//  Manager and hits classes for set : AD       //
+//////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//                  AD (ALICE Diffractive)  Detector                     //
+//                                                                       //
+//  This class contains the base procedures for the AD  detector         //
+//  Default geometry of 2013                                             //
+//  All comments should be sent to :                                     //
+//                                                                       //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliAD.h"
+
+class AliADv1 : public AliAD {
+public:
+   
+                        AliADv1();
+                        AliADv1(const char *name, const char *title);
+  virtual       void   AddAlignableVolumes() const;
+  virtual              ~AliADv1();
+
+   
+  virtual      TString Version() { return TString("v1"); }
+  virtual       Int_t  IsVersion() const { return 1; }
+  virtual      void   AddHit(Int_t track, Int_t *vol, Float_t *hits);
+  virtual      void   AddDigits(Int_t* track, Int_t module, Float_t time);
+  virtual      void   MakeBranch(Option_t *option);
+  virtual       void   CreateGeometry();
+  virtual      void   Init();
+  virtual       void   StepManager();
+
+protected:
+
+  // functions for ADA and ADC
+  virtual       void   CreateAD();
+
+private:
+  //! ADC Geometrical & Optical parameters :
+  
+  Double_t    fADCLightYield;       //! Lightyield in NE102
+  Double_t    fADCPhotoCathodeEfficiency;
+
+  //! ADA Geometrical & Optical parameters :
+  Double_t    fADALightYield;       //! Lightyield in NE102
+  Double_t    fADAPhotoCathodeEfficiency;  
+
+
+                       AliADv1(const AliAD&); 
+                       AliADv1& operator = (const AliADv1&); 
+  
+  ClassDef(AliADv1, 1)  //!Class for the AD detector
+   
+};
+
+
+#endif
diff --git a/AD/CMakelibADbase.pkg b/AD/CMakelibADbase.pkg
new file mode 100644 (file)
index 0000000..97f9e67
--- /dev/null
@@ -0,0 +1,51 @@
+# -*- mode: CMake -*- 
+#--------------------------------------------------------------------------------#
+# Package File for ADbase                                                        #
+# Author :                                        #
+# Variables Defined :                                                            #
+#                                                                                #
+# SRCS - C++ source files                                                        #
+# HDRS - C++ header files                                                        #
+# DHDR - ROOT Dictionary Linkdef header file                                     #
+# CSRCS - C source files                                                         #
+# CHDRS - C header files                                                         #
+# EINCLUDE - Include directories                                                 #
+# EDEFINE - Compiler definitions                                                 #
+# ELIBS - Extra libraries to link                                                #
+# ELIBSDIR - Extra library directories                                           #
+# PACKFFLAGS - Fortran compiler flags for package                                #
+# PACKCXXFLAGS - C++ compiler flags for package                                  #
+# PACKCFLAGS - C compiler flags for package                                      #
+# PACKSOFLAGS - Shared library linking flags                                     #
+# PACKLDFLAGS - Module linker flags                                              #
+# PACKBLIBS - Libraries to link (Executables only)                               #
+# EXPORT - Header files to be exported                                           #
+# CINTHDRS - Dictionary header files                                             #
+# CINTAUTOLINK - Set automatic dictionary generation                             #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS  
+    AliADLoader.cxx 
+    AliADdigit.cxx 
+    AliADSDigit.cxx 
+    AliADCalibData.cxx 
+#    AliADPreprocessor.cxx 
+#    AliADDataDCS.cxx 
+#    AliADQAChecker.cxx 
+#    AliADMisAligner.cxx 
+#    AliADLogicalSignal.cxx 
+#    AliADTrending.cxx 
+#    AliADDataFEE.cxx 
+#    AliADTriggerSimulator.cxx 
+#    AliADTriggerData.cxx 
+    )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR ADbaseLinkDef.h)
+
+set ( EINCLUDE  STRUCT RAW STEER/STEER STEER/CDB STEER/STEERBase)
+
+set ( EXPORT AliADdigit.h)
diff --git a/AD/CMakelibADrec.pkg b/AD/CMakelibADrec.pkg
new file mode 100644 (file)
index 0000000..5cf98a2
--- /dev/null
@@ -0,0 +1,43 @@
+# -*- mode: CMake -*- 
+#--------------------------------------------------------------------------------#
+# Package File for ADrec                                                         #
+# Author :                                        #
+# Variables Defined :                                                            #
+#                                                                                #
+# SRCS - C++ source files                                                        #
+# HDRS - C++ header files                                                        #
+# DHDR - ROOT Dictionary Linkdef header file                                     #
+# CSRCS - C source files                                                         #
+# CHDRS - C header files                                                         #
+# EINCLUDE - Include directories                                                 #
+# EDEFINE - Compiler definitions                                                 #
+# ELIBS - Extra libraries to link                                                #
+# ELIBSDIR - Extra library directories                                           #
+# PACKFFLAGS - Fortran compiler flags for package                                #
+# PACKCXXFLAGS - C++ compiler flags for package                                  #
+# PACKCFLAGS - C compiler flags for package                                      #
+# PACKSOFLAGS - Shared library linking flags                                     #
+# PACKLDFLAGS - Module linker flags                                              #
+# PACKBLIBS - Libraries to link (Executables only)                               #
+# EXPORT - Header files to be exported                                           #
+# CINTHDRS - Dictionary header files                                             #
+# CINTAUTOLINK - Set automatic dictionary generation                             #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS  
+    AliADReconstructor.cxx 
+    AliADTrigger.cxx 
+    AliADRecoParam.cxx
+#    AliADRawStream.cxx 
+#    AliADQADataMakerRec.cxx 
+#    AliADTriggerMask.cxx 
+#    AliADRecoParam.cxx 
+    )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR ADrecLinkDef.h)
+
+set ( EINCLUDE  STRUCT RAW STEER/STEER STEER/CDB STEER/ESD STEER/STEERBase)
diff --git a/AD/CMakelibADsim.pkg b/AD/CMakelibADsim.pkg
new file mode 100644 (file)
index 0000000..fc43f7f
--- /dev/null
@@ -0,0 +1,42 @@
+# -*- mode: CMake -*- 
+#--------------------------------------------------------------------------------#
+# Package File for ADsim                                                         #
+# Author :                                        #
+# Variables Defined :                                                            #
+#                                                                                #
+# SRCS - C++ source files                                                        #
+# HDRS - C++ header files                                                        #
+# DHDR - ROOT Dictionary Linkdef header file                                     #
+# CSRCS - C source files                                                         #
+# CHDRS - C header files                                                         #
+# EINCLUDE - Include directories                                                 #
+# EDEFINE - Compiler definitions                                                 #
+# ELIBS - Extra libraries to link                                                #
+# ELIBSDIR - Extra library directories                                           #
+# PACKFFLAGS - Fortran compiler flags for package                                #
+# PACKCXXFLAGS - C++ compiler flags for package                                  #
+# PACKCFLAGS - C compiler flags for package                                      #
+# PACKSOFLAGS - Shared library linking flags                                     #
+# PACKLDFLAGS - Module linker flags                                              #
+# PACKBLIBS - Libraries to link (Executables only)                               #
+# EXPORT - Header files to be exported                                           #
+# CINTHDRS - Dictionary header files                                             #
+# CINTAUTOLINK - Set automatic dictionary generation                             #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS  
+    AliAD.cxx 
+    AliADv1.cxx 
+    AliADhit.cxx 
+    AliADDigitizer.cxx 
+#    AliADBuffer.cxx 
+#    AliADQADataMakerSim.cxx
+    )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR ADsimLinkDef.h)
+
+set ( EINCLUDE  STRUCT RAW STEER/STEER STEER/STEERBase)
diff --git a/AD/MakeADZeroMisAlignment.C b/AD/MakeADZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..6e533e6
--- /dev/null
@@ -0,0 +1,67 @@
+void MakeADZeroMisAlignment()
+{
+  // Create TClonesArray of zero misalignment objects for AD
+  // 
+  const char* macroname = "MakeADZeroMisAlignment.C";
+
+  TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
+  TClonesArray &alobj = *array;
+
+  Double_t dx=0., dy=0., dz=0.;
+  Double_t dpsi=0., dtheta=0., dphi=0.;
+
+  const char * ADC1 = "AD/ADC1";
+  const char * ADC2 = "AD/ADC2";
+  const char * ADA1 = "AD/ADA1";
+  const char * ADA2 = "AD/ADA2";
+
+  UShort_t iIndex=0;
+  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
+  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
+
+  new( alobj[0] ) AliAlignObjParams( ADC1, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
+  new( alobj[1] ) AliAlignObjParams( ADC2, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
+  new( alobj[2] ) AliAlignObjParams( ADA1, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
+  new( alobj[3] ) AliAlignObjParams( ADA2, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
+
+  if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
+     
+    // save in file
+    const char* filename = "ADzeroMisalignment.root";
+    TFile f( filename, "RECREATE");
+    if (!f) {
+      Error( macroname, "cannot open file for output\n");
+      return;
+    }
+    Info( macroname,"Saving alignment objects to the file %s", filename);
+    f.cd();
+    f.WriteObject( array, "ADAlignObjs", "kSingleKey");
+    f.Close();
+    
+  } else {
+     
+    // save in CDB storage
+    TString storage = gSystem->Getenv("STORAGE");
+    if ( !storage.BeginsWith("local://") && !storage.BeginsWith("alien://") ) {
+      Error( macroname, "STORAGE variable set to %s is not valid. Exiting\n", storage.Data());
+      return;
+    }
+    Info( macroname, "Saving alignment objects in CDB storage %s", storage.Data() );
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storageCDB = cdb->GetStorage(storage.Data());
+    if ( !storageCDB ) {
+      Error( macroname,"Unable to open storage %s\n", storageCDB.Data());
+      return;
+    }
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible( "Ernesto Lopez" );
+    md->SetComment( "Alignment objects for AD zero misalignment" );
+    md->SetAliRootVersion( gSystem->Getenv("ARVERSION") );
+    AliCDBId id( "AD/Align/Data", 0, AliCDBRunRange::Infinity() );
+    storageCDB->Put( array, id, md );
+  }
+
+  array->Delete();
+
+}
+
diff --git a/AD/macros/DBStorageCalib.C b/AD/macros/DBStorageCalib.C
new file mode 100644 (file)
index 0000000..fa2404e
--- /dev/null
@@ -0,0 +1,47 @@
+void DBStorageCalib(){
+
+AliCDBManager *man = AliCDBManager::Instance();
+
+AliCDBStorage *storLoc;
+man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+
+
+AliADCalibData *calibda = new AliADCalibData("Calib");
+
+Float_t Efficiencies[16] = { 
+  0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+  0.94, 0.94, 0.94, 0.94, 0.94, 0.94
+};
+Float_t Rates[16] = {
+
+  1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+  1.14, 0.94, 0.94, 0.94, 0.94, 0.94
+
+
+                    };
+  
+calibda->SetEfficiencies(Efficiencies);
+calibda->SetRates(Rates);
+
+// Creation of the object AD Calibration as a MetaData
+        
+TObjString str("AD Calibration");      // object that will be stored
+
+AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
+
+AliCDBId id("AD/Calib/Data",0,9999999);
+
+md->SetResponsible("Mario Rodriguez Cahuantzi");
+md->SetBeamPeriod(0);
+md->SetAliRootVersion("v5-04-Rev-08");
+md->SetComment("Prototype");
+md->PrintMetaData();
+
+storLoc = man->GetDefaultStorage();
+storLoc->Put(calibda, id, md);
+
+storLoc->Delete();
+delete md;
+
+}
+
index 2e8c038..18d6095 100644 (file)
@@ -34,9 +34,9 @@ set ( ELIBSDIR )
 set(MFT_UPGRADE $ENV{MFT_UPGRADE})
   
 if(MFT_UPGRADE)
-set ( ELIBS  MUONevaluation    MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec TPCutil  ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase HLTshuttle TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase)
+set ( ELIBS  MUONevaluation    MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec TPCutil  ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ADbase ADsim ADrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase HLTshuttle TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase)
 else(MFT_UPGRADE)
-set ( ELIBS  MUONevaluation    MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec TPCutil ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase HLTshuttle TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase)
+set ( ELIBS  MUONevaluation    MUONmapping MUONshuttle MUONgraphics MUONsim MUONrec MUONgeometry MUONcalib MUONbase MUONraw MUONtrigger MUONcore TPCbase TPCsim TPCrec TPCutil ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOSUtils PHOSbase PHOSsim PHOSrec ADbase ADsim ADrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDrec HMPIDsim ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec EMCALraw BCM STRUCT T0base T0sim T0rec FASTSIM microcern HLTbase HLTshuttle TRIGGERbase STEER STAT CDB AOD  STEERBase ESD ANALYSIS RAWDatasim RAWDatarec RAWDatabase)
 endif(MFT_UPGRADE)
 
 if(PYTHIA6)
@@ -55,9 +55,9 @@ if( ALICE_TARGET STREQUAL "macosx")
 endif( ALICE_TARGET STREQUAL "macosx")
 
 if(MFT_UPGRADE)
-  set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase HLTshuttle ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCutil STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+  set (ARPACKS FMDbase FMDsim FMDrec ADbase ADsim ADrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec MFTbase MFTsim MFTrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase HLTshuttle ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCutil STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
 else(MFT_UPGRADE)
-  set (ARPACKS FMDbase FMDsim FMDrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase HLTshuttle ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCutil STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
+  set (ARPACKS FMDbase FMDsim FMDrec ADbase ADsim ADrec ACORDEbase ACORDEsim ACORDErec HMPIDbase HMPIDsim HMPIDrec ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCALUtils EMCALbase EMCALsim EMCALrec T0base T0sim T0rec TOFbase TOFsim TOFrec TRDbase TRDsim TRDrec PMDbase PMDsim PMDrec MUONmapping MUONmapping MUONgeometry MUONbase MUONsim MUONrec MUONraw PHOSUtils PHOSbase PHOSsim PHOSrec HLTbase HLTshuttle ITSbase ITSsim ITSrec STRUCT TPCbase TPCsim TPCrec TPCutil STEER CDB ESD STEERBase RAWDatabase RAWDatasim RAWDatarec MDC TRIGGERbase)
 endif(MFT_UPGRADE)
 
 set(GFILES)
index decf52e..06bf9d6 100644 (file)
@@ -129,7 +129,7 @@ set(BINLIBDIRS "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
 
 # Standard Modules
 # ------------------------------
-set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT STAT TTherminator CORRFW DPMJET TDPMjet STARLIGHT PWGPP PWG PWGCF PWGGA PWGHF PWGDQ PWGJE PWGLF PWGUD TRIGGER PYTHIA8 TAmpt OADB MFT TEvtGen)
+set(ALIROOTMODULES STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS AD ACORDE HMPID T0 BCM STRUCT VZERO THijing THbtp EMCAL THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS JETAN HLT STAT TTherminator CORRFW DPMJET TDPMjet STARLIGHT PWGPP PWG PWGCF PWGGA PWGHF PWGDQ PWGJE PWGLF PWGUD TRIGGER PYTHIA8 TAmpt OADB MFT TEvtGen)
 
 if(THydjet)
   list(APPEND ALIROOTMODULES THydjet)
@@ -170,7 +170,7 @@ set(MODDIRS ${MODULES})
 
 # Libraries for Linking
 # ------------------------------
-set(ALILIBS MUON TPC PMD TRD FMD TOF ITS PHOS ACORDE HMPID VZERO ZDC STRUCT T0 EVGEN STEER TRIGGER MFT)
+set(ALILIBS MUON TPC PMD TRD FMD TOF ITS PHOS AD ACORDE HMPID VZERO ZDC STRUCT T0 EVGEN STEER TRIGGER MFT)
 set(LIBS ${ROOTCLIBS} ${ROOTPLIBS} ${SYSLIBS})
 
 # Configure ARVerion.h
index eb8bbb6..6055849 100644 (file)
@@ -8,7 +8,7 @@ set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "1000")
 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "1000")
 set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "5000")
 set(CTEST_PROJECT_SUBPROJECTS STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS
-      ACORDE HMPID T0 BCM STRUCT EVGEN RALICE VZERO 
+      AD ACORDE HMPID T0 BCM STRUCT EVGEN RALICE VZERO 
       THijing THbtp EMCAL 
       THerwig TEPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS 
       JETAN HLT LHC ESDCheck STAT TTherminator CORRFW DPMJET TDPMjet 
index 97730f6..264edb6 100644 (file)
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: AliEveEventManager.cxx 59994 2012-12-14 10:03:06Z quark $
 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
 /**************************************************************************
@@ -1249,7 +1249,7 @@ Bool_t AliEveEventManager::InitRecoParam()
     // the available reco-param objects from there.
 
     fgRecoParam = new AliRecoParam;
-    const Int_t  kNDetectors = 14;
+    const Int_t  kNDetectors = 15;
 
     static const TEveException kEH("AliEveEventManager::InitRecoParam");
 
@@ -1289,7 +1289,7 @@ Bool_t AliEveEventManager::InitRecoParam()
         }
     }
 
-    const char* fgkDetectorName[kNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE" };
+    const char* fgkDetectorName[kNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "AD" };
 
 
     for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
index 46bf3db..30cc4b7 100644 (file)
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: AliEveEventManager.h 59763 2012-11-27 12:42:41Z hristov $
 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
 /**************************************************************************
diff --git a/EVE/alice-macros/ad_hits.C b/EVE/alice-macros/ad_hits.C
new file mode 100644 (file)
index 0000000..7c82d5c
--- /dev/null
@@ -0,0 +1,54 @@
+// $Id: acorde_hits.C 55060 2012-03-09 18:13:17Z quark $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TTree.h>
+#include <TString.h>
+#include <TEveManager.h>
+#include <TEveElement.h>
+#include <TEvePointSet.h>
+
+#include <AliEveEventManager.h>
+#include <AliRunLoader.h>
+#endif
+
+TEvePointSet*
+ad_hits(const char  *varexp    = "AD.fX:AD.fY:AD.fZ",
+           const char  *selection = "",
+           TEveElement *cont      = 0)
+{
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
+  rl->LoadHits("AD");
+
+  TTree* ht = rl->GetTreeH("AD", false);
+
+  TEvePointSet* points = new TEvePointSet(Form("AD Hits '%s'", selection));
+
+  TEvePointSelector ps(ht, points, varexp, selection);
+  ps.Select();
+
+  if(points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE)
+  {
+    Warning("ad_hits", "No hits match '%s'", selection);
+    delete points;
+    return 0;
+  }
+
+  points->SetName(Form("AD Hits"));
+  const TString viz_tag("SIM Hits AD");
+  points->ApplyVizTag(viz_tag, "Hits");
+
+  points->SetTitle(Form("N=%d", points->Size()));
+  points->SetMarkerSize(.5);
+  points->SetMarkerColor(2);
+
+  gEve->AddElement(points, cont);
+  gEve->Redraw3D();
+
+  return points;
+}
diff --git a/EVE/alice-macros/geom_ad.C b/EVE/alice-macros/geom_ad.C
new file mode 100644 (file)
index 0000000..9b32151
--- /dev/null
@@ -0,0 +1,38 @@
+// $Id: geom_acorde.C 55329 2012-03-23 19:29:00Z quark $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TGeoManager.h>
+#include <TGeoNode.h>
+#include <TEveManager.h>
+#include <TEveElement.h>
+#include <TEveGeoNode.h>
+
+#include <AliEveEventManager.h>
+#endif
+
+void geom_ad()
+{
+  AliEveEventManager::AssertGeometry();
+
+  TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("AD_1");
+  if (!node) {
+    Warning("geom_ad()", "Node AD_1 not found.");
+    return;
+  }
+
+  TEveElementList* list = new TEveElementList("AD");
+  gEve->AddGlobalElement(list);
+
+  TEveGeoTopNode* re = new TEveGeoTopNode(gGeoManager, node);
+  re->UseNodeTrans();
+  gEve->AddGlobalElement(re, list);
+
+  gEve->Redraw3D();
+}
diff --git a/OCDB/AD/Align/Data/Run0_999999999_v0_s0.root b/OCDB/AD/Align/Data/Run0_999999999_v0_s0.root
new file mode 100644 (file)
index 0000000..f2881cd
Binary files /dev/null and b/OCDB/AD/Align/Data/Run0_999999999_v0_s0.root differ
diff --git a/OCDB/AD/Calib/Data/Run0_9999999_v0_s0.root b/OCDB/AD/Calib/Data/Run0_9999999_v0_s0.root
new file mode 100644 (file)
index 0000000..ea36641
Binary files /dev/null and b/OCDB/AD/Calib/Data/Run0_9999999_v0_s0.root differ
diff --git a/OCDB/AD/Calib/RecoParam/Run0_9999999_v0_s0.root b/OCDB/AD/Calib/RecoParam/Run0_9999999_v0_s0.root
new file mode 100644 (file)
index 0000000..ea36641
Binary files /dev/null and b/OCDB/AD/Calib/RecoParam/Run0_9999999_v0_s0.root differ
index 00a239d..c976ee5 100644 (file)
Binary files a/OCDB/GRP/Geometry/Data/Run0_999999999_v0_s0.root and b/OCDB/GRP/Geometry/Data/Run0_999999999_v0_s0.root differ
index 16d841c..30fc5df 100644 (file)
@@ -49,6 +49,7 @@ set ( SRCS
     ESD/AliMeanVertex.cxx 
     ESD/AliESDCaloCells.cxx 
     ESD/AliESDACORDE.cxx 
+    ESD/AliESDAD.cxx 
     ESD/AliESDVZEROfriend.cxx 
     ESD/AliESDHandler.cxx 
     ESD/AliTrackerBase.cxx  
index 26a801b..442e047 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+/* $Id: AliESD.cxx 54579 2012-02-14 12:22:34Z shahoian $ */
 
 //-----------------------------------------------------------------
 //           Implementation of the ESD class
@@ -74,6 +74,7 @@ AliESD::AliESD():
   fESDFMD(0x0),
   fESDVZERO(0x0),
   fESDACORDE(0x0),
+  fESDAD(0x0),
   fErrorLogs("AliRawDataErrorLog",5)
   #ifdef MFT_UPGRADE
  // ,fESDMFT(0x0)
@@ -140,6 +141,7 @@ AliESD::AliESD(const AliESD& esd):
   fESDFMD(esd.fESDFMD),
   fESDVZERO(esd.fESDVZERO),
   fESDACORDE(esd.fESDACORDE),
+  fESDAD(esd.fESDAD),
   fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone()))
   #ifdef MFT_UPGRADE
   //, fESDMFT(esd.fESDMFT)
@@ -180,6 +182,7 @@ AliESD::~AliESD()
   delete fPHOSTriggerPosition;
   delete fPHOSTriggerAmplitudes;
   delete fESDACORDE;
+  delete fESDAD;
   #ifdef MFT_UPGRADE
 //  delete fESDMFT;
   #endif
@@ -263,6 +266,12 @@ void AliESD::Reset()
       fESDACORDE->~AliESDACORDE();
       new (fESDACORDE) AliESDACORDE(); 
   }    
+
+ if (fESDAD){
+      fESDAD->~AliESDAD();
+      new (fESDAD) AliESDAD(); 
+  }    
+
 //
   #ifdef MFT_UPGRADE
  // if (fESDMFT){
index 86dc6b4..478febc 100644 (file)
@@ -5,7 +5,7 @@
  * See cxx source for full Copyright notice                               */
 
 
-/* $Id$ */
+/* $Id: AliESD.h 52237 2011-10-20 19:26:08Z hristov $ */
 
 //-------------------------------------------------------------------------
 //                          Class AliESD
@@ -33,6 +33,7 @@
 #include "AliMultiplicity.h"
 #include "AliRawDataErrorLog.h"
 #include "AliESDACORDE.h"
+#include "AliESDAD.h"
 #ifdef MFT_UPGRADE
 //#include "AliESDMFT.h"
 #endif
@@ -246,6 +247,11 @@ public:
   #endif
   void SetACORDEData(AliESDACORDE * obj){ fESDACORDE = new AliESDACORDE(*obj); } 
   AliESDACORDE *GetACORDEDAta(){ return fESDACORDE; }
+  void SetADData(AliESDAD * obj){ fESDAD = new AliESDAD(*obj); } 
+  AliESDAD *GetADData(){ return fESDAD; }
+
+
+
   AliRawDataErrorLog *GetErrorLog(Int_t i) const {
     return (AliRawDataErrorLog *)fErrorLogs.UncheckedAt(i);
   }
@@ -317,6 +323,7 @@ protected:
   AliESDFMD   *fESDFMD;   // FMD object containing rough multiplicity
   AliESDVZERO *fESDVZERO; // VZERO object containing rough multiplicity
   AliESDACORDE *fESDACORDE; // ACORDE ESD object containing bit pattern
+  AliESDAD *fESDAD; // AD ESD object containing bit pattern
   #ifdef MFT_UPGRADE
   //AliESDMFT *fESDMFT; // MFT object containing rough multiplicity
   #endif
diff --git a/STEER/ESD/AliESDAD.cxx b/STEER/ESD/AliESDAD.cxx
new file mode 100644 (file)
index 0000000..0ad2fe3
--- /dev/null
@@ -0,0 +1,76 @@
+
+
+// Last update: Nov. 5th 2013 
+
+#include "AliESDAD.h"
+
+ClassImp(AliESDAD)
+
+AliESDAD::AliESDAD():TObject()
+{
+ //Default constructor
+       for(Int_t i=0;i<16;i++)
+       {
+               fADCellID[i] = 0;
+       }
+}
+
+
+AliESDAD::AliESDAD(const AliESDAD &o)
+  :TObject(o)
+
+{      
+       //Default constructor
+       for(Int_t i=0;i<16;i++)
+       {
+               fADCellID[i] = o.fADCellID[i];
+       }
+}
+
+
+AliESDAD::AliESDAD(Bool_t* MADBitCell):TObject()
+{
+
+       //Constructor
+
+       for(Int_t i=0;i<16;i++)
+       {
+               fADCellID[i] = MADBitCell[i];
+       }
+}
+
+AliESDAD& AliESDAD::operator=(const AliESDAD& o)
+{
+// Copy Constructor
+       if(this==&o)return *this;
+       TObject::operator=(o);
+
+       // Assignment operator
+       for(Int_t i=0; i<16; i++)
+       {
+               fADCellID[i] = o.fADCellID[i];
+       }
+       
+       return *this;
+}
+
+
+Bool_t AliESDAD::GetADCell(Int_t i) const
+{
+       return fADCellID[i];
+}
+
+void AliESDAD::Copy(TObject &obj) const {
+  
+  // this overwrites the virtual TOBject::Copy()
+  // to allow run time copying without casting
+  // in AliESDEvent
+
+  if(this==&obj)return;
+  AliESDAD *robj = dynamic_cast<AliESDAD*>(&obj);
+  if(!robj)return; // not an AliESDAD
+  *robj = *this;
+
+}
+
+
diff --git a/STEER/ESD/AliESDAD.h b/STEER/ESD/AliESDAD.h
new file mode 100644 (file)
index 0000000..a3303e1
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef AliESDAD_H
+#define AliESDAD_H
+
+#include <TObject.h>
+// Send comments to:
+// Mario Rodriguez <mrodriguez@fis.cinvestav.mx>
+
+class AliESDAD : public TObject
+{
+
+ public:
+  AliESDAD();
+  AliESDAD(const AliESDAD&);
+  AliESDAD(Bool_t *ADBitCell); 
+  virtual ~AliESDAD() {};
+  virtual void Copy(TObject &) const;
+
+ // We define the "setters" for AD
+       // fake bit pattern, but enought to MC studies
+  void SetADBitCell(Bool_t ADBitCell[16]){for (Int_t i=0;i<16;i++){fADCellID[i]=ADBitCell[i];}}
+
+ // Getters    
+  Bool_t GetADCell(Int_t i) const;
+  AliESDAD &operator=(const AliESDAD& source);
+  
+ protected:
+
+  Bool_t       fADCellID[16];  // Array with the AD's bitpattern
+
+  ClassDef(AliESDAD, 1)
+
+};
+
+#endif
index f28aae0..7a36370 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+/* $Id: AliESDEvent.cxx 64008 2013-08-28 13:09:59Z hristov $ */
 
 //-----------------------------------------------------------------
 //           Implementation of the AliESDEvent class
@@ -69,6 +69,7 @@
 #include "AliRawDataErrorLog.h"
 #include "AliLog.h"
 #include "AliESDACORDE.h"
+#include "AliESDAD.h"
 #include "AliESDHLTDecision.h"
 #include "AliCentrality.h"
 #include "AliESDCosmicTrack.h"
@@ -117,6 +118,7 @@ ClassImp(AliESDEvent)
                                                        "PHOSCells",
                                                        "AliRawDataErrorLogs",
                                                        "AliESDACORDE",
+                                                       "AliESDAD",
                                                        "AliTOFHeader",
                                                         "CosmicTracks"
                               #ifdef MFT_UPGRADE
@@ -141,6 +143,7 @@ AliESDEvent::AliESDEvent():
   fPHOSTrigger(0),
   fEMCALTrigger(0),
   fESDACORDE(0),
+  fESDAD(0),
   fTrdTrigger(0),
   fSPDPileupVertices(0),
   fTrkPileupVertices(0),
@@ -191,6 +194,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
   fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
   fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
+  fESDAD(new AliESDAD(*esd.fESDAD)),
   fTrdTrigger(new AliESDTrdTrigger(*esd.fTrdTrigger)),
   fSPDPileupVertices(new TClonesArray(*esd.fSPDPileupVertices)),
   fTrkPileupVertices(new TClonesArray(*esd.fTrkPileupVertices)),
@@ -257,6 +261,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   AddObject(fCosmicTracks);
   AddObject(fErrorLogs);
   AddObject(fESDACORDE);
+  AddObject(fESDAD);
   AddObject(fTOFHeader);
   AddObject(fMuonClusters);
   AddObject(fMuonPads);
@@ -487,6 +492,13 @@ void AliESDEvent::ResetStdContent()
     fESDACORDE->~AliESDACORDE();
     new (fESDACORDE) AliESDACORDE();   
   } 
+
+  if(fESDAD){
+    fESDAD->~AliESDAD();
+    new (fESDAD) AliESDAD();   
+  } 
+
+
   if(fESDTZERO) fESDTZERO->Reset(); 
   // CKB no clear/reset implemented
   if(fTPCVertex){
@@ -1370,6 +1382,13 @@ void AliESDEvent::SetACORDEData(AliESDACORDE * obj)
     *fESDACORDE = *obj;
 }
 
+void AliESDEvent::SetADData(AliESDAD * obj)
+{
+  if(fESDAD)
+    *fESDAD = *obj;
+}
+
+
 
 void AliESDEvent::GetESDfriend(AliESDfriend *ev) const 
 {
@@ -1439,6 +1458,7 @@ void AliESDEvent::GetStdContent()
   fPHOSCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kPHOSCells]);
   fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]);
   fESDACORDE = (AliESDACORDE*)fESDObjects->FindObject(fgkESDListName[kESDACORDE]);
+  fESDAD = (AliESDAD*)fESDObjects->FindObject(fgkESDListName[kESDAD]);
   fTOFHeader = (AliTOFHeader*)fESDObjects->FindObject(fgkESDListName[kTOFHeader]);
   fCosmicTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCosmicTracks]);
   #ifdef MFT_UPGRADE
@@ -1506,6 +1526,7 @@ void AliESDEvent::CreateStdContent()
   AddObject(new AliESDCaloCells());
   AddObject(new TClonesArray("AliRawDataErrorLog",0));
   AddObject(new AliESDACORDE()); 
+  AddObject(new AliESDAD()); 
   AddObject(new AliTOFHeader());
   AddObject(new TClonesArray("AliESDCosmicTrack",0));
   #ifdef MFT_UPGRADE
index d17c8b4..e74bacb 100644 (file)
@@ -5,7 +5,7 @@
  * See cxx source for full Copyright notice                               */
 
 
-/* $Id$ */
+/* $Id: AliESDEvent.h 64008 2013-08-28 13:09:59Z hristov $ */
 
 //-------------------------------------------------------------------------
 //                          Class AliESDEvent
@@ -29,6 +29,7 @@
 #include "AliESDTZERO.h"
 #include "AliESDZDC.h"
 #include "AliESDACORDE.h"
+#include "AliESDAD.h"
 
 // AliESDtrack has to be included so that the compiler 
 // knows its inheritance tree (= that it is a AliVParticle).
@@ -66,6 +67,7 @@ class AliCentrality;
 class AliEventplane;
 class TRefArray;
 class AliESDACORDE;
+class AliESDAD;
 class AliESDHLTDecision;
 class AliESDCosmicTrack;
 
@@ -107,6 +109,7 @@ public:
                       kPHOSCells,
                       kErrorLogs,
                        kESDACORDE,
+                       kESDAD,
                       kTOFHeader,
                        kCosmicTracks,
                       kESDListN
@@ -265,6 +268,13 @@ public:
   AliESDACORDE *GetACORDEData() const { return fESDACORDE;}
   void SetACORDEData(AliESDACORDE * obj);
 
+ // AD
+  AliESDAD *GetADData() const { return fESDAD;}
+  void SetADData(AliESDAD * obj);
+
+
+
+
   void SetESDfriend(const AliESDfriend *f) const;
   void GetESDfriend(AliESDfriend *f) const;
 
@@ -530,6 +540,7 @@ protected:
   AliESDCaloTrigger* fPHOSTrigger;     //! PHOS Trigger information
   AliESDCaloTrigger* fEMCALTrigger;    //! PHOS Trigger information
   AliESDACORDE    *fESDACORDE;        //! ACORDE ESD object caontaining bit pattern
+  AliESDAD    *fESDAD;        //! AD ESD object caontaining bit pattern
   AliESDTrdTrigger *fTrdTrigger;      //! TRD trigger information
 
   TClonesArray *fSPDPileupVertices;//! Pileup primary vertices reconstructed by SPD 
index 0808b4a..2225be3 100644 (file)
@@ -2,7 +2,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
+/* $Id: ESDLinkDef.h 54829 2012-02-25 20:47:28Z morsch $ */
 
 #pragma link off all globals;
 #pragma link off all classes;
@@ -73,6 +73,7 @@
 #pragma link C++ class  AliESDVZERO+;
 #pragma link C++ class  AliESDTZERO+;
 #pragma link C++ class  AliESDACORDE+;
+#pragma link C++ class  AliESDAD+;
 #ifdef MFT_UPGRADE
 //#pragma link C++ class  AliESDMFT+;
 #endif
index cd38af6..9649297 100644 (file)
@@ -98,13 +98,13 @@ AliAlignObj** AliGeomManager::fgAlignObjs[kLastLayer - kFirstLayer] = {
   0x0
 };
 
-const char* AliGeomManager::fgkDetectorName[AliGeomManager::fgkNDetectors] = {"GRP","ITS","TPC","TRD","TOF","PHOS","HMPID","EMCAL","MUON","FMD","ZDC","PMD","T0","VZERO","ACORDE"
+const char* AliGeomManager::fgkDetectorName[AliGeomManager::fgkNDetectors] = {"GRP","ITS","TPC","TRD","TOF","PHOS","HMPID","EMCAL","MUON","FMD","ZDC","PMD","T0","VZERO","ACORDE","AD"
                                                                              // #ifdef MFT_UPGRADE     
                                                                              //  ,"MFT"
                                                                              // #endif 
                                                                              ,"MFT"   // AU
 };
-Int_t AliGeomManager::fgNalignable[fgkNDetectors] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+Int_t AliGeomManager::fgNalignable[fgkNDetectors] = {0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 // #ifdef MFT_UPGRADE
 //                                                  , 0
 // #endif 
index ffe5242..cd0f05f 100644 (file)
@@ -128,7 +128,8 @@ public:
 //   #else
 //   static const Int_t   fgkNDetectors = 15;              // number of detectors
 //   #endif
-  static const Int_t   fgkNDetectors = 16;              // number of detectors    // AU
+  //static const Int_t   fgkNDetectors = 16;              // number of detectors    // AU
+  static const Int_t   fgkNDetectors = 17;              // number of detectors    + AD
   static const char *  fgkDetectorName[fgkNDetectors] ; // name of detectors
   static Int_t       fgNalignable[fgkNDetectors];
 
index 477cab6..b920e1b 100644 (file)
@@ -34,7 +34,7 @@ class AliRecoParam : public TObject
 // #else
 //     kNDetectors = 16 // number of detectors (last one is GRP!)
 // #endif
-    kNDetectors = 17 // number of detectors (last one is MFT!)   // AU
+    kNDetectors = 18 // number of detectors (last one is AD)   // AU
   };
   enum EventSpecie_t {kDefault = 1,
                      kLowMult = 2,
index c126ad6..d1913e1 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+/* $Id: AliReconstruction.cxx 63911 2013-08-19 16:46:41Z hristov $ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -211,7 +211,7 @@ using std::endl;
 
 //_____________________________________________________________________________
 const char* AliReconstruction::fgkStopEvFName = "_stopEvent_";
-const char* AliReconstruction::fgkDetectorName[AliReconstruction::kNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE"
+const char* AliReconstruction::fgkDetectorName[AliReconstruction::kNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE","AD"
 // #ifdef MFT_UPGRADE
 //                                                                                   , "MFT"
 // #endif 
index cbee86a..6946a67 100644 (file)
@@ -3,7 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
+/* $Id: AliReconstruction.h 63911 2013-08-19 16:46:41Z hristov $ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -175,7 +175,8 @@ public:
 // #else
 //     kNDetectors = 15   // number of detectors
 // #endif 
-    kNDetectors = 16   // number of detectors    // AU
+    //kNDetectors = 16   // number of detectors    // AU
+    kNDetectors = 17   // number of detectors    + AD
   };
   static Int_t   GetDetIndex(const char * detector);
   static const char** GetDetectorNames() { return fgkDetectorName; }
index 14c64ba..f14ce9d 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+/* $Id: AliSimulation.cxx 63204 2013-06-26 13:33:28Z rgrosso $ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -156,11 +156,11 @@ using std::ofstream;
 ClassImp(AliSimulation)
 
 AliSimulation *AliSimulation::fgInstance = 0;
-const char* AliSimulation::fgkDetectorName[AliSimulation::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE"
+const char* AliSimulation::fgkDetectorName[AliSimulation::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE","AD",
 // #ifdef MFT_UPGRADE
 //                                                                             ,"MFT"
 // #endif 
-                                                                            ,"MFT"    // AU
+                                                                            "MFT"    // AU
                                                                            ,"HLT"
 };
 
index df050ab..3f88f9d 100644 (file)
@@ -3,7 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
+/* $Id: AliSimulation.h 63170 2013-06-24 14:20:10Z morsch $ */
 
 //
 // class for running generation, simulation and digitization
@@ -211,7 +211,8 @@ private:
 //   #else
 //   static const Int_t   fgkNDetectors = 15 ;             // number of detectors
 //   #endif
-  static const Int_t   fgkNDetectors = 16 ;             // number of detectors    // AU
+  //static const Int_t   fgkNDetectors = 16 ;             // number of detectors    // AU
+  static const Int_t   fgkNDetectors = 17 ;             // number of detectors    + AD
   static const char *  fgkDetectorName[fgkNDetectors] ; // names of detectors
   TString              fQADetectors ;                   // list of detectors to be QA'ed       
   TString              fQATasks ;                       // list of QA tasks to be performed    
index 7888cd6..155ee04 100644 (file)
@@ -232,6 +232,7 @@ void Config()
     Int_t   iEMCAL  = 1;
     Int_t   iVZERO  = 1;
     Int_t   iACORDE = 1;
+    Int_t   iAD = 0;
 
     //=================== Alice BODY parameters =============================
     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
@@ -382,7 +383,15 @@ void Config()
         AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
     }
  
-             
+      if (iAD)
+    {
+        //=================== AD parameters ============================
+        AliAD *AD = new AliADv1("AD", "normal AD test");
+       AD->SetADAToInstalled(kTRUE);
+       AD->SetADCToInstalled(kTRUE);
+    }
+        
 }
 
 Float_t EtaToTheta(Float_t arg){