Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
This class deals with the removal of calorimeter cells from calorimeter clusters.
More...
#include <eflowCellSubtractionFacilitator.h>
|
| eflowCellSubtractionFacilitator () |
|
double | subtractCells (eflowRingSubtractionManager &ringSubtractionManager, eflowRecTrack &theTrack, xAOD::CaloCluster *tracksClus, eflowCellList &orderedCells, bool &annFlag, const bool &addCPData) const |
|
double | subtractCells (eflowRingSubtractionManager &ringSubtractionManager, eflowRecTrack &theTrack, std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClus, eflowCellList &orderedCells, bool &annFlag, const bool &addCPData) const |
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
void | subtractPartialRings (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing, double targetRingEnergy, double eRing, eflowRecTrack &theTrack, const bool &addCPData) const |
|
void | subtractFullRings (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing, eflowRecTrack &theTrack, const bool &addCPData) const |
|
bool | subtractRings (eflowRingSubtractionManager &ringSubtractionManager, const std::pair< eflowCaloENUM, short > &ring, double &eSubtracted, const double eExpect, eflowCellList &orderedCells, std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, bool &annFlag, eflowRecTrack &theTrack, const bool &addCPData) const |
|
void | initMessaging () const |
| Initialize our message level and MessageSvc. More...
|
|
|
static CaloClusterCellLink::iterator | getCellIterator (xAOD::CaloCluster *thisCluster, const CaloCell *thisCell) |
|
static void | updateClusterKinematics (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters) |
|
static void | updateClusterKinematics (xAOD::CaloCluster *) |
|
static double | getTotalEnergy (const std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters) |
|
static double | getRingsEnergy (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing) |
|
static bool | subtractCaloCell (double &eSubtracted, const double eExpect, xAOD::CaloCluster *cluster, const CaloCell *cell, eflowRecTrack &theTrack, const bool &addCPData) |
|
static void | annihilateClusters (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, bool &annFlag, eflowRecTrack &theTrack, const bool &addCPData) |
|
static bool | subtractReorderedCells (std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, double eSubtracted, const double eExpect, eflowCellList &orderedCells, eflowRecTrack &theTrack, const bool &addCPData) |
|
|
std::string | m_nm |
| Message source name. More...
|
|
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) More...
|
|
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. More...
|
|
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. More...
|
|
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) More...
|
|
This class deals with the removal of calorimeter cells from calorimeter clusters.
The main entry points are the subtractCells methods which find out how much energy they should subtract from the eflowRingSubtractionManager. The eflowRingSubtractionManager also contains a list of calorimeter cell rings (a ring is a list of calorimeter cells, in a given calorimeter layer, between two radii r1 and r2). The cell information is stored in the eflowCellList. Rings are removed one by one in the order they are stored until the summed cell ring energy is >= to the expected energy deposit from the track in the calorimeter.
Definition at line 36 of file eflowCellSubtractionFacilitator.h.
◆ eflowCellSubtractionFacilitator()
eflowCellSubtractionFacilitator::eflowCellSubtractionFacilitator |
( |
| ) |
|
◆ annihilateClusters()
void eflowCellSubtractionFacilitator::annihilateClusters |
( |
std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters, |
|
|
bool & |
annFlag, |
|
|
eflowRecTrack & |
theTrack, |
|
|
const bool & |
addCPData |
|
) |
| |
|
staticprivate |
Definition at line 96 of file eflowCellSubtractionFacilitator.cxx.
100 for (
auto& thisPair : tracksClusters) {
110 for (; theFirstCell != theLastCell;){
113 theLastCell = theCellLink->
end();
118 thisPair.second =
true;
◆ getCellIterator()
◆ getRingsEnergy()
double eflowCellSubtractionFacilitator::getRingsEnergy |
( |
std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters, |
|
|
CellIt |
beginRing, |
|
|
CellIt |
endRing |
|
) |
| |
|
staticprivate |
Definition at line 71 of file eflowCellSubtractionFacilitator.cxx.
81 for (
auto thisCell :
it->second) {
83 std::pair<const CaloCell*, int> thisPair = thisCell;
87 double cellWeight = theIterator.
weight();
88 eRing += thisPair.first->energy() * cellWeight;
◆ getTotalEnergy()
double eflowCellSubtractionFacilitator::getTotalEnergy |
( |
const std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters | ) |
|
|
staticprivate |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ subtractCaloCell()
Definition at line 257 of file eflowCellSubtractionFacilitator.cxx.
267 double oldCellWeight = theIterator.
weight();
268 double oldCellEnergy =
cell->energy() * oldCellWeight;
270 if (oldCellEnergy != 0. && eSubtracted + oldCellEnergy > eExpect) {
273 double targetCellEnergy = oldCellEnergy - (eExpect - eSubtracted);
275 double energyWeight = targetCellEnergy / oldCellEnergy;
276 double newCellWeight = oldCellWeight * energyWeight;
277 theIterator.
reweight(newCellWeight);
280 eSubtracted = eExpect;
290 eSubtracted += oldCellEnergy;
◆ subtractCells() [1/2]
Definition at line 334 of file eflowCellSubtractionFacilitator.cxx.
342 const double trackEnergy = theTrack.
getTrack()->
e();
343 const double eExpect = cellSubtractionManager.fudgeMean() * trackEnergy;
344 const double sigmaEExpect =
345 cellSubtractionManager.fudgeStdDev() * trackEnergy;
346 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: For track with trackEnergy "
347 << trackEnergy <<
" expect to subtract " << eExpect
348 <<
" with width of " << sigmaEExpect);
350 double eSubtracted = 0.0;
355 std::map<double, RingId>::const_iterator ringIt =
356 cellSubtractionManager.rankBegin();
357 std::map<double, RingId>::const_iterator ringEnd =
358 cellSubtractionManager.rankEnd();
359 for (; ringIt != ringEnd; ++ringIt) {
377 if (orderedCells.
mapSize() <= 0 || eSubtracted >= eExpect) {
◆ subtractCells() [2/2]
Definition at line 24 of file eflowCellSubtractionFacilitator.cxx.
31 std::vector<std::pair<xAOD::CaloCluster*, bool>> localClusterBoolPairVec(
32 1, std::pair(tracksCluster,
false));
34 cellSubtractionManager, theTrack, localClusterBoolPairVec, orderedCells, annFlag,
addCPData);
◆ subtractFullRings()
Definition at line 157 of file eflowCellSubtractionFacilitator.cxx.
165 for (
CellIt itRing = beginRing; itRing != endRing; ++itRing) {
167 for (
auto thisCell : itRing->second) {
169 std::pair<const CaloCell*, int> thisPair = thisCell;
172 tracksClusters[thisPair.second].second =
true;
173 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Cluster with e "
174 <<
cluster->e() <<
" is removing cell with e "
175 << thisPair.first->e());
178 cluster->removeCell(thisPair.first);
◆ subtractPartialRings()
void eflowCellSubtractionFacilitator::subtractPartialRings |
( |
std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters, |
|
|
CellIt |
beginRing, |
|
|
CellIt |
endRing, |
|
|
double |
targetRingEnergy, |
|
|
double |
eRing, |
|
|
eflowRecTrack & |
theTrack, |
|
|
const bool & |
addCPData |
|
) |
| const |
|
private |
Definition at line 124 of file eflowCellSubtractionFacilitator.cxx.
132 for (
CellIt itRing = beginRing; itRing != endRing; ++itRing) {
134 for (
auto thisCell : itRing->second) {
136 std::pair<const CaloCell*, int> thisPair = thisCell;
139 tracksClusters[thisPair.second].second =
true;
143 double oldCellWeight = theIterator.
weight();
144 double ringWeight = targetRingEnergy / eRings;
145 const double newCellWeight = oldCellWeight * ringWeight;
146 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Cluster with e "
148 <<
" is changing weight of cell with energy " <<
cell->e()
149 <<
" from " << oldCellWeight <<
" to " << newCellWeight);
150 theIterator.
reweight(newCellWeight);
◆ subtractReorderedCells()
Definition at line 299 of file eflowCellSubtractionFacilitator.cxx.
307 CellIt itCellPosition = reorderedCells.begin();
308 CellIt endCellPosition = reorderedCells.end();
309 while (itCellPosition != endCellPosition) {
311 std::vector<std::pair<const CaloCell*, int>>
::iterator itEntry =
312 itCellPosition->second.begin();
313 std::vector<std::pair<const CaloCell*, int>>
::iterator endEntry =
314 itCellPosition->second.end();
315 for (; itEntry != endEntry; ++itEntry) {
316 const std::pair<const CaloCell*, int> thisPair = *itEntry;
319 tracksClusters[thisPair.second].second =
true;
328 reorderedCells.deleteFromList(
tmp);
◆ subtractRings()
bool eflowCellSubtractionFacilitator::subtractRings |
( |
eflowRingSubtractionManager & |
ringSubtractionManager, |
|
|
const std::pair< eflowCaloENUM, short > & |
ring, |
|
|
double & |
eSubtracted, |
|
|
const double |
eExpect, |
|
|
eflowCellList & |
orderedCells, |
|
|
std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters, |
|
|
bool & |
annFlag, |
|
|
eflowRecTrack & |
theTrack, |
|
|
const bool & |
addCPData |
|
) |
| const |
|
private |
Definition at line 184 of file eflowCellSubtractionFacilitator.cxx.
198 const short ringNo = ring.second;
200 const double r1 = ringNo * cellSubtractionManager.ringThickness(subtLayer);
202 (ringNo + 1) * cellSubtractionManager.ringThickness(subtLayer);
208 double eRings =
getRingsEnergy(tracksClusters, beginRing, endRing);
210 if (eSubtracted + eRings > eExpect) {
213 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Subtracting partial ring, "
214 "eSubtracted, eRings and eExpect are "
215 << eSubtracted <<
", " << eRings <<
", " << eExpect);
219 double targetRingEnergy = eRings - (eExpect - eSubtracted);
220 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: targetRingEnergy is "
221 << targetRingEnergy);
223 tracksClusters, beginRing, endRing, targetRingEnergy, eRings, theTrack,
addCPData);
224 eSubtracted = eExpect;
234 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Subtracting full ring ");
238 eSubtracted += eRings;
242 if (fabs(eClustersOld - eSubtracted) < 1.0
e-6 * eClustersOld) {
◆ updateClusterKinematics() [1/2]
void eflowCellSubtractionFacilitator::updateClusterKinematics |
( |
std::vector< std::pair< xAOD::CaloCluster *, bool >> & |
tracksClusters | ) |
|
|
staticprivate |
◆ updateClusterKinematics() [2/2]
void eflowCellSubtractionFacilitator::updateClusterKinematics |
( |
xAOD::CaloCluster * |
theCluster | ) |
|
|
staticprivate |
Definition at line 46 of file eflowCellSubtractionFacilitator.cxx.
49 float oldEnergy = theCluster->
e();
51 if (0.0 != oldEnergy) {
52 float energyAdjustment = theCluster->
e() / oldEnergy;
53 theCluster->
setRawE(theCluster->
rawE() * energyAdjustment);
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::atomic< MSG::Level > m_lvl
Current logging level.
virtual double phi() const
The azimuthal angle ( ) of the particle.
static double getTotalEnergy(const std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters)
void reorderWithoutLayers()
bool subtractRings(eflowRingSubtractionManager &ringSubtractionManager, const std::pair< eflowCaloENUM, short > &ring, double &eSubtracted, const double eExpect, eflowCellList &orderedCells, std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, bool &annFlag, eflowRecTrack &theTrack, const bool &addCPData) const
static bool subtractReorderedCells(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, double eSubtracted, const double eExpect, eflowCellList &orderedCells, eflowRecTrack &theTrack, const bool &addCPData)
void deleteFromList(CellIt &start, CellIt &end)
static bool subtractCaloCell(double &eSubtracted, const double eExpect, xAOD::CaloCluster *cluster, const CaloCell *cell, eflowRecTrack &theTrack, const bool &addCPData)
void subtractPartialRings(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing, double targetRingEnergy, double eRing, eflowRecTrack &theTrack, const bool &addCPData) const
weight_t weight() const
Accessor for weight associated to this cell.
const_iterator begin() const
const begin method
unsigned index() const
Accessor for the index of the cell in the CaloCellContainer.
AsgMessaging(const std::string &name)
Constructor with a name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
void addSubtractedCaloCell(ElementLink< CaloCellContainer > theCellLink, const double &weight)
static void annihilateClusters(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, bool &annFlag, eflowRecTrack &theTrack, const bool &addCPData)
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Description of a calorimeter cluster.
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
bool removeCell(const CaloCell *ptr)
Method to remove a cell to the cluster (slow!) (Beware: Kinematics not updated!)
virtual double eta() const
The pseudorapidity ( ) of the particle.
static double getRingsEnergy(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing)
void setRawEta(flt_t)
Set for signal state UNCALIBRATED.
double subtractCells(eflowRingSubtractionManager &ringSubtractionManager, eflowRecTrack &theTrack, xAOD::CaloCluster *tracksClus, eflowCellList &orderedCells, bool &annFlag, const bool &addCPData) const
const xAOD::TrackParticle * getTrack() const
static void updateClusterKinematics(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters)
virtual double e() const override final
The total energy of the particle.
void setCalE(flt_t)
Set Energy for signal state CALIBRATED.
void subtractFullRings(std::vector< std::pair< xAOD::CaloCluster *, bool >> &tracksClusters, CellIt beginRing, CellIt endRing, eflowRecTrack &theTrack, const bool &addCPData) const
std::map< eflowCellPosition, std::vector< std::pair< const CaloCell *, int > > >::iterator CellIt
const_iterator end() const
const end method
Data object for each calorimeter readout cell.
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version)
std::string m_nm
Message source name.
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
CellIt getLowerBound(eflowCaloENUM layer, double r)
void reweight(const weight_t newWeight)
Update the weight.
virtual double e() const
The total energy of the particle.
void setRawPhi(flt_t)
Set for signal state UNCALIBRATED.
static CaloClusterCellLink::iterator getCellIterator(xAOD::CaloCluster *thisCluster, const CaloCell *thisCell)