]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
The patch fixes
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 May 2006 18:18:03 +0000 (18:18 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 May 2006 18:18:03 +0000 (18:18 +0000)
      * Bug in AliFMDBaseDigitizer that caused only a subset of channels
        to be digitised.
      * Made the range of ADC's be 0-1023 (10bit) rather than 0-1024.
      * Removed an old #if 1 ... #else ... #endif
      * Up-ted some debug levels
      * Fix to debug event display to show ESD data too.
      * Abstracted adding a marker in debug event display.
      * Added cut setters (via context menu too) of display cut-offs.
      * Removed CDB setup from scripts Reconstruct.C and Simulate.C
        since this is now taken care of by AliReconstruction and
        AliSimulation.
      * Some more stuff drawn for debug in DrawHitsRecs.C

Christian

14 files changed:
FMD/AliFMDBaseDigitizer.cxx
FMD/AliFMDDetector.cxx
FMD/AliFMDDisplay.cxx
FMD/AliFMDDisplay.h
FMD/AliFMDReconstructor.cxx
FMD/Reconstruct.C
FMD/Simulate.C
FMD/scripts/DisplayDigits.C [new file with mode: 0644]
FMD/scripts/DisplayESD.C [new file with mode: 0644]
FMD/scripts/DisplayRecs.C [new file with mode: 0644]
FMD/scripts/DrawDigits.C [new file with mode: 0644]
FMD/scripts/DrawHitsRecs.C
FMD/scripts/PrintCalibration.C [new file with mode: 0644]
FMD/scripts/Resolution.C [new file with mode: 0644]

index 09125edd4d9e47e8ec314680d6856521512e1b6c..30aa74df29029e4991e896644504ce3e40c76880 100644 (file)
@@ -337,8 +337,8 @@ AliFMDBaseDigitizer::SumContributions(AliFMD* fmd)
       UShort_t sector   = fmdHit->Sector();
       UShort_t strip    = fmdHit->Strip();
       Float_t  edep     = fmdHit->Edep();
-      UShort_t minstrip = param->GetMinStrip(detector, ring, sector, strip);
-      UShort_t maxstrip = param->GetMaxStrip(detector, ring, sector, strip);
+      // UShort_t minstrip = param->GetMinStrip(detector, ring, sector, strip);
+      // UShort_t maxstrip = param->GetMaxStrip(detector, ring, sector, strip);
       // Check if strip is `dead' 
       if (param->IsDead(detector, ring, sector, strip)) { 
        AliDebug(5, Form("FMD%d%c[%2d,%3d] is marked as dead", 
@@ -346,11 +346,11 @@ AliFMDBaseDigitizer::SumContributions(AliFMD* fmd)
        continue;
       }
       // Check if strip is out-side read-out range 
-      if (strip < minstrip || strip > maxstrip) {
-       AliDebug(5, Form("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]", 
-                        detector, ring, sector, strip, minstrip, maxstrip));
-       continue;
-      }
+      // if (strip < minstrip || strip > maxstrip) {
+      //   AliDebug(5, Form("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]", 
+      //                   detector,ring,sector,strip,minstrip,maxstrip));
+      //   continue;
+      // }
        
       // Give warning in case of double hit 
       if (fEdep(detector, ring, sector, strip).fEdep != 0)
@@ -473,7 +473,7 @@ AliFMDBaseDigitizer::ConvertToCount(Float_t   edep,
   AliFMDParameters* param = AliFMDParameters::Instance();
   Float_t  convF          = 1/param->GetPulseGain(detector,ring,sector,strip);
   UShort_t ped            = MakePedestal(detector,ring,sector,strip);
-  UInt_t   maxAdc         = param->GetAltroChannelSize();
+  UInt_t   maxAdc         = param->GetAltroChannelSize()-1;
   UShort_t rate           = param->GetSampleRate(detector,ring,sector,strip);
   
   // In case we don't oversample, just return the end value. 
index 82b7ef5855ec800a8e05bad9404e74b380c342e2..acde14a22fd81c604c5f421827ecad8f58227575 100644 (file)
@@ -312,7 +312,6 @@ AliFMDDetector::Detector2XYZ(Char_t   ring,
   // (x,y,z) coordinates (in global reference frame)
   AliFMDRing* r = GetRing(ring);
   if (!r) return;
-#if 1
   TGeoMatrix* m = FindTransform(ring, sector);
   if (!m) return;
   Double_t rho      = r->GetStripRadius(strip);
@@ -323,23 +322,19 @@ AliFMDDetector::Detector2XYZ(Char_t   ring,
                       + r->GetCopperThickness()
                       + r->GetChipThickness()
                       + r->GetSpacing());
-  AliDebug(10,Form("Rho %7.3f, angle %7.3f", rho, phi));
+  AliDebug(30,Form("Rho %7.3f, angle %7.3f", rho, phi));
 # define DEGRAD TMath::Pi() / 180. 
   Double_t local[]  = { rho * TMath::Cos(phi * DEGRAD), 
                        rho * TMath::Sin(phi * DEGRAD), 
                        -modThick + siThick / 2 };
   Double_t master[3];
-  AliDebug(10, Form("Local (%7.3f,%7.3f,%7.3f)",local[0], local[1], local[2]));
+  AliDebug(30, Form("Local (%7.3f,%7.3f,%7.3f)",local[0], local[1], local[2]));
   m->LocalToMaster(local, master);
-  AliDebug(10, Form("Master (%7.3f,%7.3f,%7.3f)",
+  AliDebug(30, Form("Master (%7.3f,%7.3f,%7.3f)",
                    master[0],master[1],master[2]));
   x = master[0];
   y = master[1];
   z = master[2];
-#else
-  z = GetRingZ(ring);
-  r->Detector2XYZ(sector, strip, x, y, z);
-#endif
 }
 
 //____________________________________________________________________
index 4e6f93f196715f71ffb2b1e1429cf32d8f08fc2a..d3adb92652ea667fffe05792a03a9eef677eea7e 100644 (file)
@@ -34,7 +34,7 @@
 #include "AliFMDRecPoint.h"     // ALIFMDRECPOINT_H
 #include "AliFMDGeometry.h"    // ALIFMDGEOMETRY_H
 #include "AliFMDParameters.h"  // ALIFMDPARAMETERS_H
-// #include <AliESDFMD.h>          // ALIESDFMD_H
+#include <AliESDFMD.h>          // ALIESDFMD_H
 #include <AliLog.h>
 #include <TStyle.h>
 // #include <TArrayF.h>
@@ -83,6 +83,8 @@ AliFMDDisplay::AliFMDDisplay(const char* gAliceFile)
   fMarkers->SetOwner(kTRUE);
   fHits->SetOwner(kFALSE);
   fgInstance = this;
+  SetMultiplicityCut();
+  SetPedestalFactor();
 }
 
 //____________________________________________________________________
@@ -237,6 +239,36 @@ AliFMDDisplay::LookupColor(Float_t x, Float_t max) const
   return gStyle->GetColorPalette(idx);
 }
 
+//____________________________________________________________________
+void
+AliFMDDisplay::AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
+                        TObject* o, Float_t s, Float_t max)
+{
+  // Add a marker to the display
+  //
+  //    det    Detector
+  //    rng    Ring
+  //    sec    Sector 
+  //    str    Strip
+  //    o      Object to refer to
+  //    s      Signal 
+  //    max    Maximum of signal 
+  //
+  AliFMDGeometry*   geom = AliFMDGeometry::Instance();
+  Double_t x, y, z;
+  geom->Detector2XYZ(det, rng, sec, str, x, y, z);
+  Float_t  size  = .1;
+  Float_t  zsize = s / max * 10;
+  Float_t  r     = TMath::Sqrt(x * x + y * y);
+  Float_t  theta = TMath::ATan2(r, z);
+  Float_t  phi   = TMath::ATan2(y, x);
+  Float_t  rz    = z + (z < 0 ? 1 : -1) * zsize;
+  TMarker3DBox* marker = new  TMarker3DBox(x,y,rz,size,size,zsize,theta,phi);
+  if (o) marker->SetRefObject(o);
+  marker->SetLineColor(LookupColor(s, max));
+  fMarkers->Add(marker);
+}
+  
 
 //____________________________________________________________________
 Bool_t 
@@ -248,11 +280,13 @@ AliFMDDisplay::ProcessHit(AliFMDHit* hit, TParticle* p)
 
   fHits->Add(hit);
   Float_t  size  = .1;
+  Float_t  zsize = hit->Edep() * 10;
+  Float_t  z     = hit->Z() + (hit->Z() < 0 ? 1 : -1) * zsize; 
   Float_t  pt    = TMath::Sqrt(hit->Py()*hit->Py()+hit->Px()*hit->Px());
   Float_t  theta = TMath::ATan2(pt, hit->Pz());
   Float_t  phi   = TMath::ATan2(hit->Py(), hit->Px());
-  TMarker3DBox* marker = new  TMarker3DBox(hit->X(), hit->Y(), hit->Z(),
-                                          size, size, size, theta, phi);
+  TMarker3DBox* marker = new  TMarker3DBox(hit->X(), hit->Y(), z,
+                                          size, size, zsize, theta, phi);
   marker->SetLineColor(LookupColor(hit->Edep(), 1));
   marker->SetRefObject(hit);
   fMarkers->Add(marker);
@@ -266,29 +300,19 @@ AliFMDDisplay::ProcessDigit(AliFMDDigit* digit)
   // Process a digit 
   if (!digit) { AliError("No digit");   return kFALSE; }
 
-  Double_t x, y, z;
-  AliFMDGeometry*   geom = AliFMDGeometry::Instance();
   AliFMDParameters* parm = AliFMDParameters::Instance();
-  Double_t threshold = (parm->GetPedestal(digit->Detector(), 
-                                         digit->Ring(), 
-                                         digit->Sector(), 
-                                         digit->Strip())
-                       + 4 * parm->GetPedestalWidth(digit->Detector(), 
-                                                    digit->Ring(), 
-                                                    digit->Sector(), 
-                                                    digit->Strip()));
-  if (digit->Counts() < threshold) return kTRUE;
+  UShort_t det           =  digit->Detector();
+  Char_t   ring          =  digit->Ring();
+  UShort_t sec           =  digit->Sector();
+  UShort_t str           =  digit->Strip();
+  Double_t ped           =  parm->GetPedestal(det,ring, sec, str);
+  Double_t pedW          =  parm->GetPedestalWidth(det,ring, sec, str);
+  Double_t threshold     =  ped * fPedestalFactor * pedW;
+  Float_t  counts        = digit->Counts();
+  if (counts < threshold) return kTRUE;
   fHits->Add(digit);
-  geom->Detector2XYZ(digit->Detector(), digit->Ring(), digit->Sector(), 
-                   digit->Strip(), x, y, z);
-  Float_t  size  = .1;
-  Float_t  r     = TMath::Sqrt(x * x + y * y);
-  Float_t  theta = TMath::ATan2(r, z);
-  Float_t  phi   = TMath::ATan2(y, x);
-  TMarker3DBox* marker = new  TMarker3DBox(x,y,z,size,size,size,theta,phi);
-  marker->SetRefObject(digit);
-  marker->SetLineColor(LookupColor(digit->Counts(), 1024));
-  fMarkers->Add(marker);
+
+  AddMarker(det, ring, sec, str, digit, counts, 1024);
   return kTRUE;
 }
 
@@ -306,21 +330,32 @@ AliFMDDisplay::ProcessRecPoint(AliFMDRecPoint* recpoint)
 {
   // Process reconstructed point 
   if (!recpoint) { AliError("No recpoint");   return kFALSE; }
-  if (recpoint->Particles() < .1) return kTRUE;
+  if (recpoint->Particles() < fMultCut) return kTRUE;
   fHits->Add(recpoint);
-  Double_t x, y, z;
-  AliFMDGeometry* geom = AliFMDGeometry::Instance();
-  geom->Detector2XYZ(recpoint->Detector(), recpoint->Ring(), 
-                   recpoint->Sector(),  recpoint->Strip(), x, y, z);
+  AddMarker(recpoint->Detector(), recpoint->Ring(), recpoint->Sector(),  
+           recpoint->Strip(), recpoint, recpoint->Particles(), 20);
+  return kTRUE;
+}
 
-  Float_t  size  = .1;
-  Float_t  r     = TMath::Sqrt(x * x + y * y);
-  Float_t  theta = TMath::ATan2(r, z);
-  Float_t  phi   = TMath::ATan2(y, x);
-  TMarker3DBox* marker = new  TMarker3DBox(x,y,z,size,size,size,theta,phi);
-  marker->SetRefObject(recpoint);
-  marker->SetLineColor(LookupColor(recpoint->Particles(), 20));
-  fMarkers->Add(marker);
+//____________________________________________________________________
+Bool_t 
+AliFMDDisplay::ProcessESD(AliESDFMD* esd)
+{
+  // Process event summary data
+  for (UShort_t det = 1; det <= 3; det++) {
+    Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+    for (Char_t* rng = rings; *rng != '\0'; rng++) {
+      UShort_t nsec = (*rng == 'I' ?  20 :  40);
+      UShort_t nstr = (*rng == 'O' ? 512 : 256);
+      for (UShort_t sec = 0; sec < nsec; sec++) {
+       for (UShort_t str = 0; str < nstr; str++) {
+         Float_t mult = esd->Multiplicity(det,*rng,sec,str);
+         if (mult < fMultCut) continue;
+         AddMarker(det,*rng,sec,str, 0, mult, 20);
+       }
+      }
+    }
+  }
   return kTRUE;
 }
 
index 19b627399721f73aba6b1b18d0605a4dd66907c6..3d586ae285deff021dbbe421344413571175c415 100644 (file)
@@ -88,15 +88,39 @@ public:
       @param recpoint Reconstructed point
       @return @c false on error  */
   virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
+  /** Visualize data in ESD 
+      @param esd FMD ESD data 
+      @return  Always @c true */
+  virtual Bool_t ProcessESD(AliESDFMD* esd);
   /** Look up a color index, based on the value @a x and the maximum
       value of @a x
       @param x   Value 
       @param max Maximum (for example 1023 for digits)
       @return @c false on error  */
   virtual Int_t  LookupColor(Float_t x, Float_t max)  const;
+  /** Set multiplicity cut 
+      @param cut Cut-off in multiplicity */
+  virtual void SetMultiplicityCut(Float_t c=.01) { fMultCut = c; }//*MENU*
+  /** Set pedestal width factor 
+      @param fac Factor */
+  virtual void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }//*MENU*
 protected:
+  /** Copy constructor 
+      @param o Object to copy from  */
   AliFMDDisplay(const AliFMDDisplay& o) : AliFMDInput(o) { } 
+  /** Assignment operator 
+      @return Reference to this object */
   AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; } 
