]>
Commit | Line | Data |
---|---|---|
3cfb9c56 | 1 | //$Id$ |
3cfb9c56 | 2 | /************************************************************************** |
3 | * This file is property of and copyright by the ALICE HLT Project * | |
4 | * ALICE Experiment at CERN, All rights reserved. * | |
5 | * * | |
2a24cbbe | 6 | * Primary Authors: Svein Lindal (slindal@fys.uio.no) * |
3cfb9c56 | 7 | * for The ALICE HLT Project. * |
8 | * * | |
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 | **************************************************************************/ | |
17 | ||
18 | /** @file AliHLTGlobalTrackMatcher.cxx | |
bad7877b | 19 | @author Svein Lindal |
3cfb9c56 | 20 | @date |
bad7877b | 21 | @brief The HLT class Matching Calorimeter clusters to TPC tracks |
3cfb9c56 | 22 | */ |
23 | ||
3cfb9c56 | 24 | #include "AliHLTGlobalTrackMatcher.h" |
2a24cbbe | 25 | //#include "AliESDCaloCluster.h" |
26 | ||
27 | ||
3cfb9c56 | 28 | |
29 | #if __GNUC__>= 3 | |
30 | using namespace std; | |
31 | #endif | |
32 | ||
33 | ClassImp(AliHLTGlobalTrackMatcher) | |
34 | ||
434146d0 | 35 | |
3cfb9c56 | 36 | AliHLTGlobalTrackMatcher::AliHLTGlobalTrackMatcher() : |
434146d0 | 37 | fPhosMaxZ(0), |
38 | fPhosMaxX(0), | |
39 | fEmcalMaxZ(0), | |
40 | fEmcalMaxX(0), | |
434146d0 | 41 | fMatchDistance(0), |
2a24cbbe | 42 | fPhosRadius(460), |
43 | fEmcalRadius(448) | |
3cfb9c56 | 44 | { |
434146d0 | 45 | //Default constructor |
434146d0 | 46 | DoInit(); |
3cfb9c56 | 47 | } |
48 | ||
49 | //_____________________________________________________________________________ | |
50 | AliHLTGlobalTrackMatcher::~AliHLTGlobalTrackMatcher() | |
51 | { | |
52 | //Destructor | |
3cfb9c56 | 53 | |
bad7877b | 54 | } |
3cfb9c56 | 55 | |
434146d0 | 56 | void AliHLTGlobalTrackMatcher::DoInit( ) { |
2a24cbbe | 57 | //See header file for documentation |
58 | //BALLE TODO: Change hardcoded values to something that is initialised through command line or something!!! | |
3cfb9c56 | 59 | |
70cad768 | 60 | |
0903d3cd | 61 | fMatchDistance = 40*40; |
434146d0 | 62 | |
63 | fPhosMaxX = 355 + TMath::Sqrt(fMatchDistance) + 30; | |
64 | fPhosMaxZ = 64.+ TMath::Sqrt(fMatchDistance) + 30; | |
65 | ||
66 | fEmcalMaxZ = 350 + TMath::Sqrt(fMatchDistance) + 30; | |
67 | fEmcalMaxX = 3000; | |
68 | ||
434146d0 | 69 | |
70 | } | |
71 | ||
2a24cbbe | 72 | Int_t AliHLTGlobalTrackMatcher::AddTrackToCluster(Int_t tId, TArrayI* matchedTracksArray, Bool_t bestMatch, Int_t nMatches){ |
73 | //See header file for documentation | |
74 | ||
75 | matchedTracksArray->Set(matchedTracksArray->GetSize() + 1); | |
76 | if ( bestMatch ) { | |
77 | matchedTracksArray->AddAt(matchedTracksArray->At(0), matchedTracksArray->GetSize() - 1); | |
78 | matchedTracksArray->AddAt(tId, 0); | |
79 | } else { | |
80 | matchedTracksArray->AddAt(tId, matchedTracksArray->GetSize() - 1); | |
81 | } | |
434146d0 | 82 | |
2a24cbbe | 83 | return nMatches; |
84 | } | |
434146d0 | 85 | |
2a24cbbe | 86 | Int_t AliHLTGlobalTrackMatcher::AddTrackToCluster(Int_t tId, Int_t* matchArray, bool bestMatch, Int_t nMatches ){ |
434146d0 | 87 | |
74085fad | 88 | // HLTInfo("Adding track %d to cluster with %d previous matches", tId, nMatches); |
de31859c | 89 | |
2a24cbbe | 90 | //BALLE TODO: remove hardcoded 9 |
91 | if (nMatches > 9) { //BALLE this on tooo | |
ff9f0a1f | 92 | HLTDebug("The number of matching tracks (%d) exceeds the array size of %d", nMatches, 9); |
2a24cbbe | 93 | return 0; |
de31859c | 94 | } |
434146d0 | 95 | |
2a24cbbe | 96 | if(bestMatch) { |
2a24cbbe | 97 | matchArray[nMatches] = matchArray[0]; |
98 | matchArray[0] = tId; | |
99 | } else { | |
100 | matchArray[nMatches] = tId; | |
434146d0 | 101 | } |
bad7877b | 102 | |
2a24cbbe | 103 | return nMatches; |
434146d0 | 104 | |
2a24cbbe | 105 | }; |
434146d0 | 106 | |
434146d0 | 107 | |
2a24cbbe | 108 | Bool_t AliHLTGlobalTrackMatcher::IsTrackCloseToDetector(AliExternalTrackParam * track, Double_t bz, Double_t fMaxX, Bool_t ySign, Double_t fMaxZ, Double_t dRadius) { |
434146d0 | 109 | //See header file for documentation |
110 | ||
434146d0 | 111 | //Get track instersection with cylinder defined by detector radius |
70cad768 | 112 | Double_t trackPosition[3] = {0, 0, 0}; |
2a24cbbe | 113 | if (! (track->GetXYZAt(dRadius, bz, trackPosition)) ) { |
434146d0 | 114 | return kFALSE; |
2a24cbbe | 115 | } |
116 | ||
74085fad | 117 | // HLTInfo("Track coordinate at R = PHOS radius %f %f %f", trackPosition[0],trackPosition[1],trackPosition[2]); |
70cad768 | 118 | |
119 | ||
2a24cbbe | 120 | //Positive y for EMCAL, negative for PHOS |
434146d0 | 121 | if(ySign) { |
122 | if (trackPosition[1] < 0 ) | |
123 | return kFALSE; | |
124 | } else { | |
125 | if (trackPosition[1] > 0 ) | |
126 | return kFALSE; | |
127 | } | |
128 | ||
129 | ||
130 | if ( (TMath::Abs(trackPosition[2]) > fMaxZ) ) | |
131 | return kFALSE; | |
132 | ||
133 | if (TMath::Abs(trackPosition[0]) > fMaxX ) | |
134 | return kFALSE; | |
70cad768 | 135 | |
74085fad | 136 | // HLTInfo("kTRUE"); |
434146d0 | 137 | |
434146d0 | 138 | return kTRUE; |
139 | } |