Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:19:17

0001 /*
0002  * Copyright (c) 2014-2024 Key4hep-Project.
0003  *
0004  * This file is part of Key4hep.
0005  * See https://key4hep.github.io/key4hep-doc/ for further info.
0006  *
0007  * Licensed under the Apache License, Version 2.0 (the "License");
0008  * you may not use this file except in compliance with the License.
0009  * You may obtain a copy of the License at
0010  *
0011  *     http://www.apache.org/licenses/LICENSE-2.0
0012  *
0013  * Unless required by applicable law or agreed to in writing, software
0014  * distributed under the License is distributed on an "AS IS" BASIS,
0015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016  * See the License for the specific language governing permissions and
0017  * limitations under the License.
0018  */
0019 #ifndef RECINTERFACE_ITOWERTOOLTHETAMODULE_H
0020 #define RECINTERFACE_ITOWERTOOLTHETAMODULE_H
0021 
0022 // Gaudi
0023 #include "GaudiKernel/IAlgTool.h"
0024 
0025 // datamodel
0026 #include "edm4hep/CalorimeterHit.h"
0027 #include "edm4hep/CalorimeterHitCollection.h"
0028 #include "edm4hep/Cluster.h"
0029 
0030 /** @class ITowerToolThetaModule RecInterface/RecInterface/ITowerToolThetaModule.h ITowerToolThetaModule.h
0031  *
0032  *  Abstract interface to tower building tool.
0033  *
0034  *  @author Anna Zaborowska
0035  *  @Modified by Tong Li (t.li at cern.ch), for sliding-window clustering at FCCee where the CaloTower is created from
0036  * Theta-Phi
0037  */
0038 
0039 class ITowerToolThetaModule : virtual public IAlgTool {
0040 public:
0041   DeclareInterfaceID(ITowerToolThetaModule, 1, 0);
0042 
0043   /**  Find number of calorimeter towers.
0044    *   @param[out] nTheta number of towers in theta.
0045    *   @param[out] nPhi number of towers in phi.
0046    */
0047   virtual void towersNumber(int& nTheta, int& nPhi) = 0;
0048   /**  Build calorimeter towers.
0049    *   @param[out] aTowers Calorimeter towers.
0050    *   @param[in] fillTowersCells Whether to fill maps of cells into towers, for later use in attachCells
0051    *   @return Size of the cell collection.
0052    */
0053   virtual uint buildTowers(std::vector<std::vector<float>>& aTowers, bool fillTowersCells = true) = 0;
0054   /**  Get the map of cells contained within a tower.
0055    *   @return Map of cells in a tower
0056    */
0057   virtual std::map<std::pair<uint, uint>, std::vector<edm4hep::CalorimeterHit>> cellsInTowers() const = 0;
0058   /**  Get the tower IDs in theta.
0059    *   @param[in] aTheta Position of the calorimeter cell in theta
0060    *   @return ID (theta) of a tower
0061    */
0062   virtual uint idTheta(float aTheta) const = 0;
0063   /**  Get the tower IDs in phi.
0064    *   @param[in] aPhi Position of the calorimeter cell in phi
0065    *   @return ID (phi) of a tower
0066    */
0067   virtual uint idPhi(float aPhi) const = 0;
0068   /**  Get the theta position of the centre of the tower.
0069    *   @param[in] aIdTheta ID (theta) of a tower
0070    *   @return Position of the centre of the tower
0071    */
0072   virtual float theta(int aIdTheta) const = 0;
0073   /**  Get the phi position of the centre of the tower.
0074    *   @param[in] aIdPhi ID (phi) of a tower
0075    *   @return Position of the centre of the tower
0076    */
0077   virtual float phi(int aIdPhi) const = 0;
0078   /**  Find cells belonging to a cluster.
0079    *   @param[in] aTheta Position of the middle tower of a cluster in theta
0080    *   @param[in] aPhi Position of the middle tower of a cluster in phi
0081    *   @param[in] aHalfThetaFinal Half size of cluster in theta (in units of tower size). Cluster size is
0082    * 2*aHalfThetaFinal+1
0083    *   @param[in] aHalfPhiFinal Half size of cluster in phi (in units of tower size). Cluster size is 2*aHalfPhiFinal+1
0084    *   @param[out] aEdmCluster Cluster of interest
0085    *   @param[out] aEdmClusterCells Cluster cells which belong to the cluster of interest
0086    */
0087   virtual void attachCells(float aTheta, float aPhi, uint aHalfThetaFinal, uint aHalfPhiFinal,
0088                            edm4hep::MutableCluster& aEdmCluster, edm4hep::CalorimeterHitCollection* aEdmClusterCells,
0089                            bool aEllipse) = 0;
0090 };
0091 
0092 #endif /* RECINTERFACE_ITOWERTOOLTHETAMODULE_H */