Accumulate hits.
62 {
63
64 if ((not m_digits.isValid()) or (not m_clusters.isValid())) return;
65
66
67 auto& rates = m_buffer[timeStamp];
68
69
70 rates.numEvents++;
71
72
73 rates.averageRate += m_digits.getEntries();
74
75
76 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
77
78
79 float occupancies[40] = {0};
80 for (const PXDDigit& storeDigit : m_digits) {
81 VxdID sensorID = storeDigit.getSensorID();
82 int index = gTools->getPXDSensorIndex(storeDigit.getSensorID());
83 int vBin = PXD::PXDGainCalibrator::getInstance().getBinV(sensorID, storeDigit.getVCellID(), 6);
84 double ADUToEnergy = PXD::PXDGainCalibrator::getInstance().getADUToEnergy(sensorID, storeDigit.getUCellID(),
85 storeDigit.getVCellID());
86 double hitEnergy = storeDigit.getCharge() * ADUToEnergy;
87 rates.doseRates[index] += (hitEnergy / Unit::J);
88 occupancies[index] += 1.0;
89 rates.segmentDoseRates[vBin + index * 6] += (hitEnergy / Unit::J);
90 }
91
92 for (int index = 0; index < m_nPXDSensors; index++) {
93 if (m_activePixels[index] > 0) {
94 occupancies[index] /= m_activePixels[index];
95 }
96 rates.meanOccupancies[index] += occupancies[index];
97 if (rates.maxOccupancies[index] < occupancies[index]) {
98 rates.maxOccupancies[index] = occupancies[index];
99 }
100 }
101
102
103 for (const PXDCluster& cluster : m_clusters) {
104
105 VxdID sensorID = cluster.getSensorID();
106 int index = gTools->getPXDSensorIndex(sensorID);
108
109 auto cluster_uID = info.getUCellID(cluster.getU());
110 auto cluster_vID = info.getVCellID(cluster.getV());
111 int vBin = PXD::PXDGainCalibrator::getInstance().getBinV(sensorID, cluster_vID, 6);
112 double ADUToEnergy = PXD::PXDGainCalibrator::getInstance().getADUToEnergy(sensorID, cluster_uID, cluster_vID);
113 double clusterEnergy = cluster.getCharge() * ADUToEnergy;
114
115 if (cluster.getSize() == 1 && clusterEnergy < 10000 * Unit::eV && clusterEnergy > 6000 * Unit::eV) {
116 rates.softPhotonFluxes[index] += 1.0;
117 rates.segmentSoftPhotonFluxes[vBin + index * 6] += 1.0;
118 } else if (cluster.getSize() == 1 && clusterEnergy > 10000 * Unit::eV) {
119 rates.hardPhotonFluxes[index] += 1.0;
120 rates.segmentHardPhotonFluxes[vBin + index * 6] += 1.0;
121 } else if (cluster.getSize() > 1 && clusterEnergy > 10000 * Unit::eV) {
122 rates.chargedFluxes[index] += 1.0;
123 rates.segmentChargedFluxes[vBin + index * 6] += 1.0;
124 }
125 }
126
127
128 rates.valid = true;
129 }
TString getInfo(const TObject *obj)
Get object info HTML (e.g.