13#define TRGCDC_SHORT_NAMES
15#include "trg/trg/Debug.h"
16#include "trg/cdc/TRGCDC.h"
17#include "trg/cdc/TrackBase.h"
18#include "trg/cdc/Wire.h"
19#include "trg/cdc/Link.h"
20#include "trg/cdc/Fitter.h"
21#include "trg/cdc/Relation.h"
32 : _name(
"CopyOf" + t._name),
40 m_trackID(t.m_trackID)
42 _ts =
new vector<TCLink*>[
_nTs];
43 for (
unsigned i = 0; i <
_nTs; i++)
44 _ts[i].assign(t._ts[i].begin(), t._ts[i].end());
52 _nTs(
TRGCDC::getTRGCDC()->nSuperLayers()),
57 _ts =
new vector<TCLink*>[
_nTs];
70 cout << tab <<
"Dump of " <<
name() << endl;
73 cout << tab <<
"status=" <<
status() <<
":p=" <<
p() <<
":x=" <<
x()
76 for (
unsigned i = 0; i <
_nTs; i++) {
77 cout << i <<
":" <<
_ts[i].size();
78 for (
unsigned j = 0; j <
_ts[i].size(); j++) {
83 const TCLink& l = *
_ts[i][j];
84 cout << l.cell()->name();
102 cout <<
"TRGCDCTrackBase !!! no fitter available" << endl;
110 _ts[a->cell()->superLayerId()].push_back(a);
117 for (
unsigned i = 0; i <
links.size(); i++) {
122 const std::vector<TCLink*>&
128 const std::vector<TCLink*>&
137 cout <<
"TRGCDCTrackBase::approach2D !!! not implemented" << endl;
147 map<unsigned, unsigned> relations;
148 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
150 const TCCell& cell = *
_tsAll[i]->cell();
151 const TCCHit& hit = * cell.hit();
152 const unsigned iMCParticle = hit.iMCParticle();
154 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
155 if (it != relations.end())
158 relations[iMCParticle] = 1;
162 << iMCParticle << endl;
167 map<unsigned, unsigned>::const_iterator it = relations.begin();
168 while (it != relations.end()) {
171 << it->second << endl;
178 return TCRelation(*
this, relations);
187 map<unsigned, unsigned> relations;
188 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
191 const TCCell& cell = *
_tsAll[i]->cell();
194 if (cell.superLayerId() % 2 == 1)
continue;
196 const TCCHit& hit = * cell.hit();
197 const unsigned iMCParticle = hit.iMCParticle();
199 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
200 if (it != relations.end())
203 relations[iMCParticle] = 1;
207 << iMCParticle << endl;
212 map<unsigned, unsigned>::const_iterator it = relations.begin();
213 while (it != relations.end()) {
216 << it->second << endl;
223 return TCRelation(*
this, relations);
237 map<unsigned, unsigned> relations;
238 for (
unsigned i = 0; i <
_tsAll.size(); i++) {
240 const TCCell& cell = *
_tsAll[i]->cell();
243 if (cell.superLayerId() % 2 == 0)
continue;
245 const TCCHit& hit = * cell.hit();
246 const unsigned iMCParticle = hit.iMCParticle();
248 map<unsigned, unsigned>::iterator it = relations.find(iMCParticle);
249 if (it != relations.end())
252 relations[iMCParticle] = 1;
256 << iMCParticle << endl;
261 map<unsigned, unsigned>::const_iterator it = relations.begin();
262 while (it != relations.end()) {
265 << it->second << endl;
272 return TCRelation(*
this, relations);
virtual int fit(TRGCDCTrackBase &) const =0
Fit functions.
A class to relate TRGCDCCellHit and TRGCDCTrack objects.
A class to represent a wire in CDC.
A class to represent a track object in TRGCDC.
std::vector< TRGCDCLink * > _tsAll
Links for all super layers.
const unsigned _nTs
Size of _ts.
std::vector< TRGCDCLink * > * _ts
Links for each super layer.
const TRGCDCFitter * _fitter
Fitter.
The instance of TRGCDC is a singleton.
const TRGCDCRelation relation(void) const
returns MC information.
static std::string tab(void)
returns tab spaces.
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
const TRGCDCRelation relation3D(void) const
returns MC information for only stereo layers.
static void enterStage(const std::string &stageName)
Declare that you enter new stage.
int status(void) const
returns status.
const TRGCDCRelation relation2D(void) const
returns MC information for only axial layers.
virtual int fit(void)
fits itself by a default fitter. Error was happened if return value is not zero.
TRGCDCTrackBase(const TRGCDCTrackBase &)
Copy constructor.
std::string name(void) const
returns name.
static int level(void)
returns the debug level.
static void leaveStage(const std::string &stageName)
Declare that you leave a stage.
virtual int approach2D(TRGCDCLink &) const
calculate closest approach. Error was happened if return value is not zero.
virtual const CLHEP::Hep3Vector & p(void) const
returns momentum vector.
const std::vector< TRGCDCLink * > & links(void) const
returns a vector to track segments.
virtual const CLHEP::Hep3Vector & x(void) const
returns position vector.
virtual ~TRGCDCTrackBase()
Destructor.
void append(TRGCDCLink *)
appends a link.
Abstract base class for different kinds of events.