OK. AliTPCcalibDButil.cxx.diff formatting fix
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 11:21:31 +0000 (11:21 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 11:21:31 +0000 (11:21 +0000)
OK. AliTPCCalibRaw.cxx.diff fix division by 0 in graph creation
OK. AliTPCCalibViewerGUItime.cxx.diff fix display for runs >100000
OK. AliTPCMonitor.cxx.diff fix event selection for root files
OK. makeCalibTree.diff fix problem with runs > 100000 (sorting)
Already there:startGUI.C.diff remove obsolete loading of reference tree

(Jens)

TPC/AliTPCCalibViewerGUItime.cxx
TPC/AliTPCMonitor.cxx
TPC/scripts/makeCalibTree
TPC/scripts/startGUI.C

index 6872bf6521181f65213c1a07d1e0e37aa3e80323..8596d1ccf4211fc80841bf9f0fe1cf6ab983d79b 100644 (file)
@@ -325,7 +325,7 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h
   fLblRunNumber->SetTextJustify(kTextLeft);
   fContValues->AddFrame(fLblRunNumber, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
   //run number
-  fLblRunNumberVal = new TGLabel(fContValues, "00000");
+  fLblRunNumberVal = new TGLabel(fContValues, "000000");
   fLblRunNumberVal->SetTextJustify(kTextLeft);
   fContValues->AddFrame(fLblRunNumberVal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0, 0, 0, 0));
   //time stamp label
@@ -1140,7 +1140,7 @@ void AliTPCCalibViewerGUItime::MouseMove(Int_t event, Int_t x, Int_t y, TObject
   UInt_t dd=0,mm=0,yy=0,HH=0,MM=0,SS=0,run=0;
   Double_t valx=0.,valy=0.;
   if (!fCurrentGraph) {
-    fLblRunNumberVal->SetText(Form("%05u",run));
+    fLblRunNumberVal->SetText(Form("%06u",run));
     fLblRunTimeVal->SetText(Form("%02u.%02u.%04u\n%02u:%02u:%02u",dd,mm,yy,HH,MM,SS));
     fLblValueXVal->SetText(Form("%.3e", valx));
     fLblValueYVal->SetText(Form("%.3e", valy));
@@ -1175,7 +1175,7 @@ void AliTPCCalibViewerGUItime::MouseMove(Int_t event, Int_t x, Int_t y, TObject
     valx=0.;
     valy=0.;
   }
-  fLblRunNumberVal->SetText(Form("%05u",run));
+  fLblRunNumberVal->SetText(Form("%06u",run));
   fLblRunTimeVal->SetText(Form("%02u.%02u.%04u\n%02u.%02u.%02u",dd,mm,yy,HH,MM,SS));
   if (fIsCustomDraw){
     fLblValueXVal->SetText(Form("%.3e", valx));
index 72b3620b05de01632ebb7618a9de882466b6cddd..5bdfea009f27126e4e53144579931f2a73569704 100755 (executable)
@@ -579,15 +579,33 @@ Int_t AliTPCMonitor::ReadDataNew(Int_t secid)
            eventType==AliRawEventHeaderBase::kSystemSoftwareTriggerEvent ||
            eventType==AliRawEventHeaderBase::kDetectorSoftwareTriggerEvent) ) {
              if (fVerb) cout<< "Skipping event! Its neither of 'physics, calibration and software trigger event'" << endl;
+             if(fRawReader->IsA()==AliRawReaderRoot::Class()){
+               if (fEventNumber<fRawReader->GetNumberOfEvents()-1) ++fEventNumber;
+               else {AliError("No more events");return 11;}
+             }
              continue;
            }
     skip=kFALSE;
     //test if the TPC has data
     UChar_t *data=0;
     fRawReader->Select("TPC");
-    if (!fRawReader->ReadNextData(data)) skip=kTRUE;
-    fEventNumber = fRawReader->GetEventIndex();
-    fEventNumberOld = fRawReader->GetEventIndex();
+    Int_t eventNr=fRawReader->GetEventIndex();
+    if (!fRawReader->ReadNextData(data)) {
+      skip=kTRUE;
+      printf("%d - %d\n",fEventNumber,fRawReader->GetNumberOfEvents());
+      if(fRawReader->IsA()==AliRawReaderRoot::Class()){
+        if (fEventNumber<fRawReader->GetNumberOfEvents()-1){
+          ++eventNr;
+          printf("inc conter\n");
+        }
+        else {
+          AliError("No more events");
+          return 11;
+        }
+      }
+    }
+    fEventNumber = eventNr;
+    fEventNumberOld = eventNr;
   }
   
 //   printf("secid: %d\n",secid);
index 2119c55a287fe3b1eca3a80ae4f900354ab865b3..451e8d78edb4c3409cba260ee4b55905243fc2fe 100755 (executable)
@@ -32,7 +32,7 @@ function createRangeList {
   local command=ls
   if [ $WITHALIEN -eq 1 ]; then command=alien_ls; fi
   local dir=$AUTOFILES
-  RUNS=($($command $dir | sed 's|Run\([0-9]\{5\}\)_.*|\1|'))
+  RUNS=($($command $dir | sed 's|Run\([0-9]\{1,6\}\)_.*|\1|' | sort -n))
   #define filename
   local filename=calibTreeTime_${first}_${last}
   #remove old files
@@ -54,7 +54,7 @@ function createGuiLists {
   local command=ls
   if [ $WITHALIEN -eq 1 ]; then command=alien_ls; fi
   local dir=$AUTOFILES
-  RUNS=($($command $dir | sed 's|Run\([0-9]\{5\}\)_.*|\1|'))
+  RUNS=($($command $dir | sed 's|Run\([0-9]\{1,6\}\)_.*|\1|' | sort -n))
   local count=0
   local iter=0
   local skip=0
@@ -69,10 +69,13 @@ function createGuiLists {
   if [ "x$RANGE" != "x" ]; then
     first=$(echo $RANGE | sed 's|\(.*\)-.*|\1|')
     last=$(echo $RANGE | sed 's|.*-\(.*\)|\1|')
+    echo $first-$last
     for (( i=0; i<${#RUNS[*]}; i=i+1 )); do
       if [ ${RUNS[i]} -ge $first ]&&[ $ifirst -eq 0 ]; then ifirst=$i; fi
       if [ ${RUNS[i]} -gt $last ]&&[ $ilast -eq ${#RUNS[*]} ]; then ilast=$i; fi
     done
+      echo $ifirst-$ilast
+      echo ${RUNS[$ifirst]}-${RUNS[$ilast-1]}
   fi
   #remove old files
   #test -d $TMPLISTDIR  && rm -rf $TMPLISTDIR
@@ -85,8 +88,9 @@ function createGuiLists {
     fi
     if [ $count -eq 0 ]; then
        local firstLocal=$(echo "$iter*$nfiles+$ifirst" | bc)
-       local lastLocal=$(echo "if ($firstLocal+$nfiles-1>=$ilast-$ifirst) $ilast-1 else $firstLocal+$nfiles-1" | bc)
-       filename=calibTreeTime_${RUNS[$firstLocal]}_${RUNS[$lastLocal]}
+#       local lastLocal=$(echo "if ($firstLocal+$nfiles-1>=$ilast-$ifirst) $ilast-1 else $firstLocal+$nfiles-1" | bc)
+       local lastLocal=$(echo "if (($iter+1)*$nfiles>=$ilast-$ifirst) $ilast-1 else $firstLocal+$nfiles-1" | bc)
+      filename=calibTreeTime_${RUNS[$firstLocal]}_${RUNS[$lastLocal]}
     fi
     echo ${RUNS[$i]} >> $TMPLISTDIR/$filename
     let count=$count+1
index 0e88894321d9e40ce259c2adc90783f99580a0ac..dda4cc2031e134aa7f7b078bb4dc9fc31e1f3303 100644 (file)
@@ -15,12 +15,5 @@ startGUI(char *file=0x0){
     viewer2=gui2->GetViewer();
     calPads=viewer->GetTree();
     calPads2=viewer2->GetTree();
-    TString refDataTree=gSystem->ExpandPathName("$REF_DATA_TREE");
-    if (!refDataTree.IsNull()&&refDataTree!="$REF_DATA_TREE"){
-      viewer->AddReferenceTree(refDataTree.Data(),"calPads","Ref");
-      viewer2->AddReferenceTree(refDataTree.Data(),"calPads","Ref");
-      gui->Reload();
-      gui2->Reload();
-    }
   }
 }