Loading [MathJax]/extensions/tex2jax.js
|
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include <boost/scoped_ptr.hpp>
37 return StatusCode::SUCCESS;
46 std::vector<ElementLink<xAOD::PFOContainer>>
empty;
51 return StatusCode::SUCCESS;
55 if (!caloCellInHandle.
isValid()) {
56 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << caloCellInHandle.
key());
57 return StatusCode::FAILURE;
67 std::vector<const CaloCell*> seedCells;
72 while (!seedCells.empty()) {
133 auto cellIndex =
std::find(seedCells.begin(), seedCells.end(),
cell);
134 seedCells.erase(cellIndex);
136 cellIndex =
std::find(seedCells.begin(), seedCells.end(), phiNeigCell);
137 seedCells.erase(cellIndex);
141 return StatusCode::SUCCESS;
172 const std::vector<float>& minPtCut =
m_minPtCut.value();
187 std::vector<const CaloCell*>&
cells)
const {
189 std::vector<const CaloCell*> removed_cells;
192 if (!removedClustersHandle.
isValid()){
193 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << removedClustersHandle.
key());
194 return StatusCode::FAILURE;
198 for (
auto cluster : *removed_clusters_cont){
199 for(
auto cell_it = cluster->cell_cbegin(); cell_it != cluster->cell_cend(); cell_it++){
200 removed_cells.push_back(*cell_it);
206 std::vector<CaloCell_ID::SUBCALO> emSubCaloBlocks;
208 boost::scoped_ptr<CaloCellList> cellList(
new CaloCellList(detMgr, &cellContainer,emSubCaloBlocks));
210 cellList->select(tau.
eta(), tau.
phi(), 0.4);
220 int sampling =
cell->caloDDE()->getSampling();
225 return StatusCode::SUCCESS;
233 std::vector<const CaloCell*>& seedCells)
const {
236 assert(seedCells.empty());
237 std::vector<const CaloCell*>
cells;
241 std::set<IdentifierHash> seedCellHashes;
247 std::vector<IdentifierHash> nextEtaHashes;
249 std::vector<IdentifierHash> prevEtaHashes;
252 std::vector<IdentifierHash> neighHashes = nextEtaHashes;
253 neighHashes.insert(neighHashes.end(),prevEtaHashes.begin(),prevEtaHashes.end());
260 if (seedCellHashes.find(neighHash) != seedCellHashes.end()) {
267 if (!neighCell)
continue;
276 seedCells.push_back(
cell);
280 return StatusCode::SUCCESS;
286 std::vector<IdentifierHash> neigHashes;
290 if (neigHashes.size() > 1) {
291 ATH_MSG_DEBUG(cell1Hash <<
" has " << neigHashes.size() <<
" neighbours in the next phi direction !");
293 if (
std::find(neigHashes.begin(), neigHashes.end(), cell2Hash) != neigHashes.end()) {
299 if (neigHashes.size() > 1) {
300 ATH_MSG_DEBUG(cell1Hash <<
" has " << neigHashes.size() <<
" neighbours in the previous phi direction !");
302 return std::find(neigHashes.begin(), neigHashes.end(), cell2Hash) != neigHashes.end();
308 const std::vector<const CaloCell*>& seedCells)
const {
313 std::vector<const CaloCell*> neighCells;
314 for (
const CaloCell* neighCell : seedCells) {
315 if (neighCell == &seedCell)
continue;
319 neighCells.push_back(neighCell);
322 std::sort(neighCells.begin(),neighCells.end(),
ptSort(*
this));
325 const CaloCell* phiNeigCell =
nullptr;
326 if (!neighCells.empty()) {
327 phiNeigCell = neighCells[0];
337 int maxDepth)
const {
338 std::vector<const CaloCell*>
cells;
352 std::vector<const CaloCell*>&
cells,
358 if (
depth > maxDepth)
return;
362 std::vector<IdentifierHash> neigHashes;
373 if (!newCell)
continue;
375 cells.push_back(newCell);
378 if (neigHashes.size() > 1) {
396 std::vector<const CaloCell*> windowNeighbours = this->
getEtaNeighbours(*cell, cellContainer, maxDepth);
398 std::vector<const CaloCell*> mergeCells = this->
getEtaNeighbours(*phiNeigCell, cellContainer, maxDepth);
399 windowNeighbours.push_back(phiNeigCell);
400 windowNeighbours.insert(windowNeighbours.end(), mergeCells.begin(), mergeCells.end());
420 double pt1 = cell1->
pt()*m_info.m_caloWeightTool->wtCell(cell1);
421 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
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.
__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)
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
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, double &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