AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTriggerTrackToTrackerClusters.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 
16 // $Id$
17 
19 
28 
29 #include "AliCodeTimer.h"
30 #include "AliLog.h"
31 #include "AliMUONConstants.h"
33 #include "AliMUONTrack.h"
34 #include "AliMUONTrackExtrap.h"
35 #include "AliMUONTriggerTrack.h"
36 #include "AliMUONVCluster.h"
37 #include "AliMUONVClusterStore.h"
39 #include "AliMUONTrackParam.h"
40 #include "AliMpArea.h"
41 #include "AliMpDEManager.h"
42 #include <TMath.h>
43 
47 
48 //_____________________________________________________________________________
50  AliMUONVTriggerTrackStore* trackStore)
51 : TObject(), fkTransformer(transformer), fTriggerTrackStore(trackStore)
52 {
54 }
55 
56 //_____________________________________________________________________________
58 {
60 }
61 
62 //_____________________________________________________________________________
63 Int_t
64 AliMUONTriggerTrackToTrackerClusters::DetElemId(Int_t chamber, Double_t x, Double_t y,
65  Double_t ex, Double_t ey,
66  Double_t& z) const
67 {
69 
70  AliMpDEIterator it;
71 
72  AliMpArea a(x, y, ex, ey);
73 
74  it.First(chamber);
75 
76  while ( !it.IsDone() )
77  {
78  Int_t detElemId = it.CurrentDEId();
79 
80  AliMpArea* area = fkTransformer.GetDEArea(detElemId);
81 
82  if ( area->Overlap(a) )
83  {
84  // get z of the center of that DE.
85  Double_t dummyx, dummyy;
86  fkTransformer.Local2Global(detElemId,0,0,0,dummyx,dummyy,z);
87  return detElemId;
88  }
89  it.Next();
90  }
91 
92  return -1;
93 }
94 
95 //_____________________________________________________________________________
96 Int_t
98  AliMUONVClusterStore& clusterStore) const
99 {
102 
103  AliCodeTimerAuto(Form("Chamber %d",iChamber),0);
104 
105  TIter next(fTriggerTrackStore->CreateIterator());
106 
108  Int_t nadded(0);
109 
110  while ( ( track = static_cast<AliMUONTriggerTrack*>(next()) ) )
111  {
112  nadded += GenerateClusters(iChamber,*track,clusterStore);
113  }
114  return nadded;
115 }
116 
117 //_____________________________________________________________________________
118 Int_t
120  const AliMUONTriggerTrack& track,
121  AliMUONVClusterStore& clusterStore) const
122 {
124 
126 
127  Int_t nadded(0);
128 
129  Double_t z = AliMUONConstants::DefaultChamberZ(10);
130 
131  Double_t bendingCoord = track.GetY11();
132  Double_t bendingSlope = TMath::Tan(track.GetThetay());
133 
134  Double_t bendingImpact = bendingCoord - z * bendingSlope;
135 
136  AliDebug(1,Form("TriggerTrack impact parameter=%e",bendingImpact));
137 
138  // StdoutToAliDebug(1,track.Print());
139 
140  Double_t inverseBendingMomentum = 1. / AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(bendingImpact);
141 
142  // Construct an AliMUONTrackParam from the trigger track, in order to be able to extrapolate it
143  // to chambers 6..9 planes.
144 
145  AliMUONTrackParam trackParam;
146 
147  trackParam.SetZ(z);
148  trackParam.SetNonBendingCoor(track.GetX11());
149  trackParam.SetNonBendingSlope(TMath::Tan(track.GetThetax()));
150  trackParam.SetBendingCoor(bendingCoord);
151  trackParam.SetBendingSlope(bendingSlope);
152  trackParam.SetInverseBendingMomentum(inverseBendingMomentum);
153 
155 
156  Double_t sigmaX = AliMUONConstants::TriggerNonBendingReso();
157 
158  Double_t sigmaY = AliMUONConstants::TriggerBendingReso();
159 
160  // Compute and set track parameters covariances
161  TMatrixD paramCov(5,5);
162  paramCov.Zero();
163 
164  // Non bending plane
165  paramCov(0,0) = sigmaX*sigmaX;
166  paramCov(0,1) = paramCov(0,0)/dZ;
167  paramCov(1,0) = paramCov(0,1);
168  paramCov(1,1) = 2.0*paramCov(0,0)/dZ/dZ;
169 
170  // Bending plane
171  paramCov(2,2) = sigmaY*sigmaY;
172  paramCov(2,3) = paramCov(2,2)/dZ;
173  paramCov(3,2) = paramCov(2,3);
174  paramCov(3,3) = 2.0*paramCov(2,2)/dZ/dZ;
175 
176  // Inverse bending momentum (50% error)
177  paramCov(4,4) = 0.5*inverseBendingMomentum * 0.5*inverseBendingMomentum;
178 
179  // Set covariances
180  trackParam.SetCovariances(paramCov);
181 
182  // add MCS effect in the iron wall
183  const Float_t kFilterThickness = AliMUONConstants::MuonFilterZEnd()-AliMUONConstants::MuonFilterZBeg(); // cm
184  AliMUONTrackExtrap::ExtrapToZCov(&trackParam, AliMUONConstants::MuonFilterZEnd()); // Extrap to iChamber
185  AliMUONTrackExtrap::AddMCSEffect(&trackParam, kFilterThickness, AliMUONConstants::MuonFilterX0()); // Add MCS effects
186 
187  // Now we extrapolate this trackParam to chambers 6 -> 9
188  Int_t nclusters = clusterStore.GetSize();
189 
190  AliMUONTrackParam tp(trackParam);
191 
192  Double_t zg = AliMUONConstants::DefaultChamberZ(iChamber);
193  AliMUONTrackExtrap::ExtrapToZCov(&tp, zg); // Extrap to iChamber
194 
195 
196  AliDebug(1,Form("iChamber=%d",iChamber));
197 
198  StdoutToAliDebug(1,tp.Print("FULLCOV"););
199 
200  Double_t x = tp.GetNonBendingCoor();
201  Double_t y = tp.GetBendingCoor();
202  const TMatrixD& cov = tp.GetCovariances();
203  Double_t ex = TMath::Sqrt(cov(0,0));
204  Double_t ey = TMath::Sqrt(cov(2,2));
205 
206  Double_t zde;
207 
208  Int_t detElemId = DetElemId(iChamber,x,y,ex,ey,zde);
209 
210  AliDebug(1,Form("zg = %e zde = %e",zg,zde));
211 
212  if ( AliMpDEManager::IsValidDetElemId(detElemId) )
213  {
214  AliMUONVCluster* rawCluster = clusterStore.Add(AliMpDEManager::GetChamberId(detElemId), detElemId, nclusters);
215 
216  ++nclusters;
217  ++nadded;
218 
219  rawCluster->SetCharge(100.0);
220  rawCluster->SetXYZ(x, y, zg);
221  rawCluster->SetErrXY(ex,ey);
222  }
223  else
224  {
225  AliWarning(Form("No DE found at xg=%e yg=%e",x,y));
226  }
227 
228  return nadded;
229 }
The iterator over detection elements.
virtual TIterator * CreateIterator() const =0
Iterator to loop over tracks.
Int_t GenerateClusters(Int_t iChamber, AliMUONVClusterStore &clusterStore) const
AliMpArea * GetDEArea(Int_t detElemId) const
Double_t GetBendingCoor() const
return bending coordinate (cm)
Top container class for geometry transformations.
void dZ()
Definition: CalibAlign.C:517
Bool_t IsDone() const
virtual Int_t GetSize() const =0
The number of objects stored.
A rectangle area positioned in plane..
Definition: AliMpArea.h:20
Track parameters in ALICE dimuon spectrometer.
Int_t CurrentDEId() const
static Double_t TriggerBendingReso()
Return default trigger chamber resolution DUE TO ALIGNMENT ONLY in bending direction.
AliTPCfastTrack * track
void SetNonBendingCoor(Double_t nonBendingCoor)
set non bending coordinate (cm)
Reconstructed trigger track in ALICE dimuon spectrometer.
virtual void SetErrXY(Double_t errX, Double_t errY)=0
Set resolution (cm) on coordinates (X,Y)
AliMUONVTriggerTrackStore * fTriggerTrackStore
not owner
Float_t GetX11() const
Return x position of fired Y strip in MC11.
Float_t GetThetay() const
Return track theta angle in Y.
static Double_t MuonFilterX0()
Return radiation length (in cm) of muon filter.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual Bool_t Add(TObject *object)
Add an object to the store.
virtual void SetXYZ(Double_t x, Double_t y, Double_t z)=0
Set coordinates (cm)
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
void Local2Global(Int_t detElemId, Float_t xl, Float_t yl, Float_t zl, Float_t &xg, Float_t &yg, Float_t &zg) const
void SetBendingSlope(Double_t bendingSlope)
set bending slope (cm ** -1)
abstract base class for clusters
static Bool_t ExtrapToZCov(AliMUONTrackParam *trackParam, Double_t zEnd, Bool_t updatePropagator=kFALSE)
static Double_t MuonFilterZEnd()
Return z-position of muon filter end.
static Double_t MuonFilterZBeg()
Return z-position of muon filter begining.
static void AddMCSEffect(AliMUONTrackParam *param, Double_t dZ, Double_t x0)
Float_t GetY11() const
Return y position of fired X strip in MC11.
Interface of a cluster container.
Float_t GetThetax() const
Return track theta angle in X.
void SetNonBendingSlope(Double_t nonBendingSlope)
set non bending slope (cm ** -1)
Base class of a trigger track store.
Int_t DetElemId(Int_t chamber, Double_t x, Double_t y, Double_t ex, Double_t ey, Double_t &z) const
virtual void Print(Option_t *opt="") const
void SetInverseBendingMomentum(Double_t inverseBendingMomentum)
set inverse bending momentum (GeV/c ** -1) times the charge (assumed forward motion) ...
Convertor of trigger track to tracker clusters.
virtual void SetCharge(Double_t charge)=0
Set the cluster charge.
void SetBendingCoor(Double_t bendingCoor)
set bending coordinate (cm)
static Float_t * DefaultChamberZ()
Return pointer to array of positions.
Double_t GetNonBendingCoor() const
return non bending coordinate (cm)
Bool_t Overlap(const AliMpArea &area) const
Definition: AliMpArea.cxx:231
static Double_t TriggerNonBendingReso()
Return default trigger chamber resolution DUE TO ALIGNMENT ONLY in non bending direction.
const AliMUONGeometryTransformer & fkTransformer
to go from local to global
void SetCovariances(const TMatrixD &covariances)
void SetZ(Double_t z)
set Z coordinate (cm)
static Bool_t IsValidDetElemId(Int_t detElemId, Bool_t warn=false)
const TMatrixD & GetCovariances() const
static Double_t GetBendingMomentumFromImpactParam(Double_t impactParam)