|
ATLAS Offline Software
|
#include <CaloClusterThinning.h>
|
StatusCode | setClustersMask (std::vector< bool > &mask, const xAOD::IParticle *particle, const xAOD::CaloClusterContainer *cps, bool is_muons, bool is_egamma, bool is_track) const |
|
StatusCode | particleCluster (std::vector< bool > &mask, const xAOD::IParticle *particle, const xAOD::CaloClusterContainer *cps, bool is_muons, bool is_egamma, bool is_tau) const |
|
Definition at line 27 of file CaloClusterThinning.h.
◆ CaloClusterThinning()
DerivationFramework::CaloClusterThinning::CaloClusterThinning |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~CaloClusterThinning()
DerivationFramework::CaloClusterThinning::~CaloClusterThinning |
( |
| ) |
|
|
virtualdefault |
◆ doThinning()
StatusCode DerivationFramework::CaloClusterThinning::doThinning |
( |
| ) |
const |
|
overridevirtual |
Definition at line 109 of file CaloClusterThinning.cxx.
111 const EventContext& ctx = Gaudi::Hive::currentContext();
113 bool is_muons =
false;
114 bool is_egamma =
false;
116 bool is_track =
false;
121 importedCaloCluster =
128 importedTopoCaloCluster =
132 unsigned int nClusters = 0;
134 nClusters = importedCaloCluster->
size();
136 unsigned int nTopoClusters = 0;
138 nTopoClusters = importedTopoCaloCluster->
size();
140 if (nClusters == 0 && nTopoClusters == 0) {
141 return StatusCode::SUCCESS;
145 std::vector<bool>
mask(nClusters,
false), topomask(nTopoClusters,
false);
153 importedParticlesHandle.ptr();
156 unsigned int nParticles(importedParticles->
size());
157 if (nParticles == 0) {
166 return StatusCode::SUCCESS;
197 if (!(is_egamma || is_muons || is_tau || is_track)) {
198 ATH_MSG_ERROR(
"This tool only works with Egamma, Muons, Taus and Tracks "
199 <<
m_sgKey.key() <<
" is not a compatible collection");
200 return StatusCode::FAILURE;
206 std::vector<int>
entries = m_parser->evaluateAsVector();
210 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string "
211 "used e-gamma objects??");
212 return StatusCode::FAILURE;
214 std::vector<const xAOD::IParticle*> particlesToCheck = {};
216 for (
unsigned int i = 0;
i < nParticles; ++
i) {
217 if (
static_cast<bool>(
entries[
i])) {
218 particlesToCheck.push_back((*importedParticles)[
i]);
222 for (
const auto*
particle : particlesToCheck) {
227 importedCaloCluster.
cptr(),
230 is_tau) != StatusCode::SUCCESS) {
231 return StatusCode::FAILURE;
235 importedCaloCluster.
cptr(),
238 is_track) != StatusCode::SUCCESS) {
239 return StatusCode::FAILURE;
245 importedTopoCaloCluster.
cptr(),
248 is_tau) != StatusCode::SUCCESS) {
249 return StatusCode::FAILURE;
253 importedTopoCaloCluster.
cptr(),
256 is_track) != StatusCode::SUCCESS) {
257 return StatusCode::FAILURE;
262 for (
const auto*
particle : *importedParticles) {
266 importedCaloCluster.
cptr(),
269 is_tau) != StatusCode::SUCCESS) {
270 return StatusCode::FAILURE;
274 importedCaloCluster.
cptr(),
277 is_track) != StatusCode::SUCCESS) {
278 return StatusCode::FAILURE;
284 importedTopoCaloCluster.
cptr(),
287 is_tau) != StatusCode::SUCCESS) {
288 return StatusCode::FAILURE;
292 importedTopoCaloCluster.
cptr(),
295 is_track) != StatusCode::SUCCESS) {
296 return StatusCode::FAILURE;
303 for (
unsigned int i = 0;
i < nClusters; ++
i) {
307 for (
unsigned int i = 0;
i < nTopoClusters; ++
i) {
321 return StatusCode::SUCCESS;
◆ finalize()
StatusCode DerivationFramework::CaloClusterThinning::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode DerivationFramework::CaloClusterThinning::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 52 of file CaloClusterThinning.cxx.
61 <<
"as the source collection for calo clusters");
67 <<
"as the source collection for topo calo clusters");
71 "No CalCaloTopoCluster or CaloCluster collection provided for thinning.");
72 return StatusCode::FAILURE;
76 ATH_MSG_FATAL(
"No particle collection provided for thinning.");
77 return StatusCode::FAILURE;
80 "Calo clusters associated with objects in "
82 <<
" will be retained in this format with the rest being thinned away");
92 return StatusCode::SUCCESS;
◆ particleCluster()
Definition at line 366 of file CaloClusterThinning.cxx.
376 return StatusCode::FAILURE;
383 return StatusCode::FAILURE;
386 if (
it != cps->
end()) {
388 mask[ItsCluster] =
true;
396 return StatusCode::FAILURE;
399 if (
it != cps->
end()) {
401 mask[ItsCluster] =
true;
409 return StatusCode::FAILURE;
413 for (
const auto * pJetConstituent :
vec) {
414 TLorentzVector cluster_P4;
415 cluster_P4.SetPtEtaPhiM(1, pJetConstituent->Eta(), pJetConstituent->Phi(), 1);
416 if (LC_P4.DeltaR(cluster_P4) > 0.2)
421 if (it_cps != cps->
end()) {
423 mask[ItsCluster] =
true;
428 return StatusCode::SUCCESS;
◆ setClustersMask()
Definition at line 325 of file CaloClusterThinning.cxx.
335 return StatusCode::FAILURE;
342 return StatusCode::FAILURE;
350 return StatusCode::FAILURE;
358 return StatusCode::FAILURE;
362 return StatusCode::SUCCESS;
◆ m_CaloClSGKey
◆ m_coneSize
float DerivationFramework::CaloClusterThinning::m_coneSize |
|
private |
◆ m_npass
std::atomic<unsigned int> DerivationFramework::CaloClusterThinning::m_npass |
|
private |
◆ m_npassTopo
std::atomic<unsigned int> DerivationFramework::CaloClusterThinning::m_npassTopo |
|
private |
◆ m_ntot
std::atomic<unsigned int> DerivationFramework::CaloClusterThinning::m_ntot |
|
mutableprivate |
◆ m_ntotTopo
std::atomic<unsigned int> DerivationFramework::CaloClusterThinning::m_ntotTopo |
|
private |
◆ m_run_calo
bool DerivationFramework::CaloClusterThinning::m_run_calo |
|
private |
◆ m_run_topo
bool DerivationFramework::CaloClusterThinning::m_run_topo |
|
private |
◆ m_selectionString
std::string DerivationFramework::CaloClusterThinning::m_selectionString |
|
private |
◆ m_sgKey
◆ m_streamName
StringProperty DerivationFramework::CaloClusterThinning::m_streamName |
|
private |
Initial value:{ this,
"StreamName",
"",
"Name of the stream being thinned" }
Definition at line 44 of file CaloClusterThinning.h.
◆ m_TopoClSGKey
The documentation for this class was generated from the following files:
StatusCode setClustersMask(std::vector< bool > &mask, const xAOD::IParticle *particle, const xAOD::CaloClusterContainer *cps, bool is_muons, bool is_egamma, bool is_track) const
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
StringProperty m_streamName
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_TopoClSGKey
StatusCode testElectrons(const char *APP_NAME, bool quiet)
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Handle for requesting thinning for a data object.
Description of a calorimeter cluster.
StatusCode particleCluster(std::vector< bool > &mask, const xAOD::IParticle *particle, const xAOD::CaloClusterContainer *cps, bool is_muons, bool is_egamma, bool is_tau) const
std::atomic< unsigned int > m_ntotTopo
std::atomic< unsigned int > m_npassTopo
Class describing a tau jet.
std::atomic< unsigned int > m_npass
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_CaloClSGKey
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
std::string m_selectionString
SG::ReadHandleKey< xAOD::IParticleContainer > m_sgKey
A vector of jet constituents at the scale used during jet finding.
StatusCode testPhotons(const char *APP_NAME, bool quiet)
Class describing a TrackParticle.
void select(const xAOD::IParticle *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
size_type size() const noexcept
Returns the number of elements in the collection.
std::atomic< unsigned int > m_ntot
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.