]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/T0Physda.cxx
for current DA
[u/mrichter/AliRoot.git] / T0 / T0Physda.cxx
index e0d47b18004835d566f59504eaaf172a2319b99b..f2ebf94ca0d86c16c47e8092289f47dfec5a628f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 T0 DA for online calibration
-
 Contact: Michal.Oledzki@cern.ch
 Link: http://users.jyu.fi/~mioledzk/
 Run Type: PHYSICS
@@ -79,9 +79,9 @@ int main(int argc, char **argv) {
       case 'a': {fscanf(inp, "%d", &ccbx ); break;} //N of X bins hCFD1_CFD
       case 'b': {fscanf(inp, "%f", &cclx ); break;} //Low x hCFD1_CFD
       case 'c': {fscanf(inp, "%f", &ccmx ); break;} //High x hCFD1_CFD
-      case 'd': {fscanf(inp, "%d", &cbx ); break;} //N of X bins hCFD
-      case 'e': {fscanf(inp, "%f", &clx ); break;} //Low x hCFD
-      case 'f': {fscanf(inp, "%f", &cmx ); break;} //High x hCFD
+//      case 'd': {fscanf(inp, "%d", &cbx ); break;} //N of X bins hCFD
+//      case 'e': {fscanf(inp, "%f", &clx ); break;} //Low x hCFD
+//      case 'f': {fscanf(inp, "%f", &cmx ); break;} //High x hCFD
     }
   }
   fclose(inp);
@@ -118,18 +118,10 @@ int main(int argc, char **argv) {
 
   // Allocation of histograms - start
 
-  TH1F *hCFD1_CFD[24];  
-  TH1F *hCFD[24];
+  TH1F *hCFD1minCFD[24];  
    
    for(Int_t ic=0; ic<24; ic++) {
-      if(ic<12) {
-        hCFD1_CFD[ic] = new TH1F(Form("CFD1-CFD%d",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
-        hCFD[ic] = new TH1F(Form("CFD%i",ic+1),"CFD",cbx,clx,cmx);
-       }
-      if(ic>11){
-        hCFD1_CFD[ic] = new TH1F(Form("CFD13-CFD%i",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
-        hCFD[ic] = new TH1F(Form("CFD%i",ic+1),"CFD",cbx,clx,cmx);
-       }
+        hCFD1minCFD[ic] = new TH1F(Form("CFD1-CFD%d",ic+1),"CFD-CFD",ccbx,cclx,ccmx);
     }
 
   // Allocation of histograms - end
@@ -159,8 +151,6 @@ int main(int argc, char **argv) {
     if (event==NULL) {
       continue;
     }
-//    iev++; 
 
     /* use event - here, just write event id to result file */
     eventT=event->eventType;
@@ -174,21 +164,18 @@ int main(int argc, char **argv) {
        break;
 
       case PHYSICS_EVENT:
+//      case CALIBRATION_EVENT:
       iev++;
 
       if(iev==1){
            printf("First event - %i\n",iev);
       }
 
-//      printf(" event number = %i \n",iev);
-
       // Initalize raw-data reading and decoding
       AliRawReader *reader = new AliRawReaderDate((void*)event);
           
       // Enable the following two lines in case of real-data
-   //       reader->LoadEquipmentIdsMap("T0map.txt");
-    //     reader->RequireHeader(kFALSE);
-     //          reader->RequireHeader(kTRUE);
+         reader->RequireHeader(kTRUE);
       AliT0RawReader *start = new AliT0RawReader(reader, kTRUE);
 
       // Read raw data
@@ -196,37 +183,31 @@ int main(int argc, char **argv) {
       for(Int_t i0=0;i0<105;i0++)
        for(Int_t j0=0;j0<5;j0++)
                allData[i0][j0] = 0;
-     
-      if(start->Next())
-      for (Int_t i=0; i<105; i++) {
+
+       if(start->Next()){
+       for (Int_t i=0; i<105; i++) {
        for(Int_t iHit=0;iHit<5;iHit++){
          allData[i][iHit]= start->GetData(i,iHit);
         }
+       }
       }
        else 
-       printf("No T0 data found!!\n");
+       printf("No T0 data found!!!\n");
 
       // Fill the histograms
        
-      for (Int_t ik = 0; ik<24; ik+=2)
+      for (Int_t ik = 0; ik<24; ik++)
          for (Int_t iHt=0; iHt<5; iHt++){
-                Int_t cc = ik/2;
-                if(allData[cc+1][iHt]!=0 ){
-                hCFD1_CFD[cc]->Fill(allData[cc+1][iHt]-allData[1][iHt]);
-                hCFD[cc]->Fill(allData[cc+13][iHt]);
+                if(allData[ik+1][iHt]!=0 ){
+                 if(ik<12){
+                        hCFD1minCFD[ik]->Fill(allData[ik+1][iHt]-allData[1][iHt]);
+                 }
+                  if(ik>11){
+                         hCFD1minCFD[ik]->Fill(allData[ik+45][iHt]-allData[57][iHt]);
+                  }
                }
        }
 
-      for (Int_t ik = 24; ik<48; ik+=2)
-         for (Int_t iHt=0; iHt<5; iHt++){
-                Int_t cc = ik/2; 
-                if(allData[cc+45][iHt]!=0 ){
-                 hCFD1_CFD[cc]->Fill(allData[cc+45][iHt]-allData[57][iHt]);
-                hCFD[cc]->Fill(allData[cc+45][iHt]);
-                       }
-       }
-
      delete start;
        start = 0x0;
      reader->Reset();
@@ -234,8 +215,6 @@ int main(int argc, char **argv) {
 
     }
 
-
-
     /* free resources */
     free(event);
     
@@ -251,8 +230,7 @@ int main(int argc, char **argv) {
   TFile *hist = new TFile(FILE_OUT,"RECREATE");
 
   for(Int_t j=0;j<24;j++){
-     hCFD1_CFD[j]->Write();
-     hCFD[j]->Write(); 
+     hCFD1minCFD[j]->Write();
     }
   hist->Close();
   delete hist;
@@ -260,7 +238,7 @@ int main(int argc, char **argv) {
   status=0;
 
   /* export file to FXS */
-  if (daqDA_FES_storeFile(FILE_OUT, FILE_OUT)) {
+  if (daqDA_FES_storeFile(FILE_OUT, "PHYSICS")) {
     status=-2;
   }