correct Hash in TMap, reading channel names
[u/mrichter/AliRoot.git] / T0 / MakeT0ZeroMisAlignment.C
CommitLineData
d3a9c52a 1void MakeT0ZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for T0
3 //
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
5 TClonesArray &alobj = *array;
6
7 AliAlignObjAngles a;
8
9 Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
10
11 TString symName, sn;
12
13 Int_t iIndex=0;
ae079791 14 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
15 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
d3a9c52a 16
17 Int_t j=0;
18 for (Int_t imod=0; imod<24; imod++)
19 {
20 if (imod < 12){
21 sn="T0/C/PMT";
22 }else{
23 sn="T0/A/PMT";
24 }
25 symName = sn;
26 symName += imod+1;
27
28 new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
29 }
30
8d0a15a4 31 if(!gSystem->Getenv("$TOCDB")){
d3a9c52a 32 // save on file
33 TFile f("T0zeroMisalignment.root","RECREATE");
34 if(!f) cerr<<"cannot open file for output\n";
35 f.cd();
36 f.WriteObject(array,"T0ZeroObjs","kSingleKey");
37 f.Close();
38 }else{
39 // save in CDB storage
8d0a15a4 40 const char* Storage = gSystem->Getenv("$STORAGE");
d3a9c52a 41 AliCDBManager* cdb = AliCDBManager::Instance();
42 AliCDBStorage* storage = cdb->GetStorage(Storage);
43 AliCDBMetaData* md = new AliCDBMetaData();
44 md->SetResponsible("Tomasz Malkiewicz");
45 md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
8d0a15a4 46 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
d3a9c52a 47 AliCDBId id("T0/Align/Data",0,9999999);
48 storage->Put(array,id,md);
49 }
50
51 array->Delete();
52
53}
54