NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
EventSummary.cpp
Go to the documentation of this file.
2 #include <bitset>
3 
5 
6 namespace NAIA {
7 const std::string EventSummary::BranchName{"EventSummaryData"};
8 
10  float weight = 1.0f;
11 
12  if (!IsPhysicsTrigger()) {
13  switch (JMembPatt & 0x802) {
14  case 0:
15  spdlog::error(
16  "EventSummaryData::TriggerWeight: Trigger is non-physics ({}) but no unbiased but set in JMembPatt ({})",
17  std::bitset<8>(PhysBPatt).to_string(), std::bitset<16>(JMembPatt).to_string());
18  throw std::runtime_error("Invalid trigger");
19  case 0x2:
20  weight = 100.0f;
21  break;
22  case 0x800:
23  weight = 1000.0f;
24  break;
25  case 0x802:
26  weight = 100.0f;
27  break;
28  default:
29  break;
30  }
31  }
32 
33  return weight;
34 }
35 
37  // same as in root.C:14634
38 
39  if (force || PhysBPatt == 0) {
40  if ((JMembPatt & 0x0001) == 0x0001)
41  PhysBPatt |= 0x0001; // unbiased 3/4 TOF-CP
42  if ((JMembPatt & 0x0090) == 0x0090)
43  PhysBPatt |= 0x0002; // 4/4 TOF-CT & ACC0
44  if ((JMembPatt & 0x0300) == 0x0300)
45  PhysBPatt |= 0x0004; // 4/4 TOF-BZ & ACC1
46  if ((JMembPatt & 0x0020) == 0x0020)
47  PhysBPatt |= 0x0008; // 4/4 FTZ
48  if ((JMembPatt & 0x0410) == 0x0410)
49  PhysBPatt |= 0x0010; // 4/4 TOF-CT & ECALF&
50  if ((JMembPatt & 0x1000) == 0x1000)
51  PhysBPatt |= 0x0020; // ECALA&
52  if ((JMembPatt & 0x0800) == 0x0800)
53  PhysBPatt |= 0x0040; // unbiased ECALA||
54  }
55 }
56 
58  NAntiCluster = 0;
59  NTofCluster = 0;
60  NTrRecHit = 0;
61  NTrTrack = 0;
62  NRichRing = 0;
63  NEcalShower = 0;
64  NParticle = 0;
65 
69 
70  JMembPatt = std::numeric_limits<unsigned short>::max();
71  PhysBPatt = std::numeric_limits<unsigned short>::max();
72  NAcc = std::numeric_limits<unsigned short>::max();
73 }
74 
75 void EventSummaryData::Dump() const {
76  fmt::print("{:=^120} \n", " EventSummaryData ");
77 
78  fmt::print("{:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>10} {:>16}\n", "NAntiCluster", "NTofCluster",
79  "NTrRecHit", "NTrTrack", "NRichRing", "NEcalShower", "NParticle", "NAcc", "PhysBPatt", "JMembPatt");
80 
81  fmt::print("{:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>15} {:>10} {:>16}\n", NAntiCluster, NTofCluster,
82  NTrRecHit, NTrTrack, NRichRing, NEcalShower, NParticle, NAcc, std::bitset<8>(PhysBPatt).to_string(),
83  std::bitset<16>(JMembPatt).to_string());
84  fmt::print("{:-^120}\n", "");
85 }
86 } // namespace NAIA
unsigned short NParticle
Total number of reconstructed particles in the event.
Definition: EventSummary.h:69
unsigned short NAcc
Number of fired ACC counters.
Definition: EventSummary.h:79
float TriggerWeight() const
Returns the weight associated with the trigger for this event (depends on the prescaling factor for e...
Definition: EventSummary.cpp:9
unsigned short NAntiCluster
Number of fired ACC clusters.
Definition: EventSummary.h:63
static const std::string BranchName
Definition: EventSummary.h:103
unsigned short PhysBPatt
same as in gbatch, see https://ams.cern.ch/AMS/Analysis/hpl3itp1/root02_v5/html/development/html/clas...
Definition: EventSummary.h:76
unsigned short NTrRecHit
Total number of Tracker hits in the event.
Definition: EventSummary.h:65
unsigned short NEcalShower
Total number of Ecal showers in the event.
Definition: EventSummary.h:68
short HighestEcalEnergyParticle
ID of the ParticleR object with the highest ECAL shower energy.
Definition: EventSummary.h:71
void Dump() const
Dump on screen container content.
short HighestInnerChargeParticle
ID of the ParticleR object with the highest Inner Tracker charge.
Definition: EventSummary.h:72
unsigned short NTrTrack
Total number of Tracker tracks in the event.
Definition: EventSummary.h:66
bool IsPhysicsTrigger() const
Checks if the trigger corresponds to any of the AMS physics triggers.
Definition: EventSummary.h:46
short HighestBetaHChargeParticle
ID of the ParticleR object with the highest BetaH charge.
Definition: EventSummary.h:73
unsigned short NTofCluster
Total number of Tof clusters in the event.
Definition: EventSummary.h:64
void Clear()
Clear container content.
unsigned short JMembPatt
same as in gbatch, see https://ams.cern.ch/AMS/Analysis/hpl3itp1/root02_v5/html/development/html/clas...
Definition: EventSummary.h:77
void RestorePhysBPatt(bool force=false)
Recompute the PhysBPatt variable.
Event summary container class description.
unsigned short NRichRing
Total number of Rich rings in the event.
Definition: EventSummary.h:67