improving raw qa making
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Sep 2009 20:59:11 +0000 (20:59 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Sep 2009 20:59:11 +0000 (20:59 +0000)
test/cosmic/MergeQAMerged.C [new file with mode: 0644]
test/cosmic/rawqa.C
test/cosmic/rawqa.sh

diff --git a/test/cosmic/MergeQAMerged.C b/test/cosmic/MergeQAMerged.C
new file mode 100644 (file)
index 0000000..fca560e
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  MergeQAMerged.C
+ *  
+ *
+ *  Created by schutz on 29/09/09.
+ *  Copyright 2009 CERN. All rights reserved.
+ *
+ */
+MergeQAMerged(Char_t * outfile, Char_t * list)
+{
+  TFileMerger merger ; 
+  merger.OutputFile(outfile); 
+  TString QAfile ; 
+  FILE * QAfiles = fopen(list, "r") ; 
+  while ( QAfile.Gets(QAfiles) ){
+    merger.AddFile(QAfile) ;     
+  } 
+  merger.Merge() ;   
+}
+
index a5f7347..0d2ca78 100644 (file)
 TString ClassName() { return "rawqa" ; } 
 
 //________________________________qa______________________________________
-void rawqa(Int_t run) 
+void rawqa(Char_t * filename, Int_t run) 
 {      
-  const Char_t * filename = "raw.root" ; 
+//  TGrid * grid = TGrid::Connect("alien://") ; 
+//  TString filename ; 
+//  if (grid) {
+//    filename = Form("alien:///alice/data/2009/LHC09c/000085034/raw/09000085034023.40.root") ;  
+//  } else {
+//    filename = "raw.root" ;       
+//  }
+
   // Set the CDB storage location
   AliCDBManager * man = AliCDBManager::Instance();
-  //man->SetDefaultStorage("local://cdb2");
+//  man->SetDefaultStorage("local://cdb2");
   man->SetDefaultStorage("raw://");
   
   // set the location of reference data 
@@ -53,7 +60,8 @@ void rawqa(Int_t run)
   AliGeomManager::LoadGeometry();
   printf("INFO: Proccessing file %s\n", filename) ;
   // check which detectors are present 
-  AliRawReader * rawReader = new AliRawReaderRoot(filename);
+  TString alienName = Form("alien://%s", filename) ;
+  AliRawReader * rawReader = new AliRawReaderRoot(alienName.Data());
   //AliTRDrawStreamBase::SetRawStreamVersion("TB");
   while ( rawReader->NextEvent() ) {
     man->SetRun(rawReader->GetRunNumber());
index 7704225..d6d201e 100755 (executable)
@@ -12,7 +12,7 @@
 
 # SET THE FOLLOWING PARAMETERS IF NEEDED: 
 # ---------------------------------------
-export YEAR=08
+export YEAR=09
 # ---------------------------------------
 
 export RUNNUM=$1
@@ -63,7 +63,6 @@ PROGRAM=aliroot #`cat $tempfile`
 
 # 
 for filename in $CHUNKS; do
-     filename=${filename//\"/} 
      CHUNK=`basename $filename | cut -d "." -f 1,2`
      BEG=`expr index "$CHUNK" .`
      BEG=`expr $BEG - 4`
@@ -74,25 +73,25 @@ for filename in $CHUNKS; do
      rm $RUNNUM"/"*.QA.$RUNNUM.$SUBCHUNK.root 
      rm $RUNNUM"/"QA.$SUBCHUNK.root 
      cd       $RUNNUM"/"$CHUNK
-     $PROGRAM -q $ALICE_ROOT/test/cosmic/rawqa.C\(\"$filename\"\) 2>&1 | tee rawqa.log
-     ls *.QA.$RUNNUM.0.root > $tempfile
-     cd ../
-     QAFILES=`cat $tempfile`
-     for qafile in $QAFILES; do
-        in=$CHUNK/$qafile
-        ou=${qafile/.0./.$SUBCHUNK.}
-        ln -si $in $ou
-     done
-     ln -si $CHUNK/QA.root QA.$SUBCHUNK.root
+$PROGRAM -b <<EOF
+.L $ALICE_ROOT/test/cosmic/rawqa.C+
+rawqa($filename, $RUNNUM)
+EOF
+
+$PROGRAM -b <<EOF
+AliQAManager * qam = AliQAManager::QAManager(AliQAv1::kRECMODE) ; 
+ qam.Merge(atoi(gSystem->Getenv("RUNNUM"))) ;
+EOF
+     rm *QA.$RUNNUM.root
      cd ..
 done
-cd $RUNNUM
+ls */Merged.QA.Data.root > merged.list
+outfile="Merged.QA.Data."$RUNNUM".root"
 $PROGRAM -b <<EOF
- AliQADataMakerSteer qas ; 
- qas.Merge(atoi(gSystem->Getenv("RUNNUM"))) ;
+.L $ALICE_ROOT/test/cosmic/MergeQAMerged.C
+MergeQAMerged("$outfile", "merged.list") ; 
 EOF
-rm -f tempo.txt
-
-$PROGRAM -b -q $ALICE_ROOT/test/cosmic/qasummary.C 
-$PROGRAM -b  $ALICE_ROOT/test/QA/menuQA.C
+rm -f merged.list
+#$PROGRAM -b -q $ALICE_ROOT/test/cosmic/qasummary.C 
+#$PROGRAM -b  $ALICE_ROOT/test/QA/menuQA.C
 cd ..