12 #if !defined(__CINT__) 15 #include <TClonesArray.h> 35 const char* macroname =
"MakeEMCALResMisAlignment.C";
42 Error(
"MakeEMCALResMisAlignment",
"Cannot obtain AliEMCALGeometry singleton\n");
46 TClonesArray *
array =
new TClonesArray
48 TClonesArray &alobj = *
array;
57 if( TString(gSystem->Getenv(
"TOCDB")) == TString(
"kTRUE") )
59 TString storageName = gSystem->Getenv(
"STORAGE");
60 if(!storageName.BeginsWith(
"local://") && !storageName.BeginsWith(
"alien://"))
62 Error(macroname,
"STORAGE variable set to %s is not valid. Exiting\n",storageName.Data());
69 Error(macroname,
"Unable to open storage %s\n",storageName.Data());
75 if(!entry) Fatal(macroname,
"Could not get the specified CDB entry!");
85 Double_t dx, dy, dz, dpsi, dtheta, dphi;
87 const TString fbasepath =
"EMCAL/FullSupermodule";
88 const TString hbasepath =
"EMCAL/HalfSupermodule";
89 const TString tbasepath =
"EMCAL/OneThrdSupermodule";
90 const TString dbasepath =
"EMCAL/DCALSupermodule";
91 const TString debasepath=
"EMCAL/DCALExtensionSM";
103 TRandom *rnd =
new TRandom(4321);
104 Double_t sigmatr = 0.05;
105 Double_t sigmarot = 0.1;
110 dx = rnd->Gaus(0.,sigmatr);
111 dy = rnd->Gaus(0.,sigmatr);
112 dz = rnd->Gaus(0.,sigmatr);
113 dpsi = rnd->Gaus(0.,sigmarot);
114 dtheta = rnd->Gaus(0.,sigmarot);
115 dphi = rnd->Gaus(0.,sigmarot);
124 new(alobj[i])
AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
127 if( TString(gSystem->Getenv(
"TOCDB")) != TString(
"kTRUE") )
130 const char* filename =
"EMCALresidualMisalignment.root";
131 TFile
f(filename,
"RECREATE");
138 Info(macroname,
"Saving alignment objects to the file %s", filename);
140 f.WriteObject(array,
"EMCALAlignObjs",
"kSingleKey");
148 md->
SetComment(
"Residual misalignment for EMCAL, produced with sigmatr=0.05 and sigmarot=0.1 in the local RS");
151 storage->
Put(array,
id,md);
AliCDBEntry * Get(const AliCDBId &query)
void MakeEMCALResMisAlignment(TString geoname="EMCAL_COMPLETE12SMV1_DCAL_8SM")
const TString & GetPath() const
Bool_t Put(TObject *object, AliCDBId &id, AliCDBMetaData *metaData, const char *mirrors="", AliCDBManager::DataType type=AliCDBManager::kPrivate)
static const Char_t * GetDefaultGeometryName()
Int_t GetNumberOfSuperModules(void) const
Int_t GetNumberOfSuperModules() const
AliCDBStorage * GetStorage(const char *dbString)
static void SetGeometry(TGeoManager *const geom)
Int_t GetSMType(Int_t nSupMod) const
void SetDefaultStorage(const char *dbString)
AliEMCALEMCGeometry * GetEMCGeometry() const
static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId)
void SetOwner(Bool_t owner)
static AliEMCALGeometry * GetInstance()
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
Bool_t IsDefaultStorageSet() const
static void LoadGeometry(const char *geomFileName=NULL)
EMCal geometry, singleton.