Here is the code that gives me the error.
#ifndef CINT
#include “TObject.h”
#include “TFile.h”
#include “TTree.h”
#include “TChain.h”
#include “TBranch.h”
#include “TEventList.h”
#include “AliMagF.h”
#include “AliESD.h”
#include “AliESDfriend.h”
#include “AliESDtrack.h”
#include “AliTPCseed.h”
#include “AliTPCclusterMI.h”
#include “AliTPCclusterInfo.h”
#include “TTreeStream.h”
#include “TF1.h”
#include “AliSignalProcesor.h”
#include “TCanvas.h”
#include “TGraphErrors.h”
#include “AliTPCclusterInfo.h”
#endif
void LoopTest1(){
// Intializing the chain and andresses as well as home made fitters and datafiles
TChain * Tree = new TChain(“esdTree”);
Tree->AddFile(“SectorA00A01/1/AliESDs.root”);
AliESD * esd =0; // Change to AliESD in normal mode!
AliESDfriend *evf=0;
Tree->SetBranchAddress(“ESD”,&esd);
Tree->SetBranchAddress(“ESDfriend.”,&evf);
Tree->SetBranchStatus("*",0);
Tree->SetBranchStatus(“TObject”, 1);
Tree->SetBranchStatus(“fRunNumber”, 1);
Tree->SetBranchStatus(“fEventNumberInFile”, 1);
Tree->SetBranchStatus(“fEventType”, 1);
Tree->SetBranchStatus(“fRecoVersion”, 1);
Tree->SetBranchStatus(“ESDfriend.fTracks.fCalibContainer”, 1);
Tree->SetBranchStatus(“ESDfriend.”, 1);
Tree->SetBranchStatus(“ESDfriend.fTracks”, 1);
Tree->SetBranchStatus(“fTracks”,1);
Tree->SetBranchStatus(“fTimeStamp”,1);
Int_t ntracks = 0;
Int_t nevents = Tree->GetEntries();
cout << "Number of events in the chain: " << nevents << endl;
for (Int_t i = 0; i < nevents;i++){
cout << "Processing event number: " << i << endl;
Tree->GetEntry(i);
ntracks = esd->GetNumberOfTracks();
cout << "Number of tracks in current event: " << ntracks << endl;
esd->SetESDfriend(evf);
if (0 == ntracks) continue;
for (Int_t k = 0; k < ntracks; k++){
AliESDtrack * track = esd->GetTrack(k);
AliESDfriendTrack * ftrack = (AliESDfriendTrack *)esd->GetTrack(k)
->GetFriendTrack();
AliTPCseed * trackseed = (AliTPCseed*) ftrack->GetCalibObject(0);
// the trackseed is what i need to analyze.
// cout << trackseed;
}
}
}
I use the two files AliESDs.root and AliESDfriends.root.
The files are too large (1 + 27 MB) to be sent. They can be found on Alien at
/alice/cern.ch/user/h/haavard/rec0307_alien/2571
Any one of these file pairs will do (AliESDs.root + AliESDfriends.root)
Best regards