#include "AliMUONReconstructor.h"
-#include "AliCDBManager.h"
-#include "AliLog.h"
#include "AliMUONCalibrationData.h"
#include "AliMUONClusterFinderCOG.h"
#include "AliMUONClusterFinderMLEM.h"
#include "AliMUONClusterFinderSimpleFit.h"
-#include "AliMUONClusterReconstructor.h"
-#include "AliMUONClusterStoreV2.h"
#include "AliMUONConstants.h"
#include "AliMUONDigitCalibrator.h"
#include "AliMUONDigitMaker.h"
#include "AliMUONPreClusterFinder.h"
#include "AliMUONPreClusterFinderV2.h"
#include "AliMUONPreClusterFinderV3.h"
+#include "AliMUONRecoParam.h"
+#include "AliMUONSimpleClusterServer.h"
#include "AliMUONTracker.h"
-#include "AliMUONVTrackStore.h"
#include "AliMUONTriggerChamberEff.h"
#include "AliMUONTriggerCircuit.h"
#include "AliMUONTriggerCrateStore.h"
#include "AliMUONTriggerStoreV1.h"
#include "AliMUONVClusterFinder.h"
-#include "AliMUONRecoParam.h"
+#include "AliMUONVClusterServer.h"
+#include "AliMUONVTrackStore.h"
+
+#include "AliMpArea.h"
#include "AliMpCDB.h"
+#include "AliMpConstants.h"
+
#include "AliRawReader.h"
+#include "AliCDBManager.h"
#include "AliCodeTimer.h"
+#include "AliLog.h"
+
#include <Riostream.h>
#include <TClonesArray.h>
#include <TString.h>
fTriggerCircuit(0x0),
fCalibrationData(0x0),
fDigitCalibrator(0x0),
-fClusterReconstructor(0x0),
-fClusterStore(0x0),
+fClusterServer(0x0),
fTriggerStore(0x0),
fTrackStore(0x0),
fTrigChamberEff(0x0)
delete fTriggerCircuit;
delete fCalibrationData;
delete fDigitCalibrator;
- delete fClusterReconstructor;
- delete fClusterStore;
+ delete fClusterServer;
delete fTriggerStore;
delete fTrackStore;
delete fTrigChamberEff;
fDigitCalibrator->Calibrate(digitStore);
}
-//_____________________________________________________________________________
-void
-AliMUONReconstructor::Clusterize(const AliMUONVDigitStore& digitStore,
- AliMUONVClusterStore& clusterStore) const
-{
- /// Creates clusters from digits.
-
- TString sopt(fgRecoParam->GetClusteringMode());
- sopt.ToUpper();
- if ( sopt.Contains("NOCLUSTERING") ) return;
-
- if (!fClusterReconstructor) CreateClusterReconstructor();
-
- // if the required clustering mode does not exist
- if (!fClusterReconstructor) return;
-
- AliCodeTimerAuto(Form("%s::Digits2Clusters(const AliMUONVDigitStore&,AliMUONVClusterStore&)",
- fClusterReconstructor->ClassName()))
- fClusterReconstructor->Digits2Clusters(digitStore,clusterStore);
-}
-
-//_____________________________________________________________________________
-AliMUONVClusterStore*
-AliMUONReconstructor::ClusterStore() const
-{
- /// Return (and create if necessary) the cluster container
- if (!fClusterStore)
- {
- fClusterStore = new AliMUONClusterStoreV2;
- }
- return fClusterStore;
-}
-
//_____________________________________________________________________________
void
AliMUONReconstructor::ConvertDigits(AliRawReader* rawReader,
CreateTriggerCircuit();
CreateDigitMaker();
CreateTriggerChamberEff();
+ CreateClusterServer();
+
+ if (!fClusterServer)
+ {
+ AliError("ClusterServer is NULL ! Cannot create tracker");
+ return 0x0;
+ }
- AliMUONTracker* tracker = new AliMUONTracker(fDigitMaker,fTransformer,fTriggerCircuit,fTrigChamberEff);
+ fClusterServer->UseDigitStore(*(DigitStore()));
+
+ AliMUONTracker* tracker = new AliMUONTracker(*fClusterServer,
+ fDigitMaker,
+ fTransformer,
+ fTriggerCircuit,
+ fTrigChamberEff);
return tracker;
}
//_____________________________________________________________________________
-void
-AliMUONReconstructor::CreateClusterReconstructor() const
+AliMUONVClusterFinder*
+AliMUONReconstructor::CreateClusterFinder(const char* clusterFinderType) const
{
- /// Create cluster reconstructor, depending on clustering mode set in RecoParam
+ /// Create a given cluster finder instance
AliCodeTimerAuto("")
- AliDebug(1,"");
-
AliMUONVClusterFinder* clusterFinder(0x0);
- TString opt(fgRecoParam->GetClusteringMode());
+ TString opt(clusterFinderType);
opt.ToUpper();
if ( strstr(opt,"PRECLUSTERV2") )
else
{
AliError(Form("clustering mode \"%s\" does not exist",opt.Data()));
- return;
+ return 0x0;
}
+ return clusterFinder;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::CreateClusterServer() const
+{
+ /// Create cluster server
+
+ if ( fClusterServer ) return;
+
+ AliCodeTimerAuto("")
+
+ AliDebug(1,"");
+
+ AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(fgRecoParam->GetClusteringMode());
+
+ if ( !clusterFinder ) return;
+
AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName()));
- fClusterReconstructor = new AliMUONClusterReconstructor(clusterFinder,fTransformer);
+ fClusterServer = new AliMUONSimpleClusterServer(*clusterFinder,*fTransformer);
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore,
- AliMUONVClusterStore* clusterStore,
TTree& clustersTree) const
{
/// Write the trigger and cluster information into TreeR
Bool_t ok(kFALSE);
if ( triggerStore )
{
- Bool_t alone = ( clusterStore ? kFALSE : kTRUE );
- ok = triggerStore->Connect(clustersTree,alone);
+ ok = triggerStore->Connect(clustersTree,kTRUE);
if (!ok)
{
AliError("Could not create triggerStore branches in TreeR");
}
}
- if ( clusterStore )
- {
- Bool_t alone = ( triggerStore ? kFALSE : kTRUE );
- ok = clusterStore->Connect(clustersTree,alone);
- if (!ok)
- {
- AliError("Could not create triggerStore branches in TreeR");
- }
- }
-
if (ok) // at least one type of branches created successfully
{
clustersTree.Fill();
}
ConvertDigits(rawReader,DigitStore(),TriggerStore());
- Clusterize(*(DigitStore()),*(ClusterStore()));
-
- FillTreeR(TriggerStore(),ClusterStore(),*clustersTree);
+
+ FillTreeR(TriggerStore(),*clustersTree);
}
//_____________________________________________________________________________
{
Calibrate(*fDigitStore);
}
- Clusterize(*fDigitStore,*(ClusterStore()));
}
- FillTreeR(fTriggerStore,ClusterStore(),*clustersTree);
+ FillTreeR(fTriggerStore,*clustersTree);
}
//_____________________________________________________________________________
class AliMUONDigitCalibrator;
class AliMUONCalibrationData;
-class AliMUONClusterReconstructor;
-class AliMUONVClusterStore;
-
class AliMUONTracker;
class AliMUONVTrackStore;
class AliMUONRecoParam;
+class AliMUONVClusterFinder;
+
+class AliMUONVClusterServer;
+
class AliMUONReconstructor : public AliReconstructor
{
public:
AliMUONVDigitStore* digitStore,
AliMUONVTriggerStore* triggerStore) const;
void Calibrate(AliMUONVDigitStore& digitStore) const;
- void Clusterize(const AliMUONVDigitStore& digitStore, AliMUONVClusterStore& clusterStore) const;
AliMUONTriggerCrateStore* CrateManager() const;
void CreateCalibrator() const;
+ AliMUONVClusterFinder* CreateClusterFinder(const char* clusterFinderType) const;
void CreateDigitMaker() const;
void CreateTriggerCircuit() const;
- void CreateClusterReconstructor() const;
+ void CreateClusterServer() const;
void CreateTriggerChamberEff() const;
void FillTreeR(AliMUONVTriggerStore* triggerStore,
- AliMUONVClusterStore* clusterStore,
TTree& clustersTree) const;
AliMUONVDigitStore* DigitStore() const;
- AliMUONVClusterStore* ClusterStore() const;
AliMUONVTriggerStore* TriggerStore() const;
private:
mutable AliMUONTriggerCircuit* fTriggerCircuit; //!< Trigger Circuit
mutable AliMUONCalibrationData* fCalibrationData; //!< Calibration data
mutable AliMUONDigitCalibrator* fDigitCalibrator; //!< Digit to calibrate digit converter
- mutable AliMUONClusterReconstructor* fClusterReconstructor; //!< Clusterizer
- mutable AliMUONVClusterStore* fClusterStore; //!< Cluster container
+ mutable AliMUONVClusterServer* fClusterServer; //!< Clusterizer
mutable AliMUONVTriggerStore* fTriggerStore; //!< Trigger container
mutable AliMUONVTrackStore* fTrackStore; //!< Track container
mutable AliMUONTriggerChamberEff* fTrigChamberEff; //!< pointer to trigger chamber efficiency class
static AliMUONRecoParam* fgRecoParam; //!< parameters used to tune the MUON reconstruction
- ClassDef(AliMUONReconstructor,3) // Implementation of AliReconstructor
+ ClassDef(AliMUONReconstructor,4) // Implementation of AliReconstructor
};
#endif