]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes, and extra debug
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2005 21:39:30 +0000 (21:39 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2005 21:39:30 +0000 (21:39 +0000)
20 files changed:
FMD/AliFMD.cxx
FMD/AliFMDCalibGain.cxx [new file with mode: 0644]
FMD/AliFMDCalibGain.h [new file with mode: 0644]
FMD/AliFMDCalibPedestal.cxx [new file with mode: 0644]
FMD/AliFMDCalibPedestal.h [new file with mode: 0644]
FMD/AliFMDDigitizer.cxx
FMD/AliFMDFloatMap.cxx [new file with mode: 0644]
FMD/AliFMDFloatMap.h [new file with mode: 0644]
FMD/AliFMDMultPoisson.cxx
FMD/AliFMDMultRegion.cxx
FMD/AliFMDMultRegion.h
FMD/AliFMDReconstructor.cxx
FMD/AliFMDReconstructor.h
FMD/AliFMDSimulator.cxx
FMD/Config.C
FMD/FMDbaseLinkDef.h
FMD/FMDrecLinkDef.h
FMD/Simulate.C
FMD/libFMDbase.pkg
FMD/libFMDrec.pkg

index cb4d56ed9fa0c29f6010fbfa0136fb82dd4499a1..a56720e9f81659022e2229558a7cc8a59bcd8c9b 100644 (file)
@@ -808,6 +808,8 @@ AliFMD::Hits2Digits()
   // Create AliFMDDigit's from AliFMDHit's.  This is done by making a
   // AliFMDDigitizer, and executing that code.
   // 
+  Warning("Hits2Digits", "Try not to use this method.\n"
+         "Instead, use AliSimulator");
   AliRunDigitizer* manager = new AliRunDigitizer(1, 1);
   manager->SetInputStream(0, "galice.root");
   manager->SetOutputFile("H2Dfile");
diff --git a/FMD/AliFMDCalibGain.cxx b/FMD/AliFMDCalibGain.cxx
new file mode 100644 (file)
index 0000000..c154410
--- /dev/null
@@ -0,0 +1,70 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+//                                                                          
+//
+//
+#include "AliFMDCalibGain.h"   // ALIFMDCALIBGAIN_H
+//____________________________________________________________________
+ClassImp(AliFMDCalibGain)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDCalibGain::AliFMDCalibGain()
+{
+  fValue.Reset(-1.);
+  fThreshold = -1.;
+}
+
+//____________________________________________________________________
+AliFMDCalibGain::AliFMDCalibGain(const AliFMDCalibGain& o)
+  : TObject(o), fValue(o.fValue), fThreshold(o.fThreshold)
+{}
+
+//____________________________________________________________________
+AliFMDCalibGain&
+AliFMDCalibGain::operator=(const AliFMDCalibGain& o)
+{
+  fValue     = o.fValue;
+  fThreshold = o.fThreshold;
+  return (*this);
+}
+
+//____________________________________________________________________
+void
+AliFMDCalibGain::Set(UShort_t det, Char_t ring, UShort_t sec, 
+                    UShort_t str, Float_t val)
+{
+  if (fValue.CheckIndex(det, ring, sec, str) < 0) return;
+  fValue(det, ring, sec, str) = val;
+}
+
+//____________________________________________________________________
+Float_t
+AliFMDCalibGain::Value(UShort_t det, Char_t ring, UShort_t sec, 
+                      UShort_t str)
+{
+  return fValue(det, ring, sec, str);
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/AliFMDCalibGain.h b/FMD/AliFMDCalibGain.h
new file mode 100644 (file)
index 0000000..e0c030d
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIFMDCALIBGAIN_H
+#define ALIFMDCALIBGAIN_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+#ifndef ALIFMDFLOATMAP_H
+# include <AliFMDFloatMap.h>
+#endif
+//____________________________________________________________________
+//
+// Gain value and width for each strip in the FMD
+//
+class AliFMDCalibGain : public TObject 
+{
+public:
+  AliFMDCalibGain();
+  ~AliFMDCalibGain() {}
+  AliFMDCalibGain(const AliFMDCalibGain& o);
+  AliFMDCalibGain& operator=(const AliFMDCalibGain& o);
+  void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, Float_t val);
+  void Set(Float_t thres) { fThreshold = thres; }
+  Float_t Value(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
+  Float_t Threshold() const { return fThreshold; }
+private:
+  AliFMDFloatMap fValue;
+  Float_t        fThreshold;
+  ClassDef(AliFMDCalibGain, 1) // Gain data for the FMD 
+};
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+
+
diff --git a/FMD/AliFMDCalibPedestal.cxx b/FMD/AliFMDCalibPedestal.cxx
new file mode 100644 (file)
index 0000000..776cdc0
--- /dev/null
@@ -0,0 +1,79 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+//                                                                          
+//
+//
+#include "AliFMDCalibPedestal.h"       // ALIFMDCALIBPEDESTAL_H
+//____________________________________________________________________
+ClassImp(AliFMDCalibPedestal)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDCalibPedestal::AliFMDCalibPedestal()
+{
+  fValue.Reset(-1.);
+  fWidth.Reset(-1.);
+}
+
+//____________________________________________________________________
+AliFMDCalibPedestal::AliFMDCalibPedestal(const AliFMDCalibPedestal& o)
+  : TObject(o), fValue(o.fValue), fWidth(o.fWidth)
+{}
+
+//____________________________________________________________________
+AliFMDCalibPedestal&
+AliFMDCalibPedestal::operator=(const AliFMDCalibPedestal& o)
+{
+  fValue = o.fValue;
+  fWidth = o.fWidth;
+  return (*this);
+}
+
+//____________________________________________________________________
+void
+AliFMDCalibPedestal::Set(UShort_t det, Char_t ring, UShort_t sec, 
+                        UShort_t str, Float_t ped, Float_t pedW)
+{
+  if (fValue.CheckIndex(det, ring, sec, str) < 0) return;
+  fValue(det, ring, sec, str) = ped;
+  fWidth(det, ring, sec, str) = pedW;
+}
+
+//____________________________________________________________________
+Float_t
+AliFMDCalibPedestal::Value(UShort_t det, Char_t ring, UShort_t sec, 
+                          UShort_t str)
+{
+  return fValue(det, ring, sec, str);
+}
+
+//____________________________________________________________________
+Float_t
+AliFMDCalibPedestal::Width(UShort_t det, Char_t ring, UShort_t sec, 
+                          UShort_t str)
+{
+  return fValue(det, ring, sec, str);
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/AliFMDCalibPedestal.h b/FMD/AliFMDCalibPedestal.h
new file mode 100644 (file)
index 0000000..202adff
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIFMDCALIBPEDESTAL_H
+#define ALIFMDCALIBPEDESTAL_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+#ifndef ALIFMDFLOATMAP_H
+# include <AliFMDFloatMap.h>
+#endif
+//____________________________________________________________________
+//
+// Pedestal value and width for each strip in the FMD
+//
+class AliFMDCalibPedestal : public TObject 
+{
+public:
+  AliFMDCalibPedestal();
+  ~AliFMDCalibPedestal() {}
+  AliFMDCalibPedestal(const AliFMDCalibPedestal& o);
+  AliFMDCalibPedestal& operator=(const AliFMDCalibPedestal& o);
+  void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, 
+          Float_t ped, Float_t pedW);
+  Float_t Value(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
+  Float_t Width(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
+private:
+  AliFMDFloatMap fValue;
+  AliFMDFloatMap fWidth;
+  ClassDef(AliFMDCalibPedestal, 1) // Pedestal data for the FMD 
+};
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+
+
index 39748070e1f70902dd5046f5ece1d905f63515ae..bfb9a276f10ae2c9e9de4de158510d4664ea7d8f 100644 (file)
@@ -494,7 +494,7 @@ AliFMDDigitizer::Exec(Option_t*)
   // Get the input loader 
   TString inFolder(fManager->GetInputFolderName(0));
   fRunLoader = 
-    AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0));
+    AliRunLoader::GetRunLoader(inFolder.Data());
   if (!fRunLoader) {
     AliError("Can not find Run Loader for input stream 0");
     return;
diff --git a/FMD/AliFMDFloatMap.cxx b/FMD/AliFMDFloatMap.cxx
new file mode 100644 (file)
index 0000000..5251a30
--- /dev/null
@@ -0,0 +1,128 @@
+/**************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN.          *
+ * All rights reserved.                                       *
+ *                                                            *
+ * Author: The ALICE Off-line Project.                        *
+ * Contributors are mentioned in the code where appropriate.  *
+ *                                                            *
+ * Permission to use, copy, modify and distribute this        *
+ * software and its documentation strictly for non-commercial *
+ * purposes is hereby granted without fee, provided that the  *
+ * above copyright notice appears in all copies and that both *
+ * the copyright notice and this permission notice appear in  *
+ * the supporting documentation. The authors make no claims   *
+ * about the suitability of this software for any purpose. It *
+ * is provided "as is" without express or implied warranty.   *
+ **************************************************************/
+/* $Id$ */
+//__________________________________________________________
+// 
+// Map of per strip Float_t information
+// 
+// Created Mon Nov  8 12:51:51 2004 by Christian Holm Christensen
+// 
+#include "AliFMDFloatMap.h"    //ALIFMDFLOATMAP_H
+//__________________________________________________________
+ClassImp(AliFMDFloatMap)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
+//__________________________________________________________
+AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other)
+  : AliFMDMap(other.fMaxDetectors,
+              other.fMaxRings,
+              other.fMaxSectors,
+              other.fMaxStrips),
+    fData(0)
+{
+  // Copy constructor
+  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
+        * fMaxSectors * fMaxStrips; i++)
+    fData[i] = other.fData[i];
+}
+
+//__________________________________________________________
+AliFMDFloatMap::AliFMDFloatMap(size_t maxDet,
+                              size_t maxRing,
+                              size_t maxSec,
+                              size_t maxStr)
+  : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
+    fData(0)
+{
+  // Constructor.
+  // Parameters:
+  //   maxDet  Maximum number of detectors
+  //   maxRing Maximum number of rings per detector
+  //   maxSec  Maximum number of sectors per ring
+  //   maxStr  Maximum number of strips per sector
+  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  Reset();
+}
+
+//__________________________________________________________
+AliFMDFloatMap&
+AliFMDFloatMap::operator=(const AliFMDFloatMap& other)
+{
+  // Assignment operator 
+  fMaxDetectors = other.fMaxDetectors;
+  fMaxRings     = other.fMaxRings;
+  fMaxSectors   = other.fMaxSectors;
+  fMaxStrips    = other.fMaxStrips;
+  if (fData) delete [] fData;
+  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
+        * fMaxSectors * fMaxStrips; i++)
+    fData[i] = other.fData[i];
+  return *this;
+}
+
+//__________________________________________________________
+void
+AliFMDFloatMap::Reset(const Float_t& val)
+{
+  // Reset map to val
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
+        * fMaxSectors * fMaxStrips; i++)
+    fData[i] = val;
+}
+
+//__________________________________________________________
+Float_t&
+AliFMDFloatMap::operator()(UShort_t det, 
+                          Char_t   ring, 
+                          UShort_t sec, 
+                          UShort_t str)
+{
+  // Get data
+  // Parameters:
+  //   det     Detector #
+  //   ring    Ring ID
+  //   sec     Sector #
+  //   str     Strip #
+  // Returns appropriate data
+  return fData[CalcIndex(det, ring, sec, str)];
+}
+
+//__________________________________________________________
+const Float_t&
+AliFMDFloatMap::operator()(UShort_t det, 
+                          Char_t   ring, 
+                          UShort_t sec, 
+                          UShort_t str) const
+{
+  // Get data
+  // Parameters:
+  //   det     Detector #
+  //   ring    Ring ID
+  //   sec     Sector #
+  //   str     Strip #
+  // Returns appropriate data
+  return fData[CalcIndex(det, ring, sec, str)];
+}
+
+//__________________________________________________________
+// 
+// EOF
+// 
+
diff --git a/FMD/AliFMDFloatMap.h b/FMD/AliFMDFloatMap.h
new file mode 100644 (file)
index 0000000..3f26353
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef ALIFMDFLOATMAP_H
+#define ALIFMDFLOATMAP_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+#ifndef ALIFMDMAP_H
+# include <AliFMDMap.h>
+#endif
+//____________________________________________________________________
+//
+// Array of floats indexed by strip identifier.
+//
+class AliFMDFloatMap : public AliFMDMap
+{
+public:
+  AliFMDFloatMap(size_t  maxDet = kMaxDetectors, 
+                size_t  maxRing= kMaxRings, 
+                size_t  maxSec = kMaxSectors, 
+                size_t  maxStr = kMaxStrips);
+  AliFMDFloatMap(const AliFMDFloatMap& o);
+  virtual ~AliFMDFloatMap() { delete [] fData; }
+  AliFMDFloatMap& operator=(const AliFMDFloatMap& o);
+  virtual void Reset(const Float_t& v=Float_t());
+  virtual Float_t& operator()(UShort_t det,
+                             Char_t   ring,
+                             UShort_t sec,
+                             UShort_t str);
+  virtual const Float_t& operator()(UShort_t det,
+                                   Char_t   ring,
+                                   UShort_t sec,
+                                   UShort_t str) const;
+protected:
+  Float_t* fData;
+  ClassDef(AliFMDFloatMap,1) // Map of floats
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+
index fe11a98f29e0fccc2c6c5500ad75c7240e10e5a1..18236d84b02e668d51ffa37a85b2bcc29bb20d73 100644 (file)
@@ -156,11 +156,20 @@ AliFMDMultPoisson::PostEvent()
          Float_t  theta2   = 2 * TMath::ATan(TMath::Exp(-maxEta));
          Float_t  minR     = TMath::Abs(realZ * TMath::Tan(theta2));
          Float_t  maxR     = TMath::Abs(realZ * TMath::Tan(theta1));
+         // Calculate the weighted mean eta of the region
+         Float_t  minW2    = TMath::Power(minR * 2 * TMath::Pi() * 
+                                          ((maxPhi - minPhi)/360),2);
+         Float_t  maxW2    = TMath::Power(minR * 2 * TMath::Pi() * 
+                                          ((maxPhi - minPhi)/360), 2);
+         Float_t  meanEta  = ((minEta / minW2 + maxEta / maxW2) / 
+                              (1 / (minW2 + maxW2)));
          //UShort_t minStrip = UShort_t((etaIn - maxEta) * stripEta + 0.5);
          // UShort_t maxStrip = UShort_t((etaIn - minEta) * stripEta + 0.5);
 
-         UShort_t minStrip = UShort_t(r->GetNStrips() -(etaIn - minEta) * stripEta + 0.5);
-         UShort_t maxStrip = UShort_t(r->GetNStrips() -(etaIn - maxEta) * stripEta + 0.5);
+         UShort_t minStrip = UShort_t(r->GetNStrips() - 
+                                      (etaIn - minEta) * stripEta + 0.5);
+         UShort_t maxStrip = UShort_t(r->GetNStrips() - 
+                                      (etaIn - maxEta) * stripEta + 0.5);
 
          AliDebug(10, Form("  Now in eta range %f, %f (strips %d, %d)\n"
                            "    [radii %f, %f, thetas %f, %f, sign %d]", 
@@ -192,7 +201,7 @@ AliFMDMultPoisson::PostEvent()
          AliFMDMultRegion* m = new((*fMult)[fNMult])   
            AliFMDMultRegion(sub->GetId(), r->GetId(),
                             minSector, maxSector, minStrip, maxStrip,
-                            minEta, maxEta, minPhi, maxPhi,
+                            minEta, maxEta, meanEta, minPhi, maxPhi,
                             reconstructed, AliFMDMultRegion::kPoission);
          (void)m;
          fNMult++;
index 460c6301888b88297f11a3ca72aa99f0d23ff200..c73e2a8fa6e1634ad1bcc25af662bb74e0f970b9 100644 (file)
@@ -59,6 +59,7 @@ AliFMDMultRegion::AliFMDMultRegion(UShort_t detector,  Char_t ring,
                                   UShort_t minSector, UShort_t maxSector, 
                                   UShort_t minStrip,  UShort_t maxStrip, 
                                   Float_t  minEta,    Float_t  maxEta, 
+                                  Float_t  meanEta, 
                                   Float_t  minPhi,    Float_t  maxPhi,
                                   Float_t  particles, UShort_t method)
   : AliFMDMult(particles, method),
@@ -70,10 +71,12 @@ AliFMDMultRegion::AliFMDMultRegion(UShort_t detector,  Char_t ring,
     fMaxStrip(maxStrip),
     fMinEta(minEta),
     fMaxEta(maxEta),
+    fMeanEta(meanEta),
     fMinPhi(minPhi),
     fMaxPhi(maxPhi)
 {}
 
+#if 0
 //____________________________________________________________________
 Float_t
 AliFMDMultRegion::Eta() const 
@@ -137,7 +140,7 @@ AliFMDMultRegion::Eta() const
     / (fMaxStrip * fMaxStrip + fMinStrip * fMinStrip);
   return eta;
 }
-
+#endif
   
 //____________________________________________________________________
 void
index 74359f6678ae2c0e19a95324962f3505686cc8bf..46ad46c076724b0b95f3e2cdef6bf5eb46d56875 100644 (file)
@@ -16,14 +16,15 @@ public:
   AliFMDMultRegion (UShort_t detector,  Char_t ring, 
                    UShort_t minSector, UShort_t maxSector, 
                    UShort_t minStrip,  UShort_t maxStrip, 
-                   Float_t  minEta,    Float_t  maxEta, 
+                   Float_t  minEta,    Float_t  maxEta,
+                   Float_t  meanEta,
                    Float_t  minPhi,    Float_t  maxPhi,
                    Float_t  particles, UShort_t method);
   virtual ~AliFMDMultRegion(){};
 
   UShort_t     Detector() const        { return fDetector; }
   Char_t       Ring() const            { return fRing; }
-  Float_t      Eta() const;
+  Float_t      Eta() const             { return fMeanEta; }
   Float_t      Phi() const             { return (fMaxPhi + fMinPhi) / 2; }  
   UShort_t     MinSector() const       { return fMinSector; }
   UShort_t     MaxSector() const       { return fMaxSector; }
@@ -37,16 +38,17 @@ public:
 protected:
   UShort_t fDetector;        // Detector #
   Char_t   fRing;            // Ring ID
-  UShort_t fMinSector;       // First sector of this region
-  UShort_t fMaxSector;       // Last sector of this region
-  UShort_t fMinStrip;        // First strip of this region
-  UShort_t fMaxStrip;        // Second strip of this region  
+  UShort_t fMinSector;       // !First sector of this region
+  UShort_t fMaxSector;       // !Last sector of this region
+  UShort_t fMinStrip;        // !First strip of this region
+  UShort_t fMaxStrip;        // !Second strip of this region  
   Float_t  fMinEta;          // Least eta covered
   Float_t  fMaxEta;          // Largest eta covered
+  Float_t  fMeanEta;         // Scaled average Eta in the region
   Float_t  fMinPhi;          // Least phi covered
   Float_t  fMaxPhi;          // Largest phi covered
 
-  ClassDef(AliFMDMultRegion,1) // Rec. Multiplicity in a eta,phi region
+  ClassDef(AliFMDMultRegion,2) // Rec. Multiplicity in a eta,phi region
 };
 #endif
 //____________________________________________________________________
index 88949f26b58e8cda02c4b09fcf2a26992d383355..6801f5bfee4eab5fa52ae65c5738facfe70187b1 100644 (file)
 #include "AliFMDMultAlgorithm.h"          // ALIFMDMULTALGORITHM_H
 #include "AliFMDMultPoisson.h"            // ALIFMDMULTPOISSON_H
 #include "AliFMDMultNaiive.h"             // ALIFMDMULTNAIIVE_H
+#include "AliESD.h"                       // ALIESD_H
 
 //____________________________________________________________________
 ClassImp(AliFMDReconstructor)
@@ -201,15 +202,20 @@ AliFMDReconstructor::Init(AliRunLoader* runLoader)
     return;
   }
   AliGenEventHeader* eventHeader = header->GenEventHeader();
-  if (!eventHeader) {
-    Warning("Init", "no event header");
-    return;
+  if (eventHeader) {
+    TArrayF vtx;
+    eventHeader->PrimaryVertex(vtx);
+    fCurrentVertex = vtx[2];
+    AliDebug(1, Form("Primary vertex Z coordinate for event # %d/%d is %f", 
+                    header->GetRun(), header->GetEvent(), fCurrentVertex));
+    Warning("Init", "no generator event header");
+  }
+  else {
+    Warning("Init", "No generator event header - "
+           "perhaps we get the vertex from ESD?");
   }
-  TArrayF vtx;
-  eventHeader->PrimaryVertex(vtx);
-  fCurrentVertex = vtx[2];
-  AliDebug(1, Form("Primary vertex Z coordinate for event # %d/%d is %f", 
-                  header->GetRun(), header->GetEvent(), fCurrentVertex));
+  // Get the ESD tree 
+  SetESD(new AliESD);
 }
 
 //____________________________________________________________________
@@ -233,6 +239,14 @@ AliFMDReconstructor::Reconstruct(TTree* digitsTree,
   // FIXME: The vertex may not be known yet, so we may have to move
   // some of this to FillESD. 
   AliDebug(1, "Reconstructing from digits in a tree");
+
+  if (fESD) {
+    const AliESDVertex* vertex = fESD->GetVertex();
+    // if (vertex) {
+    //   AliDebug(1, Form("Got vertex from ESD: %f", vertex->GetZv()));
+    //   fCurrentVertex = vertex->GetZv();
+    // }
+  }
   
   TBranch *digitBranch = digitsTree->GetBranch("FMD");
   if (!digitBranch) {
@@ -329,7 +343,35 @@ AliFMDReconstructor::FillESD(TTree*  /* digitsTree */,
   // nothing to be done
   // FIXME: The vertex may not be known when Reconstruct is executed,
   // so we may have to move some of that member function here. 
-
+#if 0
+  TClonesArray* multStrips  = 0;
+  TClonesArray* multRegions = 0;
+  TTree*        treeR  = fmdLoader->TreeR();
+  TBranch*      branchRegions = treeR->GetBranch("FMDPoisson");
+  TBranch*      branchStrips  = treeR->GetBranch("FMDNaiive");
+  branchRegions->SetAddress(&multRegions);
+  branchStrips->SetAddress(&multStrips);
+  
+  Int_t total = 0;
+  Int_t nEntries  = clusterTree->GetEntries();
+  for (Int_t entry = 0; entry < nEntries; entry++) {
+    AliDebug(5, Form("Entry # %d in cluster tree", entry));
+    treeR->GetEntry(entry);
+    
+    
+    Int_t nMults = multRegions->GetLast();
+    for (Int_t i = 0; i <= nMults; i++) {
+      AliFMDMultRegion* multR =
+       static_cast<AliFMDMultRegion*>(multRegions->UncheckedAt(i));
+      Int_t nParticles=multR->Particles();
+      if (i>=0 && i<=13)   hEtaPoissonI1->AddBinContent(i+1,nParticles);
+      if (i>=14 && i<=27 ) hEtaPoissonI2->AddBinContent(i-13,nParticles);
+      if (i>=28 && i<=33 );
+      if (i>=34 && i<=47 ) hEtaPoissonI3->AddBinContent(48-i,nParticles);
+      if (i>=48 && i<=53)  hEtaPoissonO3->AddBinContent(54-i,nParticles);
+    }
+  }
+#endif   
 }
 
 //____________________________________________________________________
index ddb88b5437418ab20ae3b947df070aa246a1d02e..348e5ff3473daf1b0a461daf8494efb754f2f7f7 100644 (file)
@@ -42,6 +42,7 @@ class TClonesArray;
 class AliFMDDigit;
 class AliRawReader;
 class AliRunLoader;
+class AliESD;
 
 //____________________________________________________________________
 class AliFMDReconstructor: public AliReconstructor 
@@ -59,6 +60,7 @@ public:
   virtual void   Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
   virtual void   FillESD(TTree* digitsTree, TTree* clusterTree, 
                         AliESD* esd) const;
+  virtual void   SetESD(AliESD* esd) { fESD = esd; }
      
 protected:
   virtual void     ProcessDigits(TClonesArray* digits) const;
@@ -69,6 +71,7 @@ protected:
   Float_t               fPedestalWidth; // Width of pedestal
   Float_t               fPedestalFactor;// Number of pedestal widths 
   mutable Float_t       fCurrentVertex; // Z-coordinate of primary vertex
+  AliESD*               fESD;
   
   ClassDef(AliFMDReconstructor, 0)  // class for the FMD reconstruction
 }; 
index 9f17dad3baf678b52cfed44c1b2b5331e2cea2f7..e4c23fec9271e3689f569145e23de2cbfb664f27 100644 (file)
@@ -386,7 +386,11 @@ AliFMDSimulator::Exec(Option_t* /* option */)
   Bool_t inside   = mc->IsTrackInside();
   Bool_t out      = (mc->IsTrackExiting()|| mc->IsTrackDisappeared()||
                     mc->IsTrackStop());
-
+  static Int_t lastPdg = 0;
+  static Double_t lastEtot = 0;
+  static Int_t    lastTrack = 0;
+  static Int_t    nBad       = 0;
+  
   // Reset the energy deposition for this track, and update some of
   // our parameters.
   if (entering) {
@@ -402,6 +406,64 @@ AliFMDSimulator::Exec(Option_t* /* option */)
     fCurrentPdg = mc->IdFromPDG(mc->TrackPid());
   }
   
+  if (mc->Edep() > mc->Etot()/*fCurrentP.E()*/) {
+    // The track deposited an obscene amount of energy in this step 
+    Int_t trackno = gAlice->GetMCApp()->GetCurrentTrackNumber();
+    // TMCProcess process = mc->ProdProcess(trackno);
+    // TString process_name(TMCProcessName[process]);
+    TArrayI procs;
+    mc->StepProcesses(procs);
+    Int_t currentPdg = mc->TrackPid();
+    TString processes;
+    for (Int_t ip = 0; ip < procs.fN; ip++) {
+      if (ip != 0) processes.Append(",");
+      processes.Append(TMCProcessName[procs.fArray[ip]]);
+    }
+    // Int_t currentPdg = mc->IdFromPDG(mc->TrackPid());
+    TParticlePDG* particleType = TDatabasePDG::Instance()->GetParticle(currentPdg);
+    TParticlePDG* lastType = TDatabasePDG::Instance()->GetParticle(lastPdg);
+    TLorentzVector currentV;      //! Current hit postition 
+    TLorentzVector currentP;      //! Current hit momentum
+    mc->TrackMomentum(currentP);
+    mc->TrackPosition(currentV);
+    TString origin("???");
+    if (mc->IsRootGeometrySupported()) {
+      TGeoNode* node = gGeoManager->FindNode(fCurrentV.X(), fCurrentV.Y(), fCurrentV.Z());
+      if (node) origin = node->GetName();
+    }
+    TString what;
+    if (mc->IsTrackEntering())    what.Append("entering ");
+    if (mc->IsTrackExiting())     what.Append("exiting ");
+    if (mc->IsTrackInside())      what.Append("inside ");
+    if (mc->IsTrackDisappeared()) what.Append("disappeared ");
+    if (mc->IsTrackStop())        what.Append("stopped ");
+    if (mc->IsNewTrack())         what.Append("new ");
+    if (mc->IsTrackAlive())       what.Append("alive ");
+    if (mc->IsTrackOut())         what.Append("out ");
+    
+    Int_t mother = gAlice->GetMCApp()->GetPrimary(trackno);
+    AliDebug(0, Form("Track # %5d deposited an obsence amout of energy (call # %d)\n" 
+                    "  Volume:    %s\n" 
+                    "  Momentum:  (%8.4f,%8.4f,%8.4f)\n"
+                    "  Vertex:    (%8.4f,%8.4f,%8.4f) [%s]\n"
+                    "  PDG:       %d (%s) [last %d (%s)]\n" 
+                    "  Edep:      %-16.8f (mother %d)\n"
+                    "  Energy:    %-16.8f (last %16.8f from track %d)\n"
+                    "  Processes: %s\n"
+                    "  What:      %s\n",
+                    trackno, nCall, mc->CurrentVolPath(), 
+                    currentP.X(), currentP.Y(), currentP.Z(),
+                    currentV.X(), currentV.Y(), currentV.Z(), origin.Data(),
+                    currentPdg, (particleType ? particleType->GetName() : "???"), 
+                    lastPdg, (lastType ? lastType->GetName() : "???"),
+                    mc->Edep(), mother, mc->Etot() /*currentP.E()*/, 
+                    lastEtot, lastTrack, processes.Data(), what.Data()));
+    // gAlice->GetMCApp()->DumpPStack();
+    // mother->Print();
+    nBad++;
+    if (nBad > 10) exit (1);
+  }
+  
   // If the track is inside, then update the energy deposition
   if (inside && fCurrentDeltaE >= 0) {
     fCurrentDeltaE += 1000 * mc->Edep();
@@ -462,6 +524,10 @@ AliFMDSimulator::Exec(Option_t* /* option */)
                         fCurrentDeltaE, fCurrentPdg, fCurrentV.T());
     fCurrentDeltaE = -1;
   }
+  lastPdg   = fCurrentPdg;
+  lastEtot  = mc->Etot();
+  lastTrack = gAlice->GetMCApp()->GetCurrentTrackNumber();
+  
 }
 
 
