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{
34 fGAliceFile.Form("galice.root");
37 Bool_t ProcessHit(AliFMDHit* hit, TParticle* p)
40 // std::cout<<hit->Px()<<" "<<hit->Py()<<" "<<hit->Pz()<<std::endl;
41 //std::cout<<hit->Detector()<<" "<<hit->Ring()<<" "<<hit->Sector()<<" "<<hit->Strip()<<std::endl;
44 Bool_t ProcessTrackRef(AliTrackReference* trackRef, TParticle* p)
46 UShort_t det,sec,strip;
48 if(trackRef->DetectorId() == AliTrackReference::kFMD) {
50 AliFMDStripIndex::Unpack(trackRef->UserId(),det,ring,sec,strip);
51 //std::cout<<p->Px()<<" "<<p->Py()<<" "<<p->Pz()<<std::endl;
52 //std::cout<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
62 /* TFile* f=TFile::Open("TrackRefs.root");
63 TTree* tree = (TTree*)f->Get("Event0/TreeTR");
66 TClonesArray* array=new TClonesArray("AliTrackReference");
68 tree->SetBranchAddress("TrackReferences",&array);
70 UShort_t det,sec,strip;
72 for (int i=0; i<tree->GetEntries(); i++) {
74 for(Int_t j = 0; j <array->GetEntriesFast();j++) {
76 AliTrackReference* track = static_cast<AliTrackReference*>(array->At(j));
78 if(track->DetectorId()==AliTrackReference::kFMD) {
80 AliFMDStripIndex::Unpack(track->UserId(),det,ring,sec,strip);
81 std::cout<<track->Px()<<" "<<track->Py()<<" "<<track->Pz()<<" "<<track->UserId()<<endl;
82 std::cout<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
89 std::cout<<nTracks<<" "<<nHits<<std::endl;