]>
Commit | Line | Data |
---|---|---|
48b962f0 | 1 | |
2 | #include "AliHLTPHOSDigitContainerStruct.h" | |
3 | #include "AliHLTPHOSRecPointContainerStruct.h" | |
4 | #include "AliPHOSDigit.h" | |
5 | #include "AliPHOSGetter.h" | |
6 | #include "AliHLTPHOSClusterizer.h" | |
7 | #include "AliPHOSReconstructor.h" | |
8 | #include "AliPHOSGeometry.h" | |
9 | #include "TH2I.h" | |
10 | #include "TFile.h" | |
11 | ||
12 | Int_t clusterTest(); | |
13 | ||
14 | int main() | |
15 | { | |
16 | clusterTest(); | |
17 | return 0; | |
18 | } | |
19 | ||
20 | Int_t clusterTest() | |
21 | { | |
22 | ||
23 | AliHLTPHOSDigitContainerStruct *digCon = new AliHLTPHOSDigitContainerStruct(); | |
24 | ||
25 | AliHLTPHOSRecPointContainerStruct *recCon = new AliHLTPHOSRecPointContainerStruct(); | |
26 | AliHLTPHOSClusterizer *clusterizer = new AliHLTPHOSClusterizer(); | |
27 | ||
28 | AliPHOSDigit * offDig = 0; | |
29 | int nClusters = 0; | |
30 | float energy = 0; | |
31 | float time = 0; | |
32 | Int_t coord[4]; | |
33 | int a = 0; | |
34 | ||
35 | clock_t start = 0; | |
36 | clock_t end = 0; | |
37 | clock_t total = 0; | |
38 | ||
39 | AliPHOSGeometry *geometry = AliPHOSGeometry::GetInstance(); | |
40 | ||
41 | TH2F *hist = new TH2F("hist", "hist", 56, 1, 56, 64, 2, 65); | |
42 | TFile *outfile = new TFile("histogram.root","recreate"); | |
43 | ||
44 | AliPHOSGetter *getter = AliPHOSGetter::Instance("/home/odjuvsla/Workspace/Simulations/test4/galice.root"); | |
45 | TClonesArray* digs = getter->Digits(); | |
46 | ||
47 | clusterizer->SetOfflineMode("/home/odjuvsla/Workspace/Simulations/test4/galice.root"); | |
48 | clusterizer->SetRecPointContainer(recCon); | |
49 | ||
50 | while(a < 5000) | |
51 | { | |
52 | for(int k = 0; k < getter->MaxEvent(); k++) | |
53 | { | |
54 | ||
55 | //getter->Event(k,"D"); | |
56 | //digCon->fNDigits = digs->GetEntries(); | |
57 | ||
58 | clusterizer->GetEvent(k); | |
59 | ||
60 | /* for(int i = 0; i < digs->GetEntries(); i++) | |
61 | { | |
62 | offDig = (AliPHOSDigit*)digs->At(i); | |
63 | digCon->fDigitDataStruct[i].fID = offDig->GetId(); | |
64 | digCon->fDigitDataStruct[i].fEnergy = offDig->GetEnergy(); | |
65 | digCon->fDigitDataStruct[i].fTime = offDig->GetTime(); | |
66 | hist->Fill(coord[3], coord[2], offDig->GetEnergy()); | |
67 | } | |
68 | ||
69 | ||
70 | outfile->Open("histogram.root", "recreate"); | |
71 | hist->Write(); | |
72 | outfile->Close("histogram.root"); | |
73 | ||
74 | */ | |
75 | ||
76 | start = clock(); | |
77 | clusterizer->SetDigitContainer(digCon); | |
78 | nClusters = clusterizer->ClusterizeEvent(); | |
79 | clusterizer->CalculateCenterOfGravity(); | |
80 | end = clock(); | |
81 | ||
82 | total += end - start; | |
83 | /* | |
84 | printf("Event #: %d\n", k); | |
85 | printf("Number of clusters found: ", nClusters); | |
86 | ||
87 | for(int m = 0; m < nClusters; m++) | |
88 | { | |
89 | energy = 0; | |
90 | for (int n = 0; n < recCon->fRecPointArray[m].fMultiplicity; n++) | |
91 | { | |
92 | energy += recCon->fRecPointArray[m].fDigitsList[n].fEnergy; | |
93 | } | |
94 | printf("Clusters:\n"); | |
95 | printf("Cluster energy: %f\n", energy); | |
96 | printf("Cluster position: x = %f -- z = %f\n", recCon->fRecPointArray[m].fX, recCon->fRecPointArray[m].fZ); | |
97 | printf("Digit multiplicity: %d\n", recCon->fRecPointArray[m].fMultiplicity); | |
98 | } | |
99 | */ | |
100 | } | |
101 | a++; | |
102 | } | |
103 | printf("Clusterizing done!\n"); | |
104 | ||
105 | printf("Time pr event (us): %f\n", (float)total/((float)getter->MaxEvent()*(float)a)); | |
106 | ||
107 | return 0; | |
108 | } | |
109 | ||
110 |