fSSDNModules(0),
fArray(),
fCurrentEve(-1000),
+fNextEvent(-1000),
fActualSize(0),
fDet(""),
fStatusOK(kTRUE){
const Int_t kLimits[12]={25,25,20,20,10,10,300,300,200,200,100,100};
Int_t offset=0;
if(!krp){
- AliWarning("AliITSRecoPoint is missing. Using defaults");
+ AliWarning("AliITSRecoParam is missing. Using defaults");
}
else {
if(krp->GetEventSpecie() == AliRecoParam::kHighMult)offset=6;
TClonesArray* AliITSRecPointContainer::FetchClusters(Int_t mod, TTree* tR){
// retrieves Recpoints for module mod (offline mode: the event number is
// retrieved via the AliRunLoader object)
- Int_t cureve=AliRunLoader::Instance()->GetEventNumber();
+ // The actual access to the RP TTree is done as follows:
+ // If the AliRunLoader object exists, the event number is taken from it
+ // If not, the data member fNextEvent is used.
+ // To set fNextEvent it is necessary to call PrepareToRead in advance.
+ // if this is never done, fNextEvent will have its default negative value
+ // and an error message will be delivered.
+ AliRunLoader* rl = AliRunLoader::Instance();
+ Int_t cureve;
+ if(rl){
+ cureve = rl->GetEventNumber();
+ }
+ else if(fNextEvent>=0){
+ cureve = fNextEvent;
+ }
+ else {
+ AliError("The RunLoader is not defined, PrepareToRead was not invoked. Revise calling sequence. Nothing done");
+ return NULL;
+ }
return FetchClusters(mod,tR,cureve);
}
//______________________________________________________________________
Int_t GetNumberOfModules() const {return fActualSize; }
static AliITSRecPointContainer* Instance(const AliITSRecoParam *ptr=NULL);
+ void PrepareToRead(){if(fNextEvent<0){fNextEvent=0;} else {++fNextEvent;}}
TClonesArray* FetchClusters(Int_t mod, TTree* tR);
TClonesArray* FetchClusters(Int_t mod, TTree* tR,Int_t cureve);
TClonesArray* UncheckedGetClusters(Int_t mod) const {return fArray[mod];}
Int_t fSDDNModules; //! number of SDD modules
Int_t fSSDNModules; //! number of SDD modules
TClonesArray* fArray[fgkNModules]; //! container - 1 TClonesArray per module
- Int_t fCurrentEve; //!run number
+ Int_t fCurrentEve; //! event number
+ Int_t fNextEvent; //! number of the next event to be read; used only when
+ //! the run loader is not available. It is just a counter.
Int_t fActualSize; //! actual number of ITS modules in TTree R
TString fDet; //! ITS subdetectors active for the current run
Bool_t fStatusOK; //! kFALSE is RP branch is absent or if there are anomalies