ALIROOT-5420 Changes for CDH v3
[u/mrichter/AliRoot.git] / ZDC / MakeZDCRecoParam.C
CommitLineData
1de9cc13 1void MakeZDCRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult){
7bff3766 2//========================================================================
3//
4// Steering macro to create and store in OCDB
5// ZDC reconstruction parameters
6//
7// Contact: chiara.oppedisano@to.infn.it
8//
9//========================================================================
10
11 AliCDBManager* cdb = AliCDBManager::Instance();
bc7bc94b 12 //if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://OCDB");
162637e4 13 cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
1de9cc13 14
15 TObjArray *recoParamArray = new TObjArray();
7bff3766 16
1de9cc13 17
18 AliZDCRecoParampp* zdcppRecoParam = AliZDCRecoParampp::GetLowFluxParam();
19 zdcppRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
20 recoParamArray->AddLast(zdcppRecoParam);
21
22 AliZDCRecoParamPbPb* zdcAARecoParam = AliZDCRecoParamPbPb::GetHighFluxParam();
23 zdcAARecoParam->SetEventSpecie(AliRecoParam::kHighMult);
24 recoParamArray->AddLast(zdcAARecoParam);
25
26 // Set the default
27 Bool_t defaultIsSet = kFALSE;
28 for(Int_t i =0; i<recoParamArray->GetEntriesFast(); i++) {
29 AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
30 if (!param) continue;
31 if (default & param->GetEventSpecie()) {
32 param->SetAsDefault();
33 defaultIsSet = kTRUE;
34 }
73bc3a3f 35 }
1de9cc13 36 if (!defaultIsSet) {
37 Error("The default reconstruction parameters are not set! Exiting...");
7bff3766 38 return;
7bff3766 39 }
7bff3766 40
1de9cc13 41 // save in CDB storage
42 AliCDBMetaData *md= new AliCDBMetaData();
43 md->SetResponsible("Chiara Oppedisano");
44 md->SetComment("Reconstruction parameters for ZDC");
45 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
46 AliCDBId id("ZDC/Calib/RecoParam",0,AliCDBRunRange::Infinity());
47 cdb->GetDefaultStorage()->Put(recoParamArray,id, md);
48
7bff3766 49}