]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Zero suppression added. Sigmas of noise generated randomly.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Nov 2003 11:06:30 +0000 (11:06 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Nov 2003 11:06:30 +0000 (11:06 +0000)
RICH/AliRICH.cxx
RICH/AliRICHConst.h
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/menu.C

index 795f9defdda88d09fbe7674e0acb9eee856159d3..779d21b96bcd16fc0e2103aa4a68de3c0b86b407 100644 (file)
@@ -80,6 +80,7 @@ AliRICH::AliRICH(const char *name, const char *title)
 {//Named ctor
   if(GetDebug())Info("named ctor","Start.");
   fpParam     =   new AliRICHParam;
+  Param()->GenSigmaThMap();
   fChambers = 0;  CreateChambers();
 //AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them)
   fHits=       0;     CreateHits();          gAlice->GetMCApp()->AddHitList(fHits);
index 307a7b3a12d0caa82e2feba20fa2404dcb77e7d3..15016a7afbaaa51ad2a52f772756f284b831860e 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef AliRICHConst_h
 #define AliRICHConst_h
 #include <TMath.h>
+
+static const Int_t kNpadsX = 144;
+static const Int_t kNpadsY = 160;
 static const Double_t kD2r=TMath::Pi()/180;
 static const Double_t kR2d=57.2957795130823229;
 static const Double_t kDeg=TMath::Pi()/180;
index f172b2b24c4991af22cb126fdaa80fcade08f8f6..6948bead72d2bbe6d43d0e126f8c95d883d5b27d 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 #include "AliRICHParam.h"
+#include <TRandom.h>
 
 Bool_t   AliRICHParam::fgIsWireSag            =kTRUE;
 Bool_t   AliRICHParam::fgIsResolveClusters    =kTRUE;
 Double_t AliRICHParam::fgAngleRot             =-60;
 Int_t    AliRICHParam::fgHV                   =2150;
-
+Int_t    AliRICHParam::fgNsigmaTh             =4;
+Float_t  AliRICHParam::fgSigmaThMean          =1.5;
+Float_t  AliRICHParam::fgSigmaThSpread        =0.5;      
 ClassImp(AliRICHParam)
+
+void AliRICHParam::GenSigmaThMap()
+{
+  for(Int_t iChamber=0;iChamber<kNCH;iChamber++)
+    for(Int_t ipadX=0;ipadX<NpadsX();ipadX++)
+      for(Int_t ipadY=0;ipadY<NpadsY();ipadY++) 
+        fSigmaThMap[iChamber][ipadX][ipadY] = SigmaThMean()+(1.-2*gRandom->Rndm())*SigmaThSpread();
+  Info("GenSigmaThMap"," Threshold map generated for all RICH chambers");
+}
index a976bda1ca2fce990177bd948f4e81925103f583..4f4112c66dfc206ec69b2f66644aacb78ee00822 100644 (file)
@@ -11,9 +11,9 @@ class AliRICHParam :public TObject
 {
 public:
            AliRICHParam()                    {;}
-  virtual ~AliRICHParam()                    {;}  
-  static Int_t   NpadsX()                   {return 144;}
-  static Int_t   NpadsY()                   {return 160;}   
+  virtual ~AliRICHParam()                    {;}
+  static const Int_t   NpadsX()             {return kNpadsX;}
+  static const Int_t   NpadsY()             {return kNpadsY;}   
   static Int_t   NpadsXsec()                {return NpadsX()/3;}   
   static Int_t   NpadsYsec()                {return NpadsY()/2;}   
   static Double_t DeadZone()                 {return 2.6;}
@@ -56,7 +56,7 @@ public:
     static void  SetResolveClusters(Bool_t a){fgIsResolveClusters=a;}  
     static void  SetWireSag(Bool_t status)   {fgIsWireSag=status;}  
     static void  SetHV(Int_t hv)             {fgHV       =hv;}  
-    static void  SetAngleRot(Double_t rot)   {fgAngleRot =rot;}         
+    static void  SetAngleRot(Double_t rot)   {fgAngleRot =rot;}
 
   inline static Double_t Mathieson(Double_t lx1,Double_t lx2,Double_t ly1,Double_t ly2);   
   inline static void    Loc2Area(TVector3 hitX3,Int_t &padxMin,Int_t &padyMin,Int_t &padxMax,Int_t &padyMax);
@@ -71,13 +71,20 @@ public:
          Bool_t SigGenCond(Double_t,Double_t){return kFALSE;}
   inline static Int_t   Loc2Sec(Double_t &x,Double_t &y); 
   inline static Int_t   Pad2Sec(Int_t &padx,Int_t &pady); 
-  
+  inline Bool_t IsOverTh(Int_t iChamber, Int_t x, Int_t y, Double_t q);
+  static Int_t NsigmaTh() {return fgNsigmaTh;}
+  static Float_t SigmaThMean() {return fgSigmaThMean;}
+  static Float_t SigmaThSpread() {return fgSigmaThSpread;}
+  void GenSigmaThMap();
 protected:
-  static Bool_t  fgIsWireSag;              //is wire sagitta taken into account
-  static Bool_t  fgIsResolveClusters;      //performs declustering or not
-  static Int_t   fgHV;                     //HV applied to anod wires
-  static Double_t fgAngleRot;              //rotation of RICH from up postion (0,0,490)cm
-  
+  static Bool_t  fgIsWireSag;                           //is wire sagitta taken into account
+  static Bool_t  fgIsResolveClusters;                   //performs declustering or not
+  static Int_t   fgHV;                                  //HV applied to anod wires
+  static Double_t fgAngleRot;                           //rotation of RICH from up postion (0,0,490)cm
+  Float_t fSigmaThMap[kNCH][kNpadsX][kNpadsY];          // sigma of the pedestal distributions for all pads
+  static Int_t fgNsigmaTh;                              // n. of sigmas to cut for zero suppression
+  static Float_t fgSigmaThMean;                         // sigma threshold value
+  static Float_t fgSigmaThSpread;                       // spread of sigma
   ClassDef(AliRICHParam,4)    //RICH main parameters
 };
 //__________________________________________________________________________________________________
@@ -224,4 +231,9 @@ void AliRICHParam::Loc2Area(TVector3 hitX3,Int_t &iPadXmin,Int_t &iPadYmin,Int_t
   Loc2Pad(hitX3.X()-MathiesonDeltaX(),hitX3.Y()-MathiesonDeltaY(),iPadXmin,iPadYmin);   
   Loc2Pad(hitX3.X()+MathiesonDeltaX(),hitX3.Y()+MathiesonDeltaY(),iPadXmax,iPadYmax);     
 }//
+//__________________________________________________________________________________________________
+Bool_t AliRICHParam::IsOverTh(Int_t iChamber, Int_t x, Int_t y, Double_t q)
+{// Calculate the new charge subtracting pedestal and if the current digit is over threshold
+  if(q>NsigmaTh()*fSigmaThMap[iChamber-1][x-1][y-1]) return kTRUE; else return kFALSE;
+}//
 #endif //AliRICHParam_h
index beca37dfff71678fba636570c0228adf7f404f5a..c988cb3a23cc9e8c6571f27790e32f11f44bfac0 100644 (file)
@@ -165,13 +165,17 @@ void SD_D()
         else
           Info("","More then 3 sdigits for the given pad");
       }else{//new pad, add the pevious one
-        if(id!=kBad) r->AddDigit(chamber,x,y,q,tr[0],tr[1],tr[2]);//ch-xpad-ypad-qdc-tr1-2-3
+        if(id!=kBad&&r->Param()->IsOverTh(chamber,x,y,q)) {
+           
+           r->AddDigit(chamber,x,y,q,tr[0],tr[1],tr[2]);//ch-xpad-ypad-qdc-tr1-2-3
+         }
         chamber=pSdig->C();x=pSdig->X();y=pSdig->Y();q=pSdig->Q();tr[0]=pSdig->T(0);id=pSdig->Id();
         iNdigitsPerPad=1;tr[1]=tr[2]=kBad;
       }
     }//sdigits loop (sorted)
   
