+//____________________________________________________________________
+Bool_t
+AliFMDInput::ProcessTrackRefs()
+{
+ // Read the reconstrcted points tree, and pass each reconstruction
+ // object (AliFMDRecPoint) to either ProcessRecPoint.
+ if (!fTreeTR) {
+ AliError("No track reference tree defined");
+ return kFALSE;
+ }
+ if (!fArrayTR) {
+ AliError("No track reference array defined");
+ return kFALSE;
+ }
+
+ Int_t nEv = fTreeTR->GetEntries();
+ for (Int_t i = 0; i < nEv; i++) {
+ Int_t trRead = fTreeTR->GetEntry(i);
+ if (trRead <= 0) continue;
+ Int_t nTrackRefs = fArrayTR->GetEntries();
+ for (Int_t j = 0; j < nTrackRefs; j++) {
+ AliTrackReference* trackRef =
+ static_cast<AliTrackReference*>(fArrayTR->At(j));
+ if (!trackRef) continue;
+ // if (trackRef->DetectorId() != AliTrackReference::kFMD) continue;
+ TParticle* track = 0;
+ if (TESTBIT(fTreeMask, kKinematics) && fStack) {
+ Int_t trackno = trackRef->GetTrack();
+ track = fStack->Particle(trackno);
+ }
+ if (!ProcessTrackRef(trackRef,track)) return kFALSE;
+ }
+ }
+ return kTRUE;
+}
+//____________________________________________________________________
+Bool_t
+AliFMDInput::ProcessTracks()
+{
+ // Read the hit tree, and pass each hit to the member function
+ // ProcessTrack.
+ if (!fStack) {
+ AliError("No track tree defined");
+ return kFALSE;
+ }
+ if (!fTreeH) {
+ AliError("No hit tree defined");
+ return kFALSE;
+ }
+ if (!fArrayH) {
+ AliError("No hit array defined");
+ return kFALSE;
+ }
+
+ // Int_t nTracks = fStack->GetNtrack();
+ Int_t nTracks = fTreeH->GetEntries();
+ for (Int_t i = 0; i < nTracks; i++) {
+ Int_t trackno = nTracks - i - 1;
+ TParticle* track = fStack->Particle(trackno);
+ if (!track) continue;
+
+ // Get the hits for this track.
+ Int_t hitRead = fTreeH->GetEntry(i);
+ Int_t nHit = fArrayH->GetEntries();
+ if (nHit == 0 || hitRead <= 0) {
+ // Let user code see the track, even if there's no hits.
+ if (!ProcessTrack(trackno, track, 0)) return kFALSE;
+ continue;
+ }
+
+ // Loop over the hits corresponding to this track.
+ for (Int_t j = 0; j < nHit; j++) {
+ AliFMDHit* hit = static_cast<AliFMDHit*>(fArrayH->At(j));
+ if (!ProcessTrack(trackno, track, hit)) return kFALSE;
+ }
+ }
+ return kTRUE;
+}
+//____________________________________________________________________
+Bool_t
+AliFMDInput::ProcessStack()
+{
+ // Read the hit tree, and pass each hit to the member function
+ // ProcessTrack.
+ if (!fStack) {
+ AliError("No track tree defined");
+ return kFALSE;
+ }
+ Int_t nTracks = fStack->GetNtrack();
+ for (Int_t i = 0; i < nTracks; i++) {
+ Int_t trackno = nTracks - i - 1;
+ TParticle* track = fStack->Particle(trackno);
+ if (!track) continue;