index f8a5265a78dcac09686f1229a1db755319c42e40..0d9eabe010f2f122295f68fc582822708bdf289a 100644 (file)
@@ -619,7 +619,7 @@ Config()
   if (useFMD) {
     //=================== FMD parameters ============================
     AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
-    AliLog::SetModuleDebugLevel("FMD", 10);
+    AliLog::SetModuleDebugLevel("FMD", 16);
   }
 
   if (useMUON) {
index 39c8cffa3a2e2bf89798b3c2927de6a9163a1175..445090512562b03ff86c4d4e9c3f202220b02e6e 100644 (file)
@@ -13,6 +13,9 @@
 #pragma link C++ class  AliFMDDigit+;
 #pragma link C++ class  AliFMDSDigit+;
 #pragma link C++ class  AliFMDMap+;
+#pragma link C++ class  AliFMDFloatMap+;
+#pragma link C++ class  AliFMDBoolMap+;
+#pragma link C++ class  AliFMDUShortMap+;
 #pragma link C++ class  AliFMD1+;
 #pragma link C++ class  AliFMD2+;
 #pragma link C++ class  AliFMD3+;
@@ -20,6 +23,8 @@
 #pragma link C++ class  AliFMDDetector+;
 #pragma link C++ class  AliFMDGeometry+;
 #pragma link C++ class  AliFMDParameters+;
+#pragma link C++ class  AliFMDCalibPedestal+;
+#pragma link C++ class  AliFMDCalibGain+;
 
 #else
 # error Not for compilation 
index 7de18d3085b83bcfdec21b0c2275e3099fdb2831..b9134995fe7a3d3ba540e5e7d61ee303e3b93c8a 100644 (file)
@@ -13,8 +13,6 @@
  
 // #pragma link C++ class  AliFMDMap<UShort_t>;
 // #pragma link C++ typedef AliFMDAdcMap;
-#pragma link C++ class  AliFMDUShortMap+;
-#pragma link C++ class  AliFMDBoolMap+;
 #pragma link C++ class  AliFMDReconstructor+;
 #pragma link C++ class  AliFMDMultAlgorithm+;
 #pragma link C++ class  AliFMDMultNaiive+;
index 54c59f460edd1eaac502475613076e255fb1b58f..002804d6640edd66f10d8d12ccc629b674e98ba2 100644 (file)
@@ -22,7 +22,7 @@ Simulate()
  AliSimulation sim;
  sim.SetConfigFile("$(ALICE)/FMD/Config.C");
  // sim.SetMakeSDigits("FMD");
// sim.SetMakeDigits("FMD");
+ sim.SetMakeDigits("FMD");
  sim.SetWriteRawData("FMD");
  // sim.SetMakeDigitsFromHits("FMD");
  sim.Run(1); 
index 5f565af3568e0d5866f56dbcb896d0216b69e410..a484c001615549422bbf6656b7c6296a96405fde 100644 (file)
@@ -4,6 +4,11 @@
 
 SRCS   =  AliFMDDigit.cxx              \
           AliFMDMap.cxx                \
+          AliFMDFloatMap.cxx           \
+          AliFMDBoolMap.cxx            \
+          AliFMDUShortMap.cxx          \
+          AliFMDCalibPedestal.cxx      \
+          AliFMDCalibGain.cxx          \
           AliFMDParameters.cxx         \
           AliFMDGeometry.cxx           \
           AliFMDRing.cxx               \
index a5da33cf9db0f05abc4baa47be4db32b874d7270..cacfcef0ed688d5b8043818be9049f800ab7f858 100644 (file)
@@ -10,9 +10,7 @@ SRCS          =  AliFMDReconstructor.cxx      \
                   AliFMDMultPoisson.cxx        \
                   AliFMDMultRegion.cxx         \
                   AliFMDMult.cxx               \
-                  AliFMDMultStrip.cxx          \
-                  AliFMDUShortMap.cxx          \
-                  AliFMDBoolMap.cxx
+                  AliFMDMultStrip.cxx          
 HDRS           =  $(SRCS:.cxx=.h)
 DHDR           := FMDrecLinkDef.h
 EINCLUDE       := $(ALICE)/RAW