]>
Commit | Line | Data |
---|---|---|
2dc46816 | 1 | /* ModifyRecoParamHLTUsage |
2 | * Changes the Input for Reconstruction ( TPC RAW data or HLT TPC clusters ) | |
3 | * 1 -> only TPC raw/sim data | |
4 | * 2 -> if present TPC raw/sim data, otherwise HLT clusters | |
5 | * 3 -> only HLT clusters | |
6 | * 4 -> if present HLT clusters, otherwise TPC raw/sim data | |
7 | * | |
19dcf504 | 8 | * Usage : aliroot -b -q ModifyRecoParamHLTUsage.C'("/lustre/alice/alien/alice/data/2011/OCDB/TPC/Calib/RecoParam/Run136844_999999999_v2_s0.root",3,"local:///tmp/ocdb/")' |
2dc46816 | 9 | * |
10 | */ | |
11 | ||
12 | void ModifyRecoParamHLTUsage( const Char_t* lastOCDBEntry, | |
13 | Int_t iHLTusage, | |
14 | const Char_t* newStoragePath = "local:///tmp/ocdb", | |
15 | const Char_t* author = "Jochen Thaeder", | |
16 | const Char_t* alirootVersion = "05-01-Release" ) { | |
17 | ||
18 | // -- Get RecoParam | |
19 | // ------------------------------------------------------------------- | |
20 | TFile inFile(lastOCDBEntry); | |
21 | if (!inFile) { | |
22 | printf("File %s could not be found!\n", lastOCDBEntry); | |
23 | return -1; | |
24 | } | |
25 | ||
26 | AliCDBEntry * entry = ( AliCDBEntry *) inFile.Get("AliCDBEntry"); | |
27 | if (!entry) { | |
28 | printf("File %s does not contain AliCDBEntry object!\n", lastOCDBEntry); | |
29 | return -2; | |
30 | } | |
31 | ||
32 | TObjArray * arr = entry->GetObject(); | |
33 | ||
34 | AliTPCRecoParam * parHighFlux = NULL; | |
35 | AliTPCRecoParam * parLowFlux = NULL; | |
36 | AliTPCRecoParam * parLaserFlux = NULL; | |
37 | AliTPCRecoParam * parCosmicFlux = NULL; | |
38 | ||
39 | for (Int_t idx = 0 ; idx < arr->GetEntries() ; ++idx) { | |
40 | AliTPCRecoParam *param = (AliTPCRecoParam*) arr->At(idx); | |
41 | ||
42 | TString name(param->GetName()); | |
43 | ||
44 | if ( name.Contains("Low") ) | |
45 | parLowFlux = param; | |
46 | else if ( name.Contains("High") ) | |
47 | parHighFlux = param; | |
48 | else if ( name.Contains("Laser") ) | |
49 | parLaserFlux = param; | |
50 | else if ( name.Contains("Cosmic") ) | |
51 | parCosmicFlux = param; | |
52 | } | |
53 | ||
54 | // -- Set TPC RecoParam : UseHLTClusters | |
55 | // ------------------------------------------------------------------- | |
56 | parLaserFlux->SetUseHLTClusters(1); // LASER use always raw data | |
57 | ||
58 | parHighFlux->SetUseHLTClusters(iHLTusage); | |
59 | parLowFlux->SetUseHLTClusters(iHLTusage); | |
60 | parCosmicFlux->SetUseHLTClusters(iHLTusage); | |
61 | ||
62 | // -- Write out | |
63 | // ------------------------------------------------------------------- | |
64 | const Char_t *comment = "Modified RecoParam with HLT clusters usage"; | |
65 | // ------------------------------------------------------------------- | |
66 | ||
67 | AliCDBMetaData *metaData= new AliCDBMetaData(); | |
68 | metaData->SetObjectClassName("TObjArray"); | |
69 | metaData->SetResponsible(author); | |
70 | metaData->SetBeamPeriod(1); | |
71 | metaData->SetAliRootVersion(alirootVersion); | |
72 | metaData->SetComment(comment); | |
73 | ||
74 | AliCDBId id("TPC/Calib/RecoParam", 0, AliCDBRunRange::Infinity()); | |
75 | ||
76 | AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(newStoragePath); | |
77 | gStorage->Put(arr, id, metaData); | |
78 | ||
79 | return; | |
80 | } | |
81 |