+  /** Add a marker to the display
+      @param det Detector
+      @param rng Ring
+      @param sec Sector 
+      @param str Strip
+      @param o   Object to refer to
+      @param s   Signal 
+      @param max Maximum of signal */
+  void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, 
+                TObject* o, Float_t s, Float_t max);
   
   static AliFMDDisplay* fgInstance; // Static instance 
   Bool_t                fWait;      // Wait until user presses `Continue'
@@ -112,6 +136,8 @@ protected:
   Float_t               fY0;        // Y at lower left corner or range 
   Float_t               fX1;        // X at upper right corner or range 
   Float_t               fY1;        // Y at upper right corner or range 
+  Float_t               fMultCut;   // Multiplicity cut  
+  Float_t               fPedestalFactor; // ADC acceptance factor 
   Int_t                 fXPixel;    // X pixel of mark
   Int_t                 fYPixel;    // Y pixel of mark
   Int_t                 fOldXPixel; // Old x pixel of mark
index ea8e2cd4d3da80ca6663aaad5b9d7485cb9cebaa..987e819641b50f599ac5ddb2abfff5b418d6213a 100644 (file)
@@ -228,7 +228,11 @@ AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
     AliFMDParameters* param  = AliFMDParameters::Instance();
     // Check that the strip is not marked as dead 
     if (param->IsDead(digit->Detector(), digit->Ring(), 
-                     digit->Sector(), digit->Strip())) continue;
+                     digit->Sector(), digit->Strip())) {
+      AliDebug(10, Form("FMD%d%c[%2d,%3d] is dead", digit->Detector(), 
+                       digit->Ring(), digit->Sector(), digit->Strip()));
+      continue;
+    }
 
     // digit->Print();
     // Get eta and phi 
