PandaRoot
BSEmcEnergies_t.h
Go to the documentation of this file.
1 #ifndef BSEMCENERGIES_T_HH
2 #define BSEMCENERGIES_T_HH
3 
4 #include "TClonesArray.h"
5 
6 #include "BSEmcDigi.h"
8 
10  Double_t CenterEnergy{0};
11  Double_t NeighbourEnergy{0};
12  Double_t MaxNeighbourEnergy{0};
13  Int_t NeighbourNumber{0};
14 
15  Double_t MaxRatio() { return MaxNeighbourEnergy / CenterEnergy; }
16  Double_t SumRatio() { return NeighbourEnergy / CenterEnergy; }
19 
20  static BSEmcEnergies_t GetEnergies(Int_t t_centralcrystal, const std::vector<const BSEmcDigi *> &t_digiArray, BSEmcGeoNeighbouringRelationPar *t_neighbouring)
21  {
22  BSEmcEnergies_t energies;
23  Double_t energy = 0.0;
24  Int_t detectorid = 0;
25  for (const BSEmcDigi *digi : t_digiArray) {
26  energy = digi->GetEnergy();
27  detectorid = digi->GetDetectorId();
28  if (detectorid == t_centralcrystal) {
29  energies.CenterEnergy += energy;
30  } else if (t_neighbouring->AreNeighbours(detectorid, t_centralcrystal)) {
31  energies.NeighbourNumber += 1;
32  energies.NeighbourEnergy += energy;
33  if (energy > energies.MaxNeighbourEnergy) {
34  energies.MaxNeighbourEnergy = energy;
35  }
36  }
37  }
38  return energies;
39  }
40 };
41 
42 #endif /*BSEMCENERGIES_T_HH*/
Double_t SumRatio()
Bool_t AreNeighbours(Int_t t_a, Int_t t_b) const
Double_t CenterEnergy
Double_t NeighbourEnergy
Double_t MaxPlusRatio()
Double_t MaxNeighbourEnergy
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
Double_t MaxRatio()
Double_t SumPlusRatio()
Neigbouring Relations based on a list of detectorIds.
static BSEmcEnergies_t GetEnergies(Int_t t_centralcrystal, const std::vector< const BSEmcDigi *> &t_digiArray, BSEmcGeoNeighbouringRelationPar *t_neighbouring)