ROOT logo
// $Id$
//**************************************************************************
//* This file is property of and copyright by the ALICE HLT Project        * 
//* ALICE Experiment at CERN, All rights reserved.                         *
//*                                                                        *
//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
//*                  for The ALICE HLT Project.                            *
//*                                                                        *
//* 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.                  *
//**************************************************************************

/**
 * Display HLT TPC clusters in AliEVE.
 * The cluster data must be stored in an HLTOUT collection originating
 * either from an HLT simulation or real run with a chain adding
 * HLT TPC cluster structures of type AliHLTTPCDefinitions::fgkClustersDataType
 * to the HLTOUT.
 *
 * The HLTOUT data is read either from the RawReader which AliEve has been
 * initialized or the HLT.Digits.root if the RawReader is not available.
 * Please note: As of Nov 2008, AliEve can handle raw data noy through
 * AliRawReaderFile. It can only open a RawReader on a single file, by default
 * raw.root. If the file is not existing, the RawReader is not initialized.
 *
 * Usage:
 * <pre>
 *   alieve $ALICE_ROOT/EVE/alice-macros/event_next.C \
 *          $ALICE_ROOT/EVE/macros/alieve_init.C \
 *          $ALICE_ROOT/EVE/alice-macros/geom_simple.C \
 *          $ALICE_ROOT/HLT/TPCLib/EVE/macros/hlt_tpc_clusters.C
 * </pre>
 * Display is changed to next event by executing event_next()
 * from the root prompt.
 * <pre>
 *   event_next(); hlt_tpc_clusters();
 * </pre>
 *
 * @ingroup alihlt_tpc
 * @author Matthias.Richter@ift.uib.no
 * @date   2008-11-22
 */
