]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small fixes
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 12:00:54 +0000 (12:00 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 12:00:54 +0000 (12:00 +0000)
FMD/AliFMDInput.cxx
FMD/AliFMDReconstructor.cxx
FMD/AliFMDReconstructor.h

index f26cfe03a2322135ac6ae96b5a64695409c42f45..ae5d30f5f288b6fdafdd831a4c4ae65a203075a5 100644 (file)
@@ -396,19 +396,23 @@ AliFMDInput::ProcessHits()
     AliError("No hit tree defined");
     return kFALSE;
   }
+  if (!fArrayH) {
+    AliError("No hit array defined");
+    return kFALSE;
+  }
+
   Int_t nTracks = fTreeH->GetEntries();
   for (Int_t i = 0; i < nTracks; i++) {
     Int_t hitRead  = fTreeH->GetEntry(i);
     if (hitRead <= 0) continue;
-    if (!fArrayH) {
-      AliError("No hit array defined");
-      return kFALSE;
-    }
+
     Int_t nHit = fArrayH->GetEntries();
     if (nHit <= 0) continue;
+  
     for (Int_t j = 0; j < nHit; j++) {
       AliFMDHit* hit = static_cast<AliFMDHit*>(fArrayH->At(j));
       if (!hit) continue;
+
       TParticle* track = 0;
       if (TESTBIT(fTreeMask, kKinematics) && fStack) {
        Int_t trackno = hit->Track();
@@ -425,7 +429,7 @@ Bool_t
 AliFMDInput::ProcessTracks()
 {
   // Read the hit tree, and pass each hit to the member function
-  // ProcessHit.
+  // ProcessTrack.
   if (!fStack) {
     AliError("No track tree defined");
     return kFALSE;
@@ -434,25 +438,32 @@ AliFMDInput::ProcessTracks()
     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++) {
-    TParticle* track = fStack->Particle(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);
-    if (hitRead <= 0) continue;
-    if (!fArrayH) {
-      AliError("No hit array defined");
-      return kFALSE;
+    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;
     }
-    Int_t nHit = fArrayH->GetEntries();
-    if (nHit <= 0) 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 (!hit) continue;
-      if (!ProcessTrack(i, track, hit)) return kFALSE;
-    }    
-    // if (!ProcessTrack(i, track, fArrayH)) return kFALSE;
+      if (!ProcessTrack(trackno, track, hit)) return kFALSE;
+    }   
   }
   return kTRUE;
 }
index fb9a17dd0f93c8b6f83430def971ad589efc9d27..acf44e3f102004b15ce631615a2dda39ac6af5f9 100644 (file)
@@ -222,6 +222,26 @@ AliFMDReconstructor::GetVertex() const
 }
   
 
+//____________________________________________________________________
+void 
+AliFMDReconstructor::Reconstruct(AliRawReader* /*reader*/, TTree*) const
+{
+  // Reconstruct directly from raw data (no intermediate output on
+  // digit tree or rec point tree).  
+  // Parameters: 
+  //   reader  Raw event reader 
+  //   ctree    Not used. 
+  AliError("Method is not used");
+#if 0
+  TClonesArray*   array = new TClonesArray("AliFMDDigit");
+  AliFMDRawReader rawRead(reader, 0);
+  rawRead.ReadAdcs(array);
+  ProcessDigits(array);
+  array->Delete();
+  delete array;
+#endif
+}
+
 //____________________________________________________________________
 void 
 AliFMDReconstructor::Reconstruct(TTree* digitsTree, 
@@ -502,6 +522,15 @@ AliFMDReconstructor::FillESD(TTree*  /* digitsTree */,
   if (fDiagAll)   fDiagAll->Reset();
 }
 
+//____________________________________________________________________
+void
+AliFMDReconstructor::FillESD(AliRawReader*, TTree* clusterTree, 
+                            AliESDEvent* esd) const
+{
+  TTree* dummy = 0;
+  FillESD(dummy, clusterTree, esd);
+}
+
 //____________________________________________________________________
 //
 // EOF
index f93a204bf559d284963f0cd72406497c77b98f57..f0f2fc5b145387202918f73ed133ddd7d5ebdd32 100644 (file)
@@ -80,8 +80,8 @@ public:
       @param digitsTree  Tree holding the digits of this event
       @param clusterTree Tree to store AliFMDRecPoint objects in. */
   virtual void   Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
-  virtual void   Reconstruct(AliRawReader *, TTree*) const
-  {AliError("Method is not used");}
+  /** Not used */
+  virtual void   Reconstruct(AliRawReader *, TTree*) const;
   /** Put in the ESD data, the FMD ESD data.  The object created by
       the Reconstruct member function is copied to the ESD object. 
       @param digitsTree   Tree of digits for this event - not used
@@ -89,10 +89,11 @@ public:
       - not used. 
       @param esd ESD object to store data in. 
   */
-  virtual void   FillESD(AliRawReader*, TTree*clusterTree, AliESDEvent*esd) const
-  {FillESD((TTree*)NULL,clusterTree,esd);}
   virtual void   FillESD(TTree* digitsTree, TTree* clusterTree, 
                         AliESDEvent* esd) const;
+  /** Forwards to above member function */
+  virtual void   FillESD(AliRawReader*, TTree* clusterTree, 
+                        AliESDEvent* esd) const;
   /** Not used */
   virtual void   SetESD(AliESDEvent* esd) { fESD = esd; }
   /** Set the noise factor