--- /dev/null
+/**************************************************************************
+ * 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);
+}
+
+//________________________________________________________________
--- /dev/null
+#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
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()
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;
}
// --- AliRoot header files ---
#include "AliLoader.h"
#include "AliEMCALCalibData.h"
+#include "AliEMCALAlignData.h"
class AliLoader ;
class AliEMCAL ;
//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:
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