Update timestamps for new AMANDA simulation (17/02/2015)
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROEqualizationFactorsEntry.C
CommitLineData
c4bb5c1d 1void MakeVZEROEqualizationFactorsEntry(Bool_t default = kTRUE, const char *infile = "alpha.dat")
3a0e93b4 2{
3
4 AliCDBManager *man = AliCDBManager::Instance();
5 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
6
3a0e93b4 7
8 TH1F *eqFactors = new TH1F("VZEROEqualizationFactors","VZERO Equalization Factors for Pb-Pb",64,-0.5,63.5);
c4bb5c1d 9 if (default) {
10 const Double_t alpha[66] = {0.0,
11 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
12 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
13 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
14 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
15 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
16 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
17 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
18 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
19 0.0};
20 eqFactors->SetContent(alpha);
21 }
22 else {
23 FILE *falphas;
24 if((falphas = fopen(infile,"r")) == NULL){
25 printf("Cannot open file %s",infile);
26 return;
27 }
28 Double_t alpha[66], alpha2[66], beta[66];
29 alpha[0] = alpha2[0] = beta[0] = alpha[65] = alpha2[65] = beta[65] = 0;
30 Int_t tempCh;
31 for(Int_t j=0; j<64; ++j) fscanf(falphas,"%d %lf %lf %lf", &tempCh, &beta[j+1], &alpha[j+1], &alpha2[j+1]);
32 fclose(falphas);
33
34 eqFactors->SetContent(alpha2);
35 }
3a0e93b4 36
37 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
38 md->SetResponsible("Brigitte Cheynis");
39 md->SetBeamPeriod(0);
40 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
41 md->SetComment("Default entry for VZERO Equalization Factors object");
42 md->PrintMetaData();
43
44 AliCDBStorage *storLoc = man->GetDefaultStorage();
45 AliCDBId id("VZERO/Calib/EqualizationFactors",0,AliCDBRunRange::Infinity());
46
47 storLoc->Put(eqFactors, id, md);
48
49 storLoc->Delete();
50 delete md;
51
52}