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.

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.

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.

Detailed Description

Definition at line 58 of file CaloFillRectangularCluster.h.

Member Typedef Documentation

◆ WindowArray_t

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

Holds the per-layer window sizes.

Definition at line 120 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 782 of file CaloFillRectangularCluster.cxx.

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

◆ CaloFillRectangularCluster() [2/2]

CaloFillRectangularCluster::CaloFillRectangularCluster ( )
privatedelete

This isn't allowed.

Member Function Documentation

◆ execute() [1/2]

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

Definition at line 52 of file CaloClusterCorrection.cxx.

54{
55 this->makeCorrection (context(ctx), cluster);
56
57#if 0
58 ATH_MSG_DEBUG( " ...... e, et " << cluster->e() << " " << cluster->et() << endmsg);
59 ATH_MSG_DEBUG( " ...... eta, etaBE, etaSmp " << cluster->eta() << " " << cluster->etaBE(2)
60 << " " << cluster->etaSample(CaloSampling::EMB1)
61 << " " << cluster->etaSample(CaloSampling::EMB2)
62 << " " << cluster->etaSample(CaloSampling::EMB3) << endmsg);
63 ATH_MSG_DEBUG( " ...... phi, phiBE, phiSmp " << cluster->phi() << " " << cluster->phiBE(2)
64 << " " << cluster->phiSample(CaloSampling::EMB1)
65 << " " << cluster->phiSample(CaloSampling::EMB2)
66 << " " << cluster->phiSample(CaloSampling::EMB3) << endmsg);
67#endif
68
69 return StatusCode::SUCCESS;
70}
#define endmsg
#define ATH_MSG_DEBUG(x)
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *) const =0
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.

46{
47 for (xAOD::CaloCluster* clu : *collection) {
48 ATH_CHECK( execute (ctx, clu) );
49 }
50 return StatusCode::SUCCESS;
51}
#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 1148 of file CaloFillRectangularCluster.cxx.

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

797{
798 // The method from the base class.
800 if (!m_cellsName.key().empty()){
801 CHECK( m_cellsName.initialize() );
802 }
803
804 ATH_CHECK(m_caloMgrKey.initialize());
805 return StatusCode::SUCCESS;
806}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
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 1230 of file CaloFillRectangularCluster.cxx.

1234{
1236
1237 // set up the sampling windows:
1238 w[0].first = detas2*neta;
1239 w[0].second = dphis2*4;
1240
1241 if (nphi >= 7)
1242 w[0].second *= 2;
1243 else
1244 w[0].second *= 1.5;
1245
1246 w[1].first = w[0].first;
1247 w[1].second = w[0].second;
1248
1249 w[2].first = detas2*neta;
1250 w[2].second = dphis2*nphi;
1251
1252 w[3].first = (2*detas2)*(0.5 + (neta/2.));
1253 w[3].second = w[2].second;
1254
1255 return w;
1256}
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 90 of file CaloFillRectangularCluster.h.

92 {
93 return makeCorrection (context(ctx), cluster);
94 }
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 818 of file CaloFillRectangularCluster.cxx.

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

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

◆ 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 1213 of file CaloFillRectangularCluster.cxx.

1215{
1216 return this->setProperty (StringProperty ("cells_name", name));
1217}
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 93 of file CaloClusterCorrection.cxx.

94{
95 if (cluster->e() == 0) {
96 if (energy != 0)
97 REPORT_MESSAGE (MSG::WARNING)
98 << "Attempt to rescale zero-energy cluster to energy " << energy
99 << " ignored.";
100 return;
101 }
102
103 float correction = energy/cluster->e();
104 cluster->setE(energy);
105
106 // also correct individual sampling energies:
107
108 for (int iSample=CaloSampling::PreSamplerB;
109 iSample < CaloSampling::Unknown;
110 ++iSample)
111 {
112 CaloSampling::CaloSample sampling=static_cast<CaloSampling::CaloSample>(iSample);
113 if (cluster->hasSampling (sampling)) {
114 double e = cluster->eSample(sampling);
115 cluster->setEnergy(sampling,e*correction) ;
116 }
117 }
118}
#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 73 of file CaloClusterCorrection.cxx.

78{
79 cluster->setEnergy(sampling, em);
80 cluster->setEta(sampling, etam);
81 cluster->setPhi(sampling, phim);
82
83 cluster->setEmax(sampling,emax);
84 cluster->setEtamax(sampling,etamax);
85 cluster->setPhimax(sampling,phimax);
86
87 cluster->setEtasize(sampling, etas);
88 cluster->setPhisize(sampling, phis);
89}
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.

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 194 of file CaloFillRectangularCluster.h.

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

◆ m_deta0

double CaloFillRectangularCluster::m_deta0 = 0.0
protected

Cell window sizes in each sampling.

Definition at line 174 of file CaloFillRectangularCluster.h.

◆ m_deta1

double CaloFillRectangularCluster::m_deta1 = 0.0
protected

Definition at line 174 of file CaloFillRectangularCluster.h.

◆ m_deta2

double CaloFillRectangularCluster::m_deta2 = 0.0
protected

Definition at line 174 of file CaloFillRectangularCluster.h.

◆ m_deta3

double CaloFillRectangularCluster::m_deta3 = 0.0
protected

Definition at line 174 of file CaloFillRectangularCluster.h.

◆ m_dphi0

double CaloFillRectangularCluster::m_dphi0 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_dphi1

double CaloFillRectangularCluster::m_dphi1 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_dphi2

double CaloFillRectangularCluster::m_dphi2 = 0.0
protected

Definition at line 175 of file CaloFillRectangularCluster.h.

◆ m_dphi3

double CaloFillRectangularCluster::m_dphi3 = 0.0
protected

Definition at line 175 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 184 of file CaloFillRectangularCluster.h.

184{this, "fill_cluster", true};

◆ m_neta

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

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

Definition at line 178 of file CaloFillRectangularCluster.h.

178{this, "eta_size", 5};

◆ m_nphi

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

Definition at line 179 of file CaloFillRectangularCluster.h.

179{this, "phi_size", 5};

◆ 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 189 of file CaloFillRectangularCluster.h.

189{this, "set_raw_state", true};

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