BOSS 7.0.1
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//---------------
34// C++ Headers --
35//---------------
36
37//-------------------------------
38// Collaborating Class Headers --
39//-------------------------------
40
41#include "TrkBase/TrkFitTypeKey.h"
42#include "TrkBase/TrkExpectedHot.h"
43using std::endl;
44using std::ostream;
45
46//----------------------------------------------------------------------
47// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
48//-----------------------------------------------------------------------
49
50
51
52// -----------------------------------------------
53// -- Static Data & Function Member Definitions --
54// -----------------------------------------------
55
56// ----------------------------------------
57// -- Public Function Member Definitions --
58// ----------------------------------------
59
60//----------------
61// Constructors --
62//----------------
63
65 const int& maxFits )
66 :_elemId(elemId),
67 _nFit(-1),
68 _fitTypeMap(maxFits,-1),
69 _exTrk(0)
70{
71}
72
73//--------------
74// Destructor --
75//--------------
76
78 // owns the exHost
79 const int iEx = _theHots.size();
80 for ( int iKill(0); iKill < iEx; ++iKill ) {
81 TrkExpectedHot* exHot = _theHots[iKill];
82 delete exHot;
83 }
84}
85
86//-------------
87// Operators --
88//-------------
89
90//-------------
91// Selectors --
92//-------------
93
94const TrkExpectedHot*
96 if ( key.value() < 0 || key.value() >= _fitTypeMap.size() ) return 0;
97 const int index = _fitTypeMap[key.value()];
98 return index < 0 ? 0 : _theHots[index];
99}
100
101const TrkExpectedHot*
103 return _nFit < 0 ? 0 : _theHots[0];
104}
105
106void
107TrkExpectedHotSet::getHots( std::vector<TrkHitOnTrk*>& hots ) const {
108 const TrkExpectedHot* anExHot(0);
109 for ( int i(0); i < _theHots.size(); ++i ) {
110 anExHot = _theHots[i];
111 if ( anExHot->getHots(hots) ) break;
112 }
113}
114
115bool
117 return ( exHot(key) != 0 );
118}
119
120
121void
123 ostream& os ) const{
124 os << " Intersects element ";
125 _elemId.printAll(os);
126 const TrkExpectedHot* theExHot = exHot(key);
127 if ( theExHot == 0 ) {
128 os << " _" << endl;
129 return;
130 }
131 theExHot->printAll(os);
132 os << endl;
133}
134
135//-------------
136// Modifiers --
137//-------------
138
139bool
141 const TrkFitTypeKey& key ){
142 if ( key.value() < 0 ) return false;
143 if ( key.value() >= _fitTypeMap.size() ) return false;
144 if ( aHot == 0 ) return false;
145 const int test = _fitTypeMap[key.value()];
146 if ( test != -1 ) {
147 TrkExpectedHot* myHot = _theHots[test];
148 if ( aHot->hasHot() ) { myHot->setHots(aHot); }
149 delete aHot;
150 return true;
151 }
152 ++_nFit;
153 _fitTypeMap[key.value()] = _nFit;
154 aHot->setExTrk(_exTrk);
155 _theHots.push_back(aHot);
156 return true;
157}
158
159void
161 _exTrk = anExTrk;
162 const int nHot = _theHots.size();
163 for ( int iHot(0); iHot < nHot; ++iHot ) {
164 TrkExpectedHot* aHot = _theHots[iHot];
165 aHot->setExTrk(_exTrk);
166 }
167}
168
169bool
171 return _elemId.sysInd() == TrkDetElemId::svt;
172}
173
174bool
176 return _elemId.sysInd() == TrkDetElemId::mdc;
177}
178
179// -------------------------------------------
180// -- Protected Function Member Definitions --
181// -------------------------------------------
182
183// -----------------------------------------
184// -- Private Function Member Definitions --
185// -----------------------------------------
186
187// -----------------------------------
188// -- Internal Function Definitions --
189// -----------------------------------
190
191
192
193
194
195
196
197
198
199
200
201
std::string test
Definition: CalibModel.cxx:43
*************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
const TrkDetElemId::systemIndex & sysInd() const
void printAll(std::ostream &os=std::cout) const
bool addInfo(TrkExpectedHot *aHot, const TrkFitTypeKey &key)
void getHots(std::vector< TrkHitOnTrk * > &hots) 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
void setExTrk(const TrkExpectedTrk *anExTrk)
virtual void printAll(std::ostream &os) const =0