]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added hacks to allow removal of noisy pads.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Jun 2006 14:27:58 +0000 (14:27 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Jun 2006 14:27:58 +0000 (14:27 +0000)
EVE/Alieve/LinkDef.h
EVE/Alieve/TPCData.cxx
EVE/Alieve/TPCLoader.cxx
EVE/Alieve/TPCSectorData.cxx
EVE/Alieve/TPCSectorData.h

index 552f367e82b9b863b0666aa64a00fcdf0ba2b6d9..124fe3b331cd479172ce87c651c2f697511dcaf4 100644 (file)
@@ -33,6 +33,8 @@
 #pragma link C++ class Alieve::TPCSectorData::RowIterator;
 #pragma link C++ class Alieve::TPCSectorData::SegmentInfo;
 
+#pragma link C++ class Alieve::TPCSectorData::PadRowHack;
+
 #pragma link C++ class Alieve::TPCSectorViz+;
 #pragma link C++ class Alieve::TPCSectorVizEditor+;
 #pragma link C++ class Alieve::TPCSector2D+;
index 598265e4191db275a41cccfc7ee82a68d29971b3..3e1511a9c12a3afb99d7871ea57c030c22280dc4 100644 (file)
@@ -156,10 +156,12 @@ void TPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t warn)
   Bool_t  lastTimeWarn = kFALSE;
   TPCSectorData* secData = 0;
 
+  Short_t threshold = fLoadThreshold;
+
   while (input.Next()) {
     if (input.IsNewSector()) {
       if(inFill) {
-       secData->EndPad(fAutoPedestal, fLoadThreshold);
+       secData->EndPad(fAutoPedestal, threshold);
        inFill = kFALSE;
       }
       sector = input.GetSector();
@@ -176,7 +178,7 @@ void TPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t warn)
 
     if (input.IsNewPad()) {
       if(inFill) {
-       secData->EndPad(fAutoPedestal, fLoadThreshold);
+       secData->EndPad(fAutoPedestal, threshold);
        inFill = kFALSE;
       }
       row = input.GetRow() + rowOffset;
@@ -190,6 +192,14 @@ void TPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t warn)
        continue;
       }
 
+      TPCSectorData::PadRowHack* prh = secData->GetPadRowHack(row, pad);
+      if(prh != 0) {
+       printf ("hakahaka s=%d, r=%d, p=%d\n", sector, row, pad);
+       threshold = prh->fThrExt + Short_t(prh->fThrFac*fLoadThreshold);
+      } else {
+       threshold = fLoadThreshold;
+      }
+
       secData->BeginPad(row, pad, kTRUE);
       inFill   = kTRUE;
       lastTime = 1024;  lastTimeWarn = kFALSE;
@@ -210,13 +220,13 @@ void TPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t warn)
     if(fAutoPedestal) {
       secData->RegisterData(time, signal);
     } else {
-      if(signal > fLoadThreshold)
+      if(signal > threshold)
        secData->RegisterData(time, signal - fLoadPedestal);
     }
   }
 
   if(inFill) {
-    secData->EndPad(fAutoPedestal, fLoadThreshold);
+    secData->EndPad(fAutoPedestal, threshold);
     inFill = kFALSE;
   }
 }
index 7b091257efd9df34197c90411835c434e2e635e8..d7161d2b35a636342d293d15e84e568295c0885a 100644 (file)
@@ -158,6 +158,11 @@ void TPCLoader::UpdateSectors()
        if(fDoubleSR)
          s->SetMaxTime(1023);
 
+       // Hack for front/back pulse
+       s->SetMinTime(50);
+       s->SetMaxTime(980);
+       s->SetThreshold(10);
+
        s->SetTrans(kTRUE);
        s->SetFrameColor(36);
 
index 184b884153ff0621dac9d4bdcd01a9b372c45528..ca6f67fb8e3f2b30c6a924e44ba74e181a650984 100644 (file)
@@ -154,7 +154,8 @@ void TPCSectorData::NewBlock()
 TPCSectorData::TPCSectorData(Int_t sector, Int_t bsize) :
   fSectorID(sector), fNPadsFilled(0),
   fBlockSize(bsize), fBlockPos(0),
