From b7cbcf19eac93960fe1ae59a8ce986073157774a Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 4 Feb 2020 19:42:30 +0000 Subject: [PATCH 1/3] ATLASRECTS-5012, remove usages of CaloDetDescrManager::instance --- .../CaloFillRectangularCluster.h | 3 + .../src/CaloClusterLocalCalib.cxx | 3 +- .../src/CaloClusterLocalCalibCone.cxx | 199 ++++++++---------- .../src/CaloClusterLocalCalibCone.h | 2 - .../src/CaloClusterLogPos.cxx | 8 +- .../src/CaloClusterLogPos.h | 2 - .../src/CaloFillRectangularCluster.cxx | 49 +++-- .../CaloRec/src/CaloClusterMomentsMaker.cxx | 3 - .../CaloClusterMomentsMaker_DigiHSTruth.cxx | 3 - .../src/egammaLargeClusterMaker.cxx | 9 +- .../TrigCaloRec/src/FullCaloCellContMaker.cxx | 7 - .../src/RoIFCalEmCellContMaker.cxx | 4 - .../src/RoIFCalHadCellContMaker.cxx | 4 - 13 files changed, 124 insertions(+), 172 deletions(-) diff --git a/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h b/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h index 451c569497d..24513dd9d65 100755 --- a/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h +++ b/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h @@ -43,6 +43,7 @@ #include "AthenaKernel/IOVSvcDefs.h" #include "StoreGate/ReadHandleKey.h" #include "GaudiKernel/ThreadLocalContext.h" +class CaloDetDescrManager; // Helper object used for the per-sampling calculations. namespace CaloClusterCorr { @@ -148,6 +149,7 @@ private: * @param samplings List of samplings for this region. */ void makeCorrection1 (const EventContext& ctx, + const CaloDetDescrManager& dd_man, CaloClusterCorr::SamplingHelper& helper, double eta, double phi, @@ -160,6 +162,7 @@ private: * @param helper Sampling calculation helper object. */ void makeCorrection2 (const EventContext& ctx, + const CaloDetDescrManager& dd_man, CaloClusterCorr::SamplingHelper& helper) const; diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx index a8b2d61d81e..392acfeb7d3 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx @@ -93,7 +93,8 @@ StatusCode CaloClusterLocalCalib::execute(const EventContext& ctx, double oldEnergy = theCluster->e(); - const CaloDetDescrManager* calo_dd_man = CaloDetDescrManager::instance(); + const CaloDetDescrManager* calo_dd_man = nullptr; + ATH_CHECK( detStore()->retrieve(calo_dd_man,"CaloMgr")); const CaloCell_ID* calo_id = calo_dd_man->getCaloCell_ID(); // Make new Cluster and CellColl diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx index c1461af172e..a834f0a4523 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx @@ -50,8 +50,6 @@ CaloClusterLocalCalibCone::CaloClusterLocalCalibCone(const std::string& type, m_hadWeightFileName(""), m_signalOverNoiseCut(2), m_hadWeightFile(0), - m_calo_id(0), - m_calo_dd_man(0), m_noiseTool(0) { m_etaBins.resize(0); @@ -84,9 +82,6 @@ StatusCode CaloClusterLocalCalibCone::initialize() msg(MSG::INFO) << "Initializing " << name() << endmsg; - // pointer to detector manager: - m_calo_dd_man = CaloDetDescrManager::instance(); - m_calo_id = m_calo_dd_man->getCaloCell_ID(); //---- retrieve the noise tool ---------------- @@ -221,127 +216,105 @@ CaloClusterLocalCalibCone::execute(const EventContext& /*ctx*/, xAOD::CaloClusterContainer::iterator clusIter = clusColl->begin(); xAOD::CaloClusterContainer::iterator clusIterEnd = clusColl->end(); unsigned int iClus=0; - for( ;clusIter!=clusIterEnd;clusIter++,iClus++) { - xAOD::CaloCluster * thisCluster = *clusIter; + for (; clusIter != clusIterEnd; clusIter++, iClus++) { + xAOD::CaloCluster* thisCluster = *clusIter; // check existing jets - for(unsigned int ijet=0;ijetAngle(thisCluster->p4().Vect()) < m_coneDistance ) - || ( m_coneSchema == DeltaR - && jets[ijet]->DeltaR(thisCluster->p4()) < m_coneDistance ) ) { - if ( thisCluster->e()+jets[ijet]->E() > 0 ) { - pjet[iClus] = jets[ijet]; - // add energy only - don't change jet direction - (*jets[ijet]) *= ((thisCluster->e()+jets[ijet]->E()) - /jets[ijet]->E()); - - ATH_MSG_DEBUG( - "added cluster with E/eta/phi = " << thisCluster->e() - << "/" << thisCluster->eta() - << "/" << thisCluster->phi() - << " to jet " << ijet << " which has now E/eta/phi/M = " - << jets[ijet]->E() - << "/" << jets[ijet]->Eta() - << "/" << jets[ijet]->Phi() - << "/" << jets[ijet]->M() - << endmsg); - } - break; + for (unsigned int ijet = 0; ijet < jets.size(); ijet++) { + if ((m_coneSchema == Angle && jets[ijet]->Angle(thisCluster->p4().Vect()) < m_coneDistance) || + (m_coneSchema == DeltaR && jets[ijet]->DeltaR(thisCluster->p4()) < m_coneDistance)) { + if (thisCluster->e() + jets[ijet]->E() > 0) { + pjet[iClus] = jets[ijet]; + // add energy only - don't change jet direction + (*jets[ijet]) *= ((thisCluster->e() + jets[ijet]->E()) / jets[ijet]->E()); + + ATH_MSG_DEBUG("added cluster with E/eta/phi = " + << thisCluster->e() << "/" << thisCluster->eta() << "/" << thisCluster->phi() << " to jet " + << ijet << " which has now E/eta/phi/M = " << jets[ijet]->E() << "/" << jets[ijet]->Eta() << "/" + << jets[ijet]->Phi() << "/" << jets[ijet]->M() << endmsg); + } + break; } } - if ( !pjet[iClus] && thisCluster->e() > 0 ) { + if (!pjet[iClus] && thisCluster->e() > 0) { // make new jet - TLorentzVector *theJet = new TLorentzVector(thisCluster->p4()); + TLorentzVector* theJet = new TLorentzVector(thisCluster->p4()); pjet[iClus] = theJet; jets.push_back(theJet); - ATH_MSG_DEBUG( - "cluster with E/eta/phi = " << thisCluster->e() - << "/" << thisCluster->eta() - << "/" << thisCluster->phi() - << " started new jet " << jets.size()-1 - << " which has now E/eta/phi/M = " - << theJet->E() - << "/" << theJet->Eta() - << "/" << theJet->Phi() - << "/" << theJet->M() - << endmsg); + ATH_MSG_DEBUG("cluster with E/eta/phi = " + << thisCluster->e() << "/" << thisCluster->eta() << "/" << thisCluster->phi() << " started new jet " + << jets.size() - 1 << " which has now E/eta/phi/M = " << theJet->E() << "/" << theJet->Eta() << "/" + << theJet->Phi() << "/" << theJet->M() << endmsg); } } + const CaloDetDescrManager* calo_dd_man = nullptr; + ATH_CHECK( detStore()->retrieve(calo_dd_man,"CaloMgr") ); + clusIter = clusColl->begin(); - iClus=0; - for( ;clusIter!=clusIterEnd;clusIter++,iClus++) { - xAOD::CaloCluster * thisCluster = *clusIter; - if ( pjet[iClus] - && thisCluster->recoStatus().checkStatus(CaloRecoStatus::StatusIndicator(m_recoStatus))) { - TLorentzVector *thisJet = pjet[iClus]; + iClus = 0; + for (; clusIter != clusIterEnd; clusIter++, iClus++) { + xAOD::CaloCluster* thisCluster = *clusIter; + if (pjet[iClus] && thisCluster->recoStatus().checkStatus(CaloRecoStatus::StatusIndicator(m_recoStatus))) { + TLorentzVector* thisJet = pjet[iClus]; // weight all cells in selected cluster xAOD::CaloCluster::cell_iterator itrCell = thisCluster->cell_begin(); xAOD::CaloCluster::cell_iterator itrCell_e = thisCluster->cell_end(); - for (;itrCell!=itrCell_e;++itrCell) { - const CaloCell* thisCell = *itrCell; - double weight = itrCell.weight(); - // check calo and sampling index for current cell - Identifier myId = thisCell->ID(); - CaloCell_ID::CaloSample theSample = thisCell->caloDDE()->getSampling(); - if ( theSample < (int)m_caloIndices.size() - && m_caloIndices[theSample] >= 0 - && m_samplingIndices[theSample] >= 0 ) { - // check noise level and energy density of the current cell - double sigma = m_noiseTool->getNoise(thisCell,ICalorimeterNoiseTool::ELECTRONICNOISE); - double energy = fabs(thisCell->e()); - double ratio = 0; - if ( finite(sigma) && sigma > 0 ) - ratio = energy/sigma; - if ( ratio > m_signalOverNoiseCut ) { - double volume = 0; - double density = 0; - const CaloDetDescrElement* myCDDE = m_calo_dd_man->get_element(myId); - if ( myCDDE ) { - volume = myCDDE->volume(); - } - if ( volume > 0 ) - density = energy/volume; - if ( density > 0 ) { - int neta = m_etaBins.size()-1; - int ieta; - double abseta = fabs(thisCell->eta()); - for(ieta=0;ieta= m_etaBins[ieta] - && abseta < m_etaBins[ieta+1]) - break; - } - if ( ieta < neta && m_data[theSample][ieta]) { - double log10edens = log10(density); - double log10conee = log10(thisJet->E()); - double lemax = m_data[theSample][ieta]->GetXaxis()->GetBinCenter(m_data[theSample][ieta]->GetNbinsX()); - if ( log10conee > lemax ) - log10conee = lemax; - int iBin = m_data[theSample][ieta]->FindBin(log10conee,log10edens); - double num = m_data[theSample][ieta]->GetBinEntries(iBin); - if (num > 10 ) { - weight *= m_data[theSample][ieta]->GetBinContent(iBin); - thisCluster->reweightCell(itrCell,weight); - ATH_MSG_VERBOSE( - "cell with E/eta/phi = " << thisCell->e() - << "/" << thisCell->eta() - << "/" << thisCell->phi() - << " in jet with E/eta/phi/M = " - << thisJet->E() - << "/" << thisJet->Eta() - << "/" << thisJet->Phi() - << "/" << thisJet->M() - << " weighted with w = " << weight - << endmsg); - } - } - }//end if density >0 - }//end if noise cut - } - }//end loop over cells + for (; itrCell != itrCell_e; ++itrCell) { + const CaloCell* thisCell = *itrCell; + double weight = itrCell.weight(); + // check calo and sampling index for current cell + Identifier myId = thisCell->ID(); + CaloCell_ID::CaloSample theSample = thisCell->caloDDE()->getSampling(); + if (theSample < (int)m_caloIndices.size() && m_caloIndices[theSample] >= 0 && + m_samplingIndices[theSample] >= 0) { + // check noise level and energy density of the current cell + double sigma = m_noiseTool->getNoise(thisCell, ICalorimeterNoiseTool::ELECTRONICNOISE); + double energy = fabs(thisCell->e()); + double ratio = 0; + if (finite(sigma) && sigma > 0) + ratio = energy / sigma; + if (ratio > m_signalOverNoiseCut) { + double volume = 0; + double density = 0; + const CaloDetDescrElement* myCDDE = calo_dd_man->get_element(myId); + if (myCDDE) { + volume = myCDDE->volume(); + } + if (volume > 0) + density = energy / volume; + if (density > 0) { + int neta = m_etaBins.size() - 1; + int ieta; + double abseta = fabs(thisCell->eta()); + for (ieta = 0; ieta < neta; ieta++) { + if (abseta >= m_etaBins[ieta] && abseta < m_etaBins[ieta + 1]) + break; + } + if (ieta < neta && m_data[theSample][ieta]) { + double log10edens = log10(density); + double log10conee = log10(thisJet->E()); + double lemax = m_data[theSample][ieta]->GetXaxis()->GetBinCenter(m_data[theSample][ieta]->GetNbinsX()); + if (log10conee > lemax) + log10conee = lemax; + int iBin = m_data[theSample][ieta]->FindBin(log10conee, log10edens); + double num = m_data[theSample][ieta]->GetBinEntries(iBin); + if (num > 10) { + weight *= m_data[theSample][ieta]->GetBinContent(iBin); + thisCluster->reweightCell(itrCell, weight); + ATH_MSG_VERBOSE("cell with E/eta/phi = " + << thisCell->e() << "/" << thisCell->eta() << "/" << thisCell->phi() + << " in jet with E/eta/phi/M = " << thisJet->E() << "/" << thisJet->Eta() << "/" + << thisJet->Phi() << "/" << thisJet->M() << " weighted with w = " << weight + << endmsg); + } + } + } // end if density >0 + } // end if noise cut + } + } // end loop over cells CaloClusterKineHelper::calculateKine(thisCluster,true,m_updateSamplingVars); - - }//end if reco status - }//end loop over clusters + + } // end if reco status + } // end loop over clusters for(unsigned int ijet=0;ijet > m_data; - const CaloCell_ID* m_calo_id; - const CaloDetDescrManager* m_calo_dd_man; ICalorimeterNoiseTool * m_noiseTool; }; diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx index 11d8e7af814..4c5c262ccd3 100644 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx @@ -17,9 +17,7 @@ CaloClusterLogPos::CaloClusterLogPos(const std::string& type, const std::string& name, const IInterface* parent) :CaloClusterProcessor(type, name, parent), - m_offset(4.7), - m_calo_id(0), - m_calo_dd_man(0) + m_offset(4.7) { declareProperty ("LogPosOffset",m_offset) ; } @@ -29,10 +27,6 @@ StatusCode CaloClusterLogPos::initialize() { ATH_MSG_DEBUG("Initializing " << name() << endmsg ) ; - // pointer to detector manager: - m_calo_dd_man = CaloDetDescrManager::instance(); - m_calo_id = m_calo_dd_man->getCaloCell_ID(); - return StatusCode::SUCCESS; } diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h index b2fd225986c..840004e18c3 100644 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h @@ -69,8 +69,6 @@ class CaloClusterLogPos : public CaloClusterProcessor // property: offset for the logarithmic weighting double m_offset; - const CaloCell_ID* m_calo_id; - const CaloDetDescrManager* m_calo_dd_man; }; diff --git a/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx b/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx index 51305081434..041b4a409bd 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx @@ -62,7 +62,8 @@ namespace CaloClusterCorr { * direction, and finding the centers of those cells. Then we use * the larger of these for the symmetric range. */ -void etaphi_range (double eta, +void etaphi_range (const CaloDetDescrManager& dd_man, + double eta, double phi, CaloCell_ID::CaloSample sampling, double& deta, @@ -72,15 +73,14 @@ void etaphi_range (double eta, dphi = 0; // Get the DD element for the central cell. - const CaloDetDescrManager* dd_man = CaloDetDescrManager::instance(); - const CaloDetDescrElement* elt = dd_man->get_element_raw (sampling, eta, phi); + const CaloDetDescrElement* elt = dd_man.get_element_raw (sampling, eta, phi); if (!elt) return; // Should be smaller than the eta half-width of any cell. const double eps = 0.001; // Now look in the negative eta direction. - const CaloDetDescrElement* elt_l = dd_man->get_element_raw + const CaloDetDescrElement* elt_l = dd_man.get_element_raw (sampling, eta - elt->deta() - eps, phi); @@ -89,7 +89,7 @@ void etaphi_range (double eta, deta_l = std::abs (eta - elt_l->eta_raw()) + eps; // Now look in the positive eta direction. - const CaloDetDescrElement* elt_r = dd_man->get_element_raw + const CaloDetDescrElement* elt_r = dd_man.get_element_raw (sampling, eta + elt->deta() + eps, phi); @@ -106,7 +106,7 @@ void etaphi_range (double eta, // take the largest variation. // Now look in the negative eta direction. - elt_l = dd_man->get_element_raw + elt_l = dd_man.get_element_raw (sampling, eta - elt->deta() - eps, CaloPhiRange::fix (phi - elt->dphi() - eps)); @@ -115,7 +115,7 @@ void etaphi_range (double eta, dphi_l = std::abs (CaloPhiRange::fix (phi - elt_l->phi_raw())) + eps; // Now look in the positive eta direction. - elt_r = dd_man->get_element_raw + elt_r = dd_man.get_element_raw (sampling, eta + elt->deta() + eps, CaloPhiRange::fix (phi - elt->dphi() - eps)); @@ -137,18 +137,15 @@ void etaphi_range (double eta, class Segmentation { public: - Segmentation (StoreGateSvc* detStore); - + Segmentation (const CaloDetDescrManager* dd_man); /// middle layer cell segmentation size double m_detas2; double m_dphis2; }; - -Segmentation::Segmentation (StoreGateSvc* detStore) +Segmentation::Segmentation (const CaloDetDescrManager* dd_man) { - const CaloDetDescrManager* dd_man = nullptr; - if (detStore->retrieve (dd_man, "CaloMgr").isFailure()) { + if(dd_man == nullptr){ m_detas2 = 0; m_dphis2 = 0; } @@ -822,6 +819,7 @@ StatusCode CaloFillRectangularCluster::initialize() */ void CaloFillRectangularCluster::makeCorrection1(const EventContext& ctx, + const CaloDetDescrManager& dd_man, CaloClusterCorr::SamplingHelper& helper, double eta, @@ -862,7 +860,7 @@ CaloFillRectangularCluster::makeCorrection1(const EventContext& ctx, // This only makes sense if the previous step was OK if (refine) { double detastr, dphistr; - CaloClusterCorr::etaphi_range (helper.etamax(), helper.phimax(), + CaloClusterCorr::etaphi_range (dd_man,helper.etamax(), helper.phimax(), xsample, detastr, dphistr); @@ -871,9 +869,9 @@ CaloFillRectangularCluster::makeCorrection1(const EventContext& ctx, detastr, dphistr, samplings[1]); if (helper.etam()!=-999.) { - eta1 = helper.etam(); - double eta1r = helper.etareal(); - helper.cluster()->setEta(samplings[1], eta1r); + eta1 = helper.etam(); + double eta1r = helper.etareal(); + helper.cluster()->setEta(samplings[1], eta1r); } } } @@ -952,6 +950,7 @@ CaloFillRectangularCluster::makeCorrection1(const EventContext& ctx, */ void CaloFillRectangularCluster::makeCorrection2 (const EventContext& ctx, + const CaloDetDescrManager& dd_man, CaloClusterCorr::SamplingHelper& helper) const { @@ -1041,12 +1040,12 @@ CaloFillRectangularCluster::makeCorrection2 (const EventContext& ctx, // Barrel if (aeta < 1.6) { - makeCorrection1 (ctx, helper, eta, phi, samplings_b); + makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_b); } // Endcap if (aeta > 1.3) { - makeCorrection1 (ctx, helper, eta, phi, samplings_e); + makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_e); } // Set the total cluster energy to the sum over all samplings. @@ -1075,8 +1074,14 @@ void CaloFillRectangularCluster::makeCorrection(const EventContext& ctx, CaloCluster* cluster) const { ATH_MSG_DEBUG( "Executing CaloFillRectangularCluster" << endmsg) ; + + const CaloDetDescrManager* calodetdescrmgr = nullptr; + if(detStore()->retrieve(calodetdescrmgr,"CaloMgr").isFailure()){ + ATH_MSG_ERROR ("Failed to retrieve CaloDetDescrManager : CaloMgr"); + } + - CaloClusterCorr::Segmentation seg (&*detStore()); + CaloClusterCorr::Segmentation seg (calodetdescrmgr); if (seg.m_detas2 == 0) { ATH_MSG_ERROR ("Retrieving cell segmentation"); return; @@ -1121,12 +1126,12 @@ void CaloFillRectangularCluster::makeCorrection(const EventContext& ctx, cluster, cell_list, cell_container); - makeCorrection2 (ctx, helper); + makeCorrection2 (ctx,*calodetdescrmgr, helper); } else { // We're recalculating a cluster using the existing cells. CaloClusterCorr::SamplingHelper_Cluster helper (*this, windows, cluster); - makeCorrection2 (ctx, helper); + makeCorrection2 (ctx, *calodetdescrmgr,helper); } } diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx index d97e53c389c..cd64eefa559 100644 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx @@ -235,10 +235,7 @@ StatusCode CaloClusterMomentsMaker::initialize() } } */ - // pointer to detector manager: - //m_calo_dd_man = CaloDetDescrManager::instance(); - //m_calo_id = m_calo_dd_man->getCaloCell_ID(); CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID")); CHECK(m_caloDepthTool.retrieve()); diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx index 0278524847d..11d26979839 100755 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx @@ -240,10 +240,7 @@ StatusCode CaloClusterMomentsMaker_DigiHSTruth::initialize() } } */ - // pointer to detector manager: - //m_calo_dd_man = CaloDetDescrManager::instance(); - //m_calo_id = m_calo_dd_man->getCaloCell_ID(); ATH_CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID")); ATH_CHECK(m_caloDepthTool.retrieve()); diff --git a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx index 587c0259659..97299e14a0d 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx @@ -54,7 +54,10 @@ StatusCode egammaLargeClusterMaker::execute(const EventContext& ctx, SG::ReadHandle inputClusters(m_inputClusterCollection, ctx); // retrieve the cell containers SG::ReadHandle cellcoll(m_cellsKey, ctx); - + + const CaloDetDescrManager* dd_man= nullptr; + ATH_CHECK( detStore()->retrieve(dd_man,"CaloMgr") ); + // The main loop over clusters for (auto cluster : *inputClusters) { @@ -82,9 +85,7 @@ StatusCode egammaLargeClusterMaker::execute(const EventContext& ctx, if ((eta==0. && phi==0.) || fabs(eta)>100) { return StatusCode::SUCCESS; } - - const CaloDetDescrManager* dd_man = CaloDetDescrManager::instance(); - + // Should get overritten bool barrel=false; CaloCell_ID::SUBCALO subcalo=CaloCell_ID::LAREM; diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx index 21c9912bdff..b98fdc3cb57 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx @@ -197,13 +197,6 @@ StatusCode FullCaloCellContMaker::addFullLArCells(CaloCellContainer& pCaloCellCo // noise suppression if(m_do_LArCells_noise_suppression!=0){ - //const CaloDetDescrManager* m_CaloDetDescrManager = CaloDetDescrManager::instance(); - //if ( m_CaloDetDescrManager == 0 ) - // { - //std::cout << "ERROR : cannot allocate CaloDetDescrManager" - // << endmsg; -// return StatusCode::FAILURE; - // } for(m_it = m_iBegin;m_it != m_iEnd; ++m_it) { // Main Loop //const CaloDetDescrElement* caloDDE = (*m_it)->caloDDE(); diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx index ddaaca1c590..8660f9794ac 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx @@ -126,10 +126,6 @@ StatusCode RoIFCalEmCellContMaker::execute(CaloCellContainer &pCaloCellContainer if (m_do_LArCells_noise_suppression!=0){ - //const CaloDetDescrManager* m_CaloDetDescrManager = CaloDetDescrManager::instance(); - //if ( m_CaloDetDescrManager == 0 ) { - // return StatusCode::FAILURE; - //} for(it = m_iBegin;it != m_iEnd; ++it) { //const CaloDetDescrElement* caloDDE = (*it)->caloDDE(); diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx index cd016d670e8..9f19e19744e 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx @@ -120,10 +120,6 @@ StatusCode RoIFCalHadCellContMaker::execute(CaloCellContainer &pCaloCellContaine if (m_do_LArCells_noise_suppression!=0){ - //const CaloDetDescrManager* m_CaloDetDescrManager = CaloDetDescrManager::instance(); - //if ( m_CaloDetDescrManager == 0 ) { - // return StatusCode::FAILURE; - //} for(it = m_iBegin;it != m_iEnd; ++it) { //const CaloDetDescrElement* caloDDE = (*it)->caloDDE(); -- GitLab From 978ba1bbdc11c7ae9607d3864af64a56394dc127 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 4 Feb 2020 19:43:00 +0000 Subject: [PATCH 2/3] copy rights --- .../CaloClusterCorrection/CaloFillRectangularCluster.h | 2 +- Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx | 2 +- .../CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx | 2 +- .../CaloClusterCorrection/src/CaloClusterLocalCalibCone.h | 2 +- Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx | 2 +- Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h | 2 +- .../CaloClusterCorrection/src/CaloFillRectangularCluster.cxx | 2 +- Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx | 2 +- Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx | 2 +- .../egamma/egammaTools/src/egammaLargeClusterMaker.cxx | 2 +- .../TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx | 2 +- .../TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx | 2 +- .../TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h b/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h index 24513dd9d65..699410b9b5d 100755 --- a/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h +++ b/Calorimeter/CaloClusterCorrection/CaloClusterCorrection/CaloFillRectangularCluster.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: CaloFillRectangularCluster.h,v 1.7 2009-04-25 17:57:00 ssnyder Exp $ diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx index 392acfeb7d3..2ef052da3b4 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CaloClusterCorrection/CaloClusterLocalCalib.h" diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx index a834f0a4523..2cd9ef86765 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------------------- diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.h index 756f671a158..fb0a4580cdd 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalibCone.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCLUSTERCORRECTION_CALOCLUSTERLOCALCALIBCONE_H diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx index 4c5c262ccd3..035deb219b6 100644 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CaloClusterLogPos.h" diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h index 840004e18c3..1180166b28f 100644 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLogPos.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: CaloClusterLogPos.h,v 1.3 2009-04-22 17:26:21 ssnyder Exp $ diff --git a/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx b/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx index 041b4a409bd..28a01ccf53f 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloFillRectangularCluster.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id: CaloFillRectangularCluster.cxx,v 1.20 2009-04-25 17:57:01 ssnyder Exp $ diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx index cd64eefa559..dee3d32a268 100644 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------------------- diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx index 11d26979839..7fe70f71064 100755 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker_DigiHSTruth.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------------------- // File and Version Information: diff --git a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx index 97299e14a0d..44b6fc43944 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "egammaLargeClusterMaker.h" diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx index b98fdc3cb57..2d63792add3 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx index 8660f9794ac..5bfc91407f1 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx index 9f19e19744e..f9af4f1a672 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** -- GitLab From 652187f32240b49522daec6ab353e9e746e69961 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 4 Feb 2020 19:48:33 +0000 Subject: [PATCH 3/3] ATLASRECTS-5012, remove usages of CaloDetDescrManager::instance --- .../CaloClusterCorrection/src/CaloClusterLocalCalib.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx index 2ef052da3b4..3f6d9703ff0 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterLocalCalib.cxx @@ -93,9 +93,8 @@ StatusCode CaloClusterLocalCalib::execute(const EventContext& ctx, double oldEnergy = theCluster->e(); - const CaloDetDescrManager* calo_dd_man = nullptr; - ATH_CHECK( detStore()->retrieve(calo_dd_man,"CaloMgr")); - const CaloCell_ID* calo_id = calo_dd_man->getCaloCell_ID(); + const CaloCell_ID* calo_id = nullptr; + ATH_CHECK(detStore()->retrieve(calo_id,"CaloCell_ID")); // Make new Cluster and CellColl CaloCellContainer* myCellColl = new CaloCellContainer(SG::OWN_ELEMENTS); -- GitLab