]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
EMCAL Threshold for digitaziation put in the correct place
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Mar 2000 08:47:11 +0000 (08:47 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Mar 2000 08:47:11 +0000 (08:47 +0000)
PHOS/AliPHOSv0.cxx

index 411c5a5a873ee668fe30e40829b1ede02dd9ab65..ab4eba18c739ba0dda9c54ce93f081ddb9095e2b 100644 (file)
@@ -1079,14 +1079,20 @@ void AliPHOSv0::FinishEvent()
   for ( i = 0 ; i < fNdigits ; i++ ) {
     newdigit =  (AliPHOSDigit * ) fDigits->At(i) ;
     fGeom->AbsToRelNumbering(newdigit->GetId(), relid) ;
+
     if (relid[1]==0){   // Digits belong to EMC (PbW0_4 crystals)
       energyandnoise = newdigit->GetAmp() + Digitize(gRandom->Gaus(0., fPinElectronicNoise)) ;
+
       if (energyandnoise < 0 ) 
        energyandnoise = 0 ;
+
       newdigit->SetAmp(energyandnoise) ;
+
+      if ( newdigit->GetAmp() < fDigitThreshold ) // if threshold not surpassed, remove digit from list
+       fDigits->RemoveAt(i) ; 
     }
   }
-
+  fDigits->Compress() ; 
   fNTmpHits = 0 ;
   fTmpHits->Delete();
 }