Coding convetion violations fixed.
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROCalibEntryScaled.C
CommitLineData
5fbabbd4 1
2void MakeVZEROCalibEntryScaled(Int_t run, Int_t scale = 1, const char *inputCDB = "raw://", const char *outputCDB = "local://$ALICE_ROOT/OCDB/VZERO/test"){
3
4 AliCDBManager *man = AliCDBManager::Instance();
5
6 man->SetDefaultStorage(inputCDB);
7
8 man->SetSpecificStorage("VZERO/Calib/PMGains",
9 "local://$ALICE_ROOT/OCDB");
10 man->SetSpecificStorage("VZERO/Calib/LightYields",
11 "local://$ALICE_ROOT/OCDB");
12
13 man->SetRun(run);
14
15 AliCDBEntry *entry = man->Get("VZERO/Calib/Data");
16 AliVZEROCalibData *calibdaorg = (AliVZEROCalibData*)entry->GetObject();
17 AliVZEROCalibData *calibda = new AliVZEROCalibData(*calibdaorg);
18
19 Float_t b[64] = { 7.40, 6.83, 7.02, 6.94, 7.03, 7.04, 7.79, 7.27,
20 6.92, 6.96, 7.01, 6.90, 7.28, 7.38, 7.33, 7.23,
21 6.71, 7.05, 7.17, 7.69, 7.41, 7.38, 7.21, 7.11,
22 7.26, 7.12, 6.98, 7.35, 6.99, 6.79, 7.13, 7.58,
23 6.95, 7.01, 7.33, 7.01, 7.21, 6.01, 7.34, 6.44,
24 5.68, 7.12, 6.07, 6.92, 7.04, 6.82, 7.04, 7.24,
25 7.53, 6.99, 7.10, 6.89, 7.07, 6.35, 6.88, 5.77,
26 6.81, 7.01, 6.89, 6.84, 6.68, 6.95, 6.73, 7.14};
27
28 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};
29
30 for (Int_t i = 0; i < 64; ++i) {
31 Float_t hv = calibdaorg->GetMeanHV(i)*TMath::Exp(-TMath::Log((Float_t)scale)/b[i]);
32 calibda->SetMeanHV(hv,i);
33 Float_t mip = (i < 32) ? 6950 : 33690;
34 printf("%d %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
35 i,
36 calibdaorg->GetMeanHV(i),
37 1./calibdaorg->GetMIPperADC(i),
38 mip*lightYieldCorr[i]*0.18*TMath::Qe()*calibdaorg->GetGain(i)/0.6e-12,
39 calibda->GetMeanHV(i),
40 1./calibda->GetMIPperADC(i),
41 mip*lightYieldCorr[i]*0.18*TMath::Qe()*calibda->GetGain(i)/0.6e-12,
42 calibda->GetMIPperADC(i)/calibdaorg->GetMIPperADC(i));
43 }
44
45 // Creation of the object VZERO Calibration as a MetaData
46 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
47 md->SetResponsible("Brigitte Cheynis");
48 md->SetBeamPeriod(0);
49 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
50 md->SetComment(Form("VZERO Calibration from RAW OCDB (HV gains are scaled down by factor of %d)",scale));
0fb97391 51 AliCDBId id("VZERO/Calib/Data",run,run);
5fbabbd4 52
53 man->SetDefaultStorage(outputCDB);
54 AliCDBStorage *storLoc = man->GetDefaultStorage();
55 storLoc->Put(calibda, id, md);
56
57}