Macro to calculate the needed HV values as a function of the required MIP signal.
[u/mrichter/AliRoot.git] / VZERO / CalculateHVs.C
CommitLineData
3aa47a8e 1void CalculateHVs(Float_t requiredADCperMIP = 2.6, Int_t run = 137366)
2{
3 AliCDBManager *man = AliCDBManager::Instance();
4 man->SetDefaultStorage("raw://");
5 man->SetSpecificStorage("VZERO/Calib/PMGains","local://$ALICE_ROOT/OCDB");
6 man->SetSpecificStorage("VZERO/Calib/LightYields","local://$ALICE_ROOT/OCDB");
7 man->SetRun(run);
8
9 AliCDBEntry *ent = man->Get("VZERO/Calib/Data");
10 AliVZEROCalibData *calData = (AliVZEROCalibData*)ent->GetObject();
11 for(Int_t i = 0; i < 64; ++i) {
12 printf("%d %.0f (%.0f) S%d R%d\n",
13 i,
14 calData->GetHV(i,requiredADCperMIP),
15 calData->GetMeanHV(i),
16 i%8,
17 (i<32) ? i/8 : (i-32)/8);
18 }
19}