1 #ifndef St_tpcChargeEventC_h
2 #define St_tpcChargeEventC_h
4 #include "tables/St_tpcChargeEvent_Table.h"
13 tpcChargeEvent_st *Struct(Int_t i = 0) {
return ((St_tpcChargeEvent*) Table())->GetTable()+i;}
14 int nChargeEvents() {
return Struct()->nChargeEvents;}
15 unsigned int* eventBunchCrossingsLow() {
return Struct()->eventBunchCrossingsLow;}
16 unsigned int* eventBunchCrossingsHigh() {
return Struct()->eventBunchCrossingsHigh;}
17 float* eventCharges() {
return Struct()->eventCharges;}
18 int badBunch() {
return Struct()->badBunch;}
20 unsigned int eventBunchCrossingLow(
int idx) {
return eventBunchCrossingsLow()[idx]; }
21 unsigned int eventBunchCrossingHigh(
int idx) {
return eventBunchCrossingsHigh()[idx]; }
22 unsigned long long eventBunchCrossing(
int idx) {
return (((
unsigned long long) (eventBunchCrossingHigh(idx))) << 32)
23 + ((
unsigned long long) (eventBunchCrossingLow(idx))); }
24 float eventCharge(
int idx) {
return eventCharges()[idx];}
28 void lastChargeTime(
unsigned long long bunchCrossingNumber,
float& charge,
double& timeSinceCharge) {
29 int idx = indexBeforeBunchCrossing(bunchCrossingNumber);
30 charge = eventCharge(idx);
31 timeSinceCharge = timeDifference(bunchCrossingNumber,idx);
35 void findLastchargeTime(
unsigned long long bunchCrossingNumber) {
36 lastChargeTime(bunchCrossingNumber, localStoreCharge, localStoreTimeSinceCharge);
38 void getLastChargeTime(
float& charge,
double& timeSinceCharge) {
39 charge = localStoreCharge;
40 timeSinceCharge = localStoreTimeSinceCharge;
44 int findChargeTimes(
unsigned long long bunchCrossingNumber,
unsigned long long bunchCrossingWindow);
45 int findChargeTimes(
unsigned long long bunchCrossingNumber,
double timeWindow=1.9);
46 TArrayF* getCharges() {
return &localStoreCharges; }
47 TArrayD* getTimes() {
return &localStoreTimesSinceCharges; }
52 double timeDifference(
unsigned long long bunchCrossingNumber,
int idx);
53 int indexBeforeBunchCrossing(
unsigned long long bunchCrossingNumber);
55 int localSearchLowerIndex = 0;
56 int localSearchUpperIndex = -1;
57 float localStoreCharge = 0;
58 double localStoreTimeSinceCharge = 0;
59 TArrayF localStoreCharges;
60 TArrayD localStoreTimesSinceCharges;