{//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);
#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;
* 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");
+}
{
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;}
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);
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
};
//__________________________________________________________________________________________________
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
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");
r->ResetSDigits();r->ResetDigitsOld();//reset lists of sdigits and digits
Info("SD_DOLD","Stop.");
}
-
-
+//__________________________________________________________________________________________________
void Show3()
{
cout<<endl;
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","");
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