]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/EMCALLEDda.cxx
do also keep jet direction for pTSub exactly 0
[u/mrichter/AliRoot.git] / EMCAL / EMCALLEDda.cxx
index a2f43881744e73919990daf15bc75f4e5cd4c289..b147bcaec2d8df476f856518a4a9f2e1e7ff112c 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
@@ -20,7 +19,6 @@
 #define RESULT_FILE  "EMCALLED.root"
 #define FILE_ID "signal"
 #define AliDebugLevel() -1
-#define FILE_PEDClassName "emcCalibPedestal"
 #define FILE_SIGClassName "emcCalibSignal"
 const int kNRCU = 4;
 /* LOCAL_DEBUG is used to bypass daq* calls that do not work locally */
@@ -49,11 +47,11 @@ extern "C" {
 #include "AliCaloRawStreamV3.h"
 #include "AliCaloAltroMapping.h"
 #include "AliLog.h"
+#include "AliDAQ.h"
 
 //
 // EMC calibration-helper algorithm includes
 //
-#include "AliCaloCalibPedestal.h"
 #include "AliCaloCalibSignal.h"
 
 /*
@@ -84,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) {
@@ -139,9 +139,6 @@ int main(int argc, char **argv) {
   }
   
   /* set up our analysis classes */  
-  AliCaloCalibPedestal * calibPedestal = new AliCaloCalibPedestal(AliCaloCalibPedestal::kEmCal); 
-  calibPedestal->SetAltroMapping( mapping );
-  calibPedestal->SetParametersFromFile( parameterFile );
   AliCaloCalibSignal * calibSignal = new AliCaloCalibSignal(AliCaloCalibSignal::kEmCal); 
   calibSignal->SetAltroMapping( mapping );
   calibSignal->SetParametersFromFile( parameterFile );
@@ -163,7 +160,7 @@ int main(int argc, char **argv) {
     /* read until EOF */
     struct eventHeaderStruct *event;
     eventTypeType eventT;
-    
+
     for ( ; ; ) { // infinite loop
       
       /* check shutdown condition */
@@ -185,21 +182,24 @@ 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
       rawReader = new AliRawReaderDate((void*)event);
       calibSignal->SetRunNumber(event->eventRunNb);
       calibSignal->ProcessEvent(rawReader);
-      rawReader->Reset();
-      calibPedestal->SetRunNumber(event->eventRunNb);
-      calibPedestal->ProcessEvent(rawReader);
       delete rawReader;
       
       /* free resources */
@@ -224,16 +224,15 @@ 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()) { 
     f.cd();
-    calibPedestal->Write(FILE_PEDClassName);
     calibSignal->Write(FILE_SIGClassName);
     f.Close();
-    printf("Objects saved to file \"%s\" as \"%s\" and \"%s\".\n", 
-          RESULT_FILE, FILE_PEDClassName, FILE_SIGClassName); 
+    printf("Objects saved to file \"%s\" as \"%s\".\n", 
+          RESULT_FILE, FILE_SIGClassName); 
   } 
   else {
     printf("Could not save the object to file \"%s\".\n", 
@@ -243,7 +242,6 @@ int main(int argc, char **argv) {
   //
   // closing down; see if we can delete our analysis helper(s) also
   //
-  delete calibPedestal;
   delete calibSignal;
   for(Int_t iFile=0; iFile<kNRCU; iFile++) {
     if (mapping[iFile]) delete mapping[iFile];