]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/ZDCMAPPINGda.cxx
store pt in the tracklet instead of momentum
[u/mrichter/AliRoot.git] / ZDC / ZDCMAPPINGda.cxx
index 652b9ffee738ddbf1e745c929a9b8ae490317609..1a5856d16218db018b51cb778c1c464d42c250f0 100644 (file)
@@ -48,6 +48,7 @@ int main(int argc, char **argv) {
   monitorDeclareTable(const_cast<char**>(tableSOD));
   
   int status = 0;
+  int const kNChannels = 48;
 
   /* log start of process */
   printf("\nZDC MAPPING program started\n");  
@@ -101,16 +102,13 @@ int main(int argc, char **argv) {
       }
 
       /* retry if got no event */
-      if(event==NULL) {
-        continue;
-      }      
+      if(event==NULL) continue;
       
       // Initalize raw-data reading and decoding
       AliRawReader *reader = new AliRawReaderDate((void*)event);
       // --- Reading event header
-      UInt_t evtype = reader->GetType();
-      //printf("\n\t ZDCPEDESTALda -> ev. type %d\n",evtype);
-      //printf("\t ZDCPEDESTALda -> run # %d\n",reader->GetRunNumber());
+      //UInt_t evtype = reader->GetType();
+      //printf("\t ZDCMAPPINGda -> run # %d\n",reader->GetRunNumber());
       //
       AliZDCRawStream *rawStreamZDC = new AliZDCRawStream(reader);
         
@@ -118,34 +116,37 @@ int main(int argc, char **argv) {
       /* use event - here, just write event id to result file */
       eventT=event->eventType;
       
-      Int_t ich=0, adcMod[48], adcCh[48], sigCode[48], det[48], sec[48];
+      Int_t ich=0;
+      Int_t adcMod[kNChannels], adcCh[kNChannels], sigCode[kNChannels];
+      Int_t det[kNChannels], sec[kNChannels];
       
       if(eventT==START_OF_DATA){
        sodRead = kTRUE;
+       rawStreamZDC->SetSODReading(kTRUE);
        
+       // --------------------------------------------------------
+       // --- Writing ascii data file for the Shuttle preprocessor
+        mapFile4Shuttle = fopen(MAPDATA_FILE,"w");
        if(!rawStreamZDC->Next()) printf(" \t No raw data found!! \n");
         else{
          while(rawStreamZDC->Next()){
-            if(rawStreamZDC->IsChMapping()){
+            if((rawStreamZDC->IsChMapping()) && (ich<kNChannels)){
              adcMod[ich] = rawStreamZDC->GetADCModFromMap(ich);
              adcCh[ich] = rawStreamZDC->GetADCChFromMap(ich);
              sigCode[ich] = rawStreamZDC->GetADCSignFromMap(ich);
              det[ich] = rawStreamZDC->GetDetectorFromMap(ich);
              sec[ich] = rawStreamZDC->GetTowerFromMap(ich);
+             //
+             fprintf(mapFile4Shuttle,"\t%d\t%d\t%d\t%d\t%d\t%d\n",
+               ich,adcMod[ich],adcCh[ich],sigCode[ich],det[ich],sec[ich]);
+             //
+             //printf("ZDCMAPPINGda.cxx -> %d mod %d ch %d code %d det %d sec %d\n",
+             //   ich,adcMod[ich],adcCh[ich],sigCode[ich],det[ich],sec[ich]);
+             //
              ich++;
            }
          }
        }
-       // --------------------------------------------------------
-       // --- Writing ascii data file for the Shuttle preprocessor
-        mapFile4Shuttle = fopen(MAPDATA_FILE,"w");
-        for(Int_t i=0; i<ich; i++){
-          fprintf(mapFile4Shuttle,"\t%d\t%d\t%d\t%d\t%d\t%d\n",i,
-            adcMod[i],adcCh[i],sigCode[i],det[i],sec[i]);
-          //
-          //printf("ZDCMAPPING.cxx ->  mod %d ch %d, ch %d, code %d det %d, sec %d\n",
-          //      i,adcMod[i],adcCh[i],sigCode[i],det[i],sec[i]);
-        }
         fclose(mapFile4Shuttle);
       } // SOD event
       else{ 
@@ -159,8 +160,8 @@ int main(int argc, char **argv) {
       iev++; 
     }    
       
-      /* free resources */
-      free(event);
+    /* free resources */
+    //free(event);
   }
   
   /* store the result files on FES */