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

EM cluster shower shape calculations in 1st ECAL sampling Calculate the width in the strip layer around the eta,phi of the hottest cell in the middle layer. More...

#include <egammaStripsShape.h>

Collaboration diagram for egammaStripsShape:

Classes

struct  Info

Static Public Member Functions

static StatusCode execute (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, Info &info, bool ExecAllVariables=true)
 AlgTool main method.

Detailed Description

EM cluster shower shape calculations in 1st ECAL sampling Calculate the width in the strip layer around the eta,phi of the hottest cell in the middle layer.

Author
Frederic Derue derue.nosp@m.@lpn.nosp@m.he.in.nosp@m.2p3..nosp@m.fr
Christos Anastopoulos

Definition at line 26 of file egammaStripsShape.h.

Member Function Documentation

◆ execute()

StatusCode egammaStripsShape::execute ( const xAOD::CaloCluster & cluster,
const CaloDetDescrManager & cmgr,
Info & info,
bool ExecAllVariables = true )
static

AlgTool main method.

Definition at line 702 of file egammaStripsShape.cxx.

706{
707 //
708 // Estimate shower shapes from first compartment
709 // based on hottest cell in 2nd sampling , the deta,dphi,
710 // And the barycenter in the 1st sampling (seed)
711 //
712
713 // check if cluster is in barrel or in the end-cap
714 if (!cluster.inBarrel() && !cluster.inEndcap()) {
715 return StatusCode::SUCCESS;
716 }
717 // retrieve energy in all samplings
718 const double eallsamples = egammaEnergyPositionAllSamples::e(cluster);
719 // retrieve energy in 1st sampling
720 const double e1 = egammaEnergyPositionAllSamples::e1(cluster);
721
722 // sam is used in SetArray to check that cells belong to strips
723 // samgran is used to estimate the window to use cells in eta
724 // it is based on the granularity of the middle layer
725 // For phi we use the strip layer granularity
726
727 // check if cluster is in barrel or end-cap
728 const bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(cluster, 2);
729
730 // define accordingly the position of CaloSampling
731 const CaloSampling::CaloSample sam = in_barrel ? CaloSampling::EMB1 : CaloSampling::EME1;
732 const CaloSampling::CaloSample samgran = in_barrel ? CaloSampling::EMB2 : CaloSampling::EME2;
733
735
736 // get eta and phi of the seed
737 info.etaseed = cluster.etaSample(sam);
738 info.phiseed = cluster.phiSample(sam);
739 // get eta and phi of the hottest cell in the second sampling
740 info.etamax = cluster.etamax(samgran);
741 info.phimax = cluster.phimax(samgran);
742 // possible for soft electrons to be at -999
743 if ((info.etamax == 0. && info.phimax == 0.) ||
744 std::abs(info.etamax) > 100.) {
745 return StatusCode::SUCCESS;
746 }
747 // check if we are in a crack or outside area where strips are well defined
748 if (std::abs(info.etamax) > 2.4) {
749 return StatusCode::SUCCESS;
750 }
751 if (std::abs(info.etamax) > 1.4 && std::abs(info.etamax) < 1.5) {
752 return StatusCode::SUCCESS;
753 }
754 // We eeds both enums: subCalo and CaloSample
755 // use samgran = granularity in second sampling for eta !!!!
756 double deta = 0;
757 double dphi = 0;
758 bool barrel = false;
759 int sampling_or_module = 0;
761 subcalo, barrel, sampling_or_module, (CaloCell_ID::CaloSample)samgran);
762 const CaloDetDescrElement* dde = cmgr.get_element(
763 subcalo, sampling_or_module, barrel, info.etamax, info.phimax);
764 // if no object then exit
765 if (!dde) {
766 return StatusCode::SUCCESS;
767 }
768 // width in eta is granularity (dde->deta()) times number of cells (neta)
769 deta = dde->deta() * neta / 2.0;
770 // use samgran = granularity in first sampling for phi
772 subcalo, barrel, sampling_or_module, (CaloCell_ID::CaloSample)sam);
773 dde = cmgr.get_element(
774 subcalo, sampling_or_module, barrel, info.etamax, info.phimax);
775 // if no object then exit
776 if (!dde) {
777 return StatusCode::SUCCESS;
778 }
779 // width in phi is granularity (dde->dphi()) times number of cells (nphi)
780 dphi = dde->dphi() * nphi / 2.0;
781
782 /* initialize the arrays*/
783 double enecell[STRIP_ARRAY_SIZE] = { 0 };
784 double etacell[STRIP_ARRAY_SIZE] = { 0 };
785 double gracell[STRIP_ARRAY_SIZE] = { 0 };
786 int ncell[STRIP_ARRAY_SIZE] = { 0 };
787
788 // Fill the array in energy and eta from which all relevant
789 // quantities are estimated
790 setArray(cluster,
791 cmgr,
792 sam,
793 info.etamax,
794 info.phimax,
795 deta,
796 dphi,
797 enecell,
798 etacell,
799 gracell,
800 ncell);
801 /* Fill the the rest of the shapes*/
802 // find the corresponding index of the seed
803 setIndexSeed(info, etacell, gracell);
804 // calculate fraction of energy in strips
805 info.f1 = std::abs(eallsamples) > 0. ? e1 / eallsamples : 0.;
806 // calculate energy and bin where the energy strip is maximum
807 setEmax(info, enecell);
808 // calculate total width
809 setWstot(info, deta, enecell, etacell, ncell);
810 // width in three strips
811 setWs3(info, sam, cluster, enecell, etacell, ncell);
812 // Energy in in +/-1 and in +/-7 strips
813 if (ExecAllVariables) {
814 setEnergy(info, enecell);
815 setF1core(info, cluster);
816
817 setAsymmetry(info, enecell);
818 // Using strips centered on the hottest cell
819 // position in eta from +/- 1 strips
820 info.deltaEtaTrackShower =
821 setDeltaEtaTrackShower(1, info.ncetamax, enecell);
822 // Using strips centered on the seed cell
823 // position in eta from +/- 7 strips
824 info.deltaEtaTrackShower7 =
825 setDeltaEtaTrackShower(7, info.ncetaseed, enecell);
826 // calculate the fraction of energy int the two highest energy strips
827 setF2(info, enecell, eallsamples);
828 // Shower width in 5 strips around the highest energy strips
829 setWidths5(info, enecell);
830 // calculate energy of the second local maximum
831 int ncsec1 = setEmax2(info, enecell, gracell, ncell);
832 // calculate the energy of the strip with the minimum energy
833 setEmin(ncsec1, info, enecell, gracell, ncell);
834 // calculate M.S's valley
835 setValley(info, enecell);
836 // calculate M.S's fraction
837 setFside(info, enecell, gracell, ncell);
838 info.success = true;
839 }
840 return StatusCode::SUCCESS;
841}
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
bool inBarrel(const xAOD::CaloCluster &cluster, int is)
return boolean to know if we are in barrel/end-cap
double e(const xAOD::CaloCluster &cluster)
return the uncorrected sum of energy in all samples

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