BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkExpectedHotSet.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkExpectedHotSet.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Class TrkExpectedHotSet, stores information about projected location
7// of Tracks
8//
9// Environment:
10// Software developed for B Factory.
11//
12// Author List:
13// Eric A Charles UW-Madison
14//
15//------------------------------------------------------------------------
16
17//----------------
18// BaBar header
19//----------------
20// #include "BaBar/BaBar.hh"
21
22//-----------------------
23// This Class's Header --
24//-----------------------
25#include "TrkBase/TrkExpectedHotSet.h"
26
27//-------------
28// C Headers --
29//-------------
30extern "C" {}
31
32//---------------
33// C++ Headers --
34//---------------
35
36//-------------------------------
37// Collaborating Class Headers --
38//-------------------------------
39
40#include "TrkBase/TrkExpectedHot.h"
41#include "TrkBase/TrkFitTypeKey.h"
42using std::endl;
43using std::ostream;
44
45//----------------------------------------------------------------------
46// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
47//-----------------------------------------------------------------------
48
49// -----------------------------------------------
50// -- Static Data & Function Member Definitions --
51// -----------------------------------------------
52
53// ----------------------------------------
54// -- Public Function Member Definitions --
55// ----------------------------------------
56
57//----------------
58// Constructors --
59//----------------
60
62 : _elemId( elemId ), _nFit( -1 ), _fitTypeMap( maxFits, -1 ), _exTrk( 0 ) {}
63
64//--------------
65// Destructor --
66//--------------
67
69 // owns the exHost
70 const int iEx = _theHots.size();
71 for ( int iKill( 0 ); iKill < iEx; ++iKill )
72 {
73 TrkExpectedHot* exHot = _theHots[iKill];
74 delete exHot;
75 }
76}
77
78//-------------
79// Operators --
80//-------------
81
82//-------------
83// Selectors --
84//-------------
85
87 if ( key.value() < 0 || key.value() >= _fitTypeMap.size() ) return 0;
88 const int index = _fitTypeMap[key.value()];
89 return index < 0 ? 0 : _theHots[index];
90}
91
92const TrkExpectedHot* TrkExpectedHotSet::exHot() const { return _nFit < 0 ? 0 : _theHots[0]; }
93
94void TrkExpectedHotSet::getHots( std::vector<TrkHitOnTrk*>& hots ) const {
95 const TrkExpectedHot* anExHot( 0 );
96 for ( int i( 0 ); i < _theHots.size(); ++i )
97 {
98 anExHot = _theHots[i];
99 if ( anExHot->getHots( hots ) ) break;
100 }
101}
102
104 return ( exHot( key ) != 0 );
105}
106
107void TrkExpectedHotSet::printFit( const TrkFitTypeKey& key, ostream& os ) const {
108 os << " Intersects element ";
109 _elemId.printAll( os );
110 const TrkExpectedHot* theExHot = exHot( key );
111 if ( theExHot == 0 )
112 {
113 os << " _" << endl;
114 return;
115 }
116 theExHot->printAll( os );
117 os << endl;
118}
119
120//-------------
121// Modifiers --
122//-------------
123
125 if ( key.value() < 0 ) return false;
126 if ( key.value() >= _fitTypeMap.size() ) return false;
127 if ( aHot == 0 ) return false;
128 const int test = _fitTypeMap[key.value()];
129 if ( test != -1 )
130 {
131 TrkExpectedHot* myHot = _theHots[test];
132 if ( aHot->hasHot() ) { myHot->setHots( aHot ); }
133 delete aHot;
134 return true;
135 }
136 ++_nFit;
137 _fitTypeMap[key.value()] = _nFit;
138 aHot->setExTrk( _exTrk );
139 _theHots.push_back( aHot );
140 return true;
141}
142
144 _exTrk = anExTrk;
145 const int nHot = _theHots.size();
146 for ( int iHot( 0 ); iHot < nHot; ++iHot )
147 {
148 TrkExpectedHot* aHot = _theHots[iHot];
149 aHot->setExTrk( _exTrk );
150 }
151}
152
153bool TrkExpectedHotSet::isSvt() const { return _elemId.sysInd() == TrkDetElemId::svt; }
154
155bool TrkExpectedHotSet::isMdc() const { return _elemId.sysInd() == TrkDetElemId::mdc; }
156
157// -------------------------------------------
158// -- Protected Function Member Definitions --
159// -------------------------------------------
160
161// -----------------------------------------
162// -- Private Function Member Definitions --
163// -----------------------------------------
164
165// -----------------------------------
166// -- Internal Function Definitions --
167// -----------------------------------
std::string test
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42
void printAll(std::ostream &os=std::cout) const
bool addInfo(TrkExpectedHot *aHot, const TrkFitTypeKey &key)
void getHots(std::vector< TrkHitOnTrk * > &hots) const
const TrkExpectedHot * exHot(const TrkFitTypeKey &key) const
TrkExpectedHotSet(const TrkDetElemId &elemId, const int &maxFits)
const TrkExpectedHot * exHot() const
bool hasFitType(const TrkFitTypeKey &key) const
void setExTrk(const TrkExpectedTrk *anExTrk)
void printFit(const TrkFitTypeKey &key, std::ostream &os=std::cout) const
virtual bool hasHot() const =0
virtual bool setHots(const TrkExpectedHot *aHot)=0
virtual bool getHots(std::vector< TrkHitOnTrk * > &hots) const =0
virtual void printAll(std::ostream &os) const =0