From 33d0b83311a70297def8542dd9f01f41bea6e22d Mon Sep 17 00:00:00 2001 From: schutz Date: Mon, 3 Jul 2006 14:03:19 +0000 Subject: [PATCH] correction for ALICE numbering scheme in Trigger methods --- EMCAL/AliEMCALGeometry.cxx | 30 +++++++++++++++--------------- EMCAL/AliEMCALTrigger.cxx | 28 ++++++++++------------------ 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/EMCAL/AliEMCALGeometry.cxx b/EMCAL/AliEMCALGeometry.cxx index 264b8ff62db..2c4920dd127 100644 --- a/EMCAL/AliEMCALGeometry.cxx +++ b/EMCAL/AliEMCALGeometry.cxx @@ -456,22 +456,22 @@ void AliEMCALGeometry::FillTRU(const TClonesArray * digits, TClonesArray * ampma //First calculate the row and column in the supermodule //of the TRU to which the cell belongs. - Int_t col = (ieta-1)/nCellsEta+1; - Int_t row = (iphi-1)/nCellsPhi+1; - if(iSupMod > 10) - row = (iphi-1)/nCellsPhi2+1; + Int_t col = ieta/nCellsEta; + Int_t row = iphi/nCellsPhi; + if(iSupMod > 9) + row = iphi/nCellsPhi2; //Calculate label number of the TRU - Int_t itru = (row-1) + (col-1)*fNTRUPhi + (iSupMod-1)*fNTRU ; + Int_t itru = row + col*fNTRUPhi + iSupMod*fNTRU ; //Fill TRU matrix with cell values TMatrixD * amptrus = dynamic_cast(ampmatrix->At(itru)) ; TMatrixD * timeRtrus = dynamic_cast(timeRmatrix->At(itru)) ; //Calculate row and column of the cell inside the TRU with number itru - Int_t irow = (iphi-1) - (row-1) * nCellsPhi; - if(iSupMod > 10) - irow = (iphi-1) - (row-1) * nCellsPhi2; - Int_t icol = (ieta-1) - (col-1) * nCellsEta; + Int_t irow = iphi - row * nCellsPhi; + if(iSupMod > 9) + irow = iphi - row * nCellsPhi2; + Int_t icol = ieta - col * nCellsEta; (*amptrus)(irow,icol) = amp ; (*timeRtrus)(irow,icol) = timeR ; @@ -483,21 +483,21 @@ void AliEMCALGeometry::FillTRU(const TClonesArray * digits, TClonesArray * ampma void AliEMCALGeometry::GetCellPhiEtaIndexInSModuleFromTRUIndex(const Int_t itru, const Int_t iphitru, const Int_t ietatru, Int_t &iphiSM, Int_t &ietaSM) const { - // This method transforms the (eta,phi) index of a cells in a + // This method transforms the (eta,phi) index of cells in a // TRU matrix into Super Module (eta,phi) index. - // Calculate in which row and column in which the TRU are + // Calculate in which row and column where the TRU are // ordered in the SM - Int_t col = itru/ fNTRUPhi + 1; - Int_t row = itru - (col-1)*fNTRUPhi + 1; + Int_t col = itru/ fNTRUPhi ; + Int_t row = itru - col*fNTRUPhi ; //Calculate the (eta,phi) index in SM Int_t nCellsPhi = fNPhi*2/fNTRUPhi; Int_t nCellsEta = fNZ*2/fNTRUEta; - iphiSM = nCellsPhi*(row-1) + iphitru + 1 ; - ietaSM = nCellsEta*(col-1) + ietatru + 1 ; + iphiSM = nCellsPhi*row + iphitru ; + ietaSM = nCellsEta*col + ietatru ; } //______________________________________________________________________ diff --git a/EMCAL/AliEMCALTrigger.cxx b/EMCAL/AliEMCALTrigger.cxx index ea1f79d0bee..42d16224c0e 100644 --- a/EMCAL/AliEMCALTrigger.cxx +++ b/EMCAL/AliEMCALTrigger.cxx @@ -133,10 +133,10 @@ void AliEMCALTrigger::MakeSlidingCell(const TClonesArray * amptrus, const TClone //Sums energy of all possible 2x2 (L0) and 4x4 (L1) cells per each TRU. //Fast signal in the experiment is given by 2x2 cells, //for this reason we loop inside the TRU cells by 2. - + //Declare and initialize variables Int_t nCellsPhi = geom->GetNPhi()*2/geom->GetNTRUPhi() ; - if(isupermod > 10) + if(isupermod > 9) nCellsPhi = nCellsPhi / 2 ; //Half size SM. Not Final. // 12(tow)*2(cell)/1 TRU, cells in Phi in one TRU Int_t nCellsEta = geom->GetNEta()*2/geom->GetNTRUEta() ; @@ -145,7 +145,7 @@ void AliEMCALTrigger::MakeSlidingCell(const TClonesArray * amptrus, const TClone Float_t amp2 = 0 ; Float_t amp4 = 0 ; - for(Int_t i = 0; i < 3; i++){ + for(Int_t i = 0; i < 4; i++){ for(Int_t j = 0; j < nTRU; j++){ (*ampmax2)(i,j) = -1; (*ampmax4)(i,j) = -1; @@ -160,16 +160,17 @@ void AliEMCALTrigger::MakeSlidingCell(const TClonesArray * amptrus, const TClone (*tru2x2)(i,j) = -1; //Loop over all TRUS in a supermodule - for(Int_t itru = 0 + (isupermod - 1) * nTRU ; itru < isupermod*nTRU ; itru++) { + for(Int_t itru = 0 + isupermod * nTRU ; itru < (isupermod+1)*nTRU ; itru++) { TMatrixD * amptru = dynamic_cast(amptrus->At(itru)) ; TMatrixD * timeRtru = dynamic_cast(timeRtrus->At(itru)) ; - Int_t mtru = itru-(isupermod-1)*nTRU ; //Number of TRU in Supermodule - + Int_t mtru = itru-isupermod*nTRU ; //Number of TRU in Supermodule + //Sliding 2x2, add 2x2 amplitudes (NOT OVERLAP) for(Int_t irow = 0 ; irow < nCellsPhi; irow += 2){ for(Int_t icol = 0 ; icol < nCellsEta ; icol += 2){ amp2 = (*amptru)(irow,icol)+(*amptru)(irow+1,icol)+ (*amptru)(irow,icol+1)+(*amptru)(irow+1,icol+1); + //Fill matrix with added 2x2 crystals for use in 4x4 sums (*tru2x2)(irow/2,icol/2) = amp2 ; //Select 2x2 maximum sums to select L0 @@ -330,11 +331,6 @@ void AliEMCALTrigger::SetTriggers(const Int_t iSM, const TMatrixD *ampmax2, break; } } - // for(Int_t i = 0 ; i < nTimeBins ; i++) - // if(fADCValuesLow2x2[i]!=0||fADCValuesHigh2x2[i]!=0) - // cout<< "2x2 Time Bin "<LoadDigits("EMCAL"); fDigitsList = emcalLoader->Digits() ; } - cout<<"Simulation "<FillTRU(fDigitsList, amptrus, timeRtrus) ; //Do Cell Sliding and select Trigger @@ -431,9 +422,10 @@ void AliEMCALTrigger::Trigger() TMatrixD * ampmax2 = new TMatrixD(4,nTRU) ; TMatrixD * ampmax4 = new TMatrixD(4,nTRU) ; - for(Int_t iSM = 1 ; iSM <= nSuperModules ; iSM++) { + for(Int_t iSM = 0 ; iSM < nSuperModules ; iSM++) { //Do 2x2 and 4x4 sums, select maximums. MakeSlidingCell(amptrus, timeRtrus, iSM, ampmax2, ampmax4, geom); + //Set the trigger SetTriggers(iSM, ampmax2, ampmax4, geom) ; } -- 2.43.0