13#ifndef TRGCDCLink_FLAG_
14#define TRGCDCLink_FLAG_
18#include "CLHEP/Geometry/Point3D.h"
19#include "trg/cdc/Cell.h"
20#include "trg/cdc/CellHit.h"
22#ifdef TRGCDC_SHORT_NAMES
23#define TCLink TRGCDCLink
58 static void*
operator new (size_t);
61 static void operator delete (
void*);
81 double pull(
void)
const;
93 double dPhi(
void)
const;
163 float drift(
void)
const;
166 float drift(
unsigned)
const;
169 float drift(
float,
unsigned);
175 float dDrift(
unsigned)
const;
178 float dDrift(
float,
unsigned);
183 void dump(
const std::string& message = std::string(
""),
184 const std::string& prefix = std::string(
""))
const;
189 static void separate(
const std::vector<TRGCDCLink*>& links,
191 std::vector<TRGCDCLink*>* layers);
197 const std::vector<TRGCDCLink*>& links);
200 static unsigned nSuperLayers(
const std::vector<TRGCDCLink*>& links);
203 static unsigned nSuperLayers(
const std::vector<TRGCDCLink*>& links,
209 const std::vector<TRGCDCLink*>& links);
213 const std::vector<TRGCDCLink*>& links);
216 static unsigned nLayers(
const std::vector<TRGCDCLink*>& links);
219 static void nHits(
const std::vector<TRGCDCLink*>& links,
228 std::vector<TRGCDCLink*>* list);
231 static std::vector<TRGCDCLink*>
axialHits(
232 const std::vector<TRGCDCLink*>& links);
236 const std::vector<TRGCDCLink*>& links);
239 static unsigned nAxialHits(
const std::vector<TRGCDCLink*>& links);
242 static unsigned nStereoHits(
const std::vector<TRGCDCLink*>& links);
247 static unsigned width(
const std::vector<TRGCDCLink*>&);
251 static std::vector<TRGCDCLink*>
edges(
const std::vector<TRGCDCLink*>&);
254 static std::vector<TRGCDCLink*>
sameLayer(
255 const std::vector<TRGCDCLink*>& list,
259 static std::vector<TRGCDCLink*>
sameLayer(
260 const std::vector<TRGCDCLink*>& list,
265 const std::vector<TRGCDCLink*>& list,
270 const std::vector<TRGCDCLink*>& list,
274 static unsigned superLayer(
const std::vector<TRGCDCLink*>& list);
277 static unsigned superLayer(
const std::vector<TRGCDCLink*>& list,
289 static std::vector<TRGCDCLink*>
inOut(
const std::vector<TRGCDCLink*>&);
292 static void separateCores(
const std::vector<TRGCDCLink*>& input,
293 std::vector<TRGCDCLink*>&
cores,
294 std::vector<TRGCDCLink*>& nonCores);
297 static std::vector<TRGCDCLink*>
cores(
298 const std::vector<TRGCDCLink*>& input);
301 static void remove(std::vector<TRGCDCLink*>& list,
302 const std::vector<TRGCDCLink*>& links);
305 static void dump(
const std::vector<const TRGCDCLink*>& links,
306 const std::string& message = std::string(
""),
307 const std::string& prefix = std::string(
""));
310 static void dump(
const std::vector<TRGCDCLink*>& links,
311 const std::string& message = std::string(
""),
312 const std::string& prefix = std::string(
""));
316 const std::string& message = std::string(
""),
317 const std::string& prefix = std::string(
""));
320 static std::string
layerUsage(
const std::vector<TRGCDCLink*>& links);
342 void dump_base(
const std::string& message = std::string(
""),
343 const std::string& prefix = std::string(
""))
const;
348 static std::vector<TRGCDCLink*>
_all;
408 static unsigned nTRGCDCLinks(
void);
409 static unsigned nTRGCDCLinksMax(
void);
411 static unsigned _nTRGCDCLinks;
412 static unsigned _nTRGCDCLinksMax;
A class to represent a wire hit in CDC.
A class to represent a wire in CDC.
A class to relate TRGCDCCellHit and TRGCDCTrack objects.
HepGeom::Point3D< double > _arcZ[4]
arcZ
HepGeom::Point3D< double > _onTrack
position on track
const TRGCDCSegment * segment(void) const
returns a pointer to a track segment.
int _zStatus
z status of stereo
TRGCDCLink * _link
TRGCDCLink.
const TRGCDCCellHit * _hit
Cell hit object.
unsigned _fit2D
2D fitted or not
TRGCDCTrack * _track
Track object.
static unsigned nMissingStereoSuperLayers(const std::vector< TRGCDCLink * > &links)
returns # of missing stereo super layers.
HepGeom::Point3D< double > _conf
...tmp...
HepGeom::Point3D< double > _position
position
HepGeom::Point3D< double > _onWire
position on wire
float _drift[2]
drift distance
TRGCDCLink * _neighbor[7]
neighbor TRGCDCLink
float _dDrift[2]
drift distance error
unsigned _leftRight
left right
A class to represent a wire in CDC.
A class to represent a GEN_HEPEVT particle in tracking.
A class to represent a reconstructed charged track in TRGCDC.
A class to represent a wire in CDC.
The instance of TRGCDC is a singleton.
const TRGCDCWire * wire(void) const
returns a pointer to a wire.
float drift(void) const
returns drift distance.
static std::vector< TRGCDCLink * > sameLayer(const std::vector< TRGCDCLink * > &list, const TRGCDCLink &a)
returns links which are in the same layer as 'a' or 'id'.
static const TRGCDCTrackMC & links2HEP(const std::vector< TRGCDCLink * > &links)
returns TRGCDCTrackMC
HepGeom::Point3D< double > Point3D
3D point
virtual const TRGCDCCell & cell(void) const
returns a pointer to a TRGCDCWire.
virtual ~TRGCDCLink()
Destructor.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
const TRGCDCCell * cell(void) const
returns a pointer to a cell.
float dDrift(void) const
returns drift distance error.
static std::vector< TRGCDCLink * > inOut(const std::vector< TRGCDCLink * > &)
returns links which are in the inner most and outer most layer.
static std::vector< TRGCDCLink * > edges(const std::vector< TRGCDCLink * > &)
returns links which are edges.
static TRGCDCLink * outerMost(const std::vector< TRGCDCLink * > &links)
returns the outer-most link.
const HepGeom::Point3D< double > & position(void) const
returns position.
static unsigned width(const std::vector< TRGCDCLink * > &)
returns width(wire cell unit) of given std::vector<TRGCDCLink *>.
TRGCDCTrack * track(void) const
returns a pointer to a track.
static TRGCDCLink * innerMost(const std::vector< TRGCDCLink * > &links)
returns the inner-most link.
static std::vector< TRGCDCLink * > sameSuperLayer(const std::vector< TRGCDCLink * > &list, const TRGCDCLink &a)
returns links which are in the same super layer as 'a' or 'id'.
const HepGeom::Point3D< double > & positionOnTrack(void) const
returns the closest point on track to wire.
static unsigned superLayer(const std::vector< TRGCDCLink * > &list)
returns super layer pattern.
double distance(void) const
returns distance between point on wire and on track.
static void clearBufferSL(void)
clear buffers
const TRGCDCCellHit * hit(void) const
returns a pointer to a hit.
static int sortByX(const TRGCDCLink *a, const TRGCDCLink *b)
sorts by X position.
static unsigned _nSL
...Buffers...
static void separateCores(const std::vector< TRGCDCLink * > &input, std::vector< TRGCDCLink * > &cores, std::vector< TRGCDCLink * > &nonCores)
separate cores and non-cores.
static bool sortById(const TRGCDCLink *a, const TRGCDCLink *b)
sorts by ID.
const HepGeom::Point3D< double > & positionOnWire(void) const
returns the closest point on wire to a track.
static unsigned nMissingAxialSuperLayers(const std::vector< TRGCDCLink * > &links)
returns # of missing axial super layers.
static void removeAll(void)
destructs all TRGCDCLink objects. (Called by TRGCDC)
static std::vector< TRGCDCLink * > _all
Keeps all TRGCDCLinks created by new().
TRGCDCLink * link(void) const
returns a pointer to a TRGCDCLink.
TRGCDCLink * neighbor(unsigned n) const
returns neighbor TRGCDCLink.
static void remove(std::vector< TRGCDCLink * > &list, const std::vector< TRGCDCLink * > &links)
removes links from list if wire is same
static bool ms_superb
ms_superb
double dPhi(void) const
returns dPhi to the closest point.
static unsigned nSuperLayers(const std::vector< TRGCDCLink * > &links)
returns # of layers.
void update(const HepGeom::Point3D< double > &onTrack, const HepGeom::Point3D< double > &onWire, unsigned leftRight, double pull)
sets results of fitting.
static void nHits(const std::vector< TRGCDCLink * > &links, unsigned *nHits)
returns # of hits per layer.
static std::vector< TRGCDCLink * > stereoHits(const std::vector< TRGCDCLink * > &links)
returns stereo hits.
double pull(void) const
returns pull.
const HepGeom::Point3D< double > & xyPosition(void) const
returns middle position of a wire. z componet is 0.
static std::vector< TRGCDCLink * > axialHits(const std::vector< TRGCDCLink * > &links)
returns axial hits.
void dump_base(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
static std::string layerUsage(const std::vector< TRGCDCLink * > &links)
usage of each layer
static unsigned nLayers(const std::vector< TRGCDCLink * > &links)
returns # of layers.
static bool ms_smallcell
ms_smallcell
static std::vector< TRGCDCLink * > cores(const std::vector< TRGCDCLink * > &input)
separate cores and non-cores.
static void initializeBuffers(void)
initialize the Buffers
const HepGeom::Point3D< double > & conf(const HepGeom::Point3D< double > &conf)
conf 3D point
static unsigned nAxialHits(const std::vector< TRGCDCLink * > &links)
returns # of axial hits.
unsigned leftRight(void) const
returns left-right. 0:left, 1:right, 2:wire
static unsigned _nL
...Buffers...
static unsigned * _nHitsSL
...Buffers...
static unsigned nStereoHits(const std::vector< TRGCDCLink * > &links)
returns # of stereo hits.
static void nHitsSuperLayer(const std::vector< TRGCDCLink * > &links, unsigned *nHits)
returns # of hits per super layer.
static void separate(const std::vector< TRGCDCLink * > &links, unsigned nLayers, std::vector< TRGCDCLink * > *layers)
separates into layers.
static unsigned _nSLA
...Buffers...
Abstract base class for different kinds of events.