]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCConfMapper.cxx
minor update of documentation
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCConfMapper.cxx
index 417ddd4c43507ad0830dbb4c043ca78b07c9f634..6a42af76e9a6584ba65d919bc695c8c9dfc3b120 100644 (file)
@@ -1,16 +1,27 @@
 // @(#) $Id$
 // Original: AliHLTConfMapper.cxx,v 1.26 2005/06/14 10:55:21 cvetan Exp $
 
-/** \class AliHLTTPCConfMapper
-<pre>
-//_____________________________________________________________
-// AliHLTTPCConfMapper
-//
-// Conformal mapping base class
-//
-// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
-// Copyright &copy ALICE HLT Group
-</pre>
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Anders Vestbo, maintained by
+//*                  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.                  *
+//**************************************************************************
+
+/** @file   AliHLTTPCConfMapper.cxx
+    @author Anders Vestbo, Matthias Richter
+    @date   Conformal mapping base class.
+    @brief  
 */
 
 #include <cassert>
@@ -64,8 +75,8 @@ AliHLTTPCConfMapper::AliHLTTPCConfMapper()
   fMaxPhi(0.0),
   fMaxEta(0.0),
   fMainVertexTracks(0),
-  fClustersUnused(0)
-
+  fClustersUnused(0),
+  fClusterCutZ(-1)
 {
   //Default constructor
   fParamSet[0]=0;
@@ -161,16 +172,52 @@ void AliHLTTPCConfMapper::InitSector(Int_t sector,Int_t *rowrange,Float_t *etara
 }
 
 Bool_t AliHLTTPCConfMapper::ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits )
+{
+  //read hits with ReadHitsChecked  
+  return ReadHitsChecked(count,hits,0);
+}
+
+Bool_t AliHLTTPCConfMapper::ReadHitsChecked(UInt_t count, AliHLTTPCSpacePointData* hits, unsigned int sizeInByte )
 {
   //read hits
-  if (fHit.size()<fClustersUnused+count) fHit.resize(fClustersUnused+count);
-  assert(fHit.size()>=fClustersUnused+count);
-  for (Int_t i=0;(UInt_t)i<count;i++)
-    {  
-      fHit[i+fClustersUnused].Reset();
-      fHit[i+fClustersUnused].Read(hits[i]);
-    }
-  fClustersUnused += count;
+  if(fClusterCutZ == -1){
+    if (fHit.size()<fClustersUnused+count) fHit.resize(fClustersUnused+count);
+    assert(fHit.size()>=fClustersUnused+count);
+    for (Int_t i=0;(UInt_t)i<count;i++)
+      {        
+       AliHLTTPCSpacePointData *hit = &hits[i];
+       if (sizeInByte>0 && ((AliHLTUInt8_t*)hit)+sizeof(AliHLTTPCSpacePointData)>((AliHLTUInt8_t*)hits)+sizeInByte) {
+         LOG(AliHLTTPCLog::kWarning,"AliHLTTPCConfMapper::ReadHits","")<<"Wrong size of data (" << sizeInByte << " byte), skipping array of AliHLTTPCSpacePointData" <<ENDLOG;;
+         break;
+       }
+       fHit[i+fClustersUnused].Reset();
+       fHit[i+fClustersUnused].Read(hits[i]);
+      }
+    fClustersUnused += count;
+  }
+  else{
+    //Skipping clusters with high Z. 
+    UInt_t skipped=0;
+    
+    if (fHit.size()<fClustersUnused+count) fHit.resize(fClustersUnused+count);
+    assert(fHit.size()>=fClustersUnused+count);
+    for (Int_t i=0;(UInt_t)i<count;i++)
+      {  
+       AliHLTTPCSpacePointData *hit = &hits[i];
+       if (sizeInByte>0 && ((AliHLTUInt8_t*)hit)+sizeof(AliHLTTPCSpacePointData)>((AliHLTUInt8_t*)hits)+sizeInByte) {
+         LOG(AliHLTTPCLog::kWarning,"AliHLTTPCConfMapper::ReadHits","")<<"Wrong size of data (" << sizeInByte << " byte), skipping array of AliHLTTPCSpacePointData" <<ENDLOG;;
+         break;
+       }
+       if(hits[i].fZ > fClusterCutZ || hits[i].fZ < -1*fClusterCutZ){
+         ++skipped;
+         continue;
+       }
+       fHit[i+fClustersUnused-skipped].Reset();
+       fHit[i+fClustersUnused-skipped].Read(hits[i]);
+      }
+    fClustersUnused += count - skipped;
+    fHit.resize(fClustersUnused);
+  }
 
   LOG(AliHLTTPCLog::kDebug,"AliHLTTPCConfMapper::ReadHits","#hits")
     <<AliHLTTPCLog::kDec<<"#hits: "<<count<<" total: "<<fClustersUnused<<ENDLOG;
@@ -256,8 +303,12 @@ void AliHLTTPCConfMapper::SetPointers()
        fRow[(localrow-fRowMin)].last = (void *)thisHit;
     }
   
+  //If a cluster has an Eta outside the Eta or Phi range set in the Tracker, it will go in to
+  //the if here. This has been seen for high Eta clusters most likely from signal from the gating grid.
+  //These clusters are read in, but not used in the Tracking. 
+#ifdef PACKAGE_STRING
   if(fClustersUnused>0 && localcounter==0)
-    LOG(AliHLTTPCLog::kError,"AliHLTTPCConfMapper::SetPointers","Parameters")
+    LOG(AliHLTTPCLog::kDebug,"AliHLTTPCConfMapper::SetPointers","Parameters")
       <<AliHLTTPCLog::kDec<<"No points passed to track finder, hits out of range: "
       <<fEtaHitsOutOfRange+fPhiHitsOutOfRange<<ENDLOG;
 
@@ -265,6 +316,7 @@ void AliHLTTPCConfMapper::SetPointers()
   LOG(AliHLTTPCLog::kDebug,"AliHLTTPCConfMapper::SetPointers","Setup")
     <<"Setup finished, hits out of range: "<<fEtaHitsOutOfRange+fPhiHitsOutOfRange
     <<" hits accepted "<<hits_accepted<<ENDLOG;
+#endif //PACKAGE_STRING
 }
 
 void AliHLTTPCConfMapper::MainVertexTrackingA()
@@ -829,9 +881,9 @@ Double_t AliHLTTPCConfMapper::TrackletAngle(AliHLTTPCConfMapTrack *track,Int_t n
   if(n<3)
     return 0;
   
-  Double_t x1[2];
-  Double_t x2[2];
-  Double_t x3[2];
+  Double_t x1[2]={0,0};
+  Double_t x2[2]={0,0};
+  Double_t x3[2]={0,0};
   Double_t angle1,angle2;
   Int_t counter=0;
   for(track->StartLoop(); track->LoopDone(); track->GetNextHit())