]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/RichAlign.C
Updating MUON code with the new class AliMUONTrackExtrap (Philippe Pillot)
[u/mrichter/AliRoot.git] / RICH / RichAlign.C
1 void RichAlign(Float_t sigmaTrans=0.1, Float_t sigmaRot=0.001)
2 {
3   Float_t dX, dY, dZ;          Float_t dPsi, dTheta, dPhi;   //displacements
4
5   TClonesArray *pCA = new TClonesArray("AliAlignObjMatrix",10000);
6   
7   TRandom *pRnd   = new TRandom(4357);
8
9   AliAlignObjMatrix o;
10  
11   Int_t idRICH =  AliAlignObj::kRICH;
12   for (Int_t iCh = 0; iCh < 7; iCh++) {
13     dX     = pRnd->Gaus(0,sigmaTrans);    dY     = pRnd->Gaus(0,sigmaTrans);    dZ     = pRnd->Gaus(0,sigmaTrans);
14     dPsi   = pRnd->Gaus(0,sigmaRot);      dTheta = pRnd->Gaus(0,sigmaRot);      dPhi   = pRnd->Gaus(0,sigmaRot);
15     new((*pCA)[iCh]) AliAlignObjMatrix(AliAlignObj::GetVolPath(idRICH,iCh), AliAlignObj::LayerToVolUID(idRICH,iCh),dX,dY,dZ,dPsi,dTheta,dPhi);
16   }
17
18   pCA->Print();
19   
20   AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
21   
22   AliCDBMetaData *pMeta= new AliCDBMetaData();  
23   pMeta->SetResponsible("RICH Expert");
24   pMeta->SetComment("Alignment objects for ideal geometry, i.e. applying them to TGeo has to leave geometry unchanged");
25   AliCDBId id("RICH/Align/Data",0,0); //you have to specify the run validity, although in the case of saving ideal objects makes not much sense
26   AliCDBManager::Instance()->Put(pCA,id,pMeta);
27   pCA->Delete();
28 }