From c526514ba59cd01eb73ed02493e8ef49f05a9507 Mon Sep 17 00:00:00 2001 From: gconesab Date: Mon, 18 Oct 2010 09:10:03 +0000 Subject: [PATCH] Add debug prints, also some cosmetics. --- EMCAL/AliEMCALClusterizer.cxx | 63 ++++++++++------- EMCAL/AliEMCALClusterizerNxN.cxx | 112 +++++++++++++++---------------- EMCAL/AliEMCALClusterizerv1.cxx | 106 ++++++++++++++--------------- 3 files changed, 146 insertions(+), 135 deletions(-) diff --git a/EMCAL/AliEMCALClusterizer.cxx b/EMCAL/AliEMCALClusterizer.cxx index 7675f59f3fd..c3a6d93d7e2 100644 --- a/EMCAL/AliEMCALClusterizer.cxx +++ b/EMCAL/AliEMCALClusterizer.cxx @@ -133,10 +133,10 @@ AliEMCALClusterizer::AliEMCALClusterizer(AliEMCALGeometry* geometry, AliEMCALCal fECALocMaxCut(0.),fECAW0(0.),fMinECut(0.), fClusterUnfolding(NULL) { - // ctor, geometry and calibration are initialized elsewhere. - - if (!fGeom) - AliFatal("Geometry not initialized."); + // ctor, geometry and calibration are initialized elsewhere. + + if (!fGeom) + AliFatal("Geometry not initialized."); Int_t i=0; for (i = 0; i < 8; i++) @@ -250,26 +250,26 @@ void AliEMCALClusterizer::GetCalibrationParameters() //____________________________________________________________________________ void AliEMCALClusterizer::GetCaloCalibPedestal() { - // Set calibration parameters: - // if calibration database exists, they are read from database, - // otherwise, they are taken from digitizer. - // - // It is a user responsilibity to open CDB before reconstruction, - // for example: - // AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB"); - - //Check if calibration is stored in data base - - if(!fCaloPed) - { - AliCDBEntry *entry = (AliCDBEntry*) - AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals"); - if (entry) fCaloPed = (AliCaloCalibPedestal*) entry->GetObject(); - } - - if(!fCaloPed) - AliFatal("Pedestal info not found in CDB!"); - + // Set calibration parameters: + // if calibration database exists, they are read from database, + // otherwise, they are taken from digitizer. + // + // It is a user responsilibity to open CDB before reconstruction, + // for example: + // AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB"); + + //Check if calibration is stored in data base + + if(!fCaloPed) + { + AliCDBEntry *entry = (AliCDBEntry*) + AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals"); + if (entry) fCaloPed = (AliCaloCalibPedestal*) entry->GetObject(); + } + + if(!fCaloPed) + AliFatal("Pedestal info not found in CDB!"); + } //____________________________________________________________________________ @@ -346,7 +346,7 @@ void AliEMCALClusterizer::InitParameters() } for (i = 0; i < 3; i++) { AliDebug(1,Form("unfolding parameter 5: fPar5=%f \n",fPar5[i])); - AliDebug(1,Form("unfolding parameter 6: fPar5=%f \n",fPar6[i])); + AliDebug(1,Form("unfolding parameter 6: fPar6=%f \n",fPar6[i])); } } @@ -373,8 +373,19 @@ void AliEMCALClusterizer::Print(Option_t * /*option*/)const printf("Clusterizing digits: "); printf("\n ECA Local Maximum cut = %f", fECALocMaxCut); printf("\n ECA Logarithmic weight = %f", fECAW0); - if(fToUnfold) + if(fToUnfold){ printf("\nUnfolding on\n"); + printf("Unfolding parameters: fSSpars: \n"); + Int_t i=0; + for (i = 0; i < 8; i++) { + printf("fSSPars[%d] = %f \n", i, fSSPars[i]); + } + printf("Unfolding parameter 5 and 6: fPar5 and fPar6: \n"); + for (i = 0; i < 3; i++) { + printf("fPar5[%d] = %f \n", i, fPar5[i]); + printf("fPar6[%d] = %f \n", i, fPar6[i]); + } + } else printf("\nUnfolding off\n"); diff --git a/EMCAL/AliEMCALClusterizerNxN.cxx b/EMCAL/AliEMCALClusterizerNxN.cxx index 75c5d92aba6..8c6de2d6255 100644 --- a/EMCAL/AliEMCALClusterizerNxN.cxx +++ b/EMCAL/AliEMCALClusterizerNxN.cxx @@ -171,62 +171,62 @@ void AliEMCALClusterizerNxN::Digits2Clusters(Option_t * option) //____________________________________________________________________________ Int_t AliEMCALClusterizerNxN::AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2, Bool_t & shared) const { - // Gives the neighbourness of two digits = 0 are not neighbour ; continue searching - // = 1 are neighbour - // = 2 is in different SM; continue searching - // In case it is in different SM, but same phi rack, check if neigbours at eta=0 - // neighbours are defined as digits having at least a common side - // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster - // which is compared to a digit (d2) not yet in a cluster - - static Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0; - static Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0; - static Int_t rowdiff=0, coldiff=0; - - shared = kFALSE; - - fGeom->GetCellIndex(d1->GetId(), nSupMod1,nModule1,nIphi1,nIeta1); - fGeom->GetCellIndex(d2->GetId(), nSupMod2,nModule2,nIphi2,nIeta2); - fGeom->GetCellPhiEtaIndexInSModule(nSupMod1,nModule1,nIphi1,nIeta1, iphi1,ieta1); - fGeom->GetCellPhiEtaIndexInSModule(nSupMod2,nModule2,nIphi2,nIeta2, iphi2,ieta2); - - //If different SM, check if they are in the same phi, then consider cells close to eta=0 as neighbours; May 2010 - if(nSupMod1 != nSupMod2 ) - { - //Check if the 2 SM are in the same PHI position (0,1), (2,3), ... - Float_t smPhi1 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod1); - Float_t smPhi2 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod2); - - if(!TMath::AreEqualAbs(smPhi1, smPhi2, 1e-3)) return 2; //Not phi rack equal, not neighbours - - // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2 - // C Side impair SM, nSupMod%2=1; A side pair SM nSupMod%2=0 - if(nSupMod1%2) ieta1+=AliEMCALGeoParams::fgkEMCALCols; - else ieta2+=AliEMCALGeoParams::fgkEMCALCols; - - shared = kTRUE; // maybe a shared cluster, we know this later, set it for the moment. - - }//Different SM, same phi - - rowdiff = TMath::Abs(iphi1 - iphi2); - coldiff = TMath::Abs(ieta1 - ieta2) ; - - // neighbours +-1 in col and row - if ( TMath::Abs(coldiff) < 2 && TMath::Abs(rowdiff) < 2) - { - - AliDebug(9, Form("AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", - d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared)); - - return 1; - }//Neighbours - else - { - AliDebug(9, Form("NOT AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", - d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared)); - shared = kFALSE; - return 2 ; - }//Not neighbours + // Gives the neighbourness of two digits = 0 are not neighbour ; continue searching + // = 1 are neighbour + // = 2 is in different SM; continue searching + // In case it is in different SM, but same phi rack, check if neigbours at eta=0 + // neighbours are defined as digits having at least a common side + // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster + // which is compared to a digit (d2) not yet in a cluster + + static Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0; + static Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0; + static Int_t rowdiff=0, coldiff=0; + + shared = kFALSE; + + fGeom->GetCellIndex(d1->GetId(), nSupMod1,nModule1,nIphi1,nIeta1); + fGeom->GetCellIndex(d2->GetId(), nSupMod2,nModule2,nIphi2,nIeta2); + fGeom->GetCellPhiEtaIndexInSModule(nSupMod1,nModule1,nIphi1,nIeta1, iphi1,ieta1); + fGeom->GetCellPhiEtaIndexInSModule(nSupMod2,nModule2,nIphi2,nIeta2, iphi2,ieta2); + + //If different SM, check if they are in the same phi, then consider cells close to eta=0 as neighbours; May 2010 + if(nSupMod1 != nSupMod2 ) + { + //Check if the 2 SM are in the same PHI position (0,1), (2,3), ... + Float_t smPhi1 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod1); + Float_t smPhi2 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod2); + + if(!TMath::AreEqualAbs(smPhi1, smPhi2, 1e-3)) return 2; //Not phi rack equal, not neighbours + + // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2 + // C Side impair SM, nSupMod%2=1; A side pair SM nSupMod%2=0 + if(nSupMod1%2) ieta1+=AliEMCALGeoParams::fgkEMCALCols; + else ieta2+=AliEMCALGeoParams::fgkEMCALCols; + + shared = kTRUE; // maybe a shared cluster, we know this later, set it for the moment. + + }//Different SM, same phi + + rowdiff = TMath::Abs(iphi1 - iphi2); + coldiff = TMath::Abs(ieta1 - ieta2) ; + + // neighbours +-1 in col and row + if ( TMath::Abs(coldiff) < 2 && TMath::Abs(rowdiff) < 2) + { + + AliDebug(9, Form("AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", + d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared)); + + return 1; + }//Neighbours + else + { + AliDebug(9, Form("NOT AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", + d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared)); + shared = kFALSE; + return 2 ; + }//Not neighbours } //____________________________________________________________________________ diff --git a/EMCAL/AliEMCALClusterizerv1.cxx b/EMCAL/AliEMCALClusterizerv1.cxx index 8f6c4e01edb..41998b0662b 100644 --- a/EMCAL/AliEMCALClusterizerv1.cxx +++ b/EMCAL/AliEMCALClusterizerv1.cxx @@ -155,59 +155,59 @@ void AliEMCALClusterizerv1::Digits2Clusters(Option_t * option) //____________________________________________________________________________ Int_t AliEMCALClusterizerv1::AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2, Bool_t & shared) const { - // Gives the neighbourness of two digits = 0 are not neighbour ; continue searching - // = 1 are neighbour - // = 2 is in different SM; continue searching - // In case it is in different SM, but same phi rack, check if neigbours at eta=0 - // neighbours are defined as digits having at least a common side - // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster - // which is compared to a digit (d2) not yet in a cluster - - static Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0; - static Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0; - - shared = kFALSE; - - fGeom->GetCellIndex(d1->GetId(), nSupMod1,nModule1,nIphi1,nIeta1); - fGeom->GetCellIndex(d2->GetId(), nSupMod2,nModule2,nIphi2,nIeta2); - fGeom->GetCellPhiEtaIndexInSModule(nSupMod1,nModule1,nIphi1,nIeta1, iphi1,ieta1); - fGeom->GetCellPhiEtaIndexInSModule(nSupMod2,nModule2,nIphi2,nIeta2, iphi2,ieta2); - - //If different SM, check if they are in the same phi, then consider cells close to eta=0 as neighbours; May 2010 - if(nSupMod1 != nSupMod2 ) { - //Check if the 2 SM are in the same PHI position (0,1), (2,3), ... - Float_t smPhi1 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod1); - Float_t smPhi2 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod2); - - if(!TMath::AreEqualAbs(smPhi1, smPhi2, 1e-3)) return 2; //Not phi rack equal, not neighbours - - // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2 - // C Side impair SM, nSupMod%2=1; A side pair SM nSupMod%2=0 - if(nSupMod1%2) ieta1+=AliEMCALGeoParams::fgkEMCALCols; - else ieta2+=AliEMCALGeoParams::fgkEMCALCols; - - shared = kTRUE; // maybe a shared cluster, we know this later, set it for the moment. - - }//Different SM, same phi - - Int_t rowdiff = TMath::Abs(iphi1 - iphi2); - Int_t coldiff = TMath::Abs(ieta1 - ieta2) ; - - // neighbours with at least common side; May 11, 2007 - if ((coldiff==0 && TMath::Abs(rowdiff)==1) || (rowdiff==0 && TMath::Abs(coldiff)==1)) { - //Diagonal? - //if ((coldiff==0 && TMath::Abs(rowdiff==1)) || (rowdiff==0 && TMath::Abs(coldiff==1)) || (TMath::Abs(rowdiff)==1 && TMath::Abs(coldiff==1))) rv = 1; - - if (gDebug == 2) - printf("AliEMCALClusterizerv1::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", - d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared); - - return 1; - }//Neighbours - else { - shared = kFALSE; - return 2 ; - }//Not neighbours + // Gives the neighbourness of two digits = 0 are not neighbour ; continue searching + // = 1 are neighbour + // = 2 is in different SM; continue searching + // In case it is in different SM, but same phi rack, check if neigbours at eta=0 + // neighbours are defined as digits having at least a common side + // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster + // which is compared to a digit (d2) not yet in a cluster + + static Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0; + static Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0; + + shared = kFALSE; + + fGeom->GetCellIndex(d1->GetId(), nSupMod1,nModule1,nIphi1,nIeta1); + fGeom->GetCellIndex(d2->GetId(), nSupMod2,nModule2,nIphi2,nIeta2); + fGeom->GetCellPhiEtaIndexInSModule(nSupMod1,nModule1,nIphi1,nIeta1, iphi1,ieta1); + fGeom->GetCellPhiEtaIndexInSModule(nSupMod2,nModule2,nIphi2,nIeta2, iphi2,ieta2); + + //If different SM, check if they are in the same phi, then consider cells close to eta=0 as neighbours; May 2010 + if(nSupMod1 != nSupMod2 ) { + //Check if the 2 SM are in the same PHI position (0,1), (2,3), ... + Float_t smPhi1 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod1); + Float_t smPhi2 = fGeom->GetEMCGeometry()->GetPhiCenterOfSM(nSupMod2); + + if(!TMath::AreEqualAbs(smPhi1, smPhi2, 1e-3)) return 2; //Not phi rack equal, not neighbours + + // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2 + // C Side impair SM, nSupMod%2=1; A side pair SM nSupMod%2=0 + if(nSupMod1%2) ieta1+=AliEMCALGeoParams::fgkEMCALCols; + else ieta2+=AliEMCALGeoParams::fgkEMCALCols; + + shared = kTRUE; // maybe a shared cluster, we know this later, set it for the moment. + + }//Different SM, same phi + + Int_t rowdiff = TMath::Abs(iphi1 - iphi2); + Int_t coldiff = TMath::Abs(ieta1 - ieta2) ; + + // neighbours with at least common side; May 11, 2007 + if ((coldiff==0 && TMath::Abs(rowdiff)==1) || (rowdiff==0 && TMath::Abs(coldiff)==1)) { + //Diagonal? + //if ((coldiff==0 && TMath::Abs(rowdiff==1)) || (rowdiff==0 && TMath::Abs(coldiff==1)) || (TMath::Abs(rowdiff)==1 && TMath::Abs(coldiff==1))) rv = 1; + + if (gDebug == 2) + printf("AliEMCALClusterizerv1::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n", + d1->GetId(), iphi1,ieta1, d2->GetId(), iphi2,ieta2, shared); + + return 1; + }//Neighbours + else { + shared = kFALSE; + return 2 ; + }//Not neighbours } //____________________________________________________________________________ -- 2.39.3