Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / HMPID / MakeHMPIDRecoParamV1.C
CommitLineData
c458aab6 1void MakeHMPIDRecoParamV1(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult)
2{
3 //
4 // Create HMPID Reco Parameters in OCDB
5 //
6 AliCDBManager* man = AliCDBManager::Instance();
7 if(!man->IsDefaultStorageSet()) man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
8
9 TObjArray *recoParamArray = new TObjArray();
10
11 {
12 AliHMPIDRecoParamV1* hmpRecoParam = AliHMPIDRecoParamV1::GetLowFluxParam();
13 hmpRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
14 hmpRecoParam->SetAsDefault();
15 recoParamArray->AddLast(hmpRecoParam);
16 hmpRecoParam->PrintParameters();
17 }
18 {
19 AliHMPIDRecoParamV1* hmpRecoParam = AliHMPIDRecoParamV1::GetHighFluxParam();
20 hmpRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
21 recoParamArray->AddLast(hmpRecoParam);
22 hmpRecoParam->PrintParameters();
23
24 }
25 {
26 AliHMPIDRecoParamV1* hmpRecoParam = AliHMPIDRecoParamV1::GetCosmicParam();
27 hmpRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
28 recoParamArray->AddLast(hmpRecoParam);
29 hmpRecoParam->PrintParameters();
30 }
31
32 // Set the default
33 Bool_t defaultIsSet = kFALSE;
34 for(Int_t i =0; i < recoParamArray->GetEntriesFast(); i++) {
35 AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
36 if (!param) continue;
37 if (default & param->GetEventSpecie()) {
38 param->SetAsDefault();
39 defaultIsSet = kTRUE;
40 }
41 }
42 if (!defaultIsSet) {
43 Error("The default reconstruction parameters are not set! Exiting...");
44 return;
45 }
46
47
48 AliCDBMetaData *md= new AliCDBMetaData();
49 md->SetResponsible("Domenico DiBari");
50 md->SetComment("Reconstruction parameters of HMPID, v1");
51 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
52 md->SetBeamPeriod(0);
53 AliCDBId id("HMPID/Calib/RecoParam",0,AliCDBRunRange::Infinity());
54 man->GetDefaultStorage()->Put(recoParamArray,id, md);
55
56 return;
57}