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.                  *
 **************************************************************************/

//-------------------------------------------------------
//          Implementation of the TPC cluser
//
//   Origin: Marian Ivanov   Marian.Ivanov@cern.ch
// 
//  AliTPC parallel tracker - 
//  Description of this class together with its intended usage
//  will follow shortly
//  
//-------------------------------------------------------

/* $Id$ */

#include "AliTPCclusterMI.h"
#include "AliTPCclusterInfo.h"
#include "AliTrackPointArray.h"
#include "AliGeomManager.h"
#include "AliLog.h"

ClassImp(AliTPCclusterMI)


AliTPCclusterMI::AliTPCclusterMI():
  AliCluster(),
  fInfo(0),
  fTimeBin(0),  //time bin coordinate
  fPad(0),  //pad coordinate
  fQ(0),       //Q of cluster (in ADC counts)  
  fMax(0),      //maximal amplitude in cluster
  fType(0),     //type of the cluster 0 means golden 
  fUsed(0),     //counter of usage  
  fDetector(0), //detector  number
  fRow(0)      //row number number
{
  //
  // default constructor
  //
}

AliTPCclusterMI::AliTPCclusterMI(const AliTPCclusterMI & cluster):
  AliCluster(cluster),
  fInfo(0),
  fTimeBin(cluster.fTimeBin),
  fPad(cluster.fPad),
  fQ(cluster.fQ),
  fMax(cluster.fMax),
  fType(cluster.fType),
  fUsed(cluster.fUsed),
  fDetector(cluster.fDetector),
  fRow(cluster.fRow)
{
  //
  // copy constructor
  // 
  //  AliInfo("Copy constructor\n");
  if (cluster.fInfo) fInfo = new AliTPCclusterInfo(*(cluster.fInfo));
}

AliTPCclusterMI & AliTPCclusterMI::operator = (const AliTPCclusterMI & cluster)
{
  //
  // assignment operator
  // 
  //  AliInfo("Asignment operator\n");
  if (this == &cluster) return (*this);

  (AliCluster&)(*this) = (AliCluster&)cluster;
  fQ    = cluster.fQ;
  fType = cluster.fType;
  fMax  = cluster.fMax;
  fUsed = cluster.fUsed;
  fDetector = cluster.fDetector;
  fRow  = cluster.fRow;
  fTimeBin = cluster.fTimeBin;
  fPad     = cluster.fPad;
  delete fInfo;
  fInfo = 0;
  if (cluster.fInfo) fInfo = new AliTPCclusterInfo(*(cluster.fInfo));
  return *this;
}




AliTPCclusterMI::AliTPCclusterMI(Int_t *lab, Float_t *hit) : 
  AliCluster(0,hit,0.,0.,lab),
  fInfo(0),
  fTimeBin(0),  //time bin coordinate
  fPad(0),  //pad coordinate
  fQ(0),       //Q of cluster (in ADC counts)  
  fMax(0),      //maximal amplitude in cluster
  fType(0),     //type of the cluster 0 means golden 
  fUsed(0),     //counter of usage  
  fDetector(0), //detector  number
  fRow(0)      //row number number
{
  //
  // constructor
  //
  fQ = (UShort_t)hit[4];
  fInfo = 0;
}

AliTPCclusterMI::~AliTPCclusterMI() {
  //
  // destructor
  //
  if (fInfo) delete fInfo;
  fInfo = 0;
}



Bool_t AliTPCclusterMI::IsSortable() const
{
  //
  //
  return kTRUE;

}

Int_t AliTPCclusterMI::Compare(const TObject* obj) const
{
  //
  // compare according y
  AliTPCclusterMI * o2 = (AliTPCclusterMI*)obj;
  return (o2->GetY()>GetY())? -1:1; 
}


void AliTPCclusterMI::SetDetector(Int_t detector){
  //
  // set volume ID 
  //  
  fDetector = (UChar_t)(detector%72);
  AliGeomManager::ELayerID id = (fDetector<36) ? 
    AliGeomManager::kTPC1 :AliGeomManager::kTPC2 ;
  Int_t modId = (fDetector<36)?fDetector: fDetector-36;
  SetVolumeId(AliGeomManager::LayerToVolUID(id,modId));  
}


void AliTPCclusterMI::SetInfo(AliTPCclusterInfo * info) {
  //
  //
  //
  if (fInfo) delete fInfo;
  fInfo = info;
}


AliTPCclusterMI* AliTPCclusterMI::MakeCluster(AliTrackPoint* /*point*/) {
  //
  // make AliTPCclusterMI out of AliTrackPoint
  // (not yet implemented)
  
  return NULL;
}


AliTrackPoint* AliTPCclusterMI::MakePoint() {
  //
  // make AliTrackPoint out of AliTPCclusterMI
  //

  AliTrackPoint* point = new AliTrackPoint();
  Float_t xyz[3]={0.};
  Float_t cov[6]={0.};
  GetGlobalXYZ(xyz);
  GetGlobalCov(cov);
  // voluem ID to add later ....
  point->SetXYZ(xyz);
  point->SetCov(cov);

  return point;
}

