From c630773fea57644d72af47a03c8028b6bd64e6d3 Mon Sep 17 00:00:00 2001 From: decaro Date: Tue, 28 Apr 2009 11:20:46 +0000 Subject: [PATCH] Added more checks at s/digitization level (to keep bug#47098 under control) --- TOF/AliTOFDigitMap.cxx | 3 +- TOF/AliTOFDigitizer.cxx | 6 ++- TOF/AliTOFSDigit.cxx | 114 +++++++++++++++++---------------------- TOF/AliTOFSDigitizer.cxx | 15 ++++-- TOF/AliTOFdigit.cxx | 13 +++-- 5 files changed, 71 insertions(+), 80 deletions(-) diff --git a/TOF/AliTOFDigitMap.cxx b/TOF/AliTOFDigitMap.cxx index 2d2b857adbf..227d7321157 100644 --- a/TOF/AliTOFDigitMap.cxx +++ b/TOF/AliTOFDigitMap.cxx @@ -159,7 +159,7 @@ void AliTOFDigitMap::AddDigit(Int_t *vol, Int_t idigit) // 0 means empty pad, we need to shift indeces by 1 if (fDigitMap[CheckedIndex(vol)][kMaxDigitsPerPad-1]!=0) { - AliWarning(Form("For this volume (Se%i, Pl%i, St%i, PadR%i, Pad%i) there are not more possibility to add digits.", vol[0], vol[1], vol[2], vol[4], vol[3])); + AliWarning(Form("In the volume (Se%i, Pl%i, St%i, PadR%i, Pad%i) there is not more possibility to add other digits.", vol[0], vol[1], vol[2], vol[4], vol[3])); AliWarning(Form("Then, the digit number %i will be not inserted in the digit map, i.e. it will be lost.", idigit)); return; } @@ -173,6 +173,7 @@ void AliTOFDigitMap::AddDigit(Int_t *vol, Int_t idigit) //else continue; } + } //////////////////////////////////////////////////////////////////////// diff --git a/TOF/AliTOFDigitizer.cxx b/TOF/AliTOFDigitizer.cxx index 0f310678fa6..c1a058bc38d 100644 --- a/TOF/AliTOFDigitizer.cxx +++ b/TOF/AliTOFDigitizer.cxx @@ -214,7 +214,11 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/) fSDigitsArray->Clear(); treeD->Fill(); - + + AliInfo("----------------------------------------"); + AliInfo(Form("%d digits have been created", fDigits->GetEntriesFast())); + AliInfo("----------------------------------------"); + outgime->WriteDigits("OVERWRITE"); outgime->UnloadDigits(); fDigits->Clear(); diff --git a/TOF/AliTOFSDigit.cxx b/TOF/AliTOFSDigit.cxx index a22a86572de..88f1faad933 100644 --- a/TOF/AliTOFSDigit.cxx +++ b/TOF/AliTOFSDigit.cxx @@ -31,10 +31,6 @@ // -- Authors: F. Pierella, A. Seganti, D. Vicinanza // //_________________________________________________________________________// -//#include "TArrayI.h" - -#include "AliLog.h" - #include "AliTOFGeometry.h" #include "AliTOFSDigit.h" @@ -194,22 +190,34 @@ void AliTOFSDigit::Update(Float_t tdcbin, Int_t tdc, Int_t adc, Int_t track) } } - if (sameTime >= 0) { + if (sameTime >= 0) { // another time measurement happens during the + // dead time of the hit pad => it corresponds + // to the same time measurement (*fAdc)[sameTime] += adc; - // update track - find the first -1 value and replace it by the - // track number - for (Int_t iTrack=0; iTrackSet(fNDigits); @@ -218,9 +226,9 @@ void AliTOFSDigit::Update(Float_t tdcbin, Int_t tdc, Int_t adc, Int_t track) (*fAdc)[fNDigits-1] = adc; fTracks->Set(fNDigits*kMAXDIGITS); (*fTracks)[(fNDigits-1)*kMAXDIGITS] = track; - for (Int_t i = 1; i GetNDigits(); + Float_t tdcbin = AliTOFGeometry::TdcBinWidth();// [ps] hardwired for the time being + Int_t track = -1; + Int_t adc = -1; + Int_t tdc = -1; + + // start loop on all sdig locations + Int_t nlocations = sdig->GetNDigits(); for (Int_t j = 0; j < nlocations; j++) { - Float_t tdcbin = AliTOFGeometry::TdcBinWidth();// [ps] hardwired for the time being - Int_t tdc=(Int_t)sdig->GetTdc(j); - Int_t adc=(Int_t)sdig->GetAdc(j); + tdc = (Int_t)sdig->GetTdc(j); + adc = (Int_t)sdig->GetAdc(j); + // getting here only the first track number - Int_t track=GetTrack(j,0); - - - Int_t sameTime = -1; - Float_t tdcwindow = AliTOFGeometry::DeadTime()/tdcbin; - for (Int_t i = 0; i < fNDigits; i++) { - if (TMath::Abs(tdc-fTdc->At(i)) < tdcwindow) { - sameTime = i; - break; - } - } - - if (sameTime >= 0) { - (*fAdc)[sameTime] += adc; - // update track - find the first -1 value and replace it by the - // track number - for (Int_t iTrack=0; iTrackSet(fNDigits); - (*fTdc)[fNDigits-1] = tdc; - fAdc->Set(fNDigits); - (*fAdc)[fNDigits-1] = adc; - fTracks->Set(fNDigits*kMAXDIGITS); - (*fTracks)[(fNDigits-1)*kMAXDIGITS] = track; - for (Int_t i = 1; i = 0) + //Int_t track = GetTrack(j,0); + + // getting here all the track numbers + for (Int_t iTrack = 0; iTrackGetTrack(j,iTrack); + Update(tdcbin, tdc, adc, track); + } // end loop on tracks + } // end loop on sdig locations + + } //////////////////////////////////////////////////////////////////////// @@ -304,8 +287,7 @@ Int_t AliTOFSDigit::GetTotPad() const // starting from the digits data. // - Int_t pad = 2*fPadx + fPadz; - //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz; + Int_t pad = AliTOFGeometry::NpadZ()*fPadx + fPadz; Int_t before=0; switch(fPlate){ diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index aeaaffc7e9c..cc417881fe0 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -459,7 +459,7 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { } geantTime *= 1.e+09; // conversion from [s] to [ns] - + // selection case for sdigitizing only hits in a given plate of a given sector if(thereIsNotASelection || (vol[0]==fSelectedSector && vol[1]==fSelectedPlate)){ @@ -497,10 +497,15 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { for(Int_t indexOfPad=0; indexOfPad=AliTOFGeometry::MatchingWindow()*1E-3) continue; - if(timediff>=0.2) nlargeTofDiff++; + // TOF matching window (~200ns) control + if (tofAfterSimul[indexOfPad]>=AliTOFGeometry::MatchingWindow()*1E-3) { + AliWarning(Form("Time measurement (%f) greater than the matching window (%f)", + tofAfterSimul[indexOfPad], AliTOFGeometry::MatchingWindow()*1E-3)); + continue; + } + + if(timediff>=0.2) nlargeTofDiff++; // greater than 200ps digit[0] = (Int_t) ((tofAfterSimul[indexOfPad]*1.e+03)/AliTOFGeometry::TdcBinWidth()); // TDC bin number (each bin -> 24.4 ps) @@ -557,7 +562,7 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { AliInfo(" "); AliInfo(Form("After sdigitizing %d hits in event %d", nselectedHitsinEv, iEvent)); //" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, " - AliInfo(Form("%d digits have been created", ntotalsdigitsinEv)); + AliInfo(Form("%d sdigits have been created", ntotalsdigitsinEv)); AliInfo(Form("(%d due to signals and %d due to border effect)", nsignalsdigitsinEv, nnoisesdigitsinEv)); AliInfo(Form("%d total updates of the hit map have been performed in current event", ntotalupdatesinEv)); AliInfo("----------------------------------------"); diff --git a/TOF/AliTOFdigit.cxx b/TOF/AliTOFdigit.cxx index 62423629f89..5caab7d415e 100644 --- a/TOF/AliTOFdigit.cxx +++ b/TOF/AliTOFdigit.cxx @@ -155,8 +155,7 @@ Int_t AliTOFdigit::GetTotPad() const break; } - Int_t pad = 2*fPadx + fPadz; - //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz; + Int_t pad = AliTOFGeometry::NpadZ()*fPadx + fPadz; Int_t strip = fStrip + before; Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad; @@ -170,13 +169,13 @@ void AliTOFdigit::AddTrack(Int_t track) // Add a new and different track to the digit // if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return; - if (fTracks[1]==0){ + if (fTracks[1]==-1) fTracks[1] = track; - }else if (fTracks[2]==0){ + else if (fTracks[2]==-1) fTracks[2] = track; - }else{ - // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n"); - } + else + printf("W-AliTOFdigit::AddTrack: Too many tracks (>3) that contribute to the same TOF digit\n"); + } // Overloading of Streaming, Sum and Comparison operators -- 2.43.0