#include "AliMUONVDigit.h"
#include "AliMUONVDigitStore.h"
#include "AliMUONLocalTrigger.h"
+#include "AliMUONTriggerTrack.h"
#include "AliMUONVTriggerStore.h"
#include "AliMUON2DMapIterator.h"
#include "AliMUONTrackParam.h"
#include "AliMpExMapIterator.h"
#include "AliMpVSegmentation.h"
#include "AliMpSegmentation.h"
-#include "AliMpIntPair.h"
#include "AliMpPad.h"
#include "AliESDEvent.h"
/// 2) loading a whole ESDEvent and using the finders and/or the iterators
/// to access the corresponding MUON objects
///
+/// note: You can set the recoParam used to refit the MUON track with ResetTracker(...);
+/// By default we use Kalman filter + Smoother
+///
/// \author Philippe Pillot
//-----------------------------------------------------------------------------
ClassImp(AliMUONESDInterface)
/// \endcond
+AliMUONRecoParam* AliMUONESDInterface::fgRecoParam = 0x0;
AliMUONVTrackReconstructor* AliMUONESDInterface::fgTracker = 0x0;
TString AliMUONESDInterface::fgTrackStoreName = "AliMUONTrackStoreV1";
TString AliMUONESDInterface::fgTriggerStoreName = "AliMUONTriggerStoreV1";
//_____________________________________________________________________________
-AliMUONESDInterface::AliMUONESDInterface(AliMUONRecoParam* recoParam)
+AliMUONESDInterface::AliMUONESDInterface()
: TObject(),
-fRecoParam(recoParam),
fTracks(0x0),
fDigits(0x0),
fTriggers(0x0),
if (!esdTrack->ContainTrackerData()) continue;
// add it to track store
- AliMUONTrack* track = Add(GetRecoParam(),*esdTrack, *fTracks);
+ AliMUONTrack* track = Add(*esdTrack, *fTracks);
// prepare cluster map
AliMpExMap* cMap = new AliMpExMap;
// static methods //
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
+//_____________________________________________________________________________
+void AliMUONESDInterface::ResetTracker(const AliMUONRecoParam* recoParam)
+{
+ /// Reset the MUON tracker using "recoParam" if provided.
+ /// If not provided, will use Kalman filter + Smoother
+
+ delete fgTracker;
+ delete fgRecoParam;
+
+ if (recoParam) {
+
+ fgRecoParam = new AliMUONRecoParam(*recoParam);
+
+ } else {
+
+ fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
+ fgRecoParam->SetTrackingMode("KALMAN");
+ fgRecoParam->UseSmoother(kTRUE);
+ fgRecoParam->SetBendingVertexDispersion(10.);
+
+ }
+
+ fgTracker = AliMUONTracker::CreateTrackReconstructor(fgRecoParam,0x0);
+
+}
+
//_____________________________________________________________________________
AliMUONVTrackStore* AliMUONESDInterface::NewTrackStore()
{
}
//_____________________________________________________________________________
-void AliMUONESDInterface::ESDToMUON(const AliMUONRecoParam* recoParam, const AliESDMuonTrack& esdTrack, AliMUONTrack& track)
+void AliMUONESDInterface::ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONTrack& track)
{
- /// Transfert data from ESDMuon track to MUON track
+ /// Transfert data from ESDMuon track to MUON track.
+ /// The track parameters at each cluster are obtained by refitting the track
+ /// or by extrapolating the parameters at the first one if the refit failed.
+ /// note: You can set the recoParam used to refit the MUON track with ResetTracker(...);
+ /// By default we use Kalman filter + Smoother
// if the ESDMuon track is a ghost then return an empty MUON track
if (!esdTrack.ContainTrackerData()) {
track.SetMatchTrigger(esdTrack.GetMatchTrigger());
track.SetLoTrgNum(-1);
track.SetChi2MatchTrigger(esdTrack.GetChi2MatchTrigger());
- track.SetTrackID(0);
track.SetHitsPatternInTrigCh(esdTrack.GetHitsPatternInTrigCh());
track.SetLocalTrigger(esdTrack.LoCircuit(), esdTrack.LoStripX(), esdTrack.LoStripY(),
esdTrack.LoDev(), esdTrack.LoLpt(), esdTrack.LoHpt());
AliMUONTrackExtrap::ExtrapToZCov(firstTrackParam,firstTrackParam->GetClusterPtr()->GetZ());
// refit the track to get better parameters and covariances at each cluster (temporary disable track improvement)
- if (!fgTracker) fgTracker = AliMUONTracker::CreateTrackReconstructor(recoParam,0x0);
+ if (!fgTracker) ResetTracker();
if (!fgTracker->RefitTrack(track, kFALSE)) track.UpdateCovTrackParamAtCluster();
} else {
- // get number of the first hit chamber (according to the MUONClusterMap if not empty)
+ // get number of the first hit chamber according to the MUONClusterMap
Int_t firstCh = 0;
- if (esdTrack.GetMuonClusterMap() != 0) while (!esdTrack.IsInMuonClusterMap(firstCh)) firstCh++;
- else firstCh = AliMUONConstants::ChamberNumber(param.GetZ());
+ while (firstCh < 10 && !esdTrack.IsInMuonClusterMap(firstCh)) firstCh++;
// produce fake cluster at this chamber
cluster->SetUniqueID(AliMUONVCluster::BuildUniqueID(firstCh, 0, 0));
}
+ // set the MC label from ESD track
+ track.SetMCLabel(esdTrack.GetLabel());
+
delete cluster;
delete cStore;
locTrg.SetLoCircuit(esdTrack.LoCircuit());
locTrg.SetLoStripX(esdTrack.LoStripX());
locTrg.SetLoStripY(esdTrack.LoStripY());
- locTrg.SetLoDev(esdTrack.LoDev());
+ locTrg.SetDeviation(esdTrack.LoDev());
locTrg.SetLoLpt(esdTrack.LoLpt());
locTrg.SetLoHpt(esdTrack.LoHpt());
- locTrg.SetLoSdev(1);
locTrg.SetLoTrigY(1);
locTrg.SetX1Pattern(esdTrack.GetTriggerX1Pattern());
locTrg.SetX2Pattern(esdTrack.GetTriggerX2Pattern());
cluster.SetErrXY(esdCluster.GetErrX(),esdCluster.GetErrY());
cluster.SetCharge(esdCluster.GetCharge());
cluster.SetChi2(esdCluster.GetChi2());
+ cluster.SetMCLabel(esdCluster.GetLabel());
if (esdCluster.PadsStored()) {
Int_t nPads = esdCluster.GetNPads();
/// Transfert data from ESDMuon pad to MUON digit
const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(esdPad.GetDetElemId(), esdPad.GetManuId());
- AliMpPad pad = seg->PadByLocation(AliMpIntPair(esdPad.GetManuId(), esdPad.GetManuChannel()), kFALSE);
+ AliMpPad pad = seg->PadByLocation(esdPad.GetManuId(), esdPad.GetManuChannel(), kFALSE);
digit.Saturated(esdPad.IsSaturated());
digit.Used(kFALSE);
digit.SetUniqueID(esdPad.GetUniqueID());
digit.SetCharge(esdPad.GetCharge());
digit.SetADC(esdPad.GetADC());
- digit.SetPadXY(pad.GetIndices().GetFirst(), pad.GetIndices().GetSecond());
+ digit.SetPadXY(pad.GetIx(), pad.GetIy());
}
esdTrack.SetUniqueID(track.GetUniqueID());
esdTrack.SetChi2(track.GetGlobalChi2());
esdTrack.SetNHit(track.GetNClusters());
+ esdTrack.SetLabel(track.GetMCLabel());
// set param at first cluster
AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>((track.GetTrackParamAtCluster())->First());
}
//_____________________________________________________________________________
-void AliMUONESDInterface::MUONToESD(const AliMUONLocalTrigger& locTrg, AliESDMuonTrack& esdTrack, UInt_t trackId)
+void AliMUONESDInterface::MUONToESD(const AliMUONLocalTrigger& locTrg, AliESDMuonTrack& esdTrack,
+ UInt_t trackId, const AliMUONTriggerTrack* triggerTrack)
{
/// Build ghost ESDMuon track containing only informations about trigger track
muonTrack.SetLocalTrigger(locTrg.LoCircuit(),
locTrg.LoStripX(),
locTrg.LoStripY(),
- locTrg.LoDev(),
+ locTrg.GetDeviation(),
locTrg.LoLpt(),
locTrg.LoHpt());
esdTrack.SetLocalTrigger(muonTrack.GetLocalTrigger());
esdTrack.SetChi2MatchTrigger(0.);
- esdTrack.SetHitsPatternInTrigCh(0);
esdTrack.SetTriggerX1Pattern(locTrg.GetX1Pattern());
esdTrack.SetTriggerY1Pattern(locTrg.GetY1Pattern());
esdTrack.SetTriggerX2Pattern(locTrg.GetX2Pattern());
esdTrack.SetTriggerY3Pattern(locTrg.GetY3Pattern());
esdTrack.SetTriggerX4Pattern(locTrg.GetX4Pattern());
esdTrack.SetTriggerY4Pattern(locTrg.GetY4Pattern());
-
+ UShort_t hitPattern = 0;
+ if(triggerTrack){
+ hitPattern = triggerTrack->GetHitsPatternInTrigCh();
+ esdTrack.SetHitsPatternInTrigCh(hitPattern);
+ esdTrack.SetThetaXUncorrected(triggerTrack->GetThetax());
+ esdTrack.SetThetaYUncorrected(triggerTrack->GetThetay());
+ esdTrack.SetNonBendingCoorUncorrected(triggerTrack->GetX11());
+ esdTrack.SetBendingCoorUncorrected(triggerTrack->GetY11());
+ }
}
//_____________________________________________________________________________
esdCluster.SetErrXY(cluster.GetErrX(), cluster.GetErrY());
esdCluster.SetCharge(cluster.GetCharge());
esdCluster.SetChi2(cluster.GetChi2());
+ esdCluster.SetLabel(cluster.GetMCLabel());
if (digits) { // transfert all data if required
}
//___________________________________________________________________________
-AliMUONTrack*
-AliMUONESDInterface::Add(const AliMUONRecoParam* recoParam, const AliESDMuonTrack& esdTrack, AliMUONVTrackStore& trackStore)
+AliMUONTrack* AliMUONESDInterface::Add(const AliESDMuonTrack& esdTrack, AliMUONVTrackStore& trackStore)
{
/// Create MUON track from ESDMuon track and add it to the store
/// return a pointer to the track into the store (0x0 if the track already exist)
if(trackStore.FindObject(esdTrack.GetUniqueID())) return 0x0;
AliMUONTrack* track = trackStore.Add(AliMUONTrack());
- ESDToMUON(recoParam,esdTrack, *track);
+ ESDToMUON(esdTrack, *track);
return track;
}