AliRoot Core  edcc906 (edcc906)
ModifyRecoParamHLTUsage.C
Go to the documentation of this file.
1 
15 void ModifyRecoParamHLTUsage( const Char_t* lastOCDBEntry,
16  Int_t iHLTusage,
17  const Char_t* newStoragePath = "local:///tmp/ocdb",
18  const Char_t* author = "Jochen Thaeder",
19  const Char_t* alirootVersion = "05-01-Release" ) {
20 
21  // -- Get RecoParam
22  // -------------------------------------------------------------------
23  TFile inFile(lastOCDBEntry);
24  if (!inFile) {
25  printf("File %s could not be found!\n", lastOCDBEntry);
26  return -1;
27  }
28 
29  AliCDBEntry * entry = ( AliCDBEntry *) inFile.Get("AliCDBEntry");
30  if (!entry) {
31  printf("File %s does not contain AliCDBEntry object!\n", lastOCDBEntry);
32  return -2;
33  }
34 
35  TObjArray * arr = entry->GetObject();
36 
37  AliTPCRecoParam * parHighFlux = NULL;
38  AliTPCRecoParam * parLowFlux = NULL;
39  AliTPCRecoParam * parLaserFlux = NULL;
40  AliTPCRecoParam * parCosmicFlux = NULL;
41 
42  for (Int_t idx = 0 ; idx < arr->GetEntries() ; ++idx) {
43  AliTPCRecoParam *param = (AliTPCRecoParam*) arr->At(idx);
44 
45  TString name(param->GetName());
46 
47  if ( name.Contains("Low") )
48  parLowFlux = param;
49  else if ( name.Contains("High") )
50  parHighFlux = param;
51  else if ( name.Contains("Laser") )
52  parLaserFlux = param;
53  else if ( name.Contains("Cosmic") )
54  parCosmicFlux = param;
55  }
56 
57  // -- Set TPC RecoParam : UseHLTClusters
58  // -------------------------------------------------------------------
59  parLaserFlux->SetUseHLTClusters(1); // LASER use always raw data
60 
61  parHighFlux->SetUseHLTClusters(iHLTusage);
62  parLowFlux->SetUseHLTClusters(iHLTusage);
63  parCosmicFlux->SetUseHLTClusters(iHLTusage);
64 
65  // -- Write out
66  // -------------------------------------------------------------------
67  const Char_t *comment = "Modified RecoParam with HLT clusters usage";
68  // -------------------------------------------------------------------
69 
70  AliCDBMetaData *metaData= new AliCDBMetaData();
71  metaData->SetObjectClassName("TObjArray");
72  metaData->SetResponsible(author);
73  metaData->SetBeamPeriod(1);
74  metaData->SetAliRootVersion(alirootVersion);
75  metaData->SetComment(comment);
76 
77  AliCDBId id("TPC/Calib/RecoParam", 0, AliCDBRunRange::Infinity());
78 
79  AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(newStoragePath);
80  gStorage->Put(arr, id, metaData);
81 
82  return;
83 }
84 
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Bool_t Put(TObject *object, AliCDBId &id, AliCDBMetaData *metaData, const char *mirrors="", AliCDBManager::DataType type=AliCDBManager::kPrivate)
#define TObjArray
static TString comment
Definition: ConfigCosmic.C:131
void SetComment(const char *comment)
void SetResponsible(const char *yourName)
TObject * GetObject()
Definition: AliCDBEntry.h:56
AliCDBStorage * GetStorage(const char *dbString)
void SetBeamPeriod(UInt_t period)
void SetAliRootVersion(const char *version)
Definition: AliCDBEntry.h:18
void SetObjectClassName(const char *name)
void ModifyRecoParamHLTUsage(const Char_t *lastOCDBEntry, Int_t iHLTusage, const Char_t *newStoragePath="local:///tmp/ocdb", const Char_t *author="Jochen Thaeder", const Char_t *alirootVersion="05-01-Release")
Class with TPC reconstruction parameters.
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
void SetUseHLTClusters(Int_t useHLTClusters)
static Int_t Infinity()