@@ -282,13 +286,13 @@ AliFMDReconstructor::SubtractPedestal(AliFMDDigit* digit) const
                                                digit->Ring(), 
                                                digit->Sector(), 
                                                digit->Strip());
-  AliDebug(10, Form("Subtracting pedestal %f from signal %d", 
+  AliDebug(15, Form("Subtracting pedestal %f from signal %d", 
                   pedM, digit->Counts()));
   if (digit->Count3() > 0)      counts = digit->Count3();
   else if (digit->Count2() > 0) counts = digit->Count2();
   else                          counts = digit->Count1();
   counts = TMath::Max(Int_t(counts - pedM), 0);
-  if (counts > 0) AliDebug(10, "Got a hit strip");
+  if (counts > 0) AliDebug(15, "Got a hit strip");
   
   return  UShort_t(counts);
 }
@@ -324,7 +328,7 @@ AliFMDReconstructor::Adc2Energy(AliFMDDigit* digit,
                                                digit->Sector(), 
                                                digit->Strip());
   Double_t          edep  = count * gain;
-  AliDebug(10, Form("Converting counts %d to energy via factor %f", 
+  AliDebug(15, Form("Converting counts %d to energy via factor %f", 
                    count, gain));
   return edep;
 }
@@ -352,7 +356,7 @@ AliFMDReconstructor::Energy2Multiplicity(AliFMDDigit* /* digit */,
   Double_t          edepMIP = param->GetEdepMip();
   Float_t           mult    = edep / edepMIP;
   if (edep > 0) 
-    AliDebug(10, Form("Translating energy %f to multiplicity via "
+    AliDebug(15, Form("Translating energy %f to multiplicity via "
                     "divider %f->%f", edep, edepMIP, mult));
   return mult;
 }
index e89c638e624b448af1b8d86d90f2414246c1eb2a..96132b6c5246bd5d17dad852d10fd9980d26ab0f 100644 (file)
 void 
 Reconstruct()
 {
-  AliCDBManager* cdb = AliCDBManager::Instance();
-  cdb->SetDefaultStorage("local://$ALICE_ROOT");
-  AliLog::SetModuleDebugLevel("FMD", 2);
+  AliLog::SetModuleDebugLevel("FMD", 1);
   AliReconstruction rec;   
-  AliCDBEntry* align = cdb->Get("FMD/Align/Data");
-  if (align) {
-    TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
-    if (array) {
-      Int_t nAlign = array->GetEntries();
-      for (Int_t i = 0; i < nAlign; i++) {
-       AliAlignObjAngles* a = static_cast<AliAlignObjAngles*>(array->At(i));
-       if (!a->ApplyToGeometry()) {
-         Warning("ApplyAlignement", "Failed to apply alignment to %s", 
-                 a->GetVolPath());
-       }
-      }
-    }
-  }
   rec.SetRunLocalReconstruction("FMD");
   rec.SetRunVertexFinder(kFALSE);
   rec.SetRunTracking(""); 
index d18d3216f820cdc3e3ab39a280a6d247ca1164e5..5273269c72d9b96ee821382a87e84a35d3e66d8e 100644 (file)
 void
 Simulate()
 {
-  AliCDBManager* cdb = AliCDBManager::Instance();
-  cdb->SetDefaultStorage("local://$ALICE_ROOT");
   AliSimulation sim;
-  AliCDBEntry* align = cdb->Get("FMD/Align/Data");
-  if (align) {
-    TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
-    if (array) sim.SetAlignObjArray(array);
-  }
-  AliLog::SetModuleDebugLevel("FMD", 2);
+  AliLog::SetModuleDebugLevel("FMD", 1);
   sim.SetConfigFile("$(ALICE_ROOT)/FMD/Config.C");
   // sim.SetMakeSDigits("FMD");
   sim.SetMakeDigits("FMD"); 
diff --git a/FMD/scripts/DisplayDigits.C b/FMD/scripts/DisplayDigits.C
new file mode 100644 (file)
index 0000000..5b293a4
--- /dev/null
@@ -0,0 +1,25 @@
+//____________________________________________________________________
+//
+// $Id$
+//
+// Draw hits in the specialised FMD event display 
+//
+/** Display hits 
+    @ingroup FMD_script
+ */
+void
+DisplayDigits()
+{
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  gSystem->Load("libFMDutil.so");
+  AliFMDDisplay* d = new AliFMDDisplay;
+  d->AddLoad(AliFMDInput::kDigits);
+  // d->AddLoad(AliFMDInput::kKinematics);
+  d->Run();
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/scripts/DisplayESD.C b/FMD/scripts/DisplayESD.C
new file mode 100644 (file)
index 0000000..a79fd6e
--- /dev/null
@@ -0,0 +1,26 @@
+//____________________________________________________________________
+//
+// $Id$
+//
+// Draw hits in the specialised FMD event display 
+//
+/** Display hits 
+    @ingroup FMD_script
+ */
+void
+DisplayESD()
+{
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  gSystem->Load("libFMDutil.so");
+  AliFMDDisplay* d = new AliFMDDisplay;
+  d->AddLoad(AliFMDInput::kESD);
+  // d->AddLoad(AliFMDInput::kDigits);
+  // d->AddLoad(AliFMDInput::kKinematics);
+  d->Run();
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/scripts/DisplayRecs.C b/FMD/scripts/DisplayRecs.C
new file mode 100644 (file)
index 0000000..7c61f00
--- /dev/null
@@ -0,0 +1,26 @@
+//____________________________________________________________________
+//
+// $Id$
+//
+// Draw hits in the specialised FMD event display 
+//
+/** Display hits 
+    @ingroup FMD_script
+ */
+void
+DisplayRecs()
+{
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  gSystem->Load("libFMDutil.so");
+  AliFMDDisplay* d = new AliFMDDisplay;
+  d->AddLoad(AliFMDInput::kRecPoints);
+  // d->AddLoad(AliFMDInput::kDigits);
+  // d->AddLoad(AliFMDInput::kKinematics);
+  d->Run();
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/scripts/DrawDigits.C b/FMD/scripts/DrawDigits.C
new file mode 100644 (file)
index 0000000..572b492
--- /dev/null
@@ -0,0 +1,73 @@
+//____________________________________________________________________
+//
+// $Id$
+//
+// Script that contains a class to draw eloss from hits, versus ADC
+// counts from digits, using the AliFMDInputHits class in the util library. 
+//
+// It draws the energy loss versus the p/(mq^2).  It can be overlayed
+// with the Bethe-Bloc curve to show how the simulation behaves
+// relative to the expected. 
+//
+// Use the script `Compile.C' to compile this class using ACLic. 
+//
+#include <TH1D.h>
+#include <AliFMDHit.h>
+#include <AliFMDDigit.h>
+#include <AliFMDInput.h>
+#include <AliFMDEdepMap.h>
+#include <iostream>
+#include <TStyle.h>
+#include <TArrayF.h>
+#include <AliLog.h>
+
+/** @class DrawDigits
+    @brief Draw hit energy loss versus digit ADC
+    @code 
+    Root> .L Compile.C
+    Root> Compile("DrawDigits.C")
+    Root> DrawDigits c
+    Root> c.Run();
+    @endcode
+    @ingroup FMD_script
+ */
+class DrawDigits : public AliFMDInput
+{
+private:
+  TH1D* fAdc; // Histogram 
+public:
+  //__________________________________________________________________
+  DrawDigits(Int_t m=1100, Double_t amin=-0.5, Double_t amax=1099.5) 
+  { 
+    AddLoad(kDigits);
+    fAdc = new TH1D("adc", "ADC", m, amin, amax);
+    fAdc->SetXTitle("ADC value");
+  }
+  //__________________________________________________________________
+  Bool_t ProcessDigit(AliFMDDigit* digit)
+  {
+    if (!digit) return kTRUE;
+    fAdc->Fill(digit->Counts());
+    return kTRUE;
+  }
+  //__________________________________________________________________
+  Bool_t Finish()
+  {
+    gStyle->SetPalette(1);
+    gStyle->SetOptTitle(0);
+    gStyle->SetCanvasColor(0);
+    gStyle->SetCanvasBorderSize(0);
+    gStyle->SetPadColor(0);
+    gStyle->SetPadBorderSize(0);
+    fAdc->SetStats(kFALSE);
+    fAdc->Draw();
+    return kTRUE;
+  }
+
+  ClassDef(DrawDigits,0);
+};
+
+//____________________________________________________________________
+//
+// EOF
+//
index f12cc89c96368c60e4d7b348ae4b2de78800b781..9a000e2e4895e086df152f257d05c761be3ac5a5 100644 (file)
@@ -13,9 +13,8 @@
 //
 #include <TH2D.h>
 #include <AliFMDHit.h>
-#include <AliFMDMultStrip.h>
-#include <AliFMDMultRegion.h>
 #include <AliFMDDigit.h>
+#include <AliFMDRecPoint.h>
 #include <AliFMDInput.h>
 #include <AliFMDEdepMap.h>
 #include <AliFMDFloatMap.h>
     @endcode
     @ingroup FMD_script
  */
-class DrawHitsRecs : public AliFMDInputHits
+class DrawHitsRecs : public AliFMDInput
 {
 private:
-  TH2D* fElossVsMult; // Histogram 
-  TH2D* fHitsVsStrip;  // Histogram 
-  TH2D* fHitsVsRegion;  // Histogram 
-  AliFMDEdepMap fMap;
+  TH2D* fHitEvsAdc;
+  TH2D* fHitEvsRecM;  // Histogram 
+  TH2D* fHitEvsRecE;  // Histogram 
+  TH1D* fDiffE;       // Histogram 
+  TH2D* fHitsVsRecM;  // Histogram 
+  AliFMDEdepMap  fMap;
   AliFMDFloatMap fEta;
   AliFMDFloatMap fPhi;
   AliFMDFloatMap fMult;
@@ -73,25 +74,41 @@ public:
     fPrimary = primary;
     AddLoad(kRecPoints);
     AddLoad(kHits);
+    AddLoad(kDigits);
     if (fPrimary) AddLoad(kKinematics);
     TArrayF eloss(MakeLogScale(n, emin, emax));
     TArrayF mults(m+1);
     mults[0] = mmin;
     for (Int_t i = 1; i < m+1; i++) mults[i] = mults[i-1] + (mmax-mmin)/m;
-    fElossVsMult = new TH2D("elossVsMult", 
-                           "#Delta E vs. Multiplicity (single)", 
+
+    fHitEvsAdc  = new TH2D("hitEvsAdc", "#Delta E_{sim} vs. ADC",
+                          n, emin, emax, 1025, -.5, 1024.5);
+    fHitEvsAdc->SetXTitle("#Delta E_{sim} [MeV]");
+    fHitEvsAdc->SetYTitle("ADC");
+    
+    fHitEvsRecM = new TH2D("hitEvsRecM", "#Delta E_{sim} vs. M_{rec}", 
                           eloss.fN-1, eloss.fArray, mults.fN-1, mults.fArray);
-    fElossVsMult->SetXTitle("#Delta E/#Delta x [MeV/cm]");
-    fElossVsMult->SetYTitle("Strip Multiplicity");
+    fHitEvsRecM->SetXTitle("#Delta E_{sim} [MeV]");
+    fHitEvsRecM->SetYTitle("M_{rec}");
+
+    fHitEvsRecE = new TH2D("hitEvsRecE", "#Delta E_{sim} vs. #Delta E_{rec}", 
+                           n, emin, emax, n, emin, emax);
+    fHitEvsRecE->SetXTitle("#Delta E_{sim} [MeV]");
+    fHitEvsRecE->SetYTitle("#Delta E_{rec} [MeV]");
 
+
+    fDiffE = new TH1D("diffE", 
+                     "#frac{#Delta E_{sim}-#Delta E_{rec}}{#Delta E_{sim}}", 
+                     1100, -1, 1.1);
+    fDiffE->SetXTitle("#frac{#Delta E_{sim}-#Delta E_{rec}}{#Delta E_{sim}}");
+    
     Double_t omin = -.5;
     Double_t omax = 7.5;
     Int_t    o    = 8;
-    fHitsVsStrip = new TH2D("hitsVsStrip", 
-                           "# of Hits vs. Multiplicity (strip)",
+    fHitsVsRecM = new TH2D("hitsVsStrip", "# of Hits vs. M_{rec}",
                           o, omin, omax, m, mmin, mmax);
-    fHitsVsStrip->SetXTitle("# of Hits");
-    fHitsVsStrip->SetYTitle("Strip Multiplicity");
+    fHitsVsRecM->SetXTitle("# of Hits");
+    fHitsVsRecM->SetYTitle("M_{rec}");
   }
   //__________________________________________________________________
   /** Begining of event
@@ -100,7 +117,7 @@ public:
   Bool_t Begin(Int_t ev) 
   {
     fMap.Reset();
-    return AliFMDInputHits::Begin(ev);
+    return AliFMDInput::Begin(ev);
   }
   //__________________________________________________________________
   Bool_t ProcessHit(AliFMDHit* hit, TParticle*) 
@@ -125,24 +142,46 @@ public:
     fMap(det, rng, sec, str).fN++;
     return kTRUE;
   }
+
+  //__________________________________________________________________
+  Bool_t ProcessDigit(AliFMDDigit* digit)
+  {
+    if (!digit) return kTRUE;
+
+    UShort_t det = digit->Detector();
+    Char_t   rng = digit->Ring();
+    UShort_t sec = digit->Sector();
+    UShort_t str = digit->Strip();
+    if (str > 511) {
+      AliWarning(Form("Bad strip number %d in digit", str));
+      return kTRUE;
+    }
+    Double_t edep = fMap(det, rng, sec, str).fEdep;
+    if (edep > 0) fHitEvsAdc->Fill(edep, digit->Counts());
+      
+    return kTRUE;
+  }
+
   //__________________________________________________________________
   Bool_t ProcessRecPoint(AliFMDRecPoint* single) 
   {
-    if (!single) continue;
+    if (!single) return kTRUE;
     UShort_t det = single->Detector();
     Char_t   rng = single->Ring();
     UShort_t sec = single->Sector();
     UShort_t str = single->Strip();
     if (str > 511) {
       AliWarning(Form("Bad strip number %d in single", str));
-      continue;
+      return kTRUE;
+    }
+    Double_t edep = fMap(det, rng, sec, str).fEdep;
+    Int_t    nhit = fMap(det, rng, sec, str).fN;
+    if (edep > 0) {
+      fHitEvsRecM->Fill(edep, single->Particles());
+      fHitEvsRecE->Fill(edep, single->Edep());
+      fDiffE->Fill((single->Edep() - edep) / edep);
     }
-    if (fMap(det, rng, sec, str).fEdep > 0) 
-      fElossVsMult->Fill(fMap(det, rng, sec, str).fEdep, 
-                        single->Particles());
-    if (fMap(det, rng, sec, str).fN > 0) 
-      fHitsVsStrip->Fill(fMap(det, rng, sec, str).fN, 
-                        single->Particles());
+    if (nhit > 0) fHitsVsRecM->Fill(nhit, single->Particles());
     return kTRUE;
   }
   //__________________________________________________________________
@@ -155,13 +194,24 @@ public:
     gStyle->SetPadColor(0);
     gStyle->SetPadBorderSize(0);
 
-    new TCanvas("c1", "Energy loss vs. Strip Multiplicity");
-    fElossVsMult->SetStats(kFALSE);
-    fElossVsMult->Draw("COLZ");
+    new TCanvas("c0", fHitEvsAdc->GetTitle());
+    fHitEvsAdc->SetStats(kFALSE);
+    fHitEvsAdc->Draw("COLZ");
+
+    new TCanvas("c1", fHitEvsRecM->GetTitle());
+    fHitEvsRecM->SetStats(kFALSE);
+    fHitEvsRecM->Draw("COLZ");
+
+    new TCanvas("c2", fHitEvsRecE->GetTitle());
+    fHitEvsRecE->SetStats(kFALSE);
+    fHitEvsRecE->Draw("COLZ");
+
+    new TCanvas("c3", fDiffE->GetTitle());
+    fDiffE->Draw();
 
-    new TCanvas("c2", "# of Hits vs. Strip Multiplicity");
-    fHitsVsStrip->SetStats(kFALSE);
-    fHitsVsStrip->Draw("COLZ");
+    new TCanvas("c4", fHitsVsRecM->GetTitle());
+    fHitsVsRecM->SetStats(kFALSE);
+    fHitsVsRecM->Draw("COLZ");
 
     return kTRUE;
   }
diff --git a/FMD/scripts/PrintCalibration.C b/FMD/scripts/PrintCalibration.C
new file mode 100644 (file)
index 0000000..0c0a112
--- /dev/null
@@ -0,0 +1,29 @@
+//____________________________________________________________________
+//
+// $Id$
+//
+// Make fake alignment data.
+//
+/** @file    PrintCalibration.C
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Sun Mar 26 17:58:27 2006
+    @brief   Make fake calibration data.
+*/
+/** Make fake calibration data 
+    @ingroup simple_script
+ */
+void
+PrintCalibration()
+{
+  AliCDBManager* cdb   = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  cdb->SetRun(0);
+  AliFMDParameters* p = AliFMDParameters::Instance();
+  p->Init();
+  p->Print("fmd1I[0,0]");
+  p->Draw("pedestal");
+}
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/scripts/Resolution.C b/FMD/scripts/Resolution.C
new file mode 100644 (file)
index 0000000..68dacff
--- /dev/null
@@ -0,0 +1,35 @@
+void
+res(Char_t i)
+{
+  Double_t pitch  = (i == 'I' ?  0.025 :  0.048);
+  Double_t open   = (i == 'I' ? 18.0   :  9.0  ) / 180 * TMath::Pi();
+  Double_t rmin   = (i == 'I' ?  4.3   : 15.6  );
+  Double_t rmax   = (i == 'I' ? 17.2   : 28.0  );
+  Double_t phimin = 0;
+  Double_t phimax = 2 * TMath::Pi();
+  TF2* xres = new TF2("xres", "sqrt(pow(cos(x),2)*[0]+y*y*pow(sin(x),2)*[1])",
+                     phimin,phimax,rmin,rmax);
+  TF2* yres = new TF2("yres", "sqrt(pow(sin(x),2)*[0]+y*y*pow(cos(x),2)*[1])",
+                     phimin,phimax,rmin,rmax);
+  xres->SetParameters(pitch*pitch, open*open); 
+  yres->SetParameters(pitch*pitch, open*open);
+  xres->GetHistogram()->SetXTitle("#phi [radians]");
+  xres->GetHistogram()->SetYTitle("r [cm]");
+  xres->GetHistogram()->SetZTitle("#delta x [cm]");
+  yres->GetHistogram()->SetXTitle("#phi [radians]");
+  yres->GetHistogram()->SetYTitle("r [cm]");
+  yres->GetHistogram()->SetZTitle("#delta y [cm]");
+  xres->SetLineColor(i == 'I' ? 2 : 6);
+  yres->SetLineColor(i == 'I' ? 3 : 7);
+  gStyle->SetOptTitle(0);
+  gStyle->SetOptStat(0);
+  xres->Draw("surf");
+  yres->Draw("same surf");
+
+  TLegend* l = new TLegend(.7,.8,.95,.95, i == 'I' ? "Inner" : "Outer");
+  l->SetBorderSize(0);
+  l->AddEntry(xres, "#delta x", "l");
+  l->AddEntry(yres, "#delta y", "l");
+  l->Draw();
+}
+