ATLAS Offline Software
Loading...
Searching...
No Matches
CaloFillRectangularCluster Class Reference

#include <CaloFillRectangularCluster.h>

Inheritance diagram for CaloFillRectangularCluster:
Collaboration diagram for CaloFillRectangularCluster:

Public Types

typedef std::array< std::pair< double, double >, 4 > WindowArray_t
 Holds the per-layer window sizes.
typedef ToolWithConstants base_class
 Shorthand for derived classes.
using Context
 Convenient alias for the Context type.
using Constant
 Alias for the Constant type.

Public Member Functions

 CaloFillRectangularCluster (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi constructor.
virtual StatusCode initialize () override
 Standard Gaudi initialize method.
virtual void makeCorrection (const Context &myctx, xAOD::CaloCluster *cluster) const override
 CaloClusterCorrection virtual method.
void makeCorrection (const EventContext &ctx, xAOD::CaloCluster *cluster) const
virtual void get_seed (CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
virtual StatusCode setCaloCellContainerName (const std::string &name) override
 Change the name of the CaloCellContainer used by this tool.
virtual WindowArray_t initWindows (const int neta, const int nphi, const double detas2, const double dphis2) const
 Set up layer-by-layer cluster window sizes.
virtual void setsample (xAOD::CaloCluster *cluster, CaloSampling::CaloSample sampling, float em, float etam, float phim, float emax, float etamax, float phimax, float etas, float phis) const
virtual void setenergy (xAOD::CaloCluster *cluster, float energy) const
StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const override
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
 Execute on an entire collection of clusters.
Context context (const EventContext &ctx) const
 Create a Context object.
virtual void writeConstants (std::ostream &stream, const std::string &name, const EventContext &ctx) const
 Dump method (for debugging)
virtual StatusCode mergeConstants (CaloRec::ToolConstants &out, const EventContext &ctx) const override
 Merge our constants into out with the proper prefix.
virtual int toolVersion () const
 Return the version number for this tool.
virtual const std::string & toolType () const
 Return the name of the type of this tool.

Protected Attributes

double m_deta0 = 0.0
 Cell window sizes in each sampling.
double m_deta1 = 0.0
double m_deta2 = 0.0
double m_deta3 = 0.0
double m_dphi0 = 0.0
double m_dphi1 = 0.0
double m_dphi2 = 0.0
double m_dphi3 = 0.0
Gaudi::Property< int > m_neta {this, "eta_size", 5}
 \(\eta\times\phi\) cluster size. These are properties.
Gaudi::Property< int > m_nphi {this, "phi_size", 5}
Gaudi::Property< bool > m_fill_cluster {this, "fill_cluster", true}
 Fill-cluster flag.
Gaudi::Property< bool > m_setRawState {this, "set_raw_state", true}
 Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}

Private Member Functions

 CaloFillRectangularCluster ()=delete
 This isn't allowed.
void makeCorrection1 (const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
void makeCorrection2 (const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper) const

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_cellsName {this, "cells_name", "AllCalo"}
 The StoreGate key for the container of our input cells.
SG::ReadCondHandleKey< CaloRec::ToolConstantsm_DBHandle
 Handle to a ToolConstants conditions object.
StringProperty m_prefix
 Prefix for finding our constants within the ToolConstants object.
ToolWithConstantsImpl m_impl
 Internal implementation object.
Constant< int > m_order
 Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag.
Constant< bool > m_isdummy
 If true, then this is a dummy tool that should not be executed.

Detailed Description

Definition at line 59 of file CaloFillRectangularCluster.h.

Member Typedef Documentation

◆ base_class

typedef ToolWithConstants CaloUtils::ToolWithConstants< BASE >::base_class
inherited

Shorthand for derived classes.

Definition at line 450 of file ToolWithConstants.h.

◆ Constant

using CaloUtils::ToolWithConstants< BASE >::Constant
inherited

Alias for the Constant type.

Definition at line 463 of file ToolWithConstants.h.

◆ Context

using CaloUtils::ToolWithConstants< BASE >::Context
inherited

Convenient alias for the Context type.

Definition at line 458 of file ToolWithConstants.h.

◆ WindowArray_t

typedef std::array<std::pair<double, double>, 4> CaloFillRectangularCluster::WindowArray_t

Holds the per-layer window sizes.

Definition at line 121 of file CaloFillRectangularCluster.h.

Constructor & Destructor Documentation

◆ CaloFillRectangularCluster() [1/2]

CaloFillRectangularCluster::CaloFillRectangularCluster ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Gaudi constructor.

Parameters
typeThe type of the tool.
nameThe name of the tool.
parentThe parent algorithm of the tool.

Definition at line 781 of file CaloFillRectangularCluster.cxx.

785 : CaloClusterCorrection(type, name, parent)
786{
787}

◆ CaloFillRectangularCluster() [2/2]

CaloFillRectangularCluster::CaloFillRectangularCluster ( )
privatedelete

This isn't allowed.

Member Function Documentation

◆ context()

Context CaloUtils::ToolWithConstants< BASE >::context ( const EventContext & ctx) const
inherited

Create a Context object.

This can then be passed to Constant::operator().

◆ execute() [1/2]

StatusCode CaloClusterCorrection::execute ( const EventContext & ctx,
xAOD::CaloCluster * cluster ) const
overrideinherited

Definition at line 53 of file CaloClusterCorrection.cxx.

55{
56 this->makeCorrection (context(ctx), cluster);
57
58#if 0
59 ATH_MSG_DEBUG( " ...... e, et " << cluster->e() << " " << cluster->et() << endmsg);
60 ATH_MSG_DEBUG( " ...... eta, etaBE, etaSmp " << cluster->eta() << " " << cluster->etaBE(2)
61 << " " << cluster->etaSample(CaloSampling::EMB1)
62 << " " << cluster->etaSample(CaloSampling::EMB2)
63 << " " << cluster->etaSample(CaloSampling::EMB3) << endmsg);
64 ATH_MSG_DEBUG( " ...... phi, phiBE, phiSmp " << cluster->phi() << " " << cluster->phiBE(2)
65 << " " << cluster->phiSample(CaloSampling::EMB1)
66 << " " << cluster->phiSample(CaloSampling::EMB2)
67 << " " << cluster->phiSample(CaloSampling::EMB3) << endmsg);
68#endif
69
70 return StatusCode::SUCCESS;
71}
#define endmsg
#define ATH_MSG_DEBUG(x)
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *) const =0
Context context(const EventContext &ctx) const
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.

◆ execute() [2/2]

StatusCode CaloClusterProcessor::execute ( const EventContext & ctx,
xAOD::CaloClusterContainer * collection ) const
inherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters.

This will iterate over all the clusters in collection and call execute on each one individually.

Parameters
collectionThe container of clusters.
ctxThe event context.

This will iterate over all the clusters in collection and call execute on each one individually.

Definition at line 65 of file CaloClusterProcessor.cxx.

47{
48 for (xAOD::CaloCluster* clu : *collection) {
49 ATH_CHECK( execute (ctx, clu) );
50 }
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ get_seed()

void CaloFillRectangularCluster::get_seed ( CaloClusterCorr::SamplingHelper & helper,
const xAOD::CaloCluster * cluster,
double & eta,
double & phi ) const
virtual

!!! NEW way of the endcap-shift treatment (same for barrel and endcap)

Reimplemented in CaloTopoEMlayers.

Definition at line 1147 of file CaloFillRectangularCluster.cxx.

1151{
1152 const CaloCell* max_et_cell = helper.max_et_cell();
1153
1155 // a.b.c 2004 : for barrel, correct for the alignment before
1156 // comparing the Tower direction and the cell's
1157 // ( for Atlas the difference is null, but it's not true for TB )
1158 const CaloDetDescrElement* elt = max_et_cell->caloDDE();
1159 double phi_shift = elt->phi()-elt->phi_raw();
1160 double eta_shift = elt->eta()-elt->eta_raw();
1161 eta = cluster->eta0()+eta_shift;
1162 phi = CaloPhiRange::fix(cluster->phi0()+phi_shift);
1163
1164 // Special case to handle a pathology seen at the edge of the calorimeter
1165 // with clusters with an eta size of 3. The cluster size used for the SW
1166 // clustering is 5x5. The SW clustering will find the window that contains
1167 // the maximum amount of energy. So, suppose that there's a cluster
1168 // near the edge of the calorimeter such that the most energetic cell
1169 // is right at the edge of the calorimeter. In this case, the SW clustering
1170 // is likely to position the seed cell two cells from the edge
1171 // (the next-to-next-to-last cell), as in that case, all 5 eta cells
1172 // are contained within the calorimeter. But in that case, if we then
1173 // build a cluster of size 3 around this seed, then we'll be missing
1174 // the cell with the highest energy! This will severely bias the
1175 // energy and eta measurements.
1176 //
1177 // So, what I'll do is this. If the maximum cell is at the outer
1178 // edge of the (outer) EC and it is not within our eta window, then I'll
1179 // use the maximum cell position as the seed instead of what
1180 // the SW clustering gives. I restrict this to the outer edge
1181 // of the EC to avoid any chance of changing the clustering results
1182 // in the bulk of the calorimeter.
1183 // Also do this if the maximum cell is on the edge of the inner endcap ---
1184 // we can get the same effect.
1185 if ((elt->is_lar_em_endcap_inner() &&
1186 std::abs(elt->eta_raw()) - elt->deta() <
1187 elt->descriptor()->calo_eta_min()) ||
1188 (elt->is_lar_em_endcap_outer() &&
1189 std::abs(elt->eta_raw()) + elt->deta() >
1190 elt->descriptor()->calo_eta_max()))
1191 {
1192 // Max cell is at the edge. Is it outside the window?
1193 if (std::abs (eta - elt->eta()) > helper.deta(2)/2) {
1194 // Yes --- change the seed.
1195 eta = elt->eta();
1196 }
1197 }
1198
1199 // stay in the calo frame and do not cook for cluster on edge
1200 // (inputs are now 3x5 so there should not be problems anymore)
1201 eta = cluster->eta0();
1202 phi = CaloPhiRange::fix(cluster->phi0());
1203
1204}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
bool is_lar_em_endcap_outer() const
cell belongs to the outer wheel of EM end cap
bool is_lar_em_endcap_inner() const
cell belongs to the inner wheel of EM end cap
const CaloDetDescriptor * descriptor() const
cell descriptor
double calo_eta_min() const
'ideal' geometry: eta minimal
double calo_eta_max() const
'ideal' geometry: eta maximal
static double fix(double phi)
flt_t eta0() const
Returns raw of cluster seed.
flt_t phi0() const
Returns raw of cluster seed.

◆ initialize()

StatusCode CaloFillRectangularCluster::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Derived classes can extend this to change the sampling window sizes.

Reimplemented from CaloClusterCorrection.

Reimplemented in CaloTopoEMlayers.

Definition at line 795 of file CaloFillRectangularCluster.cxx.

796{
797 // The method from the base class.
799 if (!m_cellsName.key().empty()){
800 CHECK( m_cellsName.initialize() );
801 }
802
803 ATH_CHECK(m_caloMgrKey.initialize());
804 return StatusCode::SUCCESS;
805}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
Initialize method.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.

◆ initWindows()

CaloFillRectangularCluster::WindowArray_t CaloFillRectangularCluster::initWindows ( const int neta,
const int nphi,
const double detas2,
const double dphis2 ) const
virtual

Set up layer-by-layer cluster window sizes.

Parameters
netaCluster eta size.
nphiCluster phi size.
detas2Middle layer cell eta size.
detas2Middle layer cell phi size.

Returns per-layer array of deta,dphi pairs.

Reimplemented in CaloTopoEMlayers.

Definition at line 1229 of file CaloFillRectangularCluster.cxx.

1233{
1235
1236 // set up the sampling windows:
1237 w[0].first = detas2*neta;
1238 w[0].second = dphis2*4;
1239
1240 if (nphi >= 7)
1241 w[0].second *= 2;
1242 else
1243 w[0].second *= 1.5;
1244
1245 w[1].first = w[0].first;
1246 w[1].second = w[0].second;
1247
1248 w[2].first = detas2*neta;
1249 w[2].second = dphis2*nphi;
1250
1251 w[3].first = (2*detas2)*(0.5 + (neta/2.));
1252 w[3].second = w[2].second;
1253
1254 return w;
1255}
std::array< std::pair< double, double >, 4 > WindowArray_t
Holds the per-layer window sizes.

◆ makeCorrection() [1/2]

virtual void CaloFillRectangularCluster::makeCorrection ( const Context & myctx,
xAOD::CaloCluster * cluster ) const
overridevirtual

CaloClusterCorrection virtual method.

Parameters
myctxToolWithConstants context.
clusterThe cluster on which to operate.

Implements CaloClusterCorrection.

◆ makeCorrection() [2/2]

void CaloFillRectangularCluster::makeCorrection ( const EventContext & ctx,
xAOD::CaloCluster * cluster ) const
inline

Definition at line 91 of file CaloFillRectangularCluster.h.

93 {
94 return makeCorrection (context(ctx), cluster);
95 }
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
CaloClusterCorrection virtual method.

◆ makeCorrection1()

void CaloFillRectangularCluster::makeCorrection1 ( const EventContext & ctx,
const CaloDetDescrManager & dd_man,
CaloClusterCorr::SamplingHelper & helper,
double eta,
double phi,
const CaloSampling::CaloSample samplings[4] ) const
private

Definition at line 817 of file CaloFillRectangularCluster.cxx.

825{
826 // Do sampling 2.
827 helper.calculate_and_set (eta, phi, 2, -1, samplings, true);
828 // the etam and phim of the helper are now filled with etamr and phimr from the CaloLayerCalculator
829 double eta2 = helper.etam();
830 double phi2 = helper.phim();
831 // Make sure that we have a seed. Assume the input cluster has a good (eta,phi)
832 if (eta2 == -999.) eta2 = eta;
833 if (phi2 == -999.) phi2 = phi;
834
835 // Now do sampling 1; use the result from sampling 2 as the seed.
836 helper.calculate_and_set (eta2, phi2, 1, -1, samplings);
837 double eta1 = helper.etam();
838 double phi1 = helper.phim();
839 bool refine = true;
840 if (eta1 == -999. || phi1 == -999.) {
841 // Make sure that we have a seed. If eta,phi1 not OK, (e.g. deadOTX), take (eta2,phi2)
842 if (eta1 == -999.) eta1 = eta2;
843 if (phi1 == -999.) phi1 = phi2;
844 refine = false;
845 }
846
847 // For some silly reason, we have TWO different sampling enums.
848 // The clusters use one, the detector description uses the other.
850 if (samplings[1] == CaloSampling::EMB1)
851 xsample = CaloCell_ID::EMB1;
852 else
853 xsample = CaloCell_ID::EME1;
854
855 // Now refine the eta position using +-1 strip around hot cell
856 // This only makes sense if the previous step was OK
857 if (refine) {
858 double detastr, dphistr;
859 CaloClusterCorr::etaphi_range (dd_man,helper.etamax(), helper.phimax(),
860 xsample,
861 detastr, dphistr);
862
863 if (detastr > 0 && dphistr > 0) {
864 helper.calculate_cluster (helper.etamax(), helper.phimax(),
865 detastr, dphistr, samplings[1]);
866
867 if (helper.etam()!=-999.) {
868 eta1 = helper.etam();
869 double eta1r = helper.etareal();
870 helper.cluster()->setEta(samplings[1], eta1r);
871 }
872 }
873 }
874
875 // Now do sampling 0 using the eta1 point:
876 helper.calculate_and_set (eta1, phi2, 0, 1, samplings);
877
878 // Do for sampling 3 (using the sampling 2 seed).
879 helper.calculate_and_set (eta2, phi2, 3, -1, samplings);
880
881 // Crack;
882 // Check if the cluster has TileGap3 sampling and avoid to calculate the TileGap3 energy twice
883 if ( helper.cluster()->hasSampling(CaloSampling::TileGap3) && samplings[0]==CaloSampling::PreSamplerE )
884 {
885 //By default, use the original cell container
886 const CaloCellContainer* cc = helper.cluster()->getCellLinks()->getCellContainer();
887
888 //Leave the option to use a different cell container
889 if (!m_cellsName.key().empty()) {
890 SG::ReadHandle<CaloCellContainer> cchand (m_cellsName, ctx);
891 if (!cchand.isValid()) {
892 REPORT_ERROR(StatusCode::FAILURE)
893 << "Can't retrieve cell container " << m_cellsName.key();
894 return;
895 }
896 cc = cchand.cptr();
897 }
898
899 if(!cc) //cover the case when the cluster does not give a cell container and the name is empty
900 {
901 REPORT_ERROR(StatusCode::FAILURE)
902 << "Can't find cell container; cluster does not give a cell container";
903 return;
904 }
905
906 // Add up the tile scintillator energy in the region around the cluster.
907 double eh_scint = 0;
909 cc->beginConstCalo(CaloCell_ID::TILE);
911 cc->endConstCalo(CaloCell_ID::TILE);
912
913 for ( ; f_cell!=l_cell; ++f_cell)
914 {
915 const CaloCell* cell = (*f_cell) ;
916
917 if (CaloCell_ID::TileGap3 == cell->caloDDE()->getSampling()) {
918 // consider only E4 cell
919 if( fabs(cell->eta()) < 1.4 || fabs(cell->eta()) > 1.6 ) continue;
920 double phic = cell->phi();
921 double etac = cell->eta();
922
923 float diffeta = etac-eta2;
924 float diffphi = phic-phi2;
925 if (diffphi < -pi) diffphi += twopi;
926 if (diffphi > pi) diffphi -= twopi;
927
928 if(fabs(diffeta)<deta && fabs(diffphi)<dphi){
929 eh_scint += cell->e();
930 }
931 }
932 }
933 //Set the TileGap3 sampling energy to the cluster; Needed for MVA calibration
934 helper.cluster()->setEnergy(CaloSampling::TileGap3,eh_scint);
935
936 helper.cluster()->setEta(CaloSampling::TileGap3, eta2);
937 helper.cluster()->setPhi(CaloSampling::TileGap3, phi2);
938 }
939}
#define REPORT_ERROR(SC)
Report an error.
#define pi
constexpr double twopi
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
void etaphi_range(const CaloDetDescrManager &dd_man, double eta, double phi, CaloCell_ID::CaloSample sampling, double &deta, double &dphi)
Return eta/phi ranges encompassing +- 1 cell.
setEt setPhi setE277 setWeta2 eta1

◆ makeCorrection2()

void CaloFillRectangularCluster::makeCorrection2 ( const EventContext & ctx,
const CaloDetDescrManager & dd_man,
CaloClusterCorr::SamplingHelper & helper ) const
private

Definition at line 948 of file CaloFillRectangularCluster.cxx.

952{
953
954 // Don't do anything if we don't have any cells.
955 if (helper.empty())
956 return;
957
958 // Get the seed position of the cluster.
959 CaloCluster* cluster = helper.cluster();
960 double eta, phi;
961 get_seed (helper, cluster, eta, phi);
962 double aeta = fabs(eta);
963
964 // set the appropriate cluster size
965 int neta = cluster->getClusterEtaSize();
966 int nphi = cluster->getClusterPhiSize();
967
968 if (m_neta != neta || m_nphi != nphi) {
969 CaloCluster::ClusterSize oldSize = cluster->clusterSize();
970 CaloCluster::ClusterSize newSize = oldSize;
971 switch(oldSize) {
973 break;
977 if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55ele;
978 if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35ele;
979 if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37ele;
980 if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
981 break;
985 if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55gam;
986 if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35gam;
987 if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37gam;
988 if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
989 break;
993 if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55Econv;
994 if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35Econv;
995 if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37Econv;
996 if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
997 break;
998 default:
999 if (m_neta==5 && m_nphi==5) newSize=CaloCluster::SW_55ele;
1000 if (m_neta==3 && m_nphi==5) newSize=CaloCluster::SW_35ele;
1001 if (m_neta==3 && m_nphi==7) newSize=CaloCluster::SW_37ele;
1002 if (m_neta==7 && m_nphi==11) newSize=CaloCluster::SW_7_11;
1003 break;
1004 }
1005 cluster->setClusterSize(newSize);
1006 }
1007
1008 // Lists of samplings in the barrel and endcap.
1009 static const CaloSampling::CaloSample samplings_b[4] =
1010 { CaloSampling::PreSamplerB, CaloSampling::EMB1,
1011 CaloSampling::EMB2, CaloSampling::EMB3 };
1012 static const CaloSampling::CaloSample samplings_e[4] =
1013 { CaloSampling::PreSamplerE, CaloSampling::EME1,
1014 CaloSampling::EME2, CaloSampling::EME3 };
1015
1016 // We need to calculate sampling properties for barrel and endcap
1017 // separately.
1018 // FIXME: the overlap with barrel should be checked!!
1019
1020 //Now set the sampling pattern for this cluster
1021 //Can't set sampling variables w/o setting the sampling pattern before
1022 uint32_t samplingPattern_b=0xf; //first four bits: The barrel sampling (PS to Back)
1023 uint32_t samplingPattern_e=0xf0; //bits 4-7: The EMEC samplings (PS to back)
1024 uint32_t samplingPattern=0;
1025
1026 if (aeta < 1.6)
1027 samplingPattern |=samplingPattern_b;
1028
1029 if (aeta > 1.3)
1030 samplingPattern |=samplingPattern_e;
1031
1032 if (aeta > 1.37 && aeta < 1.63)
1033 samplingPattern |=(1<<(uint32_t)CaloSampling::TileGap3);
1034
1035 cluster->setSamplingPattern(samplingPattern);
1036
1037 // Barrel
1038 if (aeta < 1.6) {
1039 makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_b);
1040 }
1041
1042 // Endcap
1043 if (aeta > 1.3) {
1044 makeCorrection1 (ctx, dd_man,helper, eta, phi, samplings_e);
1045 }
1046
1047 // Set the total cluster energy to the sum over all samplings.
1048 double cl_ene = 0;
1049 for(int i=0; i<4; i++ ){
1050 cl_ene += cluster->eSample(samplings_b[i]);
1051 cl_ene += cluster->eSample(samplings_e[i]);
1052 }
1053 cluster->setE(cl_ene);
1054
1055 if (m_setRawState) {
1056 cluster->setRawE(cl_ene);
1057 cluster->setRawEta(eta);
1058 cluster->setRawPhi(phi);
1059 }
1060
1061}
void setRawEta(double eta)
Set raw eta.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
unsigned int getClusterEtaSize() const
void setRawPhi(double phi)
Set raw phi.
void setRawE(double e)
Set raw energy.
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
unsigned int getClusterPhiSize() const
virtual void setE(double e)
Set energy.
Gaudi::Property< int > m_neta
cluster size. These are properties.
Gaudi::Property< bool > m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state.
virtual void get_seed(CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
void makeCorrection1(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
ClusterSize
Enumeration to identify different cluster sizes.
setEventNumber uint32_t

◆ mergeConstants()

virtual StatusCode CaloUtils::ToolWithConstants< BASE >::mergeConstants ( CaloRec::ToolConstants & out,
const EventContext & ctx ) const
overridevirtualinherited

Merge our constants into out with the proper prefix.

Parameters
[out]outObject to receive our constants.
ctxEvent context.

◆ setCaloCellContainerName()

StatusCode CaloFillRectangularCluster::setCaloCellContainerName ( const std::string & name)
overridevirtual

Change the name of the CaloCellContainer used by this tool.

Parameters
nameThe new container name.

Implements ISetCaloCellContainerName.

Definition at line 1212 of file CaloFillRectangularCluster.cxx.

1214{
1215 return this->setProperty (StringProperty ("cells_name", name));
1216}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)

◆ setenergy()

void CaloClusterCorrection::setenergy ( xAOD::CaloCluster * cluster,
float energy ) const
virtualinherited

Definition at line 94 of file CaloClusterCorrection.cxx.

95{
96 if (cluster->e() == 0) {
97 if (energy != 0)
98 REPORT_MESSAGE (MSG::WARNING)
99 << "Attempt to rescale zero-energy cluster to energy " << energy
100 << " ignored.";
101 return;
102 }
103
104 float correction = energy/cluster->e();
105 cluster->setE(energy);
106
107 // also correct individual sampling energies:
108
109 for (int iSample=CaloSampling::PreSamplerB;
110 iSample < CaloSampling::Unknown;
111 ++iSample)
112 {
113 CaloSampling::CaloSample sampling=static_cast<CaloSampling::CaloSample>(iSample);
114 if (cluster->hasSampling (sampling)) {
115 double e = cluster->eSample(sampling);
116 cluster->setEnergy(sampling,e*correction) ;
117 }
118 }
119}
#define REPORT_MESSAGE(LVL)
Report a message.
float eSample(const CaloSample sampling) const
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
correction(mu, runmode, campaign, run=None)
Definition zlumi_mc_cf.py:4

◆ setsample()

void CaloClusterCorrection::setsample ( xAOD::CaloCluster * cluster,
CaloSampling::CaloSample sampling,
float em,
float etam,
float phim,
float emax,
float etamax,
float phimax,
float etas,
float phis ) const
virtualinherited

Definition at line 74 of file CaloClusterCorrection.cxx.

79{
80 cluster->setEnergy(sampling, em);
81 cluster->setEta(sampling, etam);
82 cluster->setPhi(sampling, phim);
83
84 cluster->setEmax(sampling,emax);
85 cluster->setEtamax(sampling,etamax);
86 cluster->setPhimax(sampling,phimax);
87
88 cluster->setEtasize(sampling, etas);
89 cluster->setPhisize(sampling, phis);
90}
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEtasize(const CaloSample sampling, const float etaSize)
Set the cluster size in for a given sampling.
bool setPhisize(const CaloSample sampling, const float phiSize)
Set the cluster size in for a given sampling.
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.

◆ toolType()

virtual const std::string & CaloUtils::ToolWithConstants< BASE >::toolType ( ) const
virtualinherited

Return the name of the type of this tool.

A saved set of constants includes both the C++ class name and a version number. Normally, the class name is taken from the Gaudi type() method, but that may be changed by overriding this method. This can be used, for example, when there are tools with distinct C++ classes but which are yet similar enough to combine together.

Reimplemented in CaloSwEta1b_g3, CaloSwEta1e_g3, CaloSwEta2b_g3, and CaloSwEta2e_g3.

◆ toolVersion()

virtual int CaloUtils::ToolWithConstants< BASE >::toolVersion ( ) const
virtualinherited

Return the version number for this tool.

A saved set of constants includes both the C++ class name and a version number. The idea is that the version number can be bumped whenever there's a backwards-incompatible change; this gives some protection against trying to use an old version of a tool with an incompatible newer set of constants.

If you want a tool to have a version number, override this method. Otherwise, it will default to a version number of 0.

◆ writeConstants()

virtual void CaloUtils::ToolWithConstants< BASE >::writeConstants ( std::ostream & stream,
const std::string & name,
const EventContext & ctx ) const
virtualinherited

Dump method (for debugging)

Parameters
streamOstream to which to write.
nameName to go in output
ctxEvent context.

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> CaloClusterCorrection::m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
protectedinherited

Definition at line 83 of file CaloClusterCorrection.h.

83{this,"CaloDetDescrManager", "CaloDetDescrManager"};

◆ m_cellsName

SG::ReadHandleKey<CaloCellContainer> CaloFillRectangularCluster::m_cellsName {this, "cells_name", "AllCalo"}
private

The StoreGate key for the container of our input cells.

This is a property.

Definition at line 195 of file CaloFillRectangularCluster.h.

195{this, "cells_name", "AllCalo"};

◆ m_DBHandle

Handle to a ToolConstants conditions object.

Definition at line 534 of file ToolWithConstants.h.

535{ this, "DBHandleKey", "", "" };

◆ m_deta0

double CaloFillRectangularCluster::m_deta0 = 0.0
protected

Cell window sizes in each sampling.

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_deta1

double CaloFillRectangularCluster::m_deta1 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_deta2

double CaloFillRectangularCluster::m_deta2 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_deta3

double CaloFillRectangularCluster::m_deta3 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_dphi0

double CaloFillRectangularCluster::m_dphi0 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_dphi1

double CaloFillRectangularCluster::m_dphi1 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_dphi2

double CaloFillRectangularCluster::m_dphi2 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_dphi3

double CaloFillRectangularCluster::m_dphi3 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_fill_cluster

Gaudi::Property<bool> CaloFillRectangularCluster::m_fill_cluster {this, "fill_cluster", true}
protected

Fill-cluster flag.

This is a property. If true, then we fill the cluster with cells from StoreGate. Otherwise, we use the cells already in the cluster.

Definition at line 185 of file CaloFillRectangularCluster.h.

185{this, "fill_cluster", true};

◆ m_impl

ToolWithConstantsImpl CaloUtils::ToolWithConstants< BASE >::m_impl
privateinherited

Internal implementation object.

Definition at line 542 of file ToolWithConstants.h.

542{ this->name(), m_prefix, m_DBHandle };
Hold constants for a tool.

◆ m_isdummy

Constant<bool> CaloUtils::ToolWithConstants< BASE >::m_isdummy
privateinherited

If true, then this is a dummy tool that should not be executed.

This is used for the case of reading from COOL using hierarchical tags: we need to have such tags associated with some object in each folder, regardless of whether or not the correction from that folder is actually used. [Every folder that IOVDbSvc knows about at configuration time needs to have a valid object for the configured tag, else IOVDbSvc will raise a fatal error. But we don't know at configuration time which folders we're actually going to need, so we gotta configure all of them.]

Definition at line 560 of file ToolWithConstants.h.

561{this, "isDummy", false };

◆ m_neta

Gaudi::Property<int> CaloFillRectangularCluster::m_neta {this, "eta_size", 5}
protected

\(\eta\times\phi\) cluster size. These are properties.

Definition at line 179 of file CaloFillRectangularCluster.h.

179{this, "eta_size", 5};

◆ m_nphi

Gaudi::Property<int> CaloFillRectangularCluster::m_nphi {this, "phi_size", 5}
protected

Definition at line 180 of file CaloFillRectangularCluster.h.

180{this, "phi_size", 5};

◆ m_order

Constant<int> CaloUtils::ToolWithConstants< BASE >::m_order
privateinherited

Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag.

Tools should be executed in order of increasing m_order.

Definition at line 547 of file ToolWithConstants.h.

548{ this, "order", 0 };

◆ m_prefix

StringProperty CaloUtils::ToolWithConstants< BASE >::m_prefix
privateinherited

Prefix for finding our constants within the ToolConstants object.

Definition at line 538 of file ToolWithConstants.h.

539{ this, "prefix", "", "" };

◆ m_setRawState

Gaudi::Property<bool> CaloFillRectangularCluster::m_setRawState {this, "set_raw_state", true}
protected

Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state.

Definition at line 190 of file CaloFillRectangularCluster.h.

190{this, "set_raw_state", true};

The documentation for this class was generated from the following files: