2 #include "AliFMDInput.h"
6 #include "TClonesArray.h"
7 #include "AliTrackReference.h"
8 #include "AliFMDStripIndex.h"
10 //Script to compare the hits and the FMD track references for one event.
12 //>gSystem->Load("libFMDutil")
13 //>.L CompareTrackRefsAndHits.C++
16 //Note that the order of hits and trackrefs is different.
18 class ReadHits : public AliFMDInput{
33 Bool_t ProcessHit(AliFMDHit* hit, TParticle* p)
36 std::cout<<hit->Px()<<" "<<hit->Py()<<" "<<hit->Pz()<<std::endl;
37 std::cout<<hit->Detector()<<" "<<hit->Ring()<<" "<<hit->Sector()<<" "<<hit->Strip()<<std::endl;
43 TFile* f=TFile::Open("TrackRefs.root");
44 TTree* tree = (TTree*)f->Get("Event0/TreeTR");
47 TClonesArray* array=new TClonesArray("AliTrackReference");
49 tree->SetBranchAddress("TrackReferences",&array);
51 UShort_t det,sec,strip;
53 for (int i=0; i<tree->GetEntries(); i++) {
55 for(Int_t j = 0; j <array->GetEntriesFast();j++) {
57 AliTrackReference* track = static_cast<AliTrackReference*>(array->At(j));
59 if(track->DetectorId()==AliTrackReference::kFMD) {
61 AliFMDStripIndex::Unpack(track->UserId(),det,ring,sec,strip);
62 std::cout<<track->Px()<<" "<<track->Py()<<" "<<track->Pz()<<" "<<track->UserId()<<endl;
63 std::cout<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
69 std::cout<<nTracks<<" "<<nHits<<std::endl;