TEvePointSet* hlt_tpc_clusters(const char* digitfile=NULL, TEveElement* cont=0, Float_t maxR=270)
{
  if (!TClass::GetClass("AliEveEventManager")) {
    Error("hlt_tpc_clusters.C", "EVE library not loaded, please start alieve correctly");
    return NULL;
  }

  AliEveEventManager* eveManager=AliEveEventManager::GetMaster();
  if (!eveManager) {
    Error("hlt_tpc_clusters.C", "EVE manager not initialized");
    return NULL;
  }

  eveManager->AssertGeometry();

  TClass* pCl=NULL;
  int iLibResult=0;
  gSystem->Load("libAliHLTUtil.so");
  gSystem->Load("libAliHLTRCU.so");
  do {
    pCl=TClass::GetClass("AliHLTTPDefinitions");
  } while (!pCl && (iLibResult=gSystem->Load("libAliHLTTPC.so"))==0);
  do {
    pCl=TClass::GetClass("AliHLTTPCEVE");
  } while (!pCl && (iLibResult=gSystem->Load("libAliHLTTPCEVE.so"))==0);

  AliHLTTPCEVE hlttpceve;
  TEvePointSet* clusters = NULL;

  AliESDEvent* pESD=eveManager->AssertESD();
  // extract from RawReader if available and no digit file has been specified
  if (digitfile==NULL && eveManager->HasRawReader()) {
    AliRawReader* pRawReader=eveManager->AssertRawReader();
    if (pRawReader) {
      Info("hlt_tpc_clusters.C", "extracting HLT TPC clusters from RawReader");
      clusters=hlttpceve.MakePointSetFromHLTOUT(pRawReader, cont, maxR);
    }
  } else {
    Info("hlt_tpc_clusters.C", Form("extracting HLT TPC clusters from digit file %s", digitfile!=NULL?digitfile:""));
    clusters=hlttpceve.MakePointSetFromHLTDigits(digitfile, eveManager->GetEventId(), cont, maxR);
  }
  if (!clusters) return NULL;
  
  if (clusters->Size() == 0) {
    Info("hlt_tpc_clusters.C", "No TPC clusters");
  }

  //clusters->ApplyVizTag(clusters->GetName());

  gEve->AddElement(clusters, cont);

  gEve->Redraw3D();

  return clusters;
}
 hlt_tpc_clusters.C:1
 hlt_tpc_clusters.C:2
 hlt_tpc_clusters.C:3
 hlt_tpc_clusters.C:4
 hlt_tpc_clusters.C:5
 hlt_tpc_clusters.C:6
 hlt_tpc_clusters.C:7
 hlt_tpc_clusters.C:8
 hlt_tpc_clusters.C:9
 hlt_tpc_clusters.C:10
 hlt_tpc_clusters.C:11
 hlt_tpc_clusters.C:12
 hlt_tpc_clusters.C:13
 hlt_tpc_clusters.C:14
 hlt_tpc_clusters.C:15
 hlt_tpc_clusters.C:16
 hlt_tpc_clusters.C:17
 hlt_tpc_clusters.C:18
 hlt_tpc_clusters.C:19
 hlt_tpc_clusters.C:20
 hlt_tpc_clusters.C:21
 hlt_tpc_clusters.C:22
 hlt_tpc_clusters.C:23
 hlt_tpc_clusters.C:24
 hlt_tpc_clusters.C:25
 hlt_tpc_clusters.C:26
 hlt_tpc_clusters.C:27
 hlt_tpc_clusters.C:28
 hlt_tpc_clusters.C:29
 hlt_tpc_clusters.C:30
 hlt_tpc_clusters.C:31
 hlt_tpc_clusters.C:32
 hlt_tpc_clusters.C:33
 hlt_tpc_clusters.C:34
 hlt_tpc_clusters.C:35
 hlt_tpc_clusters.C:36
 hlt_tpc_clusters.C:37
 hlt_tpc_clusters.C:38
 hlt_tpc_clusters.C:39
 hlt_tpc_clusters.C:40
 hlt_tpc_clusters.C:41
 hlt_tpc_clusters.C:42
 hlt_tpc_clusters.C:43
 hlt_tpc_clusters.C:44
 hlt_tpc_clusters.C:45
 hlt_tpc_clusters.C:46
 hlt_tpc_clusters.C:47
 hlt_tpc_clusters.C:48
 hlt_tpc_clusters.C:49
 hlt_tpc_clusters.C:50
 hlt_tpc_clusters.C:51
 hlt_tpc_clusters.C:52
 hlt_tpc_clusters.C:53
 hlt_tpc_clusters.C:54
 hlt_tpc_clusters.C:55
 hlt_tpc_clusters.C:56
 hlt_tpc_clusters.C:57
 hlt_tpc_clusters.C:58
 hlt_tpc_clusters.C:59
 hlt_tpc_clusters.C:60
 hlt_tpc_clusters.C:61
 hlt_tpc_clusters.C:62
 hlt_tpc_clusters.C:63
 hlt_tpc_clusters.C:64
 hlt_tpc_clusters.C:65
 hlt_tpc_clusters.C:66
 hlt_tpc_clusters.C:67
 hlt_tpc_clusters.C:68
 hlt_tpc_clusters.C:69
 hlt_tpc_clusters.C:70
 hlt_tpc_clusters.C:71
 hlt_tpc_clusters.C:72
 hlt_tpc_clusters.C:73
 hlt_tpc_clusters.C:74
 hlt_tpc_clusters.C:75
 hlt_tpc_clusters.C:76
 hlt_tpc_clusters.C:77
 hlt_tpc_clusters.C:78
 hlt_tpc_clusters.C:79
 hlt_tpc_clusters.C:80
 hlt_tpc_clusters.C:81
 hlt_tpc_clusters.C:82
 hlt_tpc_clusters.C:83
 hlt_tpc_clusters.C:84
 hlt_tpc_clusters.C:85
 hlt_tpc_clusters.C:86
 hlt_tpc_clusters.C:87
 hlt_tpc_clusters.C:88
 hlt_tpc_clusters.C:89
 hlt_tpc_clusters.C:90
 hlt_tpc_clusters.C:91
 hlt_tpc_clusters.C:92
 hlt_tpc_clusters.C:93
 hlt_tpc_clusters.C:94
 hlt_tpc_clusters.C:95
 hlt_tpc_clusters.C:96
 hlt_tpc_clusters.C:97
 hlt_tpc_clusters.C:98
 hlt_tpc_clusters.C:99
 hlt_tpc_clusters.C:100
 hlt_tpc_clusters.C:101
 hlt_tpc_clusters.C:102
 hlt_tpc_clusters.C:103