]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HMPID/MakeHMPIDZeroMisAlignment.C
Number of DDLs are 2 (previously were forseen 4 DDLs)
[u/mrichter/AliRoot.git] / HMPID / MakeHMPIDZeroMisAlignment.C
1 void MakeHMPIDZeroMisAlignment(){
2   // Create TClonesArray of zero misalignment objects for HMPID
3   //
4   TClonesArray *pCA = new TClonesArray("AliAlignObjMatrix",10);
5   
6   AliAlignObjMatrix o;
7
8   Double_t dX=0.,dY=0.,dZ=0.,dPsi=0.,dTheta=0.,dPhi=0.;
9  
10   Int_t idHMPID =  AliGeomManager::kHMPID;
11   for (Int_t iCh = 0; iCh < 7; iCh++) {
12     new((*pCA)[iCh]) AliAlignObjMatrix(AliGeomManager::SymName(idHMPID,iCh),AliGeomManager::LayerToVolUID(idHMPID,iCh),dX,dY,dZ,dPsi,dTheta,dPhi,kTRUE);
13   }
14
15 //   pCA->Print();
16   
17   if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
18     // save on file
19     TFile f("HMPIDzeroMisalignment.root","RECREATE");
20     if(!f) cerr<<"cannot open file for output\n";
21     f.cd();
22     f.WriteObject(pCA,"HMPIDAlignObjs","kSingleKey");
23     f.Close();
24   }else{
25     // save in CDB storage
26     const char* Storage = gSystem->Getenv("STORAGE");
27     AliCDBManager* cdb = AliCDBManager::Instance();
28     AliCDBStorage* storage = cdb->GetStorage(Storage);
29     AliCDBMetaData *pMeta= new AliCDBMetaData();  
30     pMeta->SetResponsible("HMPID Expert");
31     pMeta->SetComment("Zero alignment objects for HMPID");
32     pMeta->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
33     AliCDBId id("HMPID/Align/Data",0,9999999);
34     storage->Put(pCA,id,pMeta);
35   }
36   
37   pCA->Delete();
38 }