The GRP CDB entry is not any more a TList, but a TMap
[u/mrichter/AliRoot.git] / GRP / UpdateCDBGRPEntry.C
CommitLineData
99479691 1void UpdateCDBGRPEntry() {
2 // produce the GRP default entry in CDB
3
4 AliCDBManager* man = AliCDBManager::Instance();
5 man->SetDefaultStorage("local://$ALICE_ROOT");
6 man->SetRun(0);
7 AliCDBId id("GRP/GRP/Data",0,AliCDBRunRange::Infinity());
8 AliCDBMetaData *metadata= new AliCDBMetaData();
9
10 // Get root version
11 const char* rootv = gROOT->GetVersion();
12
13 // Get AliRoot version from file to set it in the metadata of the entry
14 TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
15 Int_t size = fv->GetSize();
16 char *buf = new Char_t[size];
17 memset(buf, '\0', size);
18 fv->Seek(0);
19 char* alirootv;
20 if ( fv->ReadBuffer(buf, size) ) {
21 Printf("Error reading AliRoot version from file to buffer!");
22 alirootv = "";
23 }
24 if(buf=="AliRoot"){
25 alirootv="HEAD";
26 }else{
27 alirootv = buf;
28 metadata->SetResponsible("Panos.Christakoglou@cern.ch");
29 metadata->SetComment("Default values for the GRP monitored parameters");
30 metadata->SetAliRootVersion(alirootv);
31 }
32
3549b642 33 TList *list = new TList();
34 TMap *mappp = GetGRPList("pp");
35 list->Add(mappp);
36 TMap *mappbpb = GetGRPList("PbPb");
37 list->Add(mappbpb);
38
99479691 39 Printf("Storing in CDB the default values for the GRP %d parameters produced with root %s and AliRoot version %s",list->GetEntries(),rootv,alirootv);
40
41 man->Put(list,id,metadata);
42}
43
44//_______________________________________//
3549b642 45TMap *GetGRPList(const char* system) {
46 TString fSystem = system;
47 TMap *map = new TMap();
48 map->SetName(system);
99479691 49
3549b642 50 //DAQ
51 map->Add(new TObjString("fAliceStartTime"),new TObjString("0"));
52 map->Add(new TObjString("fAliceStopTime"),new TObjString("9999"));
53 if(fSystem == "pp")
54 map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("14000"));
55 else map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("5500"));
56 map->Add(new TObjString("fAliceBeamType"),new TObjString(system));
57 map->Add(new TObjString("fNumberOfDetectors"),new TObjString("15"));
58 map->Add(new TObjString("fDetectorMask"),new TObjString("1048575"));
59 map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC07a"));
99479691 60
3549b642 61 //DCS
62 map->Add(new TObjString("fLHCState"),new TObjString("test"));
63 map->Add(new TObjString("fLHCCondition"),new TObjString("test"));
64 map->Add(new TObjString("fLHCLuminosity"),new TObjString("0"));
65 map->Add(new TObjString("fBeamIntensity"),new TObjString("0"));
66 map->Add(new TObjString("fL3Current"),new TObjString("0"));
67 map->Add(new TObjString("fL3Polarity"),new TObjString("0"));
68 map->Add(new TObjString("fDipoleCurrent"),new TObjString("0"));
69 map->Add(new TObjString("fDipolePolarity"),new TObjString("0"));
70 map->Add(new TObjString("fCavernTemperature"),new TObjString("0"));
71 map->Add(new TObjString("fCavernPressure"),new TObjString("0"));
99479691 72
3549b642 73 return map;
99479691 74}