]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New Alignment class and methods to Loader
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Feb 2006 10:11:01 +0000 (10:11 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Feb 2006 10:11:01 +0000 (10:11 +0000)
EMCAL/AliEMCALAlignData.cxx [new file with mode: 0644]
EMCAL/AliEMCALAlignData.h [new file with mode: 0644]
EMCAL/AliEMCALLoader.cxx
EMCAL/AliEMCALLoader.h

diff --git a/EMCAL/AliEMCALAlignData.cxx b/EMCAL/AliEMCALAlignData.cxx
new file mode 100644 (file)
index 0000000..e5d0cab
--- /dev/null
@@ -0,0 +1,110 @@
+/**************************************************************************
+ * 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$ */
+
+////////////////////////////////////////////////
+//  class for EMCAL alignment parameters       //
+////////////////////////////////////////////////
+
+#include "AliEMCALAlignData.h"
+
+ClassImp(AliEMCALAlignData)
+
+//________________________________________________________________
+AliEMCALAlignData::AliEMCALAlignData()
+{
+  // Default constructor
+  Reset();
+}
+
+//________________________________________________________________
+AliEMCALAlignData::AliEMCALAlignData(const char* name)
+{
+  // Constructor
+  TString namst = "Align_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+  Reset();
+}
+
+//________________________________________________________________
+AliEMCALAlignData::AliEMCALAlignData(const AliEMCALAlignData& alignda) :
+  TNamed(alignda)
+{
+  // copy constructor
+  SetName(alignda.GetName());
+  SetTitle(alignda.GetName());
+  Reset();
+  fNSuperModules = alignda.GetNSuperModules();
+  for(Int_t module=0; module<fNSuperModules; module++) {
+    for (Int_t axis=0; axis<3; axis++) {
+      fSuperModuleCenter[module][axis] = 
+       alignda.GetSuperModuleCenter(module,axis);
+      for (Int_t angle=0; angle<2; angle++) {
+       fSuperModuleAngle[module][axis][angle] = 
+         alignda.GetSuperModuleAngle(module,axis,angle);
+      }
+    }
+  }
+}
+
+//________________________________________________________________
+AliEMCALAlignData &AliEMCALAlignData::operator =(const AliEMCALAlignData& alignda)
+{
+  // assignment operator
+  SetName(alignda.GetName());
+  SetTitle(alignda.GetName());
+  Reset();
+  fNSuperModules = alignda.GetNSuperModules();
+  for(Int_t module=0; module<fNSuperModules; module++) {
+    for (Int_t axis=0; axis<3; axis++) {
+      fSuperModuleCenter[module][axis] = 
+       alignda.GetSuperModuleCenter(module,axis);
+      for (Int_t angle=0; angle<2; angle++) {
+       fSuperModuleAngle[module][axis][angle] = 
+         alignda.GetSuperModuleAngle(module,axis,angle);
+      }
+    }
+  }
+  return *this;
+}
+
+//________________________________________________________________
+AliEMCALAlignData::~AliEMCALAlignData()
+{
+  // Destructor
+}
+
+//________________________________________________________________
+void AliEMCALAlignData::Reset()
+{
+  // Set all to default values
+  fNSuperModules = 12;
+  memset(fSuperModuleCenter,0,12*3*sizeof(Float_t));
+  memset(fSuperModuleAngle ,0,12*3*2*sizeof(Float_t));
+}
+
+//________________________________________________________________
+void  AliEMCALAlignData::Print(Option_t */*option =""*/) const
+{
+  // Print alignment data
+
+  printf("EMCAL alignment object\n");
+  printf("     Number of modules: %d\n",fNSuperModules);
+}
+
+//________________________________________________________________
diff --git a/EMCAL/AliEMCALAlignData.h b/EMCAL/AliEMCALAlignData.h
new file mode 100644 (file)
index 0000000..d5624cb
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef ALIEMCALALIGNDATA_H
+#define ALIEMCALALIGNDATA_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+////////////////////////////////////////////////
+//  class for EMCAL alignment parameters       //
+////////////////////////////////////////////////
+
+#include "TNamed.h"
+#include "AliEMCAL.h"
+
+class AliEMCALAlignData: public TNamed {
+
+ public:
+  AliEMCALAlignData();
+  AliEMCALAlignData(const char* name);
+  AliEMCALAlignData(const AliEMCALAlignData &alignda);
+  AliEMCALAlignData& operator= (const AliEMCALAlignData &alignda);
+  virtual ~AliEMCALAlignData();
+  void Reset();
+  virtual void Print(Option_t *option = "") const; 
+
+  // Getters
+  Int_t   GetNSuperModules() const {return fNSuperModules;}
+  Float_t GetSuperModuleCenter(Int_t module, Int_t axis) const {
+    return fSuperModuleCenter[module][axis];}
+  Float_t GetSuperModuleAngle(Int_t module, Int_t axis, Int_t angle) const {
+    return fSuperModuleAngle[module][axis][angle];}
+
+  // Setters
+  void SetNSuperModules(Int_t nSuperModules) {fNSuperModules = nSuperModules;}
+  void SetSuperModuleCenter(Int_t module, Int_t axis, Float_t coord) {
+    fSuperModuleCenter[module][axis] = coord;}
+  void SetSuperModuleAngle(Int_t module, Int_t axis, Int_t angle, Float_t value) {
+    fSuperModuleAngle[module][axis][angle] = value;}
+
+ protected:
+  Int_t   fNSuperModules;             // number of EMCAL supermodules (max=12)
+  Float_t fSuperModuleCenter[12][3];  // xyz-position of the supermodule center
+  Float_t fSuperModuleAngle[12][3][2];// polar and azymuth angles for 3 axes 
+                                      // of supermodules
+
+  ClassDef(AliEMCALAlignData,1)    // EMCAL Alignment data
+};
+
+#endif
index 3d4320bed1be8c5a7fd6b34f831987561fdca2e5..2e448a158ed317a92ba0190c01e810bbd3293c61 100644 (file)
@@ -57,6 +57,7 @@ ClassImp(AliEMCALLoader)
   
 const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
 AliEMCALCalibData* AliEMCALLoader::fCalibData = 0; //calibation data
+AliEMCALAlignData* AliEMCALLoader::fAlignData = 0; //alignment data
 
 //____________________________________________________________________________ 
 AliEMCALLoader::AliEMCALLoader()
@@ -97,14 +98,23 @@ AliEMCALLoader::~AliEMCALLoader()
   delete fRecPoints;
 }
 
