2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
6 * Primary Authors: Svein Lindal (slindal@fys.uio.no) *
7 * for The ALICE HLT Project. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 /** @file AliHLTGlobalTrackMatcher.cxx
21 @brief The HLT class Matching Calorimeter clusters to TPC tracks
24 #include "AliHLTGlobalTrackMatcher.h"
25 //#include "AliESDCaloCluster.h"
33 ClassImp(AliHLTGlobalTrackMatcher)
36 AliHLTGlobalTrackMatcher::AliHLTGlobalTrackMatcher() :
49 //_____________________________________________________________________________
50 AliHLTGlobalTrackMatcher::~AliHLTGlobalTrackMatcher()
56 void AliHLTGlobalTrackMatcher::DoInit( )
58 //See header file for documentation
59 //BALLE TODO: Change hardcoded values to something that is initialised through
60 //command line or something!!!
61 fMatchDistance = 40*40;
62 fPhosMaxX = 355 + TMath::Sqrt(fMatchDistance) + 30;
63 fPhosMaxZ = 64.+ TMath::Sqrt(fMatchDistance) + 30;
64 fEmcalMaxZ = 350 + TMath::Sqrt(fMatchDistance) + 30;
69 Int_t AliHLTGlobalTrackMatcher::AddTrackToCluster(Int_t tId, TArrayI* matchedTracksArray, Bool_t bestMatch, Int_t nMatches){
70 //See header file for documentation
72 matchedTracksArray->Set(matchedTracksArray->GetSize() + 1);
74 matchedTracksArray->AddAt(matchedTracksArray->At(0), matchedTracksArray->GetSize() - 1);
75 matchedTracksArray->AddAt(tId, 0);
77 matchedTracksArray->AddAt(tId, matchedTracksArray->GetSize() - 1);
83 Int_t AliHLTGlobalTrackMatcher::AddTrackToCluster(Int_t tId, Int_t* matchArray, bool bestMatch, Int_t nMatches ){
85 // HLTInfo("Adding track %d to cluster with %d previous matches", tId, nMatches);
87 //BALLE TODO: remove hardcoded 9
88 if (nMatches > 9) { //BALLE this on tooo
89 HLTDebug("The number of matching tracks (%d) exceeds the array size of %d", nMatches, 9);
94 matchArray[nMatches] = matchArray[0];
97 matchArray[nMatches] = tId;
105 Bool_t AliHLTGlobalTrackMatcher::IsTrackCloseToDetector(AliExternalTrackParam * track, Double_t bz, Double_t fMaxX, Bool_t ySign, Double_t fMaxZ, Double_t dRadius) {
106 //See header file for documentation
108 //Get track instersection with cylinder defined by detector radius
109 Double_t trackPosition[3] = {0, 0, 0};
110 if (! (track->GetXYZAt(dRadius, bz, trackPosition)) ) {
114 //HLTInfo("Track coordinate at R = PHOS radius %f %f %f", trackPosition[0],trackPosition[1],trackPosition[2]);
117 //Positive y for EMCAL, negative for PHOS
119 if (trackPosition[1] < 0 )
122 if (trackPosition[1] > 0 )
127 if ( (TMath::Abs(trackPosition[2]) > fMaxZ) )
130 if (TMath::Abs(trackPosition[0]) > fMaxX )