-#include "AliReaderAOD.h"
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
//______________________________________________________________________________
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
-ClassImp(AliReaderAOD)
#include <TError.h>
#include <TFile.h>
#include <TTree.h>
#include <TH1.h>
-#include "AliAOD.h"
+#include "AliAOD.h"
+#include "AliLog.h"
+#include "AliReaderAOD.h"
const TString AliReaderAOD::fgkTreeName("TAOD");
const TString AliReaderAOD::fgkReconstructedDataBranchName("reconstructed.");
const TString AliReaderAOD::fgkSimulatedDataBranchName("simulated.");
+ClassImp(AliReaderAOD)
+
AliReaderAOD::AliReaderAOD(const Char_t* aodfilename):
fFileName(aodfilename),
fReadSim(kFALSE),
fTree = 0x0;
delete fFile;
fFile = 0x0;
+
+ delete fSimBuffer;
+ delete fRecBuffer;
+
fSimBuffer = 0x0;
fRecBuffer = 0x0;
fCurrentDir++;
continue;
}
-
+
Info("ReadNext","Getting event %d",fCurrentEvent);
fTree->GetEvent(fCurrentEvent);
Info("ReadNext","Getting event %d Done",fCurrentEvent);
}
fCurrentEvent++;
- if (retval == 0) fNEventsRead++;
+ if (retval != 0)
+ {
+ //something wrong has happend during reading this event, take next
+ continue;
+ }
+ fNEventsRead++;
return retval;//success -> read one event
}while(fCurrentDir < GetNumberOfDirs());//end of loop over directories specified in fDirs Obj Array
}
Int_t npart = fRecBuffer->GetNumberOfParticles();
+
+ if (npart != fSimBuffer->GetNumberOfParticles())
+ {
+ Error("ReadRecAndSim","There is different number of simulated and reconstructed particles!",
+ fSimBuffer->GetNumberOfParticles(),npart);
+ return 1;
+ }
for (Int_t i = 0; i < npart; i++)
{
AliVAODParticle* prec = fRecBuffer->GetParticle(i);
- if (Rejected(prec)) continue;//we make cuts only on simulated data
-
+ AliVAODParticle* psim = fSimBuffer->GetParticle(i);
+
+ if (prec == 0x0)
+ {
+ Error("ReadRecAndSim","Reconstructed Particle is NULL !!!");
+ continue;
+ }
+ if (psim == 0x0)
+ {
+ Error("ReadRecAndSim","Simulated Particle is NULL !!!");
+ continue;
+ }
+
+ if (Rejected(prec)) continue;//we make cuts only on reconstructed data
+
fEventRec->AddParticle(prec);
fEventSim->AddParticle( fSimBuffer->GetParticle(i));
}
const TString dirname = GetDirName(n);
if (dirname == "")
{
- if (AliVAODParticle::GetDebug() > 2 )
- {
- Info("OpenFile","Got empty string as a directory name.");
- }
- return 1;
+ AliDebug(3,"Got empty string as a directory name.");
+ return 1;
}
TString filename = dirname +"/"+ fFileName;
return 3;
}
- Info("ReadNext","File Is Opened, Getting the TREE");
+ Info("ReadNext","File %s Is Opened, Getting the TREE",filename.Data());
fTree = dynamic_cast<TTree*>(fFile->Get(fgkTreeName));
if (fTree == 0x0)
{
- if (AliVAODParticle::GetDebug() > 2 )
- {
- Info("ReadNext","Can not find TTree object named %s",fgkTreeName.Data());
- }
+ AliDebug(3,Form("Can not find TTree object named %s",fgkTreeName.Data()));
delete fFile;
fFile = 0x0;
return 4;
{//else just pointer to event from input reader is passed
recbuffer = event;
}
- recbuffer->GetParticle(0)->Print();
}
if (reader->ReadsSim())
{//else just pointer to event from input reader is passed
simbuffer = event;
}
- simbuffer->GetParticle(0)->Print();
}
tree->Fill();
}