**************************************************************************/
/* $Id$ */
+//-----------------------------------------------------------------------------
/// \class AliMUONReconstructor
///
/// Implementation of AliReconstructor for MUON subsystem.
///
/// SIMPLEFIT : use the AliMUONClusterFinderSimpleFit clusterizer
///
-/// AZ : use the AliMUONClusterFinderAZ clusterizer (default)
-///
-/// MLEM : another implementation of AZ, where preclustering is external
+/// MLEM : another implementation of AZ, where preclustering is external (default)
/// MLEMV3 : MLEM with preclustering=PRECLUSTERV2
/// MLEMV3 : MLEM with preclustering=PRECLUSTERV3
///
///
/// NOCLUSTERING : bypass completely the clustering stage
///
-/// NOSTATUSMAP : disable the computation and usage of the pad status map. Only
-/// for debug !
-///
/// NOLOCALRECONSTRUCTION : for debug, to disable local reconstruction (and hence
/// "recover" old behavior)
///
/// DIGITSTOREV2R : use the V2R implementation of the digitstore
///
/// \author Laurent Aphecetche, Subatech
+//-----------------------------------------------------------------------------
#include "AliMUONReconstructor.h"
#include "AliCDBManager.h"
-#include "AliLoader.h"
#include "AliLog.h"
-#include "AliRunLoader.h"
#include "AliMUONCalibrationData.h"
#include "AliMUONClusterFinderCOG.h"
#include "AliMUONClusterFinderMLEM.h"
#include "AliMUONClusterFinderSimpleFit.h"
-#include "AliMUONClusterFinderAZ.h"
#include "AliMUONClusterReconstructor.h"
-#include "AliMUONClusterStoreV1.h"
+#include "AliMUONClusterStoreV2.h"
#include "AliMUONConstants.h"
#include "AliMUONDigitCalibrator.h"
#include "AliMUONDigitMaker.h"
#include "AliMUONTriggerCrateStore.h"
#include "AliMUONTriggerStoreV1.h"
#include "AliMUONVClusterFinder.h"
+#include "AliMUONRecoParam.h"
#include "AliMpCDB.h"
#include "AliRawReader.h"
#include "AliCodeTimer.h"
#include <TClonesArray.h>
#include <TString.h>
#include <TTree.h>
-//#include "AliCodeTimer.h"
+
/// \cond CLASSIMP
ClassImp(AliMUONReconstructor)
/// \endcond
+AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters
+
//_____________________________________________________________________________
AliMUONReconstructor::AliMUONReconstructor() :
AliReconstructor(),
{
/// normal ctor
- // Load geometry data
- fTransformer->LoadGeometryData();
-
// Load mapping
- if ( ! AliMpCDB::LoadMpSegmentation() )
- {
+ if ( ! AliMpCDB::LoadDDLStore() ) {
AliFatal("Could not access mapping from OCDB !");
}
- // Load DDL store
- if ( ! AliMpCDB::LoadDDLStore() )
- {
- AliFatal("Could not access DDL Store from OCDB !");
- }
+ // Load geometry data
+ fTransformer->LoadGeometryData();
+ // initialize reconstruction parameters in not already done
+ if (!fgRecoParam) {
+ AliWarning("Reconstruction parameters not initialized - Use default one");
+ fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
+ }
}
delete fTrigChamberEff;
}
+//_____________________________________________________________________________
+void AliMUONReconstructor::SetRecoParam(AliMUONRecoParam *param)
+{
+ /// set reconstruction parameters
+
+ // remove existing parameters
+ if (fgRecoParam) {
+ cout<<"AliMUONReconstructor::SetRecoParam: Reconstruction parameters already initialized - overwrite them"<<endl;
+ delete fgRecoParam;
+ }
+
+ fgRecoParam = param;
+}
+
//_____________________________________________________________________________
void
AliMUONReconstructor::Calibrate(AliMUONVDigitStore& digitStore) const
{
/// Creates clusters from digits.
- TString sopt(GetOption());
+ TString sopt(fgRecoParam->GetClusteringMode());
sopt.ToUpper();
if ( sopt.Contains("NOCLUSTERING") ) return;
- if (!fClusterReconstructor)
- {
- CreateClusterReconstructor();
- }
+ if (!fClusterReconstructor) CreateClusterReconstructor();
+
+ // if the required clustering mode does not exist
+ if (!fClusterReconstructor) return;
AliCodeTimerAuto(Form("%s::Digits2Clusters(const AliMUONVDigitStore&,AliMUONVClusterStore&)",
fClusterReconstructor->ClassName()))
/// Return (and create if necessary) the cluster container
if (!fClusterStore)
{
- fClusterStore = new AliMUONClusterStoreV1;
+ fClusterStore = new AliMUONClusterStoreV2;
}
return fClusterStore;
}
AliMUONReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
{
/// convert raw data into a digit tree
+ AliCodeTimerAuto("")
Bool_t alone = ( TriggerStore() == 0 );
else
{
ConvertDigits(rawReader,DigitStore(),TriggerStore());
+ AliCodeTimerStart("Fill digits")
digitsTree->Fill();
+ AliCodeTimerStop("Fill digits")
DigitStore()->Clear();
}
}
//_____________________________________________________________________________
AliTracker*
-AliMUONReconstructor::CreateTracker(AliRunLoader* runLoader) const
+AliMUONReconstructor::CreateTracker() const
{
/// Create the MUONTracker object
- /// The MUONTracker is passed the GetOption(), i.e. our own options
CreateTriggerCircuit();
CreateDigitMaker();
CreateTriggerChamberEff();
- AliLoader* loader = runLoader->GetDetectorLoader("MUON");
- if (!loader)
- {
- AliError("Cannot get MUONLoader, so cannot create MUONTracker");
- return 0x0;
- }
- AliMUONTracker* tracker = new AliMUONTracker(loader,fDigitMaker,fTransformer,fTriggerCircuit,fTrigChamberEff);
- tracker->SetOption(GetOption());
+ AliMUONTracker* tracker = new AliMUONTracker(fDigitMaker,fTransformer,fTriggerCircuit,fTrigChamberEff);
return tracker;
}
void
AliMUONReconstructor::CreateClusterReconstructor() const
{
- /// Create cluster reconstructor, depending on GetOption()
+ /// Create cluster reconstructor, depending on clustering mode set in RecoParam
AliCodeTimerAuto("")
AliMUONVClusterFinder* clusterFinder(0x0);
- TString opt(GetOption());
+ TString opt(fgRecoParam->GetClusteringMode());
opt.ToUpper();
if ( strstr(opt,"PRECLUSTERV2") )
{
clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinder);
}
- else if ( strstr(opt,"AZ") )
- {
- clusterFinder = new AliMUONClusterFinderAZ;
- }
else
{
- // default is currently AZ
- clusterFinder = new AliMUONClusterFinderAZ;
+ AliError(Form("clustering mode \"%s\" does not exist",opt.Data()));
+ return;
}
- if ( clusterFinder )
- {
- AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName()));
- }
+ AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName()));
fClusterReconstructor = new AliMUONClusterReconstructor(clusterFinder,fTransformer);
}
if ( strstr(opt,"NOSTATUSMAP") )
{
- AliWarning("Disconnecting status map : SHOULD BE USED FOR DEBUG ONLY. NOT FOR PRODUCTION !!!");
- statusMap = kFALSE;
+ AliWarning("NOSTATUSMAP is obsolete");
}
- fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,statusMap);
+
+ fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData);
}
//_____________________________________________________________________________
}
}
-//_____________________________________________________________________________
-Bool_t
-AliMUONReconstructor::HasLocalReconstruction() const
-{
- /// Whether or not we have local reconstruction
- TString opt(GetOption());
- opt.ToUpper();
- if ( opt.Contains("NOLOCALRECONSTRUCTION" ) )
- {
- return kFALSE;
- }
- else
- {
- return kTRUE;
- }
-}
-
//_____________________________________________________________________________
void
AliMUONReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const
FillTreeR(TriggerStore(),ClusterStore(),*clustersTree);
}
-//_____________________________________________________________________________
-void
-AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader) const
-{
- /// Reconstruct simulated data
-
- AliCodeTimerAuto("Reconstruct(AliRunLoader*)")
-
- AliLoader* loader = runLoader->GetDetectorLoader("MUON");
- if (!loader)
- {
- AliError("Could not get MUON loader");
- return;
- }
-
- Int_t nEvents = runLoader->GetNumberOfEvents();
-
- for ( Int_t i = 0; i < nEvents; ++i )
- {
- runLoader->GetEvent(i);
-
- loader->LoadRecPoints("update");
- loader->CleanRecPoints();
- loader->MakeRecPointsContainer();
- TTree* clustersTree = loader->TreeR();
-
- loader->LoadDigits("read");
- TTree* digitsTree = loader->TreeD();
-
- Reconstruct(digitsTree,clustersTree);
-
- loader->UnloadDigits();
- loader->WriteRecPoints("OVERWRITE");
- loader->UnloadRecPoints();
- }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReader* rawReader) const
-{
- /// This method is called by AliReconstruction if HasLocalReconstruction()==kFALSE
-
- AliCodeTimerAuto("AliMUONReconstructor::Reconstruct(AliRunLoader*, AliRawReader*)")
-
- AliLoader* loader = runLoader->GetDetectorLoader("MUON");
- if (!loader)
- {
- AliError("Could not get MUON loader");
- return;
- }
-
- Int_t i(0);
-
- while (rawReader->NextEvent())
- {
- runLoader->GetEvent(i++);
-
- loader->LoadRecPoints("update");
- loader->CleanRecPoints();
- loader->MakeRecPointsContainer();
- TTree* clustersTree = loader->TreeR();
-
- loader->LoadDigits("update");
- loader->CleanDigits();
- loader->MakeDigitsContainer();
- TTree* digitsTree = loader->TreeD();
- ConvertDigits(rawReader, digitsTree);
- loader->WriteDigits("OVERWRITE");
-
- Reconstruct(digitsTree,clustersTree);
-
- loader->UnloadDigits();
- loader->WriteRecPoints("OVERWRITE");
- loader->UnloadRecPoints();
- }
-}
-
//_____________________________________________________________________________
void
AliMUONReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
/// This method is called by AliReconstruction if HasLocalReconstruction()==kTRUE
/// AND HasDigitConversion()==kTRUE
-// AliCodeTimerAuto("(TTree*,TTree*)")
+ AliCodeTimerAuto("")
AliDebug(1,"");