Commit 9950b9f1 authored by David Divalentino's avatar David Divalentino Committed by Graeme Stewart
Browse files

Tag to fix TSOS memory leak (egammaTools-01-01-86)

	* Removing BremFind code from brem collection builder
	* Removing unneccessary TSOS cloning

2016-08-25  Jovan Mitrevski <Jovan.Mitrevsk@cern.ch>
	* Tagging egammaTools-01-01-85
	* Fix filling photon supercluster nWindowClusters and nExtraClusters counts

	* Also includes the following previous untagged changes related to cell window options in:
	* python/egammaToolsFactories.py
	* src/electronSuperClusterBuilder.cxx
	* src/electronSuperClusterBuilder.h

2016-08-10  David Di Valentino <david.di.valentino@cern.ch>
	* Tagging egammaTools-01-01-84
	* Stable electron supercluster algorithm

2016-07-22  Jovan Mitrevski <Jovan.Mitrevsk@cern.ch>
	* Tagging egammaTools-01-01-82
	* Add options to do supercluster corrections (currently empty)

...
(Long ChangeLog diff - truncated)
parent 0f58095c
......@@ -64,7 +64,6 @@ EMBremCollectionBuilder = ToolFactory( egammaBremCollectionBuilder,
ExtrapolationTool = EMExtrapolationTools,
OutputTrackContainerName=egammaKeys.outputTrackKey(),
ClusterContainerName=egammaKeys.inputClusterKey(),
UseBremFinder=jobproperties.egammaRecFlags.doBremFinding(),
DoTruth=rec.doTruth()
)
......@@ -92,8 +91,10 @@ egammaTopoClusterCopier = ToolFactory( egammaToolsConf.egammaTopoClusterCopier,
electronSuperClusterBuilder = ToolFactory( egammaToolsConf.electronSuperClusterBuilder,
name = 'electronSuperClusterBuilder',
ExtrapolationTool=EMExtrapolationTools,
UseBremFinder=jobproperties.egammaRecFlags.doBremFinding(),
MVACalibTool= egammaMVATool
UseBremFinder=False,
MVACalibTool= egammaMVATool,
TopoWindowEtaCells = 5,
TopoWindowPhiCells = 7
)
......
......@@ -104,9 +104,6 @@ EMBremCollectionBuilder::EMBremCollectionBuilder(const std::string& type, const
declareProperty("narrowDeltaPhiRescaleBrem", m_narrowRescaleBrem =0.1,
"Value of the narrow cut for delta phi Rescale Brem");
//Switch to turn on-off saving of brem points found by GSF.
declareProperty("UseBremFinder", m_useBremFinder = false);
m_AllClusters=0;
m_AllTracks=0;
m_AllTRTTracks=0;
......@@ -118,7 +115,6 @@ EMBremCollectionBuilder::EMBremCollectionBuilder(const std::string& type, const
m_FailedSiliconRequirFit=0;
m_RefittedTracks=0;
declareInterface<IEMBremCollectionBuilder>(this);
}
// ===================================================================
......@@ -192,7 +188,7 @@ StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){
ATH_MSG_INFO ("Not refitted due to Silicon Requirements " << m_FailedSiliconRequirFit);
ATH_MSG_INFO ("Failed Fit Tracks " << m_FailedFitTracks);
ATH_MSG_INFO ("RefittedTracks " << m_RefittedTracks);
return StatusCode::SUCCESS;
}
......@@ -405,27 +401,35 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk
trk_refit = new Trk::Track(*tmpTrk);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//Try looking for hard brem points after using BremFinder tool.
std::vector<const Trk::TrackStateOnSurface*> bremTSOS;
if (m_useBremFinder) {
if (trk_refit) {
auto tsos = trk_refit->trackStateOnSurfaces()->begin();
for (;tsos != trk_refit->trackStateOnSurfaces()->end(); ++tsos) {
if ((*tsos)->type(Trk::TrackStateOnSurface::BremPoint) && (*tsos)->trackParameters()!=0) {
Trk::EstimatedBremOnTrack *estimatedBremOnTrack(0);
if ((*tsos)->materialEffectsOnTrack()) {
estimatedBremOnTrack = (Trk::EstimatedBremOnTrack*)((*tsos)->materialEffectsOnTrack());
}
if (estimatedBremOnTrack) {
bremTSOS.push_back((**tsos).clone());
}
}
//Save perigee eta, phi for later usage in supercluster algorithm.
std::vector<float> perigeeExtrapEta, perigeeExtrapPhi;
if (trk_refit) {
auto tsos = trk_refit->trackStateOnSurfaces()->begin();
for (;tsos != trk_refit->trackStateOnSurfaces()->end(); ++tsos) {
if ((*tsos)->type(Trk::TrackStateOnSurface::Perigee) && (*tsos)->trackParameters()!=0) {
float extrapEta(-999.), extrapPhi(-999.);
const Trk::TrackParameters *perigeeTrackParams(0);
perigeeTrackParams = (*tsos)->trackParameters();
const Trk::PerigeeSurface pSurface (perigeeTrackParams->position());
std::unique_ptr<const Trk::TrackParameters> pTrkPar(pSurface.createTrackParameters( perigeeTrackParams->position(), perigeeTrackParams->momentum().unit()*1.e9, +1, 0));
//Do the straight-line extrapolation.
bool hitEM2 = m_extrapolationTool->getEtaPhiAtCalo(pTrkPar.get(), &extrapEta, &extrapPhi);
if (hitEM2) {
perigeeExtrapEta.push_back(extrapEta);
perigeeExtrapPhi.push_back(extrapPhi);
} else {
ATH_MSG_INFO("Extrapolation to EM2 failed!");
perigeeExtrapEta.push_back(-999.);
perigeeExtrapPhi.push_back(-999.);
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//Slim the tracks
Trk::Track* slimmed = m_slimTool->slim(*trk_refit);
......@@ -452,11 +456,11 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk
aParticle->setTrackLink( trackLink );
aParticle->setVertexLink(tmpTrkPart->vertexLink());
//If requested, save list of brem points.
if (m_useBremFinder) {
static const SG::AuxElement::Accessor< std::vector<const Trk::TrackStateOnSurface*> > bremPoints("bremPoints");
bremPoints(*aParticle) = bremTSOS;
}
static const SG::AuxElement::Accessor< std::vector<float> > pgExtrapEta ("perigeeExtrapEta");
pgExtrapEta(*aParticle) = perigeeExtrapEta;
static const SG::AuxElement::Accessor<std::vector<float> > pgExtrapPhi ("perigeeExtrapPhi");
pgExtrapPhi(*aParticle) = perigeeExtrapPhi;
//Add qoverP for the last measurement
static const SG::AuxElement::Accessor<float > QoverPLM ("QoverPLM");
......
......@@ -46,6 +46,8 @@ egammaSwTool::egammaSwTool(const std::string& type,
declareProperty("ClusterCorrectionToolsEconv55",m_clusterCorrectionNamesEconv55);
declareProperty("ClusterCorrectionToolsEconv35",m_clusterCorrectionNamesEconv35);
declareProperty("ClusterCorrectionToolsEconv37",m_clusterCorrectionNamesEconv37);
declareProperty("ClusterCorrectionToolsSuperCluster",m_clusterCorrectionNamesSuperCluster);
}
// ===============================================================
......@@ -288,6 +290,30 @@ StatusCode egammaSwTool::initialize()
}
}
firstTool=m_clusterCorrectionNamesSuperCluster.begin();
lastTool =m_clusterCorrectionNamesSuperCluster.end();
for ( ; firstTool != lastTool; firstTool++ ) {
IAlgTool* algToolPtr;
ListItem clusAlgoTool(*firstTool);
StatusCode sCode = p_toolSvc->retrieveTool(clusAlgoTool.type(),
clusAlgoTool.name(),
algToolPtr,
this);
if ( sCode.isFailure() ) {
ATH_MSG_ERROR("Cannot find tool for " << *firstTool);
}
else {
ATH_MSG_DEBUG("Found tool for " << *firstTool);
// check for tool type
CaloClusterProcessor*
theTool = dynamic_cast<CaloClusterProcessor*>(algToolPtr);
if ( theTool != 0 ) {
m_clusterCorrectionPointersSuperCluster.push_back(theTool);
}
}
}
ATH_MSG_DEBUG("egammaSwTool initialisation completed successfully");
}
......@@ -350,6 +376,10 @@ StatusCode egammaSwTool::execute(xAOD::CaloCluster *cluster)
firstTool = m_clusterCorrectionPointersEconv37.begin();
lastTool = m_clusterCorrectionPointersEconv37.end();
break;
case xAOD::CaloCluster::SuperCluster:
firstTool = m_clusterCorrectionPointersSuperCluster.begin();
lastTool = m_clusterCorrectionPointersSuperCluster.end();
break;
default:
ATH_MSG_DEBUG("Inexisting cluster type and calibration requested: " << requestedSize);
return StatusCode::FAILURE;
......
......@@ -57,6 +57,7 @@ class egammaSwTool : public AthAlgTool, virtual public IegammaSwTool
std::vector<std::string> m_clusterCorrectionNamesEconv55;
std::vector<std::string> m_clusterCorrectionNamesEconv35;
std::vector<std::string> m_clusterCorrectionNamesEconv37;
std::vector<std::string> m_clusterCorrectionNamesSuperCluster;
/** @brief the actual list of tools corresponding to above names */
std::vector<CaloClusterProcessor*> m_clusterCorrectionPointersEle55;
......@@ -68,6 +69,7 @@ class egammaSwTool : public AthAlgTool, virtual public IegammaSwTool
std::vector<CaloClusterProcessor*> m_clusterCorrectionPointersEconv55;
std::vector<CaloClusterProcessor*> m_clusterCorrectionPointersEconv35;
std::vector<CaloClusterProcessor*> m_clusterCorrectionPointersEconv37;
std::vector<CaloClusterProcessor*> m_clusterCorrectionPointersSuperCluster;
};
#endif
......
......@@ -45,13 +45,24 @@ electronSuperClusterBuilder::electronSuperClusterBuilder(const std::string& type
m_nExtraClusters(0),
m_nBremPointClusters(0),
m_nSameTrackClusters(0),
m_nSimpleBremSearchtClusters(0),
m_extrapolationTool("EMExtrapolationTools"),
m_clusterCorrectionTool("egammaSwTool/egammaswtool")
{
declareProperty("WindowDelEtaCells", m_delEtaCells = 3);
declareProperty("WindowDelPhiCells", m_delPhiCells = 5);
////////////////////////////////////////////////////////////////////////////////
//NEW: Maximum window search parameters.
declareProperty("MaxWindowDelEtaCells", m_maxDelEtaCells = 5);
declareProperty("MaxWindowDelPhiCells", m_maxDelPhiCells = 12);
declareProperty("BremExtrapDelEtaCut", m_bremExtrapMatchDelEta = 0.05);
declareProperty("BremExtrapDelPhiCut", m_bremExtrapMatchDelPhi = 0.1);
declareProperty("BremSearchEOverPCut", m_secEOverPCut = 1.5);
////////////////////////////////////////////////////////////////////////////////
declareProperty("UseBremFinder", m_useBremFinder=false);
declareProperty("EtThresholdCut", m_EtThresholdCut = 1.0*GeV);
......@@ -62,10 +73,6 @@ electronSuperClusterBuilder::electronSuperClusterBuilder(const std::string& type
declareProperty("SecondaryEMFracCut", m_secondaryEmFracCut = 0.9);
declareProperty("TrackOverlapDelEta", m_trackOverlapDelEta = 0.075);
declareProperty("TrackOverlapDelPhi", m_trackOverlapDelPhi = 0.15);
declareProperty("SumRemainingCellsInWindow", m_sumRemainingCellsInWindow = false);
declareProperty("ExtrapolationTool", m_extrapolationTool, "Handle of the extrapolation tool");
......@@ -91,8 +98,17 @@ electronSuperClusterBuilder::electronSuperClusterBuilder(const std::string& type
declareProperty("MVACalibTool", m_MVACalibTool);
declareProperty("ClusterCorrectionTool", m_clusterCorrectionTool);
m_delPhi = m_delPhiCells *cellPhiSize * 0.5;
m_delEta = m_delEtaCells *cellEtaSize * 0.5;
declareProperty("TopoWindowEtaCells", m_windowEtaCells = 1E6);
declareProperty("TopoWindowPhiCells", m_windowPhiCells = 1E6);
m_delPhi = m_delPhiCells * cellPhiSize * 0.5;
m_delEta = m_delEtaCells * cellEtaSize * 0.5;
m_maxDelPhi = m_maxDelPhiCells * cellPhiSize * 0.5;
m_maxDelEta = m_maxDelEtaCells * cellEtaSize * 0.5;
m_windowEta = 0.5*float(m_windowEtaCells)*cellEtaSize;
m_windowPhi = 0.5*float(m_windowPhiCells)*cellPhiSize;
// Declare interface & properties.
declareInterface<IelectronSuperClusterBuilder>(this);
......@@ -118,6 +134,13 @@ StatusCode electronSuperClusterBuilder::initialize() {
m_delPhi = m_delPhiCells *cellPhiSize * 0.5;
m_delEta = m_delEtaCells *cellEtaSize * 0.5;
m_maxDelPhi = m_maxDelPhiCells * cellPhiSize * 0.5;
m_maxDelEta = m_maxDelEtaCells * cellEtaSize * 0.5;
m_windowEta = 0.5*float(m_windowEtaCells)*cellEtaSize;
m_windowPhi = 0.5*float(m_windowPhiCells)*cellPhiSize;
return StatusCode::SUCCESS;
}
......@@ -131,7 +154,7 @@ StatusCode electronSuperClusterBuilder::finalize() {
//////////////////////////////////////////////////////////////////////////////
StatusCode electronSuperClusterBuilder::execute(){
//-------------------------------------------------------------------------------------------------------
//Register cluster container.
xAOD::CaloClusterContainer *outputClusterContainer = CaloClusterStoreHelper::makeContainer(&*evtStore(),
......@@ -201,6 +224,7 @@ StatusCode electronSuperClusterBuilder::execute(){
m_nExtraClusters = 0;
m_nBremPointClusters=0;
m_nSameTrackClusters=0;
m_nSimpleBremSearchtClusters=0;
//
//=========================================================================================
ATH_MSG_DEBUG("=====================================================================");
......@@ -224,6 +248,15 @@ StatusCode electronSuperClusterBuilder::execute(){
CHECK(GetBremExtrapolations(egRec));
//===========
perigeeExtrapEta.clear();
perigeeExtrapPhi.clear();
static const SG::AuxElement::Accessor< std::vector<float> > pgExtrapEta ("perigeeExtrapEta");
perigeeExtrapEta = pgExtrapEta(*egRec->trackParticle());
static const SG::AuxElement::Accessor< std::vector<float> > pgExtrapPhi ("perigeeExtrapPhi");
perigeeExtrapPhi = pgExtrapPhi(*egRec->trackParticle());
//Find Secondary Clusters
ATH_MSG_DEBUG("Find secondary clusters");
const std::vector<std::size_t> secondaryIndices = SearchForSecondaryClusters(i, egammaRecs, isUsed);
......@@ -266,9 +299,12 @@ StatusCode electronSuperClusterBuilder::execute(){
ATH_MSG_DEBUG("Clusters in Window " << m_nWindowClusters);
static const SG::AuxElement::Accessor<int> nExtrapClusters ("nExtraClusters");
nExtrapClusters(*newClus) = m_nExtraClusters;
static const SG::AuxElement::Accessor<int> nSimpleBremSearchtClusters ("nSimpleBremSearchtClusters");
nSimpleBremSearchtClusters(*newClus) = m_nSimpleBremSearchtClusters;
ATH_MSG_DEBUG("extra clusters " << m_nExtraClusters);
ATH_MSG_DEBUG("Brem Point clusters " << m_nBremPointClusters);
ATH_MSG_DEBUG("Same Track clusters " << m_nSameTrackClusters);
//////////////////////////////////////////////////////////////////
//Push back the new cluster into the output container.
outputClusterContainer->push_back(newClus);
......@@ -289,6 +325,7 @@ StatusCode electronSuperClusterBuilder::execute(){
}
}
} //End loop on egammaRecs
return StatusCode::SUCCESS;
}
......@@ -323,6 +360,7 @@ const std::vector<std::size_t> electronSuperClusterBuilder::SearchForSecondaryCl
if (clus->e()*emFrac < m_secThresholdCut) {
continue;
}
//Now the actual checks
//Check if clusters are nearby enough to form the "topo-seeded window.'
bool matchesInWindow(MatchesInWindow(seedCluster,clus));
......@@ -330,22 +368,42 @@ const std::vector<std::size_t> electronSuperClusterBuilder::SearchForSecondaryCl
ATH_MSG_DEBUG("Cluster with Et : " << clus->et()<< " matched in window");
++ m_nWindowClusters;
}
//Lastly, check if we have any other egRec with the same track as best.
bool matchSameTrack (MatchSameTrack(seedEgammaRec,egRec));
if(matchSameTrack){
ATH_MSG_DEBUG("Cluster with Et : " << clus->et()<< " eta " << clus->eta()<<" phi " << clus->phi() << " matches same track");
++m_nSameTrackClusters;
++m_nExtraClusters;
}
//Now go through to see if any match the brem point extrapolations.
bool overlapsBremPoint(OverlapsABremPoint(clus) && emFrac > m_secondaryEmFracCut);
if(overlapsBremPoint) {
ATH_MSG_DEBUG("Cluster with Et : " << clus->et()<< " overlaps brem point");
++m_nBremPointClusters;
++m_nExtraClusters;
//Satellite brem cluster search for clusters
//outside the 3x5 window.
bool passesSimpleBremSearch(false);
bool matchSameTrack (false);
float seedSecdEta(fabs(seedCluster->eta() - clus->eta()));
float seedSecdPhi(fabs(P4Helpers::deltaPhi(seedCluster->phi(), clus->phi())));
if (!matchesInWindow && seedSecdEta<m_maxDelEta && seedSecdPhi<m_maxDelPhi) {
matchSameTrack = MatchSameTrack(seedEgammaRec,egRec);
if(matchSameTrack) {
++m_nSameTrackClusters;
++m_nExtraClusters;
} else {
if (egRec->trackParticle()) {
float qoverp = egRec->trackParticle()->qOverP();
float seedEOverP(egRec->caloCluster()->e() / fabs(1./qoverp));
if (perigeeExtrapEta.size())
passesSimpleBremSearch = PassesSimpleBremSearch(seedCluster,
clus,
perigeeExtrapEta[0],
perigeeExtrapPhi[0],
seedEOverP);
if (passesSimpleBremSearch) {
++m_nSimpleBremSearchtClusters;
++m_nExtraClusters;
}
}
}
}
//Add it to the list of secondary clusters if it matches.
if (matchesInWindow || overlapsBremPoint || matchSameTrack) {
if (matchesInWindow || passesSimpleBremSearch || matchSameTrack) {
secondaryClusters.push_back(i);
isUsed.at(i)=1;
}
......@@ -363,10 +421,12 @@ xAOD::CaloCluster *electronSuperClusterBuilder::AddTopoClusters(const std::vecto
ATH_MSG_DEBUG("Adding Topo Clusters Together");
xAOD::CaloCluster* myCluster = CaloClusterStoreHelper::makeCluster(clusters.at(0)->getCellLinks()->getCellContainer());
if (myCluster) {
myCluster->setClusterSize(xAOD::CaloCluster::SuperCluster);
//Use only the EM cells to calculate the energy.
AddEMCellsToCluster(myCluster, clusters.at(0));
CaloClusterKineHelper::calculateKine(myCluster, true, true);
}else {
ATH_MSG_ERROR("Null Cluster in AddTopoCluster");
return 0;
......@@ -576,14 +636,6 @@ bool electronSuperClusterBuilder::MatchSameTrack(const egammaRec *seed,
const egammaRec *sec) const{
bool matchesSameTrack(false);
if (seed && sec) {
float dEta(fabs(seed->caloCluster()->eta() - sec->caloCluster()->eta()));
float dPhi(fabs(P4Helpers::deltaPhi(seed->caloCluster()->phi(), sec->caloCluster()->phi())));
if (dEta > m_trackOverlapDelEta || dPhi > m_trackOverlapDelPhi){
return false;
}
const xAOD::TrackParticle *seedTrack = seed->trackParticle();
const xAOD::TrackParticle *secTrack = sec ->trackParticle();
if (seedTrack && secTrack) {
......@@ -605,7 +657,9 @@ bool electronSuperClusterBuilder::MatchSameTrack(const egammaRec *seed,
//Handles cases where we want to sum a cluster's cells,
//or add cells from another cluster.
void electronSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster* self,
const xAOD::CaloCluster* ref){
const xAOD::CaloCluster* ref)
{
if (!self || !ref) {
ATH_MSG_DEBUG("Can't find clusters!");
return;
......@@ -618,6 +672,13 @@ void electronSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster* s
if (!cell){
continue;
}
if (fabs(ref->eta()-cell->eta()) > m_windowEta)
continue;
if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_windowPhi)
continue;
//Add all LAR EM
if (cell->caloDDE()->getSubCalo() == CaloCell_ID::LAREM) {
self->addCell(cell_itr.index(), cell_itr.weight());
......@@ -683,3 +744,26 @@ StatusCode electronSuperClusterBuilder::fillPositionsInCalo(xAOD::CaloCluster* c
return StatusCode::SUCCESS;
}
bool electronSuperClusterBuilder::PassesSimpleBremSearch(const xAOD::CaloCluster *seed,
const xAOD::CaloCluster *sec,
float perigeeExtrapEta,
float perigeeExtrapPhi,
float seedEOverP)
{
if (seedEOverP > m_secEOverPCut)
return false;
float perigeeExtrapClusDelEta = fabs(seed->eta() - perigeeExtrapEta);
float perigeeExtrapClusDelPhi = fabs(P4Helpers::deltaPhi(seed->phi(), perigeeExtrapPhi));
float perigeeExtrapSecClusDelEta = fabs(sec->eta() - perigeeExtrapEta);
float perigeeExtrapSecClusDelPhi = fabs(P4Helpers::deltaPhi(sec->phi(), perigeeExtrapPhi));
if (perigeeExtrapClusDelEta > m_delEta && perigeeExtrapClusDelPhi > m_delPhi)
if (perigeeExtrapSecClusDelEta < m_bremExtrapMatchDelEta && perigeeExtrapSecClusDelPhi < m_bremExtrapMatchDelPhi)
return true;
return false;
}
......@@ -70,6 +70,14 @@ class electronSuperClusterBuilder : public AthAlgTool, virtual public Ielectron
StatusCode fillPositionsInCalo(xAOD::CaloCluster* cluster);
bool PassesSimpleBremSearch(const xAOD::CaloCluster *seed,
const xAOD::CaloCluster *sec,
float perigeeExtrapEta,
float perigeeExtrapPhi,
float seedEOverP);
std::vector<float> perigeeExtrapEta, perigeeExtrapPhi;
/////////////////////////////////////////////////////////////////////
//internal variables
std::vector<const CaloCell*> m_cellsin3x5;
......@@ -77,20 +85,38 @@ class electronSuperClusterBuilder : public AthAlgTool, virtual public Ielectron
std::vector<double> m_bpExtrapEta;
std::vector<double> m_bpExtrapPhi;
bool m_useBremFinder;
/** @brief Size of window in eta */
int m_delEtaCells;
/** @brief Size of window in phi */
int m_delPhiCells;
/** @brief Size of seed cluster window in eta cells */
int m_windowEtaCells;
float m_windowEta;
/** @brief Size of seed cluster window in phi cells */
int m_windowPhiCells;
float m_windowPhi;
/** @brief Size of maximum search window in eta */
int m_maxDelEtaCells;
float m_maxDelEta;
float m_bremExtrapMatchDelEta;
float m_secEOverPCut;
/** @brief Size of maximum search window in eta */
int m_maxDelPhiCells;
float m_maxDelPhi;
float m_bremExtrapMatchDelPhi;
//Keep track of # of 3x5 and brem point
//clusters added to seed clusters.
int m_nWindowClusters, m_nExtraClusters,m_nBremPointClusters,m_nSameTrackClusters;
int m_nWindowClusters, m_nExtraClusters,m_nBremPointClusters,m_nSameTrackClusters,m_nSimpleBremSearchtClusters;
float m_delEta; //!< half of window size, converted to units of eta
float m_delPhi; //!< half of window size, converted to units of phi
float m_EtThresholdCut;
float m_secThresholdCut;
float m_emFracCut;
float m_trackOverlapDelEta;
float m_trackOverlapDelPhi;
float m_secondaryEmFracCut;
float m_numberOfSiHits;
bool m_sumRemainingCellsInWindow;
......
......@@ -123,10 +123,6 @@ StatusCode photonSuperClusterBuilder::finalize() {
StatusCode photonSuperClusterBuilder::execute(){
// for stats
int nWindowClusters = 0;
int nExtraClusters = 0;
//Retrieve input egammaRec container.
const EgammaRecContainer *egammaRecs = 0;
StatusCode sc=evtStore()->retrieve(egammaRecs, m_inputEgammaRecContainerName );
......@@ -187,6 +183,10 @@ StatusCode photonSuperClusterBuilder::execute(){
//Core Logic goes here
ATH_MSG_DEBUG("Find secondary clusters");
// for stats
int nWindowClusters = 0;
int nExtraClusters = 0;
const std::vector<std::size_t> secondaryClusters =
SearchForSecondaryClusters(i, egammaRecs, isUsed, nWindowClusters, nExtraClusters);
......@@ -270,6 +270,18 @@ StatusCode photonSuperClusterBuilder::execute(){
ATH_MSG_DEBUG("extra clusters " << nExtraClusters);
//////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////
// // This is effectively an assert. Can comment out when not debugging
// const auto numClusters = constituentLinks.size();
// if (!((numClusters == 1 && nWindowClusters == 0 && nExtraClusters == 0) ||
// (numClusters > 1 && (nWindowClusters || nExtraClusters)))) {
// ATH_MSG_FATAL("The cluster links or the counts are wrong!");
// ATH_MSG_FATAL(" numClusters = " << numClusters
// << ", nWindowClusters = " << nWindowClusters
// << ", nExtraClusters = " << nExtraClusters);
// return StatusCode::FAILURE;
// }
//Add the remaining cells
if (m_sumRemainingCellsInWindow) {
ATH_CHECK(AddRemainingCellsToCluster(newCluster, seed_eta, seed_phi, cellsInWindow));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment