-
Notifications
You must be signed in to change notification settings - Fork 4
/
GammaData.c
69 lines (58 loc) · 2.34 KB
/
GammaData.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "GammaData.h"
GammaData::GammaData()
{
//Constructor
}
GammaData::~GammaData()
{
//Destructor
ClearEvent();
}
void GammaData::PrintEvent()//Print out the 'proper' information about an event
{
//Want to print out the number of valid Gamma hits
printf("Gamma hits: %d\n",SizeOfEvent());
for(unsigned int i=0;i<SizeOfEvent();i++)
{
printf("Hit number: %d\n",i);
printf("Energy: %g\n",GetEnergy(i));
}
}
bool GammaData::TestEvent()
{
bool result = true;
// Test the output data: do we have the same number of hits in each thing (energy, time etc.) and are the events good and shizzle like that
unsigned int hits = GammaEnergy.size();
if(GammaEnergy.size() != GammaHits){printf("Mismatch between GammaEnergy and GammaHits\n");result=false;}
//Check to see the same number of hits c.f. the energy hits. If you get a lot of warning messages from theta, phi, time here, that's likely because you're doing the energy hits wrong/differently
// if(GammaTheta.size() != hits){printf("Mismatched size: Theta\n"); result = false;}
// if(GammaPhi.size() != hits){printf("Mismatched size: Phi\n"); result = false;}
if(GammaTime.size() != hits){printf("Mismatched size: Time\n"); result = false;}
if(GammaDetectorType.size() != hits){printf("Mismatched size: GammaDetectorType\n"); result=false;}
if(GammaDetectorLabel.size() != hits){printf("Mismatched size: GammaDetectorLabel\n"); result=false;}
if(GammaDetectorSegm.size() != hits){printf("Mismatched size: GammaDetectorSegm\n"); result=false;}
if(GammaRawADC.size() != hits){printf("Mismatched size: GammaRawADC\n"); result=false;}
if(GammaADCChannel.size() != hits){printf("Mismatched size: GammaADCChannel\n"); result = false;}
if(GammaTDCChannel.size() != hits){printf("Mismatched size: GammaTDCChannel\n"); result = false;}
if(GammaTDCMultiplicity.size() != hits){printf("Mismatched size: GammaTDCMultiplicity\n"); result = false;}
return result;
}
void GammaData::ClearEvent()
{
GammaEnergy.clear();
// GammaTheta.clear();
// GammaPhi.clear();
GammaTime.clear();
GammaDetectorType.clear();
GammaDetectorLabel.clear();
GammaDetectorSegm.clear();
GammaRawADC.clear();
GammaADCChannel.clear();
GammaTDCChannel.clear();
GammaTDCMultiplicity.clear();
}
unsigned int GammaData::SizeOfEvent()
{
unsigned int result = GammaEnergy.size();
return result;
}