CPionTrackingStrategy.h
//-----------------------------------------------------------------------------
// $Header: /tmp_mnt/asis/offline/ceres/cool/project/RCS/CPionTrackingStrategy.h,v 1.3 1997/04/25 15:05:34 messer Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Declaration of class CPionTrackingStrategy.
//
// Creates external tracks according to the hits/rings of the detectors passed
// as arguments. Every track has always all the matches(s1,s2,r2,r2,pc).
//
// NOTE:
// getTracks copies tracks/segments according to a bitwise OR of
// one or several CTrackMask masks. The result is filled
// into the given track list.
// Note, that it is the users responsibility to handle the
// memory allocated by the obtained tracks.
// 'getTracks' creates a deep copy not a shallow one.
// example:
// strategy.getTracks(trackList, hasVertex|hasRich2Match);
//
// The meaning of the bit mask:
// There are 3 pools of tracking information: RICH tracks, SiDC
// tracks and tracks consisting of matching segments. The bits
// 'hasVertex, hasSidc1Match, hasSidc2Match' refer to Sidc tracks
// 'hasRich1Match, hasRich2Match' to RICH tracks. If only bits of
// one kind are requested the referring segment pool is inspected.
// The returned list will contain all segments which at least have
// the requested bit(s) set. E.g., if you ask for
// 'hasVertex|hasSidc2Match' there may well be segments with the
// hasSidc1Match bit set. However, if a bit mask contains bits
// referring to RICH and SIDC only matching segments (real tracks) are
// returned, resolving at least the given bit pattern.
//
//-----------------------------------------------------------------------------
#ifndef CPIONTRACKINGSTRATEGY_H
#define CPIONTRACKINGSTRATEGY_H
#include <rw/tpordvec.h>
#include "cool.h"
#include "CSidcTrackingStrategy.h"
#include "CRingFitter.h"
template <class T> class CList;
template <class T> class CSortedList;
class CTrack;
class CSidc1;
class CSidc2;
class CPadChamber;
class CRich1;
class CRich2;
class CPionTrackingStrategy : public CSidcTrackingStrategy {
public:
CPionTrackingStrategy(CVertex*, CSidc*, CSidc*, CRich1*, CRich2*, CPadChamber*, const char* = 0);
~CPionTrackingStrategy();
CBoolean makeTracks();
CBoolean getTracks(CSortedList<CTrack>&, unsigned long);
void setRich1(CRich1* ptr) {rich1 = ptr;}
void setRich2(CRich2* ptr) {rich2 = ptr;}
void setPadChamber(CPadChamber* ptr) {padChamber = ptr;}
protected:
CBoolean makeRichTracksAndLinkToSidcPadTracks();
CBoolean makePadChamberSidcTracks();
CBoolean calculateNumberOfHits(CRich*, CFittedRing*);
int returnIndexOfMaxVector();
CTrack* findBestPadCMatch(CTrack*, CPadCPadCoord, double, CAngle);
CTrack* isTrueTrack(CFittedRing*, CFittedRing*, CTrack*);
CRingCandidate* searchForCandidate(CRich*, CTrack*);
CFittedRing* makePionFreeRadiusFit(CRich*, CRingCandidate*);
protected:
const CRich1* rich1;
const CRich2* rich2;
const CPadChamber* padChamber;
int numberOfHits;
CRingFitter fit;
RWTValVector<int> radiusVector;
RWTValVector<double> xCoord;
RWTValVector<double> yCoord;
RWTValVector<int> binPos;
CList<CTrack> *richTracks; // analog to RichSegment
CSortedList<CTrack> *sidcPadTracks; // sidc-pad tracks
CSortedList<CTrack> *tracks; // final tracks
};
#endif /* CPIONTRACKINGSTRATEGY_H */