14 #define TRGCDC_SHORT_NAMES
16 #include "trg/trg/Debug.h"
17 #include "trg/cdc/TRGCDC.h"
18 #include "trg/cdc/TrackBase.h"
19 #include "trg/cdc/Wire.h"
20 #include "trg/cdc/Link.h"
21 #include "trg/cdc/Fitter.h"
22 #include "trg/cdc/Relation.h"
33 : _name(
"CopyOf" + t._name),
41 m_trackID(t.m_trackID)
43 _ts =
new vector<TCLink*>[
_nTs];
44 for (
unsigned i = 0; i <
_nTs; i++)
45 _ts[i].assign(t._ts[i].begin(), t._ts[i].end());
53 _nTs(
TRGCDC::getTRGCDC()->nSuperLayers()),
58 _ts =
new vector<TCLink*>[
_nTs];
71 cout << tab <<
"Dump of " <<
name() << endl;
74 cout << tab <<
"status=" <<
status() <<
":p=" <<
p() <<
":x=" <<
x()
77 for (
unsigned i = 0; i <
_nTs; i++) {
78 cout << i <<
":" <<
_ts[i].size();
79 for (
unsigned j = 0; j <
_ts[i].size(); j++) {
84 const TCLink& l = *
_ts[i][j];
85 cout << l.cell()->name();
103 cout <<
"TRGCDCTrackBase !!! no fitter available" << endl;
111 _ts[a->cell()->superLayerId()].push_back(a);
118 for (
unsigned i = 0; i <
links.size(); i++) {
123 const std::vector<TCLink*>&
129 const std::vector<TCLink*>&
138 cout <<
"TRGCDCTrackBase::approach2D !!! not implemented" << endl;
148 map<unsigned, unsigned> relations;
149 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
151 const TCCell& cell = *
_tsAll[i]->cell();
152 const TCCHit& hit = * cell.hit();
153 const unsigned iMCParticle = hit.iMCParticle();
155 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
156 if (it != relations.end())
159 relations[iMCParticle] = 1;
163 << iMCParticle << endl;
168 map<unsigned, unsigned>::const_iterator it = relations.begin();
169 while (it != relations.end()) {
172 << it->second << endl;
179 return TCRelation(*
this, relations);
188 map<unsigned, unsigned> relations;
189 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
192 const TCCell& cell = *
_tsAll[i]->cell();
195 if (cell.superLayerId() % 2 == 1)
continue;
197 const TCCHit& hit = * cell.hit();
198 const unsigned iMCParticle = hit.iMCParticle();
200 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
201 if (it != relations.end())
204 relations[iMCParticle] = 1;
208 << iMCParticle << endl;
213 map<unsigned, unsigned>::const_iterator it = relations.begin();
214 while (it != relations.end()) {
217 << it->second << endl;
224 return TCRelation(*
this, relations);
238 map<unsigned, unsigned> relations;
239 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
241 const TCCell& cell = *
_tsAll[i]->cell();
244 if (cell.superLayerId() % 2 == 0)
continue;
246 const TCCHit& hit = * cell.hit();
247 const unsigned iMCParticle = hit.iMCParticle();
249 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
250 if (it != relations.end())
253 relations[iMCParticle] = 1;
257 << iMCParticle << endl;
262 map<unsigned, unsigned>::const_iterator it = relations.begin();
263 while (it != relations.end()) {
266 << it->second << endl;
273 return TCRelation(*
this, relations);