+//____________________________________________________________________________
+AliEMCALAlignData* AliEMCALLoader::AlignData()
+{
+  // Check if the instance of AliEMCALAlignData exists, and return it
+  
+  if( !(AliCDBManager::Instance()->IsDefaultStorageSet()) )
+    fAlignData=0x0;
+  return fAlignData;
+}
+
 //____________________________________________________________________________ 
 AliEMCALCalibData* AliEMCALLoader::CalibData()
 { 
-  //Get the Calibration data list
+  // Check if the instance of AliEMCALCalibData exists, and return it
 
   if( !(AliCDBManager::Instance()->IsDefaultStorageSet()) ) {
     fCalibData=0x0;
-    Warning("CalibData","Calibration DB is not initiated!");
     return fCalibData;
   }
 
index 79b43822211d2f1d223cb8998c8ed2dedc6b5ef8..9bfe567a69f110f9751a3efb0b795f36e06168d4 100644 (file)
@@ -27,6 +27,7 @@ class TTask ;
 // --- AliRoot header files ---
 #include "AliLoader.h"
 #include "AliEMCALCalibData.h"
+#include "AliEMCALAlignData.h"
 
 class AliLoader ;
 class AliEMCAL ; 
@@ -103,10 +104,11 @@ class AliEMCALLoader : public AliLoader {
   //Calibration
 
   Int_t CalibrateRaw (Double_t energy, Int_t module, Int_t column, Int_t row);//take real calibration coefficients
-  void  SetCalibData(AliEMCALCalibData* calibda) { fCalibData = calibda; }
-  AliEMCALCalibData * CalibData(); // to get the CDB object
+  
+  void  SetAlignData(AliEMCALAlignData* alignda)  { fAlignData = alignda; } 
+  void  SetCalibData(AliEMCALCalibData* calibda)  { fCalibData = calibda; }
+  AliEMCALAlignData * AlignData(); // to get the alignment CDB object
+  AliEMCALCalibData * CalibData(); // to get the calibration CDB object
 
 private:
  
@@ -120,7 +122,9 @@ private:
   TClonesArray     *fHits;         //! TClonesArray of hits (for tree reading)
   TClonesArray     *fDigits;       //! TClonesArray of digits (for tree reading)
   TClonesArray     *fSDigits;      //! TClonesArray of sdigits (for tree reading)
-  TObjArray        *fRecPoints;    //! TClonesArray of recpoints (for tree reading)
+  TObjArray        *fRecPoints;    //! TClonesArray of recpoints (for tree reading)   
+  
+  static AliEMCALAlignData * fAlignData;
   static AliEMCALCalibData * fCalibData;  //  calibration data 
 
   ClassDef(AliEMCALLoader,0)  // Algorithm class that provides methods to retrieve objects from a list knowing the index