Disable retireval of DCS data points from AliShuttle for SDD
[u/mrichter/AliRoot.git] / GRP / MakeForwardMisAlignment.C
CommitLineData
5d959b2d 1void MakeForwardMisAlignment(Int_t inputRun){
2 // Creates misalignment of the beam pipe, frame and
3 // FMD2&3.
4 // The misalignment is based on the ITS global alignment
5 // object with the exception of the beam pipe where
6 // only the translations are used ignoring the rotation
7 // matrix.
8 const char* macroname = "MakeForwardMisAlignment.C";
9
10 AliCDBManager* cdb = AliCDBManager::Instance();
11 cdb->SetDefaultStorage("raw://");
12 cdb->SetRun(inputRun);
13 AliCDBEntry *inputEntry = cdb->Get("ITS/Align/Data");
14 TClonesArray *inputArray = (TClonesArray*)inputEntry->GetObject();
15 AliAlignObjParams *itsAlign = (AliAlignObjParams*)inputArray->At(0);
16 itsAlign->Print();
17 printf("\n\n\n");
18 Double_t inputTrans[3];
19 itsAlign->GetTranslation(inputTrans);
20 Double_t inputAngles[3];
21 itsAlign->GetAngles(inputAngles);
22
23 TClonesArray *array = new TClonesArray("AliAlignObjParams",20);
24
25 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
26 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
27 UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id
28
29 const char* baseSymName ="FRAME/Sector"; //base of symbolic name corresponding to base of path "ALIC_1/B077_1/BSEGMO";
30 TString symname;
31
32 for(Int_t sm=0; sm<18; sm++){
33 symname = baseSymName;
34 symname += sm;
35 cout<<symname.Data()<<endl;
36 new((*array)[sm]) AliAlignObjParams(symname.Data(),dvoluid,0.,0.,0.,0.,0.,0.,kTRUE);
37 }
38
39 new((*array)[18]) AliAlignObjParams("CP1",dvoluid,inputTrans[0],inputTrans[1],0.,0.,0.,0.,kTRUE);
40 array->At(18)->Print();
bd648008 41 new((*array)[19]) AliAlignObjParams("CP3",dvoluid,inputTrans[0],inputTrans[1],0.,0.,0.,0.,kTRUE);
42 array->At(19)->Print();
5d959b2d 43 printf("\n\n\n");
44
45 // FMD
46 TClonesArray *arrayFMD = new TClonesArray("AliAlignObjParams",4);
47 new((*arrayFMD)[0]) AliAlignObjParams("FMD/FMD2_T",0,inputTrans[0],inputTrans[1],inputTrans[2],inputAngles[0],inputAngles[1],inputAngles[2],kTRUE);
48 new((*arrayFMD)[1]) AliAlignObjParams("FMD/FMD2_B",0,inputTrans[0],inputTrans[1],inputTrans[2],inputAngles[0],inputAngles[1],inputAngles[2],kTRUE);
49 new((*arrayFMD)[2]) AliAlignObjParams("FMD/FMD3_T",0,inputTrans[0],inputTrans[1],inputTrans[2],inputAngles[0],inputAngles[1],inputAngles[2],kTRUE);
50 new((*arrayFMD)[3]) AliAlignObjParams("FMD/FMD3_B",0,inputTrans[0],inputTrans[1],inputTrans[2],inputAngles[0],inputAngles[1],inputAngles[2],kTRUE);
51 arrayFMD->Print();
52 printf("\n\n\n");
53
54 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
55 // save on file
56 const char* filename = "ForwardMisalignment.root";
57 TFile f(filename,"RECREATE");
58 if(!f){
59 Error(macroname,"cannot open file for output\n");
60 return;
61 }
62 Info(macroname,"Saving alignment objects in %s", filename);
63 f.cd();
64 f.WriteObject(array,"STRUCTAlignObjs","kSingleKey");
65 f.WriteObject(arrayFMD,"FMDAlignObjs","kSingleKey");
66 f.Close();
67 }else{
68 // save in CDB storage
69 TString Storage = gSystem->Getenv("STORAGE");
70 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
71 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
72 return;
73 }
74 Info(macroname,"Saving alignment objects in CDB storage %s",Storage.Data());
75 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
76 if(!storage){
77 Error(macroname,"Unable to open storage %s\n",Storage.Data());
78 return;
79 }
80 AliCDBMetaData* md = new AliCDBMetaData();
81 md->SetResponsible("Grosso Raffaele");
82 md->SetComment("Misalignment for FRAME and beam pipe");
83 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
84 AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
bd648008 85 storage->Put(array,id,md);
5d959b2d 86 AliCDBMetaData* mdFMD = new AliCDBMetaData();
87 mdFMD->SetResponsible("FMD Experts");
88 mdFMD->SetComment("Misalignment for FMD using ITS object");
89 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
90 AliCDBId idFMD("FMD/Align/Data",0,AliCDBRunRange::Infinity());
91 storage->Put(arrayFMD,idFMD,mdFMD);
92 }
93
94 array->Delete();
95
96}
97