]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/CalibMacros/CPass1/ConfigCalibTrain.C
Adding printout concerning usage of snapshot for CPass
[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);
18 AliCDBManager::Instance()->SetDefaultStorage(ocdb);
19 AliCDBManager::Instance()->SetRun(run);
20 if (gSystem->AccessPathName("OCDB.root", kFileExists)==0) {
05f6824f 21 Printf("ConfigCalibTrain: using OCDB snapshot");
9d34e902 22 AliCDBManager::Instance()->SetSnapshotMode("OCDB.root");
a45764d9 23 }
05f6824f 24 else {
25 Printf("ConfigCalibTrain: NOT using OCDB snapshot");
26 }
a45764d9 27 // magnetic field
28 if ( !TGeoGlobalMagField::Instance()->GetField() ) {
29 printf("Loading field map...\n");
30 AliGRPManager grpMan;
31 if( !grpMan.ReadGRPEntry() ) {
32 printf("Cannot get GRP entry\n");
33 }
34 if( !grpMan.SetMagField() ) {
35 printf("Problem with magnetic field setup\n");
36 }
37 }
38
39 // geometry
40 printf("Loading geometry...\n");
41 AliGeomManager::LoadGeometry();
4dac1092 42 if( !AliGeomManager::ApplyAlignObjsFromCDB("GRP ITS TPC TRD TOF HMPID") ) {
a45764d9 43 printf("Problem with align objects\n");
44 }
9e160db9 45
46 if (gSystem->AccessPathName("localOCDBaccessConfig.C", kFileExists)==0) {
47 gROOT->LoadMacro("localOCDBaccessConfig.C");
48 localOCDBaccessConfig();
49 }
a45764d9 50
51}