]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added electronic noise to the deposited energy
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Feb 2000 14:05:42 +0000 (14:05 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Feb 2000 14:05:42 +0000 (14:05 +0000)
PHOS/AliPHOSv0.cxx
PHOS/AliPHOSv0.h

index 19489c12f66edd7c197151bf86dff95820500d57..d9fb12f8d8e106d018e3c9d60eabf82d232d8f74 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "TBRIK.h"
 #include "TNode.h"
+#include "TRandom.h"
 
 // --- Standard library ---
 
@@ -63,6 +64,8 @@ AliPHOSv0::AliPHOSv0(const char *name, const char *title):
   //   - fTmpHits, which retains all the hits of the current event. It 
   //     is used for the digitization part.
 
+  fPINElectronicNoise = 0.010 ;
+
   fHits   = new TClonesArray("AliPHOSHit",100) ;
   gAlice->AddHitList(fHits) ; 
 
@@ -97,7 +100,7 @@ AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *nam
   //
   //   - fTmpHits, which retains all the hits of the current event. It 
   //     is used for the digitization part.
-
+  fPINElectronicNoise = 0.010 ;
   fHits   = new TClonesArray("AliPHOSHit",100) ;
   fDigits = new TClonesArray("AliPHOSDigit",100) ;
   fTmpHits= new TClonesArray("AliPHOSHit",100) ;
@@ -1051,8 +1054,20 @@ void AliPHOSv0::FinishEvent()
     digit = new AliPHOSDigit(hit->GetId(),Digitize(hit->GetEnergy())) ;
     new(lDigits[fNdigits]) AliPHOSDigit(* digit) ;
     fNdigits++;  delete digit ;    
+  } 
+  Float_t energyandnoise ;
+  for ( i = 0 ; i < fNdigits ; i++ ) {
+    digit =  (AliPHOSDigit * ) fDigits->At(i) ;
+    //    printf("GetId is %d and GetAmp is %d \n",digit->GetId(), digit->GetAmp()) ;
+    energyandnoise = digit->GetAmp() + Digitize(gRandom->Gaus(0.,fPINElectronicNoise)) ;
+    if (energyandnoise < 0 ) energyandnoise = 0 ;
+    digit->SetAmp(energyandnoise);
+    //    printf("GetId is %d and GetAmp is %d \n",digit->GetId(), digit->GetAmp()) ;
+   
+
   }
 
+
   // Reset the array of all the "accumulated hits" of this event.
   fNTmpHits = 0 ;
   fTmpHits->Delete();
index fa1ed59cf4997552814af4cfc3c2ed1fece388ab..80479cd49d038db68677855ce7351797e15670a3 100644 (file)
@@ -53,7 +53,7 @@ public:
   TrackSegmentsList *    TrackSegments(){return fTrackSegments ;}
   
 protected:
-
+  Float_t fPINElectronicNoise  ;         // Electronic Noise in the PIN
   RecPointsList * fEmcClusters ;        //!  (!=do not stream)
   AliPHOSGeometry * fGeom ;             // geometry definition
   Int_t fNTmpHits ;                     //!  used internally for digitalization