 |
ATLAS Offline Software
|
Go to the documentation of this file.
27 return StatusCode::SUCCESS;
36 std::vector<ElementLink<xAOD::PFOContainer>> empty;
41 return StatusCode::SUCCESS;
45 if (!caloCellInHandle.
isValid()) {
46 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << caloCellInHandle.
key());
47 return StatusCode::FAILURE;
57 std::vector<const CaloCell*> seedCells;
62 while (!seedCells.empty()) {
87 shot->
setP4(
static_cast<float>(
pt),
static_cast<float>(
cell->eta()),
static_cast<float>(
phi),
static_cast<float>(
cell->m()));
123 auto cellIndex =
std::find(seedCells.begin(), seedCells.end(),
cell);
124 seedCells.erase(cellIndex);
126 cellIndex =
std::find(seedCells.begin(), seedCells.end(), phiNeigCell);
127 seedCells.erase(cellIndex);
131 return StatusCode::SUCCESS;
162 const std::vector<float>& minPtCut =
m_minPtCut.value();
177 std::vector<const CaloCell*>&
cells)
const {
179 std::vector<const CaloCell*> removed_cells;
182 if (!removedClustersHandle.
isValid()){
183 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << removedClustersHandle.
key());
184 return StatusCode::FAILURE;
188 for (
auto cluster : *removed_clusters_cont){
189 for(
auto cell_it = cluster->cell_cbegin(); cell_it != cluster->cell_cend(); cell_it++){
190 removed_cells.push_back(*cell_it);
196 std::vector<CaloCell_ID::SUBCALO> emSubCaloBlocks;
198 std::unique_ptr<CaloCellList> cellList = std::make_unique<CaloCellList>(detMgr, &cellContainer, emSubCaloBlocks);
210 int sampling =
cell->caloDDE()->getSampling();
215 return StatusCode::SUCCESS;
223 std::vector<const CaloCell*>& seedCells)
const {
226 assert(seedCells.empty());
227 std::vector<const CaloCell*>
cells;
231 std::set<IdentifierHash> seedCellHashes;
237 std::vector<IdentifierHash> nextEtaHashes;
239 std::vector<IdentifierHash> prevEtaHashes;
242 std::vector<IdentifierHash> neighHashes = nextEtaHashes;
243 neighHashes.insert(neighHashes.end(),prevEtaHashes.begin(),prevEtaHashes.end());
250 if (seedCellHashes.find(neighHash) != seedCellHashes.end()) {
257 if (!neighCell)
continue;
266 seedCells.push_back(
cell);
270 return StatusCode::SUCCESS;
276 std::vector<IdentifierHash> neigHashes;
280 if (neigHashes.size() > 1) {
281 ATH_MSG_DEBUG(cell1Hash <<
" has " << neigHashes.size() <<
" neighbours in the next phi direction !");
283 if (
std::find(neigHashes.begin(), neigHashes.end(), cell2Hash) != neigHashes.end()) {
289 if (neigHashes.size() > 1) {
290 ATH_MSG_DEBUG(cell1Hash <<
" has " << neigHashes.size() <<
" neighbours in the previous phi direction !");
292 return std::find(neigHashes.begin(), neigHashes.end(), cell2Hash) != neigHashes.end();
298 const std::vector<const CaloCell*>& seedCells)
const {
303 std::vector<const CaloCell*> neighCells;
304 for (
const CaloCell* neighCell : seedCells) {
305 if (neighCell == &seedCell)
continue;
309 neighCells.push_back(neighCell);
312 std::sort(neighCells.begin(),neighCells.end(),
ptSort(*
this));
315 const CaloCell* phiNeigCell =
nullptr;
316 if (!neighCells.empty()) {
317 phiNeigCell = neighCells[0];
327 int maxDepth)
const {
328 std::vector<const CaloCell*>
cells;
342 std::vector<const CaloCell*>&
cells,
348 if (
depth > maxDepth)
return;
352 std::vector<IdentifierHash> neigHashes;
363 if (!newCell)
continue;
365 cells.push_back(newCell);
368 if (neigHashes.size() > 1) {
386 std::vector<const CaloCell*> windowNeighbours = this->
getEtaNeighbours(*cell, cellContainer, maxDepth);
388 std::vector<const CaloCell*> mergeCells = this->
getEtaNeighbours(*phiNeigCell, cellContainer, maxDepth);
389 windowNeighbours.push_back(phiNeigCell);
390 windowNeighbours.insert(windowNeighbours.end(), mergeCells.begin(), mergeCells.end());
410 double pt1 = cell1->
pt()*m_info.m_caloWeightTool->wtCell(cell1);
411 double pt2 = cell2->
pt()*m_info.m_caloWeightTool->wtCell(cell2);
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
def retrieve(aClass, aKey=None)
SG::ReadHandleKey< CaloCellContainer > m_caloCellInputContainer
virtual double pt() const
transverse momentum
void addShotPFOLink(const ElementLink< PFOContainer > &pfo)
add a shot PFO to the tau
Gaudi::Property< std::vector< float > > m_minPtCut
virtual StatusCode executeShotFinder(xAOD::TauJet &pTau, xAOD::CaloClusterContainer &tauShotCaloClusContainer, xAOD::PFOContainer &tauShotPFOContainer) const override
@ depth
pointing depth of the shower as calculated in egammaqgcld
std::vector< std::vector< const CaloCell * > > getCellBlock(const xAOD::PFO &shot, const CaloCell_ID *calo_id)
Get cell block with (currently) 2 x 5 cells in correct order for variable calculations.
virtual double phi() const override final
get phi (through CaloDetDescrElement)
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Scalar phi() const
phi method
void select(double eta, double phi, double deta, double dphi)
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
virtual double eta() const
The pseudorapidity ( ) of the particle.
Scalar eta() const
pseudorapidity method
xAOD::CaloCluster * createShotCluster(const CaloCell *cell, const CaloCell *phiNeighCell, const CaloCellContainer &cellContainer, xAOD::CaloClusterContainer *clusterContainer) const
Create the shot cluster Shot cluster contains 5x1 cells from the seed cell and hottestneighbour cell ...
virtual StatusCode initialize() override
Tool initializer.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const CaloCell * getPhiNeighbour(const CaloCell &seedCell, const std::vector< const CaloCell * > &seedCells) const
Get the hottest neighbour cell in the phi direction.
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
__HOSTDEV__ double Phi_mpi_pi(double)
void addEtaNeighbours(const CaloCell &cell, const CaloCellContainer &cellContainer, std::vector< const CaloCell * > &cells, int depth, int maxDepth, bool next) const
Get neighbour cells in the eta direction.
ptSort(const TauShotFinder &info)
ToolHandle< IHadronicCalibrationTool > m_caloWeightTool
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
bool setClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Set a cluster constituent - does NOT append to existing container
Gaudi::Property< int > m_nCellsInEta
virtual double phi() const
The azimuthal angle ( ) of the particle.
bool operator()(const CaloCell *c1, const CaloCell *c2)
Description of a calorimeter cluster.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
int getNPhotons(float eta, float energy) const
Get NPhotons in shot.
IdentifierHash calo_hash() const
cell calo hash
void reserve(const size_t s)
Method to reserve space the underlying vector<pair>
PFO_v1 PFO
Definition of the current "pfo version".
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Class describing a tau jet.
void setShotPFOLinks(const PFOLinks_t &shotPFOs)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void setBDTPi0Score(float BDTPi0Score)
set BDT Score used to classify clusters as Pi0 like or not
float ptWindow(const std::vector< std::vector< const CaloCell * >> &shotCells, int windowSize, const ToolHandle< IHadronicCalibrationTool > &caloWeightTool)
pt in a window of (currently) 2 x windowSize cells
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
ElementLink implementation for ROOT usage.
bool isPhiNeighbour(IdentifierHash cell1Hash, IdentifierHash cell2Hash) const
Check whether two cells are neighbours in the phi direction.
Class describing a particle flow object.
StatusCode selectCells(const xAOD::TauJet &tau, const CaloCellContainer &cellContainer, const CaloDetDescrManager *detMgr, std::vector< const CaloCell * > &cells) const
Apply preselection of the cells Cells within dR < 0.4, in EM1, and pt > 100 MeV are selected.
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
int getEtaBin(float eta) const
Get eta bin.
Container class for CaloCell.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Gaudi::Property< bool > m_removeElectronCells
std::vector< const CaloCell * > getEtaNeighbours(const CaloCell &cell, const CaloCellContainer &cellContainer, int maxDepth) const
Get neighbour cells in the eta direction.
void setP4(const FourMom_t &vec)
set the 4-vec
void setCharge(float charge)
set charge of PFO
const CaloCell_ID * m_calo_id
calo cell navigation
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
@ tauShots_nCellsInEta
These are the variables describing Tau Shot objects, which are built from EM1 cells.
TauShotFinder(const std::string &name)
StatusCode selectSeedCells(const xAOD::TauJet &tau, const CaloCellContainer &cellContainer, const CaloDetDescrManager *detMgr, std::vector< const CaloCell * > &seedCells) const
Select the seed cells used to construct the shot Cells must sastisfy:
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version)
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
bool absEta(const xAOD::TauJet &tau, float &out)
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
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.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
void setAttribute(PFODetails::PFOAttributes AttributeType, const T &anAttribute)
Set a PFO Variable via enum - overwrite is allowed.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_removedClusterInputContainer
Gaudi::Property< std::vector< float > > m_doubleShotCut
void setCenterMag(float CenterMag)
set CenterMag moment needed for vertex correction