ROOT logo
/**************************************************************************
 * 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$ */

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// base class for reconstruction algorithms                                  //
//                                                                           //
// Derived classes should implement a default constructor and                //
// the virtual methods                                                       //
// - Reconstruct : to perform the local reconstruction for all events        //
// - FillESD     : to fill the ESD for the current event                     //
//                                                                           //
// The reconstructor classes for the barrel detectors should in addition     //
// implement the method                                                      //
// - CreateTracker : to create a tracker object for the barrel detector      //
//                                                                           //
// The ITS reconstructor should in addition implement the method             //
// - CreateVertexer : to create an object for the vertex finding             //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////


#include "AliLog.h"
#include "AliReconstructor.h"
#include <TClass.h>
#include <TString.h>


ClassImp(AliReconstructor)

const AliDetectorRecoParam* AliReconstructor::fgRecoParam[AliReconstruction::kNDetectors] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};

//_____________________________________________________________________________
void AliReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, 
				     TTree* /*digitsTree*/) const
{
// convert raw data digits into digit objects in a root tree

  AliError("conversion of raw data digits into digit objects not implemented");
}


//_____________________________________________________________________________
void AliReconstructor::Reconstruct(TTree* /*digitsTree*/,
				   TTree* /*clustersTree*/) const
{
// run the local reconstruction

  AliError("local event reconstruction not implemented");
}

//_____________________________________________________________________________
void AliReconstructor::Reconstruct(AliRawReader* /*rawReader*/, 
				   TTree* /*clustersTree*/) const
{
// run the local reconstruction with raw data input

  AliError("local event reconstruction not implemented for raw data input");
}

//_____________________________________________________________________________
void AliReconstructor::FillESD(TTree* /*digitsTree*/, TTree* /*clustersTree*/,
			       AliESDEvent* /*esd*/) const
{
// fill the ESD.
// by default nothing is done

}

//_____________________________________________________________________________
void AliReconstructor::FillESD(AliRawReader* /*rawReader*/, 
			       TTree* clustersTree, AliESDEvent* esd) const
{
// fill the ESD in case of raw data input.
// by default the FillESD method for MC is called

  FillESD((TTree*)NULL, clustersTree, esd);
}

//_____________________________________________________________________________
const char* AliReconstructor::GetDetectorName() const
{
// get the name of the detector

  static TString detName;
  detName = GetName();
  detName.Remove(0, 3);
  detName.Remove(detName.Index("Reconstructor"));
  detName.ReplaceAll("Upgrade","");
  return detName.Data();
}

//_____________________________________________________________________________
void AliReconstructor::SetRecoParam(const AliDetectorRecoParam *par)
{
  // To be implemented by the detectors.
  // As soon as we manage to remove the static members
  // and method in the detector reconstructors, we will
  // implemented this method in the base class and remove
  // the detectors implementations.
  Int_t iDet = AliReconstruction::GetDetIndex(GetDetectorName());

  if (iDet >= 0)
    fgRecoParam[iDet] = par;
  else
    AliError(Form("Invalid detector index for (%s)",GetDetectorName()));

  return;
}

//_____________________________________________________________________________
const AliDetectorRecoParam* AliReconstructor::GetRecoParam(Int_t iDet)
{
  // Get the current reconstruciton parameters
  // for a given detector 
  if (iDet >= 0 && iDet < AliReconstruction::kNDetectors)
    return fgRecoParam[iDet];
  else {
    AliErrorClass(Form("Invalid detector index (%d)",iDet));
    return NULL;
  }
}

