1 #include "trg/cdc/modules/trgcdc/CDCTriggerTrackCombinerModule.h"
3 #include <framework/datastore/RelationVector.h>
12 CDCTriggerTrackCombinerModule::CDCTriggerTrackCombinerModule() :
Module::
Module()
15 "The combiner module of the CDC trigger.\n"
16 "Takes tracks from the various trigger stages (finder, fitter, neuro) "
17 "and combines them to a single track list. "
18 "The 2D track parameters are taken from the fitter, if present. "
19 "For the 3D track parameters there are different options (see parameters). "
20 "Combined tracks are not produced for tracks without 3D information "
21 "from either 3D fitter or neuro.\n"
25 "Name of the 2D finder track list.",
26 string(
"TRGCDC2DFinderTracks"));
28 "Name of the 2D fitter track list.",
29 string(
"TRGCDC2DFitterTracks"));
31 "Name of the 3D fitter track list.",
32 string(
"TRGCDC3DFitterTracks"));
34 "Name of the neuro track list.",
35 string(
"TRGCDCNeuroTracks"));
37 "Name of the output track list for the combined tracks.",
38 string(
"TRGCDCTracks"));
40 "Name of track segment hit list, needed for hit relations.",
43 "Select how to define cot(theta). Valid options are "
44 "3Dfitter (use 3Dfitter if present, otherwise neuro), "
45 "neuro (use neuro if present, otherwise 3Dfitter) or "
46 "avg (average 3Dfitter and neuro).",
49 "Select how to define z0. Valid options are "
50 "3Dfitter (use 3Dfitter if present, otherwise neuro), "
51 "neuro (use neuro if present, otherwise 3Dfitter), "
52 "avg (average 3Dfitter and neuro), "
53 "min (smaller |z0| of 3Dfitter and neuro) or "
54 "max (larger |z0| of 3Dfitter and neuro).",
89 if (!track3Dfitter && !trackNeuro) {
90 B2DEBUG(100,
"skip track without 3D parameters");
95 CDCTriggerTrack* track2D = (track2Dfitter) ? track2Dfitter : track2Dfinder;
101 bool usedFit =
false;
104 if (!track3Dfitter) {
105 B2DEBUG(100,
"no 3D fitter results, use neuro results");
106 z = trackNeuro->getZ0();
107 cotTheta = trackNeuro->getCotTheta();
110 }
else if (!trackNeuro) {
111 B2DEBUG(100,
"no neuro results, use 3D fitter results");
112 z = track3Dfitter->getZ0();
113 cotTheta = track3Dfitter->getCotTheta();
114 chi3D = track3Dfitter->getCotTheta();
117 B2DEBUG(100,
"combine 3D fitter and neuro results");
120 z = track3Dfitter->getZ0();
123 z = trackNeuro->getZ0();
126 z = (track3Dfitter->getZ0() + trackNeuro->getZ0()) / 2.;
130 z = (abs(track3Dfitter->getZ0()) < abs(trackNeuro->getZ0()))
131 ? track3Dfitter->getZ0()
132 : trackNeuro->getZ0();
136 z = (abs(track3Dfitter->getZ0()) > abs(trackNeuro->getZ0()))
137 ? track3Dfitter->getZ0()
138 : trackNeuro->getZ0();
143 <<
" (choose one of 3Dfitter, neuro, avg, min, max)");
147 cotTheta = track3Dfitter->getCotTheta();
150 cotTheta = trackNeuro->getCotTheta();
153 cotTheta = (track3Dfitter->getCotTheta() + trackNeuro->getCotTheta()) / 2.;
158 <<
" (choose one of 3Dfitter, neuro, avg)");
162 chi3D = track3Dfitter->getChi3D();
169 track2Dfinder->addRelationTo(combinedTrack);
174 combinedTrack->addRelationTo(&hit);
175 usedHit[hit.getArrayIndex()] =
true;
180 if (!usedHit[hit.getArrayIndex()]) {
181 combinedTrack->addRelationTo(&hit);
182 usedHit[hit.getArrayIndex()] =
true;
186 if (track3Dfitter && usedFit) {
189 if (!usedHit[hit.getArrayIndex()]) {
190 combinedTrack->addRelationTo(&hit);
191 usedHit[hit.getArrayIndex()] =
true;
195 if (trackNeuro && usedNN) {
198 if (!usedHit[hit.getArrayIndex()]) {
199 combinedTrack->addRelationTo(&hit);
200 usedHit[hit.getArrayIndex()] =
true;