NAIA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
EcalFill.cpp
Go to the documentation of this file.
1 #include "EcalKXRec.h"
2 
3 #include "Containers/Ecal.h"
4 
5 namespace NAIA {
6 using namespace Ecal;
7 
9  Energy.resize(Ecal::numEnergyRecos);
10  BDT.resize(Ecal::numBDTTypes);
11 }
12 
13 void EcalBaseData::Fill(EcalShowerR *showerPtr) {
14  ResizeMembers();
15  TotalHits = AMSEventR::Head()->nEcalHit();
16  ShowerHits = showerPtr->Nhits;
17 
18  Energy[EnergyRecoType::EnergyD] = showerPtr->EnergyD / 1000.0f;
19  Energy[EnergyRecoType::EnergyE] = showerPtr->EnergyE;
20  Energy[EnergyRecoType::EnergyCorrEneE_E] = showerPtr->GetCorrectedEnergy(2, 2);
21  Energy[EnergyRecoType::EnergyCorrEne2017] = showerPtr->ElectronEnergy2017();
22 
23  auto ecalKRec = EcalKXRec::GetHead();
24  ecalKRec->ProcessAMSEvent(AMSEventR::Head());
25  ecalKRec->GetTotalEnergy(Energy[EnergyRecoType::EcalKEle]);
26 
27  BDT[BDTType::v7std] = showerPtr->GetEcalBDT(AMSEventR::Head(), 7, 0, 1);
28  BDT[BDTType::v7ada] = showerPtr->GetEcalBDT(AMSEventR::Head(), 7, 1, 1);
29  BDT[BDTType::v5std] = showerPtr->GetEcalBDT(AMSEventR::Head(), 5, 0, 1);
30  BDT[BDTType::v5ada] = showerPtr->GetEcalBDT(AMSEventR::Head(), 5, 1, 1);
31 
32  m_pointAndDir.emplace_back(showerPtr->CofG[0], showerPtr->CofG[1], showerPtr->CofG[2]);
33  m_pointAndDir.emplace_back(showerPtr->Dir[0], showerPtr->Dir[1], showerPtr->Dir[2]);
34 }
35 
37 
38 void EcalPlusData::Fill(EcalShowerR *showerPtr) {
39  ResizeMembers();
40  auto ecalKRec = EcalKXRec::GetHead();
41  ecalKRec->GetHadronFlag(EcalKHadronicFlag);
42  ecalKRec->GetNumberOfShowers(EcalKNShowers);
43  ecalKRec->GetLikelihood(Likelihood[LikelihoodType::Integral], Likelihood[LikelihoodType::LayerCombined]);
44 
45  std::array<float, 18> energy_total_planes{0};
46  std::array<float, 18> energy_max_planes{0};
47 
48  auto event = AMSEventR::Head();
49  for (int ihit = 0; ihit < event->nEcalHit(); ihit++) {
50  energy_total_planes[event->pEcalHit(ihit)->Plane] += event->pEcalHit(ihit)->Edep;
51  energy_max_planes[event->pEcalHit(ihit)->Plane] =
52  std::max(energy_max_planes[event->pEcalHit(ihit)->Plane], event->pEcalHit(ihit)->Edep);
53  }
54 
55  for (int ipl = 0; ipl < 18; ipl++) {
56  if (energy_total_planes[ipl])
57  MaxEnergyFraction[ipl] = energy_max_planes[ipl] / energy_total_planes[ipl];
58  }
59 }
60 } // namespace NAIA
constexpr unsigned int numLikelihoodTypes
Definition: Utils.h:300
Ecal energy (W. Xu 3D reconstruction)
Definition: Utils.h:286
void ResizeMembers()
Definition: EcalFill.cpp:36
Ecal energy (2017 reconstruction)
Definition: Utils.h:285
constexpr unsigned int numBDTTypes
Definition: Utils.h:309
Ecal container class description.
Ecal energy (standard reconstruction)
Definition: Utils.h:283
Total deposited energy in Ecal.
Definition: Utils.h:282
constexpr unsigned int numEnergyRecos
Definition: Utils.h:278
void ResizeMembers()
Definition: EcalFill.cpp:8
Ecal energy (electron hypothesys, Using different methods to recover anode efficiency, rear leakage, lateral leakage and temperature effects)
Definition: Utils.h:284