1 #if !defined(__CINT__) || defined(__MAKECINT__)
4 #include "TGeoManager.h"
5 #include "TObjString.h"
6 #include "TClonesArray.h"
8 #include "AliGeomManager.h"
9 #include "AliCDBManager.h"
10 #include "AliCDBStorage.h"
11 #include "AliCDBPath.h"
12 #include "AliCDBEntry.h"
14 #include "AliCDBMetaData.h"
15 #include "AliMisAligner.h"
16 #include "AliHMPIDMisAligner.h"
20 void MakeHMPIDAlignmentObjs(Bool_t toOCDB = kFALSE, const char* misalType="residual")
22 // Make alignment objects for HMPID detector
23 // for the misalignment scenario passed as argument "misalType".
24 //Input Args: toOCDB = kFALSE -> the results are written in a local file called HMPIDMisalignObject.root
25 // kTRUE -> the results are written in local://$ALICE_ROOT/OCD
26 // misalType = ideal, residual, full (see class AliHMPIDMisAligner)
28 const char* macroname = "MakeHMPIDAlignmentObjs.C";
30 // Load geometry from OCDB; update geometry before loading it if we are going to load
31 // the alignment objects to the OCDB
32 AliCDBManager* cdb = AliCDBManager::Instance();
33 if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
35 // AliCDBStorage* storage = 0;
37 AliGeomManager::LoadGeometry(); //load geom from default OCDB storage
39 TClonesArray* objsArray = 0;
41 AliHMPIDMisAligner* misAlignerHMPID = new AliHMPIDMisAligner();
42 misAlignerHMPID->SetMisalType(misalType);
43 objsArray = misAlignerHMPID->MakeAlObjsArray();
47 AliCDBId id("HMPID/Align/Data",0,AliCDBRunRange::Infinity());
48 AliCDBMetaData *md = misAlignerHMPID->GetCDBMetaData();
49 md->SetResponsible("Domenico Di Bari");
50 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
51 cdb->Put(objsArray,id,md);
54 TFile file("HMPIDMisalignObject.root","RECREATE");
56 Error(macroName,"cannot open file for output\n");
60 file.WriteObject(objsArray,"HMPIDAlignObjs","kSingleKey");