Classes for reading raw data moved to the RAW module. New on-line MONITORING module...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Sep 2003 15:02:39 +0000 (15:02 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Sep 2003 15:02:39 +0000 (15:02 +0000)
89 files changed:
ALIROOT/binaliroot.pkg
CONTAINERS/AliMemArray.cxx
ITS/AliITSDDLRawData.C
ITS/AliITSRawClusterer.C [deleted file]
ITS/AliITSclustererV2.cxx
ITS/AliITSsimulationSDD.cxx
ITS/ITSLinkDef.h
ITS/libITS.pkg
ITS/oldmacros/AliITSTrackingV2.C [deleted file]
MONITOR/AliMonitor.cxx [new file with mode: 0644]
MONITOR/AliMonitor.h [new file with mode: 0644]
MONITOR/AliMonitorClient.cxx [new file with mode: 0644]
MONITOR/AliMonitorClient.h [new file with mode: 0644]
MONITOR/AliMonitorControl.cxx [new file with mode: 0644]
MONITOR/AliMonitorControl.h [new file with mode: 0644]
MONITOR/AliMonitorDialog.cxx [new file with mode: 0644]
MONITOR/AliMonitorDialog.h [new file with mode: 0644]
MONITOR/AliMonitorHisto.cxx [new file with mode: 0644]
MONITOR/AliMonitorHisto.h [new file with mode: 0644]
MONITOR/AliMonitorITS.cxx [new file with mode: 0644]
MONITOR/AliMonitorITS.h [new file with mode: 0644]
MONITOR/AliMonitorPlot.cxx [new file with mode: 0644]
MONITOR/AliMonitorPlot.h [new file with mode: 0644]
MONITOR/AliMonitorProcess.cxx [new file with mode: 0644]
MONITOR/AliMonitorProcess.h [new file with mode: 0644]
MONITOR/AliMonitorTPC.cxx [new file with mode: 0644]
MONITOR/AliMonitorTPC.h [new file with mode: 0644]
MONITOR/AliMonitorTrend.cxx [new file with mode: 0644]
MONITOR/AliMonitorTrend.h [new file with mode: 0644]
MONITOR/AliMonitorV0s.cxx [new file with mode: 0644]
MONITOR/AliMonitorV0s.h [new file with mode: 0644]
MONITOR/MONITORLinkDef.h [new file with mode: 0644]
MONITOR/client.C [new file with mode: 0644]
MONITOR/copy_s.xpm [new file with mode: 0644]
MONITOR/galice.C [new file with mode: 0644]
MONITOR/libMONITOR.pkg [new file with mode: 0644]
MONITOR/loop_off2.xpm [new file with mode: 0644]
MONITOR/loop_on.xpm [new file with mode: 0644]
MONITOR/monitor.C [new file with mode: 0644]
MONITOR/next_s.xpm [new file with mode: 0644]
MONITOR/previous_s.xpm [new file with mode: 0644]
MONITOR/save_s.xpm [new file with mode: 0644]
RAW/AliITSRawStream.cxx [moved from ITS/AliITSRawStream.cxx with 100% similarity]
RAW/AliITSRawStream.h [moved from ITS/AliITSRawStream.h with 100% similarity]
RAW/AliITSRawStreamSDD.cxx [moved from ITS/AliITSRawStreamSDD.cxx with 100% similarity]
RAW/AliITSRawStreamSDD.h [moved from ITS/AliITSRawStreamSDD.h with 100% similarity]
RAW/AliITSRawStreamSPD.cxx [moved from ITS/AliITSRawStreamSPD.cxx with 100% similarity]
RAW/AliITSRawStreamSPD.h [moved from ITS/AliITSRawStreamSPD.h with 100% similarity]
RAW/AliITSRawStreamSSD.cxx [moved from ITS/AliITSRawStreamSSD.cxx with 100% similarity]
RAW/AliITSRawStreamSSD.h [moved from ITS/AliITSRawStreamSSD.h with 100% similarity]
RAW/AliRawEvent.cxx
RAW/AliRawEvent.h
RAW/AliRawReader.cxx [moved from STEER/AliRawReader.cxx with 100% similarity]
RAW/AliRawReader.h [moved from STEER/AliRawReader.h with 85% similarity]
RAW/AliRawReaderFile.cxx [new file with mode: 0644]
RAW/AliRawReaderFile.h [new file with mode: 0644]
RAW/AliRawReaderRoot.cxx [new file with mode: 0644]
RAW/AliRawReaderRoot.h [new file with mode: 0644]
RAW/AliTPCBuffer160.cxx [moved from TPC/AliTPCBuffer160.cxx with 89% similarity]
RAW/AliTPCBuffer160.h [moved from TPC/AliTPCBuffer160.h with 94% similarity]
RAW/AliTPCCompression.cxx [moved from TPC/AliTPCCompression.cxx with 100% similarity]
RAW/AliTPCCompression.h [moved from TPC/AliTPCCompression.h with 100% similarity]
RAW/AliTPCHuffman.cxx [moved from TPC/AliTPCHuffman.cxx with 100% similarity]
RAW/AliTPCHuffman.h [moved from TPC/AliTPCHuffman.h with 100% similarity]
RAW/AliTPCRawStream.cxx [moved from TPC/AliTPCRawStream.cxx with 100% similarity]
RAW/AliTPCRawStream.h [moved from TPC/AliTPCRawStream.h with 100% similarity]
RAW/LinkDef.h
RAW/Make-macros
RAW/Makefile
RAW/Table0.dat [new file with mode: 0644]
RAW/Table0.txt [new file with mode: 0644]
RAW/Table1.dat [new file with mode: 0644]
RAW/Table1.txt [new file with mode: 0644]
RAW/Table2.dat [new file with mode: 0644]
RAW/Table2.txt [new file with mode: 0644]
RAW/Table3.dat [new file with mode: 0644]
RAW/Table3.txt [new file with mode: 0644]
RAW/Table4.dat [new file with mode: 0644]
RAW/Table4.txt [new file with mode: 0644]
RAW/libRAW.pkg [new file with mode: 0644]
STEER/STEERLinkDef.h
STEER/libSTEER.pkg
TPC/AliSimDigits.h
TPC/AliTPCAltro.C
TPC/AliTPCDDL.C
TPC/AliTPCDDLRawData.C
TPC/AliTPCRawClusterer.C [deleted file]
TPC/TPCLinkDef.h
TPC/libTPC.pkg

index c10fcba..c3e29e5 100644 (file)
@@ -5,7 +5,8 @@ ELIBSDIR:=
 
 ELIBS:= MUON TPC ITS PMD TRD FMD TOF PHOS CRT RICH ZDC VZERO EMCAL STRUCT \
 START EVGEN STEER CONTAINERS pythia6 AliPythia6 pdf THijing hijing TMEVSIM \
-mevsim THbtp HBTP THerwig herwig TEPEMGEN EPEMGEN TPHIC FASTSIM microcern
+mevsim THbtp HBTP THerwig herwig TEPEMGEN EPEMGEN TPHIC FASTSIM microcern \
+RAW MONITOR
 
 # The two variables below are used for the creation of profile target.
 # ARLIBS stands for ARchive LIBrarieS and for each module one wants to profile
index a126497..5a9ba24 100644 (file)
@@ -295,7 +295,7 @@ void AliMemArray::Resize(UInt_t  n)
      return;
   }
   //
