From 4a2ca5e991b0123fe3df9afb2cabf1a25924f578 Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 18 Jul 2000 12:25:34 +0000 Subject: [PATCH] Add threshold for primary particles participating to a digit --- PHOS/AliPHOSDigit.cxx | 15 +++++++++++---- PHOS/AliPHOSv1.cxx | 11 ++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/PHOS/AliPHOSDigit.cxx b/PHOS/AliPHOSDigit.cxx index 7cf26b41209..a7b142a5eff 100644 --- a/PHOS/AliPHOSDigit.cxx +++ b/PHOS/AliPHOSDigit.cxx @@ -59,8 +59,14 @@ AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Int_t index fAmp = DigEnergy ; fId = id ; fIndexInList = index ; - fPrimary1 = primary ; - fNprimary = 1 ; + if( primary != -1){ + fNprimary = 1 ; + fPrimary1 = primary ; + } + else{ //If the contribution of this primary smaller than fDigitThreshold (AliPHOSv1) + fNprimary = 0 ; + fPrimary1 = -1 ; + } fPrimary2 = -1 ; fPrimary3 = -1 ; } @@ -143,12 +149,13 @@ Bool_t AliPHOSDigit::operator==(AliPHOSDigit const & digit) const AliPHOSDigit& AliPHOSDigit::operator+(AliPHOSDigit const & digit) { // Adds the amplitude of digits and completes the list of primary particles + // if amplitude is larger than fAmp += digit.fAmp ; // Here comes something crummy ... but I do not know how to stream pointers - // because AliPHOSDigit is in a TCLonesArray - + // because AliPHOSDigit is in a TCLonesArray + Int_t tempo1[3] ; tempo1[0] = fPrimary1 ; tempo1[1] = fPrimary2 ; diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index 14b6cfeca12..2d704d6b286 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -69,7 +69,7 @@ AliPHOSv1::AliPHOSv1(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 ; fDigitThreshold = 1. ; // 1 GeV @@ -241,7 +241,12 @@ void AliPHOSv1::FinishEvent() for ( i = 0 ; i < fNTmpHits ; i++ ) { hit = (AliPHOSHit*)fTmpHits->At(i) ; - newdigit = new AliPHOSDigit( hit->GetPrimary(), hit->GetId(), Digitize( hit->GetEnergy() ) ) ; + + // Assign primary number only if contribution is significant + if( hit->GetEnergy() > fDigitThreshold) + newdigit = new AliPHOSDigit( hit->GetPrimary(), hit->GetId(), Digitize( hit->GetEnergy() ) ) ; + else + newdigit = new AliPHOSDigit( -1 , hit->GetId(), Digitize( hit->GetEnergy() ) ) ; deja =kFALSE ; for ( j = 0 ; j < fNdigits ; j++) { curdigit = (AliPHOSDigit*) lDigits[j] ; @@ -409,7 +414,7 @@ void AliPHOSv1::Reconstruction(AliPHOSReconstructioner * Reconstructioner) cout << "filled" << endl ; // 5. - gAlice->TreeR()->Write() ; + gAlice->TreeR()->Write(0,TObject::kOverwrite) ; cout << "writen" << endl ; // Deleting reconstructed objects -- 2.39.3