]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/PMDGAINda.cxx
old unused alipmdv3.cxx deleted
[u/mrichter/AliRoot.git] / PMD / PMDGAINda.cxx
index 076282a0c811d2bf8b4c9025fd6a2ca01fdccd81..7a1e1fed8804aa881f7e77d45b3e1deb4b818cf1 100644 (file)
@@ -2,12 +2,12 @@
 PMD DA for online calibration
 
 contact: basanta@phy.iitb.ac.in
-Link:
+Link: https://twiki.cern.ch/twiki/bin/view/ALICE/DA
 Reference run:/afs/cern.ch/user/s/sjena/public/run83496.raw
 Run Type: PHYSICS
 DA Type: MON
 Number of events needed: 1 million for PB+PB, 200 milion for p+p
-Input Files: Run0_999999999_v0_s0.root,PMD_PED.root, PMD_GAIN_CONFIGFILE, pmd_gain_tempfile.dat
+Input Files: PMD/Calib/Mapping/Run0_999999999_v0_s0.root, PMD_PED.root, PMD_GAIN_CONFIGFILE, pmd_gain_tempfile.dat
 Output Files: PMDGAINS.root, to be exported to the DAQ FES
 Trigger types used: PHYSICS_EVENT
 
@@ -64,7 +64,7 @@ int main(int argc, char **argv) {
 
     // Reads the pedestal file and keep the values in memory for subtraction
 
-    AliPMDCalibGain calibgain;
+    AliPMDCalibGain *calibgain = new AliPMDCalibGain();
 
     // Fetch the pedestal file - PMD_PED.root 
 
@@ -80,7 +80,7 @@ int main(int argc, char **argv) {
        return -1;
       }
     
-    Int_t pstatus = calibgain.ExtractPedestal("PMD_PED.root");
+    Int_t pstatus = calibgain->ExtractPedestal("PMD_PED.root");
 
     if(pstatus == -3) return -3;
 
@@ -113,7 +113,7 @@ int main(int argc, char **argv) {
        status = daqDA_DB_getFile("pmd_gain_tempfile.dat","pmd_gain_tempfile.dat");
        if(!status)
          {
-           calibgain.ReadTempFile("pmd_gain_tempfile.dat");
+           calibgain->ReadTempFile("pmd_gain_tempfile.dat");
          }
        else
          {
@@ -123,7 +123,7 @@ int main(int argc, char **argv) {
        status = daqDA_DB_getFile("PMD_HOT.root","PMD_HOT.root");
        if(!status)
          {
-           calibgain.ExtractHotChannel("PMD_HOT.root");
+           calibgain->ExtractHotChannel("PMD_HOT.root");
          }
        else
          {
@@ -172,15 +172,18 @@ int main(int argc, char **argv) {
     Int_t iev=0;
 
     // Get run number
-    /*
+
+    int runNr = 0;
+
     if (getenv("DATE_RUN_NUMBER")==0) {
       printf("DATE_RUN_NUMBER not properly set.\n");
-      return -1;
+      printf("Run Number set to Zero \n");
+      //return -1;
     }
-    int runNr = atoi(getenv("DATE_RUN_NUMBER"));
-    */
-
-    int runNr = 0;
+    else
+      {
+       runNr = atoi(getenv("DATE_RUN_NUMBER"));
+      }
 
     if (gSystem->AccessPathName("localOCDB/PMD/Calib/Mapping",kFileExists))
       {
@@ -190,10 +193,10 @@ int main(int argc, char **argv) {
            return -1;
          }
       }
-    status = daqDA_DB_getFile("PMD/Calib/Mapping","localOCDB/PMD/Calib/Mapping/Run0_999999999_v0_s0.root");
+    status = daqDA_DB_getFile("PMD/Calib/Mapping/Run0_999999999_v0_s0.root","localOCDB/PMD/Calib/Mapping/Run0_999999999_v0_s0.root");
     if (status)
       {
-       printf("Failed to get PMD-Mapping file (PMD/Calib/Mapping) from DAQdetDB, status=%d\n", status);
+       printf("Failed to get PMD-Mapping file (PMD/Calib/Mapping/Run0_999999999_v0_s0.root) from DAQdetDB, status=%d\n", status);
        return -1;
       }
 
@@ -249,7 +252,7 @@ int main(int argc, char **argv) {
                //if(nevents_physics%100 == 0)printf("Physis Events = %d\n",nevents_physics);
                AliRawReader *rawReader = new AliRawReaderDate((void*)event);
                TObjArray *pmdddlcont = new TObjArray();
-               calibgain.ProcessEvent(rawReader, pmdddlcont);
+               calibgain->ProcessEvent(rawReader, pmdddlcont);
 
                if (totevt%hotevtsize == 0) hotfilestatus = true;
                delete pmdddlcont;
@@ -276,7 +279,7 @@ int main(int argc, char **argv) {
 
        TTree *hot = new TTree("hot","PMD Hot cell tree");
        
-       calibgain.FindHotCell(hot,xvar);
+       calibgain->FindHotCell(hot,xvar);
        
        hot->Write();
        hotRun->Close();
@@ -297,7 +300,7 @@ int main(int argc, char **argv) {
 
        TTree *hot = new TTree("hot","PMD Hot cell tree");
        
-       calibgain.FindHotCell(hot,xvar);
+       calibgain->FindHotCell(hot,xvar);
        
        hot->Write();
        hotRun->Close();
@@ -323,7 +326,7 @@ int main(int argc, char **argv) {
        printf("***  Writing the intermediate ASCII file    ***\n");
        printf("-----------------------------------------------\n");
 
-       calibgain.WriteTempFile("pmd_gain_tempfile.dat");
+       calibgain->WriteTempFile("pmd_gain_tempfile.dat");
 
        // Store the Intermediate ascii file in the DB
        status = daqDA_DB_storeFile("pmd_gain_tempfile.dat","pmd_gain_tempfile.dat");
@@ -343,7 +346,7 @@ int main(int argc, char **argv) {
        printf("***  Writing the PMDGAINS.root file           ***\n");
        printf("-----------------------------------------------\n");
 
-       calibgain.Analyse(ic, meanc);
+       calibgain->Analyse(ic, meanc);
 
        TFile * gainRun = new TFile ("PMDGAINS.root","RECREATE"); 
        ic->Write();
@@ -369,6 +372,7 @@ int main(int argc, char **argv) {
     delete meanc;
     meanc = 0;
     
+    delete calibgain;
 
     /* store the result file on FES */