]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSClusterizerv1.cxx
New code for full visualization of the vzero raw data. ctrl-alt-letf-button shows...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.cxx
index 4450e4d56be29793ca2d54aab8581dc8064e2e79..5f5d221c391dbda69a0743a75f729512dd7d4622 100644 (file)
@@ -202,7 +202,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() :
 {
   // default ctor (to be used mainly by Streamer)
   
-  InitParameters() ; 
   fDefaultInit = kTRUE ; 
 }
 
@@ -218,7 +217,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(AliPHOSGeometry *geom) :
 {
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
-  InitParameters() ;
   Init() ;
   fDefaultInit = kFALSE ; 
 }
@@ -383,25 +381,24 @@ void AliPHOSClusterizerv1::InitParameters()
   fNumberOfCpvClusters     = 0 ; 
   fNumberOfEmcClusters     = 0 ; 
 
-  const AliPHOSRecoParam* parEmc = AliPHOSReconstructor::GetRecoParamEmc();
-  if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!");
+  const AliPHOSRecoParam* recoParam = AliPHOSReconstructor::GetRecoParam();
+  if(!recoParam) AliFatal("Reconstruction parameters are not set!");
 
-  const AliPHOSRecoParam* parCpv = AliPHOSReconstructor::GetRecoParamCpv(); 
-  if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!");
+  recoParam->Print();
 
-  fCpvClusteringThreshold  = parCpv->GetClusteringThreshold();
-  fEmcClusteringThreshold  = parEmc->GetClusteringThreshold();
+  fEmcClusteringThreshold  = recoParam->GetEMCClusteringThreshold();
+  fCpvClusteringThreshold  = recoParam->GetCPVClusteringThreshold();
   
-  fEmcLocMaxCut            = parEmc->GetLocalMaxCut();
-  fCpvLocMaxCut            = parCpv->GetLocalMaxCut();
+  fEmcLocMaxCut            = recoParam->GetEMCLocalMaxCut();
+  fCpvLocMaxCut            = recoParam->GetCPVLocalMaxCut();
 
-  fW0                      = parEmc->GetLogWeight();
-  fW0CPV                   = parCpv->GetLogWeight();
+  fW0                      = recoParam->GetEMCLogWeight();
+  fW0CPV                   = recoParam->GetCPVLogWeight();
 
   fEmcTimeGate             = 1.e-6 ; 
-  fEcoreRadius             = parEmc->GetEcoreRadius();
+  fEcoreRadius             = recoParam->GetEMCEcoreRadius();
   
-  fToUnfold                = parEmc->ToUnfold() ;
+  fToUnfold                = recoParam->EMCToUnfold() ;
     
   fWrite                   = kTRUE ;
 }
@@ -489,7 +486,7 @@ void AliPHOSClusterizerv1::WriteRecPoints()
   Int_t index ;
   //Evaluate position, dispersion and other RecPoint properties..
   Int_t nEmc = fEMCRecPoints->GetEntriesFast();
-  Float_t emcMinE= AliPHOSReconstructor::GetRecoParamEmc()->GetMinE(); //Minimal digit energy
+  Float_t emcMinE= AliPHOSReconstructor::GetRecoParam()->GetEMCMinE(); //Minimal digit energy
   TVector3 fakeVtx(0.,0.,0.) ;
   for(index = 0; index < nEmc; index++){
     AliPHOSEmcRecPoint * rp =
@@ -546,14 +543,20 @@ void AliPHOSClusterizerv1::MakeClusters()
   fNumberOfEmcClusters     = 0 ;
 
   //Mark all digits as unused yet
+  const Int_t maxNDigits = 1500;
   Int_t nDigits=fDigitsArr->GetEntriesFast() ;
+  if (nDigits > maxNDigits) {
+    AliWarning(Form("Skip event with too high digit occupancy: nDigits=%d",nDigits));
+    return;
+  }
+
   for(Int_t i=0; i<nDigits; i++){
     fDigitsUsed[i]=0 ;
   }
   Int_t iFirst = 0 ; //first index of digit which potentially can be a part of cluster
                      //e.g. first digit in this module, first CPV digit etc.
   AliPHOSDigit * digit ; 
-  TArrayI clusterdigitslist(1500) ;   
+  TArrayI clusterdigitslist(maxNDigits) ;   
   AliPHOSRecPoint * clu = 0 ; 
   for(Int_t i=0; i<nDigits; i++){
     if(fDigitsUsed[i])