Commit 9297aba3 authored by Mark Hodgkinson's avatar Mark Hodgkinson
Browse files

Make accessors const static.

parent 0bcd6986
......@@ -72,16 +72,16 @@ void PFChargedFlowElementCreatorAlgorithm::createChargedFlowElements(const eflow
etaPhi = efRecTrack->getTrackCaloPoints().getEM2etaPhi();
/*add information to xAOD*/
const SG::AuxElement::Accessor<int> accLHED("LayerHED");
const static SG::AuxElement::Accessor<int> accLHED("LayerHED");
accLHED(*thisFE) = efRecTrack->getLayerHED();
const SG::AuxElement::Accessor<std::vector<int> > accCellOrderVector("LayerVectorCellOrdering");
const static SG::AuxElement::Accessor<std::vector<int> > accCellOrderVector("LayerVectorCellOrdering");
accCellOrderVector(*thisFE) = efRecTrack->getLayerCellOrderVector();
const SG::AuxElement::Accessor<std::vector<float> > accRadiusCellOrderVector("RadiusVectorCellOrdering");
const static SG::AuxElement::Accessor<std::vector<float> > accRadiusCellOrderVector("RadiusVectorCellOrdering");
accRadiusCellOrderVector(*thisFE) = efRecTrack->getRadiusCellOrderVector();
const SG::AuxElement::Accessor<std::vector<float> > accAvgEDensityCellOrderVector("AvgEdensityVectorCellOrdering");
const static SG::AuxElement::Accessor<std::vector<float> > accAvgEDensityCellOrderVector("AvgEdensityVectorCellOrdering");
accAvgEDensityCellOrderVector(*thisFE) = efRecTrack->getAvgEDensityCellOrderVector();
} else {
/* In normal mode we want the track eta,phi at the perigee */
......@@ -95,13 +95,13 @@ void PFChargedFlowElementCreatorAlgorithm::createChargedFlowElements(const eflow
ATH_MSG_DEBUG("Created charged PFO with E, pt, eta and phi of " << thisFE->e() << ", " << thisFE->pt() << ", " << thisFE->eta() << " and " << thisFE->phi());
/* Add the amount of energy the track was expected to deposit in the calorimeter - this is needed to calculate the charged weight in the jet finding */
const SG::AuxElement::Accessor<float> accTracksExpectedEnergyDeposit("TracksExpectedEnergyDeposit");
const static SG::AuxElement::Accessor<float> accTracksExpectedEnergyDeposit("TracksExpectedEnergyDeposit");
accTracksExpectedEnergyDeposit(*thisFE) = efRecTrack->getEExpect();
ATH_MSG_DEBUG("Have set that PFO's expected energy deposit to be " << efRecTrack->getEExpect());
/* Flag if this track was in a dense environment for later checking */
//There is an issue using bools - when written to disk they convert to chars. So lets store the bool as an int.
const SG::AuxElement::Accessor<int> accIsInDenseEnvironment("IsInDenseEnvironment");
const static SG::AuxElement::Accessor<int> accIsInDenseEnvironment("IsInDenseEnvironment");
accIsInDenseEnvironment(*thisFE) = efRecTrack->isInDenseEnvironment();
/* Optionally we add the links to clusters to the xAOD::PFO */
......
......@@ -26,7 +26,7 @@ StatusCode PFLCNeutralFlowElementCreatorAlgorithm::execute(const EventContext& c
for( unsigned int counter = 0; counter < (*neutralFEContainerReadHandle).size(); counter++){
const xAOD::FlowElement* thisFE = (*neutralFEContainerReadHandle)[counter];
const SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > accShowerSubtractedClusterLink("FEShowerSubtractedClusterLink");
const static SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > accShowerSubtractedClusterLink("FEShowerSubtractedClusterLink");
ElementLink<xAOD::CaloClusterContainer> clusElementLink = accShowerSubtractedClusterLink(*thisFE);
xAOD::FlowElement* theCopiedFE = (*neutralFELCContainerWriteHandle)[counter];
......
......@@ -75,7 +75,7 @@ StatusCode PFNeutralFlowElementCreatorAlgorithm::createNeutralFlowElement(const
theClusters.push_back(theIParticleTrackLink);
thisFE->setOtherObjectLinks(theClusters);
const SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > accShowerSubtractedClusterLink("FEShowerSubtractedClusterLink");
const static SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > accShowerSubtractedClusterLink("FEShowerSubtractedClusterLink");
accShowerSubtractedClusterLink(*thisFE) = thisEfRecCluster->getClusElementLink();
ATH_MSG_VERBOSE(" Sucessfully set cluster link");
......@@ -148,10 +148,10 @@ StatusCode PFNeutralFlowElementCreatorAlgorithm::createNeutralFlowElement(const
float layerEnergy_TileBar0 = cluster->eSample(xAOD::CaloCluster::CaloSample::TileBar0);
float layerEnergy_TileExt0 = cluster->eSample(xAOD::CaloCluster::CaloSample::TileExt0);
const SG::AuxElement::Accessor<float> accFloatTIle0E("PF_LAYERENERGY_TILE0");
const static SG::AuxElement::Accessor<float> accFloatTIle0E("PF_LAYERENERGY_TILE0");
accFloatTIle0E(*thisFE) = layerEnergy_TileBar0 + layerEnergy_TileExt0;
const SG::AuxElement::Accessor<float> accFloatTiming("PF_TIMING");
const static SG::AuxElement::Accessor<float> accFloatTiming("PF_TIMING");
accFloatTiming(*thisFE) = cluster->time();
}//cluster loop
......@@ -164,7 +164,7 @@ void PFNeutralFlowElementCreatorAlgorithm::addMoment(const xAOD::CaloCluster::Mo
bool isRetrieved = theCluster.retrieveMoment(momentType, moment);
if (true == isRetrieved) {
float float_moment = static_cast<float>(moment);
const SG::AuxElement::Accessor<float> accFloat(feAttribute);
const static SG::AuxElement::Accessor<float> accFloat(feAttribute);
accFloat(theFE) = float_moment;
}
else ATH_MSG_WARNING(" Could not retrieve moment from the CaloCluster");
......@@ -172,6 +172,6 @@ void PFNeutralFlowElementCreatorAlgorithm::addMoment(const xAOD::CaloCluster::Mo
}
void PFNeutralFlowElementCreatorAlgorithm::addSamplingEnergy(const xAOD::CaloCluster::CaloSample& sampling, const std::string& feAttribute, const xAOD::CaloCluster& theCluster, xAOD::FlowElement& theFE) const {
const SG::AuxElement::Accessor<float> accFloat(feAttribute);
const static SG::AuxElement::Accessor<float> accFloat(feAttribute);
accFloat(theFE) = theCluster.eSample(sampling);
}
Markdown is supported
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