/// reconstruct tracks from recpoints
///
/// Actual tracking is performed by some AliMUONVTrackReconstructor children
-/// Tracking modes (ORIGINAL, KALMAN) and associated options and parameters
-/// can be changed by using:
-/// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLow(High)FluxParam();
-/// muonRecoParam->Set...(); // see methods in AliMUONRecoParam.h for details
-/// AliMUONReconstructor::SetRecoParam(muonRecoParam);
+/// Tracking modes (ORIGINAL, KALMAN) and associated options and parameters can be changed
+/// through the AliMUONRecoParam object set in the reconstruction macro or read from the CDB
+/// (see methods in AliMUONRecoParam.h file for details)
///
/// \author Christian Finck and Laurent Aphecetche, SUBATECH Nantes
//-----------------------------------------------------------------------------
#include "AliMUONTriggerTrackStoreV1.h"
#include "AliMUONTriggerTrack.h"
#include "AliMUONLocalTrigger.h"
-#include "AliMUONVCluster.h"
#include "AliMUONVClusterServer.h"
#include "AliMUONVDigitStore.h"
#include "AliMUONVTriggerStore.h"
+#include "AliMUONTriggerUtilities.h"
#include <Riostream.h>
#include <TRandom.h>
#include <TTree.h>
//_____________________________________________________________________________
-AliMUONTracker::AliMUONTracker(AliMUONVClusterServer* clusterServer,
- const AliMUONVDigitStore& digitStore,
- const AliMUONDigitMaker* digitMaker,
+AliMUONTracker::AliMUONTracker(const AliMUONRecoParam* recoParam,
+ AliMUONVClusterServer* clusterServer,
+ AliMUONVDigitStore& digitStore,
const AliMUONGeometryTransformer* transformer,
- const AliMUONTriggerCircuit* triggerCircuit)
+ const AliMUONTriggerCircuit* triggerCircuit,
+ const AliMUONTriggerUtilities* triggerUtilities)
: AliTracker(),
- fDigitMaker(digitMaker), // not owner
- fTransformer(transformer), // not owner
- fTriggerCircuit(triggerCircuit), // not owner
- fTrackHitPatternMaker(0x0),
- fTrackReco(0x0),
- fClusterStore(0x0),
- fTriggerStore(0x0),
- fClusterServer(clusterServer),
- fIsOwnerOfClusterServer(kFALSE),
- fDigitStore(digitStore), // not owner
- fInputClusterStore(0x0),
- fTriggerTrackStore(0x0)
+fkTransformer(transformer), // not owner
+fkTriggerCircuit(triggerCircuit), // not owner
+fTrackHitPatternMaker(0x0),
+fTrackReco(0x0),
+fClusterStore(0x0),
+fTriggerStore(0x0),
+fClusterServer(clusterServer),
+fIsOwnerOfClusterServer(kFALSE),
+fkDigitStore(digitStore), // not owner
+fInputClusterStore(0x0),
+fTriggerTrackStore(0x0),
+fkRecoParam(recoParam)
{
/// constructor
- if (fTransformer && fDigitMaker)
- fTrackHitPatternMaker = new AliMUONTrackHitPattern(*fTransformer,*fDigitMaker);
+ if (fkTransformer)
+ fTrackHitPatternMaker = new AliMUONTrackHitPattern(recoParam,*fkTransformer,fkDigitStore,triggerUtilities);
if (!fClusterServer)
{
- AliInfo("No cluster server given. Will use AliMUONLegacyClusterServer");
+ AliDebug(1,"No cluster server given. Will use AliMUONLegacyClusterServer");
fIsOwnerOfClusterServer = kTRUE;
}
else
{
- TIter next(fDigitStore.CreateIterator());
- fClusterServer->UseDigits(next);
+ TIter next(fkDigitStore.CreateIterator());
+ fClusterServer->UseDigits(next,&digitStore);
SetupClusterServer(*fClusterServer);
}
fInputClusterStore = AliMUONVClusterStore::Create(*clustersTree);
if ( fInputClusterStore )
{
- AliInfo(Form("Created %s from cluster tree",fInputClusterStore->ClassName()));
+ AliDebug(1,Form("Created %s from cluster tree",fInputClusterStore->ClassName()));
fInputClusterStore->Clear();
fInputClusterStore->Connect(*clustersTree,kFALSE);
}
delete fClusterServer;
- fClusterServer = new AliMUONLegacyClusterServer(*fTransformer,fInputClusterStore,
- AliMUONReconstructor::GetRecoParam()->BypassSt4(),
- AliMUONReconstructor::GetRecoParam()->BypassSt5());
+ fClusterServer = new AliMUONLegacyClusterServer(*fkTransformer,fInputClusterStore,
+ GetRecoParam()->BypassSt4(),
+ GetRecoParam()->BypassSt5());
SetupClusterServer(*fClusterServer);
}
{
/// Performs the tracking and store the resulting tracks in the ESD
AliDebug(1,"");
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
if (!fTrackReco)
{
- fTrackReco = CreateTrackReconstructor(AliMUONReconstructor::GetRecoParam()->GetTrackingMode(),fClusterServer);
+ fTrackReco = CreateTrackReconstructor(GetRecoParam(),fClusterServer);
}
// if the required tracking mode does not exist
}
// Make trigger tracks
- if ( fTriggerCircuit )
+ if ( fkTriggerCircuit )
{
TriggerTrackStore()->Clear();
- fTrackReco->EventReconstructTrigger(*fTriggerCircuit,*fTriggerStore,*(TriggerTrackStore()));
+ fTrackReco->EventReconstructTrigger(*fkTriggerCircuit,*fTriggerStore,*(TriggerTrackStore()));
}
- if ( ( AliMUONReconstructor::GetRecoParam()->BypassSt4() ||
- AliMUONReconstructor::GetRecoParam()->BypassSt5() ) &&
- TriggerTrackStore()->GetSize() > 5 )
+ if ( TriggerTrackStore()->GetSize() > GetRecoParam()->GetMaxTriggerTracks() )
{
- // Hard cut to reject shower events
+ // cut to reject shower events
- AliCodeTimerAuto("MUON Shower events");
+ AliCodeTimerAuto("MUON Shower events",1);
AliWarning(Form("Probably got a shower event (%d trigger tracks). Will not reconstruct tracks.",
TriggerTrackStore()->GetSize()));
}
//_____________________________________________________________________________
-void AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
+void AliMUONTracker::FillESD(const AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
{
/// Fill the ESD from the trackStore
AliDebug(1,"");
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// get ITS vertex
Double_t vertex[3] = {0., 0., 0.};
const AliESDVertex* esdVert = esd->GetVertex();
- if (esdVert->GetNContributors()) {
+ if (esdVert->GetNContributors() > 0 || !strcmp(esdVert->GetTitle(),"vertexer: smearMC")) {
esdVert->GetXYZ(vertex);
AliDebug(1,Form("found vertex (%e,%e,%e)",vertex[0],vertex[1],vertex[2]));
}
AliMUONLocalTrigger* locTrg;
AliESDMuonTrack esdTrack;
TIter next(trackStore.CreateIterator());
- if (AliMUONReconstructor::GetRecoParam()->SaveFullClusterInESD() &&
- gRandom->Uniform(100.) <= AliMUONReconstructor::GetRecoParam()->GetPercentOfFullClusterInESD()) {
+ if (GetRecoParam()->SaveFullClusterInESD() &&
+ gRandom->Uniform(100.) <= GetRecoParam()->GetPercentOfFullClusterInESD()) {
while ( ( track = static_cast<AliMUONTrack*>(next()) ) ) {
if (track->GetMatchTrigger() > 0) {
locTrg = static_cast<AliMUONLocalTrigger*>(fTriggerStore->FindLocal(track->LoCircuit()));
- AliMUONESDInterface::MUONToESD(*track, esdTrack, vertex, &fDigitStore, locTrg);
- } else AliMUONESDInterface::MUONToESD(*track, esdTrack, vertex, &fDigitStore);
+ AliMUONESDInterface::MUONToESD(*track, esdTrack, vertex, &fkDigitStore, locTrg);
+ } else AliMUONESDInterface::MUONToESD(*track, esdTrack, vertex, &fkDigitStore);
esd->AddMuonTrack(&esdTrack);
}
if (matched) break;
}
if (matched) continue;
-
- AliMUONESDInterface::MUONToESD(*locTrg, esdTrack, ghostId);
+
+ AliMUONESDInterface::MUONToESD(*locTrg, esdTrack, ghostId, triggerTrack);
esd->AddMuonTrack(&esdTrack);
ghostId -= 1;
}
//_____________________________________________________________________________
-AliMUONVTrackReconstructor* AliMUONTracker::CreateTrackReconstructor(const char* trackingMode, AliMUONVClusterServer* clusterServer)
+AliMUONVTrackReconstructor* AliMUONTracker::CreateTrackReconstructor(const AliMUONRecoParam* recoParam, AliMUONVClusterServer* clusterServer)
{
/// Create track reconstructor, depending on tracking mode set in RecoParam
AliMUONVTrackReconstructor* trackReco(0x0);
- TString opt(trackingMode);
+ TString opt(recoParam->GetTrackingMode());
opt.ToUpper();
if (strstr(opt,"ORIGINAL"))
{
- trackReco = new AliMUONTrackReconstructor(clusterServer);
+ trackReco = new AliMUONTrackReconstructor(recoParam,clusterServer);
}
else if (strstr(opt,"KALMAN"))
{
- trackReco = new AliMUONTrackReconstructorK(clusterServer);
+ trackReco = new AliMUONTrackReconstructorK(recoParam,clusterServer);
}
else
{
return 0x0;
}
- AliInfoClass(Form("Will use %s for tracking",trackReco->ClassName()));
+ AliDebugClass(1,Form("Will use %s for tracking",trackReco->ClassName()));
return trackReco;
}
{
/// Setup the cluster server
- if ( AliMUONReconstructor::GetRecoParam()->BypassSt4() ||
- AliMUONReconstructor::GetRecoParam()->BypassSt5() )
+ if ( GetRecoParam()->BypassSt4() ||
+ GetRecoParam()->BypassSt5() )
{
Bool_t ok = clusterServer.UseTriggerTrackStore(TriggerTrackStore());
TString msg1;
TString msg2;
- if ( AliMUONReconstructor::GetRecoParam()->BypassSt45() )
+ if ( GetRecoParam()->BypassSt45() )
{
msg1 = "STATIONS 4 AND 5";
msg2 = "THOSE TWO STATIONS";
}
- else if ( AliMUONReconstructor::GetRecoParam()->BypassSt4() )
+ else if ( GetRecoParam()->BypassSt4() )
{
msg1 = "STATION 4";
msg2 = "THAT STATION";
}
- else if ( AliMUONReconstructor::GetRecoParam()->BypassSt5() )
+ else if ( GetRecoParam()->BypassSt5() )
{
msg1 = "STATION 5";
msg2 = "THAT STATION";