-    if(r->SDigits()->GetEntries())r->AddDigit(chamber,x,y,q,tr[0],tr[1],tr[2]);//add the last digit
+    if(r->SDigits()->GetEntries()&&r->Param()->IsOverTh(chamber,x,y,q))
+                  r->AddDigit(chamber,x,y,q,tr[0],tr[1],tr[2]);//add the last digit
         
     rl->TreeD()->Fill();  
     rl->WriteDigits("OVERWRITE");
@@ -226,8 +230,7 @@ void OLD_SD_D()
   r->ResetSDigits();r->ResetDigitsOld();//reset lists of sdigits and digits
   Info("SD_DOLD","Stop.");  
 }
-
-
+//__________________________________________________________________________________________________
 void Show3()
 {  
   cout<<endl;
@@ -288,6 +291,54 @@ void Show3()
   cout<<endl;
 }//void Show()
 //__________________________________________________________________________________________________
+void ControlPlots()
+{  
+  Int_t iChamber = 1;
+  TH1F *pqclusterH1 = new TH1F("qclus","charge of clusters;Q (ADC);events",2000,0.,2000);
+
+    al->LoadHeader();  al->LoadKinematics();
+  
+  rl->LoadHits();  
+    Bool_t isSdigits=!rl->LoadSDigits();  
+      Bool_t isClusters=!rl->LoadRecPoints();
+        Bool_t isDigits=!rl->LoadDigits();//loaders
+  
+  for(Int_t iEventN=0;iEventN<a->GetEventsPerRun();iEventN++){//events loop
+    Int_t iNparticles=a->GetEvent(iEventN);
+    Int_t iNprims=rl->TreeH()->GetEntries();
+    
+    Int_t iTotalHits=0,iTotalCerenkovs=0,iTotalSpecials=0;
+    for(Int_t iPrimN=0;iPrimN<iNprims;iPrimN++){//prims loop
+      rl->TreeH()->GetEntry(iPrimN);      
+      iTotalHits+=r->Hits()->GetEntries();
+      iTotalCerenkovs+=r->Cerenkovs()->GetEntries();
+      iTotalSpecials+=r->Specials()->GetEntries();
+      TParticle *pPrim=al->Stack()->Particle(iPrimN);
+    }//prims loop
+    if(isSdigits){
+      rl->TreeS()->GetEntry(0);
+    }
+    if(isDigits){
+      rl->TreeD()->GetEntry(0);
+      for(int i=1;i<=7;i++);
+    }
+    if(isClusters){
+      rl->TreeR()->GetEntry(0);
+      for(Int_t iclus=0;iclus<r->Clusters(iChamber)->GetEntries();iclus++) {
+        pqclusterH1->Fill(((AliRICHcluster*)r->Clusters(iChamber)->At(iclus))->Q());
+      }
+    }
+    cout<<endl;
+  }//events loop
+  pqclusterH1->Draw();
+  rl->UnloadHits();  
+    if(isSdigits) rl->UnloadSDigits(); 
+      if(isDigits) rl->UnloadDigits(); 
+        if(isClusters) rl->UnloadRecPoints();
+  al->UnloadHeader();
+  al->UnloadKinematics();
+}//void Controlòlots()
+//__________________________________________________________________________________________________
 void DebugOFF()
 {
   Info("DebugOFF","");
@@ -721,6 +772,7 @@ void menu()
   pMenu->AddButton("Test submenu",    "TestMenu()",            "Shows test submenu");
   pMenu->AddButton("Browser",         "new TBrowser;",         "Start ROOT TBrowser");
   pMenu->AddButton("Display Fast",    "DisplFast()",           "Display Fast");
+  pMenu->AddButton("Control Plots",    "ControlPlots()",           "Control Plots");
   pMenu->AddButton("Quit",            ".q",                    "Close session");
   pMenu->Show();
   a=gAlice;//for manual manipulation convinience