]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/MakeEMCALZeroMisAlignment.C
Add Config/HighVoltage directory and entry
[u/mrichter/AliRoot.git] / EMCAL / MakeEMCALZeroMisAlignment.C
CommitLineData
d3a9c52a 1void MakeEMCALZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for EMCAL
3 //
90dbf5fb 4 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
d3a9c52a 5 TClonesArray &alobj = *array;
6fce62af 6 const char* macroname = "MakeEMCALZeroMisAlignment.C";
d3a9c52a 7
8 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
9
10 const TString fbasepath = "EMCAL/FullSupermodule";
11 const TString hbasepath = "EMCAL/HalfSupermodule";
12 TString pathstr;
13
14 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
ae079791 15 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
16 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
d3a9c52a 17
18 Int_t i;
19 Int_t j=0;
20
21 for(i=0; i<10; i++){
22 pathstr=fbasepath;
23 pathstr+=(i+1);
90dbf5fb 24 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
d3a9c52a 25 }
26
27 for(i=0; i<2; i++){
28 pathstr=hbasepath;
29 pathstr+=(i+1);
90dbf5fb 30 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
d3a9c52a 31 }
32
a24be56b 33 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
d3a9c52a 34 // save on file
dfe9c69d 35 const char* filename = "EMCALzeroMisalignment.root";
36 TFile f(filename,"RECREATE");
37 if(!f){
38 Error(macroname,"cannot open file for output\n");
39 return;
40 }
41 Info(macroname,"Saving alignment objects to the file %s", filename);
d3a9c52a 42 f.cd();
43 f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
44 f.Close();
45 }else{
46 // save in CDB storage
dfe9c69d 47 TString Storage = gSystem->Getenv("STORAGE");
48 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
49 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
50 return;
51 }
52 Info(macroname,"Saving alignment objects in CDB storage %s",
53 Storage.Data());
d3a9c52a 54 AliCDBManager* cdb = AliCDBManager::Instance();
dfe9c69d 55 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
56 if(!storage){
57 Error(macroname,"Unable to open storage %s\n",Storage.Data());
58 return;
59 }
d3a9c52a 60 AliCDBMetaData* md = new AliCDBMetaData();
61 md->SetResponsible("Jennifer Clay");
62 md->SetComment("Zero misalignment for EMCAL");
5bd470e1 63 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
dfe9c69d 64 AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
d3a9c52a 65 storage->Put(array,id,md);
66 }
67
68 array->Delete();
69
70}
71