#include "AliMUONVTriggerStore.h"
#include "AliMpCDB.h"
-#include "AliMpIntPair.h"
+#include "AliMpEncodePair.h"
#include "AliMpDEManager.h"
#include "AliMpConstants.h"
#include "AliMpCDB.h"
#include "AliLoader.h"
-#include "AliLog.h"
#include "AliRunLoader.h"
#include "AliHeader.h"
#include "AliCDBManager.h"
+#include "AliLog.h"
-#include <TError.h>
-#include <TParticle.h>
#include <Riostream.h>
#include <TFile.h>
#include <TList.h>
fTriggerStore(0x0),
fClusterStore(0x0),
fCurrentEvent(-1),
+fTreeLetter(""),
fIsValid(kFALSE),
fCurrentIteratorType(kNoIterator),
fCurrentIndex(-1),
{
/// dtor
ResetStores();
- if ( fLoader != 0x0 )
- {
- delete fLoader->GetRunLoader();
- }
--fgInstanceCounter;
}
/// Return digitStore for a given event.
/// Return 0x0 if event not found.
/// Returned pointer should not be deleted
+ ///
+ /// \note If a previous store has been retrieved by one of the methods of
+ /// this class, but for a different event number, then those stores will
+ /// be deleted and no longer valid.
+ /// If you require access to the data for the earlier retrieved store,
+ /// but for different events, then you should deep copy / clone the object.
if (not IsValid()) return 0x0;
- if (event == fCurrentEvent and fDigitStore != 0x0) return fDigitStore;
- ResetStores();
- if (not LoadEvent(event)) return 0x0;
+ if (event == fCurrentEvent)
+ {
+ if (fDigitStore != 0x0)
+ return fDigitStore;
+ }
+ else
+ {
+ ResetStores();
+ if ( not LoadEvent(event) ) return 0x0;
+ }
fLoader->LoadDigits();
/// Return clusterStore for a given event.
/// Return 0x0 if event not found.
/// Returned pointer should not be deleted
+ ///
+ /// \note If a previous store has been retrieved by one of the methods of
+ /// this class, but for a different event number, then those stores will
+ /// be deleted and no longer valid.
+ /// If you require access to the data for the earlier retrieved store,
+ /// but for different events, then you should deep copy / clone the object.
if (not IsValid()) return 0x0;
- if (event == fCurrentEvent and fClusterStore != 0x0) return fClusterStore;
- ResetStores();
- if (not LoadEvent(event)) return 0x0;
+ if (event == fCurrentEvent)
+ {
+ if (fClusterStore != 0x0)
+ return fClusterStore;
+ }
+ else
+ {
+ ResetStores();
+ if ( not LoadEvent(event) ) return 0x0;
+ }
fLoader->LoadRecPoints();
/// Return 0x0 if event not found.
/// Returned pointer should not be deleted
/// treeLetter can be R or D to tell from which tree to read the information
+ ///
+ /// \note If a previous store has been retrieved by one of the methods of
+ /// this class, but for a different event number, then those stores will
+ /// be deleted and no longer valid.
+ /// If you require access to the data for the earlier retrieved store,
+ /// but for different events, then you should deep copy / clone the object.
if (not IsValid()) return 0x0;
- if (event == fCurrentEvent and fTriggerStore != 0x0) return fTriggerStore;
- ResetStores();
- if (not LoadEvent(event)) return 0x0;
+ if (event == fCurrentEvent)
+ {
+ if (fTreeLetter == treeLetter)
+ {
+ if (fTriggerStore != 0x0)
+ return fTriggerStore;
+ }
+ else
+ {
+ // Reset only the fTriggerStore since the others might still be valid
+ // for the same event.
+ if (fTriggerStore != 0x0)
+ {
+ delete fTriggerStore;
+ fTriggerStore = 0x0;
+ }
+ }
+ }
+ else
+ {
+ // Event has changed so reset all the stores.
+ ResetStores();
+ if ( not LoadEvent(event) ) return 0x0;
+ }
TTree* tree(0x0);
{
fLoader->UnloadRecPoints();
}
+ fTreeLetter = stree;
return fTriggerStore;
}
{
AliError(Form("Cannot open file %s",filename));
fIsValid = kFALSE;
+ return;
}
runLoader->LoadHeader();
}
else {
Int_t runNumber = runLoader->GetHeader()->GetRun();
- AliCDBManager::Instance()->SetRun(runNumber);
+ AliCDBManager::Instance()->SetRun(runNumber>=0 ? runNumber : 1);
}
runLoader->UnloadHeader();
AliMUONVDigitStore* store = DigitStore(fCurrentEvent);
if (store == 0x0) return 0x0;
- AliMpIntPair pair = AliMpDEManager::GetDetElemIdRange(chamber);
- fIterator = store->CreateIterator(pair.GetFirst(), pair.GetSecond(), cathode);
+ MpPair_t pair = AliMpDEManager::GetDetElemIdRange(chamber);
+ fIterator = store->CreateIterator(AliMp::PairFirst(pair), AliMp::PairSecond(pair), cathode);
if (fIterator == 0x0) return 0x0;
fCurrentIteratorType = kDigitIteratorByChamberAndCathode;
fDataX = chamber;