]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/EMCALLEDda.cxx
Updates D+ syst err
[u/mrichter/AliRoot.git] / EMCAL / EMCALLEDda.cxx
index 670aaef71986d807d30ea83e699e05165597f914..65bfca6c1cbc97a0a9b5df29c12be94d0d64a714 100644 (file)
@@ -8,8 +8,7 @@
   Input Files: argument list
   Output Files: RESULT_FILE=EMCALLED.root, to be exported to the DAQ FXS
   fileId:  FILE_ID=EMCALLED    
-  Trigger types used: CALIBRATION_EVENT (temporarily also PHYSICS_EVENT to start with)
-  [When we have real data files later, we should only use CALIBRATION_EVENT]
+  Trigger types used: CALIBRATION_EVENT 
 */
 /*
   This process reads RAW data from the files provided as command line arguments
@@ -48,6 +47,7 @@ extern "C" {
 #include "AliCaloRawStreamV3.h"
 #include "AliCaloAltroMapping.h"
 #include "AliLog.h"
+#include "AliDAQ.h"
 
 //
 // EMC calibration-helper algorithm includes
@@ -59,7 +59,7 @@ extern "C" {
   Arguments: list of DATE raw data files
 */
 
-int main(int argc, char **argv) {
+int main(int argc, char **argv) { // Main routine, EMC signal detector algorithm 
 
   AliLog::SetClassDebugLevel("AliCaloRawStreamV3",-5);
   AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
@@ -82,6 +82,8 @@ int main(int argc, char **argv) {
   /* log start of process */
   printf("EMCAL DA started - %s\n",__FILE__);
   
+  Int_t emcID = AliDAQ::DetectorID("EMCAL"); // bit 18..
+
   /* declare monitoring program */
   status=monitorDeclareMp( __FILE__ );
   if (status!=0) {
@@ -158,7 +160,7 @@ int main(int argc, char **argv) {
     /* read until EOF */
     struct eventHeaderStruct *event;
     eventTypeType eventT;
-    
+
     for ( ; ; ) { // infinite loop
       
       /* check shutdown condition */
@@ -180,12 +182,18 @@ int main(int argc, char **argv) {
        continue;
       }
       eventT = event->eventType; /* just convenient shorthand */
-      
-      /* skip start/end of run events */
-      if ( (eventT != physicsEvent) && (eventT != calibrationEvent) ) {
+      /* only look at calibration events */
+      if ( eventT != calibrationEvent ) {
+       free(event);    
        continue;
       }
       
+      /* only look at events where EMCAL was included */
+      if (! TEST_DETECTOR_IN_PATTERN(event->eventDetectorPattern, emcID) ) {
+       free(event);    
+       continue;
+      }
+
       nevents++; // count how many acceptable events we have
       
       //  Signal calibration
@@ -216,7 +224,7 @@ int main(int argc, char **argv) {
   // write class to rootfile
   //
   
-  printf ("%d physics/calibration events processed.\n",nevents);
+  printf ("%d calibration events processed.\n",nevents);
   
   TFile f(RESULT_FILE, "recreate");
   if (!f.IsZombie()) {