Macro to generate calib entry where the PM gains are scaled down by a given factor...
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROCalibEntryPbPb.C
CommitLineData
53b85f23 1
2e61111d 2void MakeVZEROCalibEntryPbPb(Int_t run, Int_t scale = 1, const char *inputCDB = "raw://"){
53b85f23 3
4 AliCDBManager *man = AliCDBManager::Instance();
5
6 man->SetDefaultStorage(inputCDB);
7 man->SetRun(run);
8
9 AliCDBEntry *entry = man->Get("VZERO/Calib/Data");
10 AliVZEROCalibData *calibdaorg = (AliVZEROCalibData*)entry->GetObject();
11 AliVZEROCalibData *calibda = new AliVZEROCalibData(*calibdaorg);
12
2e61111d 13 Float_t b[64] = { 7.40, 6.83, 7.02, 6.94, 7.03, 7.04, 7.79, 7.27,
14 6.92, 6.96, 7.01, 6.90, 7.28, 7.38, 7.33, 7.23,
15 6.71, 7.05, 7.17, 7.69, 7.41, 7.38, 7.21, 7.11,
16 7.26, 7.12, 6.98, 7.35, 6.99, 6.79, 7.13, 7.58,
17 6.95, 7.01, 7.33, 7.01, 7.21, 6.01, 7.34, 6.44,
18 5.68, 7.12, 6.07, 6.92, 7.04, 6.82, 7.04, 7.24,
19 7.53, 6.99, 7.10, 6.89, 7.07, 6.35, 6.88, 5.77,
20 6.81, 7.01, 6.89, 6.84, 6.68, 6.95, 6.73, 7.14};
21
22 Float_t lightYieldCorr[64] = {0.01051, 0.00955, 0.00861, 0.00948, 0.01082, 0.00870, 0.01023, 0.01012, 0.01270, 0.01184, 0.01110, 0.01266, 0.00956, 0.00826, 0.00966, 0.00891, 0.01358, 0.01543, 0.01516, 0.01337, 0.01908, 0.01641, 0.01767, 0.01512, 0.01664, 0.01326, 0.01536, 0.00586, 0.01439, 0.01445, 0.01504, 0.01079, 0.00105, 0.00110, 0.00143, 0.00093, 0.00072, 0.01919, 0.00073, 0.02580, 0.02911, 0.00148, 0.03176, 0.00126, 0.00158, 0.00111, 0.02804, 0.00109, 0.00157, 0.00158, 0.00104, 0.00120, 0.00123, 0.00188, 0.00193, 0.03442, 0.00200, 0.00185, 0.00143, 0.00257, 0.00201, 0.00151, 0.00197, 0.00282};
189c0835 23
53b85f23 24 for (Int_t i = 0; i < 64; ++i) {
2e61111d 25 Float_t hv = calibdaorg->GetMeanHV(i)*TMath::Exp(-TMath::Log((Float_t)scale)/b[i]);
7c41d8d0 26 calibda->SetMeanHV(hv,i);
2e61111d 27 Float_t mip = (i < 32) ? 6950 : 33690;
28 printf("%d %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
29 i,
30 calibdaorg->GetMeanHV(i),
31 1./calibdaorg->GetMIPperADC(i),
32 mip*lightYieldCorr[i]*0.18*TMath::Qe()*calibdaorg->GetGain(i)/0.6e-12,
33 calibda->GetMeanHV(i),
34 1./calibda->GetMIPperADC(i),
35 mip*lightYieldCorr[i]*0.18*TMath::Qe()*calibda->GetGain(i)/0.6e-12,
36 calibdaorg->GetMIPperADC(i)/calibda->GetMIPperADC(i));
53b85f23 37 }
38
39 // Creation of the object VZERO Calibration as a MetaData
40 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
41 md->SetResponsible("Brigitte Cheynis");
42 md->SetBeamPeriod(0);
43 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
44 md->SetComment("Pb-Pb VZERO Calibration from RAW OCDB");
189c0835 45 AliCDBId id("VZERO/Calib/Data",0,AliCDBRunRange::Infinity());
53b85f23 46
2e61111d 47 man->SetDefaultStorage(Form("local://$ALICE_ROOT/OCDB/VZERO/PbPb_%d",scale));
53b85f23 48 AliCDBStorage *storLoc = man->GetDefaultStorage();
49 storLoc->Put(calibda, id, md);
50
51}