]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDQADataMakerRec.cxx
Connection to tree in Notify() seems to be safer.
[u/mrichter/AliRoot.git] / FMD / AliFMDQADataMakerRec.cxx
index 75b909f01af9fe7e404e20bf2d89161a4c569fbb..20250d89c4f1a59e9339ee67dd4716e844e8b552 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliFMDRawReader.h"
 #include "AliRawReader.h"
 #include "AliFMDAltroMapping.h"
+#include "AliFMDDebug.h"
 
 //_____________________________________________________________________
 // This is the class that collects the QA data for the FMD during
@@ -178,6 +179,24 @@ void AliFMDQADataMakerRec::InitRaws()
   }
 }
 
+#if 0
+struct FillESDHist : public AliESDFMD::ForOne
+{
+  FillESDHist(AliFMDQADataMakerRec* m) : fM(m) {}
+  FillESDHist(const FillESDHist& o) : fM(o.fM) {}
+  FillESDHist& operator=(const FillESDHist& o) { fM = o.fM; return *this;  }
+  Bool_t operator()(UShort_t, Char_t, UShort_t, UShort_t, Float_t m, Float_t) 
+  {
+    // Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+    if(m == AliESDFMD::kInvalidMult) return true;
+    
+    fM->GetESDsData(0)->Fill(m);    
+    return true;
+  }
+  AliFMDQADataMakerRec* fM;
+};
+#endif
+
 //_____________________________________________________________________
 void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
 {
@@ -185,11 +204,22 @@ void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
     AliError("FMD ESD object not found!!") ; 
     return;
   }
+  AliFMDDebug(2, ("Will loop over ESD data and fill histogram"));
+
   AliESDFMD* fmd = esd->GetFMDData();
   if (!fmd) return;
-  
+
+#if 0
+  FillESDHist f(this);
+  fmd->ForEach(f);
+#else
+
+
+
+  // FIXME - we should use AliESDFMD::ForOne subclass to do this!
   for(UShort_t det=1;det<=3;det++) {
-    for (UShort_t ir = 0; ir < 2; ir++) {
+    UShort_t nrng = (det == 1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nrng; ir++) {
       Char_t   ring = (ir == 0 ? 'I' : 'O');
       UShort_t nsec = (ir == 0 ? 20  : 40);
       UShort_t nstr = (ir == 0 ? 512 : 256);
@@ -203,6 +233,7 @@ void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
       }
     }
   }
+#endif
 }