|
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) {
105 for (; theFirstCell != theLastCell; ++theFirstCell){
112 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 251 of file eflowCellSubtractionFacilitator.cxx.
261 double oldCellWeight = theIterator.
weight();
262 double oldCellEnergy =
cell->energy() * oldCellWeight;
264 if (oldCellEnergy != 0. && eSubtracted + oldCellEnergy > eExpect) {
267 double targetCellEnergy = oldCellEnergy - (eExpect - eSubtracted);
269 double energyWeight = targetCellEnergy / oldCellEnergy;
270 double newCellWeight = oldCellWeight * energyWeight;
271 theIterator.
reweight(newCellWeight);
274 eSubtracted = eExpect;
284 eSubtracted += oldCellEnergy;
◆ subtractCells() [1/2]
Definition at line 328 of file eflowCellSubtractionFacilitator.cxx.
336 const double trackEnergy = theTrack.
getTrack()->
e();
337 const double eExpect = cellSubtractionManager.fudgeMean() * trackEnergy;
338 const double sigmaEExpect =
339 cellSubtractionManager.fudgeStdDev() * trackEnergy;
340 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: For track with trackEnergy "
341 << trackEnergy <<
" expect to subtract " << eExpect
342 <<
" with width of " << sigmaEExpect);
344 double eSubtracted = 0.0;
349 std::map<double, RingId>::const_iterator ringIt =
350 cellSubtractionManager.rankBegin();
351 std::map<double, RingId>::const_iterator ringEnd =
352 cellSubtractionManager.rankEnd();
353 for (; ringIt != ringEnd; ++ringIt) {
371 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 151 of file eflowCellSubtractionFacilitator.cxx.
159 for (
CellIt itRing = beginRing; itRing != endRing; ++itRing) {
161 for (
auto thisCell : itRing->second) {
163 std::pair<const CaloCell*, int> thisPair = thisCell;
166 tracksClusters[thisPair.second].second =
true;
167 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Cluster with e "
168 << cluster->
e() <<
" is removing cell with e "
169 << thisPair.first->e());
◆ 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 118 of file eflowCellSubtractionFacilitator.cxx.
126 for (
CellIt itRing = beginRing; itRing != endRing; ++itRing) {
128 for (
auto thisCell : itRing->second) {
130 std::pair<const CaloCell*, int> thisPair = thisCell;
133 tracksClusters[thisPair.second].second =
true;
137 double oldCellWeight = theIterator.
weight();
138 double ringWeight = targetRingEnergy / eRings;
139 const double newCellWeight = oldCellWeight * ringWeight;
140 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Cluster with e "
142 <<
" is changing weight of cell with energy " <<
cell->e()
143 <<
" from " << oldCellWeight <<
" to " << newCellWeight);
144 theIterator.
reweight(newCellWeight);
◆ subtractReorderedCells()
Definition at line 293 of file eflowCellSubtractionFacilitator.cxx.
301 CellIt itCellPosition = reorderedCells.begin();
302 CellIt endCellPosition = reorderedCells.end();
303 while (itCellPosition != endCellPosition) {
305 std::vector<std::pair<const CaloCell*, int>>
::iterator itEntry =
306 itCellPosition->second.begin();
307 std::vector<std::pair<const CaloCell*, int>>
::iterator endEntry =
308 itCellPosition->second.end();
309 for (; itEntry != endEntry; ++itEntry) {
310 const std::pair<const CaloCell*, int> thisPair = *itEntry;
313 tracksClusters[thisPair.second].second =
true;
322 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 178 of file eflowCellSubtractionFacilitator.cxx.
192 const short ringNo = ring.second;
194 const double r1 = ringNo * cellSubtractionManager.ringThickness(subtLayer);
196 (ringNo + 1) * cellSubtractionManager.ringThickness(subtLayer);
202 double eRings =
getRingsEnergy(tracksClusters, beginRing, endRing);
204 if (eSubtracted + eRings > eExpect) {
207 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Subtracting partial ring, "
208 "eSubtracted, eRings and eExpect are "
209 << eSubtracted <<
", " << eRings <<
", " << eExpect);
213 double targetRingEnergy = eRings - (eExpect - eSubtracted);
214 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: targetRingEnergy is "
215 << targetRingEnergy);
217 tracksClusters, beginRing, endRing, targetRingEnergy, eRings, theTrack,
addCPData);
218 eSubtracted = eExpect;
228 ATH_MSG_DEBUG(
"eflowCellSubtractionFacilitator: Subtracting full ring ");
232 eSubtracted += eRings;
236 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)