]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix bug introduced when charge units changed
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Mar 2010 18:01:26 +0000 (18:01 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Mar 2010 18:01:26 +0000 (18:01 +0000)
from ADC channels to femto coulomb (Javier, Sanjoy, Laurent)

13 files changed:
MUON/AliMUONClusterFinderCOG.cxx
MUON/AliMUONClusterFinderMLEM.cxx
MUON/AliMUONClusterFinderMLEM.h
MUON/AliMUONClusterFinderPeakCOG.cxx
MUON/AliMUONClusterFinderPeakFit.cxx
MUON/AliMUONClusterFinderSimpleFit.cxx
MUON/AliMUONClusterFinderSimpleFit.h
MUON/AliMUONClusterSplitterMLEM.cxx
MUON/AliMUONClusterSplitterMLEM.h
MUON/AliMUONRecoParam.cxx
MUON/AliMUONRecoParam.h
MUON/AliMUONSimpleClusterServer.cxx
MUON/AliMUONVClusterFinder.h

index 274fcac294a928be46ef87c4e935e43acfe363f2..8657b746c08c7ac59a819d83d19f23e29fad97f4 100644 (file)
@@ -82,7 +82,7 @@ AliMUONClusterFinderCOG::NextCluster()
   {
     ComputePosition(*cluster);
 
-    if ( cluster->Charge() < 7 )
+    if ( cluster->Charge() < 1.0675 ) // JC: adc -> fc
     {
       // skip that one
       return NextCluster();
index 060a13ab56f4fc2977a4cf6ecf13fb5295941136..6596734d2fdf9fa140729e5c963498029965a391 100644 (file)
@@ -51,8 +51,6 @@
 ClassImp(AliMUONClusterFinderMLEM)
 /// \endcond
  
-const Double_t AliMUONClusterFinderMLEM::fgkZeroSuppression = 6; // average zero suppression value
-//const Double_t AliMUONClusterFinderMLEM::fgkDistancePrecision = 1e-6; // (cm) used to check overlaps and so on
 const Double_t AliMUONClusterFinderMLEM::fgkDistancePrecision = 1e-3; // (cm) used to check overlaps and so on
 const TVector2 AliMUONClusterFinderMLEM::fgkIncreaseSize(-AliMUONClusterFinderMLEM::fgkDistancePrecision,-AliMUONClusterFinderMLEM::fgkDistancePrecision);
 const TVector2 AliMUONClusterFinderMLEM::fgkDecreaseSize(AliMUONClusterFinderMLEM::fgkDistancePrecision,AliMUONClusterFinderMLEM::fgkDistancePrecision);
@@ -81,7 +79,10 @@ fDebug(0),
 fPlot(plot),
 fSplitter(0x0),
 fNClusters(0),
-fNAddVirtualPads(0)
+fNAddVirtualPads(0),
+fLowestPixelCharge(0),
+fLowestPadCharge(0),
+fLowestClusterCharge(0)
 {
   /// Constructor
 
@@ -121,7 +122,11 @@ AliMUONClusterFinderMLEM::Prepare(Int_t detElemId,
   fDetElemId = detElemId;
   
   delete fSplitter;
-  fSplitter = new AliMUONClusterSplitterMLEM(fDetElemId,fPixArray);
+  fSplitter = new AliMUONClusterSplitterMLEM(fDetElemId,
+                                             fPixArray,
+                                             fLowestPixelCharge,
+                                             fLowestPadCharge,
+                                             fLowestClusterCharge);
   fSplitter->SetDebug(fDebug);
     
   // find out current event number, and reset the cluster number
@@ -299,7 +304,7 @@ AliMUONClusterFinderMLEM::CheckPrecluster(const AliMUONCluster& origCluster)
 
   // Disregard small clusters (leftovers from splitting or noise)
   if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
-      origCluster.Charge(0)+origCluster.Charge(1) < 10) 
+      origCluster.Charge(0)+origCluster.Charge(1) < fLowestClusterCharge )
   { 
     return 0x0;
   }
@@ -369,8 +374,7 @@ AliMUONClusterFinderMLEM::CheckPreclusterTwoCathodes(AliMUONCluster* cluster)
       fkSegmentation[cath1]->PadByPosition(pad->Position().X(),
                                            pad->Position().Y(),kFALSE);
       if (!mpPad.IsValid()) continue;
-      //if (nFlags == 1 && pad->Charge() < fgkZeroSuppression * 3) continue;
-      if (nFlags == 1 && pad->Charge() < 20) continue;
+      if (nFlags == 1 && pad->Charge() < fLowestPadCharge) continue; 
       AliDebug(2,Form("Releasing the following pad : de,cath,ix,iy %d,%d,%d,%d charge %e",
                       fDetElemId,pad->Cathode(),pad->Ix(),pad->Iy(),pad->Charge()));
       toBeRemoved.AddLast(pad);
@@ -843,10 +847,11 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
   {
     ++lc;
     delete fHistMlem;
+    fHistMlem = 0x0;
     
     AliDebug(2,Form("lc %d nPix %d(%d) npadTot %d npadOK %d",lc,nPix,fPixArray->GetLast()+1,npadTot,npadOK));
     AliDebug(2,Form("EVT%d PixArray=",fEventNumber));
-    //StdoutToAliDebug(2,fPixArray->Print("","full"));
+    //StdoutToAliDebug(2,fPixArray->Print("full"));
         
     coef = new Double_t [npadTot*nPix];
     probi = new Double_t [nPix];
@@ -896,6 +901,10 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
                     xylim[0],-xylim[1],xylim[2],-xylim[3]
                     ));
     
+    AliDebug(2,Form("LowestPadCharge=%e",fLowestPadCharge));
+    
+    delete fHistMlem;
+    
     fHistMlem = new TH2D("mlem","mlem",nx,xylim[0],-xylim[1],ny,xylim[2],-xylim[3]);
 
     for (Int_t ipix = 0; ipix < nPix; ++ipix) 
@@ -911,7 +920,7 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
       qTot += Pixel(i)->Charge();
     }
     
-    if ( qTot < 1.e-4 || ( npadOK < 3 && qTot < 7 ) ) 
+    if ( qTot < 1.e-4 || ( npadOK < 3 && qTot < fLowestClusterCharge ) )
     {
       AliDebug(1,Form("Deleting the above cluster (charge %e too low, npadOK=%d)",qTot,npadOK));
       delete [] coef; 
@@ -948,7 +957,7 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
     fPixArray->Sort();
     MaskPeaks(0); // unmask local maxima
     Double_t pixMin = 0.01*Pixel(0)->Charge();
-    pixMin = TMath::Min(pixMin,50.);
+    pixMin = TMath::Min(pixMin,100*fLowestPixelCharge);
 
     // Decrease pixel size and shift pixels to make them centered at 
     // the maximum one
@@ -974,7 +983,7 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
       {
         if (!i) 
         {
-          pixPtr2->SetCharge(10);
+          pixPtr2->SetCharge(fLowestPadCharge);
           pixPtr2->SetSize(indx, pixPtr2->Size(indx)/2);
           width = -pixPtr2->Size(indx);
           pixPtr2->Shift(indx, width);
@@ -1054,8 +1063,8 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
 
   // remove pixels with low signal or low visibility
   // Cuts are empirical !!!
-  Double_t thresh = TMath::Max (fHistMlem->GetMaximum()/100.,1.);
-  thresh = TMath::Min (thresh,50.);
+  Double_t thresh = TMath::Max (fHistMlem->GetMaximum()/100.,2.0*fLowestPixelCharge);
+  thresh = TMath::Min (thresh,100.0*fLowestPixelCharge);
   Double_t charge = 0;
 
   // Mark pixels which should be removed
@@ -1099,7 +1108,7 @@ Bool_t AliMUONClusterFinderMLEM::MainLoop(AliMUONCluster& cluster, Int_t iSimple
 
   // Try to split into clusters
   Bool_t ok = kTRUE;
-  if (fHistMlem->GetSum() < 1
+  if (fHistMlem->GetSum() < 2.0*fLowestPixelCharge
   {
     ok = kFALSE;
   }
@@ -1298,7 +1307,7 @@ Int_t AliMUONClusterFinderMLEM::FindNearest(const AliMUONPad *pixPtr0)
 
   for (Int_t i = 0; i < nPix; ++i) {
     pixPtr = (AliMUONPad*) fPixArray->UncheckedAt(i);
-    if (pixPtr == pixPtr0 || pixPtr->Charge() < 0.5) continue;
+    if (pixPtr == pixPtr0 || pixPtr->Charge() < fLowestPixelCharge) continue;
     dx = (xc - pixPtr->Coord(0)) / pixPtr->Size(0);
     dy = (yc - pixPtr->Coord(1)) / pixPtr->Size(1);
     r = dx *dx + dy * dy;
@@ -1403,7 +1412,7 @@ Int_t AliMUONClusterFinderMLEM::FindLocalMaxima(TObjArray *pixArray, Int_t *loca
   for (Int_t i = 1; i <= ny; ++i) {
     indx = (i-1) * nx;
     for (Int_t j = 1; j <= nx; ++j) {
-      if (fHistAnode->GetCellContent(j,i) < 0.5) continue;
+      if (fHistAnode->GetCellContent(j,i) < fLowestPixelCharge) continue;
       //if (isLocalMax[indx+j-1] < 0) continue;
       if (isLocalMax[indx+j-1] != 0) continue;
       FlagLocalMax(fHistAnode, i, j, isLocalMax);
@@ -1553,7 +1562,7 @@ AliMUONClusterFinderMLEM::AddBinSimple(TH2D *hist, Int_t ic, Int_t jc)
     for (Int_t j = TMath::Max(jc-1,1); j <= je; ++j) {
       cont1 = hist->GetCellContent(j,i);
       if (cont1 > cont) continue;
-      if (cont1 < 0.5) continue;
+      if (cont1 < fLowestPixelCharge) continue;
       pixPtr = new AliMUONPad (hist->GetXaxis()->GetBinCenter(j), 
                               hist->GetYaxis()->GetBinCenter(i), 0, 0, cont1);
       fPixArray->Add(pixPtr);
@@ -1673,10 +1682,10 @@ void AliMUONClusterFinderMLEM::AddVirtualPad(AliMUONCluster& cluster)
       AliMUONPad muonPad(fDetElemId, nonb[inb], mppad.GetIx(), mppad.GetIy(), 
                         mppad.GetPositionX(), mppad.GetPositionY(), 
                         mppad.GetDimensionX(), mppad.GetDimensionY(), 0);
-      if (inb == 0) muonPad.SetCharge(TMath::Min (amax[j]/100, 5.));
+      if (inb == 0) muonPad.SetCharge(TMath::Min (amax[j]/100, fLowestPadCharge));
       //else muonPad.SetCharge(TMath::Min (amax[j]/15, fgkZeroSuppression));
-      else muonPad.SetCharge(TMath::Min (amax[j]/15, 6.));
-      if (muonPad.Charge() < 1.) muonPad.SetCharge(1.);
+      else muonPad.SetCharge(TMath::Min (amax[j]/15, fLowestPadCharge));
+      if (muonPad.Charge() < 2.0*fLowestPixelCharge) muonPad.SetCharge(2.0*fLowestPixelCharge);
       muonPad.SetReal(kFALSE);
       if (fDebug) printf(" ***** Add virtual pad in %d direction ***** %f %f %f %3d %3d %f %f \n",
                         inb, muonPad.Charge(), muonPad.X(), muonPad.Y(), muonPad.Ix(), 
@@ -1770,4 +1779,14 @@ AliMUONClusterFinderMLEM::Print(Option_t* what) const
   }
 }
 
+//_____________________________________________________________________________
+void 
+AliMUONClusterFinderMLEM::SetChargeHints(Double_t lowestPadCharge, Double_t lowestClusterCharge)
+{
+  /// Set some thresholds we use later on in the algorithm
+  fLowestPadCharge=lowestPadCharge;
+  fLowestClusterCharge=lowestClusterCharge;
+  fLowestPixelCharge=fLowestPadCharge/12.0; 
+}
+
 
index 35b9296805517946c48f108cbd6845790df66f36..40178dd0c300a9a1840eabff9addc4ab8285901c 100644 (file)
@@ -46,6 +46,8 @@ public:
   
   virtual AliMUONCluster* NextCluster();
   
+  virtual void SetChargeHints(Double_t lowestPadCharge, Double_t lowestClusterCharge);
+  
   virtual void Print(Option_t* opt="") const;
 
   virtual void Paint(Option_t* opt="");
@@ -126,7 +128,6 @@ private:
   static const Int_t fgkCoupled; ///< coupled pad  
       
   // Some constants
-  static const Double_t fgkZeroSuppression; ///< average zero suppression value
   static const Double_t fgkDistancePrecision; ///< used to check overlaps and so on
   static const TVector2 fgkIncreaseSize; ///< idem
   static const TVector2 fgkDecreaseSize; ///< idem
@@ -156,6 +157,10 @@ private:
   Int_t fNClusters; //!< total number of clusters
   Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads
   
+  Double_t fLowestPixelCharge; //!< see AliMUONRecoParam
+  Double_t fLowestPadCharge; //!< see AliMUONRecoParam
+  Double_t fLowestClusterCharge; //!< see AliMUONRecoParam
+  
   ClassDef(AliMUONClusterFinderMLEM,0) // cluster finder in MUON arm of ALICE
 };
 
index c6b80f25fb8b33f5e85808bfa8b2a9597963424c..c8c6acbd4cdfd1c792206c61dd441751849a9d93 100644 (file)
@@ -99,7 +99,8 @@ AliMUONClusterFinderPeakCOG::~AliMUONClusterFinderPeakCOG()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderPeakCOG::Prepare(Int_t detElemId, TClonesArray* pads[2],
-                                    const AliMpArea& area, const AliMpVSegmentation* seg[2])
+                                     const AliMpArea& area, 
+                                     const AliMpVSegmentation* seg[2])
 {
   /// Prepare for clustering
 //  AliCodeTimerAuto("",0)
@@ -254,7 +255,7 @@ AliMUONClusterFinderPeakCOG::CheckPrecluster(const AliMUONCluster& origCluster)
 
   // Disregard small clusters (leftovers from splitting or noise)
   if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
-      origCluster.Charge(0)+origCluster.Charge(1) < 10) 
+      origCluster.Charge(0)+origCluster.Charge(1) < 1.525) // JC: adc -> fc
   { 
     return 0x0;
   }
@@ -324,7 +325,7 @@ AliMUONClusterFinderPeakCOG::CheckPreclusterTwoCathodes(AliMUONCluster* cluster)
         = fkSegmentation[cath1]->PadByPosition(pad->Position().X(),pad->Position().Y(),kFALSE);
       if (!mpPad.IsValid()) continue;
       //if (nFlags == 1 && pad->Charge() < fgkZeroSuppression * 3) continue;
-      if (nFlags == 1 && pad->Charge() < 20) continue;
+      if (nFlags == 1 && pad->Charge() < 3.05) continue; // JC: adc -> fc
       AliDebug(2,Form("Releasing the following pad : de,cath,ix,iy %d,%d,%d,%d charge %e",
                       fDetElemId,pad->Cathode(),pad->Ix(),pad->Iy(),pad->Charge()));
       toBeRemoved.AddLast(pad);
@@ -598,12 +599,12 @@ void AliMUONClusterFinderPeakCOG::BuildPixArrayOneCathode(AliMUONCluster& cluste
   for (Int_t i = 1; i <= nbins[0]; ++i) {
     Double_t x = xaxis->GetBinCenter(i);
     for (Int_t j = 1; j <= nbins[1]; ++j) {
-      if (hist2->GetCellContent(i,j) < 0.1) continue;
+      if (hist2->GetCellContent(i,j) < 0.01525) continue; // JC: adc -> fc
       if (cath0 != cath1) {
        // Two-sided cluster
        Double_t cont = hist2->GetCellContent(i,j);
        if (cont < 999.) continue;
-       if (cont-Int_t(cont/1000.)*1000. < 0.5) continue;
+       if (cont-Int_t(cont/1000.)*1000. < 0.07625) continue; // JC: adc -> fc
       }
       //if (hist2->GetCellContent(i,j) < 1.1 && cluster.Multiplicity(0) && 
       //  cluster.Multiplicity(1)) continue;
@@ -649,9 +650,9 @@ void AliMUONClusterFinderPeakCOG::PadOverHist(Int_t idir, Int_t ix0, Int_t iy0,
     else {
       // Fill histogram
       Double_t cont = pad->Charge();
-      if (hist2->GetCellContent(ix0, ixy) > 0.1) 
+      if (hist2->GetCellContent(ix0, ixy) > 0.01525) // JC: adc -> fc
        cont = TMath::Min (hist1->GetCellContent(ix0, ixy), cont) 
-            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1, 10.);
+            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1, 1.525); // JC: adc -> fc
       hist1->SetCellContent(ix0, ixy, cont);
       hist2->SetCellContent(ix0, ixy, hist2->GetCellContent(ix0, ixy)+amask);
     }
@@ -666,9 +667,9 @@ void AliMUONClusterFinderPeakCOG::PadOverHist(Int_t idir, Int_t ix0, Int_t iy0,
     else {
       // Fill histogram
       Double_t cont = pad->Charge();
-      if (hist2->GetCellContent(ix0, ixy) > 0.1) 
+      if (hist2->GetCellContent(ix0, ixy) > 0.01525) // JC: adc -> fc
        cont = TMath::Min (hist1->GetCellContent(ix0, ixy), cont)
-            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1,10.);
+            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1,1.525);  // JC: adc -> fc
       hist1->SetCellContent(ix0, ixy, cont);
       hist2->SetCellContent(ix0, ixy, hist2->GetCellContent(ix0, ixy)+amask);
     }
@@ -717,7 +718,7 @@ Int_t AliMUONClusterFinderPeakCOG::FindLocalMaxima(TObjArray *pixArray, Int_t *l
   for (Int_t i = 1; i <= ny; ++i) {
     indx = (i-1) * nx;
     for (Int_t j = 1; j <= nx; ++j) {
-      if (fHistAnode->GetCellContent(j,i) < 0.5) continue;
+      if (fHistAnode->GetCellContent(j,i) < 0.07625) continue; // JC: adc -> fc
       //if (isLocalMax[indx+j-1] < 0) continue;
       if (isLocalMax[indx+j-1] != 0) continue;
       FlagLocalMax(fHistAnode, i, j, isLocalMax);
@@ -893,7 +894,7 @@ void AliMUONClusterFinderPeakCOG::FindCluster(AliMUONCluster& cluster,
   }
 
   //qAver = TMath::Sqrt(qAver);
-  if ( qAver >= 14 )
+  if ( qAver >= 2.135 ) // JC: adc -> fc
   {
     
     AliMUONCluster* cluster1 = new AliMUONCluster(cluster);
index 24a488104ee84aa1c7ec89a8e96fad1abdd0e0c3..269054766920ca22ff5fde3173f2bf2554b3b68f 100644 (file)
@@ -171,7 +171,8 @@ AliMUONClusterFinderPeakFit::~AliMUONClusterFinderPeakFit()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderPeakFit::Prepare(Int_t detElemId, TClonesArray* pads[2],
-                                    const AliMpArea& area, const AliMpVSegmentation* seg[2])
+                                     const AliMpArea& area, 
+                                     const AliMpVSegmentation* seg[2])
 {
   /// Prepare for clustering
 //  AliCodeTimerAuto("",0)
@@ -350,7 +351,7 @@ AliMUONClusterFinderPeakFit::CheckPrecluster(const AliMUONCluster& origCluster)
 
   // Disregard small clusters (leftovers from splitting or noise)
   if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
-      origCluster.Charge(0)+origCluster.Charge(1) < 10) 
+      origCluster.Charge(0)+origCluster.Charge(1) < 1.525) // JC: adc -> fc
   { 
     return 0x0;
   }
@@ -420,7 +421,7 @@ AliMUONClusterFinderPeakFit::CheckPreclusterTwoCathodes(AliMUONCluster* cluster)
         = fkSegmentation[cath1]->PadByPosition(pad->Position().X(),pad->Position().Y(),kFALSE);
       if (!mpPad.IsValid()) continue;
       //if (nFlags == 1 && pad->Charge() < fgkZeroSuppression * 3) continue;
-      if (nFlags == 1 && pad->Charge() < 20) continue;
+      if (nFlags == 1 && pad->Charge() < 3.05) continue;  // JC: adc -> fc
       AliDebug(2,Form("Releasing the following pad : de,cath,ix,iy %d,%d,%d,%d charge %e",
                       fDetElemId,pad->Cathode(),pad->Ix(),pad->Iy(),pad->Charge()));
       toBeRemoved.AddLast(pad);
@@ -714,12 +715,12 @@ void AliMUONClusterFinderPeakFit::BuildPixArrayOneCathode(AliMUONCluster& cluste
   for (Int_t i = 1; i <= nbins[0]; ++i) {
     Double_t x = xaxis->GetBinCenter(i);
     for (Int_t j = 1; j <= nbins[1]; ++j) {
-      if (hist2->GetCellContent(i,j) < 0.1) continue;
+      if (hist2->GetCellContent(i,j) < 0.01525) continue; // JC: adc -> fc
       if (cath0 != cath1) {
        // Two-sided cluster
        Double_t cont = hist2->GetCellContent(i,j);
        if (cont < 999.) continue;
-       if (cont-Int_t(cont/1000.)*1000. < 0.5) continue;
+       if (cont-Int_t(cont/1000.)*1000. < 0.07625) continue; // JC: adc -> fc
       }
       //if (hist2->GetCellContent(i,j) < 1.1 && cluster.Multiplicity(0) && 
       //  cluster.Multiplicity(1)) continue;
@@ -765,9 +766,9 @@ void AliMUONClusterFinderPeakFit::PadOverHist(Int_t idir, Int_t ix0, Int_t iy0,
     else {
       // Fill histogram
       Double_t cont = pad->Charge();
-      if (hist2->GetCellContent(ix0, ixy) > 0.1) 
+      if (hist2->GetCellContent(ix0, ixy) > 0.01525) // JC: adc -> fc
        cont = TMath::Min (hist1->GetCellContent(ix0, ixy), cont) 
-            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1, 10.);
+            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1, 1.525); // JC: adc -> fc
       hist1->SetCellContent(ix0, ixy, cont);
       hist2->SetCellContent(ix0, ixy, hist2->GetCellContent(ix0, ixy)+amask);
     }
@@ -782,9 +783,9 @@ void AliMUONClusterFinderPeakFit::PadOverHist(Int_t idir, Int_t ix0, Int_t iy0,
     else {
       // Fill histogram
       Double_t cont = pad->Charge();
-      if (hist2->GetCellContent(ix0, ixy) > 0.1) 
+      if (hist2->GetCellContent(ix0, ixy) > 0.01525) // JC: adc -> fc 
        cont = TMath::Min (hist1->GetCellContent(ix0, ixy), cont)
-            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1,10.);
+            + TMath::Min (TMath::Max(hist1->GetCellContent(ix0, ixy),cont)*0.1,1.525); // JC: adc -> fc
       hist1->SetCellContent(ix0, ixy, cont);
       hist2->SetCellContent(ix0, ixy, hist2->GetCellContent(ix0, ixy)+amask);
     }
@@ -833,7 +834,7 @@ Int_t AliMUONClusterFinderPeakFit::FindLocalMaxima(TObjArray *pixArray, Int_t *l
   for (Int_t i = 1; i <= ny; ++i) {
     indx = (i-1) * nx;
     for (Int_t j = 1; j <= nx; ++j) {
-      if (fHistAnode->GetCellContent(j,i) < 0.5) continue;
+      if (fHistAnode->GetCellContent(j,i) < 0.07625) continue;  // JC: adc -> fc
       //if (isLocalMax[indx+j-1] < 0) continue;
       if (isLocalMax[indx+j-1] != 0) continue;
       FlagLocalMax(fHistAnode, i, j, isLocalMax);
@@ -965,7 +966,7 @@ void AliMUONClusterFinderPeakFit::FindClusterFit(AliMUONCluster& cluster, const
     err[indx] = fitter->GetParError(indx);
     err[indx+1] = fitter->GetParError(indx+1);
       
-    if ( coef*qTot >= 14 )
+    if ( coef*qTot >= 2.135 ) // JC: adc -> fc
     {
       AliMUONCluster* cluster1 = new AliMUONCluster(cluster);
       
@@ -1101,7 +1102,7 @@ void AliMUONClusterFinderPeakFit::FindClusterCOG(AliMUONCluster& cluster,
   }
 
   //qAver = TMath::Sqrt(qAver);
-  if ( qAver >= 14 )
+  if ( qAver >= 2.135 ) // JC: adc -> fc
   {
     
     AliMUONCluster* cluster1 = new AliMUONCluster(cluster);
index 314f27d37a8e07d43bd53cc84083e2c0d60181ec..bf59a282b0236d5d76166bcda947f8acf46fb00a 100644 (file)
@@ -94,7 +94,8 @@ namespace
 AliMUONClusterFinderSimpleFit::AliMUONClusterFinderSimpleFit(AliMUONVClusterFinder* clusterFinder)
 : AliMUONVClusterFinder(),
 fClusterFinder(clusterFinder),
-fMathieson(0x0)
+fMathieson(0x0),
+fLowestClusterCharge(0)
 {
   /// ctor
 }
@@ -153,7 +154,7 @@ AliMUONClusterFinderSimpleFit::NextCluster()
   {
     ComputePosition(*cluster);
 
-    if ( cluster->Charge() < 7 )
+    if ( cluster->Charge() < fLowestClusterCharge )
     {
       // skip that one
       return NextCluster();
index 837ebac6b1e335d3a3a1132af911106cc9ccbf1d..a7532a3196708c615b13021f550a4760663e5be0 100644 (file)
@@ -32,6 +32,10 @@ public:
   
   virtual AliMUONCluster* NextCluster();
   
+  virtual void SetChargeHints(Double_t /*lowestPadCharge*/, Double_t lowestClusterCharge) { 
+    fLowestClusterCharge=lowestClusterCharge; 
+  }
+  
 private:
   /// Not implemented
   AliMUONClusterFinderSimpleFit(const AliMUONClusterFinderSimpleFit& rhs);
@@ -43,8 +47,9 @@ private:
 private:
     AliMUONVClusterFinder* fClusterFinder; //!< the preclustering we use
   AliMUONMathieson* fMathieson; //!< Mathieson to compute the charge repartition
+  Double_t fLowestClusterCharge; //!< minimum cluster charge we allow
   
-  ClassDef(AliMUONClusterFinderSimpleFit,1) // Basic cluster finder
+  ClassDef(AliMUONClusterFinderSimpleFit,2) // Basic cluster finder
 };
 
 #endif
index b2efc607a84c5b899182afacca0e539811b418b1..1de8e48a5f8ae271975f2ea68f343ef88ca1e306 100644 (file)
@@ -57,7 +57,10 @@ const Double_t AliMUONClusterSplitterMLEM::fgkCouplMin = 1.e-2; // threshold on
 
 //_____________________________________________________________________________
 AliMUONClusterSplitterMLEM::AliMUONClusterSplitterMLEM(Int_t detElemId, 
-                                                       TObjArray* pixArray) 
+                                                       TObjArray* pixArray,
+                                                       Double_t lowestPixelCharge,
+                                                       Double_t lowestPadCharge,
+                                                       Double_t lowestClusterCharge) 
 : TObject(),
 fPixArray(pixArray),
 fMathieson(0x0),
@@ -65,7 +68,10 @@ fDetElemId(detElemId),
 fNpar(0),
 fQtot(0),
 fnCoupled(0),
-fDebug(0)
+fDebug(0),
+fLowestPixelCharge(lowestPixelCharge),
+fLowestPadCharge(lowestPadCharge),
+fLowestClusterCharge(lowestClusterCharge)
 {
   /// Constructor
   
@@ -119,7 +125,7 @@ AliMUONClusterSplitterMLEM::AddBin(TH2 *mlem,
       cont1 = mlem->GetCellContent(j,i);
       if (mode && cont1 > cont) continue;
       used[(i-1)*nx+j-1] = kTRUE;
-      if (cont1 < 0.5) continue;
+      if (cont1 < fLowestPixelCharge) continue;
       if (pix) pix->Add(BinToPix(mlem,j,i)); 
       else {
         pixPtr = new AliMUONPad (mlem->GetXaxis()->GetBinCenter(j), 
@@ -164,7 +170,7 @@ AliMUONClusterSplitterMLEM::BinToPix(TH2 *mlem,
   // Compare pixel and bin positions
   for (Int_t i = 0; i < nPix; ++i) {
     pixPtr = (AliMUONPad*) fPixArray->UncheckedAt(i);
-    if (pixPtr->Charge() < 0.5) continue;
+    if (pixPtr->Charge() < fLowestPixelCharge) continue; 
     if (TMath::Abs(pixPtr->Coord(0)-xc)<1.e-4 && TMath::Abs(pixPtr->Coord(1)-yc)<1.e-4) 
     {
       //return (TObject*) pixPtr;
@@ -738,7 +744,7 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
     //                                             Double_t /*sigy*/, 
     //                                             Double_t /*dist*/)
     
-    if ( coef*fQtot >= 14 )
+    if ( coef*fQtot >= fLowestClusterCharge ) 
     {
       //AZ AliMUONCluster* cluster1 = new AliMUONCluster();
       AliMUONCluster* cluster1 = new AliMUONCluster(cluster);
@@ -802,7 +808,7 @@ AliMUONClusterSplitterMLEM::Split(const AliMUONCluster& cluster,
       indx = (i-1)*nx + j - 1;
       if (used[indx]) continue;
       cont = mlem->GetCellContent(j,i);
-      if (cont < 0.5) continue;
+      if (cont < fLowestPixelCharge) continue;
       pix = new TObjArray(20);
       used[indx] = 1;
       pix->Add(BinToPix(mlem,j,i));
@@ -1293,7 +1299,7 @@ AliMUONClusterSplitterMLEM::UpdatePads(const AliMUONCluster& cluster,
     } // if (fNpar != 0)
     
     //if (pad->Charge() > 6 /*fgkZeroSuppression*/) pad->SetStatus(0); 
-    if (pad->Charge() > 6 /*fgkZeroSuppression*/) pad->SetStatus(AliMUONClusterFinderMLEM::GetZeroFlag()); 
+    if (pad->Charge() > fLowestPadCharge) pad->SetStatus(AliMUONClusterFinderMLEM::GetZeroFlag());
     // return pad for further using // FIXME: remove usage of zerosuppression here
     else pad->SetStatus(AliMUONClusterFinderMLEM::GetOverFlag()); // do not use anymore
     
index f79e2d71221bb82312018997467fd4b9feeaf3fa..d5b800c3528278f859abbf3d5952dcb530c23c03 100644 (file)
@@ -28,7 +28,10 @@ class AliMUONMathieson;
 class AliMUONClusterSplitterMLEM : public TObject
 {
 public:
-  AliMUONClusterSplitterMLEM(Int_t detElemId, TObjArray* pixArray);
+  AliMUONClusterSplitterMLEM(Int_t detElemId, TObjArray* pixArray, 
+                             Double_t lowestPixelCharge,
+                             Double_t lowestPadCharge,
+                             Double_t lowestClusterCharge);
   
   virtual ~AliMUONClusterSplitterMLEM();
 
@@ -95,7 +98,11 @@ private:
   Int_t fnCoupled; //!< number of coupled pixels ?
   Int_t fDebug; //!< debug level
   
-  ClassDef(AliMUONClusterSplitterMLEM,1) // 
+  Double_t fLowestPixelCharge; //!< minimum allowed pixel charge
+  Double_t fLowestPadCharge; //!< minimum allowed pad charge
+  Double_t fLowestClusterCharge; //!< minimum allowed cluster charge
+
+  ClassDef(AliMUONClusterSplitterMLEM,2) // Splitter of clusters
 };
 
 #endif
index c98d54d3e9ad5b24d79e70767353e343d6a157d4..2bdca970cc23e9cea396a2534002a908c6a540bc 100644 (file)
@@ -74,8 +74,10 @@ AliMUONRecoParam::AliMUONRecoParam()
   fMaxTrackCandidates(0),
   fSelectTrackOnSlope(kFALSE),
   fMissingPadFractionLimit(0),
-  fFractionOfBuspatchOutsideOccupancyLimit(0)
-{
+  fFractionOfBuspatchOutsideOccupancyLimit(0),
+  fAverageNoisePadCharge(0.22875),
+  fClusterChargeCut(2.0)
+{  
   /// Constructor
   
   SetNameTitle("Dummy","Dummy");
@@ -247,7 +249,6 @@ void AliMUONRecoParam::SetHighFluxParam()
   fBypassSt45 = 0;
   fMaxTriggerTracks = 100;
   fMaxTrackCandidates = 10000;
-  
 }
 
 //_____________________________________________________________________________
@@ -297,6 +298,7 @@ void AliMUONRecoParam::SetCosmicParam()
   fPadGoodnessMask = 0x400BE80; // Ped Mean is Zero | Ped Mean Too Low | Ped Mean Too High | Ped Sigma Too Low | Ped Sigma Too High | Ped is missing | HV is missing | manu occupancy too high
   fMaxTriggerTracks = 100;
   fMaxTrackCandidates = 10000;
+  
   SetPedMeanLimits(20, 700);
   SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
 
@@ -503,6 +505,11 @@ void AliMUONRecoParam::Print(Option_t *option) const
   cout << endl;
   cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
   cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
+
+  cout << Form("The average noise pad charge is assumed to be %7.2f fC",AverageNoisePadCharge()) << endl;
+  cout << Form("and clusters above %5.2f times this noise charge (i.e. %7.2f fC) are discarded",
+               ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
+  cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
   
   cout<<"\t-----------------------------------------------------"<<endl<<endl;
   
@@ -546,10 +553,13 @@ AliMUONRecoParam::SetDefaultLimits()
   fDEOccupancyLimits[0] = -1.0; 
   fDEOccupancyLimits[1] = 1.0;
 
-  fChargeSigmaCut = 4.0;
-  
   fMissingPadFractionLimit = 0.1; // 10 % 
   fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 % 
 
+  ChargeSigmaCut(4.0); // pad with charge < 4.0 x sigma will be removed (where sigma is the actual noise of that very pad, i.e. not the average)
+  
+  AverageNoisePadCharge(0.22875); // 0.22875 coulombs ~ 1.5 ADC channels
+
+  ClusterChargeCut(2.0); // will cut cluster below 2.0 x LowestPadCharge()
 }
 
index d71f1f629bb5ea25d2b300967710b9182e80e757..e779c47b25aacb442d751b607fa1e820ee33801c 100644 (file)
@@ -36,6 +36,22 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   /// get the clustering (pre-clustering) mode
   Option_t* GetClusteringMode() const {return fClusteringMode.Data();}
   
+  /// Get the (truncated) average of sigmas of pedestal measurements, i.e. noise, of pads
+  Double_t AverageNoisePadCharge() const { return fAverageNoisePadCharge; }
+  /// Set the average of sigmas of pedestal measurements, i.e. noise, of pads
+  void AverageNoisePadCharge(Double_t noise) { fAverageNoisePadCharge = noise; }
+  
+  /// Get the lowest charge we allow for pads
+  Double_t LowestPadCharge() const { return fChargeSigmaCut*fAverageNoisePadCharge; }
+
+  /// Get the cut applied to cut on cluster charge (the charge is cut if below fClusterChargeCut*LowestPadCharge())
+  Double_t ClusterChargeCut() const { return fClusterChargeCut; }
+  /// Set the cut applied to cut on cluster charge (the charge is cut if below fClusterChargeCut*LowestPadCharge())
+  void ClusterChargeCut(Double_t n) { fClusterChargeCut=n; }
+  
+  /// Get the lowest possible cluster charge
+  Double_t LowestClusterCharge() const { return ClusterChargeCut()*LowestPadCharge(); }
+     
   /// set the tracking mode
   void      SetTrackingMode(Option_t* mode) {fTrackingMode = mode; fTrackingMode.ToUpper();}
   /// get the tracking mode
@@ -392,13 +408,16 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   Double32_t fMissingPadFractionLimit; ///< above this fraction, we consider we have too few pads alive...
   Double32_t fFractionOfBuspatchOutsideOccupancyLimit; ///< above this limit, we consider we have too many buspatches out of the allowed occupancy range
 
+  Double32_t fAverageNoisePadCharge; ///< the (truncated, typically at 10%) mean of the sigma of the pedestals, in femto-coulomb
+  Double32_t fClusterChargeCut; ///< the cluster is cut if its charge is below fClusterChargeCut*LowestPadCharge()
+  
   // functions
   void SetLowFluxParam();
   void SetHighFluxParam();
   void SetCosmicParam();
   void SetCalibrationParam();
   
-  ClassDef(AliMUONRecoParam,15) // MUON reco parameters
+  ClassDef(AliMUONRecoParam,166) // MUON reco parameters
 };
 
 #endif
index 238c88a499ef3284c55e9a2e336645d5104060d4..ca40d1fb9025c66f9e9f163b9ae2df07c1d91133 100644 (file)
@@ -155,6 +155,10 @@ AliMUONSimpleClusterServer::Clusterize(Int_t chamberId,
         { AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath0),
           AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath1)
         };
+        
+        fClusterFinder->SetChargeHints(recoParam->LowestPadCharge(),
+                                       recoParam->LowestClusterCharge());
+        
         if ( fClusterFinder->NeedSegmentation() )
         {
           fClusterFinder->Prepare(detElemId,pads,deArea,seg);
index e08afad1326535c49a77b8c25068e680fbef83ef..9d0aeab61d38ad334621debb2e0f75b22a625c55 100644 (file)
@@ -17,6 +17,7 @@
 #endif
 
 class AliMUONCluster;
+class AliMUONRecoParam;
 class AliMpVSegmentation;
 class AliMUONPad;
 class AliMpArea;
@@ -52,6 +53,12 @@ public:
     */
   virtual Bool_t UsePad(const AliMUONPad& pad);
   
+  /** Specify a couple of charge hints. We call them hints because some
+   clustering need them and use them directly, other cook them before
+   using them, and some others yet simply don't care about them.
+   */
+  virtual void SetChargeHints(Double_t /*lowestPadCharge*/, Double_t /*lowestClusterCharge*/) { }
+  
   ClassDef(AliMUONVClusterFinder,0) // Interface of a MUON cluster finder.
 };