1 void MakeTOFFullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for TOF
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
5 TClonesArray &alobj = *array;
7 if(!gGeoManager) TGeoManager::Import("geometry.root"); //needed for
8 // the constructors with local coordinates not to fail
13 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
14 AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
15 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
19 Double_t dx, dy, dz, dpsi, dtheta, dphi;
20 TRandom *rnd = new TRandom(2345);
21 Double_t sigmatr = 0.4; // max shift in cm w.r.t. local ideal RS
22 Double_t sigmarot = 0.06; // max rot in deg w.r.t. local ideal RS (~ 1 mrad)
26 sprintf(path,"TOF/sm%02d",i);
27 dx = rnd->Gaus(0.,sigmatr);
29 dz = rnd->Gaus(0.,sigmatr);
31 dtheta = rnd->Gaus(0.,sigmarot);
33 new(alobj[j]) AliAlignObjAngles(path, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
38 if(!gSystem->Getenv("$TOCDB")){
40 TFile f("TOFfullMisalignment.root","RECREATE");
41 if(!f) cerr<<"cannot open file for output\n";
43 f.WriteObject(array,"TOFAlignObjs","kSingleKey");
46 // save in CDB storage
47 const char* Storage = gSystem->Getenv("$STORAGE");
48 AliCDBManager* cdb = AliCDBManager::Instance();
49 AliCDBStorage* storage = cdb->GetStorage(Storage);
50 AliCDBMetaData* md = new AliCDBMetaData();
51 md->SetResponsible("Silvia Arcelli");
52 md->SetComment("Full misalignment for TOF");
53 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
54 AliCDBId id("TOF/Align/Data",0,9999999);
55 storage->Put(array,id,md);