]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/PMDPEDESTALda.cxx
New set of classes for B->J/psi->ee analysis and fit a la CDF (Carmelo, Giuseppe)
[u/mrichter/AliRoot.git] / PMD / PMDPEDESTALda.cxx
index e2e2a639287634132b147bdcefc62adb2ba0e701..dda379b49f1233e57f9354031a9a80b4be1aaa08 100644 (file)
@@ -4,7 +4,7 @@ PMD DA for online calibration
 contact: basanta@phy.iitb.ac.in
 Link:
 Reference Run:/afs/cern.ch/user/b/bnandi/public/pedestaldata/run37820.raw
-Run Type: STANDALONE
+Run Type: PEDESTAL
 DA Type: LDC
 Number of events needed: 1000
 Input Files: 
@@ -36,8 +36,6 @@ extern "C" {
 #include "TROOT.h"
 #include "TPluginManager.h"
 
-
-
 /* Main routine
       Arguments: 
       1- monitoring data source
@@ -88,7 +86,7 @@ int main(int argc, char **argv) {
     monitorSetNoWaitNetworkTimeout(1000);
     
     /* log start of process */
-    printf("DA example case1 monitoring program started\n");  
+    printf("PMD PED DA - started generating mean and rms of each channel\n");  
     
     /* init some counters */
 
@@ -136,8 +134,7 @@ int main(int argc, char **argv) {
                break;
                
            case PHYSICS_EVENT:
-               printf(" event number = %i \n",iev);
-               //if (iev == 10) break;
+
                AliRawReader *rawReader = new AliRawReaderDate((void*)event);
                TObjArray *pmdddlcont = new TObjArray();
                calibped.ProcessEvent(rawReader,pmdddlcont);
@@ -153,9 +150,22 @@ int main(int argc, char **argv) {
        
        /* exit when last event received, no need to wait for TERM signal */
 
+       // either END_OF_RUN or 1000 events
+
+       if (iev == 1000)
+         {
+           printf("-- 1000 pedestal events processed : terminating --\n");
+           printf("-- eventT is set to END_OF_RUN --\n");
+           eventT = END_OF_RUN;
+           break;
+         }
+
     }
 
+    printf(" Total number of events processed = %i \n",iev);
+
     ped = new TTree("ped","PMD Pedestal tree");
+    
     if (eventT==END_OF_RUN) {
       printf("EOR event detected\n");
       calibped.Analyse(ped);
@@ -168,5 +178,28 @@ int main(int argc, char **argv) {
     delete ped;
     ped = 0;
 
+/* store the pedestal file in database */
+
+    status = daqDA_DB_storeFile("PMD_PED.root","PMD_PED.root");
+
+    if (!status)
+      {
+       printf("--- PEDESTAL root FILE IS IN THE DAQ DATABASE\n");
+      }
+    else
+      {
+       printf("--- Storing the root file into the database failed\n");
+      }
+
+/* store the pedestal file on FES */
+    status = daqDA_FES_storeFile("PMD_PED.root","PMD_PED.root");
+    if (status) {
+       status = -2;
+    }
+
+
+
+
     return status;
 }