1 void UpdateVZEROTimeDelaysEntries(Int_t year = 2010, Int_t period = 0, Bool_t local = kFALSE)
8 else if (year == 2010) {
13 else if (period == 1) {
17 else if (period == 2) {
22 printf("Invalid run period...\n");
27 printf("Invalid year...\n");
31 AliCDBManager *man = AliCDBManager::Instance();
32 man->SetDefaultStorage(Form("alien://?folder=/alice/data/%d/OCDB",year));
34 man->SetRun(runRange[1]);
36 AliCDBEntry *entry = man->Get("VZERO/Calib/Data");
37 AliVZEROCalibData *calibda = (AliVZEROCalibData*)entry->GetObject();
38 printf("Year %d Period %d:\n",year,period);
40 for(Int_t i = 0; i < 64; ++i) printf("%.2f ",calibda->GetTimeOffset(i));
42 entry = man->Get("VZERO/Calib/TimeDelays");
43 TH1F *delays = (TH1F*)entry->GetObject();
44 TH1F *delaysNew = new TH1F(*delays);
46 for(Int_t i = 0; i < 64; ++i) printf("%.2f ",delaysNew->GetBinContent(i+1));
48 for(Int_t i = 0; i < 64; ++i) {
49 if (year == 2009) delaysNew->SetBinContent(i+1,delays->GetBinContent(i+1)+5.0);
50 if (year == 2010 && period == 0) delaysNew->SetBinContent(i+1,5.0);
51 if (year == 2010 && (period == 1 || period == 2)) {
53 Int_t channel = i % 8;
54 Int_t j = AliVZEROCalibData::GetOfflineChannelNumber(board,channel);
55 delaysNew->SetBinContent(j+1,
56 delays->GetBinContent(j+1)+
57 calibda->GetTimeOffset(i)-
58 calibda->GetTimeOffset(j));
61 printf("CorrDelay:\n");
62 for(Int_t i = 0; i < 64; ++i) printf("%.2f ",delaysNew->GetBinContent(i+1));
65 if (local) man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
68 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
69 md->SetResponsible("Brigitte Cheynis");
71 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
72 md->SetComment(Form("Time delays channel by channel (corrected values for year %d, period %d)",year,period));
75 AliCDBStorage *storLoc = man->GetDefaultStorage();
76 AliCDBId id("VZERO/Calib/TimeDelays",runRange[0],runRange[1]);
78 storLoc->Put(delaysNew, id, md);