Macro to generate zero Misalignment objects with symnames (thanks to Raffaele G.)
[u/mrichter/AliRoot.git] / TOF / MakeTOFZeroMisAlignment.C
CommitLineData
b355f61e 1void MakeTOFZeroMisAlignment(){
2
3 // Create TClonesArray of zero misalignment objects for TOF
4
5 TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
6 TClonesArray &alobj = *array;
7
8 if(!gGeoManager) TGeoManager::Import("geometry.root");
9 // needed for the constructors with local coordinates not to fail
10
11 AliAlignObjAngles a;
12
13 AliAlignObj::ELayerID idTOF = AliAlignObj::kTOF;
14 Int_t i;
15 Int_t j=0;
16 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
17
18 for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
19 // cout << " TOF symname : " << AliAlignObj::SymName(idTOF,i) << endl;
20 new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i),
21 AliAlignObj::LayerToVolUID(idTOF,i),
22 dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
23 }
24
25 // save in CDB storage
26 const char* Storage = "local://$ALICE_ROOT";
27 AliCDBManager* cdb = AliCDBManager::Instance();
28 AliCDBStorage* storage = cdb->GetStorage(Storage);
29 AliCDBMetaData* md = new AliCDBMetaData();
30 md->SetResponsible("Silvia Arcelli");
31 md->SetComment("Zero misalignment for TOF");
32 md->SetAliRootVersion("HEAD");
33 AliCDBId id("TOF/Align/Data",0,9999999);
34 storage->Put(array,id,md);
35
36 array->Delete();
37
38}
39
40