1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | #include <iostream> |
9 | #include <iomanip> |
10 | using namespace std; |
11 | |
12 | #include "DNeutralShower_factory.h" |
13 | using namespace jana; |
14 | |
15 | |
16 | |
17 | |
18 | jerror_t DNeutralShower_factory::init(void) |
19 | { |
20 | |
21 | USE_KLOE = 1; |
22 | gPARMS->SetDefaultParameter("BCALRECON:USE_KLOE", USE_KLOE); |
23 | |
24 | |
25 | if(USE_KLOE){ |
26 | cout << "Using KLOE BCAL clustering." << endl; |
27 | } |
28 | else{ |
29 | cout << "Using alternative (experimental) BCAL clustering." << endl; |
30 | } |
31 | |
32 | return NOERROR; |
33 | } |
34 | |
35 | |
36 | |
37 | |
38 | jerror_t DNeutralShower_factory::brun(jana::JEventLoop *locEventLoop, int runnumber) |
39 | { |
40 | return NOERROR; |
41 | } |
42 | |
43 | |
44 | |
45 | |
46 | jerror_t DNeutralShower_factory::evnt(jana::JEventLoop *locEventLoop, int eventnumber) |
47 | { |
48 | const DChargedTrackHypothesis* locChargedTrackHypothesis; |
49 | const DBCALShower *locBCALShower; |
50 | const DFCALShower *locFCALShower; |
51 | DNeutralShower *locNeutralShower; |
52 | vector<const DBCALShower*> locAssociatedBCALShowers; |
53 | vector<const DFCALShower*> locAssociatedFCALShowers; |
54 | vector<const DChargedTrackHypothesis*> locAssociatedChargedTrackHypotheses; |
55 | bool locShowerMatchedToTrackFlag; |
56 | |
57 | vector<const DChargedTrackHypothesis*> locChargedTrackHypotheses; |
58 | vector<const DBCALShower*> locBCALShowers; |
59 | vector<const DFCALShower*> locFCALShowers; |
60 | locEventLoop->Get(locChargedTrackHypotheses); |
61 | if (USE_KLOE) { |
| |
62 | locEventLoop->Get(locBCALShowers, "KLOE"); |
63 | } else { |
64 | locEventLoop->Get(locBCALShowers); |
65 | } |
66 | locEventLoop->Get(locFCALShowers); |
67 | |
68 | |
69 | |
70 | |
71 | for(unsigned int loc_i = 0; loc_i < locBCALShowers.size(); ++loc_i){ |
| 2 | | Loop condition is false. Execution continues on line 98 | |
|
72 | locBCALShower = locBCALShowers[loc_i]; |
73 | locShowerMatchedToTrackFlag = false; |
74 | for(unsigned int loc_j = 0; loc_j < locChargedTrackHypotheses.size(); ++loc_j){ |
75 | locChargedTrackHypothesis = locChargedTrackHypotheses[loc_j]; |
76 | locChargedTrackHypothesis->GetT(locAssociatedBCALShowers); |
77 | for(unsigned int loc_k = 0; loc_k < locAssociatedBCALShowers.size(); ++loc_k){ |
78 | if(locBCALShower == locAssociatedBCALShowers[loc_k]){ |
79 | locShowerMatchedToTrackFlag = true; |
80 | break; |
81 | } |
82 | } |
83 | if(locShowerMatchedToTrackFlag) |
84 | break; |
85 | } |
86 | if(locShowerMatchedToTrackFlag) |
87 | continue; |
88 | |
89 | |
90 | locNeutralShower = new DNeutralShower(locBCALShower); |
91 | locNeutralShower->AddAssociatedObject(locBCALShower); |
92 | _data.push_back(locNeutralShower); |
93 | } |
94 | |
95 | |
96 | |
97 | |
98 | for(unsigned int loc_i = 0; loc_i < locFCALShowers.size(); ++loc_i){ |
| 3 | | Loop condition is true. Entering loop body | |
|
| 6 | | Loop condition is true. Entering loop body | |
|
| 9 | | Loop condition is true. Entering loop body | |
|
| 12 | | Loop condition is true. Entering loop body | |
|
99 | locFCALShower = locFCALShowers[loc_i]; |
100 | locShowerMatchedToTrackFlag = false; |
101 | for(unsigned int loc_j = 0; loc_j < locChargedTrackHypotheses.size(); ++loc_j){ |
| 4 | | Loop condition is false. Execution continues on line 113 | |
|
| 7 | | Loop condition is false. Execution continues on line 113 | |
|
| 10 | | Loop condition is false. Execution continues on line 113 | |
|
| 13 | | Loop condition is true. Entering loop body | |
|
102 | locChargedTrackHypothesis = locChargedTrackHypotheses[loc_j]; |
103 | locChargedTrackHypothesis->GetT(locAssociatedFCALShowers); |
104 | for(unsigned int loc_k = 0; loc_k < locAssociatedFCALShowers.size(); ++loc_k){ |
| 14 | | Loop condition is true. Entering loop body | |
|
105 | if(locFCALShower == locAssociatedFCALShowers[loc_k]){ |
| 15 | | Dereference of null pointer |
|
106 | locShowerMatchedToTrackFlag = true; |
107 | break; |
108 | } |
109 | } |
110 | if(locShowerMatchedToTrackFlag) |
111 | break; |
112 | } |
113 | if(locShowerMatchedToTrackFlag) |
| |
| |
| |
114 | continue; |
115 | |
116 | |
117 | locNeutralShower = new DNeutralShower(locFCALShower); |
118 | locNeutralShower->AddAssociatedObject(locFCALShower); |
119 | _data.push_back(locNeutralShower); |
120 | } |
121 | |
122 | return NOERROR; |
123 | } |
124 | |
125 | |
126 | |
127 | |
128 | jerror_t DNeutralShower_factory::erun(void) |
129 | { |
130 | return NOERROR; |
131 | } |
132 | |
133 | |
134 | |
135 | |
136 | jerror_t DNeutralShower_factory::fini(void) |
137 | { |
138 | return NOERROR; |
139 | } |
140 | |
141 | |