// //
//////////////////////////////////////////////////////////////////////
+#include <Riostream.h>
#include <TMath.h>
#include <TPDGCode.h>
#include <TString.h>
if(fFile) delete fFile;
}
-
-Int_t AliJetParticlesReaderESD::ReadNext()
-{
- //reads next event from fFile
-
- do // is OK even if 0 dirs specified,
- { // in that case we try to read from "./"
- if (fFile == 0)
- {
- fFile = OpenFile(fCurrentDir);
- if (fFile == 0)
- {
- Error("ReadNext","Can't get fFile for dir no. %d",fCurrentDir);
- fCurrentDir++;
- continue;
- }
-
- fCurrentEvent = 0;
- //fFile->GetListOfKeys()->Print();
-
- if(fTree) delete fTree;
- fTree = dynamic_cast<TTree*>(fFile->Get("esdTree"));
- if(fTree)
- fTree->SetBranchAddress("ESD",&fESD);
- else
- fKeyIterator = new TIter(fFile->GetListOfKeys());
- }
-
- if(fTree)
- {
- if(AliKalmanTrack::GetConvConst()<=0.)
- AliKalmanTrack::SetMagneticField(0.5);
- if(fCurrentEvent>=fTree->GetEntries())
- {
- fCurrentDir++;
- delete fTree;
- fTree = 0;
- delete fFile;
- fFile = 0;
- continue;
- }
- fTree->GetEvent(fCurrentEvent);
- }
- else
- { // "old" way via ESD objects stored in root file
- TKey* key = (TKey*)fKeyIterator->Next();
- if (key == 0)
- {
- fCurrentDir++;
- delete fKeyIterator;
- fKeyIterator = 0;
- delete fFile; //we have to assume there are no more ESD objects in the fFile
- fFile = 0;
- continue;
- }
- TString esdname = "ESD";
- esdname+=fCurrentEvent;
- if(fESD) delete fESD;
- fESD = dynamic_cast<AliESD*>(fFile->Get(esdname));
- if (fESD == 0)
- {
- Info("ReadNext","Can't find AliESD object named %s",esdname.Data());
- fCurrentDir++;
- delete fKeyIterator;
- fKeyIterator = 0;
- delete fFile;//we have to assume there is no more ESD objects in the fFile
- fFile = 0;
- continue;
- }
- }
- ReadESD(fESD);
- fCurrentEvent++;
- fNEventsRead++;
- return kTRUE;//success -> read one event
- } while(fCurrentDir < GetNumberOfDirs());
- //end of loop over directories specified in fDirs Obj Array
- return kFALSE; //no more directories to read
-}
-
/**********************************************************/
Int_t AliJetParticlesReaderESD::ReadESD(AliESD* esd)
}
AliKalmanTrack::SetMagneticField(mf/10.);
- Info("ReadESD","Reading Event %d",fCurrentEvent);
+ Info("ReadESD","Reading Event %d",fCurrentDir*1000+fCurrentEvent);
if((!fOwner) || (fEventParticles==0))
fEventParticles = new AliJetEventParticles();
//loop over tracks
for (Int_t i = 0;i<kntr; i++)
{
+
const AliESDtrack *kesdtrack = esd->GetTrack(i);
if (kesdtrack == 0)
{
Error("ReadESD","Can't get track %d", i);
continue;
}
-
- if ((kesdtrack->GetStatus() & fPassFlag) != fPassFlag)
+
+ ULong_t cmptest=(kesdtrack->GetStatus() & fPassFlag);
+ if (cmptest!=fPassFlag)
{
- Info("ReadNext","Particle skipped: %ud.",kesdtrack->GetStatus());
+ //cout << i << " "; PrintESDtrack(kesdtrack); cout << endl;
+ Info("ReadNext","Particle %d skipped: %u.",i,kesdtrack->GetStatus());
continue;
}
/**********************************************************/
+Int_t AliJetParticlesReaderESD::ReadNext()
+{
+ //reads next event from fFile
+
+ do // is OK even if 0 dirs specified,
+ { // in that case we try to read from "./"
+ if (fFile == 0)
+ {
+ fFile = OpenFile(fCurrentDir);
+ if (fFile == 0)
+ {
+ Error("ReadNext","Can't get fFile for dir no. %d",fCurrentDir);
+ fCurrentDir++;
+ continue;
+ }
+
+ fCurrentEvent = 0;
+ //fFile->GetListOfKeys()->Print();
+
+ if(fTree) delete fTree;
+ fTree = dynamic_cast<TTree*>(fFile->Get("esdTree"));
+ if(fTree)
+ fTree->SetBranchAddress("ESD",&fESD);
+ else
+ fKeyIterator = new TIter(fFile->GetListOfKeys());
+ }
+
+ if(fTree)
+ {
+ if(AliKalmanTrack::GetConvConst()<=0.)
+ AliKalmanTrack::SetMagneticField(0.5);
+ if(fCurrentEvent>=fTree->GetEntries())
+ {
+ fCurrentDir++;
+ delete fTree;
+ fTree = 0;
+ delete fFile;
+ fFile = 0;
+ continue;
+ }
+ fTree->GetEvent(fCurrentEvent);
+ }
+ else
+ { // "old" way via ESD objects stored in root file
+ TKey* key = (TKey*)fKeyIterator->Next();
+ if (key == 0)
+ {
+ fCurrentDir++;
+ delete fKeyIterator;
+ fKeyIterator = 0;
+ delete fFile; //we have to assume there are no more ESD objects in the fFile
+ fFile = 0;
+ continue;
+ }
+ TString esdname = "ESD";
+ esdname+=fCurrentEvent;
+ if(fESD) delete fESD;
+ fESD = dynamic_cast<AliESD*>(fFile->Get(esdname));
+ if (fESD == 0)
+ {
+ Info("ReadNext","Can't find AliESD object named %s",esdname.Data());
+ fCurrentDir++;
+ delete fKeyIterator;
+ fKeyIterator = 0;
+ delete fFile;//we have to assume there is no more ESD objects in the fFile
+ fFile = 0;
+ continue;
+ }
+ }
+ ReadESD(fESD);
+ fCurrentEvent++;
+ fNEventsRead++;
+ return kTRUE;//success -> read one event
+ } while(fCurrentDir < GetNumberOfDirs());
+ //end of loop over directories specified in fDirs Obj Array
+ return kFALSE; //no more directories to read
+}
+
+/**********************************************************/
+
TFile* AliJetParticlesReaderESD::OpenFile(Int_t n)
{
//opens fFile with kine tree
return ret;
}
+
+/**********************************************************/
+
+void AliJetParticlesReaderESD::PrintESDtrack(const AliESDtrack *kesdtrack) const
+{
+ ULong_t status=kesdtrack->GetStatus();
+ cout << hex << status << dec << ": ";
+ if((status & AliESDtrack::kITSin) == AliESDtrack::kITSin) cout << "ITSin ";
+ if((status & AliESDtrack::kITSout) == AliESDtrack::kITSout) cout << "ITSout ";
+ if((status & AliESDtrack::kITSrefit) == AliESDtrack::kITSrefit) cout << "ITSrefit ";
+ if((status & AliESDtrack::kITSpid) == AliESDtrack::kITSpid) cout << "ITSpid ";
+
+ if((status & AliESDtrack::kTPCin) == AliESDtrack::kTPCin) cout << "TPCin ";
+ if((status & AliESDtrack::kTPCout) == AliESDtrack::kTPCout) cout << "TPCout ";
+ if((status & AliESDtrack::kTPCrefit) == AliESDtrack::kTPCrefit) cout << "TPCrefit ";
+ if((status & AliESDtrack::kTPCpid) == AliESDtrack::kTPCpid) cout << "TPCpid ";
+
+ if((status & AliESDtrack::kTRDin) == AliESDtrack::kTRDin) cout << "TRDin ";
+ if((status & AliESDtrack::kTRDout) == AliESDtrack::kTRDout) cout << "TRDout ";
+ if((status & AliESDtrack::kTRDrefit) == AliESDtrack::kTRDrefit) cout << "TRDrefit ";
+ if((status & AliESDtrack::kTRDpid) == AliESDtrack::kTRDpid) cout << "TRDpid ";
+ if((status & AliESDtrack::kTRDbackup) == AliESDtrack::kTRDbackup) cout << "TRDbackup ";
+ if((status & AliESDtrack::kTRDStop) == AliESDtrack::kTRDStop) cout << "TRDstop ";
+
+ if((status & AliESDtrack::kTOFin) == AliESDtrack::kTOFin) cout << "TOFin ";
+ if((status & AliESDtrack::kTOFout) == AliESDtrack::kTOFout) cout << "TOFout ";
+ if((status & AliESDtrack::kTOFrefit) == AliESDtrack::kTOFrefit) cout << "TOFrefit ";
+ if((status & AliESDtrack::kTOFpid) == AliESDtrack::kTOFpid) cout << "TOFpid ";
+
+ if((status & AliESDtrack::kPHOSpid) == AliESDtrack::kPHOSpid) cout << "PHOSpid ";
+ if((status & AliESDtrack::kRICHpid) == AliESDtrack::kRICHpid) cout << "RICHpid ";
+ if((status & AliESDtrack::kEMCALpid) == AliESDtrack::kEMCALpid) cout << "EMCALpid ";
+ if((status & AliESDtrack::kESDpid) == AliESDtrack::kESDpid) cout << "ESDpid ";
+ if((status & AliESDtrack::kTIME) == AliESDtrack::kTIME) cout << "TIME ";
+ cout << endl;
+ /*
+ cout << kesdtrack->GetConstrainedChi2()
+ << " " << kesdtrack->GetITSchi2()
+ << " " << kesdtrack->GetTPCchi2()
+ << " " << kesdtrack->GetTRDchi2()<< endl;
+ */
+}