}
//__________________________________________________________
-AliJetGrid::AliJetGrid(const AliJetGrid& grid):TNamed(grid) {
+AliJetGrid::AliJetGrid(const AliJetGrid& grid) : TNamed(grid),
+ fGrid(grid.fGrid),
+ fNphi(grid.fNphi),
+ fNeta(grid.fNeta),
+ fPhi(0),
+ fEta(0),
+ fIndex(0),
+ fIndexI(grid.fIndexI),
+ fIndexJ(grid.fIndexJ),
+ fPhiMin(grid.fPhiMin),
+ fPhiMax(grid.fPhiMax),
+ fEtaMin(grid.fEtaMin),
+ fEtaMax(grid.fEtaMax),
+ fEtaBinInTPCAcc(grid.fEtaBinInTPCAcc),
+ fPhiBinInTPCAcc(grid.fPhiBinInTPCAcc),
+ fEtaBinInEMCalAcc(grid.fEtaBinInEMCalAcc),
+ fPhiBinInEMCalAcc(grid.fPhiBinInEMCalAcc),
+ fNbinEta(grid.fNbinEta),
+ fNbinPhi(grid.fNbinPhi),
+ fMaxPhi(grid.fMaxPhi),
+ fMinPhi(grid.fMinPhi),
+ fMaxEta(grid.fMaxEta),
+ fMinEta(grid.fMinEta),
+ fDebug(grid.fDebug)
+{
// Copy constructor
- fNphi = grid.fNphi;
- fNeta = grid.fNeta;
- fPhiMin = grid.fPhiMin;
- fPhiMax = grid.fPhiMax;
- fEtaMin = grid.fEtaMin;
- fEtaMax = grid.fEtaMax;
- fEtaBinInTPCAcc = grid.fEtaBinInTPCAcc;
- fPhiBinInTPCAcc = grid.fPhiBinInTPCAcc;
- fEtaBinInEMCalAcc = grid.fEtaBinInEMCalAcc;
- fPhiBinInEMCalAcc = grid.fPhiBinInEMCalAcc;
- fNbinPhi = grid.fNbinPhi;
- fMaxPhi = grid.fMaxPhi;
- fMinPhi = grid.fMinPhi;
- fMaxEta = grid.fMaxEta;
- fMinEta = grid.fMinEta;
-
fPhi = new TArrayD(fNphi+1);
for(Int_t i=0; i<fNphi+1; i++) (*fPhi)[i] = grid.fPhi->At(i);
fEta = new TArrayD(fNeta+1);
}
}
+
+AliJetGrid& AliJetGrid::operator=(const AliJetGrid& other)
+{
+// Assignment
+ fGrid = other.fGrid;
+ fNphi = other.fNphi;
+ fNeta = other.fNeta;
+ fPhi = 0;
+ fEta = 0;
+ fIndex = 0;
+ fIndexI = other.fIndexI;
+ fIndexJ = other.fIndexJ;
+ fPhiMin = other.fPhiMin;
+ fPhiMax = other.fPhiMax;
+ fEtaMin = other.fEtaMin;
+ fEtaMax = other.fEtaMax;
+ fEtaBinInTPCAcc = other.fEtaBinInTPCAcc;
+ fPhiBinInTPCAcc = other.fPhiBinInTPCAcc;
+ fEtaBinInEMCalAcc = other.fEtaBinInEMCalAcc;
+ fPhiBinInEMCalAcc = other.fPhiBinInEMCalAcc;
+ fNbinEta = other.fNbinEta;
+ fNbinPhi = other.fNbinPhi;
+ fMaxPhi = other.fMaxPhi;
+ fMinPhi = other.fMinPhi;
+ fMaxEta = other.fMaxEta;
+ fMinEta = other.fMinEta;
+ fDebug = other.fDebug;
+ fPhi = new TArrayD(fNphi+1);
+ for(Int_t i=0; i<fNphi+1; i++) (*fPhi)[i] = other.fPhi->At(i);
+ fEta = new TArrayD(fNeta+1);
+ for(Int_t i=0; i<fNeta+1; i++) (*fEta)[i] = other.fEta->At(i);
+
+ fIndex = new TMatrixD(fNphi+1,fNeta+1);
+ for(Int_t i=0; i<fNphi+1; i++) {
+ for(Int_t j=0; j<fNeta+1; j++) (*fIndex)(i,j)=(*other.fIndex)(i,j);
+ }
+ return *this;
+}
+
//__________________________________________________________
AliJetGrid::~AliJetGrid() {
//__________________________________________________________
void AliJetGrid::InitParams(Double_t phiMinCal,Double_t phiMaxCal,Double_t etaMinCal,Double_t etaMaxCal)
-{ // To set initial parameters
+{
+// To set initial parameters
fPhiMin = phiMinCal; // rad
fPhiMax = phiMaxCal; // rad
//__________________________________________________________
TArrayD* AliJetGrid::GetArrayEta()
-{ // Returns an array with the eta points
+{
+// Returns an array with the eta points
return fEta;
//__________________________________________________________
TArrayD* AliJetGrid::GetArrayPhi()
-{ // Returns an array with the phi points
+{
+// Returns an array with the phi points
return fPhi;
//__________________________________________________________
TMatrixD* AliJetGrid::GetIndexObject()
-{ // Returns a pointer to the matrix
+{
+// Returns a pointer to the matrix
return fIndex;
//__________________________________________________________
void AliJetGrid::GetAccParam(Int_t &nphi, Int_t &neta, Float_t &minphi, Float_t &maxphi,
- Float_t &mineta, Float_t &maxeta)
-{ // Returns EMCAL acceptance initially setted
+ Float_t &mineta, Float_t &maxeta) const
+{
+// Returns EMCAL acceptance initially setted
nphi = fNphi;
neta = fNeta;
//__________________________________________________________
void AliJetGrid::GetBinParam(Int_t &phibintpc, Int_t &etabintpc,
- Int_t &phibinemc, Int_t &etabinemc, Int_t &nbinphi)
-{ // Returns number of bins in TPC and EMCAL geometry
+ Int_t &phibinemc, Int_t &etabinemc, Int_t &nbinphi) const
+{
+// Returns number of bins in TPC and EMCAL geometry
etabintpc = fEtaBinInTPCAcc;
phibintpc = fPhiBinInTPCAcc;
//__________________________________________________________
Int_t AliJetGrid::GetIndexFromEtaPhi(Double_t phi,Double_t eta) const
-{ // Tells the index value of a corresponding (eta,phi) real position
- // Loop over all entries -> takes time.
- // Used one time at the begining to fill the grids
+{
+// Tells the index value of a corresponding (eta,phi) real position
+// Loop over all entries -> takes time.
+// Used one time at the begining to fill the grids
/* this is how bins are numbered
//__________________________________________________________
void AliJetGrid::GetEtaPhiFromIndex(Int_t index, Float_t &eta, Float_t &phi)
-{ // Get (eta,phi) position for a given index BUT loop over all entries (takes time)
+{
+// Get (eta,phi) position for a given index BUT loop over all entries (takes time)
for(Int_t j=0; j<fNphi+1; j++) {
for(Int_t i=0; i<fNeta+1; i++) {
//__________________________________________________________
Int_t AliJetGrid::GetIndex(Double_t phi, Double_t eta)
-{ // Get index value for a (eta,phi) position - Direct value
+{
+// Get index value for a (eta,phi) position - Direct value
Int_t ieta = GetIndexJFromEta(eta);
Int_t iphi = GetIndexIFromPhi(phi);
//__________________________________________________________
Int_t AliJetGrid::GetIndexJFromEta(Double_t eta)
-{ // Get eta id
- // Eta discretized
+{
+// Get eta id
+// Eta discretized
Int_t idEta =0;
Double_t temp = (eta+fMaxEta)/(fMaxEta-fMinEta)*fNeta;
}
//__________________________________________________________
Int_t AliJetGrid::GetIndexIFromPhi(Double_t phi)
-{ // Get phi id
- // Phi discretized
+{
+// Get phi id
+// Phi discretized
Int_t idPhi = 0;
Double_t temp = 0.;
//__________________________________________________________
void AliJetGrid::SetMatrixIndex(Int_t i,Double_t par)
-{ // Allows to set parameters using only one index (if fGrid==0) !!
- // Not used !
+{
+// Allows to set parameters using only one index (if fGrid==0) !!
+// Not used !
Int_t iphi = (Int_t)i/fNeta;
Int_t ieta = i-iphi*fNeta;
//__________________________________________________________
void AliJetGrid::SetMatrixIndexes()
-{ // Fill the final matrix object with the corresponding index in eta/phi
+{
+// Fill the final matrix object with the corresponding index in eta/phi
for(Int_t i=0; i<fNphi+1; i++){
for(Int_t j=0; j<fNeta+1; j++){
//__________________________________________________________
void AliJetGrid::SetIndexIJ()
-{ //
+{
+// Set the grid index
for(Int_t i=0; i<fNphi+1; i++){
for(Int_t j=0; j<fNeta+1; j++){
}
//__________________________________________________________
-void AliJetGrid::GetIJFromIndex(Int_t index, Int_t i, Int_t j)
-{ // returns i position id of eta and j position id of phi for a given grid index
+void AliJetGrid::GetIJFromIndex(Int_t index, Int_t i, Int_t j) const
+{
+// Returns i position id of eta and j position id of phi for a given grid index
i = (*fIndexI)[index];
j = (*fIndexJ)[index];
}
//__________________________________________________________
void AliJetGrid::GetEtaPhiFromIndex2(Int_t index, Float_t &phi, Float_t &eta)
-{ // returns eta, phi values for a given grid index
+{
+// Returns eta, phi values for a given grid index
phi = fPhi->At((*fIndexI)[index]);
eta = fEta->At((*fIndexJ)[index]);
//__________________________________________________________
Int_t AliJetGrid::GetNEntries()
-{ // Returns the number of entries of the grid
+{
+// Returns the number of entries of the grid
if(fDebug>20){
cout << "fMaxPhi : " << fMaxPhi << endl;
//__________________________________________________________
Int_t AliJetGrid::GetNEntries2()
-{ // Returns the number of entries of the grid
+{
+// Returns the number of entries of the grid
Int_t indexNum = GetIndex(fMaxPhi-1.,fMaxEta-0.5);
if(fDebug>20) cout << "indexNum : " << indexNum << endl;