]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/CalibMacros/CPass1/ConfigCalibTrain.C
Setting storage to local:// in case there is the snapshot (which is now containing...
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass1 / ConfigCalibTrain.C
CommitLineData
a45764d9 1/*
2
3 Macro to initialize:
4 - the OCDB (run number required as input argument)
5 - the geometry (expected to be in the current directory)
6 to run the Calibration train.
7
8 Example:
9 .L $ALICE_ROOT/ANALYSIS/CalibMacros/MergeCalibration/ConfigCalibTrain.C
10 ConfigCalibTrain(129160,"raw://");
11
12*/
13
14void ConfigCalibTrain(Int_t run, const char *ocdb="raw://"){
15
16 // OCDB
17 printf("setting run to %d\n",run);
a45764d9 18 if (gSystem->AccessPathName("OCDB.root", kFileExists)==0) {
05f6824f 19 Printf("ConfigCalibTrain: using OCDB snapshot");
9d34e902 20 AliCDBManager::Instance()->SetSnapshotMode("OCDB.root");
26716387 21 ocdb = "local://";
a45764d9 22 }
05f6824f 23 else {
24 Printf("ConfigCalibTrain: NOT using OCDB snapshot");
25 }
26716387 26
27 Printf("Default storage is %s", ocdb);
28
29 AliCDBManager::Instance()->SetDefaultStorage(ocdb);
30 AliCDBManager::Instance()->SetRun(run);
31
a45764d9 32 // magnetic field
33 if ( !TGeoGlobalMagField::Instance()->GetField() ) {
34 printf("Loading field map...\n");
35 AliGRPManager grpMan;
36 if( !grpMan.ReadGRPEntry() ) {
37 printf("Cannot get GRP entry\n");
38 }
39 if( !grpMan.SetMagField() ) {
40 printf("Problem with magnetic field setup\n");
41 }
42 }
43
44 // geometry
45 printf("Loading geometry...\n");
46 AliGeomManager::LoadGeometry();
4dac1092 47 if( !AliGeomManager::ApplyAlignObjsFromCDB("GRP ITS TPC TRD TOF HMPID") ) {
a45764d9 48 printf("Problem with align objects\n");
49 }
9e160db9 50
51 if (gSystem->AccessPathName("localOCDBaccessConfig.C", kFileExists)==0) {
52 gROOT->LoadMacro("localOCDBaccessConfig.C");
53 localOCDBaccessConfig();
54 }
a45764d9 55
56}