]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/MakeVZEROEqualizationFactorsEntry.C
Reducing the ADC search window for the forthcoming Pb-Pb run.
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROEqualizationFactorsEntry.C
index a7b432a903b29f0f92bbf1731ee812c9f50bace2..bc523d9d0bfddb7b0e45812d2853a7a4203632df 100644 (file)
@@ -1,23 +1,38 @@
-void MakeVZEROEqualizationFactorsEntry()
+void MakeVZEROEqualizationFactorsEntry(Bool_t default = kTRUE, const char *infile = "alpha.dat")
 {
 
   AliCDBManager *man = AliCDBManager::Instance();
   man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
 
-  // Creation of the light yields OCDB object
-  const Double_t alpha[66] = {0.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
-                             0.0};
 
   TH1F *eqFactors = new TH1F("VZEROEqualizationFactors","VZERO Equalization Factors for Pb-Pb",64,-0.5,63.5);
-  eqFactors->SetContent(alpha);
+  if (default) {
+    const Double_t alpha[66] = {0.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
+                               0.0};
+    eqFactors->SetContent(alpha);
+  }
+  else {
+    FILE *falphas;
+    if((falphas = fopen(infile,"r")) == NULL){
+      printf("Cannot open file %s",infile);
+      return;
+    }
+    Double_t alpha[66], alpha2[66], beta[66];
+    alpha[0] = alpha2[0] = beta[0] = alpha[65] = alpha2[65] = beta[65] = 0;
+    Int_t tempCh;
+    for(Int_t j=0; j<64; ++j) fscanf(falphas,"%d %lf %lf %lf", &tempCh, &beta[j+1], &alpha[j+1], &alpha2[j+1]);
+    fclose(falphas);
+
+    eqFactors->SetContent(alpha2);
+  }
        
   AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
   md->SetResponsible("Brigitte Cheynis");