From e649177a7ba040c8e27382914e7378178e56de12 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 28 Nov 2007 14:11:31 +0000 Subject: [PATCH] Summary of all changes: - in AliESDCaloCluster the following have been added: UShort_t fNCells ; UShort_t *fCellsAbsId; //[fNCells] array of cell absId numbers Double32_t *fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction. The first 2 data members are not really necessary since the data member TArrayS * fDigitIndex; has the same function, but in order to change the name to something that avoids the mention of digits ... and to have the same data member type as fCellsAmpFraction, it was added (could be removed in the future). - in AliESDCaloCells we have: Int_t fNCells; // Number of cells Short_t *fCellNumber; //[fNCells] array of cell numbers Double32_t *fAmplitude; //[fNCells][0.,0.,16] array with cell amplitudes (= energy!) Double32_t *fTime; //[fNCells][0.,0.,16] array with cell times The changes in AliESDCaloCluster were propagated to AliAODCaloCluster. Gustavo --- EMCAL/AliEMCALFolder.cxx | 8 +- STEER/AliAODCaloCells.cxx | 2 +- STEER/AliAODCaloCells.h | 8 +- STEER/AliAODCaloCluster.cxx | 54 +++++++++-- STEER/AliAODCaloCluster.h | 24 ++++- STEER/AliAODEvent.h | 4 +- STEER/AliESDCaloCells.cxx | 172 ++++++++++++++++++++++++++++++++++++ STEER/AliESDCaloCells.h | 143 ++++++++++++++++++++++++++++++ STEER/AliESDCaloCluster.cxx | 95 ++++++++++++-------- STEER/AliESDCaloCluster.h | 67 +++++++++----- STEER/AliESDEvent.cxx | 38 ++++++-- STEER/AliESDEvent.h | 21 ++++- STEER/AliReconstruction.cxx | 49 +++++----- STEER/ESDLinkDef.h | 1 + STEER/libESD.pkg | 3 +- 15 files changed, 576 insertions(+), 113 deletions(-) create mode 100644 STEER/AliESDCaloCells.cxx create mode 100644 STEER/AliESDCaloCells.h diff --git a/EMCAL/AliEMCALFolder.cxx b/EMCAL/AliEMCALFolder.cxx index d748022c6e1..378bcb1f35e 100644 --- a/EMCAL/AliEMCALFolder.cxx +++ b/EMCAL/AliEMCALFolder.cxx @@ -205,14 +205,14 @@ void AliEMCALFolder::FillPi0Candidate(const Double_t mgg, AliESDCaloCluster* cl1 int indMax = 0, id=0; id = Int_t(absId[0]); rFirst = tFirst->GetTable(id); - double emax = cl->GetTrueDigitEnergy(indMax, rFirst->fCc); + double emax = 0;//cl->GetTrueDigitEnergy(indMax, rFirst->fCc); if(kNdigits > 1) { for(int i=1; iGetTable(id); - if(emax < cl->GetTrueDigitEnergy(i, rFirst->fCc)) { + if(emax < 0){//cl->GetTrueDigitEnergy(i, rFirst->fCc)) { indMax = i; - emax = cl->GetTrueDigitEnergy(i, rFirst->fCc); + emax = 0;//cl->GetTrueDigitEnergy(i, rFirst->fCc); } } } @@ -357,7 +357,7 @@ TList *l, Double_t deff, Double_t w0, Double_t phiSlope) // cluster energy and position absId = Int_t(dgAbsId[i]); rOld = tOld->GetTable(absId); - ampDigi = cl->GetTrueDigitAmplitude(i, rOld->fCc); // True amplitude + //ampDigi = cl->GetTrueDigitAmplitude(i, rOld->fCc); // True amplitude new(digits[i]) AliEMCALDigit(Int_t(kPrim),0, absId, ampDigi, 0.0, i, 0.0); dg = (AliEMCALDigit*)digits[i]; diff --git a/STEER/AliAODCaloCells.cxx b/STEER/AliAODCaloCells.cxx index e268f79d305..c2f15396234 100644 --- a/STEER/AliAODCaloCells.cxx +++ b/STEER/AliAODCaloCells.cxx @@ -29,7 +29,7 @@ AliAODCaloCells::AliAODCaloCells() : TNamed(), fNCells(0), fCellNumber(0), fAmpl // default constructor } -AliAODCaloCells::AliAODCaloCells(const char* name, const char* title, AODTwrs_t ttype) : TNamed(name, title), fNCells(0), fCellNumber(0), fAmplitude(0), fIsSorted(kTRUE), fType(ttype) +AliAODCaloCells::AliAODCaloCells(const char* name, const char* title, AODCells_t ttype) : TNamed(name, title), fNCells(0), fCellNumber(0), fAmplitude(0), fIsSorted(kTRUE), fType(ttype) { // TNamed constructor } diff --git a/STEER/AliAODCaloCells.h b/STEER/AliAODCaloCells.h index 1ebe9099b2c..091bb5d05e1 100644 --- a/STEER/AliAODCaloCells.h +++ b/STEER/AliAODCaloCells.h @@ -17,12 +17,12 @@ class AliAODCaloCells : public TNamed { public: - enum AODTwrs_t {kUndef = -1, + enum AODCells_t {kUndef = -1, kEMCAL, kPHOS}; AliAODCaloCells(); - AliAODCaloCells(const char* name, const char* title, AODTwrs_t ttype=kUndef); + AliAODCaloCells(const char* name, const char* title, AODCells_t ttype=kUndef); virtual ~AliAODCaloCells(); @@ -39,12 +39,12 @@ class AliAODCaloCells : public TNamed inline Short_t GetCellNumber(Short_t pos) const; Char_t GetType() const { return fType;} - void SetType(AODTwrs_t ttype) { fType=ttype; } + void SetType(AODCells_t ttype) { fType=ttype; } protected: Int_t fNCells; // Number of cells Short_t *fCellNumber; //[fNCells] array of cell numbers - Double32_t *fAmplitude; //[fNCells][0.,600.,16] array with cell amplitudes (= energy!) + Double32_t *fAmplitude; //[fNCells][0.,0.,16] array with cell amplitudes (= energy!) Bool_t fIsSorted; //! true if cell arrays are sorted by index Char_t fType; // Cell type diff --git a/STEER/AliAODCaloCluster.cxx b/STEER/AliAODCaloCluster.cxx index 260fab57791..fb34ec1ba64 100644 --- a/STEER/AliAODCaloCluster.cxx +++ b/STEER/AliAODCaloCluster.cxx @@ -36,7 +36,9 @@ AliAODCaloCluster::AliAODCaloCluster() : fEmcCpvDistance(-999.), fNExMax(0), fTracksMatched(), - fCellNumber() + fNCells(0), + fCellsAbsId(), + fCellsAmpFraction() { // default constructor @@ -61,7 +63,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id, fEmcCpvDistance(-999.), fNExMax(0), fTracksMatched(), - fCellNumber() + fNCells(0), + fCellsAbsId(), + fCellsAmpFraction() { // constructor @@ -86,7 +90,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id, fEmcCpvDistance(-999.), fNExMax(0), fTracksMatched(), - fCellNumber() + fNCells(0), + fCellsAbsId(), + fCellsAmpFraction() { // constructor } @@ -96,6 +102,8 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id, AliAODCaloCluster::~AliAODCaloCluster() { // destructor + if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0; + if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0; } @@ -111,9 +119,28 @@ AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) : fEmcCpvDistance(clus.fEmcCpvDistance), fNExMax(clus.fNExMax), fTracksMatched(clus.fTracksMatched), - fCellNumber(clus.fCellNumber) + fNCells(clus.fNCells), + fCellsAbsId(), + fCellsAmpFraction() { // Copy constructor + + if (clus.fNCells > 0) { + + if(clus.fCellsAbsId){ + fCellsAbsId = new UShort_t[clus.fNCells]; + for (Int_t i=0; i 0) { + + if(clus.fCellsAbsId){ + fCellsAbsId = new UShort_t[clus.fNCells]; + for (Int_t i=0; i=0 && i < fNCells ) return fCellsAbsId[i]; + else return -1;} + + Double_t GetCellAmplitudeFraction(Int_t i) const { + if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i]; + else return -1;} // setters void SetDistToBadChannel(Double_t dist) { fDistToBadChannel = dist; } @@ -104,7 +119,10 @@ class AliAODCaloCluster : public AliAODCluster { UShort_t fNExMax; // number of (Ex-)maxima before unfolding TRefArray fTracksMatched; // references to tracks close to cluster. First entry is the most likely match. - TArrayS fCellNumber; // fired calorimeter cell numbers + + UShort_t fNCells ; + UShort_t *fCellsAbsId; //[fNCells] array of cell absId numbers + Double32_t *fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction. ClassDef(AliAODCaloCluster,1); }; diff --git a/STEER/AliAODEvent.h b/STEER/AliAODEvent.h index 0abd716ffb2..6102da0fbc7 100644 --- a/STEER/AliAODEvent.h +++ b/STEER/AliAODEvent.h @@ -151,8 +151,8 @@ class AliAODEvent : public AliVEvent { AliAODTracklets *GetTracklets() const { return fTracklets; } // -- Calorimeter Cells - AliAODCaloCells *GetEmcalCells() const { return fEmcalCells; } - AliAODCaloCells *GetPhosCells() const { return fPhosCells; } + AliAODCaloCells *GetEMCALCells() const { return fEmcalCells; } + AliAODCaloCells *GetPHOSCells() const { return fPhosCells; } // -- Services void CreateStdContent(); diff --git a/STEER/AliESDCaloCells.cxx b/STEER/AliESDCaloCells.cxx new file mode 100644 index 00000000000..1a0c3f18785 --- /dev/null +++ b/STEER/AliESDCaloCells.cxx @@ -0,0 +1,172 @@ +/************************************************************************** + * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* $Id$ */ + +//------------------------------------------------------------------------- +// ESD class to store calorimeter cell data +// Clone of AliAODCaloCells made by Markus Oldenburg, CERN +// Author: Gustavo Conesa Balbastre INFN-LNF +//------------------------------------------------------------------------- + +#include "AliESDCaloCells.h" + +ClassImp(AliESDCaloCells) + +//_______________________________________________________________________ +AliESDCaloCells::AliESDCaloCells() : + TNamed(), fNCells(0), fCellNumber(0), fAmplitude(0), fTime(0), fIsSorted(kTRUE), fType(kUndef) +{ + // default constructor +} +//_______________________________________________________________________ + AliESDCaloCells::AliESDCaloCells(const char* name, const char* title, ESDCells_t ttype) : + TNamed(name, title), fNCells(0), fCellNumber(0), fAmplitude(0), fTime(0), fIsSorted(kTRUE), fType(ttype) + { + // TNamed constructor + } + +//_______________________________________________________________________ +AliESDCaloCells::AliESDCaloCells(const AliESDCaloCells& c) : + TNamed(c), fNCells(c.fNCells), fCellNumber(), fAmplitude(), fTime(), fIsSorted(c.fIsSorted), fType(c.fType) +{ + // copy constructor + + for(Int_t i = 0; i < fNCells; i++){ + fCellNumber[i] = c.fCellNumber[i]; + fAmplitude[i] = c.fAmplitude[i]; + fTime[i] = c.fTime[i]; + } +} + +//_______________________________________________________________________ +AliESDCaloCells & AliESDCaloCells::operator =(const AliESDCaloCells& source) +{ + // assignment operator + + if(&source == this) return *this; + TNamed::operator=(source); + + fNCells = source.fNCells; + fIsSorted = source.fIsSorted; + fType = source.fType; + + for(Int_t i = 0; i < fNCells; i++){ + fCellNumber[i] = source.fCellNumber[i]; + fAmplitude[i] = source.fAmplitude[i]; + fTime[i] = source.fTime[i]; + } + + return *this; + +} + +//_______________________________________________________________________ +AliESDCaloCells::~AliESDCaloCells() +{ + // destructor + + DeleteContainer(); +} + +//_______________________________________________________________________ +void AliESDCaloCells::CreateContainer(Short_t nCells) +{ + // function that creates container to store calorimeter cell data + + DeleteContainer(); + + if (nCells <= 0) { + fNCells = 0; + return; + } + + fNCells = nCells; + + fCellNumber = new Short_t[fNCells]; + fAmplitude = new Double32_t[fNCells]; + fTime = new Double32_t[fNCells]; +} + +//_______________________________________________________________________ +void AliESDCaloCells::DeleteContainer() +{ + // deletes allocated memory + + if (fCellNumber) + { + delete[] fCellNumber; + fCellNumber = 0; + } + + if (fAmplitude) + { + delete[] fAmplitude; + fAmplitude = 0; + } + + if (fTime) + { + delete[] fTime; + fTime = 0; + } + + fNCells = 0; + fIsSorted = kFALSE; +} + +//_______________________________________________________________________ +void AliESDCaloCells::Sort() +{ + // sort the cell array by cell number + + Int_t *idxArray = new Int_t[fNCells]; + TMath::Sort(fNCells,fCellNumber,idxArray,kFALSE); + + Short_t *newIndex = new Short_t[fNCells]; + Double32_t *newAmplitude = new Double32_t[fNCells]; + Double32_t *newTime = new Double32_t[fNCells]; + for (Int_t i=0; i < fNCells; i++) { + newIndex[i] = fCellNumber[idxArray[i]]; + newAmplitude[i] = fAmplitude[idxArray[i]]; + newTime[i] = fTime[idxArray[i]]; + } + delete [] fCellNumber; + delete [] fAmplitude; + delete [] fTime; + fCellNumber = newIndex; + fAmplitude = newAmplitude; + fTime = newTime; + + delete [] idxArray; + + fIsSorted = kTRUE; +} + +//_______________________________________________________________________ +Bool_t AliESDCaloCells::SetCell(Short_t pos, Short_t cellNumber, Double32_t amplitude, Double32_t time) +{ + // Sets a cell at the given position + + if (pos>=0 && pos < fNCells) { + fCellNumber[pos] = cellNumber; + fAmplitude[pos] = amplitude; + fTime[pos] = time; + fIsSorted = kFALSE; + return kTRUE; + } else { + return kFALSE; + } +} diff --git a/STEER/AliESDCaloCells.h b/STEER/AliESDCaloCells.h new file mode 100644 index 00000000000..a6534a3bb70 --- /dev/null +++ b/STEER/AliESDCaloCells.h @@ -0,0 +1,143 @@ +#ifndef ALIESDCALOCELLS_H +#define ALIESDCALOCELLS_H +/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +/* $Id$ */ +/* $Log $ */ + +//------------------------------------------------------------------------- +// ESD class to store calorimeter cell data +// Clone of AliAODCaloCells made by Markus Oldenburg, CERN +// Author: Gustavo Conesa Balbastre INFN-LNF +// +//------------------------------------------------------------------------- + + +#include +#include + +class AliESDCaloCells : public TNamed +{ + public: + + enum ESDCells_t {kUndef = -1, + kPHOSCell, + kEMCALCell}; + + AliESDCaloCells(); + AliESDCaloCells(const char* name, const char* title, ESDCells_t ttype=kUndef); + AliESDCaloCells(const AliESDCaloCells & cells); + AliESDCaloCells & operator=(const AliESDCaloCells& source); + virtual ~AliESDCaloCells(); + + Bool_t IsEMCAL() const {return (fType == kEMCALCell);} + Bool_t IsPHOS() const {return (fType == kPHOSCell);} + Char_t GetType() const { return fType;} + void SetType(ESDCells_t ttype) { fType=ttype; } + + void CreateContainer(Short_t nCells); + void DeleteContainer(); + void Sort(); + + Bool_t SetCell(Short_t pos, Short_t cellNumber, Double_t amplitude, Double_t time); + + Short_t GetNumberOfCells() const { return fNCells; } + void SetNumberOfCells(Int_t n) { fNCells = n ; } + inline Bool_t GetCell(Short_t pos, Short_t &cellNumber, Double_t &litude, Double_t &time) const; + inline Double_t GetCellAmplitude(Short_t cellNumber); + inline Double_t GetCellTime(Short_t cellNumber); + inline Double_t GetAmplitude(Short_t pos) const; + inline Double_t GetTime(Short_t pos) const; + inline Short_t GetCellNumber(Short_t pos) const; + + + protected: + Int_t fNCells; // Number of cells + Short_t *fCellNumber; //[fNCells] array of cell numbers + Double32_t *fAmplitude; //[fNCells][0.,0.,16] array with cell amplitudes (= energy!) + Double32_t *fTime; //[fNCells][0.,0.,16] array with cell times + Bool_t fIsSorted; //! true if cell arrays are sorted by index + Char_t fType; // Cell type + + ClassDef(AliESDCaloCells, 1); +}; + + +Bool_t AliESDCaloCells::GetCell(Short_t pos, Short_t &cellNumber, Double_t &litude, Double_t & time) const +{ + if (pos>=0 && pos=0 && pos < fNCells && fCellNumber[pos] == cellNumber ) { + return fAmplitude[pos]; + } else { + Warning("GetCellAmplitude","Wrong cell array index %d", pos); + return 0.; + } +} + +Double_t AliESDCaloCells::GetCellTime(Short_t cellNumber) +{ + if (!fIsSorted) { + Sort(); + fIsSorted=kTRUE; + } + + Short_t pos = TMath::BinarySearch(fNCells, fCellNumber, cellNumber); + if (pos>=0 && pos < fNCells && fCellNumber[pos] == cellNumber) { + return fTime[pos]; + } else { + Warning("GetCellTime","Wrong cell array index %d", pos); + return 0.; + } +} + +Double_t AliESDCaloCells::GetAmplitude(Short_t pos) const +{ + if (pos>=0 && pos=0 && pos=0 && pos 0) { + + if(clus.fCellsAbsId){ + fCellsAbsId = new UShort_t[clus.fNCells]; + for (Int_t i=0; i 0) { + + if(source.fCellsAbsId){ + fCellsAbsId = new UShort_t[source.fNCells]; + for (Int_t i=0; i=0 && iGetSize() && cc>0.0) { - // true formula - amp = Int_t(Double_t(fDigitAmplitude->At(i))/500./cc+0.5); - } - return amp; -} - -Double_t AliESDCaloCluster::GetTrueDigitEnergy(Int_t i, Double_t cc) -{ - return Double_t(GetTrueDigitAmplitude(i,cc)) * cc; -} - -Double_t AliESDCaloCluster::GetRecalibratedDigitEnergy(Int_t i, Double_t ccOld, Double_t ccNew) -{ - return Double_t(GetTrueDigitAmplitude(i,ccOld)) * ccNew; -} diff --git a/STEER/AliESDCaloCluster.h b/STEER/AliESDCaloCluster.h index 58c8a184401..8d7f1a8a907 100644 --- a/STEER/AliESDCaloCluster.h +++ b/STEER/AliESDCaloCluster.h @@ -22,7 +22,8 @@ class TLorentzVector; -class AliESDCaloCluster : public TObject { +class AliESDCaloCluster : public TObject +{ public: @@ -38,14 +39,14 @@ public: // backward comp. -1 was undefined, which only applied // for PHOS clusters before enum ESDClu_t {kUndef = -2, - kPHOSCluster, - kEMCALPseudoCluster, + kPHOSCluster, + kEMCALPseudoCluster, //Not any more in use, keep for backward comp. kEMCALClusterv1}; + void SetClusterType(Int_t type) { fClusterType = type; } Char_t GetClusterType() const {return fClusterType; } - Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1||fClusterType == kEMCALPseudoCluster);} - Bool_t IsEMCALPseudo() {return (fClusterType == kEMCALPseudoCluster);} + Bool_t IsEMCAL() const {return (fClusterType == kEMCALClusterv1);} Bool_t IsPHOS() const {return (fClusterType == kPHOSCluster);} void SetPosition(const Float_t *pos) { @@ -87,15 +88,9 @@ public: void AddTracksMatched(TArrayI & array) { fTracksMatched = new TArrayI(array) ; } void AddLabels(TArrayI & array) { fLabels = new TArrayI(array) ; } - void AddDigitAmplitude(TArrayS & array) { fDigitAmplitude = new TArrayS(array) ; } - void AddDigitTime(TArrayS & array) { fDigitTime = new TArrayS(array) ; } - void AddDigitIndex(TArrayS & array) { fDigitIndex = new TArrayS(array) ; } TArrayI * GetTracksMatched() const {return fTracksMatched;} TArrayI * GetLabels() const {return fLabels;} - TArrayS * GetDigitAmplitude() const {return fDigitAmplitude;} - TArrayS * GetDigitTime() const {return fDigitTime;} - TArrayS * GetDigitIndex() const {return fDigitIndex;} Int_t GetTrackMatched() const {if( fTracksMatched && fTracksMatched->GetSize() >0) return fTracksMatched->At(0); @@ -104,28 +99,58 @@ public: {if( fLabels && fLabels->GetSize() >0) return fLabels->At(0); else return -1;} //Most likely the track associated to the cluster - Int_t GetNTracksMatched() const {if (fTracksMatched) return fTracksMatched->GetSize(); else return -1;} Int_t GetNLabels() const { if (fLabels) return fLabels->GetSize(); else return -1;} - Int_t GetNumberOfDigits() const { if (fDigitAmplitude) return fDigitAmplitude->GetSize(); - else return -1;} - + void GetMomentum(TLorentzVector& p, Double_t * vertexPosition ); - // Sep 7, 2007 - Int_t GetTrueDigitAmplitude(Int_t i, Double_t cc); - Double_t GetTrueDigitEnergy(Int_t i, Double_t cc); - Double_t GetRecalibratedDigitEnergy(Int_t i, Double_t ccOld, Double_t ccNew); + + // --- NEW --- + void SetNCells(Int_t n) { fNCells = n;} + Double_t GetNCells() const { return fNCells;} + + void SetCellsAbsId(UShort_t *array) { fCellsAbsId = array; } + UShort_t *GetCellsAbsId() {return fCellsAbsId;} + + void SetCellsAmplitudeFraction(Double32_t *array) { fCellsAmpFraction = array; } + Double32_t *GetCellsAmplitudeFraction() {return fCellsAmpFraction;} + + Int_t GetCellAbsId(Int_t i) const { + if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i]; + else return -1;} + + Double_t GetCellAmplitudeFraction(Int_t i) const { + if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i]; + else return -1;} + + //_____________________________________________________ + //Not used anymore, kept to avoid backward incompatibility + void AddDigitIndex(TArrayS & array) { fDigitIndex = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;} + void AddDigitAmplitude(TArrayS & array) { fDigitAmplitude = new TArrayS(array) ; Warning("AddDigitAmplitude","This method is no more in use") ;} + void AddDigitTime(TArrayS & array) { fDigitTime = new TArrayS(array) ;Warning("AddDigitTime","This method is no more in use") ;} + TArrayS * GetDigitAmplitude() const {return fDigitAmplitude;} + TArrayS * GetDigitTime() const {return fDigitTime;} + TArrayS * GetDigitIndex() const {return fDigitIndex;} + Int_t GetNumberOfDigits() const { return -1;} + //_____________________________________________________ protected: TArrayI * fTracksMatched; //Index of tracks close to cluster. First entry is the most likely match. TArrayI * fLabels; //list of primaries that generated the cluster, ordered in deposited energy. + + //NEW + Int_t fNCells ; + UShort_t *fCellsAbsId; //[fNCells] array of cell absId numbers + Double32_t *fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction. + + //__________________________________________________________ + //Not in use TArrayS * fDigitAmplitude; //digit energy (integer units) TArrayS * fDigitTime; //time of this digit (integer units) TArrayS * fDigitIndex; //calorimeter digit index - + //_________________________________________________________ Double32_t fGlobalPos[3]; // position in global coordinate systemD Double32_t fEnergy; // energy measured by calorimeter @@ -141,7 +166,7 @@ protected: UChar_t fNExMax ; // number of (Ex-)maxima before unfolding Char_t fClusterType; // Flag for different cluster type/versions - ClassDef(AliESDCaloCluster,6) //ESDCaloCluster + ClassDef(AliESDCaloCluster,7) //ESDCaloCluster }; #endif diff --git a/STEER/AliESDEvent.cxx b/STEER/AliESDEvent.cxx index 0dc7a6b1720..a8db57e3917 100644 --- a/STEER/AliESDEvent.cxx +++ b/STEER/AliESDEvent.cxx @@ -54,12 +54,13 @@ #include "AliESDtrack.h" #include "AliESDHLTtrack.h" #include "AliESDCaloCluster.h" +#include "AliESDCaloCells.h" #include "AliESDv0.h" #include "AliESDFMD.h" #include "AliESDVZERO.h" #include "AliMultiplicity.h" #include "AliRawDataErrorLog.h" - +#include "AliLog.h" ClassImp(AliESDEvent) @@ -86,6 +87,8 @@ ClassImp(AliESDEvent) "Cascades", "Kinks", "CaloClusters", + "EMCALCells", + "PHOSCells", "AliRawDataErrorLogs"}; //______________________________________________________________________________ AliESDEvent::AliESDEvent(): @@ -110,6 +113,7 @@ AliESDEvent::AliESDEvent(): fCascades(0), fKinks(0), fCaloClusters(0), + fEMCALCells(0), fPHOSCells(0), fErrorLogs(0), fESDOld(0), fESDFriendOld(0), @@ -143,6 +147,8 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd): fCascades(new TClonesArray(*esd.fCascades)), fKinks(new TClonesArray(*esd.fKinks)), fCaloClusters(new TClonesArray(*esd.fCaloClusters)), + fEMCALCells(new AliESDCaloCells(*esd.fEMCALCells)), + fPHOSCells(new AliESDCaloCells(*esd.fPHOSCells)), fErrorLogs(new TClonesArray(*esd.fErrorLogs)), fESDOld(new AliESD(*esd.fESDOld)), fESDFriendOld(new AliESDfriend(*esd.fESDFriendOld)), @@ -173,6 +179,8 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd): AddObject(fCascades); AddObject(fKinks); AddObject(fCaloClusters); + AddObject(fEMCALCells); + AddObject(fPHOSCells); AddObject(fErrorLogs); GetStdContent(); @@ -206,6 +214,8 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) { fCascades = new TClonesArray(*source.fCascades); fKinks = new TClonesArray(*source.fKinks); fCaloClusters = new TClonesArray(*source.fCaloClusters); + fEMCALCells = new AliESDCaloCells(*source.fEMCALCells); + fPHOSCells = new AliESDCaloCells(*source.fPHOSCells); fErrorLogs = new TClonesArray(*source.fErrorLogs); fESDOld = new AliESD(*source.fESDOld); fESDFriendOld = new AliESDfriend(*source.fESDFriendOld); @@ -232,6 +242,8 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) { AddObject(fCascades); AddObject(fKinks); AddObject(fCaloClusters); + AddObject(fEMCALCells); + AddObject(fPHOSCells); AddObject(fErrorLogs); fConnected = source.fConnected; @@ -315,6 +327,8 @@ void AliESDEvent::ResetStdContent() if(fCascades)fCascades->Delete(); if(fKinks)fKinks->Delete(); if(fCaloClusters)fCaloClusters->Delete(); + if(fPHOSCells)fPHOSCells->DeleteContainer(); + if(fEMCALCells)fEMCALCells->DeleteContainer(); if(fErrorLogs) fErrorLogs->Delete(); // don't reset fconnected fConnected ; @@ -367,6 +381,8 @@ void AliESDEvent::Print(Option_t *) const printf(" v0 %d\n", GetNumberOfV0s()); printf(" cascades %d\n", GetNumberOfCascades()); printf(" kinks %d\n", GetNumberOfKinks()); + printf(" PHOSCells %d\n", fPHOSCells->GetNumberOfCells()); + printf(" EMCALCells %d\n", fEMCALCells->GetNumberOfCells()); printf(" CaloClusters %d\n", GetNumberOfCaloClusters()); printf(" phos %d\n", GetNumberOfPHOSClusters()); printf(" emcal %d\n", GetNumberOfEMCALClusters()); @@ -797,6 +813,8 @@ void AliESDEvent::GetStdContent() fCascades = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCascades]); fKinks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kKinks]); fCaloClusters = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCaloClusters]); + fEMCALCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kEMCALCells]); + fPHOSCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kPHOSCells]); fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]); } @@ -844,6 +862,8 @@ void AliESDEvent::CreateStdContent() AddObject(new TClonesArray("AliESDcascade",0)); AddObject(new TClonesArray("AliESDkink",0)); AddObject(new TClonesArray("AliESDCaloCluster",0)); + AddObject(new AliESDCaloCells()); + AddObject(new AliESDCaloCells()); AddObject(new TClonesArray("AliRawDataErrorLog",0)); // check the order of the indices against enum... @@ -862,16 +882,16 @@ TObject* AliESDEvent::FindListObject(const char *name){ Int_t AliESDEvent::GetPHOSClusters(TRefArray *clusters) const { // fills the provided TRefArray with all found phos clusters - + clusters->Clear(); - + AliESDCaloCluster *cl = 0; for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) { - - if ( (cl = GetCaloCluster(i))) { + + if ( (cl = GetCaloCluster(i)) ) { if (cl->IsPHOS()){ clusters->Add(cl); - printf("IsPHOS %d Size: %d \n",i,clusters->GetEntriesFast()); + AliDebug(1,Form("IsPHOS cluster %d Size: %d \n",i,clusters->GetEntriesFast())); } } } @@ -880,17 +900,17 @@ Int_t AliESDEvent::GetPHOSClusters(TRefArray *clusters) const Int_t AliESDEvent::GetEMCALClusters(TRefArray *clusters) const { - // fills the provided TRefArray with all found phos clusters + // fills the provided TRefArray with all found emcal clusters clusters->Clear(); AliESDCaloCluster *cl = 0; for (Int_t i = 0; i < GetNumberOfCaloClusters(); i++) { - if ( (cl = GetCaloCluster(i))) { + if ( (cl = GetCaloCluster(i)) ) { if (cl->IsEMCAL()){ clusters->Add(cl); - printf("IsEMCAL %d Size: %d \n",i,clusters->GetEntriesFast()); + AliDebug(1,Form("IsEMCAL cluster %d Size: %d \n",i,clusters->GetEntriesFast())); } } } diff --git a/STEER/AliESDEvent.h b/STEER/AliESDEvent.h index 6f8463c8771..44aa833a0ea 100644 --- a/STEER/AliESDEvent.h +++ b/STEER/AliESDEvent.h @@ -42,6 +42,7 @@ class AliESDPmdTrack; class AliESDFMD; class AliESDkink; class AliESDCaloCluster; +class AliESDCaloCells; class AliESDv0; class AliMultiplicity; class AliRawDataErrorLog; @@ -75,6 +76,8 @@ public: kCascades, kKinks, kCaloClusters, + kEMCALCells, + kPHOSCells, kErrorLogs, kESDListN }; @@ -248,8 +251,12 @@ public: AliESDCaloCluster *GetCaloCluster(Int_t i) const { return (AliESDCaloCluster *)fCaloClusters->UncheckedAt(i); } + Int_t AddCaloCluster(const AliESDCaloCluster *c); + AliESDCaloCells *GetEMCALCells() const {return fEMCALCells; } + AliESDCaloCells *GetPHOSCells() const {return fPHOSCells; } + AliRawDataErrorLog *GetErrorLog(Int_t i) const { return (AliRawDataErrorLog *)fErrorLogs->UncheckedAt(i); } @@ -275,21 +282,27 @@ public: Int_t GetNumberOfV0s() const {return fV0s->GetEntriesFast();} Int_t GetNumberOfCascades() const {return fCascades->GetEntriesFast();} Int_t GetNumberOfKinks() const {return fKinks->GetEntriesFast();} + Int_t GetEMCALClusters(TRefArray *clusters) const; Int_t GetPHOSClusters(TRefArray *clusters) const; Int_t GetNumberOfCaloClusters() const {return fCaloClusters->GetEntriesFast();} + + // Remove this stuff CKB? + //--------------------------------------------------- Int_t GetNumberOfEMCALClusters() const {return fEMCALClusters;} void SetNumberOfEMCALClusters(Int_t clus) {fEMCALClusters = clus;} Int_t GetFirstEMCALCluster() const {return fFirstEMCALCluster;} void SetFirstEMCALCluster(Int_t index) {fFirstEMCALCluster = index;} - TArrayF *GetEMCALTriggerPosition() const {return fEMCALTrigger->GetTriggerPosition();} - TArrayF *GetEMCALTriggerAmplitudes() const {return fEMCALTrigger->GetTriggerAmplitudes();} - + Int_t GetNumberOfPHOSClusters() const {return fPHOSClusters;} void SetNumberOfPHOSClusters(Int_t part) { fPHOSClusters = part ; } void SetFirstPHOSCluster(Int_t index) { fFirstPHOSCluster = index ; } Int_t GetFirstPHOSCluster() const { return fFirstPHOSCluster ; } + //------------------------------------------------------- + + TArrayF *GetEMCALTriggerPosition() const {return fEMCALTrigger->GetTriggerPosition();} + TArrayF *GetEMCALTriggerAmplitudes() const {return fEMCALTrigger->GetTriggerAmplitudes();} TArrayF *GetPHOSTriggerPosition() const {return fPHOSTrigger->GetTriggerPosition();} TArrayF *GetPHOSTriggerAmplitudes() const {return fPHOSTrigger->GetTriggerAmplitudes();} @@ -338,6 +351,8 @@ protected: TClonesArray *fCascades; //! Cascade vertices TClonesArray *fKinks; //! Kinks TClonesArray *fCaloClusters; //! Calorimeter clusters for PHOS/EMCAL + AliESDCaloCells *fEMCALCells; //! EMCAL cell info + AliESDCaloCells *fPHOSCells; //! PHOS cell info TClonesArray *fErrorLogs; //! Raw-data reading error messages diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 9ccd7ae8ba1..5e4ff664d03 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -143,6 +143,7 @@ #include "AliESDkink.h" #include "AliESDtrack.h" #include "AliESDCaloCluster.h" +#include "AliESDCaloCells.h" #include "AliMultiplicity.h" #include "AliTracker.h" #include "AliVertexer.h" @@ -2616,12 +2617,6 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile) // Access to the AOD container of clusters TClonesArray &caloClusters = *(aod->GetCaloClusters()); Int_t jClusters=0; - - // Calo Clusters - TArrayS EMCCellNumber(15000); - TArrayD EMCCellAmplitude(15000); - Int_t nEMCCells = 0; - const Float_t fEMCAmpScale = 1./500; for (Int_t iClust=0; iClustGetClusterType() == AliESDCaloCluster::kEMCALClusterv1) { ttype = AliAODCluster::kEMCALClusterv1; } - else if (cluster->GetClusterType() == AliESDCaloCluster::kEMCALPseudoCluster) { - // Collect raw tower info - for (Int_t iDig = 0; iDig < cluster->GetNumberOfDigits(); iDig++) { - EMCCellNumber[nEMCCells] = cluster->GetDigitIndex()->At(iDig); - EMCCellAmplitude[nEMCCells] = fEMCAmpScale*cluster->GetDigitAmplitude()->At(iDig); - nEMCCells++; - } - // don't write cluster data (it's just a pseudo cluster, holding the tower information) - continue; - } + AliAODCaloCluster *caloCluster = new(caloClusters[jClusters++]) AliAODCaloCluster(id, nLabel, @@ -2665,14 +2651,31 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile) caloClusters.Expand(jClusters); // resize TObjArray to 'remove' slots for pseudo clusters // end of loop on calo clusters - // fill EMC cell info - AliAODCaloCells &EMCCells = *(aod->GetEmcalCells()); - EMCCells.CreateContainer(nEMCCells); - EMCCells.SetType(AliAODCaloCells::kEMCAL); - for (Int_t iCell = 0; iCell < nEMCCells; iCell++) { - EMCCells.SetCell(iCell,EMCCellNumber[iCell],EMCCellAmplitude[iCell]); + // fill PHOS cell info + + AliESDCaloCells &esdEMcells = *(esd->GetEMCALCells()); + Int_t nEMcell = esdEMcells.GetNumberOfCells() ; + + AliAODCaloCells &aodEMcells = *(aod->GetEMCALCells()); + aodEMcells.CreateContainer(nEMcell); + aodEMcells.SetType(AliAODCaloCells::kEMCAL); + for (Int_t iCell = 0; iCell < nEMcell; iCell++) { + aodEMcells.SetCell(iCell,esdEMcells.GetCellNumber(iCell),esdEMcells.GetAmplitude(iCell)); + } + aodEMcells.Sort(); + + // fill PHOS cell info + + AliESDCaloCells &esdPHcells = *(esd->GetPHOSCells()); + Int_t nPHcell = esdPHcells.GetNumberOfCells() ; + + AliAODCaloCells &aodPHcells = *(aod->GetPHOSCells()); + aodPHcells.CreateContainer(nPHcell); + aodPHcells.SetType(AliAODCaloCells::kPHOS); + for (Int_t iCell = 0; iCell < nPHcell; iCell++) { + aodPHcells.SetCell(iCell,esdPHcells.GetCellNumber(iCell),esdPHcells.GetAmplitude(iCell)); } - EMCCells.Sort(); + aodPHcells.Sort(); // tracklets AliAODTracklets &SPDTracklets = *(aod->GetTracklets()); diff --git a/STEER/ESDLinkDef.h b/STEER/ESDLinkDef.h index a89482f7933..34764b84be7 100644 --- a/STEER/ESDLinkDef.h +++ b/STEER/ESDLinkDef.h @@ -66,6 +66,7 @@ #pragma link C++ class AliRawDataErrorLog+; #pragma link C++ class AliMeanVertex+; +#pragma link C++ class AliESDCaloCells+; #endif diff --git a/STEER/libESD.pkg b/STEER/libESD.pkg index d8e66de02e5..297fa3d90ee 100644 --- a/STEER/libESD.pkg +++ b/STEER/libESD.pkg @@ -21,7 +21,8 @@ SRCS = AliESDEvent.cxx AliESDInputHandler.cxx AliESDfriend.cxx AliESD.cxx \ AliESDTZERO.cxx \ AliESDCaloTrigger.cxx \ AliRawDataErrorLog.cxx \ - AliMeanVertex.cxx + AliMeanVertex.cxx \ + AliESDCaloCells.cxx HDRS:= $(SRCS:.cxx=.h) -- 2.39.3