//_____________________________________________________________________________
void AliReconstructor::GetPidSettings(AliESDpid */*esdPID*/) {
  //
  // Function to set Pid settings in esdPID
  // based on detector-specific AliRecoParams
  // to be implemented by detectors separately (e.g TOF)
  // 
  return;
}
 AliReconstructor.cxx:1
 AliReconstructor.cxx:2
 AliReconstructor.cxx:3
 AliReconstructor.cxx:4
 AliReconstructor.cxx:5
 AliReconstructor.cxx:6
 AliReconstructor.cxx:7
 AliReconstructor.cxx:8
 AliReconstructor.cxx:9
 AliReconstructor.cxx:10
 AliReconstructor.cxx:11
 AliReconstructor.cxx:12
 AliReconstructor.cxx:13
 AliReconstructor.cxx:14
 AliReconstructor.cxx:15
 AliReconstructor.cxx:16
 AliReconstructor.cxx:17
 AliReconstructor.cxx:18
 AliReconstructor.cxx:19
 AliReconstructor.cxx:20
 AliReconstructor.cxx:21
 AliReconstructor.cxx:22
 AliReconstructor.cxx:23
 AliReconstructor.cxx:24
 AliReconstructor.cxx:25
 AliReconstructor.cxx:26
 AliReconstructor.cxx:27
 AliReconstructor.cxx:28
 AliReconstructor.cxx:29
 AliReconstructor.cxx:30
 AliReconstructor.cxx:31
 AliReconstructor.cxx:32
 AliReconstructor.cxx:33
 AliReconstructor.cxx:34
 AliReconstructor.cxx:35
 AliReconstructor.cxx:36
 AliReconstructor.cxx:37
 AliReconstructor.cxx:38
 AliReconstructor.cxx:39
 AliReconstructor.cxx:40
 AliReconstructor.cxx:41
 AliReconstructor.cxx:42
 AliReconstructor.cxx:43
 AliReconstructor.cxx:44
 AliReconstructor.cxx:45
 AliReconstructor.cxx:46
 AliReconstructor.cxx:47
 AliReconstructor.cxx:48
 AliReconstructor.cxx:49
 AliReconstructor.cxx:50
 AliReconstructor.cxx:51
 AliReconstructor.cxx:52
 AliReconstructor.cxx:53
 AliReconstructor.cxx:54
 AliReconstructor.cxx:55
 AliReconstructor.cxx:56
 AliReconstructor.cxx:57
 AliReconstructor.cxx:58
 AliReconstructor.cxx:59
 AliReconstructor.cxx:60
 AliReconstructor.cxx:61
 AliReconstructor.cxx:62
 AliReconstructor.cxx:63
 AliReconstructor.cxx:64
 AliReconstructor.cxx:65
 AliReconstructor.cxx:66
 AliReconstructor.cxx:67
 AliReconstructor.cxx:68
 AliReconstructor.cxx:69
 AliReconstructor.cxx:70
 AliReconstructor.cxx:71
 AliReconstructor.cxx:72
 AliReconstructor.cxx:73
 AliReconstructor.cxx:74
 AliReconstructor.cxx:75
 AliReconstructor.cxx:76
 AliReconstructor.cxx:77
 AliReconstructor.cxx:78
 AliReconstructor.cxx:79
 AliReconstructor.cxx:80
 AliReconstructor.cxx:81
 AliReconstructor.cxx:82
 AliReconstructor.cxx:83
 AliReconstructor.cxx:84
 AliReconstructor.cxx:85
 AliReconstructor.cxx:86
 AliReconstructor.cxx:87
 AliReconstructor.cxx:88
 AliReconstructor.cxx:89
 AliReconstructor.cxx:90
 AliReconstructor.cxx:91
 AliReconstructor.cxx:92
 AliReconstructor.cxx:93
 AliReconstructor.cxx:94
 AliReconstructor.cxx:95
 AliReconstructor.cxx:96
 AliReconstructor.cxx:97
 AliReconstructor.cxx:98
 AliReconstructor.cxx:99
 AliReconstructor.cxx:100
 AliReconstructor.cxx:101
 AliReconstructor.cxx:102
 AliReconstructor.cxx:103
 AliReconstructor.cxx:104
 AliReconstructor.cxx:105
 AliReconstructor.cxx:106
 AliReconstructor.cxx:107
 AliReconstructor.cxx:108
 AliReconstructor.cxx:109
 AliReconstructor.cxx:110
 AliReconstructor.cxx:111
 AliReconstructor.cxx:112
 AliReconstructor.cxx:113
 AliReconstructor.cxx:114
 AliReconstructor.cxx:115
 AliReconstructor.cxx:116
 AliReconstructor.cxx:117
 AliReconstructor.cxx:118
 AliReconstructor.cxx:119
 AliReconstructor.cxx:120
 AliReconstructor.cxx:121
 AliReconstructor.cxx:122
 AliReconstructor.cxx:123
 AliReconstructor.cxx:124
 AliReconstructor.cxx:125
 AliReconstructor.cxx:126
 AliReconstructor.cxx:127
 AliReconstructor.cxx:128
 AliReconstructor.cxx:129
 AliReconstructor.cxx:130
 AliReconstructor.cxx:131
 AliReconstructor.cxx:132
 AliReconstructor.cxx:133
 AliReconstructor.cxx:134
 AliReconstructor.cxx:135
 AliReconstructor.cxx:136
 AliReconstructor.cxx:137
 AliReconstructor.cxx:138
 AliReconstructor.cxx:139
 AliReconstructor.cxx:140
 AliReconstructor.cxx:141
 AliReconstructor.cxx:142
 AliReconstructor.cxx:143
 AliReconstructor.cxx:144
 AliReconstructor.cxx:145
 AliReconstructor.cxx:146