From a520bcd08bd812c512355ade69f18fed4e6561d5 Mon Sep 17 00:00:00 2001 From: gconesab Date: Fri, 10 Feb 2012 14:59:30 +0000 Subject: [PATCH] Fixes to have in 2012 geometry configuration the last 2 SM, one third of the size of a nominal supermodule in phi direction instead of half size, plus minor coding conventions corrections --- EMCAL/AliEMCALDigit.cxx | 1 + EMCAL/AliEMCALEMCGeometry.cxx | 10 ++- EMCAL/AliEMCALGeoParams.cxx | 5 +- EMCAL/AliEMCALGeoParams.h | 47 +++++----- EMCAL/AliEMCALGeometry.cxx | 111 +++++++++++++---------- EMCAL/AliEMCALGeometry.h | 5 +- EMCAL/AliEMCALRawDigit.cxx | 12 ++- EMCAL/AliEMCALRawDigit.h | 10 +-- EMCAL/AliEMCALRecoUtils.cxx | 127 +++++++++++++++++---------- EMCAL/AliEMCALRecoUtils.h | 52 ++++++----- EMCAL/AliEMCALReconstructor.cxx | 3 +- EMCAL/AliEMCALTriggerElectronics.cxx | 8 +- EMCAL/AliEMCALv0.cxx | 85 +++++++++++++----- EMCAL/AliEMCALv2.cxx | 4 +- 14 files changed, 299 insertions(+), 181 deletions(-) diff --git a/EMCAL/AliEMCALDigit.cxx b/EMCAL/AliEMCALDigit.cxx index 43be36c00ea..8d7bc452b7b 100644 --- a/EMCAL/AliEMCALDigit.cxx +++ b/EMCAL/AliEMCALDigit.cxx @@ -36,6 +36,7 @@ #include "AliEMCALDigit.h" #include "AliEMCALGeometry.h" +#include "AliLog.h" ClassImp(AliEMCALDigit) diff --git a/EMCAL/AliEMCALEMCGeometry.cxx b/EMCAL/AliEMCALEMCGeometry.cxx index 4d8d58019cc..640a48d1877 100644 --- a/EMCAL/AliEMCALEMCGeometry.cxx +++ b/EMCAL/AliEMCALEMCGeometry.cxx @@ -370,7 +370,8 @@ void AliEMCALEMCGeometry::Init(const Text_t* mcname, const Text_t* mctitle){ fNCellsInModule = fNPHIdiv*fNETAdiv; fNCellsInSupMod = fNCellsInModule*fNPhi*fNZ; fNCells = fNCellsInSupMod*fNumberOfSuperModules; - if(GetKey110DEG()) fNCells -= fNCellsInSupMod; + if(GetKey110DEG() && !fGeoName.Contains("12SMV1")) fNCells -= fNCellsInSupMod; // SM 10 and 11 are 1/2 size on phi + if(GetKey110DEG() && fGeoName.Contains("12SMV1") ) fNCells -=2*(2 * fNCellsInSupMod / 3); // SM 10 and 11 are 1/3 size on phi fNPhiSuperModule = fNumberOfSuperModules/2; if(fNPhiSuperModule < 1) fNPhiSuperModule = 1; @@ -416,8 +417,8 @@ void AliEMCALEMCGeometry::Init(const Text_t* mcname, const Text_t* mctitle){ } } if(fNumberOfSuperModules > 10) { - fPhiBoundariesOfSM[11] = 190.*TMath::DegToRad(); - fPhiBoundariesOfSM[10] = fPhiBoundariesOfSM[11] - TMath::ATan2((fParSM[1]) , fIPDistance); + fPhiBoundariesOfSM[10] = fPhiBoundariesOfSM[0] + 20.*TMath::DegToRad()*5; // in the ideal case the phi-gap is constant + fPhiBoundariesOfSM[11] = fPhiBoundariesOfSM[10] + 2.*TMath::ATan2((fParSM[1])/3., fIPDistance); // one_third SMs fPhiCentersOfSM[5] = (fPhiBoundariesOfSM[10]+fPhiBoundariesOfSM[11])/2.; } @@ -475,7 +476,8 @@ void AliEMCALEMCGeometry::PrintGeometry() fParSM[0],fParSM[1],fParSM[2]); printf(" fPhiGapForSM %7.4f cm (%7.4f <- phi size in degree)\n", fPhiGapForSM, TMath::ATan2(fPhiGapForSM,fIPDistance)*TMath::RadToDeg()); - if(GetKey110DEG()) printf(" Last two modules have size 10 degree in phi (180 %7.5f(%7.2f) : center %7.5f(%7.2f) \n", i, diff --git a/EMCAL/AliEMCALGeoParams.cxx b/EMCAL/AliEMCALGeoParams.cxx index 812e5fe1098..08f7bb7f492 100644 --- a/EMCAL/AliEMCALGeoParams.cxx +++ b/EMCAL/AliEMCALGeoParams.cxx @@ -13,10 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id: $ */ - //_________________________________________________________________________ -///*-- /////////////////////////////////////////////////////////////////////////////// // // // class for holding various EMCAL basic parameters @@ -29,5 +26,7 @@ // This empty cxx file is just added to get the class/numbers into // the Utils library // // +// Author: David Silvermyr (ORNL) +// /////////////////////////////////////////////////////////////////////////////// diff --git a/EMCAL/AliEMCALGeoParams.h b/EMCAL/AliEMCALGeoParams.h index 18b4a1c4c52..db0e029be1e 100644 --- a/EMCAL/AliEMCALGeoParams.h +++ b/EMCAL/AliEMCALGeoParams.h @@ -3,10 +3,11 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -/* $Id: AliEMCALGeoParams.h $ */ - ////////////////////////////////////////////////////////// // class for holding various parameters; +// +// Author: David Silvermyr (ORNL) +// ////////////////////////////////////////////////////////// class AliEMCALGeoParams @@ -14,32 +15,32 @@ class AliEMCALGeoParams public: // general geometry info - static const int fgkEMCALModules = 12; // number of modules for EMCAL - static const int fgkEMCALRows = 24; // number of rows per module for EMCAL - static const int fgkEMCALCols = 48; // number of columns per module for EMCAL + static const int fgkEMCALModules = 12; // number of modules for EMCAL + static const int fgkEMCALRows = 24; // number of rows per module for EMCAL + static const int fgkEMCALCols = 48; // number of columns per module for EMCAL - static const int fgkEMCALLEDRefs = 24; // number of LEDs (reference/monitors) per module for EMCAL; one per StripModule - static const int fgkEMCALTempSensors = 8; // number Temperature sensors per module for EMCAL + static const int fgkEMCALLEDRefs = 24; // number of LEDs (reference/monitors) per module for EMCAL; one per StripModule + static const int fgkEMCALTempSensors = 8; // number Temperature sensors per module for EMCAL Int_t GetStripModule(Int_t iSM, Int_t iCol) const // Strip 0 is the one closest to the FEE crates; different for A (iColumn/2) and C sides { return ( (iSM%2==0) ? iCol/2 : AliEMCALGeoParams::fgkEMCALLEDRefs - 1 - iCol/2 ); } // also a few readout related variables: - static const int fgkLastAltroDDL = 43; // 0..23 (i.e. 24) for EMCAL; 24..43 (i.e. 20) allocated for DCAL - static const int fgkSampleMax = 1023; // highest possible sample value (10-bit = 0x3ff) - static const int fgkOverflowCut = 950; // saturation starts around here; also exist as private constant in AliEMCALRawUtils, should probably be replaced - static const int fgkSampleMin = 0; // lowest possible sample value + static const int fgkLastAltroDDL = 43; // 0..23 (i.e. 24) for EMCAL; 24..43 (i.e. 20) allocated for DCAL + static const int fgkSampleMax = 1023; // highest possible sample value (10-bit = 0x3ff) + static const int fgkOverflowCut = 950; // saturation starts around here; also exist as private constant in AliEMCALRawUtils, should probably be replaced + static const int fgkSampleMin = 0; // lowest possible sample value // TRU numbers - static const int fgkEMCALTRUsPerSM = 3; // number of TRU's in a SuperModule - static const int fgkEMCAL2x2PerTRU = 96; // number of 2x2's in a TRU - static const int fgkEMCALTRURows = 4; - static const int fgkEMCALTRUCols = 24; + static const int fgkEMCALTRUsPerSM = 3; // number of TRU's in a SuperModule + static const int fgkEMCAL2x2PerTRU = 96; // number of 2x2's in a TRU + static const int fgkEMCALTRURows = 4; // number of TRU rows + static const int fgkEMCALTRUCols = 24; // number of TRY cols //STU numbers - static const int fgkEMCALSTUCols = 48; // STU columns - static const int fgkEMCALSTURows = 64; // STU rows + static const int fgkEMCALSTUCols = 48; // STU columns + static const int fgkEMCALSTURows = 64; // STU rows // RAW/AliCaloAltroMapping provides the correspondence information between // an electronics HWAddress (Branch<<1 | FEC<<7 | ALTRO<<4 | Channel) @@ -48,19 +49,19 @@ public: // into the other FEE indices, we provide the needed simple methods here // with arguments (within an RCU) Int_t GetHWAddress(Int_t iBranch, Int_t iFEC, Int_t iALTRO, Int_t iChannel) const - { return ( (iBranch<<11) | (iFEC<<7) | (iALTRO<<4) | iChannel ); }; // + { return ( (iBranch<<11) | (iFEC<<7) | (iALTRO<<4) | iChannel ); } // // and for converting back to the individual indices - Int_t GetBranch(Int_t iHW) const { return ( (iHW>>11) & 0x1 ); }; // - Int_t GetFEC(Int_t iHW) const { return ( (iHW>>7) & 0xf ); }; // - Int_t GetAltro(Int_t iHW) const { return ( (iHW>>4) & 0x7 ); }; // - Int_t GetChannel(Int_t iHW) const { return ( iHW & 0xf ); }; // + Int_t GetBranch(Int_t iHW) const { return ( (iHW>>11) & 0x1 ) ; } // + Int_t GetFEC(Int_t iHW) const { return ( (iHW>>7) & 0xf ) ; } // + Int_t GetAltro(Int_t iHW) const { return ( (iHW>>4) & 0x7 ) ; } // + Int_t GetChannel(Int_t iHW) const { return ( iHW & 0xf ) ; } // // We can also encode a very similar CSP address Int_t GetCSPAddress(Int_t iBranch, Int_t iFEC, Int_t iCSP) const { return ( (iBranch<<11) | (iFEC<<7) | iCSP ); }; // // and for converting back to the individual indices // Branch and FEC methods would just be the same as above - Int_t GetCSPFromAddress(Int_t i) const { return ( i & 0x1f ); }; // + Int_t GetCSPFromAddress(Int_t i) const { return ( i & 0x1f ) ; } // /* // Below is some placeholder info that can later be added // in AliEMCALGeometry, together with the Get methods just above diff --git a/EMCAL/AliEMCALGeometry.cxx b/EMCAL/AliEMCALGeometry.cxx index a21a77feaa7..ef474f84ed8 100644 --- a/EMCAL/AliEMCALGeometry.cxx +++ b/EMCAL/AliEMCALGeometry.cxx @@ -40,7 +40,7 @@ // the sizes updated with last information from production // drawing (end of October 2010). // -// EMCAL_COMPLETEV1: Same fixes as FIRSTYEAR and 10 SM instead of 10+2 half SM, for 2011 runs +// EMCAL_COMPLETEV1: Same fixes as FIRSTYEAR and 10 SM instead of 10 + 2 one_third SM, for 2011 runs // // EMCAL_COMPLETE12SMV1: contains 12 SM for runs from year 2012 and on // @@ -106,6 +106,7 @@ //#include // --- AliRoot header files --- +#include "AliLog.h" #include "AliEMCALGeometry.h" #include "AliEMCALShishKebabTrd1Module.h" @@ -460,8 +461,10 @@ Int_t AliEMCALGeometry::GetAbsCellId(Int_t nSupMod, Int_t nModule, Int_t nIphi, // 0 <= nIeta < fNETAdiv // 0 <= absid < fNCells static Int_t id=0; // have to change from 0 to fNCells-1 - if(fKey110DEG == 1 && nSupMod >= 10) { // 110 degree case; last two supermodules + if(fKey110DEG == 1 && nSupMod >= 10 && !fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules halfsupermodules id = fNCellsInSupMod*10 + (fNCellsInSupMod/2)*(nSupMod-10); + } else if(fKey110DEG == 1 && nSupMod >= 10 && fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules 1/3 supermodules + id = fNCellsInSupMod*10 + (fNCellsInSupMod/3)*(nSupMod-10); } else { id = fNCellsInSupMod*nSupMod; } @@ -549,10 +552,14 @@ Bool_t AliEMCALGeometry::GetAbsCellIdFromEtaPhi(Double_t eta, Double_t phi, Int_ phi = TVector2::Phi_0_2pi(phi); phiLoc = phi - fPhiCentersOfSM[nSupMod/2]; nphi = fPhiCentersOfCells.GetSize(); - if(nSupMod>=10) { - phiLoc = phi - 190.*TMath::DegToRad(); + if(nSupMod>=10 && !fGeoName.Contains("12SMV1")) { + phiLoc = phi - 190.*TMath::DegToRad(); // half-size case... the reference for the loc is still 190 deg..? nphi /= 2; } + if(nSupMod>=10 && fGeoName.Contains("12SMV1")) { + // in the one_third case the variable fPhiCentersOfSM behaves like for the full_module. + nphi /= 3; + } dmin = TMath::Abs(fPhiCentersOfCells[0]-phiLoc); iphi = 0; @@ -579,18 +586,11 @@ Bool_t AliEMCALGeometry::GetAbsCellIdFromEtaPhi(Double_t eta, Double_t phi, Int_ } } AliDebug(2,Form(" ieta %i : dmin %f (eta=%f) : nSupMod %i ", ieta, dmin, eta, nSupMod)); - - if(eta<0) iphi = (nphi-1) - iphi; - - //patch for mapping following alice convention - if(nSupMod%2 == 0) - ieta = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention. - else { - if(nSupMod<10) - iphi = (fCentersOfCellsPhiDir.GetSize()-1) -iphi;// 23-iphi, revert the ordering on C side in order to keep convention. - else - iphi = (fCentersOfCellsPhiDir.GetSize()/2-1)-iphi;// 11-iphi, revert the ordering on C side in order to keep convention. - } + + //patch for mapping following alice convention + if(nSupMod%2 == 0) + ieta = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention. + absId = GetAbsCellIdFromCellIndexes(nSupMod, iphi, ieta); @@ -625,10 +625,13 @@ Bool_t AliEMCALGeometry::GetCellIndex(Int_t absId,Int_t &nSupMod,Int_t &nModule, if(!CheckAbsCellId(absId)) return kFALSE; sm10 = fNCellsInSupMod*10; - if(fKey110DEG == 1 && absId >= sm10) { // 110 degree case; last two supermodules + if(fKey110DEG == 1 && absId >= sm10 && !fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules are halfsupermodules nSupMod = (absId-sm10) / (fNCellsInSupMod/2) + 10; tmp = (absId-sm10) % (fNCellsInSupMod/2); - } else { + } else if(fKey110DEG == 1 && absId >= sm10 && fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules are 1/3 supermodules + nSupMod = (absId-sm10) / (fNCellsInSupMod/3) + 10; + tmp = (absId-sm10) % (fNCellsInSupMod/3); + } else { nSupMod = absId / fNCellsInSupMod; tmp = absId % fNCellsInSupMod; } @@ -662,8 +665,9 @@ void AliEMCALGeometry::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModul // iphim - have to change from 0 to nphi-1 (fNPhi-1 or fNPhi/2-1) static Int_t nphi=-1; - if(fKey110DEG == 1 && nSupMod>=10) nphi = fNPhi/2; - else nphi = fNPhi; + if(fKey110DEG == 1 && nSupMod>=10 && !fGeoName.Contains("12SMV1") ) nphi = fNPhi/2; // halfSM + else if(fKey110DEG == 1 && nSupMod>=10 && fGeoName.Contains("12SMV1") ) nphi = fNPhi/3; // 1/3 SM + else nphi = fNPhi; // full SM ietam = nModule/nphi; iphim = nModule%nphi; @@ -714,8 +718,15 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t // xr,yr,zr - x,y,z coordinates of cell with absId inside SM // Shift index taking into account the difference between standard SM - // and SM of half size in phi direction - const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 + // and SM of half (or one third) size in phi direction + + Int_t workaround; // a small trick to be able to define the const variable kphiIndexShift + //if half, two parts, 1/4 wide, should be remove. In case of one_third SM, the two parts to be removed are 1/3 each + if(fKey110DEG == 1 && !fGeoName.Contains("12SMV1")) workaround=4; // half SM case + else workaround=3; // one third of SM case + const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/workaround; + const Int_t kphiRangeSmallSM = fCentersOfCellsPhiDir.GetSize()-2*kphiIndexShift; + static Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1; if(!CheckAbsCellId(absId)) return kFALSE; @@ -738,7 +749,7 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t } else { if(nSupMod%2 != 0) - iphi2 = (fCentersOfCellsPhiDir.GetSize()/2-1)-iphi;// 11-iphi, revert the ordering on C side in order to keep convention. + iphi2 = (kphiRangeSmallSM-1)-iphi;// 11-iphi [1/2SM] or 7-iphi [1/3SM], revert the ordering on C side in order to keep convention. yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift); } AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr)); @@ -790,8 +801,15 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t distEff, Doub // xr,yr,zr - x,y,z coordinates of cell with absId inside SM // Shift index taking into account the difference between standard SM - // and SM of half size in phi direction - const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 + // and SM of half (or one third) size in phi direction + + Int_t workaround; // a small trick to be able to define the const variable kphiIndexShift + //if half, two parts, 1/4 wide, should be remove. In case of one_third SM, the two parts to be removed are 1/3 each + if(fKey110DEG == 1 && !fGeoName.Contains("12SMV1")) workaround=4; // half SM case + else workaround=3; // one third of SM case + const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/workaround; + const Int_t kphiRangeSmallSM = fCentersOfCellsPhiDir.GetSize()-2*kphiIndexShift; + static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1; static Int_t iphim=-1, ietam=-1; static AliEMCALShishKebabTrd1Module *mod = 0; @@ -821,9 +839,9 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t distEff, Doub yr = fCentersOfCellsPhiDir.At(iphi2); } else { - if(nSupMod%2 != 0) - iphi2 = (fCentersOfCellsPhiDir.GetSize()/2-1)-iphi;// 11-iphi, revert the ordering on C side in order to keep convention. - yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift); + if(nSupMod%2 != 0) + iphi2 = (kphiRangeSmallSM-1)-iphi;// 11-iphi [1/2SM] or 7-iphi [1/3SM], revert the ordering on C side in order to keep convention. + yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift); } AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr)); @@ -1539,23 +1557,28 @@ const TGeoHMatrix * AliEMCALGeometry::GetMatrixForSuperModule(Int_t smod) const } }//external matrices - if(gGeoManager){ + if(gGeoManager){ const Int_t buffersize = 255; - char path[buffersize] ; - snprintf(path,buffersize,"/ALIC_1/XEN1_1/SMOD_%d",smod+1) ; - //TString volpath = "ALIC_1/XEN1_1/SMOD_"; - //volpath += smod+1; - - if(fKey110DEG && smod >= 10){ - snprintf(path,buffersize,"/ALIC_1/XEN1_1/SM10_%d",smod-10+1) ; - //volpath = "ALIC_1/XEN1_1/SM10_"; - //volpath += smod-10+1; - } - if (!gGeoManager->cd(path)){ - AliFatal(Form("Geo manager can not find path %s!\n",path)); - } - return gGeoManager->GetCurrentMatrix(); - } + char path[buffersize] ; + snprintf(path,buffersize,"/ALIC_1/XEN1_1/SMOD_%d",smod+1) ; + //TString volpath = "ALIC_1/XEN1_1/SMOD_"; + //volpath += smod+1; + + if(fKey110DEG && smod >= 10 && !fGeoName.Contains("12SMV1") ){ + snprintf(path,buffersize,"/ALIC_1/XEN1_1/SM10_%d",smod-10+1) ; + //volpath = "ALIC_1/XEN1_1/SM10_"; + //volpath += smod-10+1; + } + if(fKey110DEG && smod >= 10 && fGeoName.Contains("12SMV1") ){ + snprintf(path,buffersize,"/ALIC_1/XEN1_1/SM3rd_%d",smod-10+1) ; + //volpath = "ALIC_1/XEN1_1/SM10_"; + //volpath += smod-10+1; + } + if (!gGeoManager->cd(path)){ + AliFatal(Form("Geo manager can not find path %s!\n",path)); + } + return gGeoManager->GetCurrentMatrix(); + } return 0 ; } diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index 927a04a8fbe..826b678c39c 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -28,7 +28,7 @@ class TParticle ; #include "AliEMCALEMCGeometry.h" #include "AliEMCALGeoParams.h" class AliEMCALShishKebabTrd1Module; -#include "AliLog.h" // CV +class AliLog; class AliEMCALGeometry : public TNamed { @@ -201,7 +201,8 @@ public: Int_t GetSuperModuleNumber(Int_t absId) const; Int_t GetNumberOfModuleInPhiDirection(Int_t nSupMod) const { - if(fKey110DEG == 1 && nSupMod>=10) return fNPhi/2; + if(fKey110DEG == 1 && nSupMod>=10 && !fGeoName.Contains("12SMV1")) return fNPhi/2; + else if(fKey110DEG == 1 && nSupMod>=10 && fGeoName.Contains("12SMV1")) return fNPhi/3; else return fNPhi; } // From cell indexes to abs cell id diff --git a/EMCAL/AliEMCALRawDigit.cxx b/EMCAL/AliEMCALRawDigit.cxx index d076e2d8907..307489aa1d9 100644 --- a/EMCAL/AliEMCALRawDigit.cxx +++ b/EMCAL/AliEMCALRawDigit.cxx @@ -72,7 +72,8 @@ void AliEMCALRawDigit::Clear(Option_t *) //____________________________________________________________________________ Bool_t AliEMCALRawDigit::GetTimeSample(const Int_t iSample, Int_t& timeBin, Int_t& amp) const { - // + // returns the time and amplitude of a given time sample and if the sample was ok + if (iSample > fNSamples || iSample < 0) return kFALSE; amp = fSamples[iSample] & 0xFFF; @@ -84,7 +85,8 @@ Bool_t AliEMCALRawDigit::GetTimeSample(const Int_t iSample, Int_t& timeBin, Int_ //____________________________________________________________________________ void AliEMCALRawDigit::SetTimeSamples(const Int_t timeSamples[], const Int_t nSamples) { - // + // Sets the time samples + if (fSamples) { AliDebug(1,"Samples already filled: delete first!"); @@ -100,7 +102,8 @@ void AliEMCALRawDigit::SetTimeSamples(const Int_t timeSamples[], const Int_t nSa //____________________________________________________________________________ Bool_t AliEMCALRawDigit::GetMaximum(Int_t& amplitude, Int_t& time) const { - // + // Checks the maximum amplitude in the time sample + if (!fNSamples) { AliDebug(1,"Digit has no time sample"); @@ -149,7 +152,8 @@ Int_t AliEMCALRawDigit::Compare(const TObject * obj) const //____________________________________________________________________________ void AliEMCALRawDigit::Print(const Option_t* /*opt*/) const { - // + // print + printf("===\n| Digit id: %4d / %d Time Samples: \n",fId,fNSamples); for (Int_t i=0; i < fNSamples; i++) { diff --git a/EMCAL/AliEMCALRawDigit.h b/EMCAL/AliEMCALRawDigit.h index ef1fd695613..814aa6a8e6d 100644 --- a/EMCAL/AliEMCALRawDigit.h +++ b/EMCAL/AliEMCALRawDigit.h @@ -45,11 +45,11 @@ protected: AliEMCALRawDigit(const AliEMCALRawDigit &cd); // Not implemented AliEMCALRawDigit &operator=(const AliEMCALRawDigit &cd); // Not implemented - Int_t fId; //Absolute id - Int_t fNSamples; //Number of time samples - Int_t* fSamples; //[fNSamples] - Float_t fAmplitude; - Float_t fTime; + Int_t fId; // Absolute id + Int_t fNSamples; // Number of time samples + Int_t* fSamples; //[fNSamples] + Float_t fAmplitude; // digit amplitude + Float_t fTime; // digit time ClassDef(AliEMCALRawDigit,1) // Digit in EMCAL }; diff --git a/EMCAL/AliEMCALRecoUtils.cxx b/EMCAL/AliEMCALRecoUtils.cxx index 522acd6ee70..438379bcc91 100644 --- a/EMCAL/AliEMCALRecoUtils.cxx +++ b/EMCAL/AliEMCALRecoUtils.cxx @@ -44,6 +44,7 @@ #include "AliVCaloCells.h" #include "AliLog.h" #include "AliPID.h" +#include "AliESDEvent.h" #include "AliAODEvent.h" #include "AliESDtrack.h" #include "AliAODTrack.h" @@ -339,8 +340,10 @@ Bool_t AliEMCALRecoUtils::AcceptCalibrateCell(const Int_t absID, const Int_t bc, return kTRUE; } -//_______________________________________________________________ -Bool_t AliEMCALRecoUtils::CheckCellFiducialRegion(AliEMCALGeometry* geom, AliVCluster* cluster, AliVCaloCells* cells) +//_____________________________________________________________________________ +Bool_t AliEMCALRecoUtils::CheckCellFiducialRegion(const AliEMCALGeometry* geom, + const AliVCluster* cluster, + AliVCaloCells* cells) { // Given the list of AbsId of the cluster, get the maximum cell and // check if there are fNCellsFromBorder from the calorimeter border @@ -375,9 +378,12 @@ Bool_t AliEMCALRecoUtils::CheckCellFiducialRegion(AliEMCALGeometry* geom, AliVCl if(iSM < 10){ if(iphi >= fNCellsFromEMCALBorder && iphi < 24-fNCellsFromEMCALBorder) okrow =kTRUE; } - else{ - if(iphi >= fNCellsFromEMCALBorder && iphi < 12-fNCellsFromEMCALBorder) okrow =kTRUE; - } + else if (iSM >=10 && ( ( geom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) { + if(iphi >= fNCellsFromEMCALBorder && iphi < 8-fNCellsFromEMCALBorder) okrow =kTRUE; //1/3 sm case + } + else { + if(iphi >= fNCellsFromEMCALBorder && iphi < 12-fNCellsFromEMCALBorder) okrow =kTRUE; // half SM case + } //Check columns/eta if(!fNoEMCALBorderAtEta0){ @@ -408,8 +414,10 @@ Bool_t AliEMCALRecoUtils::CheckCellFiducialRegion(AliEMCALGeometry* geom, AliVCl } -//_________________________________________________________________________________________________________ -Bool_t AliEMCALRecoUtils::ClusterContainsBadChannel(const AliEMCALGeometry* geom, const UShort_t* cellList, const Int_t nCells) +//_______________________________________________________________________________ +Bool_t AliEMCALRecoUtils::ClusterContainsBadChannel(const AliEMCALGeometry* geom, + const UShort_t* cellList, + const Int_t nCells) { // Check that in the cluster cells, there is no bad channel of those stored // in fEMCALBadChannelMap or fPHOSBadChannelMap @@ -437,7 +445,7 @@ Bool_t AliEMCALRecoUtils::ClusterContainsBadChannel(const AliEMCALGeometry* geom return kFALSE; } -//_______________________________________________________________________ +//_____________________________________________________________________________________________ Bool_t AliEMCALRecoUtils::IsExoticCell(const Int_t absID, AliVCaloCells* cells, const Int_t bc) { // Look to cell neighbourhood and reject if it seems exotic @@ -503,8 +511,10 @@ Bool_t AliEMCALRecoUtils::IsExoticCell(const Int_t absID, AliVCaloCells* cells, return kFALSE; } -//_________________________________________________ -Bool_t AliEMCALRecoUtils::IsExoticCluster(AliVCluster *cluster, AliVCaloCells *cells, const Int_t bc) +//___________________________________________________________________ +Bool_t AliEMCALRecoUtils::IsExoticCluster(const AliVCluster *cluster, + AliVCaloCells *cells, + const Int_t bc) { // Check if the cluster highest energy tower is exotic @@ -524,7 +534,7 @@ Bool_t AliEMCALRecoUtils::IsExoticCluster(AliVCluster *cluster, AliVCaloCells *c return IsExoticCell(absId,cells,bc); } -//__________________________________________________ +//_______________________________________________________________________ Float_t AliEMCALRecoUtils::SmearClusterEnergy(const AliVCluster* cluster) { //In case of MC analysis, smear energy to match resolution/calibration in real data @@ -546,7 +556,7 @@ Float_t AliEMCALRecoUtils::SmearClusterEnergy(const AliVCluster* cluster) return rdmEnergy; } -//__________________________________________________ +//____________________________________________________________________________ Float_t AliEMCALRecoUtils::CorrectClusterEnergyLinearity(AliVCluster* cluster) { // Correct cluster energy from non linearity functions @@ -686,8 +696,10 @@ void AliEMCALRecoUtils::InitNonLinearityParam() } } -//__________________________________________________ -Float_t AliEMCALRecoUtils::GetDepth(const Float_t energy, const Int_t iParticle, const Int_t iSM) const +//_________________________________________________________ +Float_t AliEMCALRecoUtils::GetDepth(const Float_t energy, + const Int_t iParticle, + const Int_t iSM) const { //Calculate shower depth for a given cluster energy and particle type @@ -738,11 +750,11 @@ Float_t AliEMCALRecoUtils::GetDepth(const Float_t energy, const Int_t iParticle void AliEMCALRecoUtils::GetMaxEnergyCell(const AliEMCALGeometry *geom, AliVCaloCells* cells, const AliVCluster* clu, - Int_t & absId, - Int_t& iSupMod, - Int_t& ieta, - Int_t& iphi, - Bool_t &shared) + Int_t & absId, + Int_t & iSupMod, + Int_t & ieta, + Int_t & iphi, + Bool_t & shared) { //For a given CaloCluster gets the absId of the cell //with maximum energy deposit. @@ -903,7 +915,7 @@ void AliEMCALRecoUtils::InitEMCALRecalibrationFactors() TH1::AddDirectory(oldStatus); } -//________________________________________________________________ +//_________________________________________________________ void AliEMCALRecoUtils::InitEMCALTimeRecalibrationFactors() { //Init EMCAL recalibration factors @@ -930,7 +942,7 @@ void AliEMCALRecoUtils::InitEMCALTimeRecalibrationFactors() TH1::AddDirectory(oldStatus); } -//________________________________________________________________ +//____________________________________________________ void AliEMCALRecoUtils::InitEMCALBadChannelStatusMap() { //Init EMCAL bad channels map @@ -1054,8 +1066,9 @@ void AliEMCALRecoUtils::RecalibrateClusterEnergy(const AliEMCALGeometry* geom, } } -//________________________________________________________________ -void AliEMCALRecoUtils::RecalibrateCells(AliVCaloCells * cells, Int_t bc) +//_____________________________________________________________ +void AliEMCALRecoUtils::RecalibrateCells(AliVCaloCells * cells, + const Int_t bc) { // Recalibrate the cells time and energy, considering the recalibration map and the energy // of the cells that compose the cluster. @@ -1102,8 +1115,10 @@ void AliEMCALRecoUtils::RecalibrateCellTime(const Int_t absId, const Int_t bc, D } } -//__________________________________________________ -void AliEMCALRecoUtils::RecalculateClusterPosition(AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu) +//______________________________________________________________________________ +void AliEMCALRecoUtils::RecalculateClusterPosition(const AliEMCALGeometry *geom, + AliVCaloCells* cells, + AliVCluster* clu) { //For a given CaloCluster recalculates the position for a given set of misalignment shifts and puts it again in the CaloCluster. @@ -1117,8 +1132,10 @@ void AliEMCALRecoUtils::RecalculateClusterPosition(AliEMCALGeometry *geom, AliVC else AliDebug(2,"Algorithm to recalculate position not selected, do nothing."); } -//__________________________________________________ -void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerGlobal(AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu) +//_____________________________________________________________________________________________ +void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerGlobal(const AliEMCALGeometry *geom, + AliVCaloCells* cells, + AliVCluster* clu) { // For a given CaloCluster recalculates the position for a given set of misalignment shifts and puts it again in the CaloCluster. // The algorithm is a copy of what is done in AliEMCALRecPoint @@ -1194,8 +1211,10 @@ void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerGlobal(AliEMCALGeomet clu->SetPosition(newPos); } -//__________________________________________________ -void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerIndex(AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu) +//____________________________________________________________________________________________ +void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerIndex(const AliEMCALGeometry *geom, + AliVCaloCells* cells, + AliVCluster* clu) { // For a given CaloCluster recalculates the position for a given set of misalignment shifts and puts it again in the CaloCluster. // The algorithm works with the tower indeces, averages the indeces and from them it calculates the global position @@ -1263,8 +1282,10 @@ void AliEMCALRecoUtils::RecalculateClusterPositionFromTowerIndex(AliEMCALGeometr clu->SetPosition(xyzNew); } -//____________________________________________________________________________ -void AliEMCALRecoUtils::RecalculateClusterDistanceToBadChannel(AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster) +//___________________________________________________________________________________________ +void AliEMCALRecoUtils::RecalculateClusterDistanceToBadChannel(const AliEMCALGeometry * geom, + AliVCaloCells* cells, + AliVCluster * cluster) { //re-evaluate distance to bad channel with updated bad map @@ -1338,7 +1359,7 @@ void AliEMCALRecoUtils::RecalculateClusterDistanceToBadChannel(AliEMCALGeometry cluster->SetDistanceToBadChannel(minDist); } -//____________________________________________________________________________ +//__________________________________________________________________ void AliEMCALRecoUtils::RecalculateClusterPID(AliVCluster * cluster) { //re-evaluate identification parameters with bayesian @@ -1357,8 +1378,10 @@ void AliEMCALRecoUtils::RecalculateClusterPID(AliVCluster * cluster) cluster->SetPID(pidlist); } -//____________________________________________________________________________ -void AliEMCALRecoUtils::RecalculateClusterShowerShapeParameters(AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster) +//____________________________________________________________________________________________ +void AliEMCALRecoUtils::RecalculateClusterShowerShapeParameters(const AliEMCALGeometry * geom, + AliVCaloCells* cells, + AliVCluster * cluster) { // Calculates new center of gravity in the local EMCAL-module coordinates // and tranfers into global ALICE coordinates @@ -1491,7 +1514,9 @@ void AliEMCALRecoUtils::RecalculateClusterShowerShapeParameters(AliEMCALGeometry } //____________________________________________________________________________ -void AliEMCALRecoUtils::FindMatches(AliVEvent *event,TObjArray * clusterArr, AliEMCALGeometry *geom) +void AliEMCALRecoUtils::FindMatches(AliVEvent *event, + TObjArray * clusterArr, + const AliEMCALGeometry *geom) { //This function should be called before the cluster loop //Before call this function, please recalculate the cluster positions @@ -1655,7 +1680,10 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,TObjArray * clusterArr, Al } //________________________________________________________________________________ -Int_t AliEMCALRecoUtils::FindMatchedClusterInEvent(AliESDtrack *track, AliVEvent *event, AliEMCALGeometry *geom, Float_t &dEta, Float_t &dPhi) +Int_t AliEMCALRecoUtils::FindMatchedClusterInEvent(const AliESDtrack *track, + const AliVEvent *event, + const AliEMCALGeometry *geom, + Float_t &dEta, Float_t &dPhi) { // // This function returns the index of matched cluster to input track @@ -1686,8 +1714,11 @@ Int_t AliEMCALRecoUtils::FindMatchedClusterInEvent(AliESDtrack *track, AliVEvent return index; } -//________________________________________________________________________________ -Int_t AliEMCALRecoUtils::FindMatchedClusterInClusterArr(AliExternalTrackParam *emcalParam, AliExternalTrackParam *trkParam, TObjArray * clusterArr, Float_t &dEta, Float_t &dPhi) +//________________________________________________________________________________________ +Int_t AliEMCALRecoUtils::FindMatchedClusterInClusterArr(AliExternalTrackParam *emcalParam, + AliExternalTrackParam *trkParam, + TObjArray * clusterArr, + Float_t &dEta, Float_t &dPhi) { dEta=-999, dPhi=-999; Float_t dRMax = fCutR, dEtaMax=fCutEta, dPhiMax=fCutPhi; @@ -1745,9 +1776,9 @@ Int_t AliEMCALRecoUtils::FindMatchedClusterInClusterArr(AliExternalTrackParam * //------------------------------------------------------------------------------------ Bool_t AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, - Double_t emcalR, - Double_t mass, - Double_t step, + const Double_t emcalR, + const Double_t mass, + const Double_t step, Float_t &eta, Float_t &phi) { @@ -1801,8 +1832,8 @@ Bool_t AliEMCALRecoUtils::ExtrapolateTrackToPosition(AliExternalTrackParam *trkP //---------------------------------------------------------------------------------- Bool_t AliEMCALRecoUtils::ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, AliVCluster *cluster, - Double_t mass, - Double_t step, + const Double_t mass, + const Double_t step, Float_t &tmpEta, Float_t &tmpPhi) { @@ -1832,8 +1863,9 @@ Bool_t AliEMCALRecoUtils::ExtrapolateTrackToCluster(AliExternalTrackParam *trkPa return ExtrapolateTrackToCluster(trkParam, cluster, fMass, fStepCluster, tmpEta, tmpPhi); } -//_______________________________________________________________________________________ -void AliEMCALRecoUtils::GetMatchedResiduals(Int_t clsIndex, Float_t &dEta, Float_t &dPhi) +//_______________________________________________________________________ +void AliEMCALRecoUtils::GetMatchedResiduals(const Int_t clsIndex, + Float_t &dEta, Float_t &dPhi) { //Given a cluster index as in AliESDEvent::GetCaloCluster(clsIndex) //Get the residuals dEta and dPhi for this cluster to the closest track @@ -1958,8 +1990,9 @@ UInt_t AliEMCALRecoUtils::FindMatchedPosForTrack(Int_t trkIndex) const return pos; } -//___________________________________________________________________________________ -Bool_t AliEMCALRecoUtils::IsGoodCluster(AliVCluster *cluster, AliEMCALGeometry *geom, +//__________________________________________________________________________ +Bool_t AliEMCALRecoUtils::IsGoodCluster(AliVCluster *cluster, + const AliEMCALGeometry *geom, AliVCaloCells* cells,const Int_t bc) { // check if the cluster survives some quality cut diff --git a/EMCAL/AliEMCALRecoUtils.h b/EMCAL/AliEMCALRecoUtils.h index 1eeaa34daec..e8399006788 100644 --- a/EMCAL/AliEMCALRecoUtils.h +++ b/EMCAL/AliEMCALRecoUtils.h @@ -27,7 +27,7 @@ class TH2F; class AliVCluster; class AliVCaloCells; class AliVEvent; -#include "AliESDEvent.h" +class AliESDEvent; #include "AliLog.h" // EMCAL includes @@ -60,9 +60,9 @@ public: //Position recalculation //----------------------------------------------------- - void RecalculateClusterPosition (AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); - void RecalculateClusterPositionFromTowerIndex (AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); - void RecalculateClusterPositionFromTowerGlobal(AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); + void RecalculateClusterPosition (const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); + void RecalculateClusterPositionFromTowerIndex (const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); + void RecalculateClusterPositionFromTowerGlobal(const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); Float_t GetCellWeight(const Float_t eCell, const Float_t eCluster) const { return TMath::Max( 0., fW0 + TMath::Log( eCell / eCluster )) ; } @@ -193,7 +193,9 @@ public: // Modules fiducial region, remove clusters in borders //----------------------------------------------------- - Bool_t CheckCellFiducialRegion(AliEMCALGeometry* geom, AliVCluster* cluster, AliVCaloCells* cells) ; + Bool_t CheckCellFiducialRegion(const AliEMCALGeometry* geom, + const AliVCluster* cluster, + AliVCaloCells* cells) ; void SetNumberOfCellsFromEMCALBorder(const Int_t n){ fNCellsFromEMCALBorder = n ; } Int_t GetNumberOfCellsFromEMCALBorder() const { return fNCellsFromEMCALBorder ; } @@ -235,8 +237,8 @@ public: // Recalculate other cluster parameters //----------------------------------------------------- - void RecalculateClusterDistanceToBadChannel (AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); - void RecalculateClusterShowerShapeParameters(AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); + void RecalculateClusterDistanceToBadChannel (const AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); + void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); void RecalculateClusterPID(AliVCluster * cluster); AliEMCALPIDUtils * GetPIDUtils() { return fPIDUtils;} @@ -246,29 +248,34 @@ public: // Track matching //---------------------------------------------------- - void FindMatches(AliVEvent *event, TObjArray * clusterArr=0x0, AliEMCALGeometry *geom=0x0); - Int_t FindMatchedClusterInEvent(AliESDtrack *track, AliVEvent *event, AliEMCALGeometry *geom, Float_t &dEta, Float_t &dPhi); - Int_t FindMatchedClusterInClusterArr(AliExternalTrackParam *emcalParam, AliExternalTrackParam *trkParam, TObjArray * clusterArr, Float_t &dEta, Float_t &dPhi); + void FindMatches(AliVEvent *event, TObjArray * clusterArr=0x0, const AliEMCALGeometry *geom=0x0); + Int_t FindMatchedClusterInEvent(const AliESDtrack *track, const AliVEvent *event, + const AliEMCALGeometry *geom, Float_t &dEta, Float_t &dPhi); + Int_t FindMatchedClusterInClusterArr(AliExternalTrackParam *emcalParam, AliExternalTrackParam *trkParam, + TObjArray * clusterArr, Float_t &dEta, Float_t &dPhi); - static Bool_t ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, Double_t emcalR, - Double_t mass, Double_t step, Float_t &eta, Float_t &phi); + static Bool_t ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, + const Double_t emcalR, const Double_t mass, const Double_t step, + Float_t &eta, Float_t &phi); static Bool_t ExtrapolateTrackToPosition(AliExternalTrackParam *trkParam, const Float_t *clsPos, - Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi); + const Double_t mass, const Double_t step, + Float_t &tmpEta, Float_t &tmpPhi); static Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, - Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi); + const Double_t mass, const Double_t step, + Float_t &tmpEta, Float_t &tmpPhi); Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, Float_t &tmpEta, Float_t &tmpPhi); - UInt_t FindMatchedPosForCluster(Int_t clsIndex) const; - UInt_t FindMatchedPosForTrack(Int_t trkIndex) const; + UInt_t FindMatchedPosForCluster(const Int_t clsIndex) const; + UInt_t FindMatchedPosForTrack (const Int_t trkIndex) const; - void GetMatchedResiduals(Int_t clsIndex, Float_t &dEta, Float_t &dPhi); - void GetMatchedClusterResiduals(Int_t trkIndex, Float_t &dEta, Float_t &dPhi); + void GetMatchedResiduals (const Int_t clsIndex, Float_t &dEta, Float_t &dPhi); + void GetMatchedClusterResiduals(const Int_t trkIndex, Float_t &dEta, Float_t &dPhi); Int_t GetMatchedTrackIndex(Int_t clsIndex); Int_t GetMatchedClusterIndex(Int_t trkIndex); - Bool_t IsClusterMatched(Int_t clsIndex) const; - Bool_t IsTrackMatched(Int_t trkIndex) const; + Bool_t IsClusterMatched(const Int_t clsIndex) const; + Bool_t IsTrackMatched (const Int_t trkIndex) const; void SetClusterMatchedToTrack (const AliESDEvent *event); @@ -306,14 +313,15 @@ public: void SetExoticCellDiffTimeCut(Float_t dt) { fExoticCellDiffTime = dt ; } void SetExoticCellMinAmplitudeCut(Float_t ma) { fExoticCellMinAmplitude = ma ; } - Bool_t IsExoticCluster(AliVCluster *cluster, AliVCaloCells* cells, const Int_t bc=0) ; + Bool_t IsExoticCluster(const AliVCluster *cluster, AliVCaloCells* cells, const Int_t bc=0) ; void SwitchOnRejectExoticCluster() { fRejectExoticCluster = kTRUE ; fRejectExoticCells = kTRUE ; } void SwitchOffRejectExoticCluster() { fRejectExoticCluster = kFALSE ; } Bool_t IsRejectExoticCluster() const { return fRejectExoticCluster ; } //Cluster cut - Bool_t IsGoodCluster(AliVCluster *cluster, AliEMCALGeometry *geom, AliVCaloCells* cells, const Int_t bc =-1); + Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, + AliVCaloCells* cells, const Int_t bc =-1); //Track Cuts Bool_t IsAccepted(AliESDtrack *track); diff --git a/EMCAL/AliEMCALReconstructor.cxx b/EMCAL/AliEMCALReconstructor.cxx index 7da97b3732a..b2a6da7c070 100644 --- a/EMCAL/AliEMCALReconstructor.cxx +++ b/EMCAL/AliEMCALReconstructor.cxx @@ -644,7 +644,8 @@ void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{ TGeoHMatrix * m = 0x0; for(Int_t sm = 0; sm < fGeom->GetNumberOfSuperModules(); sm++){ snprintf(path,bufsize,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5 - if(sm >= 10) snprintf(path,bufsize,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ; + if(sm >= 10 && !((fGeom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) snprintf(path,bufsize,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ; + if(sm >= 10 && ((fGeom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) snprintf(path,bufsize,"/ALIC_1/XEN1_1/SM3rd_%d",sm-10+1) ; if (gGeoManager->CheckPath(path)){ gGeoManager->cd(path); diff --git a/EMCAL/AliEMCALTriggerElectronics.cxx b/EMCAL/AliEMCALTriggerElectronics.cxx index e87b64c3ffc..fa0183247e6 100644 --- a/EMCAL/AliEMCALTriggerElectronics.cxx +++ b/EMCAL/AliEMCALTriggerElectronics.cxx @@ -218,8 +218,8 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_ { AliEMCALTriggerTRU* iTRU = static_cast(fTRU->At(i)); - TIter Next(&iTRU->Patches()); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)Next()) + TIter next(&iTRU->Patches()); + while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)next()) { p->Position(px, py); @@ -377,8 +377,8 @@ void AliEMCALTriggerElectronics::Reset() { // Reset - TIter NextTRU(fTRU); - while ( AliEMCALTriggerTRU *TRU = (AliEMCALTriggerTRU*)NextTRU() ) TRU->Reset(); + TIter nextTRU(fTRU); + while ( AliEMCALTriggerTRU *TRU = (AliEMCALTriggerTRU*)nextTRU() ) TRU->Reset(); fSTU->Reset(); } diff --git a/EMCAL/AliEMCALv0.cxx b/EMCAL/AliEMCALv0.cxx index ae9d593a72f..f95609f472c 100644 --- a/EMCAL/AliEMCALv0.cxx +++ b/EMCAL/AliEMCALv0.cxx @@ -224,8 +224,9 @@ void AliEMCALv0::CreateShishKebabGeometry() CreateEmod("SMOD","EMOD"); // 18-may-05 - if(g->GetKey110DEG()) CreateEmod("SM10","EMOD"); // Nov 1,2006 - + if(g->GetKey110DEG() && !gn.Contains("12SMV1")) { CreateEmod("SM10","EMOD");} // Nov 1,2006 1/2 SM + if(g->GetKey110DEG() && gn.Contains("12SMV1")) { CreateEmod("SM3rd","EMOD"); } // Feb 1,2012 1/3 SM + // Sensitive SC (2x2 tiles) double parSCM0[5]={0,0,0,0}, *dummy = 0, parTRAP[11]; @@ -389,13 +390,21 @@ void AliEMCALv0::CreateSmod(const char* mother) fIdTmedArr[kIdAIR], par[0],par[1],par[2])); fSmodPar0 = par[0]; fSmodPar2 = par[2]; - if(g->GetKey110DEG()) { // 12-oct-05 + if(g->GetKey110DEG() && !gn.Contains("12SMV1") ) { // 12-oct-05 par1C = par[1]; par[1] /= 2.; gMC->Gsvolu("SM10", "BOX", fIdTmedArr[kIdAIR], par, 3); AliDebug(2,Form(" Super module with name \"SM10\" was created too par[1] = %f\n", par[1])); par[1] = par1C; } + if(g->GetKey110DEG() && gn.Contains("12SMV1")) { // 1-feb-12, one third (installed in 2012) case + par1C = par[1]; + par[1] /= 3.; + gMC->Gsvolu("SM3rd", "BOX", fIdTmedArr[kIdAIR], par, 3); + AliDebug(2,Form(" Super module with name \"SM3rd\" was created too par[1] = %f\n", par[1])); + par[1] = par1C; + } + // Steel plate if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05 par[0] = g->GetSteelFrontThickness()/2.; @@ -418,11 +427,16 @@ void AliEMCALv0::CreateSmod(const char* mother) nr++; } else { // TRD1 TString smName("SMOD"); // 12-oct-05 - if(i==5 && g->GetKey110DEG()) { + if(i==5 && g->GetKey110DEG() && !gn.Contains("12SMV1")) { smName = "SM10"; nrsmod = nr; nr = 0; } + if(i==5 && g->GetKey110DEG() && gn.Contains("12SMV1")) { + smName = "SM3rd"; + nrsmod = nr; + nr = 0; + } phi = g->GetArm1PhiMin() + dphi*(2*i+1)/2.; // phi= 70, 90, 110, 130, 150, 170 phiRad = phi*TMath::Pi()/180.; @@ -431,10 +445,14 @@ void AliEMCALv0::CreateSmod(const char* mother) xpos = rpos * TMath::Cos(phiRad); ypos = rpos * TMath::Sin(phiRad); zpos = fSmodPar2; // 21-sep-04 - if(i==5 && g->GetKey110DEG()) { + if(i==5 && g->GetKey110DEG() && !gn.Contains("12SMV1") ) { xpos += (par1C/2. * TMath::Sin(phiRad)); ypos -= (par1C/2. * TMath::Cos(phiRad)); } + if(i==5 && g->GetKey110DEG() && gn.Contains("12SMV1") ) { + xpos += (2.*par1C/3. * TMath::Sin(phiRad)); + ypos -= (2.*par1C/3. * TMath::Cos(phiRad)); + } // 1th module in z-direction; gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; @@ -491,29 +509,34 @@ void AliEMCALv0::CreateEmod(const char* mother, const char* child) zpos = mod->GetPosZ() - fSmodPar2; int iyMax = g->GetNPhi(); - if(strcmp(mother,"SMOD") && g->GetKey110DEG()) { - iyMax /= 2; + if(strcmp(mother,"SMOD") && g->GetKey110DEG() && !gn.Contains("12SMV1") ) { + iyMax /= 2; + } + if(strcmp(mother,"SMOD") && g->GetKey110DEG() && gn.Contains("12SMV1") ) { + iyMax /= 3; } for(int iy=0; iyGetPhiModuleSize()*(2*iy+1 - iyMax)/2.; - gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; - //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm); - AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1)); + ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.; + gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; + // + //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm); + AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1)); } //PH printf("\n"); } else { //WSUC if(iz==0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y) else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.); phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi(); - printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", - iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule()); + //printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", + //iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule()); zpos = mod->GetPosZ() - fSmodPar2; ypos = mod->GetPosXfromR() - fSmodPar1; - printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm); - for(int ix=0; ixGetNPhi(); ix++) { // flat in phi - xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.; - gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; - printf(" %7.2f ", xpos); + //printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm); + for(int ix=0; ixGetNPhi(); ix++) + { // flat in phi + xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.; + gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; + printf(" %7.2f ", xpos); } printf("\n"); } @@ -990,12 +1013,21 @@ void AliEMCALv0::AddAlignableVolumesInALICE() const symname = "EMCAL/FullSupermodule"; symname += (smodnum+1); - if(GetGeometry()->GetKey110DEG() && smodnum>=10) { + if(GetGeometry()->GetKey110DEG() && smodnum>=10 && !( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")) ) + { volpath = "ALIC_1/XEN1_1/SM10_"; volpath += (smodnum-10+1); symname = "EMCAL/HalfSupermodule"; symname += (smodnum-10+1); } + + if(GetGeometry()->GetKey110DEG() && smodnum>=10 && ( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")) ) + { + volpath = "ALIC_1/XEN1_1/SM3rd_"; + volpath += (smodnum-10+1); + symname = "EMCAL/OneThrdSupermodule"; + symname += (smodnum-10+1); + } if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID)) AliFatal("AliEMCALv0::Unable to set alignable entry!!"); @@ -1009,10 +1041,21 @@ void AliEMCALv0::AddAlignableVolumesInALICE() const xpos = rpos * TMath::Cos(phiRad); ypos = rpos * TMath::Sin(phiRad); zpos = pars[2]; - if(GetGeometry()->GetKey110DEG() && smodnum >= 10) { - xpos += (pars[1]/2. * TMath::Sin(phiRad)); + if(GetGeometry()->GetKey110DEG() && smodnum >= 10 && !( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) + { + AliDebug(3, Form(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : smodnum %i \n", + fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum)); + xpos += (pars[1]/2. * TMath::Sin(phiRad)); // half SM! ypos -= (pars[1]/2. * TMath::Cos(phiRad)); } + + if(GetGeometry()->GetKey110DEG() && smodnum >= 10 && ( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) + { + AliDebug(3, Form(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : smodnum %i \n", + fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum)); + xpos += (pars[1]/3. * TMath::Sin(phiRad)); // one_third SM ! + ypos -= (pars[1]/3. * TMath::Cos(phiRad)); + } TGeoHMatrix *matTtoL; TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig(); diff --git a/EMCAL/AliEMCALv2.cxx b/EMCAL/AliEMCALv2.cxx index 64e0636bb66..a57867444bc 100644 --- a/EMCAL/AliEMCALv2.cxx +++ b/EMCAL/AliEMCALv2.cxx @@ -221,6 +221,7 @@ void AliEMCALv2::StepManager(void){ gMC->CurrentVolOffID(1, yNumber); gMC->CurrentVolOffID(0, xNumber); // really x number now if(strcmp(gMC->CurrentVolOffName(4),"SM10")==0) supModuleNumber += 10; // 13-oct-05 + if(strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) supModuleNumber += 10; // 1-feb-12 // Nov 10,2006 if(strcmp(gMC->CurrentVolOffName(0),vn) != 0) { // 3X3 case if (strcmp(gMC->CurrentVolOffName(0),"SCX1")==0) xNumber=1; @@ -251,7 +252,8 @@ void AliEMCALv2::StepManager(void){ ieta = ((fGeometry->GetCentersOfCellsEtaDir()).GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention. } else { - if(smNumber >= 10) smType = 2 ; //half supermodule + if(smNumber >= 10 && strcmp(gMC->CurrentVolOffName(4),"SM10")==0) smType = 2 ; //half supermodule. previous design/idea + if(smNumber >= 10 && strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) smType = 3 ; //one third (installed in 2012) supermodule iphi= ((fGeometry->GetCentersOfCellsPhiDir()).GetSize()/smType-1)-iphi;//23-iphi, revert the ordering on C side in order to keep convention. } -- 2.43.5