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
int m_neta
 \(\eta\times\phi\) cluster size. These are properties.
int m_nphi
bool m_fill_cluster
 Fill-cluster flag.
bool m_setRawState
 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
 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 60 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 122 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 // properties
788 declareProperty("eta_size", m_neta = 5);
789 declareProperty("phi_size", m_nphi = 5);
790 declareProperty("fill_cluster", m_fill_cluster = true);
791 declareProperty("cells_name", m_cellsName = "AllCalo");
792 declareProperty("set_raw_state",m_setRawState=true);
793}
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.
bool m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state.
int m_neta
cluster size. These are properties.

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

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

802{
803 // The method from the base class.
805 if (!m_cellsName.key().empty()){
806 CHECK( m_cellsName.initialize() );
807 }
808
809 ATH_CHECK(m_caloMgrKey.initialize());
810 return StatusCode::SUCCESS;
811}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
Initialize method.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey

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

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

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

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

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

1220{
1221 return this->setProperty (StringProperty ("cells_name", name));
1222}
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
private

The StoreGate key for the container of our input cells.

This is a property.

Definition at line 195 of file CaloFillRectangularCluster.h.

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

◆ m_deta1

double CaloFillRectangularCluster::m_deta1 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_deta2

double CaloFillRectangularCluster::m_deta2 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_deta3

double CaloFillRectangularCluster::m_deta3 = 0.0
protected

Definition at line 176 of file CaloFillRectangularCluster.h.

◆ m_dphi0

double CaloFillRectangularCluster::m_dphi0 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi1

double CaloFillRectangularCluster::m_dphi1 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi2

double CaloFillRectangularCluster::m_dphi2 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_dphi3

double CaloFillRectangularCluster::m_dphi3 = 0.0
protected

Definition at line 177 of file CaloFillRectangularCluster.h.

◆ m_fill_cluster

bool CaloFillRectangularCluster::m_fill_cluster
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.

◆ 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

int CaloFillRectangularCluster::m_neta
protected

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

Definition at line 180 of file CaloFillRectangularCluster.h.

◆ m_nphi

int CaloFillRectangularCluster::m_nphi
protected

Definition at line 180 of file CaloFillRectangularCluster.h.

◆ 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

bool CaloFillRectangularCluster::m_setRawState
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.


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