-  if (n>fCapacity) Reserve(n);   //reserve automaticaly space if sie >capacity
+  if (n>fCapacity) Reserve(2*n);   //reserve automaticaly space if sie >capacity
   if (fSize>n){ 
     DTORBuffer(Unchecked1DAt(n),fSize-n);
     //memset(&((char*)fCont)[n*fObjectSize], 0, (fSize-n)*fObjectSize);
index 4b1f0c2..db50773 100644 (file)
@@ -1,6 +1,9 @@
 #if !defined(__CINT__)
 #include <Riostream.h>
 #include "AliITSDDLRawData.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliITS.h"
 #endif
 
 /*
@@ -11,69 +14,36 @@ In this way the amplitude value for signal coming from SDD takes only 8 bits and
 */
 //DigitsFile is the input file that contains digits
 
-void AliITSDDLRawData(char* DigitsFile="galiceD.root"){
-#ifdef __NOCOMPILED__
-  if (gClassTable->GetID("AliRun") < 0) {
-    gROOT->LoadMacro("loadlibs.C");
-    loadlibs();
-  }
-  else {
-#endif
-    if(gAlice){
-      delete gAlice;
-      gAlice=0;
-    }
-#ifdef __NOCOMPILED__
-  }
-#endif
-  Int_t eventNumber=0;
+void AliITSDDLRawData(Int_t eventNumber=0){
+
   Int_t spdLDCs=2;
   Int_t sddLDCs=4;
   Int_t ssdLDCs=2;
-  TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(DigitsFile);
-  if (!file){
-    file = new TFile(DigitsFile);
-  }//end if
-  file->ls();
-
-  // Get AliRun object from file
-    if (!gAlice){
-      gAlice = (AliRun*)file->Get("gAlice");
-      if (gAlice)cout<<"AliRun object found on file "<<DigitsFile<<endl;
-      if(!gAlice){
-       cout<<"Can't access AliRun object on file "<<DigitsFile<<endl;
-       cout<<"Macro execution stopped!!!"<<endl;
-       exit(1);
-      }//end if
-    }//end if 
-    gAlice->SetTreeDFileName(DigitsFile);
-    //  Long_t nparticles = gAlice->GetEvent(0);
-  
-    //Int_t nparticles = gAlice->GetEvent(0);
-    // 
-    // ITS
-    AliITS *ITS  = (AliITS*)gAlice->GetModule("ITS");
-    Int_t nmodules;
-    ITS->InitModules(-1,nmodules);
-    cout<<"Number of ITS modules= "<<nmodules<<endl;
-    //cout<<"Filling modules... It takes a while, now. Please be patient"<<endl;
-    //ITS->FillModules(0,0,nmodules," "," ");
-    //cout<<"ITS modules .... DONE!"<<endl;
-    // DIGITS
-    
-    
-    TTree* TD = (TTree*)file->Get("TreeD0");
-    if (TD == 0x0){
-      ::Error("DDLRawData","Can not find tree with ITS digits");
-      return;
-    }//end if
-    ITS->SetTreeAddressD(TD);
-    
-    
-    //TTree *TD = gAlice->TreeD();
+  Int_t eventn=0;
+  const char * inFile_new = "galice.root";
+  AliRunLoader *rl = AliRunLoader::Open(inFile_new,"Event","read");
+  rl->LoadgAlice();
+  Int_t nevents=rl->GetNumberOfEvents();
+  cout<<"Number of Events:"<<nevents<<endl;
+  while (eventNumber<=0 || eventNumber>nevents){
     cout<<"Insert the event number:";
     cin>>eventNumber;
     cout<<endl;
+  }
+  rl->GetEvent(eventNumber-1);
+  AliLoader *itsloader=rl->GetLoader("ITSLoader");
+  itsloader->LoadDigits();
+  TTree *TD=itsloader->TreeD();
+  gAlice=rl->GetAliRun(); 
+  if(!gAlice){
+    cout<<"gAlice is null"<<endl;
+    return;
+  } 
+  AliITS *ITS  = (AliITS*)gAlice->GetDetector("ITS");
+
+  Int_t nmodules;
+  ITS->InitModules(-1,nmodules);
+  ITS->SetTreeAddressD(TD);
 
     AliITSDDLRawData *util=new AliITSDDLRawData();
     //Verbose level
@@ -111,5 +81,6 @@ void AliITSDDLRawData(char* DigitsFile="galiceD.root"){
     timer.Print();
     
     delete util;
+
     return;
 }
diff --git a/ITS/AliITSRawClusterer.C b/ITS/AliITSRawClusterer.C
deleted file mode 100644 (file)
index 57ae274..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#if !defined(__CINT__) || defined(__MAKECINT__)
-#include "AliRun.h"
-#include "AliITS.h"
-#include "AliITSgeom.h"
-#include "AliITSclustererV2.h"
-#include "AliRawReaderRoot.h"
-#include "AliRunLoader.h"
-#include <TFile.h>
-#include <TTree.h>
-#endif
-
-void AliITSRawClusterer(const char* fileNameRawData = "event.root",
-                       Int_t iEvent = 0,
-                       const char* fileNameGalice = "galice.root")
-{
-// To run the cluster finder on raw data a galice.root file is needed.
-// This file has to contain a run loader, a loader for ITS and
-// the geometry of the ITS
-
-  AliRawReaderRoot rawReader(fileNameRawData, iEvent);
-
-  AliRunLoader* runLoader = AliRunLoader::Open(fileNameGalice);
-  runLoader->CdGAFile();
-  AliITSgeom* geom = (AliITSgeom*) gFile->Get("AliITSgeom");
-  AliITSclustererV2 clusterer(geom);
-
-  runLoader->GetLoader("ITSLoader")->LoadRecPoints("recreate");
-  runLoader->SetEventNumber(iEvent);
-
-  clusterer.Digits2Clusters(&rawReader);
-}
index 5469c67..80df738 100644 (file)
@@ -169,6 +169,9 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) {
   delete array;
 
   TClonesArray** clusters = new TClonesArray*[fNModules]; 
+  for (Int_t iModule = 0; iModule < fNModules; iModule++) {
+    clusters[iModule] = NULL;
+  }
   // one TClonesArray per module
 
   rawReader->Reset();
@@ -186,7 +189,7 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) {
   // write all clusters to the tree
   Int_t nClusters = 0;
   for (Int_t iModule = 0; iModule < fNModules; iModule++) {
-    TClonesArray* array = clusters[iModule];
+    array = clusters[iModule];
     if (!array) {
       Error("Digits2Clusters", "data for module %d missing!", iModule);
       array = new TClonesArray("AliITSclusterV2");
@@ -198,6 +201,8 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) {
   }
   itsLoader->WriteRecPoints("OVERWRITE");
 
+  delete[] clusters;
+
   Info("Digits2Clusters", "total number of found clusters in ITS: %d\n", 
        nClusters);
 }
index 25084f7..c2e6d0b 100644 (file)
@@ -809,7 +809,7 @@ void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) {
     Float_t phys;
     Float_t * charges = new Float_t[size];
 
-    if( fResponse->Do10to8() ) signal = Convert8to10( signal ); 
+//    if( fResponse->Do10to8() ) signal = Convert8to10( signal ); 
     digits[0] = i;
     digits[1] = j;
     digits[2] = signal;
index 9e279d0..da737f9 100644 (file)
 
 #pragma link C++ class AliITSLoader+;
 
-#pragma link C++ class AliITSRawStream+;
-#pragma link C++ class AliITSRawStreamSPD+;
-#pragma link C++ class AliITSRawStreamSDD+;
-#pragma link C++ class AliITSRawStreamSSD+;
 //
 //#pragma link C++ class AliACORDEFunction+;
 //#pragma link C++ class AliACORDEMaterial+;
index 8fd64e3..bf643fb 100644 (file)
@@ -43,8 +43,6 @@ SRCS          = AliITS.cxx AliITSv1.cxx AliITSv5.cxx AliITSvSPD02.cxx \
                AliITSRiemannFit.cxx \
                AliITSFDigitizer.cxx \
                AliITSDDLRawData.cxx AliITSpidESD.cxx \
-               AliITSRawStream.cxx AliITSRawStreamSPD.cxx \
-               AliITSRawStreamSDD.cxx AliITSRawStreamSSD.cxx
 #              AliITSBaseGeometry.cxx \
 #              AliITSv11.cxx \
 
@@ -55,5 +53,5 @@ HDRS:=  $(SRCS:.cxx=.h)
 
 DHDR=ITSLinkDef.h
 
-EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC CONTAINERS
+EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC CONTAINERS RAW
 
diff --git a/ITS/oldmacros/AliITSTrackingV2.C b/ITS/oldmacros/AliITSTrackingV2.C
deleted file mode 100644 (file)
index aed8dfe..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-////////////////////////////////////////////////////////////////////////
-//
-// AliITSTrackingV2.C 
-//
-// date: 18.03.2003
-// author: Thomas Kuhr based on AliTPCTracking.C, AliITSFindClustersV2.C
-//         and AliITSFindTracksV2.C
-// version: 1.0
-// description: 
-//      reconstructs of tracks in ITS in the following steps:
-//         ITS cluster finding
-//         ITS track finding
-// input parameters: 
-//        Int_t nEvents      ... nr of events to process
-//        Int_t firstEventNr ... first event number (starts from 0)
-//        char* fileNameHits ... name of file with hits
-//        char* fileNameITSDigits .. name of file with ITS digits
-//        char* fileNameITSTracks .. name of file with TPC tracks
-//        char* fileNameITSClusters .. name of file with ITS clusters (output)
-//        char* fileNameITSTracks .. name of file with ITS tracks (output)
-//
-////////////////////////////////////////////////////////////////////////
-
-
-#if !defined(__CINT__) || defined(__MAKECINT__)
-#include "Riostream.h"
-#include "TFile.h"
-#include "TBenchmark.h"
-#include "AliITS.h"
-#include "AliITSgeom.h"
-#include "AliITSclustererV2.h"
-#include "AliITStrackerV2.h"
-#include "AliRun.h"
-#endif
-
-Int_t gDEBUG = 2;
-
-Int_t AliITSTrackingV2(Int_t nEvents=1, Int_t firstEvent=0,
-                      const char* fileNameHits="galice.root",
-                      const char* fileNameITSDigits="its.digits.root",
-                      const char* fileNameTPCTracks="tpc.tracks.root",
-                      const char* fileNameITSClusters="its.clusters.root",
-                      const char* fileNameITSTracks="its.tracks.root");
-            
-Int_t ITSFindClustersV2(const char* fileNameITSDigits, 
-                       const char* fileNameITSClusters, 
-                       Int_t n, Int_t first);
-Int_t ITSFindTracksV2(const char* fileNameTPCTracks, 
-                     const char* fileNameITSClusters, 
-                     const char* fileNameITSTracks, 
-                     Int_t n, Int_t first);
-
-////////////////////////////////////////////////////////////////////////
-Int_t AliITSTrackingV2(Int_t nEvents, Int_t firstEvent,
-                      const char* fileNameHits,
-                      const char* fileNameITSDigits,
-                      const char* fileNameTPCTracks,
-                      const char* fileNameITSClusters,
-                      const char* fileNameITSTracks) {
-
-  AliTracker::SetFieldFactor(fileNameHits,kFALSE);
-
-// find clusters
-
-  if (fileNameITSDigits && fileNameITSClusters) {
-    if(ITSFindClustersV2(fileNameITSDigits,fileNameITSClusters,nEvents,firstEvent)) {
-      cerr << "ITS clustering failed \n";
-      return 1;
-    }
-  }
-
-// find tracks
-
-  if (fileNameTPCTracks && fileNameITSClusters && fileNameITSTracks) {
-    if(ITSFindTracksV2(fileNameTPCTracks,fileNameITSClusters,fileNameITSTracks,nEvents,firstEvent)) {
-      cerr << "ITS tracking failed \n";
-      return 2;
-    }
-  }
-
-  return 0;
-}
-////////////////////////////////////////////////////////////////////////
-Int_t ITSFindClustersV2(const char* fileNameITSDigits, const char* fileNameITSClusters, Int_t nEvents, Int_t firstEvent) {
-//
-// create ITS clusters, store them in the file fileNameITSClusters
-// gAlice object must be in memory
-
-  const char *name="ITSFindClustersV2";
-  if (gDEBUG>1) cout<<name<<" starts...\n";
-  if (gDEBUG>1) gBenchmark->Start(name);
-
-  TFile *in =TFile::Open(fileNameITSDigits);
-  if (!in->IsOpen()) {
-    cerr<<"Can't open file "<<fileNameITSDigits<<endl; 
-    return 1;
-  }
-  gAlice->SetTreeDFileName(fileNameITSDigits);
-  TFile *out=TFile::Open(fileNameITSClusters,"recreate");
-  if (!out->IsOpen()) {
-    cerr<<"Can't open file "<<fileNameITSClusters<<endl; 
-    return 1;
-  }
-
-  AliITS *ITS  = (AliITS*)gAlice->GetModule("ITS");
-  if (!ITS) { cerr<<"Can't find the ITS !\n"; return 3; }
-
-  AliITSgeom *geom=ITS->GetITSgeom();
-  out->cd();
-  geom->Write();
-  gROOT->cd();
-
-  AliITSclustererV2 clusterer(geom);
-  for (Int_t iEvent = firstEvent; iEvent<firstEvent+nEvents; iEvent++){
-    cout<<"ITSFindClusters: processing event "<<iEvent<<endl;
-    gAlice->GetEvent(iEvent);
-    in->cd();
-    clusterer.SetEvent(iEvent);
-    clusterer.Digits2Clusters(in,out); 
-  }
-
-  out->Close();
-  in->Close();
-
-  if (gDEBUG>1) gBenchmark->Show(name);
-  return 0;
-}
-////////////////////////////////////////////////////////////////////////
-Int_t ITSFindTracksV2(const char* fileNameTPCTracks, 
-                     const char* fileNameITSClusters, 
-                     const char* fileNameITSTracks, 
-                     Int_t nEvents, Int_t first) {
-  Int_t rc=0;
-  const char *name="ITSFindTracksV2";
-  if (gDEBUG>1) cout<<name<<" starts...\n";
-  if (gDEBUG>1) gBenchmark->Start(name);
-
-  TFile *out=TFile::Open(fileNameITSTracks,"recreate");
-  if (!out->IsOpen()) {
-    cerr<<"Can't open file "<<fileNameITSTracks<<endl; 
-    return 1;
-  }
-  TFile *in =TFile::Open(fileNameTPCTracks);
-  if (!in->IsOpen()) {
-    cerr<<"Can't open file "<<fileNameTPCTracks<<endl; 
-    return 1;
-  }
-  TFile *in2 =TFile::Open(fileNameITSClusters);
-  if (!in2->IsOpen()) {
-    cerr<<"Can't open file "<<fileNameITSClusters<<endl; 
-    return 1;
-  }
-
-  AliITSgeom *geom=(AliITSgeom*)in2->Get("AliITSgeom");
-  if (!geom) { cerr<<"can't get ITS geometry !\n"; return 1;}
-
-  AliITStrackerV2 tracker(geom);
-  for (Int_t iEvent=first;iEvent<first+nEvents;iEvent++){
-    cout<<"ITSFindTracks -- event "<<iEvent<<endl;
-    tracker.SetEventNumber(iEvent);
-    rc=tracker.Clusters2Tracks(in,out);
-  }
-
-  in->Close();
-  in2->Close();
-  out->Close();
-
-  if (gDEBUG>1) gBenchmark->Show(name);
-  return rc;
-}
-
diff --git a/MONITOR/AliMonitor.cxx b/MONITOR/AliMonitor.cxx
new file mode 100644 (file)
index 0000000..b6ed4a6
--- /dev/null
@@ -0,0 +1,97 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This is the base class for the creation and filling of monitor           //
+//  histograms.                                                              //
+//  Derived classes have to implement the methods CreateHistos and           //
+//  FillHistos. CreateHistos has to create the monitor histograms, put       //
+//  them into a new folder and add this folder to the given root folder.     //
+//  FillHistos has to fill the data of the current event into the created    //
+//  monitor histograms.                                                      //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitor.h"
+#include <TH1.h>
+#include <TH2.h>
+
+
+ClassImp(AliMonitor) 
+
+
+//_____________________________________________________________________________
+void AliMonitor::CreateBranches(TTree*)
+{
+// add branches to the monitor tree
+// by default no branches are added
+// this method can be overwritten by derived classes
+
+}
+
+
+//_____________________________________________________________________________
+AliMonitorHisto* AliMonitor::CreateHisto1(const char* name, const char* title,
+                             Int_t xBins, Double_t xMin, Double_t xMax,
+                             const char* xTitle, const char* yTitle,
+                             AliMonitorHisto::ENorm norm)
+{
+// create a 1 dimensional monitor histogram and add it to fFolder
+
+  TH1F* histo = new TH1F(name, title, xBins, xMin, xMax);
+  histo->SetMarkerStyle(kFullCircle);
+  histo->GetXaxis()->SetTitle(xTitle);
+  histo->GetYaxis()->SetTitle(yTitle);
+  AliMonitorHisto* result = new AliMonitorHisto(histo, norm);
+  fFolder->Add(result);
+  return result;
+}
+
+//_____________________________________________________________________________
+AliMonitorHisto* AliMonitor::CreateHisto2(const char* name, const char* title,
+                             Int_t xBins, Double_t xMin, Double_t xMax,
+                             Int_t yBins, Double_t yMin, Double_t yMax,
+                             const char* xTitle, const char* yTitle,
+                             const char* zTitle,
+                             AliMonitorHisto::ENorm norm)
+{
+// create a 2 dimensional monitor histogram and add it to fFolder
+
+  TH2F* histo = new TH2F(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
+  histo->SetOption("BOX");
+  histo->GetXaxis()->SetTitle(xTitle);
+  histo->GetYaxis()->SetTitle(yTitle);
+  histo->GetZaxis()->SetTitle(zTitle);
+  AliMonitorHisto* result = new AliMonitorHisto(histo, norm);
+  fFolder->Add(result);
+  return result;
+}
+
+//_____________________________________________________________________________
+AliMonitorTrend* AliMonitor::CreateTrend(const char* name, const char* title,
+                                        const char* label, 
+                                        Double_t min, Double_t max)
+{
+// create a trend monitor histogram and add it to fFolder
+
+  AliMonitorTrend* result = new AliMonitorTrend(name, title, label, min, max);
+  fFolder->Add(result);
+  return result;
+}
+
diff --git a/MONITOR/AliMonitor.h b/MONITOR/AliMonitor.h
new file mode 100644 (file)
index 0000000..e438507
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIMONITOR_H
+#define ALIMONITOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TObject.h>
+#include <TFolder.h>
+#include <TTree.h>
+#include "AliRunLoader.h"
+#include "AliRawReader.h"
+#include "AliMonitorHisto.h"
+#include "AliMonitorTrend.h"
+
+
+class AliMonitor : public TObject {
+public:
+  virtual void     CreateHistos(TFolder* folder) = 0;
+  virtual void     CreateBranches(TTree* tree);
+  virtual void     FillHistos(AliRunLoader* runLoader, 
+                             AliRawReader* rawReader) = 0;
+
+protected:
+  TFolder*         fFolder;    // sub folder for monitor histograms
+
+  AliMonitorHisto* CreateHisto1(const char* name, const char* title,
+                               Int_t xBins, Double_t xMin, Double_t xMax,
+                               const char* xTitle, const char* yTitle,
+                               AliMonitorHisto::ENorm norm);
+  AliMonitorHisto* CreateHisto2(const char* name, const char* title,
+                               Int_t xBins, Double_t xMin, Double_t xMax,
+                               Int_t yBins, Double_t yMin, Double_t yMax,
+                               const char* xTitle, const char* yTitle,
+                               const char* zTitle,
+                               AliMonitorHisto::ENorm norm);
+  AliMonitorTrend* CreateTrend(const char* name, const char* title,
+                              const char* label, 
+                              Double_t min = 0, Double_t max = 0);
+
+  ClassDef(AliMonitor, 0)   // base class for the creation and filling of monitor histograms
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorClient.cxx b/MONITOR/AliMonitorClient.cxx
new file mode 100644 (file)
index 0000000..f350d78
--- /dev/null
@@ -0,0 +1,2101 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class receives monitor histograms from a monitor process and        //
+//  provides a graphical user interface for browsing and analysing the       //
+//  monitor histograms.                                                      //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorClient.h"
+#include "AliMonitorDialog.h"
+#include "AliMonitorProcess.h"
+#include <TGMsgBox.h>
+#include <TGFileDialog.h>
+#include <TSystem.h>
+#include <TMessage.h>
+#include <TCanvas.h>
+#include <TApplication.h>
+#include <TStyle.h>
+
+
+ClassImp(AliMonitorClient) 
+
+
+const char* AliMonitorClient::fgSettingsFileName = ".AliMonitorClient";
+
+//_____________________________________________________________________________
+class AliMonitorStringDlg : public AliMonitorDialog {
+
+public:
+  AliMonitorStringDlg(TString& string, TGFrame* main, const char* title,
+                     const char* label);
+  virtual ~AliMonitorStringDlg();
+
+  virtual void       OnOkClicked();
+
+private:
+  TGLayoutHints*     fStringLayout;
+  TGLabel*           fStringLabel;
+  TGTextEntry*       fStringEntry;
+
+  TString&           fString;
+};
+
+
+//_____________________________________________________________________________
+AliMonitorStringDlg::AliMonitorStringDlg(TString& string, TGFrame* main, 
+                                        const char* title, 
+                                        const char* label) :
+  AliMonitorDialog(main, 300, 80), fString(string)
+{
+// create a dialog for connecting to a monitor process
+
+  fStringLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2);
+  fStringLabel = new TGLabel(fFrame, label);
+  fFrame->AddFrame(fStringLabel, fStringLayout);
+  fStringEntry = new TGTextEntry(fFrame, string.Data());
+  fStringEntry->Resize(100, fStringEntry->GetDefaultHeight());
+  fFrame->AddFrame(fStringEntry, fStringLayout);
+
+  fString = "";
+
+  fMain->SetWindowName(title);
+  fMain->MapSubwindows();
+  fMain->Layout();
+  gClient->WaitFor(fMain);
+}
+
+//_____________________________________________________________________________
+AliMonitorStringDlg::~AliMonitorStringDlg()
+{
+// clean up
+
+  delete fStringLabel;
+  delete fStringLayout;
+  delete fStringEntry;
+}
+
+//_____________________________________________________________________________
+void AliMonitorStringDlg::OnOkClicked()
+{
+  fString = fStringEntry->GetText();
+}
+
+
+
+//_____________________________________________________________________________
+class AliMonitorNumberDlg : public AliMonitorDialog {
+
+public:
+  AliMonitorNumberDlg(Float_t& value, TGFrame* main, const char* title,
+                     const char* label, Float_t min);
+  virtual ~AliMonitorNumberDlg();
+
+  virtual void       OnOkClicked();
+
+private:
+  TGLayoutHints*     fNumberLayout;
+  TGLabel*           fNumberLabel;
+  TGNumberEntry*     fNumberEntry;
+
+  Float_t&           fNumber;
+};
+
+
+//_____________________________________________________________________________
+AliMonitorNumberDlg::AliMonitorNumberDlg(Float_t& value, TGFrame* main, 
+                                        const char* title, const char* label, 
+                                        Float_t min) :
+  AliMonitorDialog(main, 250, 80), fNumber(value)
+{
+// create a dialog for getting a number
+
+  fNumberLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2);
+  fNumberLabel = new TGLabel(fFrame, label);
+  fFrame->AddFrame(fNumberLabel, fNumberLayout);
+  fNumberEntry = new TGNumberEntry(fFrame, value, 4, -1,
+                                  TGNumberFormat::kNESRealOne);
+  fNumberEntry->SetLimits(TGNumberFormat::kNELLimitMin, min, 0);
+  fFrame->AddFrame(fNumberEntry, fNumberLayout);
+
+  fNumber = -1;
+
+  fMain->SetWindowName(title);
+  fMain->MapSubwindows();
+  fMain->Layout();
+  gClient->WaitFor(fMain);
+}
+
+//_____________________________________________________________________________
+AliMonitorNumberDlg::~AliMonitorNumberDlg()
+{
+// clean up
+
+  delete fNumberLabel;
+  delete fNumberLayout;
+  delete fNumberEntry;
+}
+
+//_____________________________________________________________________________
+void AliMonitorNumberDlg::OnOkClicked()
+{
+  fNumber = fNumberEntry->GetNumber();
+}
+
+
+
+// constants for menu entries
+enum {kMenuFileConnect, kMenuFileDisconnect, kMenuFileOpen, kMenuFileExit,
+      kMenuViewToolBar, kMenuViewTree, kMenuViewDescription, 
+      kMenuViewReference, kMenuViewStatistics,
+      kMenuFavAdd, kMenuFavDelete, 
+      kMenuFavLoad, kMenuFavSave,  kMenuFavSaveAs, kMenuFavSaveOnExit,
+      kMenuRefLoad, kMenuRefThreshold, 
+      kMenuRefTakeCurrent, kMenuRefSave, kMenuRefSaveAs,
+      kMenuOptLoop, kMenuOptPrint, 
+      kMenuOptSave, kMenuOptSaveOnExit,
+      kMenuHelpDoc, kMenuHelpAbout
+};
+
+//_____________________________________________________________________________
+AliMonitorClient::AliMonitorClient():
+  TGMainFrame(gClient->GetRoot(), 500, 300)
+{
+// initialize the monitoring client window
+
+  // *** menu bar ***
+  fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+                                      0, 0, 1, 1);
+  fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
+  fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
+
+  // File menu
+  fMenuFile = new TGPopupMenu(gClient->GetRoot());
+  fMenuFile->AddEntry("&Connect...", kMenuFileConnect);
+  fMenuFile->AddEntry("&Disconnect...", kMenuFileDisconnect);
+  fMenuFile->HideEntry(kMenuFileDisconnect);
+  fMenuFile->AddEntry("&Open...", kMenuFileOpen);
+  fMenuFile->AddSeparator();
+  fMenuFile->AddEntry("E&xit", kMenuFileExit);
+  fMenuFile->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                    "OnMenuActivated(Int_t)");
+
+  // View menu
+  fMenuView = new TGPopupMenu(gClient->GetRoot());
+  fMenuView->AddEntry("Tool&bar", kMenuViewToolBar);
+  fMenuView->CheckEntry(kMenuViewToolBar);
+  fMenuView->AddEntry("&Tree", kMenuViewTree);
+  fMenuView->CheckEntry(kMenuViewTree);
+  fMenuView->AddEntry("&Description", kMenuViewDescription);
+  fMenuView->CheckEntry(kMenuViewDescription);
+  fMenuView->AddSeparator();
+  fMenuView->AddEntry("&Reference", kMenuViewReference);
+  fMenuView->CheckEntry(kMenuViewReference);
+  AliMonitorHisto::SetDrawRef(kTRUE);
+  fMenuView->AddEntry("&Statistics", kMenuViewStatistics);
+  fMenuView->CheckEntry(kMenuViewStatistics);
+  gStyle->SetOptStat(1110);
+  fMenuView->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                    "OnMenuActivated(Int_t)");
+
+  // Favorites menu
+  fMenuFavorites = new TGPopupMenu(gClient->GetRoot());
+  fMenuFavorites->AddEntry("&Add", kMenuFavAdd);
+  fMenuFavorites->DisableEntry(kMenuFavAdd);
+  fMenuFavorites->AddEntry("&Delete", kMenuFavDelete);
+  fMenuFavorites->DisableEntry(kMenuFavDelete);
+  fMenuFavorites->AddSeparator();
+  fMenuFavorites->AddEntry("&Load...", kMenuFavLoad);
+  fMenuFavorites->AddEntry("&Save", kMenuFavSave);
+  fMenuFavorites->DisableEntry(kMenuFavSave);
+  fMenuFavorites->AddEntry("&Save As...", kMenuFavSaveAs);
+  fMenuFavorites->DisableEntry(kMenuFavSaveAs);
+  fMenuFavorites->AddEntry("Save On &Exit", kMenuFavSaveOnExit);
+  fMenuFavorites->CheckEntry(kMenuFavSaveOnExit);
+  fMenuFavorites->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                         "OnMenuActivated(Int_t)");
+
+  // Reference menu
+  fMenuReference = new TGPopupMenu(gClient->GetRoot());
+  fMenuReference->AddEntry("&Load...", kMenuRefLoad);
+  fMenuReference->AddEntry("&Threshold...", kMenuRefThreshold);
+  fMenuReference->AddSeparator();
+  fMenuReference->AddEntry("Take &Current", kMenuRefTakeCurrent);
+  fMenuReference->DisableEntry(kMenuRefTakeCurrent);
+  fMenuReference->AddEntry("&Save", kMenuRefSave);
+  fMenuReference->DisableEntry(kMenuRefSave);
+  fMenuReference->AddEntry("Save &As...", kMenuRefSaveAs);
+  fMenuReference->DisableEntry(kMenuRefSaveAs);
+  fMenuReference->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                         "OnMenuActivated(Int_t)");
+
+  // Options menu
+  fMenuOptions = new TGPopupMenu(gClient->GetRoot());
+  fMenuOptions->AddEntry("&Loop Interval...", kMenuOptLoop);
+  fMenuOptions->AddEntry("&Print Command...", kMenuOptPrint);
+  fMenuOptions->AddSeparator();
+  fMenuOptions->AddEntry("&Save Settings", kMenuOptSave);
+  fMenuOptions->AddEntry("Save Settings on &Exit", kMenuOptSaveOnExit);
+  fMenuOptions->CheckEntry(kMenuOptSaveOnExit);
+  fMenuOptions->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                       "OnMenuActivated(Int_t)");
+
+  // Help menu
+  fMenuHelp = new TGPopupMenu(gClient->GetRoot());
+  fMenuHelp->AddEntry("&Documentation...", kMenuHelpDoc);
+  fMenuHelp->AddEntry("A&bout...", kMenuHelpAbout);
+  fMenuHelp->Connect("Activated(Int_t)", "AliMonitorClient", this,
+                    "OnMenuActivated(Int_t)");
+
+  // menu bar
+  fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
+  fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&View", fMenuView, fMenuBarItemLayout);
+  fMenuBar->AddPopup("F&avorites", fMenuFavorites, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&Reference", fMenuReference, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&Options", fMenuOptions, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
+
+  AddFrame(fMenuBar, fMenuBarLayout);
+
+
+  // *** tool bar ***
+  fToolBarLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 2, 2);
+  fToolBarSep = new TGHorizontal3DLine(this);
+  AddFrame(fToolBarSep, fToolBarLayout);
+  fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
+  AddFrame(fToolBar, fToolBarLayout);
+
+  // event number field
+  fEventNumberLayout = new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 
+                                        10, 2, 10, 5);
+  fEventNumber = new TGNumberEntry(fToolBar, 1, 4, 10, 
+                                  TGNumberFormat::kNESInteger);
+  fEventNumber->SetLimits(TGNumberFormat::kNELLimitMin, 1, 0);
+  fToolBar->AddFrame(fEventNumber, fEventNumberLayout);
+  fEventNumber->GetNumberEntry()->Connect("ReturnPressed()", 
+                                         "AliMonitorClient", this,
+                                         "OnEventNumberChanged()");
+  fEventNumber->GetButtonUp()->Connect("Clicked()", 
+                                      "AliMonitorClient", this,
+                                      "OnEventNumberChanged()");
+  fEventNumber->GetButtonDown()->Connect("Clicked()", 
+                                        "AliMonitorClient", this,
+                                        "OnEventNumberChanged()");
+
+  // draw event button
+  ToolBarData_t eventButton = {"h1_s.xpm", "draw event histogram", 
+                              kTRUE, 11, NULL};
+  fToolBar->AddButton(this, &eventButton, 5);
+  fEventButton = eventButton.fButton;
+  fEventButton->Connect("Pressed()", "AliMonitorClient", this,
+                       "OnEventButtonPressed()");
+
+  // draw sum button
+  ToolBarData_t sumButton = {"h2_s.xpm", "draw sum histogram", 
+                            kTRUE, 12, NULL};
+  fToolBar->AddButton(this, &sumButton, 5);
+  fSumButton = sumButton.fButton;
+  fSumButton->Connect("Pressed()", "AliMonitorClient", this,
+                     "OnSumButtonPressed()");
+
+  // draw run button
+  ToolBarData_t runButton = {"h3_s.xpm", "draw run histogram", 
+                            kTRUE, 13, NULL};
+  fToolBar->AddButton(this, &runButton, 5);
+  fRunButton = runButton.fButton;
+  fRunButton->SetDown(kTRUE);
+  fRunButton->Connect("Pressed()", "AliMonitorClient", this,
+                     "OnRunButtonPressed()");
+
+  // loop button
+  char fileName[256];
+  sprintf(fileName, "%s/MONITOR/loop_on.xpm", gSystem->Getenv("ALICE_ROOT"));
+  ToolBarData_t loopButton = {fileName, "loop over histograms", 
+                             kFALSE, 21, NULL};
+  fToolBar->AddButton(this, &loopButton, 25);
+  fLoopButton = loopButton.fButton;
+  fLoopButton->Connect("Clicked()", "AliMonitorClient", this,
+                      "OnLoopButtonClicked()");
+  fLoopOnPicture = gClient->GetPicture(fileName);
+  sprintf(fileName, "%s/MONITOR/loop_off2.xpm", gSystem->Getenv("ALICE_ROOT"));
+  fLoopOffPicture = gClient->GetPicture(fileName);
+
+  // previous button
+  sprintf(fileName, "%s/MONITOR/previous_s.xpm", 
+         gSystem->Getenv("ALICE_ROOT"));
+  ToolBarData_t previousButton = {fileName, "go to previous histogram", 
+                                 kFALSE, 22, NULL};
+  fToolBar->AddButton(this, &previousButton, 5);
+  fPreviousButton = previousButton.fButton;
+  fPreviousButton->Connect("Clicked()", "AliMonitorClient", this,
+                          "OnPreviousButtonClicked()");
+
+  // next button
+  sprintf(fileName, "%s/MONITOR/next_s.xpm", gSystem->Getenv("ALICE_ROOT"));
+  ToolBarData_t nextButton = {fileName, "go to next histogram", 
+                             kFALSE, 23, NULL};
+  fToolBar->AddButton(this, &nextButton, 5);
+  fNextButton = nextButton.fButton;
+  fNextButton->Connect("Clicked()", "AliMonitorClient", this,
+                      "OnNextButtonClicked()");
+
+  // copy button
+  sprintf(fileName, "%s/MONITOR/copy_s.xpm", gSystem->Getenv("ALICE_ROOT"));
+  ToolBarData_t copyButton = {fileName, 
+                             "copy the current histogram to a new canvas", 
+                             kFALSE, 31, NULL};
+  fToolBar->AddButton(this, &copyButton, 25);
+  fCopyButton = copyButton.fButton;
+  fCopyButton->Connect("Clicked()", "AliMonitorClient", this,
+                      "OnCopyButtonClicked()");
+
+  // save button
+  sprintf(fileName, "%s/MONITOR/save_s.xpm", gSystem->Getenv("ALICE_ROOT"));
+  ToolBarData_t saveButton = {fileName, "save the current histogram", 
+                             kFALSE, 32, NULL};
+  fToolBar->AddButton(this, &saveButton, 5);
+  fSaveButton = saveButton.fButton;
+  fSaveButton->Connect("Clicked()", "AliMonitorClient", this,
+                      "OnSaveButtonClicked()");
+
+  // print button
+  ToolBarData_t printButton = {"printer_s.xpm", "print the current histogram", 
+                            kFALSE, 33, NULL};
+  fToolBar->AddButton(this, &printButton, 5);
+  fPrintButton = printButton.fButton;
+  fPrintButton->Connect("Clicked()", "AliMonitorClient", this,
+                       "OnPrintButtonClicked()");
+
+  // *** frames ***
+  fBottomLayout = new TGLayoutHints(kLHintsExpandX | kLHintsBottom);
+  fLeftLayout = new TGLayoutHints(kLHintsLeft | kLHintsExpandY);
+  fExpandLayout = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
+
+  fVerticalFrame = new TGVerticalFrame(this, 10, 10);
+  AddFrame(fVerticalFrame, fExpandLayout);
+
+  fHorizontalFrame = new TGHorizontalFrame(fVerticalFrame, 10, 10);
+  fVerticalFrame->AddFrame(fHorizontalFrame, fExpandLayout);
+
+  // tree frame
+  fTreeFrame = new TGCompositeFrame(fHorizontalFrame, 10, 10, 
+                                   kSunkenFrame | kFixedWidth);
+  fHorizontalFrame->AddFrame(fTreeFrame, fLeftLayout);
+  fTreeCanvas = new TGCanvas(fTreeFrame, 10, 10);
+  fTreeFrame->AddFrame(fTreeCanvas, fExpandLayout);
+  fTree = new TGListTree(fTreeCanvas, kHorizontalFrame);
+  fTreeCanvas->AddFrame(fTree, fExpandLayout);
+  fTree->Connect("Clicked(TGListTreeItem*,Int_t)", "AliMonitorClient",
+                this, "OnTreeClicked(TGListTreeItem*,Int_t)");
+  fTree->Connect("ReturnPressed(TGListTreeItem*)", "AliMonitorClient",
+                this, "OnTreeReturnPressed(TGListTreeItem*)");
+
+  // tree items
+  fAllItem = fTree->AddItem(NULL, "All");
+  fFavoritesItem = fTree->AddItem(NULL, "Favorites");
+  fComparisonItem = fTree->AddItem(NULL, "Comparison");
+  fHistoPicture = fClient->GetPicture("h1_t.xpm"); 
+  fTreeFrame->Resize(100, fTreeFrame->GetDefaultHeight());
+
+  // tree / histogram splitter
+  fTreeSplitter = new TGVSplitter(fHorizontalFrame, 4);
+  fTreeSplitter->SetFrame(fTreeFrame, kTRUE);
+  fHorizontalFrame->AddFrame(fTreeSplitter, fLeftLayout);
+
+  // histogram frame
+  fDrawFrame = new TGCompositeFrame(fHorizontalFrame, 10, 10, kSunkenFrame);
+  fHorizontalFrame->AddFrame(fDrawFrame, fExpandLayout);
+  fDrawCanvas = new TRootEmbeddedCanvas("current monitor histogram", 
+                                       fDrawFrame, 10, 10);
+  fDrawFrame->AddFrame(fDrawCanvas, fExpandLayout);
+
+  // description frame
+  fDescriptionFrame = new TGCompositeFrame(fVerticalFrame, 10, 60, 
+                                          kSunkenFrame | kFixedHeight);
+  fVerticalFrame->AddFrame(fDescriptionFrame, fBottomLayout);
+  fDescription = new TGTextView(fDescriptionFrame, 10, 60, "");
+  fDescriptionFrame->AddFrame(fDescription, fExpandLayout);
+
+  // histogram / description splitter
+  fDescriptionSplitter = new TGHSplitter(fVerticalFrame, 4, 4);
+  fVerticalFrame->AddFrame(fDescriptionSplitter, fBottomLayout);
+  fDescriptionSplitter->SetFrame(fDescriptionFrame, kFALSE);
+
+  // main window
+  Connect("CloseWindow()", "AliMonitorClient", this, "CloseWindow()");
+  SetWindowName("Monitor Client");
+  SetWMSize(GetWidth(), GetHeight());
+  Move(100, 100);
+  SetWMPosition(100, 100);
+  MapSubwindows();
+  Layout();
+  MapWindow();
+
+
+  // default data members
+  fServerName = "localhost";
+  fSocket = NULL;
+  fSocketHandler = NULL;
+
+  fFolder = CreateTopFolder();
+
+  fCurrentItem = NULL;
+  fBaseItem = NULL;
+  fLoopTimer = NULL;
+  fLoopInterval = 1000;
+
+  fFavoritesFileName = "";
+
+  fReferenceFileName = "";
+  fReference = CreateTopFolder();
+  AliMonitorHisto::SetThreshold(5.0);
+
+  fPrintCommand = "gv";
+
+  // load saved settings
+  LoadSettings();
+}
+
+//_____________________________________________________________________________
+AliMonitorClient::~AliMonitorClient()
+{
+// clean up
+
+  delete fMenuBarLayout;
+  delete fMenuBarItemLayout;
+  delete fMenuBarHelpLayout;
+  delete fMenuFile;
+  delete fMenuView;
+  delete fMenuFavorites;
+  delete fMenuReference;
+  delete fMenuOptions;
+  delete fMenuHelp;
+  delete fMenuBar;
+
+  delete fEventNumberLayout;
+  delete fEventNumber;
+  delete fToolBarLayout;
+  delete fToolBarSep;
+  delete fToolBar;
+
+  delete fBottomLayout;
+  delete fLeftLayout;
+  delete fExpandLayout;
+
+  delete fTree;
+  delete fTreeCanvas;
+  delete fTreeFrame;
+  delete fTreeSplitter;
+
+  delete fDrawCanvas;
+  delete fDrawFrame;
+
+  delete fDescriptionSplitter;
+  delete fDescription;
+  delete fDescriptionFrame;
+
+  delete fVerticalFrame;
+  delete fHorizontalFrame;
+
+  if (fSocket) {
+    fSocket->Close();
+    delete fSocket;
+    delete fSocketHandler;
+  }
+
+  if (fFolder) delete fFolder;
+
+  if (fLoopTimer) {
+    fLoopTimer->TurnOff();
+    delete fLoopTimer;
+  }
+
+  if (fReference) delete fReference;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::CloseWindow()
+{
+// terminate the application when the window is closed
+
+  if (fMenuFavorites->IsEntryChecked(kMenuFavSaveOnExit)) {
+    SaveFavorites();
+  }
+  if (fMenuOptions->IsEntryChecked(kMenuOptSaveOnExit)) {
+    SaveSettings();
+  }
+  gApplication->Terminate(0);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnNewData()
+{
+// called when data has arrived from the monitor server
+
+  if (CheckForNewData()) UpdateAll();
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnMenuActivated(Int_t id)
+{
+// called when a menu item was selected
+
+  switch (id) {
+
+  case kMenuFileConnect: {
+    if (ConnectToServer()) UpdateAll();
+    break;
+  }
+
+  case kMenuFileDisconnect: {
+    DisconnectFromServer();
+    break;
+  }
+
+  case kMenuFileOpen: {
+    if (OpenFile()) UpdateAll();
+    break;
+  }
+
+  case kMenuFileExit: {
+    CloseWindow();
+    break;
+  }
+
+  case kMenuViewToolBar: {
+    ViewToolBar(!fMenuView->IsEntryChecked(kMenuViewToolBar));
+    break;
+  }
+
+  case kMenuViewTree: {
+    ViewTree(!fMenuView->IsEntryChecked(kMenuViewTree));
+    break;
+  }
+
+  case kMenuViewDescription: {
+    ViewDescription(!fMenuView->IsEntryChecked(kMenuViewDescription));
+    break;
+  }
+
+  case kMenuViewReference: {
+    ViewReference(!fMenuView->IsEntryChecked(kMenuViewReference));
+    UpdateHisto();
+    break;
+  }
+
+  case kMenuViewStatistics: {
+    ViewStatistics(!fMenuView->IsEntryChecked(kMenuViewStatistics));
+    UpdateHisto();
+    break;
+  }
+
+  case kMenuFavAdd: {
+    if (AddFavorite()) {
+      fMenuFavorites->EnableEntry(kMenuFavSave);
+      fMenuFavorites->EnableEntry(kMenuFavSaveAs);
+    }
+    break;
+  }
+
+  case kMenuFavDelete: {
+    if (DeleteFavorite()) {
+      UpdateHisto();
+      UpdateDescription();
+      fMenuFavorites->DisableEntry(kMenuFavDelete);
+      fMenuFavorites->EnableEntry(kMenuFavSave);
+      fMenuFavorites->EnableEntry(kMenuFavSaveAs);
+    }
+    break;
+  }
+
+  case kMenuFavLoad: {
+    if (LoadFavorites()) {
+      UpdateHisto();
+      UpdateDescription();
+      fMenuFavorites->DisableEntry(kMenuFavSave);
+      fMenuFavorites->EnableEntry(kMenuFavSaveAs);
+    }
+    break;
+  }
+
+  case kMenuFavSave: {
+    if (SaveFavorites()) {
+      fMenuFavorites->DisableEntry(kMenuFavSave);
+    }
+    break;
+  }
+
+  case kMenuFavSaveAs: {
+    if (SaveFavoritesAs()) {
+      fMenuFavorites->DisableEntry(kMenuFavSave);
+    }
+    break;
+  }
+
+  case kMenuFavSaveOnExit: {
+    if (fMenuFavorites->IsEntryChecked(kMenuFavSaveOnExit)) {
+      fMenuFavorites->UnCheckEntry(kMenuFavSaveOnExit);
+    } else {
+      fMenuFavorites->CheckEntry(kMenuFavSaveOnExit);
+    }
+    break;
+  }
+
+  case kMenuRefLoad: {
+    if (LoadReference()) {
+      SetReference();
+      UpdateHisto();
+      UpdateComparisonTree();
+      fMenuReference->EnableEntry(kMenuRefSaveAs);
+    }
+    break;
+  }
+
+  case kMenuRefThreshold: {
+    Float_t threshold = AliMonitorHisto::GetThreshold();
+    new AliMonitorNumberDlg(threshold, this, 
+                           "Comparison with Reference Histograms",
+                           "threshold for comparison:", 0.);
+    if (threshold < 0) break;
+
+    AliMonitorHisto::SetThreshold(threshold);
+    UpdateHisto();
+    UpdateComparisonTree();
+    break;
+  }
+
+  case kMenuRefTakeCurrent: {
+    if (TakeCurrentReference()) {
+      UpdateHisto();
+      UpdateComparisonTree();
+      fMenuReference->EnableEntry(kMenuRefSave);
+      fMenuReference->EnableEntry(kMenuRefSaveAs);
+    }
+    break;
+  }
+
+  case kMenuRefSave: {
+    if (SaveReference()) {
+      fMenuReference->DisableEntry(kMenuRefSave);
+    }
+    break;
+  }
+
+  case kMenuRefSaveAs: {
+    if (SaveReferenceAs()) {
+      fMenuReference->DisableEntry(kMenuRefSave);
+    }
+    break;
+  }
+
+  case kMenuOptLoop: {
+    Float_t interval = fLoopInterval * 0.001;
+    new AliMonitorNumberDlg(interval, this, "Loop Interval",
+                           "loop time in seconds:", 0.1);
+    if (interval < 0) break;
+
+    fLoopInterval = Int_t(1000 * interval);
+    if (fLoopTimer) {
+      fLoopTimer->Stop();
+      fLoopTimer->Start(fLoopInterval);
+    }
+    break;
+  }
+
+  case kMenuOptPrint: {
+    TString printCommand(fPrintCommand);
+    new AliMonitorStringDlg(printCommand, this, "Print Command",
+                           "shell command for printing:");
+    if (printCommand.IsNull()) break;
+
+    fPrintCommand = printCommand;
+    break;
+  }
+
+  case kMenuOptSaveOnExit: {
+    if (fMenuOptions->IsEntryChecked(kMenuOptSaveOnExit)) {
+      fMenuOptions->UnCheckEntry(kMenuOptSaveOnExit);
+    } else {
+      fMenuOptions->CheckEntry(kMenuOptSaveOnExit);
+    }
+    break;
+  }
+
+  case kMenuOptSave: {
+    SaveSettings();
+    break;
+  }
+
+  case kMenuHelpAbout: {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, 
+                "About", "AliMonitorClient $Revision$", 
+                kMBIconAsterisk, kMBOk, &result);
+    break;
+  }
+
+  default: {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, 
+                "AliMonitorClient", "not yet implemented", 
+                kMBIconExclamation, kMBOk, &result);
+  }
+  }
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnEventNumberChanged()
+{
+// called when the event number in the tool button was changed
+
+  if (!fRunButton->IsDown()) {
+    UpdateHisto();
+    UpdateComparisonTree();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnEventButtonPressed()
+{
+// called when the event tool button was clicked
+
+  fSumButton->SetDown(kFALSE);
+  fRunButton->SetDown(kFALSE);
+  UpdateHisto();
+  UpdateComparisonTree();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnSumButtonPressed()
+{
+// called when the sum tool button was clicked
+
+  fEventButton->SetDown(kFALSE);
+  fRunButton->SetDown(kFALSE);
+  UpdateHisto();
+  UpdateComparisonTree();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnRunButtonPressed()
+{
+// called when the run tool button was clicked
+
+  fEventButton->SetDown(kFALSE);
+  fSumButton->SetDown(kFALSE);
+  UpdateHisto();
+  UpdateComparisonTree();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnLoopButtonClicked()
+{
+// called when the loop tool button was clicked
+
+  // if loop is not running, start the loop timer and 
+  // set the stop loop button picture
+  if (!fLoopTimer) {  
+    if (!fBaseItem) {
+      if (!GetBaseItem()) return;
+    }
+    fLoopTimer = new TTimer(fLoopInterval);
+    fLoopTimer->Connect("Timeout()", "AliMonitorClient", this, 
+                       "OnLoopTimer()");
+    ((TGPictureButton*) fLoopButton)->SetPicture(fLoopOffPicture);
+    fLoopTimer->TurnOn();
+
+  // if the loop is running, stop it
+  } else {
+    StopLoop();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnPreviousButtonClicked()
+{
+// called when the previous tool button was clicked
+
+  if (!fBaseItem) {
+    if (!GetBaseItem()) return;
+  }
+  StopLoop();
+  GoToPreviousItem();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnNextButtonClicked()
+{
+// called when the next tool button was clicked
+
+  if (!fBaseItem) {
+    if (!GetBaseItem()) return;
+  }
+  StopLoop();
+  GoToNextItem();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnCopyButtonClicked()
+{
+// called when the copy tool button was clicked
+
+  fDrawCanvas->GetCanvas()->DrawClone();
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnSaveButtonClicked()
+{
+// called when the save tool button was clicked
+
+  // display a file save dialog
+  static TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"PostScript",   "*.ps",
+                                   "Encapsulated PostScript", "*.eps",
+                                   "SVG",          "*.svg",
+                                   "Gif files",    "*.gif",
+                                   "Macro files",  "*.C",
+                                   "ROOT files", "*.root", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fileInfo);
+  if (!fileInfo.fFilename) return;
+
+  fDrawCanvas->GetCanvas()->SaveAs(fileInfo.fFilename);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnPrintButtonClicked()
+{
+// called when the print tool button was clicked
+
+  // save the canvas to a temporary postscript file
+  char fileName[L_tmpnam+4];
+  sprintf(fileName, "%s.ps", tmpnam(NULL));
+  fDrawCanvas->GetCanvas()->SaveAs(fileName);
+
+  // call the print command and delete the temporary file
+  char command[256];
+  sprintf(command, "%s %s", fPrintCommand.Data(), fileName);
+  gSystem->Exec(command);
+  gSystem->Unlink(fileName);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnTreeClicked(TGListTreeItem* item, Int_t)
+{
+// called when an item in the histogram tree is clicked
+
+  OnTreeReturnPressed(item);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnTreeReturnPressed(TGListTreeItem* item)
+{
+// called when return is pressed at an item in the histogram tree
+
+  fCurrentItem = item;
+  fBaseItem = NULL;
+  StopLoop();
+  UpdateItem(kFALSE);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::OnLoopTimer()
+{
+// called by the loop timer when a new histogram should be displayed
+
+  if (!fBaseItem) {
+    if (!GetBaseItem()) return;
+  }
+  GoToNextItem();
+}
+
+
+//_____________________________________________________________________________
+TFolder* AliMonitorClient::CreateTopFolder()
+{
+// create a top folder for monitor histograms
+
+  return (new TFolder("Monitor", "monitor histograms"));
+}
+
+//_____________________________________________________________________________
+AliMonitorHisto* AliMonitorClient::GetHisto(const char* folderName, 
+                                           const char* histoName)
+{
+// find the monitor histogram with the given name in the given folder
+
+  TGListTreeItem* folderItem = fTree->FindChildByName(fAllItem, folderName);
+  if (folderItem) {
+    TGListTreeItem* histoItem = fTree->FindChildByName(folderItem, histoName);
+    if (histoItem) return (AliMonitorHisto*) histoItem->GetUserData();
+  }
+  return NULL;
+}
+
+//_____________________________________________________________________________
+TGListTreeItem* AliMonitorClient::GetItem(TGListTreeItem* base, 
+                                         const char* folderName, 
+                                         const char* histoName, 
+                                         Bool_t create)
+{
+// find the tree item with given name in the given folder
+// if create is kTRUE it is created if it is not there
+
+  // get or create the folder
+  TGListTreeItem* folderItem = fTree->FindChildByName(base, folderName);
+  if (!folderItem) {
+    if (!create) return NULL;
+    folderItem = fTree->AddItem(base, folderName);
+  }
+
+  // get or create the histo
+  TGListTreeItem* histoItem = fTree->FindChildByName(folderItem, histoName);
+  if (!histoItem) {
+    if (!create) return NULL;
+    histoItem = fTree->AddItem(folderItem, histoName,
+                              fClient->GetPicture("h1_t.xpm"),
+                              fClient->GetPicture("h1_t.xpm"));
+  }
+  return histoItem;
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::ConnectToServer()
+{
+// display the dialog for the server name or ip and try to connect to it
+
+  TString serverName(fServerName);
+
+  do {
+    // ask for the server name or ip
+    new AliMonitorStringDlg(serverName, this, "Connection to monitor process",
+                           "monitor server name or ip:");
+    if (serverName.IsNull()) return kFALSE;
+
+    // connect to the server
+    fSocket = new TSocket(serverName, AliMonitorProcess::kgPort);
+    if (!fSocket || !fSocket->IsValid() || (fSocket->Send("client") <= 0)) {
+      if (fSocket) delete fSocket;
+      fSocket = NULL;
+      Int_t result;
+      new TGMsgBox(gClient->GetRoot(), this, "Connect",
+                  "connection to monitor server failed", 
+                  kMBIconExclamation, kMBOk, &result);
+
+    } else {  // set up a handler for notifying when new data is there
+      fServerName = serverName;
+      fSocketHandler = new TFileHandler(fSocket->GetDescriptor(), 
+                                       TFileHandler::kRead);
+      fSocketHandler->Connect("Notified()", "AliMonitorClient", this,
+                             "OnNewData()");
+      fSocketHandler->Add();
+      TInetAddress adr = fSocket->GetInetAddress();
+      Info("ConnectToServer", "connected to server:\n %s (%s), port %d\n",
+          adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+      fMenuFile->HideEntry(kMenuFileConnect);
+      fMenuFile->HideEntry(kMenuFileOpen);
+      fMenuFile->EnableEntry(kMenuFileDisconnect);
+    };
+
+  } while (!fSocket);
+
+  // delete the old monitor histos
+  if (fFolder) delete fFolder;
+  fFolder = CreateTopFolder();
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::DisconnectFromServer()
+{
+// disconnect from the monitor server
+
+  // are-you-really-sure-dialog
+  Int_t result;
+  new TGMsgBox(gClient->GetRoot(), this, "Disconnect",
+              "Do you really want to disconnect from the monitor server?", 
+              kMBIconQuestion, kMBYes | kMBNo, &result);
+  if (result == kMBNo) return;
+
+  // disconnect from the server
+  fSocket->Close();
+  delete fSocket;
+  fSocket = NULL;
+  fMenuFile->HideEntry(kMenuFileDisconnect);
+  fMenuFile->EnableEntry(kMenuFileConnect);
+  fMenuFile->EnableEntry(kMenuFileOpen);
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::OpenFile()
+{
+// open a file with monitor histograms
+
+  // display a file open dialog
+  static TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"ROOT files", "*.root", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fileInfo);
+  if (!fileInfo.fFilename) return kFALSE;
+
+  // open the root file
+  TFile* file = TFile::Open(fileInfo.fFilename);
+  if (!file || !file->IsOpen()) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Open",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    return kFALSE;
+  }
+
+  // get the folder with the monitor histograms
+  TFolder* folder = (TFolder*) file->Get("Monitor");
+  if (!folder || !folder->InheritsFrom(TFolder::Class())) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Open",
+                "The file does not contain monitor histograms.", 
+                kMBIconExclamation, kMBOk, &result);
+    file->Close();
+    delete file;
+    return kFALSE;
+  }
+
+  // replace the old folder with the new one
+  file->Clear();
+  file->Close();
+  delete file;
+  if (fFolder) delete fFolder;
+  fFolder = folder;
+  return kTRUE;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::ViewToolBar(Bool_t visible)
+{
+// en- or disable the view of the tool bar
+
+  if (visible) {
+    ShowFrame(fToolBarSep);
+    ShowFrame(fToolBar);
+    fMenuView->CheckEntry(kMenuViewToolBar);
+  } else {
+    HideFrame(fToolBarSep);
+    HideFrame(fToolBar);
+    fMenuView->UnCheckEntry(kMenuViewToolBar);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::ViewTree(Bool_t visible)
+{
+// en- or disable the view of the tree
+
+  if (visible) {
+    fHorizontalFrame->ShowFrame(fTreeFrame);
+    fHorizontalFrame->ShowFrame(fTreeSplitter);
+    fMenuView->CheckEntry(kMenuViewTree);
+  } else {
+    fHorizontalFrame->HideFrame(fTreeFrame);
+    fHorizontalFrame->HideFrame(fTreeSplitter);
+    fMenuView->UnCheckEntry(kMenuViewTree);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::ViewDescription(Bool_t visible)
+{
+// en- or disable the view of the histogram description
+
+  if (visible) {
+    fVerticalFrame->ShowFrame(fDescriptionFrame);
+    fVerticalFrame->ShowFrame(fDescriptionSplitter);
+    fMenuView->CheckEntry(kMenuViewDescription);
+  } else {
+    fVerticalFrame->HideFrame(fDescriptionFrame);
+    fVerticalFrame->HideFrame(fDescriptionSplitter);
+    fMenuView->UnCheckEntry(kMenuViewDescription);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::ViewReference(Bool_t visible)
+{
+// en- or disable the view of the reference histos
+
+  if (visible) {
+    AliMonitorHisto::SetDrawRef(kTRUE);
+    fMenuView->CheckEntry(kMenuViewReference);
+  } else {
+    AliMonitorHisto::SetDrawRef(kFALSE);
+    fMenuView->UnCheckEntry(kMenuViewReference);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::ViewStatistics(Bool_t visible)
+{
+// en- or disable the view of the statistics box
+
+  if (visible) {
+    gStyle->SetOptStat(1110);
+    fMenuView->CheckEntry(kMenuViewStatistics);
+  } else {
+    gStyle->SetOptStat(0);
+    fMenuView->UnCheckEntry(kMenuViewStatistics);
+  }
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::AddFavorite()
+{
+// add the current histogram or folder to the list of favorites
+
+  if (!fCurrentItem || !fCurrentItem->GetParent()) return kFALSE;
+
+  // get the folder item
+  TGListTreeItem* folderItem = fCurrentItem->GetParent();
+  if (fCurrentItem->GetFirstChild()) folderItem = fCurrentItem;
+
+  Bool_t result = kFALSE;
+
+  // add a folder
+  if (fCurrentItem->GetFirstChild()) {
+    TGListTreeItem* histoItem = fCurrentItem->GetFirstChild();
+    while (histoItem) {
+      if (!GetItem(fFavoritesItem, folderItem->GetText(), 
+                  histoItem->GetText(), kFALSE)) result = kTRUE;
+      TGListTreeItem* item = GetItem(fFavoritesItem, folderItem->GetText(), 
+                                    histoItem->GetText(), kTRUE);
+      item->SetUserData(histoItem->GetUserData());
+      histoItem = histoItem->GetNextSibling();
+    }
+
+  // add a histo
+  } else {
+    if (!GetItem(fFavoritesItem, folderItem->GetText(), 
+                fCurrentItem->GetText(), kFALSE)) result = kTRUE;
+    TGListTreeItem* item = GetItem(fFavoritesItem, folderItem->GetText(), 
+                                  fCurrentItem->GetText(), kTRUE);
+    item->SetUserData(fCurrentItem->GetUserData());
+  }
+
+  if (result) gClient->NeedRedraw(fTree);
+  return result;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::DeleteFavorite()
+{
+// delete the current histogram or folder from the list of favorites
+
+  // check that the current item is a favorites histo or folder
+  if (!fCurrentItem || !fCurrentItem->GetParent()) return kFALSE;
+  TGListTreeItem* base = fCurrentItem;
+  while (base->GetParent()) base = base->GetParent();
+  if (base != fFavoritesItem) return kFALSE;
+
+  // delete it
+  TGListTreeItem* parent = fCurrentItem->GetParent();
+  fTree->DeleteItem(fCurrentItem);
+  fCurrentItem = NULL;
+
+  // delete the parent folder if it is empty now
+  if (parent->GetParent() != NULL) {
+    if (!parent->GetFirstChild()) fTree->DeleteItem(parent);
+  }
+
+  gClient->NeedRedraw(fTree);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::LoadFavorites(Bool_t dialog)
+{
+// load the list of favorites from a file
+
+  // display a file open dialog
+  TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"Favorites files", "*.fav", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  fileInfo.fIniDir = StrDup(".");
+  fileInfo.fFilename = StrDup(fFavoritesFileName.Data());
+  if (dialog) {
+    new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fileInfo);
+    if (!fileInfo.fFilename) return kFALSE;
+  }
+
+  // open the text file
+  FILE* file = fopen(fileInfo.fFilename, "rt");
+  if (!file) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Load Favorites",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    return kFALSE;
+  }
+
+  // delete the old favorites
+  TGListTreeItem* favFolderItem = fFavoritesItem->GetFirstChild();
+  while (favFolderItem) {
+    TGListTreeItem* deleteItem = favFolderItem;
+    favFolderItem = favFolderItem->GetNextSibling();
+    fTree->DeleteItem(deleteItem);
+  }
+
+  // scan the text file and add the favorites histos
+  char buffer[256];
+  while (!feof(file)) {
+    if (fgets(buffer, 255, file) == NULL) break;
+    char* item = buffer;
+    char* folder = strsep(&item, "/");
+    if (item[strlen(item)-1] == '\n') item[strlen(item)-1] = 0;
+    if (!folder || !item) continue;
+
+    AliMonitorHisto* histo = GetHisto(folder, item);
+    TGListTreeItem* histoItem = GetItem(fFavoritesItem, folder, item, kTRUE);
+    histoItem->SetUserData(histo);
+  }
+  fclose(file);
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::SaveFavorites()
+{
+// save the list of favorites in a file with the name fFavoritesFileName
+
+  // if no file name is given use a default one
+  if (fFavoritesFileName.IsNull()) {
+    char* fileName = gSystem->ConcatFileName(gSystem->HomeDirectory(), 
+                                            "AliMonitorClient.fav");
+    fFavoritesFileName = fileName;
+    free(fileName);
+  }
+
+  // open the text file
+  FILE* file = fopen(fFavoritesFileName.Data(), "wt");
+  if (!file) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Save Favorites",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    return kFALSE;
+  }
+
+  // loop over folders
+  TGListTreeItem* folderItem = fFavoritesItem->GetFirstChild();
+  while (folderItem) {
+
+    // loop over histos
+    TGListTreeItem* histoItem = folderItem->GetFirstChild();
+    while (histoItem) {
+
+      // write the favorites
+      if (fprintf(file, "%s/%s\n", folderItem->GetText(), 
+                 histoItem->GetText()) <= 0) {
+       Int_t result;
+       new TGMsgBox(gClient->GetRoot(), this, "Save Favorites",
+                    "An error occured while sving the favorites.", 
+                    kMBIconExclamation, kMBOk, &result);
+       fclose(file);
+       return kFALSE;
+      }
+      histoItem = histoItem->GetNextSibling();
+    }
+
+    folderItem = folderItem->GetNextSibling();
+  }
+
+  fclose(file);
+  Info("SaveFavorites", "favorites saved to file %s", 
+       fFavoritesFileName.Data());
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::SaveFavoritesAs()
+{
+// ask for a file name and save the favorites to this file
+
+  // display a save file dialog
+  TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"Favorites files", "*.fav", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  fileInfo.fIniDir = StrDup(".");
+  fileInfo.fFilename = StrDup(fFavoritesFileName.Data());
+  new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fileInfo);
+  if (!fileInfo.fFilename) return kFALSE;
+
+  // save the favorites
+  fFavoritesFileName = fileInfo.fFilename;
+  return SaveFavorites();
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::LoadReference(Bool_t dialog)
+{
+// load reference histograms from a file
+
+  // display a file open dialog
+  TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"ROOT files", "*.root", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  fileInfo.fIniDir = StrDup(".");
+  fileInfo.fFilename = StrDup(fReferenceFileName.Data());
+  if (dialog) {
+    new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fileInfo);
+    if (!fileInfo.fFilename) return kFALSE;
+  }
+
+  // open the root file
+  TFile* file = TFile::Open(fileInfo.fFilename);
+  if (!file || !file->IsOpen()) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Load Reference",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    return kFALSE;
+  }
+
+  // get the folder with the monitor histograms
+  TFolder* folder = (TFolder*) file->Get("Monitor");
+  if (!folder || !folder->InheritsFrom(TFolder::Class())) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Load Reference",
+                "The file does not contain monitor histograms.", 
+                kMBIconExclamation, kMBOk, &result);
+    file->Close();
+    delete file;
+    return kFALSE;
+  }
+
+  // replace the old reference folder with the new one
+  fReferenceFileName = fileInfo.fFilename;
+  file->Clear();
+  file->Close();
+  delete file;
+  if (fReference) delete fReference;
+  fReference = folder;
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::SetReference()
+{
+// set the reference histograms for all monitor histograms
+
+  // loop over folder
+  TIterator* iFolder = fFolder->GetListOfFolders()->MakeIterator();
+  while (TFolder* folder = (TFolder*) iFolder->Next()) {
+    TFolder* refFolder = (TFolder*) fReference->FindObject(folder->GetName());
+    if (!refFolder) continue;
+
+    // loop over histos
+    TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+    while (AliMonitorHisto* histo = (AliMonitorHisto*) iHisto->Next()) {
+      AliMonitorHisto* refHisto = 
+       (AliMonitorHisto*) refFolder->FindObject(histo->GetName());
+      if (!refHisto) continue;
+      histo->SetReference(refHisto);
+    }
+    delete iHisto;
+
+  }
+  delete iFolder;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::TakeCurrentReference()
+{
+// take the current monitor histogram or folder as reference
+
+  // check that a histo or folder is selected
+  if (!fCurrentItem) return kFALSE;
+  AliMonitorHisto* histo = (AliMonitorHisto*) fCurrentItem->GetUserData();
+  if (!histo && !fCurrentItem->GetFirstChild()) return kFALSE;
+
+  // confirm-dialog
+  char message[256];
+  if (histo) {
+    sprintf(message, "Do you want to take the current histogram %s/%s "
+           "as reference histogram?", fCurrentItem->GetParent()->GetText(),
+           histo->GetName());
+  } else {
+    sprintf(message, "Do you want to take all current histogram of the "
+           "folder %s as reference histogram?", fCurrentItem->GetText());
+  }
+  Int_t result;
+  new TGMsgBox(gClient->GetRoot(), this, "Take Current as Reference",
+              message, kMBIconQuestion, kMBYes | kMBNo, &result);
+  if (result != kMBYes) return kFALSE;
+
+  // take ...
+  if (histo) {   // ... a histo
+    TakeReferenceHisto(fCurrentItem->GetParent()->GetText(), histo);
+  } else if (fCurrentItem->GetParent()) {  // ... a folder
+    TakeReferenceFolder(fCurrentItem);
+  } else {  // ... a top folder
+    TGListTreeItem* folderItem = fCurrentItem->GetFirstChild();
+    while (folderItem) {
+      TakeReferenceFolder(folderItem);
+      folderItem = folderItem->GetNextSibling();
+    }
+  }
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::TakeReferenceHisto(const char* folderName,
+                                         AliMonitorHisto* histo)
+{
+// take the given monitor histogram as reference histogram
+
+  // get or create the reference folder
+  TFolder* refFolder = (TFolder*) fReference->FindObject(folderName);
+  if (!refFolder) refFolder = fReference->AddFolder(folderName, folderName);
+
+  // delete the old reference histo
+  AliMonitorHisto* refHisto = 
+    (AliMonitorHisto*) refFolder->FindObject(histo->GetName());
+  if (refHisto) {
+    refFolder->Remove(refHisto);
+    delete refHisto;
+  }
+
+  // add the new one and use it as reference
+  refFolder->Add(new AliMonitorHisto(*histo));
+  histo->SetReference(histo);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::TakeReferenceFolder(TGListTreeItem* item)
+{
+// take all monitor histogram in the given folder as reference histograms
+
+  // loop over histos
+  TGListTreeItem* histoItem = item->GetFirstChild();
+  while (histoItem) {
+    AliMonitorHisto* histo = (AliMonitorHisto*) histoItem->GetUserData();
+    if (histo) TakeReferenceHisto(item->GetText(), histo);
+    histoItem = histoItem->GetNextSibling();
+  }
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::SaveReference()
+{
+// save the reference histograms to the file with name fReferenceFileName
+
+  // if no file name is given use a default one
+  if (fFavoritesFileName.IsNull()) {
+    char* fileName = gSystem->ConcatFileName(gSystem->HomeDirectory(), 
+                                            "AliMonitorClientRef.root");
+    fFavoritesFileName = fileName;
+    free(fileName);
+  }
+
+  // open the root file
+  TFile* file = TFile::Open(fReferenceFileName, "RECREATE");
+  if (!file || !file->IsOpen()) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Save Reference",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    if (file) delete file;
+    return kFALSE;
+  }
+
+  // write the reference folder
+  fReference->Write();
+  file->Close();
+  delete file;
+  Info("SaveReference", "reference histograms saved to file %s", 
+       fReferenceFileName.Data());
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::SaveReferenceAs()
+{
+// ask for a file name and save the reference histograms to this file
+
+  // display a save file dialog
+  TGFileInfo fileInfo;
+  static const char* fileTypes[] = {"ROOT files", "*.root", 
+                                   "All files",  "*", 
+                                   NULL,         NULL};
+  fileInfo.fFileTypes = fileTypes;
+  fileInfo.fIniDir = StrDup(".");
+  fileInfo.fFilename = StrDup(fReferenceFileName.Data());
+  new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fileInfo);
+  if (!fileInfo.fFilename) return kFALSE;
+
+  // save the references
+  fReferenceFileName = fileInfo.fFilename;
+  return SaveReference();
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorClient::StopLoop()
+{
+// stop looping over histograms
+
+  // stop the timer and reset the loop button picture
+  if (fLoopTimer) {
+    fLoopTimer->TurnOff();
+    delete fLoopTimer;
+    fLoopTimer = NULL;
+    ((TGPictureButton*) fLoopButton)->SetPicture(fLoopOnPicture);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::LoadSettings()
+{
+// load setting from the file with the name fgSettingFileName and apply them
+
+  // open the text file
+  char* fileName = gSystem->ConcatFileName(gSystem->HomeDirectory(), 
+                                          fgSettingsFileName);
+  FILE* file = fopen(fileName, "rt");
+  if (!file) {
+    free(fileName);
+    return;
+  }
+
+  // scan the text file and apply the settings
+  char buffer[256];
+  while (!feof(file)) {
+    if (fgets(buffer, 255, file) == NULL) break;
+    char* value = buffer;
+    char* token = strsep(&value, "=");
+    if (!token || !value) continue;
+    if (value[strlen(value)-1] == '\n') value[strlen(value)-1] = 0;
+
+    if (strcmp(token, "ServerName") == 0) {
+      fServerName = value;
+
+    } else if (strcmp(token, "ViewToolBar") == 0) {
+      ViewToolBar(strcmp(value, "0") != 0);
+    } else if (strcmp(token, "ViewTree") == 0) {
+      ViewTree(strcmp(value, "0") != 0);
+    } else if (strcmp(token, "ViewDescription") == 0) {
+      ViewDescription(strcmp(value, "0") != 0);
+    } else if (strcmp(token, "ViewReference") == 0) {
+      ViewReference(strcmp(value, "0") != 0);
+    } else if (strcmp(token, "ViewStatistics") == 0) {
+      ViewStatistics(strcmp(value, "0") != 0);
+
+    } else if (strcmp(token, "FavoritesFileName") == 0) {
+      fFavoritesFileName = value;
+      LoadFavorites(kFALSE);
+    } else if (strcmp(token, "FavoritesSaveOnExit") == 0) {
+      if (strcmp(value, "0") != 0) {
+       fMenuFavorites->CheckEntry(kMenuFavSaveOnExit);
+      } else {
+       fMenuFavorites->UnCheckEntry(kMenuFavSaveOnExit);
+      }
+
+    } else if (strcmp(token, "ReferenceFileName") == 0) {
+      fReferenceFileName = value;
+      LoadReference(kFALSE);
+    } else if (strcmp(token, "ReferenceThreshold") == 0) {
+      AliMonitorHisto::SetThreshold(atof(value));
+
+    } else if (strcmp(token, "LoopInterval") == 0) {
+      fLoopInterval = atoi(value);
+    } else if (strcmp(token, "PrintCommand") == 0) {
+      fPrintCommand = value;
+    } else if (strcmp(token, "SettingsSaveOnExit") == 0) {
+      if (strcmp(value, "0") != 0) {
+       fMenuOptions->CheckEntry(kMenuOptSaveOnExit);
+      } else {
+       fMenuOptions->UnCheckEntry(kMenuOptSaveOnExit);
+      }
+    }
+  }
+
+  fclose(file);
+  Info("LoadSettings", "settings from file %s applied", fileName);
+  free(fileName);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::SaveSettings()
+{
+// save setting to the file with the name fgSettingFileName
+
+  // open the text file
+  char* fileName = gSystem->ConcatFileName(gSystem->HomeDirectory(), 
+                                          fgSettingsFileName);
+  FILE* file = fopen(fileName, "wt");
+  if (!file) {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), this, "Save Settings",
+                "The file could not be opened.", 
+                kMBIconExclamation, kMBOk, &result);
+    free(fileName);
+    return;
+  }
+
+  // write the settings
+  fprintf(file, "ServerName=%s\n", fServerName.Data());
+
+  fprintf(file, "ViewToolBar=%d\n", 
+         fMenuView->IsEntryChecked(kMenuViewToolBar));
+  fprintf(file, "ViewTree=%d\n", 
+         fMenuView->IsEntryChecked(kMenuViewTree));
+  fprintf(file, "ViewDescription=%d\n", 
+         fMenuView->IsEntryChecked(kMenuViewDescription));
+  fprintf(file, "ViewReference=%d\n", 
+         fMenuView->IsEntryChecked(kMenuViewReference));
+  fprintf(file, "ViewStatistics=%d\n", 
+         fMenuView->IsEntryChecked(kMenuViewStatistics));
+
+  if (!fFavoritesFileName.IsNull()) {
+    fprintf(file, "FavoritesFileName=%s\n", fFavoritesFileName.Data());
+  }
+  fprintf(file, "FavoritesSaveOnExit=%d\n", 
+         fMenuFavorites->IsEntryChecked(kMenuFavSaveOnExit));
+
+  if (!fReferenceFileName.IsNull()) {
+    fprintf(file, "ReferenceFileName=%s\n", fReferenceFileName.Data());
+  }
+  fprintf(file, "ReferenceThreshold=%.1f\n", AliMonitorHisto::GetThreshold());
+
+  fprintf(file, "LoopInterval=%d\n", fLoopInterval);
+  fprintf(file, "PrintCommand=%s\n", fPrintCommand.Data());
+  fprintf(file, "SettingsSaveOnExit=%d\n", 
+         fMenuOptions->IsEntryChecked(kMenuOptSaveOnExit));
+
+  fclose(file);
+  Info("SaveSettings", "settings saved to file %s", fileName);
+  free(fileName);
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::GetBaseItem()
+{
+// get the base item for looping over histograms
+
+  if (fCurrentItem) {
+    // the base item is a folder
+    fBaseItem = fCurrentItem;
+    // if the current item is a histo, its parent is the base folder
+    if (fBaseItem->GetParent() && fBaseItem->GetParent()->GetParent()) {
+      fBaseItem = fBaseItem->GetParent();
+    }
+
+  } else {  // if no item is selected the All item is the base item
+    fBaseItem = fAllItem;
+    fCurrentItem = fBaseItem->GetFirstChild();
+    if (!fCurrentItem) return kFALSE;
+  }
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::GoToNextItem()
+{
+// go to the next histogram in the loop
+
+  if (!fCurrentItem) return kFALSE;
+  if (!fBaseItem || !fBaseItem->GetFirstChild()) return kFALSE;
+
+  // remember the start item to avoid an endless loop
+  TGListTreeItem* startItem = fCurrentItem;
+
+  do {
+    // folder -> first child
+    if (fCurrentItem->GetFirstChild()) {
+      fCurrentItem = fCurrentItem->GetFirstChild();
+
+    // histo -> next histo
+    } else if ((fCurrentItem != fBaseItem) &&
+              (fCurrentItem->GetNextSibling())) {
+      fCurrentItem = fCurrentItem->GetNextSibling();
+
+    // last histo in folder -> next folder
+    } else if ((fCurrentItem != fBaseItem) &&
+              (fCurrentItem->GetParent() != fBaseItem) &&
+              fCurrentItem->GetParent()->GetNextSibling()) {
+      fCurrentItem = fCurrentItem->GetParent()->GetNextSibling();
+
+    // last histo in last folder -> first folder
+    } else {
+      fCurrentItem = fBaseItem->GetFirstChild();
+    }
+
+    // abort if no next item found
+    if (fCurrentItem == startItem) return kFALSE;
+
+  // end loop if an item with a monitor histo was found
+  } while (!fCurrentItem->GetUserData());
+
+  UpdateItem(kTRUE);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::GoToPreviousItem()
+{
+// go to the previous histogram in the loop
+
+  if (!fCurrentItem) return kFALSE;
+  if (!fBaseItem || !fBaseItem->GetFirstChild()) return kFALSE;
+
+  // remember the start item to avoid an endless loop
+  TGListTreeItem* startItem = fCurrentItem;
+
+  do {
+    // folder -> last child
+    if (fCurrentItem->GetFirstChild()) {
+      fCurrentItem = fCurrentItem->GetFirstChild();
+      while (fCurrentItem->GetNextSibling()) {
+       fCurrentItem = fCurrentItem->GetNextSibling();
+      }
+
+    // histo -> previous histo
+    } else if ((fCurrentItem != fBaseItem) && 
+              (fCurrentItem->GetPrevSibling())) {
+      fCurrentItem = fCurrentItem->GetPrevSibling();
+
+    // first histo in folder -> previous folder
+    } else if ((fCurrentItem != fBaseItem) && 
+              (fCurrentItem->GetParent() != fBaseItem) &&
+              fCurrentItem->GetParent()->GetPrevSibling()) {
+      fCurrentItem = fCurrentItem->GetParent()->GetPrevSibling();
+
+    // first histo in first folder -> last folder
+    } else {
+      fCurrentItem = fBaseItem->GetFirstChild();
+      while (fCurrentItem->GetNextSibling()) {
+       fCurrentItem = fCurrentItem->GetNextSibling();
+      }
+    }
+
+    // abort if no next item found
+    if (fCurrentItem == startItem) return kFALSE;
+
+  // end loop if an item with a monitor histo was found
+  } while (!fCurrentItem->GetUserData());
+
+  UpdateItem(kTRUE);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateItem(Bool_t highlight)
+{
+// update the displayed tree for currently selected item
+
+  if (highlight) {  // highlight the selected item and open its parent folders
+    TGListTreeItem* parent = fCurrentItem->GetParent();
+    while (parent) {
+      if (!parent->IsOpen()) fTree->OpenItem(parent);
+      parent = parent->GetParent();
+    }
+    fTree->HighlightItem(fCurrentItem);
+    gClient->NeedRedraw(fTree);
+  }
+
+  // update displayed histo
+  UpdateDescription();
+  UpdateHisto();
+
+  // en- or disable the "Reference/Take Current" menu item
+  TGListTreeItem* base = fCurrentItem;
+  while (base->GetParent()) base = base->GetParent();
+  if (base != fComparisonItem) {
+    fMenuReference->EnableEntry(kMenuRefTakeCurrent);
+  } else {
+    fMenuReference->DisableEntry(kMenuRefTakeCurrent);
+  }
+
+  // en- or disable the "Favorites/Add" and "Favorites/Delete" menu items
+  if (fCurrentItem->GetParent()) {
+    if (base == fFavoritesItem) {
+      fMenuFavorites->DisableEntry(kMenuFavAdd);
+      fMenuFavorites->EnableEntry(kMenuFavDelete);
+    } else {
+      fMenuFavorites->EnableEntry(kMenuFavAdd);
+      fMenuFavorites->DisableEntry(kMenuFavDelete);
+    }
+  } else {
+    fMenuFavorites->DisableEntry(kMenuFavAdd);
+    fMenuFavorites->DisableEntry(kMenuFavDelete);
+  }
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorClient::CheckForNewData()
+{
+// check whether the monitor process server sent new data
+
+  // receive a message from the server
+  if (!fSocket || !fSocket->IsValid()) return kFALSE;
+  TMessage* message = NULL;
+  Int_t result = fSocket->Recv(message);
+
+  // replace the old folder of monitor histos with the new one
+  if (result > 0) {
+    if (fFolder) delete fFolder;
+    fFolder = (TFolder*) message->ReadObject(message->GetClass());
+    return kTRUE;
+  }
+
+  return kFALSE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::ClearItems(TGListTreeItem* base)
+{
+// remove the references to the histograms from all subitems of the 
+// given tree item
+
+  // loop over folders
+  TGListTreeItem* folderItem = base->GetFirstChild();
+  while (folderItem) {
+
+    // loop over histos
+    TGListTreeItem* histoItem = folderItem->GetFirstChild();
+    while (histoItem) {
+      histoItem->SetUserData(NULL);
+      histoItem = histoItem->GetNextSibling();
+    }
+
+    folderItem = folderItem->GetNextSibling();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::CleanUpTree(TGListTreeItem* base)
+{
+// remove items without monitor histograms and 
+// folders without monitor histograms
+
+  // loop over folders
+  TGListTreeItem* folderItem = base->GetFirstChild();
+  while (folderItem) {
+
+    // loop over histos
+    TGListTreeItem* histoItem = folderItem->GetFirstChild();
+    while (histoItem) {
+      TGListTreeItem* deleteItem = NULL;
+      if (!histoItem->GetUserData()) deleteItem = histoItem;
+      histoItem = histoItem->GetNextSibling();
+      if (fCurrentItem == deleteItem) fCurrentItem = NULL;
+      if (deleteItem) fTree->DeleteItem(deleteItem);
+    }
+
+    folderItem = folderItem->GetNextSibling();
+  }
+
+  // loop over folders and remove empty folders
+  folderItem = base->GetFirstChild();
+  while (folderItem) {
+    TGListTreeItem* deleteItem = NULL;
+    if (!folderItem->GetFirstChild()) deleteItem = folderItem;
+    folderItem = folderItem->GetNextSibling();
+    if (fCurrentItem == deleteItem) fCurrentItem = NULL;
+    if (deleteItem) fTree->DeleteItem(deleteItem);
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateTree()
+{
+// update the tree of monitor histograms
+
+  // delete references to old monitor histograms
+  ClearItems(fAllItem);
+
+  // loop over folder
+  TIterator* iFolder = fFolder->GetListOfFolders()->MakeIterator();
+  while (TFolder* folder = (TFolder*) iFolder->Next()) {
+
+    // loop over histos
+    TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+    while (AliMonitorHisto* histo = (AliMonitorHisto*) iHisto->Next()) {
+
+      // add new monitor histograms
+      TGListTreeItem* histoItem = GetItem(fAllItem, folder->GetName(),
+                                         histo->GetName(), kTRUE);
+      histoItem->SetUserData(histo);
+    }
+    delete iHisto;
+
+  }
+  delete iFolder;
+
+  // remove items and folders without monitor histograms
+  CleanUpTree(fAllItem);
+
+  gClient->NeedRedraw(fTree);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateFavoritesTree()
+{
+// update the tree of favorite monitor histograms
+
+  // loop over folders
+  TGListTreeItem* folderItem = fFavoritesItem->GetFirstChild();
+  while (folderItem) {
+
+    // loop over histos
+    TGListTreeItem* histoItem = folderItem->GetFirstChild();
+    while (histoItem) {
+
+      // set monitor histo
+      histoItem->SetUserData(GetHisto(folderItem->GetText(), 
+                                     histoItem->GetText()));
+      histoItem = histoItem->GetNextSibling();
+    }
+
+    folderItem = folderItem->GetNextSibling();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateComparisonTree()
+{
+// update the tree of monitor histograms with significant deviation
+// from the reference histograms
+
+  if (!fFolder) return;
+
+  // delete references to old monitor histograms
+  ClearItems(fComparisonItem);
+
+  // add monitor histograms where the comparison returns a deviation
+  // loop over folders
+  TIterator* iFolder = fFolder->GetListOfFolders()->MakeIterator();
+  while (TFolder* folder = (TFolder*) iFolder->Next()) {
+
+    // loop over histos
+    TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+    while (AliMonitorHisto* histo = (AliMonitorHisto*) iHisto->Next()) {
+
+      // compare the histo to its reference
+      Bool_t comparison = kTRUE;
+      if (fEventButton->IsDown()) {
+       comparison = histo->CompareEvent(fEventNumber->GetIntNumber());
+      } else if (fSumButton->IsDown()) {
+       comparison = histo->CompareSum(fEventNumber->GetIntNumber());
+      } else {
+       comparison = histo->CompareRun();
+      }
+
+      // add it to the comparison tree in case of a bad comparison result
+      if (!comparison) {
+       TGListTreeItem* histoItem = GetItem(fComparisonItem, folder->GetName(),
+                                           histo->GetName(), kTRUE);
+       histoItem->SetUserData(histo);
+      }
+    }
+    delete iHisto;
+
+  }
+  delete iFolder;
+
+  // remove items and folders without monitor histograms
+  CleanUpTree(fComparisonItem);
+
+  gClient->NeedRedraw(fTree);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateDescription()
+{
+// update the description of the current monitor histogram
+
+  fDescription->Clear();
+  AliMonitorHisto* histo = NULL;
+  if (fCurrentItem) histo = (AliMonitorHisto*) fCurrentItem->GetUserData();
+  if (histo) fDescription->LoadBuffer(histo->GetDescription().Data());
+
+  gClient->NeedRedraw(fDescription);
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateHisto()
+{
+// update the current monitor histogram
+
+  // clear the canvas if no histo is selected
+  AliMonitorHisto* histo = NULL;
+  if (fCurrentItem) histo = (AliMonitorHisto*) fCurrentItem->GetUserData();
+  if (!histo) {
+    fDrawCanvas->GetCanvas()->Clear();
+    fDrawCanvas->GetCanvas()->Update();
+    return;
+  }
+
+  // draw the histo for a single event or summed over several events or a run
+  fDrawCanvas->GetCanvas()->cd();
+  if (fEventButton->IsDown()) {
+    histo->DrawEvent(fEventNumber->GetIntNumber());
+  } else if (fSumButton->IsDown()) {
+    histo->DrawSum(fEventNumber->GetIntNumber());
+  } else {
+    histo->DrawRun();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorClient::UpdateAll()
+{
+// update the trees, the histogram and the description
+
+  UpdateTree();
+  UpdateFavoritesTree();
+  UpdateComparisonTree();
+  UpdateDescription();
+  UpdateHisto();
+}
+
diff --git a/MONITOR/AliMonitorClient.h b/MONITOR/AliMonitorClient.h
new file mode 100644 (file)
index 0000000..ddeae72
--- /dev/null
@@ -0,0 +1,195 @@
+#ifndef ALIMONITORCLIENT_H
+#define ALIMONITORCLIENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TGFrame.h>
+#include <TGMenu.h>
+#include <TGButton.h>
+#include <TGLabel.h>
+#include <TGTextEntry.h>
+#include <TGToolBar.h>
+#include <TG3DLine.h>
+#include <TGNumberEntry.h>
+#include <TGCanvas.h>
+#include <TGSplitter.h>
+#include <TGListTree.h>
+#include <TRootEmbeddedCanvas.h>
+#include <TGTextView.h>
+#include <RQ_OBJECT.h>
+#include <TFolder.h>
+#include <TSocket.h>
+#include <TTimer.h>
+#include <TFile.h>
+#include "AliMonitorHisto.h"
+
+
+class AliMonitorClient : public TGMainFrame {
+
+RQ_OBJECT("AliMonitorClient")
+
+public:
+  AliMonitorClient();
+  virtual ~AliMonitorClient();
+
+  void               CloseWindow();
+
+  void               OnNewData();
+
+  void               OnMenuActivated(Int_t id);
+
+  void               OnEventNumberChanged();
+  void               OnEventButtonPressed();
+  void               OnSumButtonPressed();
+  void               OnRunButtonPressed();
+  void               OnLoopButtonClicked();
+  void               OnPreviousButtonClicked();
+  void               OnNextButtonClicked();
+  void               OnCopyButtonClicked();
+  void               OnSaveButtonClicked();
+  void               OnPrintButtonClicked();
+
+  void               OnTreeClicked(TGListTreeItem* item, Int_t btn);
+  void               OnTreeReturnPressed(TGListTreeItem* item);
+
+  void               OnLoopTimer();
+
+private:
+  TFolder*           CreateTopFolder();
+  AliMonitorHisto*   GetHisto(const char* folderName, const char* histoName);
+  TGListTreeItem*    GetItem(TGListTreeItem* base, const char* folderName, 
+                            const char* histoName, Bool_t create);
+
+  Bool_t             ConnectToServer();
+  void               DisconnectFromServer();
+  Bool_t             OpenFile();
+
+  void               ViewToolBar(Bool_t visible);
+  void               ViewTree(Bool_t visible);
+  void               ViewDescription(Bool_t visible);
+  void               ViewReference(Bool_t visible);
+  void               ViewStatistics(Bool_t visible);
+
+  Bool_t             AddFavorite();
+  Bool_t             DeleteFavorite();
+  Bool_t             LoadFavorites(Bool_t dialog = kTRUE);
+  Bool_t             SaveFavorites();
+  Bool_t             SaveFavoritesAs();
+
+  Bool_t             LoadReference(Bool_t dialog = kTRUE);
+  void               SetReference();
+  Bool_t             TakeCurrentReference();
+  void               TakeReferenceHisto(const char* folderName,
+                                       AliMonitorHisto* histo);
+  void               TakeReferenceFolder(TGListTreeItem* item);
+  Bool_t             SaveReference();
+  Bool_t             SaveReferenceAs();
+
+  void               LoadSettings();
+  void               SaveSettings();
+
+  void               StopLoop();
+  Bool_t             GetBaseItem();
+  Bool_t             GoToNextItem();
+  Bool_t             GoToPreviousItem();
+  void               UpdateItem(Bool_t highlight);
+
+  Bool_t             CheckForNewData();
+  void               ClearItems(TGListTreeItem* base);
+  void               CleanUpTree(TGListTreeItem* base);
+  void               UpdateTree();
+  void               UpdateFavoritesTree();
+  void               UpdateComparisonTree();
+  void               UpdateDescription();
+  void               UpdateHisto();
+  void               UpdateAll();
+
+  TGLayoutHints*     fMenuBarLayout;
+  TGLayoutHints*     fMenuBarItemLayout;
+  TGLayoutHints*     fMenuBarHelpLayout;
+  TGPopupMenu*       fMenuFile;
+  TGPopupMenu*       fMenuView;
+  TGPopupMenu*       fMenuFavorites;
+  TGPopupMenu*       fMenuReference;
+  TGPopupMenu*       fMenuOptions;
+  TGPopupMenu*       fMenuHelp;
+  TGMenuBar*         fMenuBar;
+
+  TGLayoutHints*     fToolBarLayout;
+  TGHorizontal3DLine* fToolBarSep;
+  TGToolBar*         fToolBar;
+  TGLayoutHints*     fEventNumberLayout;
+  TGNumberEntry*     fEventNumber;
+  TGButton*          fEventButton;
+  TGButton*          fSumButton;
+  TGButton*          fRunButton;
+  TGButton*          fLoopButton;
+  const TGPicture*   fLoopOnPicture;
+  const TGPicture*   fLoopOffPicture;
+  TGButton*          fPreviousButton;
+  TGButton*          fNextButton;
+  TGButton*          fCopyButton;
+  TGButton*          fSaveButton;
+  TGButton*          fPrintButton;
+
+  TGLayoutHints*     fBottomLayout;
+  TGLayoutHints*     fLeftLayout;
+  TGLayoutHints*     fExpandLayout;
+
+  TGVerticalFrame*   fVerticalFrame;
+  TGHorizontalFrame* fHorizontalFrame;
+
+  TGCompositeFrame*  fTreeFrame;
+  TGCanvas*          fTreeCanvas;
+  TGListTree*        fTree;
+  const TGPicture*   fHistoPicture;
+  TGListTreeItem*    fAllItem;
+  TGListTreeItem*    fFavoritesItem;
+  TGListTreeItem*    fComparisonItem;
+
+  TGVSplitter*       fTreeSplitter;
+
+  TGCompositeFrame*  fDrawFrame;
+  TRootEmbeddedCanvas* fDrawCanvas;
+
+  TGHSplitter*       fDescriptionSplitter;
+
+  TGCompositeFrame*  fDescriptionFrame;
+  TGTextView*        fDescription;
+
+  TString            fServerName;
+  TSocket*           fSocket;
+  TFileHandler*      fSocketHandler;
+
+  TFolder*           fFolder;
+
+  TGListTreeItem*    fCurrentItem;
+  TGListTreeItem*    fBaseItem;
+  TTimer*            fLoopTimer;
+  Int_t              fLoopInterval;
+
+  TString            fFavoritesFileName;
+
+  TString            fReferenceFileName;
+  TFolder*           fReference;
+
+  TString            fPrintCommand;
+
+  static const char* fgSettingsFileName;
+
+  ClassDef(AliMonitorClient, 0)   // class for receiving and displaying monitor histograms
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorControl.cxx b/MONITOR/AliMonitorControl.cxx
new file mode 100644 (file)
index 0000000..8e045e9
--- /dev/null
@@ -0,0 +1,550 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class provides a graphical user interface for the monitor process   //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorControl.h"
+#include "AliMonitorHisto.h"
+#include "AliMonitorDialog.h"
+#include <TGNumberEntry.h>
+#include <TGTextView.h>
+#include <TGMsgBox.h>
+#include <TSystem.h>
+#include <TROOT.h>
+
+
+ClassImp(AliMonitorControl) 
+
+
+//_____________________________________________________________________________
+class AliMonitorBufferDlg : public AliMonitorDialog {
+
+public:
+  AliMonitorBufferDlg(Int_t& size, TGFrame* main);
+  virtual ~AliMonitorBufferDlg();
+
+  virtual void       OnOkClicked();
+
+private:
+  TGLayoutHints*     fBufferLayout;
+  TGLabel*           fBufferLabel;
+  TGNumberEntry*     fBufferEntry;
+
+  Int_t&             fSize;
+};
+
+
+//_____________________________________________________________________________
+AliMonitorBufferDlg::AliMonitorBufferDlg(Int_t& size, TGFrame* main) :
+  AliMonitorDialog(main, 250, 80), fSize(size)
+{
+// create a dialog for setting the size of the buffer for monitor histos
+
+  fBufferLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2);
+  fBufferLabel = new TGLabel(fFrame, "size of histogram buffer:");
+  fFrame->AddFrame(fBufferLabel, fBufferLayout);
+  fBufferEntry = new TGNumberEntry(fFrame, size, 2, -1,
+                                  TGNumberFormat::kNESInteger);
+  fBufferEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 99);
+  fFrame->AddFrame(fBufferEntry, fBufferLayout);
+
+  fSize = -1;
+
+  fMain->SetWindowName("Buffer Size");
+  fMain->MapSubwindows();
+  fMain->Layout();
+  gClient->WaitFor(fMain);
+}
+
+//_____________________________________________________________________________
+AliMonitorBufferDlg::~AliMonitorBufferDlg()
+{
+// clean up
+
+  delete fBufferLabel;
+  delete fBufferLayout;
+  delete fBufferEntry;
+}
+
+//_____________________________________________________________________________
+void AliMonitorBufferDlg::OnOkClicked()
+{
+  fSize = fBufferEntry->GetIntNumber();
+}
+
+
+//_____________________________________________________________________________
+class AliMonitorClientsDlg : public AliMonitorDialog {
+
+public:
+  AliMonitorClientsDlg(TObjArray* clients, TGFrame* main);
+  virtual ~AliMonitorClientsDlg();
+
+private:
+  TGLayoutHints*     fClientsLayout;
+  TGTextView*        fClients;
+};
+
+
+//_____________________________________________________________________________
+AliMonitorClientsDlg::AliMonitorClientsDlg(TObjArray* clients, TGFrame* main) :
+  AliMonitorDialog(main, 450, 300, kFALSE)
+{
+// create a dialog to display the list of clients
+
+  delete fFrameLayout;
+  fFrameLayout = new TGLayoutHints(kLHintsCenterX | kLHintsTop, 
+                                  10, 10, 15, 15);
+  ((TGFrameElement*)(fMain->GetList()->First()))->fLayout = fFrameLayout;
+  fClientsLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 
+                                    0, 0, 0, 0);
+  fClients = new TGTextView(fFrame, 420, 230);
+  fFrame->AddFrame(fClients, fClientsLayout);
+
+  char line[256];
+  const char* format = "%-30s%-20s%-8d";
+  sprintf(line, format, "name", "address", 0);
+  strncpy(&line[50], "port", 4);
+  fClients->AddLine(line);
+  for (Int_t i = 0; i < (Int_t) strlen(line); i++) line[i] = '-';
+  fClients->AddLine(line);
+
+  for (Int_t iClient = 0; iClient < clients->GetEntriesFast(); iClient++) {
+    TSocket* socket = (TSocket*) clients->At(iClient);
+    if (!socket) continue;
+    TInetAddress adr = socket->GetInetAddress();
+    sprintf(line, format,
+           adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+    fClients->AddLine(line);
+  }
+
+  fMain->SetWindowName("List of Clients");
+  fMain->MapSubwindows();
+  fMain->Layout();
+  gClient->WaitFor(fMain);
+}
+
+//_____________________________________________________________________________
+AliMonitorClientsDlg::~AliMonitorClientsDlg()
+{
+// clean up
+
+  delete fClientsLayout;
+  delete fClients;
+}
+
+
+// constants for menu entries
+enum {kMenuFileExit, kMenuFileAbort,
+      kMenuOptBuffer, kMenuOptClients,
+      kMenuHelpDoc, kMenuHelpAbout
+};
+
+
+//_____________________________________________________________________________
+AliMonitorControl::AliMonitorControl(AliMonitorProcess* process)
+{
+// initialize the monitoring control window
+
+  fMonitorProcess = process;
+
+
+  // colors
+  gClient->GetColorByName("lightblue", fColorStatus);
+  gClient->GetColorByName("green", fColorStart);
+  gClient->GetColorByName("red", fColorStop);
+
+  // main window
+  fMain = new TGMainFrame(gClient->GetRoot(), 380, 200);
+
+  // menu bar
+  fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+                                      0, 0, 1, 1);
+  fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
+  fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
+
+  fMenuFile = new TGPopupMenu(gClient->GetRoot());
+  fMenuFile->AddEntry("E&xit", kMenuFileExit);
+  fMenuFile->AddEntry("&Abort", kMenuFileAbort);
+  fMenuFile->DisableEntry(kMenuFileAbort);
+  fMenuFile->Connect("Activated(Int_t)", "AliMonitorControl", this,
+                    "HandleMenu(Int_t)");
+
+  fMenuOptions = new TGPopupMenu(gClient->GetRoot());
+  fMenuOptions->AddEntry("&Histogram buffer...", kMenuOptBuffer);
+  fMenuOptions->AddEntry("List of &Clients...", kMenuOptClients);
+  fMenuOptions->Connect("Activated(Int_t)", "AliMonitorControl", this,
+                       "HandleMenu(Int_t)");
+
+  fMenuHelp = new TGPopupMenu(gClient->GetRoot());
+  fMenuHelp->AddEntry("&Documentation...", kMenuHelpDoc);
+  fMenuHelp->AddEntry("A&bout...", kMenuHelpAbout);
+  fMenuHelp->Connect("Activated(Int_t)", "AliMonitorControl", this,
+                    "HandleMenu(Int_t)");
+
+  fMenuBar = new TGMenuBar(fMain, 1, 1, kHorizontalFrame);
+  fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&Options", fMenuOptions, fMenuBarItemLayout);
+  fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
+
+  fMain->AddFrame(fMenuBar, fMenuBarLayout);
+
+
+  // status frame
+  fFrameLayout = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 
+                                  2, 2, 2, 2);
+  fFrame = new TGVerticalFrame(fMain, 0, 0, kChildFrame | kSunkenFrame);
+  fMain->AddFrame(fFrame, fFrameLayout);
+
+  fStatusLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 10, 2, 2, 2);
+  fStatusFrameLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 2, 2);
+
+
+  // run and event number
+  fStatus1Frame = new TGHorizontalFrame(fFrame, 0, 0);
+  fFrame->AddFrame(fStatus1Frame, fStatusFrameLayout);
+
+  fRunNumberLabel = new TGLabel(fStatus1Frame, "current run:");
+  fStatus1Frame->AddFrame(fRunNumberLabel, fStatusLayout);
+  fRunNumber = new TGTextEntry(fStatus1Frame, "-");
+  fRunNumber->Resize(60, fRunNumber->GetDefaultHeight());
+  fRunNumber->SetAlignment(kTextRight);
+  fRunNumber->SetEnabled(kFALSE);
+  fRunNumber->SetBackgroundColor(fColorStatus);
+  fStatus1Frame->AddFrame(fRunNumber, fStatusLayout);
+
+  fEventNumberLabel = new TGLabel(fStatus1Frame, 
+                                 "  event:");
+  fStatus1Frame->AddFrame(fEventNumberLabel, fStatusLayout);
+  fEventNumber = new TGTextEntry(fStatus1Frame, "-/-/-");
+  fEventNumber->Resize(100, fEventNumber->GetDefaultHeight());
+  fEventNumber->SetAlignment(kTextRight);
+  fEventNumber->SetEnabled(kFALSE);
+  fEventNumber->SetBackgroundColor(fColorStatus);
+  fStatus1Frame->AddFrame(fEventNumber, fStatusLayout);
+
+
+  // process status
+  fStatus2Frame = new TGHorizontalFrame(fFrame, 0, 0);
+  fFrame->AddFrame(fStatus2Frame, fStatusFrameLayout);
+
+  fStatusLabel = new TGLabel(fStatus2Frame, "current status:");
+  fStatus2Frame->AddFrame(fStatusLabel, fStatusLayout);
+  fStatus = new TGTextEntry(fStatus2Frame, "stopped");
+  fStatus->Resize(250, fStatus->GetDefaultHeight());
+  fStatus->SetAlignment(kTextLeft);
+  fStatus->SetEnabled(kFALSE);
+  fStatus->SetBackgroundColor(fColorStatus);
+  fStatus2Frame->AddFrame(fStatus, fStatusLayout);
+
+
+  // process status
+  fStatus3Frame = new TGHorizontalFrame(fFrame, 0, 0);
+  fFrame->AddFrame(fStatus3Frame, fStatusFrameLayout);
+
+  fEventsLabel = new TGLabel(fStatus3Frame, "monitored events:");
+  fStatus3Frame->AddFrame(fEventsLabel, fStatusLayout);
+  fEvents = new TGTextEntry(fStatus3Frame, "-");
+  fEvents->Resize(60, fEvents->GetDefaultHeight());
+  fEvents->SetAlignment(kTextRight);
+  fEvents->SetEnabled(kFALSE);
+  fEvents->SetBackgroundColor(fColorStatus);
+  fStatus3Frame->AddFrame(fEvents, fStatusLayout);
+
+  fClientsLabel = new TGLabel(fStatus3Frame, " number of clients:");
+  fStatus3Frame->AddFrame(fClientsLabel, fStatusLayout);
+  fClients = new TGTextEntry(fStatus3Frame, "-");
+  fClients->Resize(40, fClients->GetDefaultHeight());
+  fClients->SetAlignment(kTextRight);
+  fClients->SetEnabled(kFALSE);
+  fClients->SetBackgroundColor(fColorStatus);
+  fStatus3Frame->AddFrame(fClients, fStatusLayout);
+
+
+  // buttons
+  fButtonFrameLayout = new TGLayoutHints(kLHintsExpandX | kLHintsBottom, 
+                                        50, 50, 10, 10);
+  fButtonFrame = new TGHorizontalFrame(fMain, 0, 0);
+  fMain->AddFrame(fButtonFrame, fButtonFrameLayout);
+
+  fButtonLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 
+                                   2, 2, 2, 2);
+  fResetButton = new TGTextButton(fButtonFrame, " &Reset ", 1);
+  fResetButton->Connect("Clicked()", "AliMonitorControl", this, "DoReset()");
+  fButtonFrame->AddFrame(fResetButton, fButtonLayout);
+
+  fStartStopButton = new TGTextButton(fButtonFrame, " &Start ", 2);
+  fStartStopButton->SetBackgroundColor(0x00FF00);
+  fStartStopButton->Connect("Clicked()", "AliMonitorControl", this, 
+                           "DoStartStop()");
+  fButtonFrame->AddFrame(fStartStopButton, fButtonLayout);
+  fStartButtonStatus = kTRUE;
+
+
+  // main window
+  fMain->SetWindowName("Monitor Process Control");
+  fMain->DontCallClose();
+  fMain->SetWMSize(fMain->GetWidth(), fMain->GetHeight());
+  fMain->SetWMSizeHints(fMain->GetWidth(), fMain->GetHeight(), 
+                       fMain->GetWidth(), fMain->GetHeight(), 0, 0);
+  fMain->SetWMPosition(100, 100);
+  fMain->MapSubwindows();
+  fMain->Layout();
+  fMain->MapWindow();
+
+
+  fTerminating = kFALSE;
+
+  fTimer = new TTimer(this, 100, kFALSE);
+  fTimer->TurnOn();
+}
+
+//_____________________________________________________________________________
+AliMonitorControl::~AliMonitorControl()
+{
+// clean up
+
+  delete fMenuBarLayout;
+  delete fMenuBarItemLayout;
+  delete fMenuBarHelpLayout;
+  delete fMenuFile;
+  delete fMenuOptions;
+  delete fMenuHelp;
+  delete fMenuBar;
+
+  delete fFrameLayout;
+  delete fFrame;
+  delete fStatusLayout;
+  delete fStatusFrameLayout;
+
+  delete fStatus1Frame;
+  delete fRunNumberLabel;
+  delete fRunNumber;
+  delete fEventNumberLabel;
+  delete fEventNumber;
+
+  delete fStatus2Frame;
+  delete fStatusLabel;
+  delete fStatus;
+
+  delete fStatus3Frame;
+  delete fEventsLabel;
+  delete fEvents;
+  delete fClientsLabel;
+  delete fClients;
+
+  delete fButtonFrameLayout;
+  delete fButtonFrame;
+  delete fButtonLayout;
+  delete fResetButton;
+  delete fStartStopButton;
+
+  delete fTimer;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorControl::HandleMenu(Int_t id)
+{
+// called when a menu item was selected
+
+  switch (id) {
+
+  case kMenuFileExit: {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), fMain, "Exit", 
+                "Do you really want to terminate the monitor process?", 
+                kMBIconQuestion, kMBYes | kMBNo, &result);
+    if (result == kMBYes) {
+      fMenuFile->EnableEntry(kMenuFileAbort);
+      if (fMonitorProcess->IsStopped()) exit(0);
+      fMonitorProcess->Stop();
+      fTerminating = kTRUE;
+    }
+    break;
+  }
+
+  case kMenuFileAbort:
+    exit(1);
+
+  case kMenuOptBuffer: {
+    Int_t size = AliMonitorHisto::GetNHistosMax();
+    new AliMonitorBufferDlg(size, fMain);
+    if (size < 0) break;
+    AliMonitorHisto::SetNHistosMax(size);
+    break;
+  }
+
+  case kMenuOptClients: {
+    new AliMonitorClientsDlg(fMonitorProcess->GetListOfClients(), fMain);
+    break;
+  }
+
+  case kMenuHelpAbout: {
+    Int_t result;
+    char text[256];
+    sprintf(text, "AliMonitorControl $Revision$\nrunning\n"
+           "AliMonitorProcess %s", AliMonitorProcess::GetRevision());
+    new TGMsgBox(gClient->GetRoot(), fMain, 
+                "About", text, kMBIconAsterisk, kMBOk, &result);
+    break;
+  }
+
+  default: {
+    Int_t result;
+    new TGMsgBox(gClient->GetRoot(), fMain, 
+                "AliMonitorControl", "not yet implemented", 
+                kMBIconExclamation, kMBOk, &result);
+  }
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorControl::DoReset()
+{
+// called when the reset button was clicked
+
+  Int_t result;
+  new TGMsgBox(gClient->GetRoot(), fMain, "Reset", 
+              "Do you really want to reset the monitor histograms?", 
+              kMBIconQuestion, kMBYes | kMBNo, &result);
+  if (result == kMBYes) {
+    fMonitorProcess->Reset();
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorControl::DoStartStop()
+{
+// called when the start/stop button was clicked
+
+  if (fStartButtonStatus) {
+    if (fMonitorProcess->GetStatus() == AliMonitorProcess::kStopped) {
+      fStartStopButton->SetBackgroundColor(fColorStop);
+      fStartStopButton->SetText(" &Stop ");
+      fStartButtonStatus = kFALSE;
+      fMonitorProcess->Run();
+      fStartStopButton->SetBackgroundColor(fColorStart);
+      fStartStopButton->SetText(" &Start ");
+      fStartButtonStatus = kTRUE;
+    }
+
+  } else {
+    if (fMonitorProcess->GetStatus() != AliMonitorProcess::kStopped) {
+      fMonitorProcess->Stop();
+    }
+  }
+}
+
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorControl::HandleTimer(TTimer* timer)
+{
+// update the displayed information
+
+  timer->TurnOff();
+  if (fTerminating && fMonitorProcess->IsStopped()) exit(0); 
+  UpdateStatus();
+  gSystem->ProcessEvents();
+  timer->TurnOn();
+  return kFALSE;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorControl::UpdateStatus()
+{
+// update the displayed status information
+
+  char text[256];
+
+  if (fMonitorProcess->IsStopped()) {
+    fRunNumber->SetText("-");
+    fEventNumber->SetText("-/-/-");
+    fEvents->SetText("-");
+    fClients->SetText("-");
+
+  } else {
+    sprintf(text, "%d", fMonitorProcess->GetRunNumber());
+    fRunNumber->SetText(text);
+    sprintf(text, "%d/%d/%d", fMonitorProcess->GetEventPeriodNumber(),
+           fMonitorProcess->GetEventOrbitNumber(),
+           fMonitorProcess->GetEventBunchNumber());
+    fEventNumber->SetText(text);
+    sprintf(text, "%d", fMonitorProcess->GetNumberOfEvents());
+    fEvents->SetText(text);
+    sprintf(text, "%d", fMonitorProcess->GetNumberOfClients());
+    fClients->SetText(text);
+  }
+
+  const char* status = NULL;
+  switch (fMonitorProcess->GetStatus()) {
+  case AliMonitorProcess::kStopped: 
+    status = "stopped"; break;
+  case AliMonitorProcess::kWaiting: 
+    status = "waiting for new data"; break;
+  case AliMonitorProcess::kReading: 
+    status = "reading raw data"; break;
+  case AliMonitorProcess::kRecTPC: 
+    status = "running TPC reconstruction"; break;
+  case AliMonitorProcess::kRecITS: 
+    status = "running ITS reconstruction"; break;
+  case AliMonitorProcess::kRecV0s: 
+    status = "running V0 reconstruction"; break;
+  case AliMonitorProcess::kFilling: 
+    status = "filling monitor histograms"; break;
+  case AliMonitorProcess::kUpdating: 
+    status = "updating monitor histograms"; break;
+  case AliMonitorProcess::kWriting: 
+    status = "writing monitor histograms"; break;
+  case AliMonitorProcess::kResetting: 
+    status = "resetting monitor histograms"; break;
+  case AliMonitorProcess::kConnecting: 
+    status = "checking for new clients"; break;
+  case AliMonitorProcess::kBroadcasting: 
+    status = "broadcasting monitor histograms"; break;
+  }
+
+  if (fMonitorProcess->WillStop()) {
+    sprintf(text, "stopping... (%s)", status);
+  } else {
+    sprintf(text, "%s", status);
+  }
+  if (strcmp(text, fStatus->GetText()) != 0) {
+    fStatus->SetText(text);
+  }
+
+  /*
+  if (fStartButtonStatus != fMonitorProcess->IsStopped()) {
+    fStartButtonStatus = fMonitorProcess->IsStopped();
+    if (fStartButtonStatus) {
+      fStartStopButton->SetBackgroundColor(fColorStart);
+      fStartStopButton->SetText(" &Start ");
+    } else {
+      fStartStopButton->SetBackgroundColor(fColorStop);
+      fStartStopButton->SetText(" &Stop ");
+    }
+  }
+  */
+}
+
diff --git a/MONITOR/AliMonitorControl.h b/MONITOR/AliMonitorControl.h
new file mode 100644 (file)
index 0000000..c9ee0b4
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef ALIMONITORCONTROL_H
+#define ALIMONITORCONTROL_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TGFrame.h>
+#include <TGMenu.h>
+#include <TGButton.h>
+#include <TGLabel.h>
+#include <TGTextEntry.h>
+#include <RQ_OBJECT.h>
+#include <TSysEvtHandler.h>
+#include <TTimer.h>
+#include "AliMonitorProcess.h"
+
+
+class AliMonitorControl : public TObject {
+
+RQ_OBJECT("AliMonitorControl")
+
+public:
+  AliMonitorControl(AliMonitorProcess* process);
+  virtual ~AliMonitorControl();
+
+  void               HandleMenu(Int_t id);
+  void               DoReset();
+  void               DoStartStop();
+
+private:
+  virtual Bool_t     HandleTimer(TTimer* timer);
+
+  void               UpdateStatus();
+
+  AliMonitorProcess* fMonitorProcess;
+
+  ULong_t            fColorStatus;
+  ULong_t            fColorStart;
+  ULong_t            fColorStop;
+
+  TGMainFrame*       fMain;
+
+  TGLayoutHints*     fMenuBarLayout;
+  TGLayoutHints*     fMenuBarItemLayout;
+  TGLayoutHints*     fMenuBarHelpLayout;
+  TGPopupMenu*       fMenuFile;
+  TGPopupMenu*       fMenuOptions;
+  TGPopupMenu*       fMenuHelp;
+  TGMenuBar*         fMenuBar;
+
+  TGLayoutHints*     fFrameLayout;
+  TGVerticalFrame*   fFrame;
+  TGLayoutHints*     fStatusLayout;
+  TGLayoutHints*     fStatusFrameLayout;
+
+  TGHorizontalFrame* fStatus1Frame;
+  TGLabel*           fRunNumberLabel;
+  TGTextEntry*       fRunNumber;
+  TGLabel*           fEventNumberLabel;
+  TGTextEntry*       fEventNumber;
+
+  TGHorizontalFrame* fStatus2Frame;
+  TGLabel*           fStatusLabel;
+  TGTextEntry*       fStatus;
+
+  TGHorizontalFrame* fStatus3Frame;
+  TGLabel*           fEventsLabel;
+  TGTextEntry*       fEvents;
+  TGLabel*           fClientsLabel;
+  TGTextEntry*       fClients;
+
+  TGLayoutHints*     fButtonFrameLayout;
+  TGHorizontalFrame* fButtonFrame;
+  TGLayoutHints*     fButtonLayout;
+  TGTextButton*      fResetButton;
+  TGTextButton*      fStartStopButton;
+  Bool_t             fStartButtonStatus;
+
+  Bool_t             fTerminating;
+
+  TTimer*            fTimer;
+
+  ClassDef(AliMonitorControl, 0)   // class for controlling the AliMonitorProcess
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorDialog.cxx b/MONITOR/AliMonitorDialog.cxx
new file mode 100644 (file)
index 0000000..a5dfc63
--- /dev/null
@@ -0,0 +1,122 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This is a base class for dialogs with ok and cancel button               //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorDialog.h"
+
+
+ClassImp(AliMonitorDialog) 
+
+
+//_____________________________________________________________________________
+AliMonitorDialog::AliMonitorDialog(TGFrame* main, Int_t width, Int_t height,
+                                  Bool_t cancelBtn)
+{
+// create a dialog with an ok and a cancel button
+
+  fMain = new TGTransientFrame(gClient->GetRoot(), main, width, height);
+
+  fFrameLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY,
+                                  2, 2, 2, 2);
+  fFrame = new TGHorizontalFrame(fMain, 0, 0);
+  fMain->AddFrame(fFrame, fFrameLayout);
+
+  fButtonFrameLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 
+                                        2, 2, 2, 2);
+  fButtonFrame = new TGHorizontalFrame(fMain, 0, 0);
+  fMain->AddFrame(fButtonFrame, fButtonFrameLayout);
+
+  fButtonLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 
+                                   15, 15, 2, 2);
+  fOkButton = new TGTextButton(fButtonFrame, "    &Ok    ", 1);
+  fButtonFrame->AddFrame(fOkButton, fButtonLayout);
+  fOkButton->Connect("Clicked()", "AliMonitorDialog", this, "DoOk()");
+  if (cancelBtn) {
+    fCancelButton = new TGTextButton(fButtonFrame, " &Cancel ", 2);
+    fButtonFrame->AddFrame(fCancelButton, fButtonLayout);
+    fCancelButton->Connect("Clicked()", "AliMonitorDialog", this, 
+                          "DoCancel()");
+  } else {
+    fCancelButton = NULL;
+  }
+
+  fMain->Connect("CloseWindow()", "AliMonitorDialog", this, "CloseWindow()");
+  Int_t x;
+  Int_t y;
+  Window_t child;
+  gVirtualX->TranslateCoordinates(main->GetId(), gClient->GetRoot()->GetId(),
+                                 (main->GetWidth() - width) >> 1,
+                                 (main->GetHeight() - height) >> 1, 
+                                 x, y, child);
+  if (x < 0) x = 0;
+  if (y < 0) y = 0;
+  fMain->Move(x, y);
+  fMain->SetWMPosition(x, y);
+  fMain->SetWMSize(width, height);
+  fMain->SetWMSizeHints(width, height, width, height, 0, 0);
+  fMain->MapSubwindows();
+  fMain->Layout();
+  fMain->MapWindow();
+}
+
+//_____________________________________________________________________________
+AliMonitorDialog::~AliMonitorDialog()
+{
+// clean up
+
+  delete fOkButton;
+  delete fCancelButton;
+  delete fButtonLayout;
+  delete fButtonFrame;
+  delete fButtonFrameLayout;
+  delete fFrame;
+  delete fFrameLayout;
+
+  delete fMain;
+}
+
+//_____________________________________________________________________________
+void AliMonitorDialog::CloseWindow()
+{
+// called when the window is closed
+
+  delete this;
+}
+
+//_____________________________________________________________________________
+void AliMonitorDialog::DoOk()
+{
+// called when the ok button is clicked
+
+  OnOkClicked();
+  fMain->SendCloseMessage();
+}
+
+//_____________________________________________________________________________
+void AliMonitorDialog::DoCancel()
+{
+// called when the cancel button is clicked
+
+  OnCancelClicked();
+  fMain->SendCloseMessage();
+}
diff --git a/MONITOR/AliMonitorDialog.h b/MONITOR/AliMonitorDialog.h
new file mode 100644 (file)
index 0000000..81e22db
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIMONITORDIALOG_H
+#define ALIMONITORDIALOG_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TGFrame.h>
+#include <TGButton.h>
+#include <TGLabel.h>
+#include <RQ_OBJECT.h>
+
+
+class AliMonitorDialog : public TObject {
+
+RQ_OBJECT("AliMonitorDialog")
+
+public:
+  AliMonitorDialog(TGFrame* main, Int_t width = 300, Int_t height = 80,
+                  Bool_t cancelBtn = kTRUE);
+  virtual ~AliMonitorDialog();
+
+  void               CloseWindow();
+  void               DoOk();
+  virtual void       OnOkClicked() {};
+  void               DoCancel();
+  virtual void       OnCancelClicked() {};
+
+protected:
+  TGTransientFrame*  fMain;
+  TGLayoutHints*     fFrameLayout;
+  TGHorizontalFrame* fFrame;
+  TGLayoutHints*     fButtonFrameLayout;
+  TGHorizontalFrame* fButtonFrame;
+  TGLayoutHints*     fButtonLayout;
+  TGTextButton*      fOkButton;
+  TGTextButton*      fCancelButton;
+
+  ClassDef(AliMonitorDialog, 0)   // base class for dialogs with ok and cancel button
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorHisto.cxx b/MONITOR/AliMonitorHisto.cxx
new file mode 100644 (file)
index 0000000..42f4c8a
--- /dev/null
@@ -0,0 +1,452 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class maintains a histogram that is used to monitor the quality     //
+//  of the recorded data.                                                    //
+//  The histogram is created and filled by a sub class of AliMonitor.        //
+//  It can be compared to a reference histogram. For the comparison a        //
+//  maximal deviation (in standard deviations) can be specified.             //
+//  The bins where the maximal deviation is exceeded are drawn in red.       //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorHisto.h"
+#include <TProfile.h>
+#include <TH2.h>
+#include <TVirtualPad.h>
+
+
+ClassImp(AliMonitorHisto) 
+
+
+Int_t   AliMonitorHisto::fgNHistosMax = 10;
+
+
+//_____________________________________________________________________________
+AliMonitorHisto::AliMonitorHisto()
+{
+// default contructor
+
+  fHisto = NULL;
+  fNHistos = 0;
+  fHistoRun = NULL;
+  fHistoDraw = NULL;
+  fHistoRef = NULL;
+  fHistoCompare = NULL;
+  fNorm = kNormNone;
+}
+
+//_____________________________________________________________________________
+AliMonitorHisto::AliMonitorHisto(const AliMonitorHisto& histo) :
+  AliMonitorPlot(histo)
+{
+// copy constructor
+
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHisto = NULL;
+  if (histo.fHisto) fHisto = (TH1*) histo.fHisto->Clone();
+  fNHistos = histo.fNHistos;
+  TObjLink* link = histo.fHistoList.FirstLink();
+  for (Int_t i = 0; i < fNHistos; i++) {
+    fHistoList.Add(link->GetObject()->Clone());
+    link = link->Next();
+  }
+  fHistoRun = NULL;
+  if (histo.fHistoRun) fHistoRun = (TH1*) histo.fHistoRun->Clone();
+  fHistoDraw = NULL;
+  fHistoRef = NULL;
+  if (histo.fHistoRef) fHistoRef = (TH1*) histo.fHistoRef->Clone();
+  fHistoCompare = NULL;
+  fNorm = histo.fNorm;
+  TH1::AddDirectory(addStatus);
+}
+
+//_____________________________________________________________________________
+AliMonitorHisto::AliMonitorHisto(TH1* histo, ENorm norm) :
+  AliMonitorPlot(histo->GetName(), histo->GetTitle())
+{
+// create a monitor histogram from the given histogram
+
+  if (histo->GetDimension() > 2) {
+    Fatal("AliMonitorHisto", "3 dimensional histograms are not supported");
+  }
+
+  histo->SetDirectory(NULL);
+  histo->Reset();
+  fHisto = histo;
+  fHisto->Sumw2();
+  fNHistos = 0;
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoRun = (TH1*) histo->Clone();
+  TH1::AddDirectory(addStatus);
+  fHistoDraw = NULL;
+  fHistoRef = NULL;
+  fHistoCompare = NULL;
+  fNorm = norm;
+}
+
+//_____________________________________________________________________________
+AliMonitorHisto::~AliMonitorHisto()
+{
+// delete all histograms
+
+  if (fHisto) delete fHisto;
+  fHistoList.Delete();
+  if (fHistoRun) delete fHistoRun;
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHisto::SetReference(TH1* ref)
+{
+// set the reference histogram for comparison
+
+  if (fHistoRef) delete fHistoRef;
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  TH1::AddDirectory(addStatus);
+  fHistoRef = (TH1*) ref->Clone();
+  if (fHistoCompare) fHistoCompare->Reset();
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::SetReference(AliMonitorPlot* ref)
+{
+// set the reference histogram for comparison
+
+  if (!ref->InheritsFrom(AliMonitorHisto::Class())) return;
+  ((AliMonitorHisto*)ref)->GetRun();
+  SetReference(((AliMonitorHisto*)ref)->fHistoDraw);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Fill(Axis_t x)
+{
+// fill the monitor histogram
+
+  fHisto->Fill(x);
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Fill(Axis_t x, Axis_t y)
+{
+// fill the monitor histogram
+
+  fHisto->Fill(x, y);
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Fill(Axis_t x, Axis_t y, Stat_t w)
+{
+// fill the monitor histogram
+
+  if (fHisto->InheritsFrom(TH2::Class())) {
+    ((TH2*)fHisto)->Fill(x, y, w);
+  } else if (fHisto->InheritsFrom(TProfile::Class())) {
+    ((TProfile*)fHisto)->Fill(x, y, w);
+  } else {
+    Error("Fill", "trying to fill x and y of a 1 dimensinal histogram");
+    return;
+  }
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::ScaleErrorBy(Double_t factor)
+{
+// multiply the error of each bin by the given factor
+
+  Int_t yMax = 1; 
+  if (fHisto->GetDimension() > 1) 
+    yMax = fHisto->GetYaxis()->GetNbins();
+  Int_t xMax = fHisto->GetXaxis()->GetNbins();
+  for (Int_t iY = 1; iY <= yMax; iY++) {
+    for (Int_t iX = 1; iX <= xMax; iX++) {
+      Int_t iBin = fHisto->GetBin(iX, iY);
+      fHisto->SetBinError(iBin, factor * fHisto->GetBinError(iBin));
+    }
+  }
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Update()
+{
+// update the normalized data histogram
+
+  Update(fHisto);
+  fHisto->Reset();
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Update(TH1* histo)
+{
+// update the normalized data histogram using the given histo instead of fHisto
+
+  fNumberOfEvents++;
+  while (fNHistos >= fgNHistosMax) {
+    fHistoList.Remove(fHistoList.LastLink());
+    fNHistos--;
+  }
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoList.AddFirst(histo->Clone());
+  TH1::AddDirectory(addStatus);
+  fNHistos++;
+  fHistoRun->Add(histo);
+  fHisto->Reset();
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Add(AliMonitorPlot* plot)
+{
+// merge the given histo to this one
+
+  if (!plot->InheritsFrom(AliMonitorHisto::Class())) return;
+  AliMonitorHisto* histo = (AliMonitorHisto*) plot;
+
+  fNumberOfEvents += histo->fNumberOfEvents;
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  TObjLink* link = histo->fHistoList.LastLink();
+  while (link) {
+    fHistoList.AddFirst(link->GetObject()->Clone());
+    link = link->Prev();
+  }
+  TH1::AddDirectory(addStatus);
+  fNHistos += histo->fNHistos;
+  while (fNHistos > fgNHistosMax) {
+    fHistoList.Remove(fHistoList.LastLink());
+    fNHistos--;
+  }
+  fHistoRun->Add(histo->fHistoRun);
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Reset()
+{
+// reset the monitor histogram for a new run
+
+  fHisto->Reset();
+  fHistoList.Delete();
+  fNHistos = 0;
+  fHistoRun->Reset();
+  if (fHistoDraw) delete fHistoDraw;
+  fHistoDraw = NULL;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+  fNumberOfEvents = 0;
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::ResetList()
+{
+// reset the the list of monitor histograms
+
+  fHistoList.Delete();
+  fNHistos = 0;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorHisto::Scale(Int_t nEvents)
+{
+// scale the histogram to the correct normalization
+
+  Double_t scale = 1.;
+  switch (fNorm) {
+  case kNormNone    : scale = 1.; break;
+  case kNormEvents  : scale = 1./nEvents; break;
+  case kNormEntries : scale = ((fHistoDraw->GetEntries() > 0) ? 
+                              1./fHistoDraw->GetEntries() : 1.); break;
+  case kNormIntegral: scale = ((fHistoDraw->Integral() > 0) ? 
+                              1./fHistoDraw->Integral() : 1.); break;
+  }
+  fHistoDraw->Scale(scale);
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorHisto::ComparePlot()
+{
+// compare the data histogram to the reference histogram
+// if they deviate by more than fgThreshold standard deviations in a bin,
+// this bin is set in fHistoCompare and kFALSE is returned
+  
+  if (!fHistoRef) return kTRUE;
+  if (fgThreshold <= 0) return kTRUE;
+  if (!fHistoDraw) {
+    Info("Compare", "no data histogram available for comparison\ncall DrawEvent, DrawSum or DrawRaw before calling Compare");
+    return kTRUE;
+  }
+  if (fHistoCompare) delete fHistoCompare;
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoCompare = (TH1*) fHistoDraw->Clone();
+  TH1::AddDirectory(addStatus);
+  fHistoCompare->Reset();
+  Bool_t result = kTRUE;
+
+  Int_t yMax = 1; 
+  if (fHistoDraw->GetDimension() > 1) 
+    yMax = fHistoDraw->GetYaxis()->GetNbins();
+  Int_t xMax = fHistoDraw->GetXaxis()->GetNbins();
+  for (Int_t iY = 1; iY <= yMax; iY++) {
+    for (Int_t iX = 1; iX <= xMax; iX++) {
+      Int_t iBin = fHistoDraw->GetBin(iX, iY);
+      Double_t delta = TMath::Abs(fHistoDraw->GetBinContent(iBin) -
+                                 fHistoRef->GetBinContent(iBin));
+      Double_t errorData = fHistoDraw->GetBinError(iBin);
+      Double_t errorRef = fHistoRef->GetBinError(iBin);
+      Double_t sigma = TMath::Sqrt(errorData*errorData + errorRef*errorRef);
+      if (delta > fgThreshold*sigma) {
+       fHistoCompare->SetBinContent(iBin, fHistoDraw->GetBinContent(iBin));
+       fHistoCompare->SetBinError(iBin, errorData);
+       result = kFALSE;
+      }
+    }
+  }
+
+  return result;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorHisto::GetEvent(Int_t number)
+{
+// get the normalized monitor histogram for the "number"th last event
+
+  if (fNHistos == 0) {
+    Info("GetEvent", "there are no histograms for single events available");
+    return kFALSE;
+  }
+  if (number > fNHistos) {
+    Error("GetEvent", "requested event number (%d) exceeds range of available events (%d)\n", 
+         number, fNHistos);
+    return kFALSE;
+  }
+  if (number <= 0) return kFALSE;
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+
+  TObjLink* link = fHistoList.FirstLink();
+  for (Int_t i = 1; i < number; i++) link = link->Next();
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoDraw = (TH1*) link->GetObject()->Clone();
+  TH1::AddDirectory(addStatus);
+
+  Scale(1);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorHisto::GetSum(Int_t number)
+{
+// get the normalized monitor histogram for the sum of the last 
+// "number" events
+
+  if (fNHistos == 0) {
+    Info("GetSum", "there are no histograms for single events available");
+    return kFALSE;
+  }
+  if (number > fNHistos) {
+    Info("GetSum", "requested number of events (%d) exceeds range of available events (%d)\nusing last %d event(s)", 
+         number, fNHistos, fNHistos);
+    number = fNHistos;
+  }
+  if (number <= 0) return kFALSE;
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+
+  TObjLink* link = fHistoList.FirstLink();
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoDraw = (TH1*) link->GetObject()->Clone();
+  TH1::AddDirectory(addStatus);
+  for (Int_t i = 1; i < number; i++) {
+    link = link->Next();
+    fHistoDraw->Add((TH1*) link->GetObject());
+  }
+
+  Scale(number);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorHisto::GetRun()
+{
+// get the normalized monitor histogram for all monitored events 
+// of the current run
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+
+  Bool_t addStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  fHistoDraw = (TH1*) fHistoRun->Clone();
+  TH1::AddDirectory(addStatus);
+
+  Scale(fNumberOfEvents);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorHisto::DrawPlot()
+{
+// draw the histograms
+
+  fHistoDraw->SetMarkerColor(fgColorData);
+  fHistoDraw->SetLineColor(fgColorData);
+  fHistoDraw->SetFillColor(fgColorData);
+  fHistoDraw->DrawCopy();
+
+  if (fHistoRef && fgDrawRef) {
+    char option[256];
+    sprintf(option, "%sSAME", fHistoDraw->GetOption());
+
+    if (fHistoRef->GetMaximum() > fHistoDraw->GetMaximum()) {
+      fHistoDraw->SetMaximum(fHistoRef->GetMaximum() * 1.1);
+    }
+
+    fHistoRef->SetMarkerColor(fgColorRef);
+    fHistoRef->SetLineColor(fgColorRef);
+    fHistoRef->SetFillColor(fgColorRef);
+    fHistoRef->DrawCopy(option);
+
+    fHistoDraw->DrawCopy(option);
+
+    if (fHistoCompare && (fgThreshold > 0)) {
+      fHistoCompare->SetMarkerColor(fgColorCompare);
+      fHistoCompare->SetLineColor(fgColorCompare);
+      fHistoCompare->SetFillColor(fgColorCompare);
+      fHistoCompare->DrawCopy(option);
+    }
+  }
+
+  gPad->Update();
+}
diff --git a/MONITOR/AliMonitorHisto.h b/MONITOR/AliMonitorHisto.h
new file mode 100644 (file)
index 0000000..19069fd
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef ALIMONITORHISTO_H
+#define ALIMONITORHISTO_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMonitorPlot.h"
+#include <TH1.h>
+#include <TList.h>
+#include <TString.h>
+
+
+class AliMonitorHisto : public AliMonitorPlot {
+public:
+  enum ENorm {kNormNone, kNormEvents, kNormEntries, kNormIntegral};
+
+  AliMonitorHisto();
+  AliMonitorHisto(const AliMonitorHisto& histo);
+  AliMonitorHisto(TH1* histo, ENorm norm = kNormIntegral);
+  virtual ~AliMonitorHisto();
+
+  static void     SetNHistosMax(Int_t nHistosMax) {fgNHistosMax = nHistosMax;};
+  static Int_t    GetNHistosMax() {return fgNHistosMax;};
+
+  virtual void    SetReference(TH1* ref);
+  virtual void    SetReference(AliMonitorPlot* ref);
+
+  void            Fill(Axis_t x);
+  void            Fill(Axis_t x, Axis_t y);
+  void            Fill(Axis_t x, Axis_t y, Stat_t w);
+  void            ScaleErrorBy(Double_t factor);
+
+  virtual void    Update();
+  virtual void    Update(TH1* histo);
+  virtual void    Add(AliMonitorPlot* plot);
+  virtual void    Reset();
+  virtual void    ResetList();
+
+protected:
+  void            Scale(Int_t nEvents);
+  virtual Bool_t  ComparePlot();
+  virtual Bool_t  GetEvent(Int_t number = 1);
+  virtual Bool_t  GetSum(Int_t number);
+  virtual Bool_t  GetRun();
+  virtual void    DrawPlot();
+
+  TH1*            fHisto;        //! the histogram that is currently filled with data
+  TList           fHistoList;    // list of histograms of last fNHistos events
+  Int_t           fNHistos;      // number of buffered histograms
+  static Int_t    fgNHistosMax;  //! maximal number of buffered histograms
+  TH1*            fHistoRun;     // sum of histograms for the current run
+
+  TH1*            fHistoDraw;    //! the normalized histogram, used for comparison to a reference histogram
+  TH1*            fHistoRef;     //! the reference histogram for comparison
+  TH1*            fHistoCompare; //! the result of the comparison to the reference histogram, only bins with large deviation are set
+
+  ENorm           fNorm;         // type of normalization
+
+  ClassDef(AliMonitorHisto, 2)   // histogram for monitoring the quality of the recorded data
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorITS.cxx b/MONITOR/AliMonitorITS.cxx
new file mode 100644 (file)
index 0000000..24282a1
--- /dev/null
@@ -0,0 +1,216 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class creates and fills the monitor histograms for the ITS          //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorITS.h"
+#include "AliMonitorHisto.h"
+#include "AliITSRawStreamSPD.h"
+#include "AliITSRawStreamSDD.h"
+#include "AliITSRawStreamSSD.h"
+#include "AliITSclusterV2.h"
+#include "AliITStrackV2.h"
+
+
+ClassImp(AliMonitorITS) 
+
+
+//_____________________________________________________________________________
+AliMonitorITS::AliMonitorITS(AliITSgeom* geom)
+{
+// create a ITS monitor object with the given geometry
+
+  fGeom = geom;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorITS::CreateHistos(TFolder* folder)
+{
+// create the ITS monitor histograms
+
+  fFolder = folder->AddFolder("ITS", "ITS");
+
+  fSDDDigitsCharge = CreateHisto1("SDDDigitsCharge", 
+                                 "charge distribution of SDD digits", 
+                                 128, 0, 256, "charge", "#Delta N/N",
+                                 AliMonitorHisto::kNormEvents);
+
+  fSSDDigitsCharge = CreateHisto1("SSDDigitsCharge", 
+                                 "charge distribution of SSD digits", 
+                                 100, 0, 200, "charge", "#Delta N/N",
+                                 AliMonitorHisto::kNormEvents);
+
+  fSDDClustersCharge = CreateHisto1("SDDClustersCharge", 
+                                   "charge distribution of SDD clusters", 
+                                   100, 0, 200, "charge", "#Delta N/N",
+                                   AliMonitorHisto::kNormEvents);
+
+  fSSDClustersCharge = CreateHisto1("SSDClustersCharge", 
+                                   "charge distribution of SSD clusters", 
+                                   100, 0, 400, "charge", "#Delta N/N",
+                                   AliMonitorHisto::kNormEvents);
+
+  Int_t nModulesSPD = fGeom->GetLastSPD() - fGeom->GetStartSPD() + 1;
+  fSPDNClustersVsModule = CreateHisto1("SPDNClustersVsModule", 
+                                      "mean number of clusters per SPD module", 
+                                      nModulesSPD, -0.5, nModulesSPD-0.5,
+                                      "module", "<N_{clusters}>",
+                                      AliMonitorHisto::kNormEvents);
+
+  Int_t nModulesSDD = fGeom->GetLastSDD() - fGeom->GetStartSDD() + 1;
+  fSDDNClustersVsModule = CreateHisto1("SDDNClustersVsModule", 
+                                      "mean number of clusters per SDD module", 
+                                      nModulesSDD, -0.5, nModulesSDD-0.5,
+                                      "module", "<N_{clusters}>",
+                                      AliMonitorHisto::kNormEvents);
+
+  Int_t nModulesSSD = fGeom->GetLastSSD() - fGeom->GetStartSSD() + 1;
+  fSSDNClustersVsModule = CreateHisto1("SSDNClustersVsModule", 
+                                      "mean number of clusters per SSD module", 
+                                      nModulesSSD, -0.5, nModulesSSD-0.5,
+                                      "module", "<N_{clusters}>",
+                                      AliMonitorHisto::kNormEvents);
+
+  Int_t nLayer = fGeom->GetNlayers();
+  fNClustersVsLayer = CreateHisto1("NClustersVsLayer", 
+                                  "mean number of clusters per layer", 
+                                  nLayer, 0.5, nLayer+0.5, 
+                                  "layer", "<N_{clusters}>",
+                                  AliMonitorHisto::kNormEvents);
+
+  fNTracks = CreateHisto1("NTracks", "number of tracks per event", 
+                         300, 0, 30000, "N_{tracks}", "#Delta N/N",
+                         AliMonitorHisto::kNormEvents);
+
+  fNTracksITSTPC = CreateHisto2("NTracksTPCITS", 
+                               "correlation of number of ITS and TPC tracks per event", 
+                               30, 0, 30000, 30, 0, 30000, 
+                               "N_{tracks}(ITS)", "N_{tracks}(TPC)", 
+                               "#Delta N/N", AliMonitorHisto::kNormEvents);
+
+  fTrackPt = CreateHisto1("TrackPt", "pt distribution of tracks", 
+                         90, 0, 3, "p_{t} [GeV/c]", "#Delta N/N",
+                         AliMonitorHisto::kNormEntries);
+
+  fTrackEta = CreateHisto1("TrackEta", "eta distribution of tracks", 
+                          100, -2, 2, "#eta", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+
+  fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks", 
+                          120, 0, 360, "#phi [#circ]", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+
+  fTrackDEdxVsP = CreateHisto2("TrackDEdxVsP", "dE/dx of tracks", 
+                              100, 0, 3, 100, 0, 150, 
+                              "p [GeV/c]", "dE/dx", "#Delta N/N",
+                              AliMonitorHisto::kNormEntries);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorITS::FillHistos(AliRunLoader* runLoader, 
+                              AliRawReader* rawReader)
+{
+// fill the ITS monitor histogrms
+
+  rawReader->Reset();
+  AliITSRawStreamSDD inputSDD(rawReader);
+  while (inputSDD.Next()) {
+    fSDDDigitsCharge->Fill(inputSDD.GetSignal());
+  }
+
+  rawReader->Reset();
+  AliITSRawStreamSSD inputSSD(rawReader);
+  while (inputSSD.Next()) {
+    fSSDDigitsCharge->Fill(inputSSD.GetSignal());
+  }
+
+  AliLoader* itsLoader = runLoader->GetLoader("ITSLoader");
+  if (!itsLoader) return;
+
+
+  itsLoader->LoadRecPoints();
+  TTree* clustersTree = itsLoader->TreeR();
+  if (!clustersTree) return;
+  TClonesArray* clusters = new TClonesArray("AliITSclusterV2");
+  clustersTree->SetBranchAddress("Clusters", &clusters);
+
+  for (Int_t iModule = 0; iModule < clustersTree->GetEntries(); iModule++) {
+    clustersTree->GetEntry(iModule);
+    Int_t iLayer, iLadder, iDetector;
+    fGeom->GetModuleId(iModule, iLayer, iLadder, iDetector);
+
+    for (Int_t j = 0; j < clusters->GetEntriesFast(); j++) {
+      AliITSclusterV2* cluster = (AliITSclusterV2*) clusters->At(j);
+      switch (iLayer) {
+      case 1: case 2: {
+       fSPDNClustersVsModule->Fill(iModule - fGeom->GetStartSPD());
+       break;
+      }
+      case 3: case 4: {
+       fSDDClustersCharge->Fill(cluster->GetQ());
+       fSDDNClustersVsModule->Fill(iModule - fGeom->GetStartSDD());
+       break;
+      }
+      case 5: case 6: {
+       fSSDClustersCharge->Fill(cluster->GetQ());
+       fSSDNClustersVsModule->Fill(iModule - fGeom->GetStartSSD());
+       break;
+      }
+      }
+      fNClustersVsLayer->Fill(iLayer);
+    }
+  }
+
+  delete clusters;
+  itsLoader->UnloadRecPoints();
+
+
+  itsLoader->LoadTracks();
+  TTree* tracks = itsLoader->TreeT();
+  if (!tracks) return;
+  AliITStrackV2* track = new AliITStrackV2;
+  tracks->SetBranchAddress("tracks", &track);
+
+  fNTracks->Fill(tracks->GetEntries());
+  for (Int_t i = 0; i < tracks->GetEntries(); i++) {
+    tracks->GetEntry(i);
+    fTrackPt->Fill(track->Pt());
+    fTrackEta->Fill(track->Eta());
+    fTrackPhi->Fill(track->Phi() * TMath::RadToDeg());
+    fTrackDEdxVsP->Fill(track->P(), track->GetdEdx());
+  }
+
+  AliLoader* tpcLoader = runLoader->GetLoader("TPCLoader");
+  if (tpcLoader) {
+    tpcLoader->LoadTracks();
+    TTree* tracksTPC = tpcLoader->TreeT();
+    if (tracksTPC) {
+      fNTracksITSTPC->Fill(tracks->GetEntries(), tracksTPC->GetEntries());
+    }
+    tpcLoader->UnloadTracks();
+  }
+
+  delete track;
+  itsLoader->UnloadTracks();
+}
diff --git a/MONITOR/AliMonitorITS.h b/MONITOR/AliMonitorITS.h
new file mode 100644 (file)
index 0000000..d188f19
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIMONITORITS_H
+#define ALIMONITORITS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMonitor.h"
+#include "AliMonitorHisto.h"
+#include "AliITSgeom.h"
+
+
+class AliMonitorITS : public AliMonitor {
+public:
+  AliMonitorITS(AliITSgeom* param);
+
+  virtual void     CreateHistos(TFolder* folder);
+  virtual void     FillHistos(AliRunLoader* runLoader, 
+                             AliRawReader* rawReader);
+
+private:
+  AliITSgeom*      fGeom;               // ITS geometry
+
+  AliMonitorHisto* fSDDDigitsCharge;    // charge distribution of ITS-SDD digits
+  AliMonitorHisto* fSSDDigitsCharge;    // charge distribution of ITS-SSD digits
+  AliMonitorHisto* fSDDClustersCharge;  // charge distribution of ITS-SDD clusters
+  AliMonitorHisto* fSSDClustersCharge;  // charge distribution of ITS-SSD clusters
+  AliMonitorHisto* fSPDNClustersVsModule;  // mean number of ITS-SPD clusters per module
+  AliMonitorHisto* fSDDNClustersVsModule;  // mean number of ITS-SDD clusters per module
+  AliMonitorHisto* fSSDNClustersVsModule;  // mean number of ITS-SSD clusters per module
+  AliMonitorHisto* fNClustersVsLayer;   // mean number of ITS clusters per layer
+  AliMonitorHisto* fNTracks;            // number of ITS tracks per event
+  AliMonitorHisto* fNTracksITSTPC;      // correlation of number of ITS and TPC tracks per event
+  AliMonitorHisto* fTrackPt;            // pt distribution of ITS tracks
+  AliMonitorHisto* fTrackEta;           // eta distribution of ITS tracks
+  AliMonitorHisto* fTrackPhi;           // phi distribution of ITS tracks
+  AliMonitorHisto* fTrackDEdxVsP;       // dE/dx vs momentum distribution of TPC tracks
+
+  ClassDef(AliMonitorITS, 0)   // creation and filling of monitor histograms for ITS
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorPlot.cxx b/MONITOR/AliMonitorPlot.cxx
new file mode 100644 (file)
index 0000000..dba25a0
--- /dev/null
@@ -0,0 +1,153 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This is the base class for plots used to monitor the quality of the      //
+//  recorded data.                                                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorPlot.h"
+
+
+ClassImp(AliMonitorPlot) 
+
+
+Bool_t  AliMonitorPlot::fgDrawRef = kTRUE;
+Float_t AliMonitorPlot::fgThreshold = 5.0;
+
+Color_t AliMonitorPlot::fgColorData = kBlack;
+Color_t AliMonitorPlot::fgColorRef = kBlue;
+Color_t AliMonitorPlot::fgColorCompare = kRed;
+
+
+//_____________________________________________________________________________
+AliMonitorPlot::AliMonitorPlot() : TNamed()
+{
+// default contructor
+
+  fNumberOfEvents = 0;
+}
+
+//_____________________________________________________________________________
+AliMonitorPlot::AliMonitorPlot(const AliMonitorPlot& plot) :
+  TNamed(plot)
+{
+// copy constructor
+
+  fNumberOfEvents = plot.fNumberOfEvents;
+}
+
+//_____________________________________________________________________________
+AliMonitorPlot::AliMonitorPlot(const char* name, const char* title) :
+  TNamed(name, title)
+{
+// constructor setting name and title
+
+  fNumberOfEvents = 0;
+}
+
+
+
+//_____________________________________________________________________________
+void AliMonitorPlot::SetDrawRef(Bool_t drawRef)
+{
+// set the flag for drawing the reference plot
+
+  fgDrawRef = drawRef;
+}
+
+//_____________________________________________________________________________
+void AliMonitorPlot::SetThreshold(Float_t threshold)
+{
+// set the threshold in standard deviations for the comparison 
+// to the reference plot.
+// no comparison is performed, if the threshold is <= 0
+
+  fgThreshold = threshold;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorPlot::DrawEvent(Int_t number)
+{
+// draw the normalized monitor plot together with the reference
+// plot and the comparison plot (if available)
+// for the "number"th last event
+
+  if (!GetEvent(number)) return;
+  if (fgDrawRef) ComparePlot();
+  DrawPlot();
+}
+
+//_____________________________________________________________________________
+void AliMonitorPlot::DrawSum(Int_t number)
+{
+// draw the normalized monitor plot together with the reference
+// plot and the comparison plot (if available)
+// for the sum of the last "number" events
+
+  if (!GetSum(number)) return;
+  if (fgDrawRef) ComparePlot();
+  DrawPlot();
+}
+
+//_____________________________________________________________________________
+void AliMonitorPlot::DrawRun()
+{
+// draw the normalized monitor plot together with the reference
+// plot and the comparison plot (if available)
+// for all monitored events of the current run
+
+  if (!GetRun()) return;
+  if (fgDrawRef) ComparePlot();
+  DrawPlot();
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorPlot::CompareEvent(Int_t number)
+{
+// compare the normalized monitor plot for the "number"th last event
+// to the reference plot
+
+  if (!GetEvent(number)) return kTRUE;
+  return ComparePlot();
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorPlot::CompareSum(Int_t number)
+{
+// compare the normalized monitor plot for the sum of the last 
+// "number" events to the reference plot
+
+  if (!GetSum(number)) return kTRUE;
+  return ComparePlot();
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorPlot::CompareRun()
+{
+// compare the normalized monitor plot for all monitored events 
+// of the current run to the reference plot
+
+  if (!GetRun()) return kTRUE;
+  return ComparePlot();
+}
+
diff --git a/MONITOR/AliMonitorPlot.h b/MONITOR/AliMonitorPlot.h
new file mode 100644 (file)
index 0000000..1cc3a44
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef ALIMONITORPLOT_H
+#define ALIMONITORPLOT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TNamed.h>
+#include <TH1.h>
+#include <TString.h>
+
+
+class AliMonitorPlot : public TNamed {
+public:
+  AliMonitorPlot();
+  AliMonitorPlot(const AliMonitorPlot& plot);
+  AliMonitorPlot(const char* name, const char* title);
+
+  virtual void    SetReference(TH1* ref) = 0;
+  virtual void    SetReference(AliMonitorPlot* ref) = 0;
+  inline void     SetDescription(TString description) 
+                    {fDescription = description;};
+  inline TString  GetDescription() {return fDescription;};
+
+  virtual void    Update() = 0;
+  virtual void    Add(AliMonitorPlot* plot) = 0;
+  virtual void    Reset() = 0;
+  virtual void    ResetList() = 0;
+
+  static void     SetDrawRef(Bool_t drawRef = kTRUE); // *MENU*
+  static Bool_t   GetDrawRef() {return fgDrawRef;};
+  static void     SetThreshold(Float_t threshold); // *MENU*
+  static Float_t  GetThreshold() {return fgThreshold;};
+
+  virtual void    DrawEvent(Int_t number = 1); // *MENU*
+  virtual void    DrawSum(Int_t number); // *MENU*
+  virtual void    DrawRun(); // *MENU*
+
+  virtual Bool_t  CompareEvent(Int_t number = 1);
+  virtual Bool_t  CompareSum(Int_t number);
+  virtual Bool_t  CompareRun();
+
+protected:
+  virtual Bool_t  ComparePlot() = 0;
+  virtual Bool_t  GetEvent(Int_t number = 1) = 0;
+  virtual Bool_t  GetSum(Int_t number) = 0;
+  virtual Bool_t  GetRun() = 0;
+  virtual void    DrawPlot() = 0;
+
+  TString         fDescription;  // description of the monitor histogram
+  Int_t           fNumberOfEvents;// number of monitored events
+
+  static Bool_t   fgDrawRef;     //! draw the reference histogram or not
+  static Float_t  fgThreshold;   //! threshold for the comparison to the reference histogram
+
+  static Color_t  fgColorData;   //! color of the data histogram
+  static Color_t  fgColorRef;    //! color of the reference histogram
+  static Color_t  fgColorCompare;//! color of the comparison histogram
+
+  ClassDef(AliMonitorPlot, 1)   // base class for plots used to monitor the quality of the recorded data
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorProcess.cxx b/MONITOR/AliMonitorProcess.cxx
new file mode 100644 (file)
index 0000000..ea95240
--- /dev/null
@@ -0,0 +1,660 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This is the class for perfoming the monitoring process.                  //
+//  It checks if a raw data file exists, loops over the events in the raw    //
+//  data file, reconstructs TPC and ITS clusters and tracks, fills the       //
+//  monitor histograms and sends the updated histograms to the clients.      //
+//  Then the raw data file is deleted and it waits for a new file.           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorProcess.h"
+#include "AliMonitorTPC.h"
+#include "AliMonitorITS.h"
+#include "AliMonitorV0s.h"
+#include "AliRawReaderRoot.h"
+#include "AliLoader.h"
+#include "AliRun.h"
+#include "AliTPC.h"
+#include "AliTPCclustererMI.h"
+#include "AliTPCtrackerMI.h"
+#include "AliITS.h"
+#include "AliITSclustererV2.h"
+#include "AliITStrackerV2.h"
+#include "AliITSLoader.h"
+#include "AliV0vertexer.h"
+#include <TSystem.h>
+#include <TSocket.h>
+#include <TMessage.h>
+#include <TGridResult.h>
+#include <TROOT.h>
+
+
+ClassImp(AliMonitorProcess) 
+
+
+const Int_t AliMonitorProcess::kgPort = 9327;
+
+
+//_____________________________________________________________________________
+AliMonitorProcess::AliMonitorProcess(const char* alienDir,
+                                    const char* fileNameGalice)
+{
+// initialize the monitoring process and the monitor histograms
+
+  fGrid = TGrid::Connect("alien", gSystem->Getenv("USER"));
+  if (!fGrid || fGrid->IsZombie() || !fGrid->IsConnected()) {
+    delete fGrid;
+    Fatal("AliMonitorProcess", "could not connect to alien");
+  }
+  fGrid->cd(alienDir);
+  fLogicalFileName = "";
+  fFileName = "";
+
+  fRunLoader = AliRunLoader::Open(fileNameGalice);
+  if (!fRunLoader) Fatal("AliMonitorProcess", 
+                        "could not get run loader from file %s", 
+                        fileNameGalice);
+
+  fRunLoader->CdGAFile();
+  fTPCParam = AliTPC::LoadTPCParam(gFile);
+  if (!fTPCParam) Fatal("AliMonitorProcess", "could not load TPC parameters");
+
+  fRunLoader->LoadgAlice();
+  gAlice = fRunLoader->GetAliRun();
+  if (!gAlice) Fatal("AliMonitorProcess", "no gAlice object found");
+  AliITS* ITS = (AliITS*) gAlice->GetModule("ITS");
+  if (!ITS) Fatal("AliMonitorProcess", "no ITS detector found");
+  fITSgeom = ITS->GetITSgeom();
+  if (!fITSgeom) Fatal("AliMonitorProcess", "could not load ITS geometry");
+
+  fRunNumber = 0;
+  fSubRunNumber = 0;
+  fNEvents = 0;
+  fNEventsMin = 2;
+  fWriteHistoList = kFALSE;
+
+  fTopFolder = new TFolder("Monitor", "monitor histograms");
+  fTopFolder->SetOwner(kTRUE);
+
+  fMonitors.Add(new AliMonitorTPC(fTPCParam));
+  fMonitors.Add(new AliMonitorITS(fITSgeom));
+  fMonitors.Add(new AliMonitorV0s);
+
+  for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
+    ((AliMonitor*) fMonitors[iMonitor])->CreateHistos(fTopFolder);
+  }
+
+  TIterator* iFolder = fTopFolder->GetListOfFolders()->MakeIterator();
+  while (TFolder* folder = (TFolder*) iFolder->Next()) folder->SetOwner(kTRUE);
+  delete iFolder;
+
+  fFile = TFile::Open("monitor_tree.root", "RECREATE");
+  if (!fFile || !fFile->IsOpen()) {
+    Fatal("AliMonitorProcess", "could not open file for tree");
+  }
+  fTree = new TTree("MonitorTree", "tree for monitoring");
+  for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
+    ((AliMonitor*) fMonitors[iMonitor])->CreateBranches(fTree);
+  }
+  gROOT->cd();
+
+  fServerSocket = new TServerSocket(kgPort, kTRUE);
+  fServerSocket->SetOption(kNoBlock, 1);
+  fDisplaySocket = NULL;
+  CheckForConnections();
+
+  fStatus = kStopped;
+  fStopping = kFALSE;
+}
+
+//_____________________________________________________________________________
+AliMonitorProcess::~AliMonitorProcess()
+{
+// clean up
+
+  fMonitors.Delete();
+  delete fTopFolder;
+  delete fRunLoader;
+
+  delete fServerSocket;
+  fSockets.Delete();
+  delete fDisplaySocket;
+
+  fGrid->Close();
+  delete fGrid;
+
+  fFile->Close();
+  delete fFile;
+  gSystem->Unlink("monitor_tree.root");
+}
+
+
+//_____________________________________________________________________________
+const char* AliMonitorProcess::GetRevision()
+{
+  return "$Revision$";
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorProcess::Run()
+{
+// run the monitor process: 
+//  check for a raw data file, process the raw data file and delete it
+
+  fStopping = kFALSE;
+
+  while (!fStopping) {
+    fStatus = kWaiting;
+    while (!CheckForNewFile()) {
+      CheckForConnections();
+      fStatus = kWaiting;
+      if (fStopping) break;
+      gSystem->Sleep(10);
+    }
+    if (fStopping) break;
+
+    ProcessFile();
+  }
+
+  WriteHistos();
+
+  fStopping = kFALSE;
+  fStatus = kStopped;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorProcess::Stop()
+{
+// set the fStopping flag to terminate the monitor process after the current
+// event was processed
+
+  if (fStatus != kStopped) fStopping = kTRUE;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorProcess::ProcessFile(const char* fileName)
+{
+// create a file with monitor histograms for a single file
+
+  if (fStatus != kStopped) {
+    Error("ProcessFile", "ProcessFile can not be called"
+         " while the monitor process is running");
+    return;
+  }
+
+  fFileName = fileName;
+  Int_t nEventMin = fNEventsMin;
+  fNEventsMin = 1;
+  ProcessFile();
+  WriteHistos();
+  fNEventsMin = nEventMin;
+  fStatus = kStopped;
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::CheckForNewFile()
+{
+// check whether a new file was registered in alien
+
+  TGridResult* result = fGrid->Ls();
+  Long_t maxDate = -1;
+  Long_t maxTime = -1;
+  TString fileName;
+
+  while (const char* entry = result->Next()) {
+    // entry = host_date_time.root
+    TString entryCopy(entry);
+    char* p = const_cast<char*>(entryCopy.Data());
+    if (!strsep(&p, "_") || !p) continue;  // host name
+    char* dateStr = strsep(&p, "_");
+    if (!dateStr || !p) continue;
+    char* timeStr = strsep(&p, ".");
+    if (!timeStr || !p) continue;
+    Long_t date = atoi(dateStr);
+    Long_t time = atoi(timeStr);
+
+    if ((date > maxDate) || ((date == maxDate) && (time > maxTime))) {
+      maxDate = date;
+      maxTime = time;
+      fileName = entry;
+    }
+  }
+
+  if (maxDate < 0) return kFALSE;  // no files found
+  if (fLogicalFileName.CompareTo(fileName) == 0) return kFALSE;  // no new file
+
+  fLogicalFileName = fileName;
+  fFileName = fGrid->GetPhysicalFileName(fLogicalFileName.Data());
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ProcessFile()
+{
+// loop over all events in the raw data file, run the reconstruction
+// and fill the monitor histograms
+
+  Int_t nEvents = GetNumberOfEvents(fFileName);
+  if (nEvents <= 0) return kFALSE;
+  Info("ProcessFile", "found %d event(s) in file %s", 
+       nEvents, fFileName.Data());
+
+  // loop over the events
+  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
+    fStatus = kReading;
+    fRunLoader->SetEventNumber(0);
+    AliRawReaderRoot rawReader(fFileName, iEvent);
+    if (fStopping) break;
+    if (rawReader.GetRunNumber() != fRunNumber) {
+      WriteHistos();
+      StartNewRun();
+      fRunNumber = rawReader.GetRunNumber();
+      fEventNumber[0] = rawReader.GetEventId()[0];
+      fEventNumber[1] = rawReader.GetEventId()[1];
+      fSubRunNumber = 0;
+      if (fStopping) break;
+    }
+
+    if (!ReconstructTPC(&rawReader)) return kFALSE;
+    if (fStopping) break;
+    if (!ReconstructITS(&rawReader)) return kFALSE;
+    if (fStopping) break;
+    if (!ReconstructV0s()) return kFALSE;
+    if (fStopping) break;
+
+    if (fDisplaySocket) fDisplaySocket->Send("new event");
+
+    Info("ProcessFile", "filling histograms...");
+    fStatus = kFilling;
+    for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
+      ((AliMonitor*) fMonitors[iMonitor])->FillHistos(fRunLoader, &rawReader);
+      if (fStopping) break;
+    }
+    if (fStopping) break;
+
+    Info("ProcessFile", "updating histograms...");
+    fStatus = kUpdating;
+    TIterator* iFolder = fTopFolder->GetListOfFolders()->MakeIterator();
+    while (TFolder* folder = (TFolder*) iFolder->Next()) {
+      TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+      while (AliMonitorPlot* histo = (AliMonitorPlot*) iHisto->Next()) {
+       histo->Update();
+      }
+      delete iHisto;
+    }
+    delete iFolder;
+    if (fStopping) break;
+
+    Info("ProcessFile", "filling the tree...");
+    fTree->Fill();
+
+    Info("ProcessFile", "broadcasting histograms...");
+    CheckForConnections();
+    BroadcastHistos();
+
+    fNEvents++;
+    if (fStopping) break;
+  }
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorProcess::Reset()
+{
+// write the current histograms to a file and reset them
+
+  if (fSubRunNumber == 0) fSubRunNumber++;
+  WriteHistos();
+  StartNewRun();
+  fSubRunNumber++;
+}
+
+
+//_____________________________________________________________________________
+UInt_t AliMonitorProcess::GetEventPeriodNumber()
+{
+// get the period number from the event id
+
+  return (fEventNumber[1] >> 4);
+}
+
+//_____________________________________________________________________________
+UInt_t AliMonitorProcess::GetEventOrbitNumber()
+{
+// get the orbit number from the event id
+
+  return ((fEventNumber[1] & 0x000F) << 20) + (fEventNumber[0] >> 12);
+}
+
+//_____________________________________________________________________________
+UInt_t AliMonitorProcess::GetEventBunchNumber()
+{
+// get the bunch number from the event id
+
+  return (fEventNumber[0] % 0x0FFF);
+}
+
+//_____________________________________________________________________________
+Int_t AliMonitorProcess::GetNumberOfEvents(const char* fileName)
+{
+// determine the number of events in the given raw data file
+
+  Int_t nEvents = -1;
+
+  TFile* file = TFile::Open(fileName);
+  if (!file || !file->IsOpen()) {
+    Error("GetNumberOfEvents", "could not open file %s", fileName);
+    if (file) delete file;
+    return -1;
+  }
+
+  TTree* tree = (TTree*) file->Get("RAW");
+  if (!tree) {
+    Error("GetNumberOfEvents", "could not find tree with raw data");
+  } else {
+    nEvents = (Int_t) tree->GetEntries();
+  }
+  file->Close();
+  delete file;
+
+  return nEvents;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader)
+{
+// find TPC clusters and tracks
+
+  fStatus = kRecTPC;
+
+  AliLoader* tpcLoader = fRunLoader->GetLoader("TPCLoader");
+  if (!tpcLoader) {
+    Error("ReconstructTPC", "no TPC loader found");
+    return kFALSE;
+  }
+  gSystem->Unlink("TPC.RecPoints.root");
+  gSystem->Unlink("TPC.Tracks.root");
+
+  // cluster finder
+  Info("ReconstructTPC", "reconstructing clusters...");
+  tpcLoader->LoadRecPoints("recreate");
+  AliTPCclustererMI clusterer(fTPCParam);
+  tpcLoader->MakeRecPointsContainer();
+  clusterer.SetOutput(tpcLoader->TreeR());
+  clusterer.Digits2Clusters(rawReader);
+  tpcLoader->WriteRecPoints("OVERWRITE");
+
+  // track finder
+  Info("ReconstructTPC", "reconstructing tracks...");
+  tpcLoader->LoadTracks("recreate");
+  {
+    AliTPCtrackerMI tracker(fTPCParam);
+    tracker.Clusters2Tracks();
+  }
+
+  tpcLoader->UnloadRecPoints();
+  tpcLoader->UnloadTracks();
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader)
+{
+// find ITS clusters and tracks
+
+  fStatus = kRecITS;
+
+  AliLoader* itsLoader = fRunLoader->GetLoader("ITSLoader");
+  if (!itsLoader) {
+    Error("ReconstructITS", "no ITS loader found");
+    return kFALSE;
+  }
+  AliLoader* tpcLoader = fRunLoader->GetLoader("TPCLoader");
+  if (!tpcLoader) {
+    Error("ReconstructITS", "no TPC loader found");
+    return kFALSE;
+  }
+  gSystem->Unlink("ITS.RecPoints.root");
+  gSystem->Unlink("ITS.Tracks.root");
+
+  // cluster finder
+  Info("ReconstructITS", "reconstructing clusters...");
+  itsLoader->LoadRecPoints("recreate");
+  AliITSclustererV2 clusterer(fITSgeom);
+  itsLoader->MakeRecPointsContainer();
+  clusterer.Digits2Clusters(rawReader);
+
+  // track finder
+  Info("ReconstructITS", "reconstructing tracks...");
+  itsLoader->LoadTracks("recreate");
+  itsLoader->MakeTracksContainer();
+  tpcLoader->LoadTracks();
+  AliITStrackerV2 tracker(fITSgeom);
+  tracker.LoadClusters(itsLoader->TreeR());
+  tracker.Clusters2Tracks(tpcLoader->TreeT(), itsLoader->TreeT());
+  tracker.UnloadClusters();
+  itsLoader->WriteTracks("OVERWRITE");
+
+  itsLoader->UnloadRecPoints();
+  itsLoader->UnloadTracks();
+  tpcLoader->UnloadTracks();
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructV0s()
+{
+// find V0s
+
+  fStatus = kRecV0s;
+
+  AliITSLoader* itsLoader = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader");
+  if (!itsLoader) {
+    Error("ReconstructV0", "no ITS loader found");
+    return kFALSE;
+  }
+  gSystem->Unlink("ITS.V0s.root");
+
+  // V0 finder
+  Info("ReconstructV0s", "reconstructing V0s...");
+  itsLoader->LoadTracks("read");
+  itsLoader->LoadV0s("recreate");
+  AliV0vertexer vertexer;
+  TTree* tracks = itsLoader->TreeT();
+  if (!tracks) {
+    Error("ReconstructV0s", "no ITS tracks tree found");
+    return kFALSE;
+  }
+  if (!itsLoader->TreeV0()) itsLoader->MakeTree("V0");
+  TTree* v0s = itsLoader->TreeV0();
+  vertexer.Tracks2V0vertices(tracks, v0s);
+  itsLoader->WriteV0s("OVERWRITE");
+
+  itsLoader->UnloadTracks();
+  itsLoader->UnloadV0s();
+  return kTRUE;
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::WriteHistos()
+{
+// write the monitor tree and the monitor histograms to the file 
+// "monitor_<run number>[_<sub_run_number>].root"
+// if at least fNEventsMin events were monitored
+
+  fStatus = kWriting;
+
+  // rename tree file and create a new one
+  fFile->cd();
+  fTree->Write();
+  fFile->Close();
+  delete fFile;
+
+  char fileName[256];
+  sprintf(fileName, "monitor_tree_%d.root", fRunNumber);
+  if (fSubRunNumber > 0) {
+    sprintf(fileName, "monitor_tree_%d_%d.root", fRunNumber, fSubRunNumber);
+  }
+  if (fNEvents < fNEventsMin) {
+    gSystem->Unlink("monitor_tree.root");
+  } else {
+    gSystem->Rename("monitor_tree.root", fileName);
+  }
+
+  fFile = TFile::Open("monitor_tree.root", "RECREATE");
+  if (!fFile || !fFile->IsOpen()) {
+    Fatal("WriteHistos", "could not open file for tree");
+  }
+  fTree = new TTree("MonitorTree", "tree for monitoring");
+  for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) {
+    ((AliMonitor*) fMonitors[iMonitor])->CreateBranches(fTree);
+  }
+  gROOT->cd();
+
+  // write the histograms
+  if (fNEvents < fNEventsMin) return kTRUE;
+
+  if (!fWriteHistoList) {
+    TIterator* iFolder = fTopFolder->GetListOfFolders()->MakeIterator();
+    while (TFolder* folder = (TFolder*) iFolder->Next()) {
+      TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+      while (AliMonitorPlot* histo = (AliMonitorPlot*) iHisto->Next()) {
+       histo->ResetList();
+      }
+      delete iHisto;
+    }
+    delete iFolder;
+  }
+
+  Bool_t result = kTRUE;
+  sprintf(fileName, "monitor_%d.root", fRunNumber);
+  if (fSubRunNumber > 0) {
+    sprintf(fileName, "monitor_%d_%d.root", fRunNumber, fSubRunNumber);
+  }
+  TFile* file = TFile::Open(fileName, "recreate");
+  if (!file || !file->IsOpen()) {
+    Error("WriteHistos", "could not open file %s", fileName);
+    result = kFALSE;
+  } else {
+    fTopFolder->Write();
+    file->Close();
+  }
+  if (file) delete file;
+
+  return result;
+}
+
+//_____________________________________________________________________________
+void AliMonitorProcess::StartNewRun()
+{
+// reset the histograms for a new run
+
+  fStatus = kResetting;
+  TIterator* iFolder = fTopFolder->GetListOfFolders()->MakeIterator();
+  while (TFolder* folder = (TFolder*) iFolder->Next()) {
+    TIterator* iHisto = folder->GetListOfFolders()->MakeIterator();
+    while (AliMonitorPlot* histo = (AliMonitorPlot*) iHisto->Next()) {
+      histo->Reset();
+    }
+    delete iHisto;
+  }
+  delete iFolder;
+
+  fNEvents = 0;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorProcess::CheckForConnections()
+{
+// check if new clients want to connect and add them to the list of sockets
+
+  TMessage message(kMESS_OBJECT);
+  message.WriteObject(fTopFolder); 
+  fStatus = kConnecting;
+
+  TSocket* socket;
+  while ((socket = fServerSocket->Accept()) != (TSocket*)-1) {
+    char socketType[256];
+    if (!socket->Recv(socketType, 255)) continue;
+    if (strcmp(socketType, "client") == 0) {
+      if ((fNEvents == 0) || (socket->Send(message) >= 0)) {
+       fSockets.Add(socket);
+       TInetAddress adr = socket->GetInetAddress();
+       Info("CheckForConnections", "new client:\n %s (%s), port %d\n",
+            adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+      }
+    } else if (strcmp(socketType, "display") == 0) {
+      if (fDisplaySocket) {
+       fDisplaySocket->Close();
+       delete fDisplaySocket;
+      }
+      fDisplaySocket = socket;
+      fDisplaySocket->SetOption(kNoBlock, 1);
+      TInetAddress adr = socket->GetInetAddress();
+      Info("CheckForConnections", "new display:\n %s (%s), port %d\n",
+          adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+    }
+  }
+
+  for (Int_t iSocket = 0; iSocket < fSockets.GetEntriesFast(); iSocket++) {
+    socket = (TSocket*) fSockets[iSocket];
+    if (!socket) continue;
+    if (!socket->IsValid()) {
+      // remove invalid sockets from the list
+      TInetAddress adr = socket->GetInetAddress();
+      Info("BroadcastHistos", "disconnect client:\n %s (%s), port %d\n",
+          adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+      delete fSockets.RemoveAt(iSocket);
+    }
+  }
+  fSockets.Compress();
+}
+
+//_____________________________________________________________________________
+void AliMonitorProcess::BroadcastHistos()
+{
+// send the monitor histograms to the clients
+
+  fStatus = kBroadcasting;
+  TMessage message(kMESS_OBJECT);
+  message.WriteObject(fTopFolder); 
+
+  for (Int_t iSocket = 0; iSocket < fSockets.GetEntriesFast(); iSocket++) {
+    TSocket* socket = (TSocket*) fSockets[iSocket];
+    if (!socket) continue;
+    if (!socket->IsValid() || (socket->Send(message) < 0)) {
+      // remove the socket from the list if there was an error
+      TInetAddress adr = socket->GetInetAddress();
+      Info("BroadcastHistos", "disconnect client:\n %s (%s), port %d\n",
+          adr.GetHostName(), adr.GetHostAddress(), adr.GetPort());
+      delete fSockets.RemoveAt(iSocket);
+    }
+  }
+  fSockets.Compress();
+}
diff --git a/MONITOR/AliMonitorProcess.h b/MONITOR/AliMonitorProcess.h
new file mode 100644 (file)
index 0000000..172bcbe
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef ALIMONITORPROCESS_H
+#define ALIMONITORPROCESS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include <TObject.h>
+#include <TString.h>
+#include <TFolder.h>
+#include <TFile.h>
+#include <TTree.h>
+#include <TObjArray.h>
+#include <TServerSocket.h>
+#include <TTimer.h>
+#include <TGrid.h>
+#include "AliRunLoader.h"
+#include "AliRawReader.h"
+#include "AliTPCParam.h"
+#include "AliITSgeom.h"
+
+
+class AliMonitorProcess : public TObject {
+public:
+  AliMonitorProcess(const char* alienDir,
+                   const char* fileNameGalice = "galice.root");
+  virtual ~AliMonitorProcess();
+
+  static const char* GetRevision();
+
+  void             Run();
+  void             Stop();
+  void             Reset();
+
+  void             ProcessFile(const char* fileName);
+
+  UInt_t           GetRunNumber() {return fRunNumber;};
+  UInt_t           GetEventPeriodNumber();
+  UInt_t           GetEventOrbitNumber();
+  UInt_t           GetEventBunchNumber();
+
+  enum EStatus     {kStopped, kWaiting, kReading, kRecTPC, kRecITS, kRecV0s,
+                   kFilling, kUpdating, kWriting, kResetting, 
+                   kConnecting, kBroadcasting};
+  EStatus          GetStatus() {return fStatus;};
+  Bool_t           WillStop() {return fStopping;};
+  Bool_t           IsStopped() {return (fStatus == kStopped);};
+
+  Int_t            GetNumberOfEvents() {return fNEvents;};
+  Int_t            GetNumberOfClients() {return fSockets.GetEntriesFast();};
+  TObjArray*       GetListOfClients() {return &fSockets;};
+  Int_t            GetNEventsMin() {return fNEventsMin;};
+  void             SetNEventsMin(Int_t nEventsMin) {fNEventsMin = nEventsMin;};
+  void             SetWriteHistoList(Bool_t writeHistoList = kTRUE) 
+                                         {fWriteHistoList = writeHistoList;};
+  
+  static const Int_t kgPort;
+
+private:
+  Bool_t           CheckForNewFile();
+  Bool_t           ProcessFile();
+  Int_t            GetNumberOfEvents(const char* fileName);
+  Bool_t           ReconstructTPC(AliRawReader* rawReader);
+  Bool_t           ReconstructITS(AliRawReader* rawReader);
+  Bool_t           ReconstructV0s();
+
+  Bool_t           WriteHistos();
+  void             StartNewRun();
+
+  void             CheckForConnections();
+  void             BroadcastHistos();
+
+  TGrid*           fGrid;
+  AliRunLoader*    fRunLoader;
+  AliTPCParam*     fTPCParam;
+  AliITSgeom*      fITSgeom;
+  TString          fLogicalFileName;
+  TString          fFileName;
+
+  UInt_t           fRunNumber;
+  UInt_t           fSubRunNumber;
+  UInt_t           fEventNumber[2];
+  Int_t            fNEvents;
+  Int_t            fNEventsMin;
+  Bool_t           fWriteHistoList;
+
+  TFolder*         fTopFolder;
+  TObjArray        fMonitors;
+  TFile*           fFile;
+  TTree*           fTree;
+
+  TServerSocket*   fServerSocket;
+  TObjArray        fSockets;
+  TSocket*         fDisplaySocket;
+
+  EStatus          fStatus;
+  Bool_t           fStopping;
+
+  ClassDef(AliMonitorProcess, 0)   // class for performing the monitoring
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorTPC.cxx b/MONITOR/AliMonitorTPC.cxx
new file mode 100644 (file)
index 0000000..54f7135
--- /dev/null
@@ -0,0 +1,225 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class creates and fills the monitor histograms for the TPC          //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorTPC.h"
+#include "AliTPCRawStream.h"
+#include "AliTPCClustersRow.h"
+#include "AliTPCclusterMI.h"
+#include "AliTPCtrack.h"
+
+
+ClassImp(AliMonitorDataTPC) 
+
+
+//_____________________________________________________________________________
+AliMonitorDataTPC::AliMonitorDataTPC()
+{
+  fPt = fEta = fPhi = NULL;
+  fSize = 0;
+}
+
+//_____________________________________________________________________________
+AliMonitorDataTPC::AliMonitorDataTPC(Int_t size)
+{
+  fPt = new Float_t[size];
+  fEta = new Float_t[size];
+  fPhi = new Float_t[size];
+  fSize = size;
+}
+
+//_____________________________________________________________________________
+AliMonitorDataTPC::~AliMonitorDataTPC()
+{
+  delete[] fPt;
+  delete[] fEta;
+  delete[] fPhi;
+}
+
+//_____________________________________________________________________________
+void AliMonitorDataTPC::SetSize(Int_t size)
+{
+  if (size > fSize) {
+    delete[] fPt;
+    delete[] fEta;
+    delete[] fPhi;
+    fPt = new Float_t[size];
+    fEta = new Float_t[size];
+    fPhi = new Float_t[size];
+    fSize = size;
+  }
+}
+
+
+
+ClassImp(AliMonitorTPC) 
+
+
+//_____________________________________________________________________________
+AliMonitorTPC::AliMonitorTPC(AliTPCParam* param)
+{
+// create a TPC monitor object with the given parameters
+
+  fParam = param;
+  fData = new AliMonitorDataTPC(10000);
+}
+
+//_____________________________________________________________________________
+AliMonitorTPC::~AliMonitorTPC()
+{
+  delete fData;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTPC::CreateHistos(TFolder* folder)
+{
+// create the TPC monitor histograms
+
+  fFolder = folder->AddFolder("TPC", "TPC");
+
+  fPadsCharge = CreateHisto1("PadsCharge", "charge distribution of pads", 
+                            100, 0, 200, "charge", "#Delta N/N",
+                            AliMonitorHisto::kNormEvents);
+
+  fClustersCharge = CreateHisto1("ClustersCharge", 
+                                "charge distribution of clusters", 
+                                100, 0, 1000, "charge", "#Delta N/N",
+                                AliMonitorHisto::kNormEvents);
+
+  Int_t nRows = fParam->GetNRowLow() + fParam->GetNRowUp();
+  fNClustersVsRow = CreateHisto1("NClustersVsRow", 
+                                "mean number of clusters per pad row", 
+                                nRows, -0.5, nRows-0.5,
+                                "pad row", "<N_{clusters}>",
+                                AliMonitorHisto::kNormEvents);
+
+  Int_t nSector = fParam->GetNInnerSector();
+  fNClustersVsSector = CreateHisto1("NClustersVsSector", 
+                                   "mean number of clusters per sector", 
+                                   nSector, -0.5, nSector-0.5, 
+                                   "sector", "<N_{clusters}>",
+                                   AliMonitorHisto::kNormEvents);
+
+  fNTracks = CreateTrend("NTracks", "number of tracks per event", 
+                        "N_{tracks}");
+
+  fTrackPt = CreateHisto1("TrackPt", "pt distribution of tracks", 
+                         90, 0, 3, "p_{t} [GeV/c]", "#Delta N/N",
+                         AliMonitorHisto::kNormEntries);
+
+  fTrackEta = CreateHisto1("TrackEta", "eta distribution of tracks", 
+                          100, -2, 2, "#eta", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+
+  fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks", 
+                          120, 0, 360, "#phi [#circ]", "#Delta N/N",
+                          AliMonitorHisto::kNormEntries);
+  fTrackPhi->SetDescription("The phi distribution should be flat on average.\nIf it is not flat check for dead TPC sectors.");
+
+  fTrackDEdxVsP = CreateHisto2("TrackDEdxVsP", "dE/dx of tracks", 
+                              100, 0, 3, 100, 0, 200, 
+                              "p [GeV/c]", "dE/dx", "#Delta N/N",
+                              AliMonitorHisto::kNormEntries);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTPC::CreateBranches(TTree* tree)
+{
+// create a branch with TPC variables
+
+  tree->Branch("TPC", "AliMonitorDataTPC", &fData);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTPC::FillHistos(AliRunLoader* runLoader, 
+                              AliRawReader* rawReader)
+{
+// fill the TPC monitor histogrms
+
+  rawReader->Reset();
+  AliTPCRawStream input(rawReader);
+  while (input.Next()) {
+    fPadsCharge->Fill(input.GetSignal());
+  }
+
+  AliLoader* tpcLoader = runLoader->GetLoader("TPCLoader");
+  if (!tpcLoader) return;
+
+
+  tpcLoader->LoadRecPoints();
+  TTree* clusters = tpcLoader->TreeR();
+  if (!clusters) return;
+  AliTPCClustersRow* clustersRow = new AliTPCClustersRow;
+  clustersRow->SetClass("AliTPCclusterMI");
+  clusters->SetBranchAddress("Segment", &clustersRow);
+
+  for (Int_t i = 0; i < clusters->GetEntries(); i++) {
+    clusters->GetEntry(i);
+    Int_t iSector, iRow;
+    fParam->AdjustSectorRow(clustersRow->GetID(), iSector, iRow);
+    if (iSector >= fParam->GetNInnerSector()) {
+      iRow += fParam->GetNRowLow();
+      iSector -= fParam->GetNInnerSector();
+    }
+
+    TObjArray* array = clustersRow->GetArray();
+    for (Int_t j = 0; j < array->GetEntriesFast(); j++) {
+      AliTPCclusterMI* cluster = (AliTPCclusterMI*) array->At(j);
+      fClustersCharge->Fill(cluster->GetQ());
+      fNClustersVsRow->Fill(iRow);
+      fNClustersVsSector->Fill(iSector);
+    }
+  }
+  fNClustersVsSector->ScaleErrorBy(100.);
+
+  delete clustersRow;
+  tpcLoader->UnloadRecPoints();
+
+
+  tpcLoader->LoadTracks();
+  TTree* tracks = tpcLoader->TreeT();
+  if (!tracks) return;
+  AliTPCtrack* track = new AliTPCtrack;
+  tracks->SetBranchAddress("tracks", &track);
+
+  fNTracks->Fill(tracks->GetEntries());
+  fData->fNTracks = (Int_t) tracks->GetEntries();
+  fData->SetSize(fData->fNTracks);
+  for (Int_t i = 0; i < tracks->GetEntries(); i++) {
+    tracks->GetEntry(i);
+    fTrackPt->Fill(track->Pt());
+    fTrackEta->Fill(track->Eta());
+    fTrackPhi->Fill(track->Phi() * TMath::RadToDeg());
+    fTrackDEdxVsP->Fill(track->P(), track->GetdEdx());
+
+    fData->fPt[i] = track->Pt();
+    fData->fEta[i] = track->Eta();
+    fData->fPhi[i] = track->Phi() * TMath::RadToDeg();
+  }
+
+  delete track;
+  tpcLoader->UnloadTracks();
+}
diff --git a/MONITOR/AliMonitorTPC.h b/MONITOR/AliMonitorTPC.h
new file mode 100644 (file)
index 0000000..ab48750
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef ALIMONITORTPC_H
+#define ALIMONITORTPC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMonitor.h"
+#include "AliMonitorHisto.h"
+#include "AliMonitorTrend.h"
+#include "AliTPCParam.h"
+
+
+class AliMonitorDataTPC : public TObject {
+public:
+  AliMonitorDataTPC();
+  AliMonitorDataTPC(Int_t size);
+  virtual ~AliMonitorDataTPC();
+  void     SetSize(Int_t size);
+
+  Int_t    fNTracks;   // number of TPC tracks
+  Float_t* fPt;        //[fNTracks]
+  Float_t* fEta;       //[fNTracks]
+  Float_t* fPhi;       //[fNTracks]
+
+private:
+  Int_t    fSize;      //! size of the arrays
+
+  ClassDef(AliMonitorDataTPC, 1)   // data structure for the TPC monitor tree branch
+};
+
+
+class AliMonitorTPC : public AliMonitor {
+public:
+  AliMonitorTPC(AliTPCParam* param);
+  virtual ~AliMonitorTPC();
+
+  virtual void     CreateHistos(TFolder* folder);
+  virtual void     CreateBranches(TTree* tree);
+  virtual void     FillHistos(AliRunLoader* runLoader, 
+                             AliRawReader* rawReader);
+
+private:
+  AliTPCParam*     fParam;              // TPC parameters
+
+  AliMonitorHisto* fPadsCharge;         // charge distribution of TPC pads
+  AliMonitorHisto* fClustersCharge;     // charge distribution of TPC clusters
+  AliMonitorHisto* fNClustersVsRow;     // mean number of TPC clusters per pad row
+  AliMonitorHisto* fNClustersVsSector;  // mean number of TPC clusters per sector
+  AliMonitorTrend* fNTracks;            // number of TPC tracks per event
+  AliMonitorHisto* fTrackPt;            // pt distribution of TPC tracks
+  AliMonitorHisto* fTrackEta;           // eta distribution of TPC tracks
+  AliMonitorHisto* fTrackPhi;           // phi distribution of TPC tracks
+  AliMonitorHisto* fTrackDEdxVsP;       // dE/dx vs momentum distribution of TPC tracks
+
+  AliMonitorDataTPC* fData;             // data for the monitor tree
+
+  ClassDef(AliMonitorTPC, 0)   // creation and filling of monitor histograms for TPC
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorTrend.cxx b/MONITOR/AliMonitorTrend.cxx
new file mode 100644 (file)
index 0000000..ae7254a
--- /dev/null
@@ -0,0 +1,376 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class maintains a plot for the evolution of a value that is used    //
+//  tomonitor the quality of the recorded data.                              //
+//  The trendgram is created and filled by a sub class of AliMonitor.        //
+//  It can be compared to a reference trendgram. For the comparison a        //
+//  maximal deviation (in standard deviations) can be specified.             //
+//  The bins where the maximal deviation is exceeded are drawn in red.       //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorTrend.h"
+#include <TVirtualPad.h>
+#include <TLine.h>
+
+
+ClassImp(AliMonitorTrend) 
+
+
+Int_t AliMonitorTrend::fgIncSize = 10;
+
+
+//_____________________________________________________________________________
+AliMonitorTrend::AliMonitorTrend()
+{
+// default contructor
+
+  fMin = fMax = 0;
+  fHistoDraw = NULL;
+  fRefMean = 0;
+  fRefSigma = -1;
+  fHistoCompare = NULL;
+}
+
+//_____________________________________________________________________________
+AliMonitorTrend::AliMonitorTrend(const AliMonitorTrend& trend) :
+  AliMonitorPlot(trend)
+{
+// copy constructor
+
+  fLabel = trend.fLabel;
+  fMin = trend.fMin;
+  fMax = trend.fMax;
+  trend.fData.Copy(fData);
+
+  fHistoDraw = NULL;
+  fRefMean = trend.fRefMean;
+  fRefSigma = trend.fRefSigma;
+  fHistoCompare = NULL;
+}
+
+//_____________________________________________________________________________
+AliMonitorTrend::AliMonitorTrend(const char* name, const char* title,
+                 const char* label, Double_t min, Double_t max) :
+  AliMonitorPlot(name, title)
+{
+// create a monitor trend
+
+  fLabel = label;
+  fMin = min;
+  fMax = max;
+
+  fHistoDraw = NULL;
+  fRefMean = fRefSigma = 0;
+  fHistoCompare = NULL;
+}
+
+//_____________________________________________________________________________
+AliMonitorTrend::~AliMonitorTrend()
+{
+// delete all histograms
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTrend::SetReference(TH1* ref)
+{
+// set the reference trend for comparison
+
+  Int_t n = ref->GetXaxis()->GetNbins();
+  if (n <= 0) return;
+
+  Double_t sum = 0;
+  Double_t sum2 = 0;
+  for (Int_t i = 1; i <= n; i++) {
+    sum += ref->GetBinContent(i);
+    sum2 += ref->GetBinContent(i) * ref->GetBinContent(i);
+  }
+
+  fRefMean = sum / n;
+  fRefSigma = TMath::Sqrt(sum2 - sum*sum/n) / n;
+}
+
+//_____________________________________________________________________________
+void AliMonitorTrend::SetReference(AliMonitorPlot* ref)
+{
+// set the reference trendgram for comparison
+
+  if (!ref->InheritsFrom(AliMonitorTrend::Class())) return;
+  fRefMean = ((AliMonitorTrend*)ref)->GetMean();
+  fRefSigma = ((AliMonitorTrend*)ref)->GetSigma();
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTrend::Fill(Double_t x)
+{
+// add a value to the monitor trend
+
+  if (fNumberOfEvents >= fData.GetSize()) {
+    fData.Set(fNumberOfEvents + fgIncSize);
+  }
+  fData[fNumberOfEvents] = x;
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorTrend::Update()
+{
+// update
+
+  fNumberOfEvents++;
+}
+
+//_____________________________________________________________________________
+void AliMonitorTrend::Add(AliMonitorPlot* plot)
+{
+// merge the given trend to this one
+
+  if (!plot->InheritsFrom(AliMonitorTrend::Class())) return;
+  AliMonitorTrend* trend = (AliMonitorTrend*) plot;
+
+  Int_t numberOfEvents = fNumberOfEvents + trend->fNumberOfEvents;
+  if (numberOfEvents >=  fData.GetSize()) {
+    fData.Set(numberOfEvents + fgIncSize);
+  }
+  for (Int_t i = 0; i < trend->fNumberOfEvents; i++) {
+    fData[fNumberOfEvents + i] = trend->fData[i];
+  }
+  fNumberOfEvents = numberOfEvents;
+}
+
+//_____________________________________________________________________________
+void AliMonitorTrend::Reset()
+{
+// reset the monitor trend for a new run
+
+  fData.Set(fgIncSize);
+  if (fHistoDraw) delete fHistoDraw;
+  fHistoDraw = NULL;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+  fNumberOfEvents = 0;
+}
+
+//_____________________________________________________________________________
+void AliMonitorTrend::ResetList()
+{
+// reset the the list of monitor histograms
+// (not applicable for trend)
+
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliMonitorTrend::ComparePlot()
+{
+// compare the data trend to the reference
+// if they deviate by more than fgThreshold standard deviations in a bin,
+// this bin is set in fHistoCompare and kFALSE is returned
+  
+  if (fRefSigma < 0) return kTRUE;
+  if (fgThreshold <= 0) return kTRUE;
+  if (!fHistoDraw) {
+    Info("Compare", "no data trend available for comparison\ncall DrawSum or DrawRaw before calling Compare");
+    return kTRUE;
+  }
+
+  Int_t nBins = fHistoDraw->GetXaxis()->GetNbins();
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = CreateHisto(nBins);
+  fHistoCompare->Reset();
+  fHistoCompare->SetOption("P");
+  fHistoCompare->SetMarkerStyle(kFullCircle);
+  fHistoCompare->SetFillStyle(0);
+  Bool_t result = kTRUE;
+
+  for (Int_t iBin = 1; iBin <= nBins; iBin++) {
+    Double_t delta = TMath::Abs(fHistoDraw->GetBinContent(iBin) - fRefMean);
+    if (delta > fgThreshold*fRefSigma) {
+      fHistoCompare->SetBinContent(iBin, fHistoDraw->GetBinContent(iBin));
+      result = kFALSE;
+    }
+  }
+
+  return result;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorTrend::GetEvent(Int_t)
+{
+// there is no single event trend
+
+  Info("GetEvent", "there is no trend for single events available");
+  return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorTrend::GetSum(Int_t number)
+{
+// get the monitor trend for the last  "number" events
+
+  if (number > fNumberOfEvents) {
+    Info("GetSum", "requested number of events (%d) exceeds range of available events (%d)\nusing last %d event(s)", 
+         number, fNumberOfEvents, fNumberOfEvents);
+    number = fNumberOfEvents;
+  }
+  if (number <= 0) return kFALSE;
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+
+  fHistoDraw = CreateHisto(number);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliMonitorTrend::GetRun()
+{
+// get the monitor trend for all monitored events of the current run
+
+  if (fHistoDraw) delete fHistoDraw;
+  if (fHistoCompare) delete fHistoCompare;
+  fHistoCompare = NULL;
+  if (fNumberOfEvents <= 0) return kFALSE;
+
+  fHistoDraw = CreateHisto(fNumberOfEvents);
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliMonitorTrend::DrawPlot()
+{
+// draw the trendgrams
+
+  fHistoDraw->SetMarkerColor(fgColorData);
+  fHistoDraw->SetLineColor(fgColorData);
+  fHistoDraw->SetLineWidth(2);
+  fHistoDraw->DrawCopy();
+
+  if ((fRefSigma > 0) && fgDrawRef) {
+    if ((fRefMean+fRefSigma > fHistoDraw->GetMaximum()) && !(fMax > fMin)) {
+      fHistoDraw->SetMaximum(fRefMean+fRefSigma * 1.1);
+    }
+
+    Double_t xMin = fHistoDraw->GetXaxis()->GetXmin();
+    Double_t xMax = fHistoDraw->GetXaxis()->GetXmax();
+    TLine* mean = new TLine(xMin, fRefMean, xMax, fRefMean);
+    mean->SetLineColor(fgColorRef);
+    mean->SetLineWidth(2);
+    mean->Draw();
+    TLine* high = new TLine(xMin, fRefMean+fRefSigma, 
+                           xMax, fRefMean+fRefSigma);
+    high->SetLineColor(fgColorRef);
+    high->SetLineWidth(2);
+    high->SetLineStyle(2);
+    high->Draw();
+    TLine* low = new TLine(xMin, fRefMean-fRefSigma, 
+                          xMax, fRefMean-fRefSigma);
+    low->SetLineColor(fgColorRef);
+    low->SetLineWidth(2);
+    low->SetLineStyle(2);
+    low->Draw();
+
+//    char option[256];
+//    sprintf(option, "%sSAME", fHistoDraw->GetOption());
+//    fHistoDraw->DrawCopy(option);
+
+    if (fHistoCompare && (fgThreshold > 0)) {
+      char option[256];
+      sprintf(option, "%sSAME", fHistoCompare->GetOption());
+      fHistoCompare->SetMarkerColor(fgColorCompare);
+      fHistoCompare->SetLineColor(fgColorCompare);
+      fHistoCompare->SetLineWidth(2);
+      fHistoCompare->DrawCopy(option);
+    }
+  }
+
+  gPad->Update();
+}
+
+
+//_____________________________________________________________________________
+TH1* AliMonitorTrend::CreateHisto(Int_t nBins)
+{
+// create a histogram for a trend plot with the last nBin entries
+
+  TH1* result = new TH1D(GetName(), GetTitle(), nBins, -nBins-0.5, -0.5);
+  result->GetXaxis()->SetTitle("N_{event}");
+  result->GetYaxis()->SetTitle(fLabel.Data());
+  if (fMax > fMin) {
+    result->SetMinimum(fMin);
+    result->SetMaximum(fMax);
+  }
+  result->SetOption("L");
+
+  Double_t sum = 0;
+  Double_t sum2 = 0;
+  for (Int_t i = 0; i < nBins; i++) {
+    Double_t data = fData[fNumberOfEvents-1-i];
+    sum += data;
+    sum2 += data * data;
+    result->SetBinContent(nBins-i, data);
+  }
+  Stat_t stats[4];
+  stats[0] = nBins;
+  stats[1] = nBins * nBins;
+  stats[2] = sum;
+  stats[3] = sum2;
+  result->PutStats(stats);
+
+  return result;
+}
+
+//_____________________________________________________________________________
+Double_t AliMonitorTrend::GetMean()
+{
+// get the mean value
+
+  if (fNumberOfEvents <= 0) return 0;
+
+  Double_t sum = 0;
+  for (Int_t i = 0; i < fNumberOfEvents; i++) {
+    sum += fData[i];
+  }
+  return sum / fNumberOfEvents;
+}
+
+//_____________________________________________________________________________
+Double_t AliMonitorTrend::GetSigma()
+{
+// get the rms value
+
+  if (fNumberOfEvents <= 0) return 0;
+
+  Double_t sum = 0;
+  Double_t sum2 = 0;
+  for (Int_t i = 0; i < fNumberOfEvents; i++) {
+    sum += fData[i];
+    sum2 += fData[i] * fData[i];
+  }
+  return TMath::Sqrt(sum2 - sum*sum/fNumberOfEvents) / fNumberOfEvents;
+}
+
diff --git a/MONITOR/AliMonitorTrend.h b/MONITOR/AliMonitorTrend.h
new file mode 100644 (file)
index 0000000..cce44b5
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef ALIMONITORTREND_H
+#define ALIMONITORTREND_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMonitorPlot.h"
+
+
+class AliMonitorTrend : public AliMonitorPlot {
+public:
+  AliMonitorTrend();
+  AliMonitorTrend(const AliMonitorTrend& trend);
+  AliMonitorTrend(const char* name, const char* title,
+                 const char* label, Double_t min = 0, Double_t max = 0);
+  virtual ~AliMonitorTrend();
+
+  virtual void    SetReference(TH1* ref);
+  virtual void    SetReference(AliMonitorPlot* ref);
+
+  void            Fill(Double_t x);
+
+  virtual void    Update();
+  virtual void    Add(AliMonitorPlot* plot);
+  virtual void    Reset();
+  virtual void    ResetList();
+
+  Double_t        GetMean();
+  Double_t        GetSigma();
+protected:
+  virtual Bool_t  ComparePlot();
+  virtual Bool_t  GetEvent(Int_t number = 1);
+  virtual Bool_t  GetSum(Int_t number);
+  virtual Bool_t  GetRun();
+  virtual void    DrawPlot();
+
+  TH1*            CreateHisto(Int_t nBins);
+
+  TString         fLabel;        // label of the y axis
+  Double_t        fMin;          // minimal y axis value
+  Double_t        fMax;          // maximal y axis value
+  TArrayD         fData;         // monitored values
+  static Int_t    fgIncSize;  //! amount by which the TArrayD is increased
+
+  TH1*            fHistoDraw;    //! the histogram for the trend, used for comparison to a reference
+  Double_t        fRefMean;      //! mean reference value
+  Double_t        fRefSigma;     //! standard deviation of the reference value
+  TH1*            fHistoCompare; //! the result of the comparison to the reference, only bins with large deviation are set
+
+  ClassDef(AliMonitorTrend, 1)   // histogram for monitoring the quality of the recorded data (time dependent value)
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/AliMonitorV0s.cxx b/MONITOR/AliMonitorV0s.cxx
new file mode 100644 (file)
index 0000000..eebbd54
--- /dev/null
@@ -0,0 +1,101 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  This class creates and fills the monitor histograms for V0s              //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliMonitorV0s.h"
+#include "AliMonitorHisto.h"
+#include "AliITSLoader.h"
+#include "AliV0vertex.h"
+#include <TPDGCode.h>
+
+
+ClassImp(AliMonitorV0s) 
+
+
+//_____________________________________________________________________________
+AliMonitorV0s::AliMonitorV0s()
+{
+// create a monitor object for V0s
+
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorV0s::CreateHistos(TFolder* folder)
+{
+// create the V0s monitor histograms
+
+  fFolder = folder->AddFolder("V0s", "V0s");
+
+  fRadius = CreateHisto1("Radius", "radius of V0 vertices", 
+                        90, 0., 3., "r_{xy} [cm]", 
+                        "#Delta N/N", AliMonitorHisto::kNormEvents);
+
+  fMassK0 = CreateHisto1("MassK0", "invariant mass of K^{0} candidates", 
+                        50, 0.4, 0.6, "m_{#pi^{+}#pi^{-}} [GeV/c^{2}]", 
+                        "#Delta N/N", AliMonitorHisto::kNormEvents);
+
+  fMassLambda = CreateHisto1("MassLambda", 
+                            "invariant mass of #Lambda candidates", 
+                            50, 1.0, 1.2, "m_{p#pi^{-}} [GeV/c^{2}]", 
+                            "#Delta N/N", AliMonitorHisto::kNormEvents);
+
+  fMassAntiLambda = CreateHisto1("MassAntiLambda", 
+                                "invariant mass of #bar{#Lambda} candidates", 
+                                50, 1.0, 1.2, 
+                                "m_{#bar{p}#pi^{+}} [GeV/c^{2}]", 
+                                "#Delta N/N", AliMonitorHisto::kNormEvents);
+}
+
+
+//_____________________________________________________________________________
+void AliMonitorV0s::FillHistos(AliRunLoader* runLoader, 
+                              AliRawReader*)
+{
+// fill the TPC-ITS correlation monitor histogrms
+
+  AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
+  if (!itsLoader) return;
+
+  itsLoader->LoadV0s();
+  TTree* v0s = itsLoader->TreeV0();
+  if (!v0s) return;
+  AliV0vertex* vertex = new AliV0vertex;
+  v0s->SetBranchAddress("vertices", &vertex);
+
+  for (Int_t i = 0; i < v0s->GetEntries(); i++) {
+    v0s->GetEntry(i);
+    Double_t x, y, z;
+    vertex->GetXYZ(x, y, z);
+    fRadius->Fill(TMath::Sqrt(x*x + y*y));
+    vertex->ChangeMassHypothesis(kK0Short); 
+    fMassK0->Fill(vertex->GetEffMass());
+    vertex->ChangeMassHypothesis(kLambda0); 
+    fMassLambda->Fill(vertex->GetEffMass());
+    vertex->ChangeMassHypothesis(kLambda0Bar); 
+    fMassAntiLambda->Fill(vertex->GetEffMass());
+  }
+
+  delete vertex;
+  itsLoader->UnloadV0s();
+}
diff --git a/MONITOR/AliMonitorV0s.h b/MONITOR/AliMonitorV0s.h
new file mode 100644 (file)
index 0000000..17ccb58
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef ALIMONITORV0S_H
+#define ALIMONITORV0S_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMonitor.h"
+#include "AliMonitorHisto.h"
+
+
+class AliMonitorV0s : public AliMonitor {
+public:
+  AliMonitorV0s();
+
+  virtual void     CreateHistos(TFolder* folder);
+  virtual void     FillHistos(AliRunLoader* runLoader, 
+                             AliRawReader* rawReader);
+
+private:
+  AliMonitorHisto* fRadius;             // radius of V0 vertices
+  AliMonitorHisto* fMassK0;             // invariant mass distribution of V0s for pi+ pi- hypothesis
+  AliMonitorHisto* fMassLambda;         // invariant mass distribution of V0s for p pi- hypothesis
+  AliMonitorHisto* fMassAntiLambda;     // invariant mass distribution of V0s for anti-p pi+ hypothesis
+
+  ClassDef(AliMonitorV0s, 0)   // creation and filling of monitor histograms for correlations between TPC and ITS
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/MONITOR/MONITORLinkDef.h b/MONITOR/MONITORLinkDef.h
new file mode 100644 (file)
index 0000000..fafedb0
--- /dev/null
@@ -0,0 +1,26 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class  AliMonitorPlot+;
+#pragma link C++ class  AliMonitorHisto+;
+#pragma link C++ class  AliMonitorTrend+;
+#pragma link C++ class  AliMonitor+;
+#pragma link C++ class  AliMonitorTPC+;
+#pragma link C++ class  AliMonitorDataTPC+;
+#pragma link C++ class  AliMonitorITS+;
+#pragma link C++ class  AliMonitorV0s+;
+#pragma link C++ class  AliMonitorProcess+;
+#pragma link C++ class  AliMonitorControl+;
+#pragma link C++ class  AliMonitorDialog+;
+#pragma link C++ class  AliMonitorClient+;
+
+#endif
+
diff --git a/MONITOR/client.C b/MONITOR/client.C
new file mode 100644 (file)
index 0000000..5c6f1e7
--- /dev/null
@@ -0,0 +1,8 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "MONITOR/AliMonitorClient.h"
+#endif
+
+void client()
+{
+  new AliMonitorClient;
+}
diff --git a/MONITOR/copy_s.xpm b/MONITOR/copy_s.xpm
new file mode 100644 (file)
index 0000000..d31a0f3
--- /dev/null
@@ -0,0 +1,46 @@
+/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 8 1",
+"  c Gray100",
+". c #8b8bfd",
+"X c #3c3cfd",
+"o c #000082",
+"O c Gray0",
+"+ c None",
+"@ c Gray0",
+"# c Gray0",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"+++++OOOOOOOO+++++++++++++++++++",
+"+++++O      OO++++++++++++++++++",
+"+++++O OOOO O O+++++++++++++++++",
+"+++++O      O  O++++++++++++++++",
+"+++++O OOOO Ooooooooo+++++++++++",
+"+++++O      Oo      oo++++++++++",
+"+++++O OOOOO o OOOO oXo+++++++++",
+"+++++O       o      o.Xo++++++++",
+"+++++O OOOOO o OOOO o .Xo+++++++",
+"+++++O       o      oooooo++++++",
+"+++++O OOOOO o OOOO      o++++++",
+"+++++O       o           o++++++",
+"+++++O OOOOO o OOOOOOOOO o++++++",
+"+++++O       o           o++++++",
+"+++++OOOOOOOOo OOOOOOOOO o++++++",
+"+++++++++++++o           o++++++",
+"+++++++++++++o OOOOOOOOO o++++++",
+"+++++++++++++o           o++++++",
+"+++++++++++++ooooooooooooo++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
diff --git a/MONITOR/galice.C b/MONITOR/galice.C
new file mode 100644 (file)
index 0000000..0bc996b
--- /dev/null
@@ -0,0 +1,297 @@
+void galice()
+{
+    AliRunLoader* runLoader = AliRunLoader::Open("galice.root", AliConfig::fgkDefaultEventFolderName, "recreate");
+    runLoader->SetCompressionLevel(2);
+    runLoader->SetNumberOfEventsPerFile(1);
+    gAlice->SetRunLoader(runLoader);
+
+    gSystem->Load("libgeant321");
+    new TGeant3("C++ Interface to Geant3");
+
+    // Field (L3 0.4 T)
+    AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k4kG);
+    gAlice->SetField(field);    
+
+    Int_t   iABSO  =  0;
+    Int_t   iDIPO  =  0;
+    Int_t   iFMD   =  0;
+    Int_t   iFRAME =  0;
+    Int_t   iHALL  =  0;
+    Int_t   iITS   =  1;
+    Int_t   iMAG   =  0;
+    Int_t   iMUON  =  0;
+    Int_t   iPHOS  =  0;
+    Int_t   iPIPE  =  0;
+    Int_t   iPMD   =  0;
+    Int_t   iRICH  =  0;
+    Int_t   iSHIL  =  0;
+    Int_t   iSTART =  0;
+    Int_t   iTOF   =  0;
+    Int_t   iTPC   =  1;
+    Int_t   iTRD   =  0;
+    Int_t   iZDC   =  0;
+    Int_t   iEMCAL =  0;
+    Int_t   iCRT   =  0;
+    Int_t   iVZERO =  0;
+    runLoader->CdGAFile();
+    //=================== Alice BODY parameters =============================
+    AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+    if (iMAG)
+    {
+        //=================== MAG parameters ============================
+        // --- Start with Magnet since detector layouts may be depending ---
+        // --- on the selected Magnet dimensions ---
+        AliMAG *MAG = new AliMAG("MAG", "Magnet");
+    }
+
+
+    if (iABSO)
+    {
+        //=================== ABSO parameters ============================
+        AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
+    }
+
+    if (iDIPO)
+    {
+        //=================== DIPO parameters ============================
+
+        AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
+    }
+
+    if (iHALL)
+    {
+        //=================== HALL parameters ============================
+
+        AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
+    }
+
+
+    if (iFRAME)
+    {
+        //=================== FRAME parameters ============================
+
+        AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+       if (geo == kHoles) {
+           FRAME->SetHoles(1);
+       } else {
+           FRAME->SetHoles(0);
+       }
+    }
+
+    if (iSHIL)
+    {
+        //=================== SHIL parameters ============================
+
+        AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
+    }
+
+
+    if (iPIPE)
+    {
+        //=================== PIPE parameters ============================
+
+        AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
+    }
+    if(iITS) {
+
+    //=================== ITS parameters ============================
+    //
+    // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
+    // almost all other detectors. This involves the fact that the ITS geometry
+    // still has several options to be followed in parallel in order to determine
+    // the best set-up which minimizes the induced background. All the geometries
+    // available to date are described in the following. Read carefully the comments
+    // and use the default version (the only one uncommented) unless you are making
+    // comparisons and you know what you are doing. In this case just uncomment the
+    // ITS geometry you want to use and run Aliroot.
+    //
+    // Detailed geometries:         
+    //
+    //
+    //AliITS *ITS  = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
+    //
+    //AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
+    //
+       AliITSvPPRasymm *ITS  = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
+       ITS->SetMinorVersion(2);                                         // don't touch this parameter if you're not an ITS developer
+       ITS->SetReadDet(kFALSE);                                         // don't touch this parameter if you're not an ITS developer
+    //    ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");  // don't touch this parameter if you're not an ITS developer
+       ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
+       ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
+       ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
+       ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
+       ITS->SetRails(0);            // 1 --> rails in ; 0 --> rails out
+       ITS->SetCoolingFluid(1);   // 1 --> water ; 0 --> freon
+       //
+    //AliITSvPPRsymm *ITS  = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
+    //ITS->SetMinorVersion(2);                                       // don't touch this parameter if you're not an ITS developer
+    //ITS->SetReadDet(kFALSE);                                       // don't touch this parameter if you're not an ITS developer
+    //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
+    //ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
+    //ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
+    //ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
+    //ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
+    //ITS->SetRails(0);              // 1 --> rails in ; 0 --> rails out
+    //ITS->SetCoolingFluid(1);       // 1 --> water ; 0 --> freon
+    //
+    //
+    // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful 
+    // for reconstruction !):
+    //                                                     
+    //
+    //AliITSvPPRcoarseasymm *ITS  = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
+    //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
+    //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
+    //
+    //AliITS *ITS  = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
+    //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
+    //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
+    //                      
+    //
+    //
+    // Geant3 <-> EUCLID conversion
+    // ============================
+    //
+    // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
+    // media to two ASCII files (called by default ITSgeometry.euc and
+    // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
+    // The default (=0) means that you dont want to use this facility.
+    //
+     ITS->SetEUCLID(0);  
+    }
+
+    if (iTPC)
+    {
+        //============================ TPC parameters ================================
+        // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
+        // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
+        // --- sectors are specified, any value other than that requires at least one 
+        // --- sector (lower or upper)to be specified!
+        // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
+        // ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
+        // --- SecLows - number of lower sectors specified (up to 6)
+        // --- SecUps - number of upper sectors specified (up to 12)
+        // --- Sens - sensitive strips for the Slow Simulator !!!
+        // --- This does NOT work if all S or L-sectors are specified, i.e.
+        // --- if SecAL or SecAU < 0
+        //
+        //
+        //-----------------------------------------------------------------------------
+
+        //  gROOT->LoadMacro("SetTPCParam.C");
+        //  AliTPCParam *param = SetTPCParam();
+        AliTPC *TPC = new AliTPCv2("TPC", "Default");
+
+        // All sectors included 
+        TPC->SetSecAU(-1);
+        TPC->SetSecAL(-1);
+    }
+
+
+    if (iTOF) {
+       if (geo == kHoles) {
+        //=================== TOF parameters ============================
+           AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
+       } else {
+           AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
+       }
+    }
+
+
+    if (iRICH)
+    {
+        //=================== RICH parameters ===========================
+        AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
+
+    }
+
+
+    if (iZDC)
+    {
+        //=================== ZDC parameters ============================
+
+        AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
+    }
+
+    if (iTRD)
+    {
+        //=================== TRD parameters ============================
+
+        AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+
+        // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
+        TRD->SetGasMix(1);
+       if (geo == kHoles) {
+           // With hole in front of PHOS
+           TRD->SetPHOShole();
+           // With hole in front of RICH
+           TRD->SetRICHhole();
+       }
+           // Switch on TR
+           AliTRDsim *TRDsim = TRD->CreateTR();
+    }
+
+    if (iFMD)
+    {
+        //=================== FMD parameters ============================
+       AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+        FMD->SetRingsSi1(256);
+        FMD->SetRingsSi2(128);
+        FMD->SetSectorsSi1(20);
+        FMD->SetSectorsSi2(40);      
+   }
+
+    if (iMUON)
+    {
+        //=================== MUON parameters ===========================
+
+        AliMUON *MUON = new AliMUONv1("MUON", "default");
+    }
+    //=================== PHOS parameters ===========================
+
+    if (iPHOS)
+    {
+        AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+    }
+
+
+    if (iPMD)
+    {
+        //=================== PMD parameters ============================
+        AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+    }
+
+    if (iSTART)
+    {
+        //=================== START parameters ============================
+        AliSTART *START = new AliSTARTv1("START", "START Detector");
+    }
+
+    if (iEMCAL)
+    {
+        //=================== EMCAL parameters ============================
+        AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
+    }
+
+     if (iCRT)
+    {
+        //=================== CRT parameters ============================
+        AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
+    }
+
+     if (iVZERO)
+    {
+        //=================== CRT parameters ============================
+        AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
+    }
+
+     AliConfig::Instance()->Add(gMC);
+     gMC->Init();
+     gAlice->InitLoaders();
+     gAlice->Write();
+     runLoader->MakeTree("E");
+     runLoader->Write();
+     delete runLoader;
+}
diff --git a/MONITOR/libMONITOR.pkg b/MONITOR/libMONITOR.pkg
new file mode 100644 (file)
index 0000000..cc174e4
--- /dev/null
@@ -0,0 +1,11 @@
+SRCS:=  AliMonitorPlot.cxx AliMonitorHisto.cxx AliMonitorTrend.cxx \
+       AliMonitor.cxx \
+       AliMonitorTPC.cxx AliMonitorITS.cxx AliMonitorV0s.cxx \
+       AliMonitorProcess.cxx AliMonitorControl.cxx \
+       AliMonitorDialog.cxx AliMonitorClient.cxx
+
+HDRS:= $(SRCS:.cxx=.h)
+
+DHDR:= MONITORLinkDef.h
+
+EINCLUDE:=TPC CONTAINERS ITS RAW
diff --git a/MONITOR/loop_off2.xpm b/MONITOR/loop_off2.xpm
new file mode 100644 (file)
index 0000000..71a30e6
--- /dev/null
@@ -0,0 +1,39 @@
+/* XPM */
+static char * next_t_xpm[] = {
+"32 32 3 1",
+".     c None",
+"+     c #000000",
+"o     c Red",      
+"................................",
+"...o........................o...",
+"..ooo......................ooo..",
+".ooooo....................ooooo.",
+"..ooooo......++++++......ooooo..",
+"...ooooo..+++++++++++...ooooo...",
+"....ooooo++++++++++++..ooooo....",
+".....ooooo+++.........ooooo.....",
+"......ooooo..........ooooo......",
+"......+ooooo........ooooo+......",
+".....+++ooooo......ooooo+++.....",
+".....+++.ooooo....ooooo.+++.....",
+".....+++..ooooo..ooooo.+++++....",
+"....+++....oooooooooo..+++++....",
+"....+++.....oooooooo..+++++++...",
+"....+++......oooooo...+++++++...",
+"....+++......oooooo..+++++++++..",
+"....+++.....oooooooo.+++++++++..",
+"....+++....oooooooooo++++++++++.",
+".....+++..ooooo..ooooo..+++.....",
+".....+++.ooooo....ooooo.+++.....",
+".....+++ooooo......ooooo+++.....",
+"......+ooooo........ooooo+......",
+"......ooooo..........ooooo......",
+".....ooooo+++......+++ooooo.....",
+"....ooooo++++++++++++++ooooo....",
+"...ooooo..++++++++++++..ooooo...",
+"..ooooo......++++++......ooooo..",
+".ooooo....................ooooo.",
+"..ooo......................ooo..",
+"...o........................o...",
+"................................"
+};
diff --git a/MONITOR/loop_on.xpm b/MONITOR/loop_on.xpm
new file mode 100644 (file)
index 0000000..3220623
--- /dev/null
@@ -0,0 +1,38 @@
+/* XPM */
+static char * next_t_xpm[] = {
+"32 32 2 1",
+".     c None",
+"+     c #000000",
+"................................",
+"................................",
+"................................",
+"................................",
+".............++++++.............",
+"..........+++++++++++...........",
+"........+++++++++++++...........",
+".......++++++...................",
+"......++++...............+......",
+"......+++................+......",
+".....+++................+++.....",
+".....+++................+++.....",
+".....+++...............+++++....",
+"....+++................+++++....",
+"....+++...............+++++++...",
+"....+++...............+++++++...",
+"....+++..............+++++++++..",
+"....+++..............+++++++++..",
+"....+++.............+++++++++++.",
+".....+++................+++.....",
+".....+++................+++.....",
+".....+++................+++.....",
+"......+++..............+++......",
+"......++++............++++......",
+".......++++++......++++++.......",
+"........++++++++++++++++........",
+"..........++++++++++++..........",
+".............++++++.............",
+"................................",
+"................................",
+"................................",
+"................................"
+};
diff --git a/MONITOR/monitor.C b/MONITOR/monitor.C
new file mode 100644 (file)
index 0000000..116c26a
--- /dev/null
@@ -0,0 +1,19 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "TSystem.h"
+#include "TInterpreter.h"
+#include "MONITOR/AliMonitorProcess.h"
+#include "MONITOR/AliMonitorControl.h"
+#endif
+
+void monitor(const char* alienDir = ".")
+{
+  if (!gSystem->Which(".", "galice.root")) {
+    gInterpreter->ExecuteMacro("$ALICE_ROOT/MONITOR/galice.C");
+  }
+  if (!gSystem->Which(".", "Table0.dat")) {
+    gSystem->Exec("cp $ALICE_ROOT/RAW/Table*.dat .");
+  }
+  AliMonitorProcess process(alienDir);
+  process.Run();
+//  new AliMonitorControl(&process);
+}
diff --git a/MONITOR/next_s.xpm b/MONITOR/next_s.xpm
new file mode 100644 (file)
index 0000000..b3383e0
--- /dev/null
@@ -0,0 +1,38 @@
+/* XPM */
+static char * next_t_xpm[] = {
+"32 32 2 1",
+".     c None",
+"+     c #000000",
+"................................",
+"................................",
+"................................",
+"........+.......................",
+"........++......................",
+"........+++.....................",
+"........++++....................",
+"........+++++...................",
+"........++++++..................",
+"........+++++++.................",
+"........++++++++................",
+"........+++++++++...............",
+"........++++++++++..............",
+"........+++++++++++.............",
+"........++++++++++++............",
+"........+++++++++++++...........",
+"........++++++++++++++..........",
+"........+++++++++++++...........",
+"........++++++++++++............",
+"........+++++++++++.............",
+"........++++++++++..............",
+"........+++++++++...............",
+"........++++++++................",
+"........+++++++.................",
+"........++++++..................",
+"........+++++...................",
+"........++++....................",
+"........+++.....................",
+"........++......................",
+"........+.......................",
+"................................",
+"................................"
+};
diff --git a/MONITOR/previous_s.xpm b/MONITOR/previous_s.xpm
new file mode 100644 (file)
index 0000000..49953c1
--- /dev/null
@@ -0,0 +1,38 @@
+/* XPM */
+static char * next_t_xpm[] = {
+"32 32 2 1",
+".     c None",
+"+     c #000000",
+"................................",
+"................................",
+"................................",
+".......................+........",
+"......................++........",
+".....................+++........",
+"....................++++........",
+"...................+++++........",
+"..................++++++........",
+".................+++++++........",
+"................++++++++........",
+"...............+++++++++........",
+"..............++++++++++........",
+".............+++++++++++........",
+"............++++++++++++........",
+"...........+++++++++++++........",
+"..........++++++++++++++........",
+"...........+++++++++++++........",
+"............++++++++++++........",
+".............+++++++++++........",
+"..............++++++++++........",
+"...............+++++++++........",
+"................++++++++........",
+".................+++++++........",
+"..................++++++........",
+"...................+++++........",
+"....................++++........",
+".....................+++........",
+"......................++........",
+".......................+........",
+"................................",
+"................................"
+};
diff --git a/MONITOR/save_s.xpm b/MONITOR/save_s.xpm
new file mode 100644 (file)
index 0000000..7399991
--- /dev/null
@@ -0,0 +1,46 @@
+/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 8 1",
+"  c Gray100",
+". c #cab5d1",
+"X c #c1c1c1",
+"o c #848200",
+"O c Gray0",
+"+ c None",
+"@ c Gray0",
+"# c Gray0",
+/* pixels */
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++OOOOOOOOOOOOOOOOOOOO++++++",
+"++++++OooOXXXXXXXXXXXXOXXO++++++",
+"++++++OooOXXXXXXXXXXXXOXXO++++++",
+"++++++OooOXXXXXXXXX.XXOOOO++++++",
+"++++++OooOXXX..XXXXXXXOooO++++++",
+"++++++OooOXXX..XXXXXXXOooO++++++",
+"++++++OooOXXXXXXXXXXXXOooO++++++",
+"++++++OooOXXXXXXXXXXXXOooO++++++",
+"++++++OooOXXXXXXXXXXXXOooO++++++",
+"++++++OooOXXXXXXXXXXXXOooO++++++",
+"++++++OoooOOOOOOOOOOOOoooO++++++",
+"++++++OooooooooooooooooooO++++++",
+"++++++OooooooooooooooooooO++++++",
+"++++++OoooOOOOOOOOOOOOOooO++++++",
+"++++++OoooOOOOOOOOOXXXOooO++++++",
+"++++++OoooOOOOOOOOOXXXOooO++++++",
+"++++++OoooOOOOOOOOOXXXOooO++++++",
+"++++++OoooOOOOOOOOOXXXOooO++++++",
+"++++++OoooOOOOOOOOOXXXOooO++++++",
+"+++++++OOOOOOOOOOOOOOOOOO+++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++",
+"++++++++++++++++++++++++++++++++"
+};
similarity index 100%
rename from ITS/AliITSRawStream.h
rename to RAW/AliITSRawStream.h
index 84cf520..589e76d 100644 (file)
@@ -60,6 +60,7 @@ const char *kRawDBFS[2] = { "/scratch/mdc1", "/scratch/mdc2" };
 const char *kTagDBFS    = "/scratch/mdc1/tags";
 const char *kRunDBFS    = "/scratch/mdc1/meta";
 const char *kRFIOFS     = "rfio:/castor/cern.ch/lcg/alicemdc4";
+const char *kRootdFS    = "root://localhost//tmp/mdc1";
 #endif
 
 // Maximum size of tag db files
@@ -234,6 +235,12 @@ AliRawEvent *AliRawEvent::NextSubEvent()
 }
 
 //______________________________________________________________________________
+AliRawEvent *AliRawEvent::GetSubEvent(Int_t index)
+{
+  return (AliRawEvent *)fSubEvents->At(index);
+}
+
+//______________________________________________________________________________
 void AliRawEvent::Reset()
 {
    // Reset the event in case it needs to be re-used (avoiding costly
index e1f0784..db1a307 100644 (file)
 #include <TTree.h>
 #endif
 
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
 
 // Forward class declarations
-class TH1F;
 class AliRawDB;
 
 
@@ -188,6 +191,7 @@ public:
    AliRawData            *GetRawData();
    Int_t                  GetNSubEvents() const { return fNSubEvents; }
    AliRawEvent           *NextSubEvent();
+   AliRawEvent           *GetSubEvent(Int_t index);
    void                   Reset();
 
    ClassDef(AliRawEvent,1)  // ALICE raw event object
similarity index 100%
rename from STEER/AliRawReader.cxx
rename to RAW/AliRawReader.cxx
similarity index 85%
rename from STEER/AliRawReader.h
rename to RAW/AliRawReader.h
index cbbe2f5..564524c 100644 (file)
@@ -22,6 +22,14 @@ class AliRawReader: public TObject {
     void             Select(Int_t detectorID, 
                            Int_t minDDLID = -1, Int_t maxDDLID = -1);
 
+    virtual UInt_t   GetType() = 0;
+    virtual UInt_t   GetRunNumber() = 0;
+    virtual const UInt_t* GetEventId() = 0;
+    virtual const UInt_t* GetTriggerPattern() = 0;
+    virtual const UInt_t* GetDetectorPattern() = 0;
+    virtual const UInt_t* GetAttributes() = 0;
+    virtual UInt_t   GetGDCId() = 0;
+
     inline Int_t     GetDataSize() const {return fMiniHeader->fSize;};
     inline Int_t     GetDetectorID() const {return fMiniHeader->fDetectorID;};
     inline Int_t     GetDDLID() const {return fMiniHeader->fDDLID;};
diff --git a/RAW/AliRawReaderFile.cxx b/RAW/AliRawReaderFile.cxx
new file mode 100644 (file)
index 0000000..fb18b8f
--- /dev/null
@@ -0,0 +1,184 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// This is a class for reading a raw data file and providing
+// information about digits
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReaderFile.h"
+
+
+ClassImp(AliRawReaderFile)
+
+
+AliRawReaderFile::AliRawReaderFile(const char* fileName, Bool_t addNumber)
+{
+// create an object to read digits from the given input file(s)
+// if addNumber is true, a number starting at 1 is appended to the file name
+
+  fFileName = fileName;
+  if (!addNumber) {
+    fFileNumber = -1;
+#ifndef __DECCXX
+    fStream = new fstream(fileName, ios::binary|ios::in);
+#else
+    fStream = new fstream(fileName, ios::in);
+#endif
+  } else {
+    fFileNumber = 0;
+    fStream = NULL;
+    OpenNextFile();
+  }
+  fMiniHeader = new AliMiniHeader;
+  fBuffer = NULL;
+  fBufferSize = 0;
+}
+
+AliRawReaderFile::~AliRawReaderFile()
+{
+// close the input file
+
+  if (fStream) {
+#if defined(__HP_aCC) || defined(__DECCXX)
+    if (fStream->rdbuf()->is_open()) fStream->close();
+#else
+    if (fStream->is_open()) fStream->close();
+#endif
+    delete fStream;
+  }
+  delete fMiniHeader;
+  if (fBuffer) delete[] fBuffer;
+}
+
+
+Bool_t AliRawReaderFile::OpenNextFile()
+{
+  if (fStream) {
+#if defined(__HP_aCC) || defined(__DECCXX)
+    if (fStream->rdbuf()->is_open()) fStream->close();
+#else
+    if (fStream->is_open()) fStream->close();
+#endif
+    delete fStream;
+    fStream = NULL;
+  }
+  if (fFileNumber < 0) return kFALSE;
+
+  fFileNumber++;
+  char fileName[256];
+  sprintf(fileName, "%s%d", fFileName.Data(), fFileNumber);
+#ifndef __DECCXX 
+  fStream = new fstream(fileName, ios::binary|ios::in);
+#else
+  fStream = new fstream(fileName, ios::in);
+#endif
+#if defined(__HP_aCC) || defined(__DECCXX)
+  return (fStream->rdbuf()->is_open());
+#else
+  return (fStream->is_open());
+#endif
+}
+
+
+Bool_t AliRawReaderFile::ReadMiniHeader()
+{
+// read a mini header at the current stream position
+// returns kFALSE if the mini header could not be read
+
+  if (!fStream) return kFALSE;
+  do {
+    if (fCount > 0) fStream->seekg(Int_t(fStream->tellg()) + fCount);
+    while (!fStream->read((char*) fMiniHeader, sizeof(AliMiniHeader))) {
+      if (!OpenNextFile()) return kFALSE;
+    }
+    CheckMiniHeader();
+    fCount = fMiniHeader->fSize;
+  } while (!IsSelected());
+  return kTRUE;
+}
+
+Bool_t AliRawReaderFile::ReadNextData(UChar_t*& data)
+{
+// reads the next payload at the current stream position
+// returns kFALSE if the data could not be read
+
+  while (fCount == 0) {
+    if (!ReadMiniHeader()) return kFALSE;
+  }
+  if (fBufferSize < fCount) {
+    if (fBuffer) delete[] fBuffer;
+    fBufferSize = Int_t(fCount*1.2);
+    fBuffer = new UChar_t[fBufferSize];
+  }
+  if (!fStream->read((char*) fBuffer, fCount)) {
+    Error("ReadNext", "could not read data!");
+    return kFALSE;
+  }
+  fCount = 0;
+
+  data = fBuffer;
+  return kTRUE;
+}
+
+Bool_t AliRawReaderFile::ReadNext(UChar_t* data, Int_t size)
+{
+// reads the next block of data at the current stream position
+// returns kFALSE if the data could not be read
+
+  if (!fStream->read((char*) data, size)) {
+    Error("ReadNext", "could not read data!");
+    return kFALSE;
+  }
+  fCount -= size;
+  return kTRUE;
+}
+
+
+Bool_t AliRawReaderFile::Reset()
+{
+// reset the current stream position to the beginning of the file
+
+  if ((fFileNumber > 0) && fStream) {
+#if defined(__HP_aCC) || defined(__DECCXX)
+    if (fStream->rdbuf()->is_open()) fStream->close();
+#else
+    if (fStream->is_open()) fStream->close();
+#endif
+    delete fStream;
+    fStream = NULL;
+    fFileNumber = 0;
+  }
+
+  if (!fStream) {
+    if (fFileNumber < 0) {
+#ifndef __DECCXX
+      fStream = new fstream(fFileName, ios::binary|ios::in);
+#else
+      fStream = new fstream(fFileName, ios::in);
+#endif
+    } else {
+      if (!OpenNextFile()) return kFALSE;
+    }
+  }
+
+  if (!fStream || !fStream->rdbuf()->is_open()) return kFALSE;
+  fStream->seekg(0);
+  fCount = 0;
+  return kTRUE;
+}
+
diff --git a/RAW/AliRawReaderFile.h b/RAW/AliRawReaderFile.h
new file mode 100644 (file)
index 0000000..fea1b75
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef ALIRAWREADERFILE_H
+#define ALIRAWREADERFILE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include "AliRawReader.h"
+#include <Riostream.h>
+#include <TString.h>
+
+
+class AliRawReaderFile: public AliRawReader {
+  public :
+    AliRawReaderFile(const char* fileName, Bool_t addNumber = kTRUE);
+    virtual ~AliRawReaderFile();
+
+    virtual UInt_t   GetType() {return 0;};
+    virtual UInt_t   GetRunNumber() {return 0;};
+    virtual const UInt_t* GetEventId() {return 0;};
+    virtual const UInt_t* GetTriggerPattern() {return 0;};
+    virtual const UInt_t* GetDetectorPattern() {return 0;};
+    virtual const UInt_t* GetAttributes() {return 0;};
+    virtual UInt_t   GetGDCId() {return 0;};
+
+
+    virtual Bool_t   ReadMiniHeader();
+    virtual Bool_t   ReadNextData(UChar_t*& data);
+
+    virtual Bool_t   Reset();
+
+  protected :
+    Bool_t           OpenNextFile();
+
+    virtual Bool_t   ReadNext(UChar_t* data, Int_t size);
+
+    TString          fFileName;    // name of input files
+    Int_t            fFileNumber;  // number of current input file
+    fstream*         fStream;      // stream of raw digits
+    UChar_t*         fBuffer;      // buffer for payload
+    Int_t            fBufferSize;  // size of fBuffer in bytes
+
+    ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file
+};
+
+#endif
diff --git a/RAW/AliRawReaderRoot.cxx b/RAW/AliRawReaderRoot.cxx
new file mode 100644 (file)
index 0000000..bcd41cc
--- /dev/null
@@ -0,0 +1,227 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// This is a class for reading a raw data from a root file and providing
+// information about digits
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReaderRoot.h"
+
+
+ClassImp(AliRawReaderRoot)
+
+
+AliRawReaderRoot::AliRawReaderRoot(const char* fileName, Int_t eventNumber)
+{
+// create an object to read digits from the given input file for the
+// event with the given number
+
+  fFile = TFile::Open(fileName);
+  if (!fFile || !fFile->IsOpen()) {
+    Error("AliRawReaderRoot", "could not open file %s", fileName);
+    return;
+  }
+  TTree* tree = (TTree*) fFile->Get("RAW");
+  if (!tree) {
+    Error("AliRawReaderRoot", "no raw data tree found");
+    return;
+  }
+  TBranch* branch = tree->GetBranch("rawevent");
+  if (!branch) {
+    Error("AliRawReaderRoot", "no raw data branch found");
+    return;
+  }
+
+  fEvent = new AliRawEvent;
+  branch->SetAddress(&fEvent);
+  if (branch->GetEntry(eventNumber) <= 0) {
+    Error("AliRawReaderRoot", "no event with number %d found", eventNumber);
+    return;
+  }
+  
+  fSubEventIndex = 0;
+  fSubEvent = NULL;
+  fRawData = NULL;
+  fMiniHeader = NULL;
+
+  fCount = 0;
+  fPosition = fEnd = NULL;
+}
+
+AliRawReaderRoot::AliRawReaderRoot(AliRawEvent* event)
+{
+// create an object to read digits from the given raw event
+
+  fFile = NULL;
+  fEvent = event;
+  
+  fSubEventIndex = 0;
+  fSubEvent = NULL;
+  fRawData = NULL;
+  fMiniHeader =  NULL;
+
+  fCount = 0;
+  fPosition = fEnd = NULL;
+}
+
+AliRawReaderRoot::~AliRawReaderRoot()
+{
+// delete objects and close root file
+
+  if (fFile) {
+    if (fEvent) delete fEvent;
+    fFile->Close();
+    delete fFile;
+  }
+}
+
+
+UInt_t AliRawReaderRoot::GetType()
+{
+// get the type from the event header
+
+  if (!fEvent) return 0;
+  return fEvent->GetHeader()->GetType();
+}
+
+UInt_t AliRawReaderRoot::GetRunNumber()
+{
+// get the run number from the event header
+
+  if (!fEvent) return 0;
+  return fEvent->GetHeader()->GetRunNumber();
+}
+
+const UInt_t* AliRawReaderRoot::GetEventId()
+{
+// get the event id from the event header
+
+  if (!fEvent) return NULL;
+  return fEvent->GetHeader()->GetId();
+}
+
+const UInt_t* AliRawReaderRoot::GetTriggerPattern()
+{
+// get the trigger pattern from the event header
+
+  if (!fEvent) return NULL;
+  return fEvent->GetHeader()->GetTriggerPattern();
+}
+
+const UInt_t* AliRawReaderRoot::GetDetectorPattern()
+{
+// get the detector pattern from the event header
+
+  if (!fEvent) return NULL;
+  return fEvent->GetHeader()->GetDetectorPattern();
+}
+
+const UInt_t* AliRawReaderRoot::GetAttributes()
+{
+// get the type attributes from the event header
+
+  if (!fEvent) return NULL;
+  return fEvent->GetHeader()->GetTypeAttribute();
+}
+
+UInt_t AliRawReaderRoot::GetGDCId()
+{
+// get the GDC Id from the event header
+
+  if (!fEvent) return 0;
+  return fEvent->GetHeader()->GetGDCId();
+}
+
+
+Bool_t AliRawReaderRoot::ReadMiniHeader()
+{
+// read a mini header at the current position
+// returns kFALSE if the mini header could not be read
+
+  if (!fEvent) return kFALSE;
+  do {
+    if (fCount > 0) fPosition += fCount;      // skip payload if event was not selected
+    if (!fSubEvent || (fPosition >= fEnd)) {  // new sub event
+      if (fSubEventIndex >= fEvent->GetNSubEvents()) return kFALSE;
+      fSubEvent = fEvent->GetSubEvent(fSubEventIndex++);
+      fRawData = fSubEvent->GetRawData();
+      fCount = 0;
+      fPosition = (UChar_t*) fRawData->GetBuffer();
+      fEnd = ((UChar_t*) fRawData->GetBuffer()) + fRawData->GetSize();
+    }
+    if (fPosition >= fEnd) continue;          // no data left in the payload
+    if (fPosition + sizeof(AliMiniHeader) > fEnd) {
+      Error("ReadMiniHeader", "could not read data!");
+      return kFALSE;
+    }
+    fMiniHeader = (AliMiniHeader*) fPosition;
+    fPosition += sizeof(AliMiniHeader);
+    CheckMiniHeader();
+    fCount = fMiniHeader->fSize;
+    if (fPosition + fCount > fEnd) {  // check data size in mini header and sub event
+      Error("ReadMiniHeader", "size in mini header exceeds event size!");
+      fMiniHeader->fSize = fCount = fEnd - fPosition;
+    }
+  } while (!IsSelected());
+  return kTRUE;
+}
+
+Bool_t AliRawReaderRoot::ReadNextData(UChar_t*& data)
+{
+// reads the next payload at the current position
+// returns kFALSE if the data could not be read
+
+  while (fCount == 0) {
+    if (!ReadMiniHeader()) return kFALSE;
+  }
+  data = fPosition;
+  fPosition += fCount;  
+  fCount = 0;
+  return kTRUE;
+}
+
+Bool_t AliRawReaderRoot::ReadNext(UChar_t* data, Int_t size)
+{
+// reads the next block of data at the current position
+// returns kFALSE if the data could not be read
+
+  if (fPosition + size > fEnd) {
+    Error("ReadNext", "could not read data!");
+    return kFALSE;
+  }
+  memcpy(data, fPosition, size);
+  fPosition += size;
+  fCount -= size;
+  return kTRUE;
+}
+
+
+Bool_t AliRawReaderRoot::Reset()
+{
+// reset the current position to the beginning of the event
+
+  fSubEventIndex = 0;
+  fSubEvent = NULL;
+  fRawData = NULL;
+  fMiniHeader = NULL;
+
+  fCount = 0;
+  fPosition = fEnd = NULL;
+  return kTRUE;
+}
+
diff --git a/RAW/AliRawReaderRoot.h b/RAW/AliRawReaderRoot.h
new file mode 100644 (file)
index 0000000..265a7ec
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef ALIRAWREADERROOT_H
+#define ALIRAWREADERROOT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <TObject.h>
+#include <Riostream.h>
+#include "AliRawEvent.h"
+#include "AliRawReader.h"
+
+
+class AliRawReaderRoot: public AliRawReader {
+  public :
+    AliRawReaderRoot(const char* fileName, Int_t eventNumber);
+    AliRawReaderRoot(AliRawEvent* event);
+    virtual ~AliRawReaderRoot();
+
+    virtual UInt_t   GetType();
+    virtual UInt_t   GetRunNumber();
+    virtual const UInt_t* GetEventId();
+    virtual const UInt_t* GetTriggerPattern();
+    virtual const UInt_t* GetDetectorPattern();
+    virtual const UInt_t* GetAttributes();
+    virtual UInt_t   GetGDCId();
+
+    virtual Bool_t   ReadMiniHeader();
+    virtual Bool_t   ReadNextData(UChar_t*& data);
+
+    virtual Bool_t   Reset();
+
+  protected :
+    virtual Bool_t   ReadNext(UChar_t* data, Int_t size);
+
+    TFile*           fFile;         // raw data root file
+    AliRawEvent*     fEvent;        // (super) event
+    Int_t            fSubEventIndex; // index of current sub event
+    AliRawEvent*     fSubEvent;     // current sub event
+    AliRawData*      fRawData;      // current raw data
+    UChar_t*         fPosition;     // current position in the raw data
+    UChar_t*         fEnd;          // end position of the current subevent
+
+    ClassDef(AliRawReaderRoot, 0) // class for reading raw digits from a root file
+};
+
+#endif
similarity index 89%
rename from TPC/AliTPCBuffer160.cxx
rename to RAW/AliTPCBuffer160.cxx
index bbb9f50..fe0553e 100644 (file)
 // and in the compression of the RAW data
 // Author: D.Favretto
 
+#include "AliTPCBuffer160.h"
 #include <TObjArray.h>
 #include <Riostream.h>
 #include <TMath.h>
 #include <stdlib.h>
-#include "AliTPCBuffer160.h"
 
 
 ClassImp(AliTPCBuffer160)
@@ -45,26 +45,44 @@ AliTPCBuffer160::AliTPCBuffer160(const char* fileName,Int_t flag){
     for (Int_t i=0;i<5;i++)fBuffer[i]=0;
     //open the output file
 #ifndef __DECCXX
-    f.open(fileName,ios::binary|ios::out);
+    f = new fstream(fileName,ios::binary|ios::out);
 #else
-    f.open(fileName,ios::out);
+    f = new fstream(fileName,ios::out);
 #endif
   }
   else{
     //open the input file
 #ifndef __DECCXX
-    f.open(fileName,ios::binary|ios::in);
+    f = new fstream(fileName,ios::binary|ios::in);
 #else
-    f.open(fileName,ios::in);
+    f = new fstream(fileName,ios::in);
 #endif
     if(!f){cout<<"File doesn't exist:"<<fileName<<endl;;exit(-1);}
     fShift=0;
     //To get the file dimension (position of the last element in term of bytes)
-    f.seekg(0, ios::end);
-    fFilePosition= f.tellg();
+    f->seekg(0, ios::end);
+    fFilePosition= f->tellg();
     fFileEnd=fFilePosition;
-    f.seekg(0);
+    f->seekg(0);
   }
+  fCreated = kTRUE;
+}
+
+AliTPCBuffer160::AliTPCBuffer160(fstream* file, Int_t size){
+//constructor for reading a file with mini header
+  fFlag=0;
+  f=file;
+  fCurrentCell=0;
+  fShift=0;
+  fMaskBackward=0xFF;
+  fVerbose=0;
+
+  fMiniHeaderPos=f->tellg();
+  f->seekg(fMiniHeaderPos+size);
+  fFilePosition=f->tellg();
+  fFileEnd=fFilePosition;
+  f->seekg(fMiniHeaderPos);
+  fCreated = kFALSE;
 }
 
 AliTPCBuffer160::~AliTPCBuffer160(){
@@ -75,7 +93,10 @@ AliTPCBuffer160::~AliTPCBuffer160(){
     if(fVerbose)
       cout<<"File Created\n";
   }//end if
-  f.close();
+  if (fCreated) {
+    f->close();
+    delete f;
+  }
 }
 
 
@@ -118,7 +139,8 @@ Int_t AliTPCBuffer160::GetNext(){
   ULong_t temp;
   ULong_t value;
   if (!fShift){
-    if ( f.read((char*)fBuffer,sizeof(ULong_t)*5) ){
+    if (f->tellg()>=(Int_t)fFileEnd) return -1;
+    if ( f->read((char*)fBuffer,sizeof(ULong_t)*5) ){
       fCurrentCell=0;
       fShift=22;
       value=fBuffer[fCurrentCell]&mask;
@@ -159,10 +181,10 @@ Int_t AliTPCBuffer160::GetNextBackWord(){
   ULong_t temp;
   ULong_t value;
   if (!fShift){
-    if (fFilePosition){
+    if (fFilePosition>fMiniHeaderPos){
       fFilePosition-=sizeof(ULong_t)*5;
-      f.seekg(fFilePosition);
-      f.read((char*)fBuffer,sizeof(ULong_t)*5);
+      f->seekg(fFilePosition);
+      f->read((char*)fBuffer,sizeof(ULong_t)*5);
       
       //cout<<"Buffer letto"<<endl;
       /*
@@ -187,7 +209,11 @@ Int_t AliTPCBuffer160::GetNextBackWord(){
       fBuffer[fCurrentCell]=fBuffer[fCurrentCell]>>10;
       return value;      
     }
-    else return -1;
+    else {
+//      f->seekg(fFileEnd);
+      f->seekg(fMiniHeaderPos);
+      return -1;
+    }
   }//end if
   else{
     if (fShift>=10){
@@ -236,7 +262,7 @@ void AliTPCBuffer160::FillBuffer(Int_t Val){
   fBuffer[fCurrentCell]|=Val;
   if(!fShift){
     //Buffer is written into a file
-    f.write((char*)fBuffer,sizeof(ULong_t)*5);
+    f->write((char*)fBuffer,sizeof(ULong_t)*5);
    //Buffer is empty
     for(Int_t j=0;j<5;j++)fBuffer[j]=0;
     fShift=32;
@@ -311,20 +337,20 @@ void AliTPCBuffer160::WriteMiniHeader(ULong_t Size,Int_t SecNumber,Int_t SubSect
   PackWord(miniHeader[2],ddlNumber,16,31);
   if (!Size){
     //if size=0 it means that this mini header is a dummi mini header
-    fMiniHeaderPos=f.tellp();
+    fMiniHeaderPos=f->tellp();
     //cout<<" Position of the DUMMY MH:"<<fMiniHeaderPos<<" Size:"<<Size<<endl;
     miniHeader[0]=Size;
-    f.write((char*)(miniHeader),miniHeaderSize);
+    f->write((char*)(miniHeader),miniHeaderSize);
   }//end if
   else{
-    ULong_t currentFilePos=f.tellp();
-    f.seekp(fMiniHeaderPos);
+    ULong_t currentFilePos=f->tellp();
+    f->seekp(fMiniHeaderPos);
     Size=currentFilePos-fMiniHeaderPos-miniHeaderSize;
     //cout<<"Current Position (Next MH) "<<currentFilePos<<" Position of the MH:"<<fMiniHeaderPos<<" Size:"<<Size<<endl;
     miniHeader[0]=Size;
     //cout<<"Mini Header Size:"<<miniHeader[0]<<endl;
-    f.write((char*)(miniHeader),miniHeaderSize);
-    f.seekp(currentFilePos);
+    f->write((char*)(miniHeader),miniHeaderSize);
+    f->seekp(currentFilePos);
   }
   return;
 }
similarity index 94%
rename from TPC/AliTPCBuffer160.h
rename to RAW/AliTPCBuffer160.h
index fabe1dc..5bed738 100644 (file)
@@ -16,6 +16,8 @@
 
 #ifndef AliTPCBUFFER160_H
 #define AliTPCBUFFER160_H
+
+#include <TObject.h>
 #ifdef __CINT__
 class fstream;
 #else
@@ -27,6 +29,7 @@ class AliTPCBuffer160:public TObject{
 public:
   AliTPCBuffer160(){}//default constructor
   AliTPCBuffer160(const char* fileName,Int_t flag);//constructor
+  AliTPCBuffer160(fstream* file, Int_t size);//constructor for reading a file with mini header
   virtual ~AliTPCBuffer160();//destructor
   AliTPCBuffer160(const AliTPCBuffer160 &source); // copy constructor
   AliTPCBuffer160& operator=(const AliTPCBuffer160 &source); // ass. op.
@@ -70,7 +73,8 @@ private:
   Int_t fFreeCellBuffer;//number of free cells of the buffer
   Int_t fFlag;          //0 read  1 write
   Int_t fVerbose;       //verbose level
-  fstream f;            //logical name of the I/O file
+  fstream* f;           //logical name of the I/O file
+  Bool_t fCreated;      //true if f was created by the buffer
   Int_t fMaskBackward;  //bit mask for backward reading of a file
   ULong_t fFilePosition;//'pointer' to the actual position in the file
   ULong_t fFileEnd;     //position of the last element of the file (File dimension)
similarity index 100%
rename from TPC/AliTPCHuffman.cxx
rename to RAW/AliTPCHuffman.cxx
similarity index 100%
rename from TPC/AliTPCHuffman.h
rename to RAW/AliTPCHuffman.h
similarity index 100%
rename from TPC/AliTPCRawStream.h
rename to RAW/AliTPCRawStream.h
index e64c85d..5681a0a 100644 (file)
 #pragma link C++ class AliTagNullDB;
 #pragma link C++ class AliRunDB;
 #pragma link C++ class AliMDC;
+#pragma link C++ class AliRawReader+;
+#pragma link C++ class AliRawReaderFile+;
+#pragma link C++ class AliRawReaderRoot+;
+#pragma link C++ class AliTPCBuffer160+;
+#pragma link C++ class AliTPCCompression+;
+#pragma link C++ class AliTPCHNode+;
+#pragma link C++ class AliTPCHTable+;
+#pragma link C++ class AliTPCRawStream+;
+#pragma link C++ class AliITSRawStream+;
+#pragma link C++ class AliITSRawStreamSPD+;
+#pragma link C++ class AliITSRawStreamSDD+;
+#pragma link C++ class AliITSRawStreamSSD+;
 
 #endif
index 8900b55..efcacbe 100644 (file)
@@ -2,9 +2,14 @@
 
 ROOTH         = TH1.h
 
-SRCS          = AliRawEvent.cxx
+SRCS          = AliRawEvent.cxx \
+               AliRawReader.cxx AliRawReaderFile.cxx AliRawReaderRoot.cxx \
+               AliTPCBuffer160.cxx AliTPCHuffman.cxx AliTPCCompression.cxx \
+               AliTPCRawStream.cxx \
+               AliITSRawStream.cxx AliITSRawStreamSPD.cxx \
+               AliITSRawStreamSDD.cxx AliITSRawStreamSSD.cxx
 
-HDRS          = AliRawEvent.h LinkDef.h
+HDRS          = $(SRCS:.cxx=.h) LinkDef.h
 
 DICT          = AliRawDict.cxx
 DICTH         = $(DICT:.cxx=.h)
@@ -19,7 +24,7 @@ ALLDICT       = $(DICT) $(DICTH)
 ALLSRCS       = $(SRCS) $(HDRS) $(MAIN) DateEvent.h
 ALLOBJS       = $(OBJS) $(MAINO)
 
-ALIRAW        = libAliRaw.so
+ALIRAW        = libRAW.so
 ALIMDC        = alimdc
 
 
index afc2a67..d36c5ce 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for ALICE MDC program for Linux
 
-include $(ROOTSYS)/test/Makefile.arch
+include $(ROOTSYS)/test/Makefile
 
 LDFLAGS      += -Wl,-rpath,/ROOT/Linux/CurrentRelease/root/lib \
                 -Wl,-rpath,/date/smi/linux \
@@ -59,4 +59,4 @@ include Make-macros
 
 ##### DEPENDENCIES #####
 
-include Make-depend
+-include Make-depend
diff --git a/RAW/Table0.dat b/RAW/Table0.dat
new file mode 100644 (file)
index 0000000..25e2ed6
Binary files /dev/null and b/RAW/Table0.dat differ
diff --git a/RAW/Table0.txt b/RAW/Table0.txt
new file mode 100644 (file)
index 0000000..b00c70a
--- /dev/null
@@ -0,0 +1,1024 @@
+2.00918e-07
+2.00918e-07
+2.00918e-07
+0.365333
+0.157426
+0.228764
+0.143818
+0.0546002
+0.021801
+0.0103286
+0.00558832
+0.00326793
+0.00206222
+0.00143013
+0.00098972
+0.000761277
+0.000542478
+0.000423936
+0.000314838
+0.000281887
+0.000217192
+0.000186653
+0.000163547
+0.000136021
+0.000122359
+9.92533e-05
+8.82029e-05
+7.67506e-05
+6.8312e-05
+5.32432e-05
+5.46496e-05
+4.6412e-05
+4.159e-05
+4.60101e-05
+3.67679e-05
+3.85762e-05
+2.6923e-05
+2.95349e-05
+3.23477e-05
+2.97358e-05
+2.67221e-05
+2.67221e-05
+2.35074e-05
+2.06945e-05
+2.19e-05
+2.57175e-05
+1.74798e-05
+1.52697e-05
+1.60734e-05
+1.24569e-05
+1.18541e-05
+1.60734e-05
+1.18541e-05
+9.0413e-06
+8.03671e-06
+1.02468e-05
+1.00459e-05
+1.18541e-05
+1.02468e-05
+7.03212e-06
+7.83579e-06
+5.62569e-06
+4.82202e-06
+4.01835e-06
+4.42019e-06
+4.01835e-06
+4.62111e-06
+5.22386e-06
+4.21927e-06
+5.42478e-06
+4.82202e-06
+4.82202e-06
+4.62111e-06
+3.81744e-06
+2.61193e-06
+4.21927e-06
+3.81744e-06
+2.41101e-06
+1.80826e-06
+4.42019e-06
+3.4156e-06
+4.62111e-06
+1.80826e-06
+2.41101e-06
+5.42478e-06
+2.81285e-06
+2.41101e-06
+2.81285e-06
+1.40642e-06
+1.40642e-06
+2.81285e-06
+3.4156e-06
+2.00918e-06
+1.20551e-06
+3.4156e-06
+1.00459e-06
+6.02753e-07
+1.20551e-06
+2.81285e-06
+1.60734e-06
+2.21009e-06
+1.60734e-06
+2.41101e-06
+1.40642e-06
+1.00459e-06
+1.60734e-06
+1.00459e-06
+1.60734e-06
+1.40642e-06
+1.80826e-06
+6.02753e-07
+6.02753e-07
+2.21009e-06
+1.80826e-06
+1.00459e-06
+6.02753e-07
+1.40642e-06
+2.00918e-07
+4.01835e-07
+1.00459e-06
+4.01835e-07
+1.20551e-06
+4.01835e-07
+1.00459e-06
+6.02753e-07
+4.01835e-07
+4.01835e-07
+6.02753e-07
+1.00459e-06
+8.03671e-07
+6.02753e-07
+1.20551e-06
+2.00918e-07
+4.01835e-07
+4.01835e-07
+1.20551e-06
+6.02753e-07
+6.02753e-07
+6.02753e-07
+4.01835e-07
+4.01835e-07
+6.02753e-07
+2.00918e-07
+8.03671e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+4.01835e-07
+6.02753e-07
+4.01835e-07
+4.01835e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+6.02753e-07
+2.00918e-07
+2.00918e-07
+6.02753e-07
+4.01835e-07
+2.00918e-07
+6.02753e-07
+6.02753e-07
+6.02753e-07
+6.02753e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+6.02753e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+4.01835e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
+2.00918e-07
diff --git a/RAW/Table1.dat b/RAW/Table1.dat
new file mode 100644 (file)
index 0000000..c99dff1
Binary files /dev/null and b/RAW/Table1.dat differ
diff --git a/RAW/Table1.txt b/RAW/Table1.txt
new file mode 100644 (file)
index 0000000..e89960e
--- /dev/null
@@ -0,0 +1,1024 @@
+0.000610892
+0.0366716
+0.0295006
+0.0269685
+0.0254778
+0.0241493
+0.0229679
+0.0220952
+0.0212544
+0.020448
+0.0198238
+0.0191539
+0.0185689
+0.0179244
+0.0172255
+0.016811
+0.0161402
+0.0157465
+0.0152586
+0.0146811
+0.014231
+0.0138078
+0.0133856
+0.0130466
+0.0130206
+0.0127365
+0.0122827
+0.0118798
+0.0115826
+0.0114022
+0.0110268
+0.0106313
+0.0104665
+0.0102081
+0.00974814
+0.00954076
+0.00922949
+0.00901025
+0.00878217
+0.0084924
+0.00844236
+0.00818394
+0.00797917
+0.00768618
+0.007564
+0.00744745
+0.00725092
+0.00693261
+0.0068667
+0.00671659
+0.00649776
+0.00634041
+0.0062317
+0.00606852
+0.00591862
+0.00579101
+0.00570983
+0.00548376
+0.00536399
+0.00523739
+0.00511642
+0.00503785
+0.0049848
+0.00473903
+0.00470608
+0.00459073
+0.00439038
+0.00436064
+0.00430236
+0.00413397
+0.00403289
+0.00404736
+0.00381064
+0.00382109
+0.00370594
+0.00362898
+0.00350519
+0.00343546
+0.0033796
+0.0033593
+0.00322386
+0.00317463
+0.00309103
+0.00301427
+0.00298252
+0.00289591
+0.00287481
+0.00280769
+0.00268873
+0.00269455
+0.0026194
+0.00254826
+0.00248737
+0.00245623
+0.00244316
+0.00239574
+0.00228642
+0.00222031
+0.00220484
+0.00214857
+0.00208869
+0.00206518
+0.0020071
+0.00195887
+0.00194561
+0.00190582
+0.00184232
+0.00187045
+0.00178505
+0.00177862
+0.00169683
+0.00164901
+0.00165021
+0.0016066
+0.00155094
+0.00155215
+0.00147599
+0.00147699
+0.00144886
+0.00139701
+0.00140726
+0.00135883
+0.00134477
+0.00133452
+0.00126941
+0.00126418
+0.00124027
+0.0012252
+0.00115165
+0.00112553
+0.00115748
+0.00111588
+0.0010994
+0.00108654
+0.00101159
+0.000988278
+0.00096115
+0.000971599
+0.000958738
+0.000911716
+0.000900864
+0.000879764
+0.000864693
+0.000890214
+0.00086831
+0.000842588
+0.000807824
+0.000807422
+0.000772054
+0.000770849
+0.000752361
+0.000720812
+0.000717798
+0.000718802
+0.000702927
+0.000677005
+0.000645053
+0.000637015
+0.000642843
+0.000618729
+0.000615714
+0.000590997
+0.000594815
+0.000589591
+0.00057472
+0.000570701
+0.000552817
+0.000536942
+0.000529506
+0.000522875
+0.000505995
+0.000497957
+0.000489919
+0.000478867
+0.000469221
+0.000452341
+0.000468618
+0.00045415
+0.000426017
+0.000408534
+0.00039507
+0.00041195
+0.000385826
+0.000391252
+0.00036975
+0.000384219
+0.0003591
+0.000363923
+0.000357894
+0.000346641
+0.000332976
+0.000342421
+0.000330766
+0.00031268
+0.000318106
+0.000309264
+0.000297207
+0.000291379
+0.000296403
+0.000272289
+0.000278116
+0.000274097
+0.000265457
+0.000260433
+0.000256012
+0.000259428
+0.000238931
+0.000243754
+0.000227678
+0.000238127
+0.000224663
+0.000230089
+0.000216826
+0.000222453
+0.000209391
+0.000215219
+0.000209994
+0.000197937
+0.000195526
+0.000184875
+0.000186885
+0.000187086
+0.000180856
+0.000173421
+0.000167191
+0.000170206
+0.000168598
+0.000171813
+0.000161766
+0.000150713
+0.000154732
+0.000145288
+0.000149307
+0.000134838
+0.00015212
+0.000129413
+0.000135441
+0.000130819
+0.000137652
+0.000129814
+0.000123183
+0.000119767
+0.000117556
+0.000123384
+0.000104294
+0.000108715
+0.000108916
+0.000109116
+0.000105298
+0.000105298
+0.000113136
+0.000102686
+9.8667e-05
+9.08299e-05
+8.62081e-05
+8.56052e-05
+8.92223e-05
+8.6409e-05
+8.74138e-05
+8.60071e-05
+8.15862e-05
+8.48014e-05
+7.89738e-05
+7.75672e-05
+7.55576e-05
+7.71653e-05
+7.0132e-05
+7.395e-05
+8.07824e-05
+7.05339e-05
+6.81225e-05
+6.06873e-05
+6.5711e-05
+5.3654e-05
+6.02854e-05
+6.45053e-05
+5.88787e-05
+5.40559e-05
+5.52616e-05
+5.66682e-05
+5.70701e-05
+4.9233e-05
+5.28502e-05
+5.60654e-05
+4.66207e-05
+5.38549e-05
+5.18454e-05
+4.36064e-05
+4.68216e-05
+5.24483e-05
+5.22473e-05
+4.5415e-05
+3.95874e-05
+4.01902e-05
+3.91855e-05
+4.01902e-05
+3.87836e-05
+3.99893e-05
+3.57693e-05
+3.59703e-05
+3.77788e-05
+3.73769e-05
+3.21522e-05
+3.55684e-05
+2.75303e-05
+3.01427e-05
+3.31569e-05
+3.09465e-05
+2.79322e-05
+2.65256e-05
+2.77313e-05
+2.73294e-05
+2.65256e-05
+2.8937e-05
+3.03436e-05
+2.75303e-05
+2.53198e-05
+2.17027e-05
+2.69275e-05
+2.27075e-05
+2.57218e-05
+2.25065e-05
+2.00951e-05
+2.23056e-05
+2.49179e-05
+1.88894e-05
+2.39132e-05
+2.02961e-05
+2.65256e-05
+2.13008e-05
+1.90904e-05
+1.92913e-05
+1.54732e-05
+1.88894e-05
+1.74828e-05
+1.72818e-05
+1.84875e-05
+1.86885e-05
+1.48704e-05
+1.68799e-05
+1.56742e-05
+1.80856e-05
+1.80856e-05
+1.50713e-05
+1.48704e-05
+1.48704e-05
+1.44685e-05
+1.34637e-05
+1.32628e-05
+1.20571e-05
+1.50713e-05
+1.20571e-05
+1.42675e-05
+1.26599e-05
+1.40666e-05
+9.64566e-06
+9.64566e-06
+1.12533e-05
+1.08514e-05
+8.6409e-06
+1.20571e-05
+1.00476e-05
+1.36647e-05
+1.16552e-05
+1.10523e-05
+9.0428e-06
+8.84185e-06
+8.239e-06
+8.6409e-06
+9.84661e-06
+8.84185e-06
+7.63614e-06
+7.03329e-06
+7.23424e-06
+7.03329e-06
+8.43995e-06
+7.63614e-06
+7.8371e-06
+7.43519e-06
+8.03805e-06
+7.8371e-06
+7.23424e-06
+6.02854e-06
+8.43995e-06
+7.03329e-06
+6.63139e-06
+4.21997e-06
+5.62663e-06
+5.42568e-06
+5.02378e-06
+4.42093e-06
+6.63139e-06
+5.22473e-06
+4.42093e-06
+5.22473e-06
+4.82283e-06
+5.22473e-06
+4.42093e-06
+4.82283e-06
+3.21522e-06
+3.41617e-06
+4.62188e-06
+3.81807e-06
+3.01427e-06
+4.01902e-06
+2.41141e-06
+3.41617e-06
+3.61712e-06
+3.81807e-06
+3.61712e-06
+3.81807e-06
+4.62188e-06
+3.81807e-06
+2.61237e-06
+3.21522e-06
+3.01427e-06
+3.21522e-06
+3.61712e-06
+3.61712e-06
+2.00951e-06
+3.21522e-06
+3.21522e-06
+2.00951e-06
+2.41141e-06
+2.41141e-06
+2.21046e-06
+3.41617e-06
+2.41141e-06
+2.41141e-06
+2.41141e-06
+1.40666e-06
+1.80856e-06
+1.20571e-06
+2.41141e-06
+3.21522e-06
+2.00951e-06
+2.81332e-06
+2.41141e-06
+2.21046e-06
+1.80856e-06
+2.00951e-06
+1.60761e-06
+2.00951e-06
+1.20571e-06
+8.03805e-07
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
diff --git a/RAW/Table2.dat b/RAW/Table2.dat
new file mode 100644 (file)
index 0000000..2b11ee8
Binary files /dev/null and b/RAW/Table2.dat differ
diff --git a/RAW/Table2.txt b/RAW/Table2.txt
new file mode 100644 (file)
index 0000000..cc6e3e7
--- /dev/null
@@ -0,0 +1,1024 @@
+5.49665e-07
+5.49665e-07
+0.814861
+0.0862528
+0.0361608
+0.0211555
+0.0131579
+0.00865062
+0.0057308
+0.00389492
+0.00267357
+0.00193372
+0.00128347
+0.000925635
+0.00063871
+0.000494698
+0.000366626
+0.000273183
+0.000205575
+0.000162151
+0.000109383
+0.000104986
+7.91517e-05
+5.11188e-05
+4.45228e-05
+3.62779e-05
+3.35295e-05
+2.52846e-05
+2.14369e-05
+1.64899e-05
+1.64899e-05
+1.42913e-05
+1.20926e-05
+1.1543e-05
+1.09933e-05
+4.94698e-06
+7.14564e-06
+8.24497e-06
+4.94698e-06
+5.49665e-06
+6.04631e-06
+3.29799e-06
+1.09933e-06
+4.39732e-06
+3.84765e-06
+1.09933e-06
+5.49665e-07
+1.09933e-06
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+1.09933e-06
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+1.09933e-06
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
+5.49665e-07
diff --git a/RAW/Table3.dat b/RAW/Table3.dat
new file mode 100644 (file)
index 0000000..48bac78
Binary files /dev/null and b/RAW/Table3.dat differ
diff --git a/RAW/Table3.txt b/RAW/Table3.txt
new file mode 100644 (file)
index 0000000..af33f23
--- /dev/null
@@ -0,0 +1,1024 @@
+1.99066e-07
+1.99066e-07
+0.0146349
+0.0162241
+0.0174772
+0.0186172
+0.0195319
+0.0202924
+0.0207211
+0.0210952
+0.0212471
+0.0213185
+0.0213446
+0.0211432
+0.0208742
+0.0207162
+0.0204162
+0.0199882
+0.0195068
+0.0191762
+0.0187084
+0.0182856
+0.0176888
+0.0173048
+0.0166903
+0.0161631
+0.0156701
+0.0152176
+0.0147814
+0.0142879
+0.0137465
+0.0133097
+0.0128565
+0.0123682
+0.0117972
+0.0115078
+0.0111059
+0.0106916
+0.0103307
+0.00996125
+0.00968176
+0.00929119
+0.00893606
+0.00869678
+0.00831517
+0.00802016
+0.00776754
+0.00744486
+0.00718408
+0.00693903
+0.00673599
+0.00646028
+0.00627157
+0.00600959
+0.00585313
+0.00560609
+0.0054542
+0.00523184
+0.00504632
+0.00491633
+0.00475269
+0.00458926
+0.0044959
+0.00435317
+0.00414753
+0.00399087
+0.00392577
+0.00378723
+0.00366878
+0.00353362
+0.0033867
+0.00336799
+0.00324517
+0.00313927
+0.00305526
+0.00290636
+0.00286038
+0.00276283
+0.0027483
+0.00264917
+0.00253391
+0.00250146
+0.00243218
+0.00235455
+0.00228607
+0.00225283
+0.00218733
+0.00213717
+0.00207964
+0.00198389
+0.00197712
+0.00195761
+0.00186823
+0.0018318
+0.00178602
+0.00174103
+0.00169246
+0.00165463
+0.00162
+0.0015563
+0.00156008
+0.00148543
+0.00144163
+0.00146293
+0.0014062
+0.00135464
+0.00134867
+0.00132618
+0.00129512
+0.00125192
+0.00120594
+0.00120634
+0.00119638
+0.00118325
+0.00114065
+0.00113189
+0.00107595
+0.00109426
+0.00105883
+0.00102559
+0.00102021
+0.000992542
+0.000979602
+0.000968853
+0.000929637
+0.000909531
+0.000898981
+0.000891416
+0.000895597
+0.000853395
+0.000837469
+0.000826322
+0.000809998
+0.000800244
+0.000769588
+0.000773171
+0.000754061
+0.000729377
+0.000733159
+0.000711262
+0.000697128
+0.0007031
+0.000668861
+0.000691355
+0.000658111
+0.000655722
+0.000643181
+0.000634821
+0.000616905
+0.00062845
+0.000600581
+0.000602373
+0.000583063
+0.000567735
+0.000576693
+0.000567337
+0.000585054
+0.000538672
+0.000539269
+0.000545838
+0.000510205
+0.000525733
+0.000498461
+0.0004901
+0.000499058
+0.000486915
+0.000478753
+0.000467008
+0.000458647
+0.000464221
+0.000454467
+0.000434162
+0.000439736
+0.000444713
+0.000426001
+0.000431973
+0.000422417
+0.000407886
+0.000407288
+0.000403307
+0.000403506
+0.000401715
+0.000386187
+0.000385192
+0.00037723
+0.00037703
+0.000350157
+0.000369466
+0.000358517
+0.00035374
+0.000357522
+0.000357323
+0.000335625
+0.000333236
+0.000330847
+0.000330051
+0.000330051
+0.000332042
+0.000325671
+0.000312732
+0.000324676
+0.000325472
+0.000304571
+0.000302381
+0.000300589
+0.000290636
+0.000302381
+0.00028546
+0.000291034
+0.000292228
+0.000271127
+0.00028765
+0.000271327
+0.000267743
+0.000267743
+0.000270331
+0.000261373
+0.000271127
+0.000254804
+0.000255003
+0.000248434
+0.000254207
+0.000253013
+0.000240471
+0.000254207
+0.000241467
+0.00023649
+0.000245846
+0.000234101
+0.000233106
+0.000226537
+0.000237286
+0.000223352
+0.000224944
+0.000212602
+0.000228726
+0.000214991
+0.000208223
+0.000209616
+0.000212204
+0.000198668
+0.000199862
+0.000189311
+0.000195283
+0.000194686
+0.000195682
+0.000196478
+0.000206829
+0.000177567
+0.000184335
+0.000186126
+0.000185728
+0.000183937
+0.000177766
+0.000182344
+0.000180354
+0.000176372
+0.000175178
+0.000177168
+0.000170201
+0.000173585
+0.000160646
+0.000169604
+0.000159452
+0.000158655
+0.000169007
+0.000167016
+0.000162438
+0.000165623
+0.000157461
+0.000166419
+0.000153082
+0.000153281
+0.000154077
+0.000150494
+0.000148304
+0.00014711
+0.000142531
+0.000148503
+0.00014711
+0.000151489
+0.000148503
+0.000135564
+0.00013417
+0.000145915
+0.000137953
+0.000137355
+0.000147707
+0.000135166
+0.000139744
+0.000130587
+0.000131184
+0.000134767
+0.000129592
+0.000133772
+0.000121629
+0.00012561
+0.000128995
+0.000121629
+0.000121629
+0.000121032
+0.000118046
+0.000109685
+0.000122226
+0.000136758
+0.00012362
+0.00010869
+0.000118444
+0.000110681
+0.000115856
+0.000106102
+0.000111477
+0.000112671
+0.000105107
+0.000100926
+0.000107097
+0.00010232
+0.000114463
+0.000105306
+0.000109088
+0.000107097
+0.000104509
+0.000106699
+0.000101524
+0.000103315
+9.91347e-05
+0.000103713
+9.31627e-05
+9.35609e-05
+0.00010013
+9.43571e-05
+9.03758e-05
+9.53525e-05
+8.95796e-05
+9.21674e-05
+9.41581e-05
+9.47553e-05
+9.25656e-05
+8.61955e-05
+9.15702e-05
+8.85842e-05
+8.12188e-05
+9.3959e-05
+9.51534e-05
+8.81861e-05
+8.16169e-05
+8.52001e-05
+7.90291e-05
+8.87833e-05
+7.18627e-05
+8.53992e-05
+8.4802e-05
+7.8631e-05
+8.65936e-05
+8.1816e-05
+8.69917e-05
+7.84319e-05
+7.2659e-05
+8.12188e-05
+6.88767e-05
+7.18627e-05
+7.68394e-05
+7.32562e-05
+7.46496e-05
+7.64412e-05
+7.38534e-05
+7.5645e-05
+7.02702e-05
+7.20618e-05
+7.54459e-05
+6.94739e-05
+6.72842e-05
+7.2858e-05
+7.14646e-05
+7.02702e-05
+6.86777e-05
+6.84786e-05
+6.25066e-05
+6.68861e-05
+6.92749e-05
+6.54926e-05
+7.08674e-05
+6.78814e-05
+6.84786e-05
+6.86777e-05
+6.86777e-05
+6.92749e-05
+7.04693e-05
+6.6687e-05
+5.87244e-05
+6.17104e-05
+6.11132e-05
+6.56917e-05
+6.3701e-05
+5.95206e-05
+6.03169e-05
+6.39001e-05
+5.97197e-05
+5.49421e-05
+6.25066e-05
+6.29048e-05
+5.71319e-05
+5.95206e-05
+5.73309e-05
+6.27057e-05
+5.43449e-05
+5.97197e-05
+5.81272e-05
+5.73309e-05
+5.67337e-05
+6.58907e-05
+5.1359e-05
+5.65347e-05
+5.25533e-05
+5.63356e-05
+5.57384e-05
+5.57384e-05
+5.753e-05
+5.1558e-05
+5.81272e-05
+4.99655e-05
+5.05627e-05
+5.29515e-05
+5.39468e-05
+4.73776e-05
+5.23543e-05
+4.89702e-05
+5.05627e-05
+4.31973e-05
+4.75767e-05
+4.37945e-05
+4.71786e-05
+4.08085e-05
+5.21552e-05
+5.35487e-05
+5.17571e-05
+5.1558e-05
+4.95674e-05
+4.5387e-05
+4.41926e-05
+4.79748e-05
+4.20029e-05
+4.97664e-05
+4.43917e-05
+3.88178e-05
+4.22019e-05
+4.73776e-05
+4.41926e-05
+4.59842e-05
+4.69795e-05
+4.20029e-05
+4.10075e-05
+4.59842e-05
+4.2401e-05
+4.16047e-05
+4.35954e-05
+4.14057e-05
+4.04103e-05
+4.57851e-05
+4.22019e-05
+4.26001e-05
+4.35954e-05
+4.12066e-05
+3.74244e-05
+3.98131e-05
+3.54337e-05
+4.14057e-05
+3.66281e-05
+3.28458e-05
+3.88178e-05
+4.22019e-05
+4.26001e-05
+3.52346e-05
+3.68272e-05
+4.2401e-05
+3.623e-05
+3.58318e-05
+3.58318e-05
+3.90169e-05
+3.68272e-05
+3.54337e-05
+4.04103e-05
+4.02113e-05
+3.96141e-05
+3.3443e-05
+4.06094e-05
+3.70262e-05
+4.14057e-05
+3.42393e-05
+3.82206e-05
+3.38412e-05
+3.84197e-05
+3.54337e-05
+2.92627e-05
+3.48365e-05
+3.70262e-05
+3.3443e-05
+3.56328e-05
+3.18505e-05
+3.3244e-05
+3.30449e-05
+3.38412e-05
+3.18505e-05
+3.0258e-05
+3.48365e-05
+3.56328e-05
+3.26468e-05
+3.3443e-05
+2.92627e-05
+3.3443e-05
+3.623e-05
+3.16514e-05
+3.22486e-05
+3.18505e-05
+3.50356e-05
+3.36421e-05
+2.78692e-05
+2.80683e-05
+3.28458e-05
+2.92627e-05
+3.06561e-05
+2.56795e-05
+2.94617e-05
+2.84664e-05
+3.24477e-05
+2.80683e-05
+2.4087e-05
+3.12533e-05
+3.04571e-05
+3.14524e-05
+2.66748e-05
+2.34898e-05
+2.98599e-05
+2.76701e-05
+2.66748e-05
+2.78692e-05
+2.80683e-05
+2.54804e-05
+2.64757e-05
+2.34898e-05
+2.32907e-05
+2.70729e-05
+2.88645e-05
+2.28926e-05
+2.74711e-05
+2.76701e-05
+2.26935e-05
+2.28926e-05
+2.34898e-05
+2.82673e-05
+2.4286e-05
+2.26935e-05
+2.4087e-05
+2.82673e-05
+2.36888e-05
+2.22954e-05
+2.44851e-05
+2.90636e-05
+2.52813e-05
+2.44851e-05
+2.09019e-05
+2.68739e-05
+2.1101e-05
+2.54804e-05
+2.50823e-05
+2.1101e-05
+2.38879e-05
+2.28926e-05
+2.56795e-05
+1.79159e-05
+2.13e-05
+1.87122e-05
+2.1101e-05
+2.24944e-05
+2.16982e-05
+1.97075e-05
+2.30916e-05
+2.56795e-05
+2.09019e-05
+2.38879e-05
+2.46841e-05
+2.1101e-05
+2.38879e-05
+2.22954e-05
+2.05038e-05
+2.03047e-05
+1.97075e-05
+2.22954e-05
+2.62767e-05
+1.89112e-05
+2.4087e-05
+2.26935e-05
+2.28926e-05
+1.57262e-05
+1.97075e-05
+2.07028e-05
+1.93094e-05
+1.49299e-05
+1.61243e-05
+2.01056e-05
+1.91103e-05
+2.48832e-05
+1.85131e-05
+1.91103e-05
+1.85131e-05
+1.87122e-05
+1.95084e-05
+2.13e-05
+2.09019e-05
+1.91103e-05
+1.5129e-05
+2.16982e-05
+1.59253e-05
+2.26935e-05
+1.93094e-05
+1.75178e-05
+1.91103e-05
+1.93094e-05
+1.63234e-05
+1.79159e-05
+1.47309e-05
+1.91103e-05
+1.71197e-05
+1.63234e-05
+1.89112e-05
+1.63234e-05
+1.79159e-05
+1.77168e-05
+2.05038e-05
+1.73187e-05
+1.89112e-05
+1.8314e-05
+1.71197e-05
+1.37355e-05
+1.45318e-05
+1.89112e-05
+1.73187e-05
+1.59253e-05
+1.71197e-05
+1.49299e-05
+1.65225e-05
+1.95084e-05
+1.33374e-05
+1.5129e-05
+1.41337e-05
+1.41337e-05
+1.33374e-05
+1.29393e-05
+1.5129e-05
+1.61243e-05
+1.71197e-05
+1.65225e-05
+1.61243e-05
+1.61243e-05
+1.45318e-05
+1.31383e-05
+1.49299e-05
+1.8314e-05
+1.85131e-05
+1.65225e-05
+1.47309e-05
+1.23421e-05
+1.47309e-05
+1.61243e-05
+1.5129e-05
+1.09486e-05
+1.61243e-05
+1.53281e-05
+1.29393e-05
+1.53281e-05
+1.39346e-05
+1.35365e-05
+1.45318e-05
+1.27402e-05
+1.33374e-05
+1.45318e-05
+1.39346e-05
+1.45318e-05
+1.19439e-05
+1.35365e-05
+1.53281e-05
+1.25411e-05
+1.2143e-05
+1.55271e-05
+1.2143e-05
+1.31383e-05
+1.35365e-05
+1.09486e-05
+1.33374e-05
+1.2143e-05
+1.09486e-05
+1.27402e-05
+1.53281e-05
+1.2143e-05
+1.31383e-05
+1.31383e-05
+1.01524e-05
+1.09486e-05
+1.35365e-05
+1.23421e-05
+1.19439e-05
+1.19439e-05
+1.43327e-05
+1.2143e-05
+1.19439e-05
+1.15458e-05
+1.15458e-05
+9.15702e-06
+1.41337e-05
+1.39346e-05
+1.03514e-05
+9.75422e-06
+1.29393e-05
+1.01524e-05
+1.05505e-05
+1.31383e-05
+1.35365e-05
+1.15458e-05
+9.15702e-06
+1.2143e-05
+1.01524e-05
+1.2143e-05
+1.29393e-05
+9.15702e-06
+1.11477e-05
+1.39346e-05
+1.03514e-05
+9.15702e-06
+1.17449e-05
+9.35609e-06
+9.75422e-06
+1.19439e-05
+9.15702e-06
+9.15702e-06
+1.13467e-05
+1.01524e-05
+1.27402e-05
+1.15458e-05
+9.35609e-06
+1.11477e-05
+8.55983e-06
+9.35609e-06
+7.96263e-06
+9.95329e-06
+9.95329e-06
+1.2143e-05
+1.13467e-05
+1.05505e-05
+9.15702e-06
+9.15702e-06
+1.11477e-05
+1.13467e-05
+1.2143e-05
+9.55515e-06
+1.07495e-05
+1.07495e-05
+6.76823e-06
+1.19439e-05
+1.01524e-05
+7.36543e-06
+1.09486e-05
+1.07495e-05
+1.03514e-05
+8.75889e-06
+1.2143e-05
+9.95329e-06
+1.13467e-05
+9.75422e-06
+9.55515e-06
+1.17449e-05
+9.75422e-06
+8.36076e-06
+7.36543e-06
+9.75422e-06
+9.55515e-06
+1.03514e-05
+8.95796e-06
+8.55983e-06
+1.01524e-05
+1.09486e-05
+1.03514e-05
+8.75889e-06
+7.5645e-06
+9.75422e-06
+8.36076e-06
+6.76823e-06
+9.75422e-06
+8.95796e-06
+7.76356e-06
+6.76823e-06
+7.5645e-06
+7.96263e-06
+9.35609e-06
+9.15702e-06
+9.15702e-06
+9.15702e-06
+6.3701e-06
+8.55983e-06
+7.5645e-06
+7.36543e-06
+8.75889e-06
+6.9673e-06
+8.95796e-06
+5.97197e-06
+8.16169e-06
+8.16169e-06
+7.36543e-06
+8.55983e-06
+6.56917e-06
+7.16637e-06
+8.75889e-06
+5.37477e-06
+5.77291e-06
+7.36543e-06
+6.9673e-06
+6.56917e-06
+6.56917e-06
+7.76356e-06
+6.9673e-06
+7.96263e-06
+6.3701e-06
+7.5645e-06
+4.97664e-06
+5.17571e-06
+6.17104e-06
+7.36543e-06
+8.16169e-06
+7.36543e-06
+6.9673e-06
+8.55983e-06
+4.97664e-06
+9.35609e-06
+6.3701e-06
+6.76823e-06
+7.36543e-06
+8.36076e-06
+5.37477e-06
+5.17571e-06
+6.9673e-06
+7.76356e-06
+5.37477e-06
+1.01524e-05
+6.56917e-06
+6.56917e-06
+7.5645e-06
+7.5645e-06
+4.97664e-06
+6.3701e-06
+8.75889e-06
+5.57384e-06
+6.76823e-06
+5.37477e-06
+4.57851e-06
+7.96263e-06
+5.77291e-06
+4.18038e-06
+6.17104e-06
+5.57384e-06
+5.17571e-06
+7.96263e-06
+6.17104e-06
+6.56917e-06
+4.97664e-06
+6.76823e-06
+7.96263e-06
+5.77291e-06
+6.56917e-06
+4.37945e-06
+5.57384e-06
+5.57384e-06
+5.77291e-06
+7.5645e-06
+6.17104e-06
+6.9673e-06
+5.37477e-06
+4.77758e-06
+5.57384e-06
+4.37945e-06
+5.57384e-06
+3.18505e-06
+3.18505e-06
+5.77291e-06
+7.16637e-06
+3.38412e-06
+4.37945e-06
+6.56917e-06
+7.16637e-06
+5.37477e-06
+3.58318e-06
+3.78225e-06
+4.77758e-06
+7.36543e-06
+6.56917e-06
+5.17571e-06
+5.57384e-06
+4.97664e-06
+6.17104e-06
+6.9673e-06
+5.17571e-06
+4.57851e-06
+5.57384e-06
+5.77291e-06
+6.17104e-06
+5.97197e-06
+4.97664e-06
+3.78225e-06
+5.57384e-06
+5.57384e-06
+4.37945e-06
+4.97664e-06
+5.77291e-06
+4.97664e-06
+3.18505e-06
+4.97664e-06
+8.55983e-06
+5.17571e-06
+3.78225e-06
+5.77291e-06
+5.17571e-06
+4.97664e-06
+5.97197e-06
+5.37477e-06
+4.18038e-06
+6.76823e-06
+4.77758e-06
+6.17104e-06
+6.17104e-06
+6.3701e-06
+5.17571e-06
+6.56917e-06
+4.97664e-06
+4.97664e-06
+6.3701e-06
+4.18038e-06
+4.37945e-06
+4.97664e-06
+5.57384e-06
+4.57851e-06
+4.37945e-06
+3.58318e-06
+3.98131e-06
+4.18038e-06
+4.57851e-06
+3.98131e-06
+3.98131e-06
+3.78225e-06
+4.77758e-06
+3.58318e-06
+4.77758e-06
+5.17571e-06
+5.17571e-06
+4.77758e-06
+4.77758e-06
+3.78225e-06
+4.18038e-06
+2.78692e-06
+3.58318e-06
+3.98131e-06
+4.77758e-06
+2.98599e-06
+3.98131e-06
+5.37477e-06
+5.97197e-06
+3.18505e-06
+4.57851e-06
+4.77758e-06
+4.97664e-06
+4.77758e-06
+3.58318e-06
+5.77291e-06
+4.37945e-06
+5.37477e-06
+5.37477e-06
+4.18038e-06
+4.97664e-06
+3.18505e-06
+3.78225e-06
+5.37477e-06
+3.58318e-06
+3.18505e-06
+3.18505e-06
+3.18505e-06
+4.18038e-06
+3.78225e-06
+3.58318e-06
+3.78225e-06
+3.98131e-06
+5.37477e-06
+2.78692e-06
+3.58318e-06
+4.18038e-06
+3.98131e-06
+3.98131e-06
+2.18972e-06
+3.78225e-06
+3.38412e-06
+1.39346e-06
+3.18505e-06
+3.38412e-06
+3.38412e-06
+4.57851e-06
+3.58318e-06
+4.37945e-06
+2.18972e-06
+5.17571e-06
+3.78225e-06
+4.37945e-06
+4.77758e-06
+3.58318e-06
+4.37945e-06
+2.58785e-06
+2.38879e-06
+4.57851e-06
+3.78225e-06
+4.57851e-06
+3.58318e-06
+3.58318e-06
+4.57851e-06
+2.98599e-06
+3.78225e-06
+4.37945e-06
+3.18505e-06
+3.78225e-06
+0.00130826
diff --git a/RAW/Table4.dat b/RAW/Table4.dat
new file mode 100644 (file)
index 0000000..525ccde
Binary files /dev/null and b/RAW/Table4.dat differ
diff --git a/RAW/Table4.txt b/RAW/Table4.txt
new file mode 100644 (file)
index 0000000..239945a
--- /dev/null
@@ -0,0 +1,1024 @@
+1.58315e-07
+1.58315e-07
+0.162321
+0.117793
+0.0931567
+0.0762903
+0.0640558
+0.0543068
+0.0469157
+0.0404141
+0.035133
+0.0308322
+0.0270298
+0.0239139
+0.0211934
+0.0188993
+0.0167953
+0.0149815
+0.01338
+0.0120468
+0.0107383
+0.00973001
+0.00875337
+0.00791319
+0.0071612
+0.00645369
+0.00592872
+0.00534691
+0.00491266
+0.00444421
+0.00404351
+0.00372308
+0.00343669
+0.00314159
+0.00287958
+0.00262707
+0.00243725
+0.0022297
+0.00211841
+0.00189851
+0.00176901
+0.00165439
+0.00152283
+0.00138367
+0.00133253
+0.0012225
+0.00110709
+0.00104234
+0.000994215
+0.000921391
+0.000864081
+0.000822602
+0.000755635
+0.000732205
+0.000657639
+0.000636583
+0.000597321
+0.0005579
+0.000548718
+0.000496158
+0.000468453
+0.000445497
+0.000402119
+0.000403385
+0.000365232
+0.000354783
+0.000343543
+0.00032312
+0.000308555
+0.000286708
+0.000287183
+0.000262485
+0.00025552
+0.000239846
+0.000223223
+0.000208025
+0.000213091
+0.000190927
+0.000188711
+0.000176521
+0.000164647
+0.000156098
+0.000157523
+0