-  fCurrentRow(0), fCurrentPad(0), fCurrentPos(0)
+  fCurrentRow(0), fCurrentPad(0), fCurrentPos(0),
+  fPadRowHackSet(0)
 {
   if(fgParam == 0) InitStatics();
 
@@ -168,6 +169,7 @@ TPCSectorData::~TPCSectorData()
 {
   for(std::vector<Short_t*>::iterator b=fBlocks.begin(); b!=fBlocks.end(); ++b)
     delete [] *b;
+  DeletePadRowHack();
 }
 
 void TPCSectorData::DropData()
@@ -446,3 +448,48 @@ TPCSectorData::SegmentInfo::SegmentInfo()
 {
   memset(this, sizeof(SegmentInfo), 0);
 }
+
+/**************************************************************************/
+// TPCSectorData::PadRowHack
+/**************************************************************************/
+
+#include <set>
+
+TPCSectorData::PadRowHack* TPCSectorData::GetPadRowHack(Int_t r, Int_t p)
+{
+  if(fPadRowHackSet == 0) return 0;
+  std::set<PadRowHack>* hs = static_cast<std::set<PadRowHack>*>(fPadRowHackSet);
+  std::set<PadRowHack>::iterator i = hs->find(PadRowHack(r,p));
+  return (i == hs->end()) ? 0 : const_cast<PadRowHack*>(&*i);
+}
+
+void TPCSectorData::AddPadRowHack(Int_t r, Int_t p, Int_t te, Float_t tf)
+{
+  if(fPadRowHackSet == 0) fPadRowHackSet = new std::set<PadRowHack>;
+
+  PadRowHack* prh = GetPadRowHack(r, p);
+  if(prh == 0) {
+    std::set<PadRowHack>* hs = static_cast<std::set<PadRowHack>*>(fPadRowHackSet);
+    hs->insert(PadRowHack(r, p, te, tf));
+  } else {
+    prh->fThrExt += te;
+    prh->fThrFac *= tf;
+  }
+}
+
+void TPCSectorData::RemovePadRowHack(Int_t r, Int_t p)
+{
+  if(fPadRowHackSet == 0) return;
+  std::set<PadRowHack>*hs = static_cast<std::set<PadRowHack>*>(fPadRowHackSet);
+  std::set<PadRowHack>::iterator i = hs->find(PadRowHack(r,p));
+  if(i != hs->end()) hs->erase(i);
+}
+
+void TPCSectorData::DeletePadRowHack()
+{
+  if(fPadRowHackSet != 0) {
+    std::set<PadRowHack>*hs = static_cast<std::set<PadRowHack>*>(fPadRowHackSet);
+    delete hs;
+    fPadRowHackSet = 0;
+  }
+}
index 0a1b36691111da8338180c2d0ece030d0a79e2c6..fea7e298ac2f0aa53578856f590f718d8edaca13 100644 (file)
@@ -181,6 +181,33 @@ public:
   
   static void InitStatics();
 
+
+  //----------------------------------------------------------------
+  // Hack for noisy pad-row removal
+  //----------------------------------------------------------------
+
+  class PadRowHack
+  {
+  public:
+    Int_t   fRow, fPad;
+    Int_t   fThrExt;
+    Float_t fThrFac; // Actual threshold = fThrExt + fThrFac*thr
+
+    PadRowHack(Int_t r, Int_t p, Int_t te=0, Float_t tf=1) :
+      fRow(r), fPad(r), fThrExt(te), fThrFac(tf) {}
+    bool operator<(const PadRowHack& a) const
+    { return (fRow == a.fRow) ? fPad < a.fPad : fRow < a.fRow; }
+  };
+
+  PadRowHack* GetPadRowHack(Int_t r, Int_t p);
+  void AddPadRowHack(Int_t r, Int_t p, Int_t te=0, Float_t tf=1);
+  void RemovePadRowHack(Int_t r, Int_t p);
+  void DeletePadRowHack();
+
+protected:
+  void* fPadRowHackSet;
+  
+
   ClassDef(TPCSectorData, 0);
 }; // endclass TPCSectorData