new macro to handle setting of default event species for reco params
[u/mrichter/AliRoot.git] / FMD / scripts / MakeRecoParam.C
CommitLineData
8a581fe8 1void
2691ce9c 2MakeRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult)
8a581fe8 3{
4 AliCDBManager* cdb = AliCDBManager::Instance();
5 cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
6 cdb->SetRun(0);
2691ce9c 7
8 TObjArray *recoParamArray = new TObjArray();
9
10 {
11 // Default reconstruction parameters
12 AliFMDRecoParam * fmdRecoParam = new AliFMDRecoParam();
13 fmdRecoParam->SetEventSpecie(AliRecoParam::kDefault);
14 fmdRecoParam->SetName("Default");
15 recoParamArray->AddLast(fmdRecoParam);
16 }
17 {
18 // Default reconstruction parameters
19 AliFMDRecoParam * fmdRecoParam = new AliFMDRecoParam();
20 fmdRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
21 fmdRecoParam->SetName("Cosmic");
22 recoParamArray->AddLast(fmdRecoParam);
23 }
24 {
25 // Default reconstruction parameters
26 AliFMDRecoParam * fmdRecoParam = new AliFMDRecoParam();
27 fmdRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
28 fmdRecoParam->SetName("LowMult");
29 recoParamArray->AddLast(fmdRecoParam);
30 }
31 {
32 // Default reconstruction parameters
33 AliFMDRecoParam * fmdRecoParam = new AliFMDRecoParam();
34 fmdRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
35 fmdRecoParam->SetName("HighMult");
36 recoParamArray->AddLast(fmdRecoParam);
37 }
38
39 // Set the default
40 Bool_t defaultIsSet = kFALSE;
41 for(Int_t i =0; i < recoParamArray->GetEntriesFast(); i++) {
42 AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
43 if (!param) continue;
44 if (default & param->GetEventSpecie()) {
45 param->SetAsDefault();
46 defaultIsSet = kTRUE;
47 }
48 }
8a581fe8 49
2691ce9c 50 if (!defaultIsSet) {
51 Error(macroname,"The default reconstruction parameters are not set! Exiting...");
52 return;
53 }
54
55 //AliFMDRecoParam param;
56 //param.SetEventSpecie(AliRecoParam::kLowMult) ;
8a581fe8 57 AliCDBId id("FMD/Calib/RecoParam",0,999999);
58 AliCDBMetaData meta;
2691ce9c 59
8a581fe8 60 meta = new AliCDBMetaData;
61 meta.SetResponsible(gSystem->GetUserInfo()->fRealName.Data());
62 meta.SetAliRootVersion(gROOT->GetVersion());
63 meta.SetBeamPeriod(1);
2691ce9c 64 meta.SetComment("Data for testing");
65 meta.SetProperty("key1", recoParamArray);
8a581fe8 66
2691ce9c 67 cdb->Put(recoParamArray, id, &meta);
8a581fe8 68}
69
70