//______________________________________________________________________________
void AliTPCclusterMI::SetGlobalTrackPoint( const AliCluster &cl, AliTrackPoint &point )
{
  //
  // Set global AliTrackPoint
  //
  
  Float_t xyz[3]={0.};
  Float_t cov[6]={0.};
  cl.GetGlobalXYZ(xyz);
  cl.GetGlobalCov(cov);
  // voluem ID to add later ....
  point.SetXYZ(xyz);
  point.SetCov(cov);
}
 AliTPCclusterMI.cxx:1
 AliTPCclusterMI.cxx:2
 AliTPCclusterMI.cxx:3
 AliTPCclusterMI.cxx:4
 AliTPCclusterMI.cxx:5
 AliTPCclusterMI.cxx:6
 AliTPCclusterMI.cxx:7
 AliTPCclusterMI.cxx:8
 AliTPCclusterMI.cxx:9
 AliTPCclusterMI.cxx:10
 AliTPCclusterMI.cxx:11
 AliTPCclusterMI.cxx:12
 AliTPCclusterMI.cxx:13
 AliTPCclusterMI.cxx:14
 AliTPCclusterMI.cxx:15
 AliTPCclusterMI.cxx:16
 AliTPCclusterMI.cxx:17
 AliTPCclusterMI.cxx:18
 AliTPCclusterMI.cxx:19
 AliTPCclusterMI.cxx:20
 AliTPCclusterMI.cxx:21
 AliTPCclusterMI.cxx:22
 AliTPCclusterMI.cxx:23
 AliTPCclusterMI.cxx:24
 AliTPCclusterMI.cxx:25
 AliTPCclusterMI.cxx:26
 AliTPCclusterMI.cxx:27
 AliTPCclusterMI.cxx:28
 AliTPCclusterMI.cxx:29
 AliTPCclusterMI.cxx:30
 AliTPCclusterMI.cxx:31
 AliTPCclusterMI.cxx:32
 AliTPCclusterMI.cxx:33
 AliTPCclusterMI.cxx:34
 AliTPCclusterMI.cxx:35
 AliTPCclusterMI.cxx:36
 AliTPCclusterMI.cxx:37
 AliTPCclusterMI.cxx:38
 AliTPCclusterMI.cxx:39
 AliTPCclusterMI.cxx:40
 AliTPCclusterMI.cxx:41
 AliTPCclusterMI.cxx:42
 AliTPCclusterMI.cxx:43
 AliTPCclusterMI.cxx:44
 AliTPCclusterMI.cxx:45
 AliTPCclusterMI.cxx:46
 AliTPCclusterMI.cxx:47
 AliTPCclusterMI.cxx:48
 AliTPCclusterMI.cxx:49
 AliTPCclusterMI.cxx:50
 AliTPCclusterMI.cxx:51
 AliTPCclusterMI.cxx:52
 AliTPCclusterMI.cxx:53
 AliTPCclusterMI.cxx:54
 AliTPCclusterMI.cxx:55
 AliTPCclusterMI.cxx:56
 AliTPCclusterMI.cxx:57
 AliTPCclusterMI.cxx:58
 AliTPCclusterMI.cxx:59
 AliTPCclusterMI.cxx:60
 AliTPCclusterMI.cxx:61
 AliTPCclusterMI.cxx:62
 AliTPCclusterMI.cxx:63
 AliTPCclusterMI.cxx:64
 AliTPCclusterMI.cxx:65
 AliTPCclusterMI.cxx:66
 AliTPCclusterMI.cxx:67
 AliTPCclusterMI.cxx:68
 AliTPCclusterMI.cxx:69
 AliTPCclusterMI.cxx:70
 AliTPCclusterMI.cxx:71
 AliTPCclusterMI.cxx:72
 AliTPCclusterMI.cxx:73
 AliTPCclusterMI.cxx:74
 AliTPCclusterMI.cxx:75
 AliTPCclusterMI.cxx:76
 AliTPCclusterMI.cxx:77
 AliTPCclusterMI.cxx:78
 AliTPCclusterMI.cxx:79
 AliTPCclusterMI.cxx:80
 AliTPCclusterMI.cxx:81
 AliTPCclusterMI.cxx:82
 AliTPCclusterMI.cxx:83
 AliTPCclusterMI.cxx:84
 AliTPCclusterMI.cxx:85
 AliTPCclusterMI.cxx:86
 AliTPCclusterMI.cxx:87
 AliTPCclusterMI.cxx:88
 AliTPCclusterMI.cxx:89
 AliTPCclusterMI.cxx:90
 AliTPCclusterMI.cxx:91
 AliTPCclusterMI.cxx:92
 AliTPCclusterMI.cxx:93
 AliTPCclusterMI.cxx:94
 AliTPCclusterMI.cxx:95
 AliTPCclusterMI.cxx:96
 AliTPCclusterMI.cxx:97
 AliTPCclusterMI.cxx:98
 AliTPCclusterMI.cxx:99
 AliTPCclusterMI.cxx:100
 AliTPCclusterMI.cxx:101
 AliTPCclusterMI.cxx:102
 AliTPCclusterMI.cxx:103
 AliTPCclusterMI.cxx:104
 AliTPCclusterMI.cxx:105
 AliTPCclusterMI.cxx:106
 AliTPCclusterMI.cxx:107
 AliTPCclusterMI.cxx:108
 AliTPCclusterMI.cxx:109
 AliTPCclusterMI.cxx:110
 AliTPCclusterMI.cxx:111
 AliTPCclusterMI.cxx:112
 AliTPCclusterMI.cxx:113
 AliTPCclusterMI.cxx:114
 AliTPCclusterMI.cxx:115
 AliTPCclusterMI.cxx:116
 AliTPCclusterMI.cxx:117
 AliTPCclusterMI.cxx:118
 AliTPCclusterMI.cxx:119
 AliTPCclusterMI.cxx:120
 AliTPCclusterMI.cxx:121
 AliTPCclusterMI.cxx:122
 AliTPCclusterMI.cxx:123
 AliTPCclusterMI.cxx:124
 AliTPCclusterMI.cxx:125
 AliTPCclusterMI.cxx:126
 AliTPCclusterMI.cxx:127
 AliTPCclusterMI.cxx:128
 AliTPCclusterMI.cxx:129
 AliTPCclusterMI.cxx:130
 AliTPCclusterMI.cxx:131
 AliTPCclusterMI.cxx:132
 AliTPCclusterMI.cxx:133
 AliTPCclusterMI.cxx:134
 AliTPCclusterMI.cxx:135
 AliTPCclusterMI.cxx:136
 AliTPCclusterMI.cxx:137
 AliTPCclusterMI.cxx:138
 AliTPCclusterMI.cxx:139
 AliTPCclusterMI.cxx:140
 AliTPCclusterMI.cxx:141
 AliTPCclusterMI.cxx:142
 AliTPCclusterMI.cxx:143
 AliTPCclusterMI.cxx:144
 AliTPCclusterMI.cxx:145
 AliTPCclusterMI.cxx:146
 AliTPCclusterMI.cxx:147
 AliTPCclusterMI.cxx:148
 AliTPCclusterMI.cxx:149
 AliTPCclusterMI.cxx:150
 AliTPCclusterMI.cxx:151
 AliTPCclusterMI.cxx:152
 AliTPCclusterMI.cxx:153
 AliTPCclusterMI.cxx:154
 AliTPCclusterMI.cxx:155
 AliTPCclusterMI.cxx:156
 AliTPCclusterMI.cxx:157
 AliTPCclusterMI.cxx:158
 AliTPCclusterMI.cxx:159
 AliTPCclusterMI.cxx:160
 AliTPCclusterMI.cxx:161
 AliTPCclusterMI.cxx:162
 AliTPCclusterMI.cxx:163
 AliTPCclusterMI.cxx:164
 AliTPCclusterMI.cxx:165
 AliTPCclusterMI.cxx:166
 AliTPCclusterMI.cxx:167
 AliTPCclusterMI.cxx:168
 AliTPCclusterMI.cxx:169
 AliTPCclusterMI.cxx:170
 AliTPCclusterMI.cxx:171
 AliTPCclusterMI.cxx:172
 AliTPCclusterMI.cxx:173
 AliTPCclusterMI.cxx:174
 AliTPCclusterMI.cxx:175
 AliTPCclusterMI.cxx:176
 AliTPCclusterMI.cxx:177
 AliTPCclusterMI.cxx:178
 AliTPCclusterMI.cxx:179
 AliTPCclusterMI.cxx:180
 AliTPCclusterMI.cxx:181
 AliTPCclusterMI.cxx:182
 AliTPCclusterMI.cxx:183
 AliTPCclusterMI.cxx:184
 AliTPCclusterMI.cxx:185
 AliTPCclusterMI.cxx:186
 AliTPCclusterMI.cxx:187
 AliTPCclusterMI.cxx:188
 AliTPCclusterMI.cxx:189
 AliTPCclusterMI.cxx:190
 AliTPCclusterMI.cxx:191
 AliTPCclusterMI.cxx:192
 AliTPCclusterMI.cxx:193
 AliTPCclusterMI.cxx:194
 AliTPCclusterMI.cxx:195
 AliTPCclusterMI.cxx:196
 AliTPCclusterMI.cxx:197
 AliTPCclusterMI.cxx:198
 AliTPCclusterMI.cxx:199
 AliTPCclusterMI.cxx:200
 AliTPCclusterMI.cxx:201
 AliTPCclusterMI.cxx:202
 AliTPCclusterMI.cxx:203
 AliTPCclusterMI.cxx:204
 AliTPCclusterMI.cxx:205
 AliTPCclusterMI.cxx:206
 AliTPCclusterMI.cxx:207