46 template <
class T,
class Derived>
47 void RFListBase<T,Derived>::Clear(){
51 template <
class T,
class Derived>
52 T& RFListBase<T,Derived>::Get(
const RFKey& key)
const{
54 for(
int i = 0; i < N; i++)
55 if(m_Objs[i]->IsSame(key))
return *m_Objs[i];
60 template <
class T,
class Derived>
61 T& RFListBase<T,Derived>::Get(
int i)
const {
62 if(i < 0 || i >= GetN())
return T::Empty();
66 template <
class T,
class Derived>
67 bool RFListBase<T,Derived>::Add(T& obj){
68 if(!obj)
return false;
70 for(
int i = 0; i < N; i++)
71 if(m_Objs[i]->IsSame(obj))
return false;
72 m_Objs.push_back(&obj);
76 template <
class T,
class Derived>
77 int RFListBase<T,Derived>::Remove(
const T& obj){
79 for(
int i = 0; i < N; i++){
80 if(m_Objs[i]->IsSame(obj)){
81 m_Objs.erase(m_Objs.begin()+i);
88 template <
class T,
class Derived>
89 int RFListBase<T,Derived>::GetIndex(
const RFKey& key)
const {
91 for(
int i = 0; i < N; i++){
92 if(m_Objs[i]->IsSame(key))
return i;
97 template <
class T,
class Derived>
98 int RFListBase<T,Derived>::GetIndex(
const T& obj)
const {
100 for(
int i = 0; i < N; i++){
101 if(m_Objs[i]->IsSame(obj))
return i;
106 template <
class T,
class Derived>
107 T& RFListBase<T,Derived>::operator[](
int i)
const {
111 template <
class T,
class Derived>
112 bool RFListBase<T,Derived>::operator==(
const T& obj)
const {
113 if(GetN() != 1)
return false;
114 return obj == *m_Objs[0];
117 template <
class T,
class Derived>
118 bool RFListBase<T,Derived>::operator!=(
const T& obj)
const {
119 if(GetN() != 1)
return true;
120 return !(obj == *m_Objs[0]);
123 template <
class T,
class Derived>
124 Derived RFListBase<T,Derived>::operator+(T& obj)
const {
126 list.Add((Derived&)*
this);
131 template <
class T,
class Derived>
132 Derived RFListBase<T,Derived>::operator-(
const T& obj)
const {
134 list.Add((Derived&)*
this);
147 template <
class T,
class Derived>
148 Derived& RFListBase<T,Derived>::operator+=(T& obj){
150 return (Derived&)*
this;
159 template <
class T,
class Derived>
160 Derived& RFListBase<T,Derived>::operator-=(
const T& obj){
162 return (Derived&)*
this;
166 double RFList<RestFrame>::GetMass()
const {
167 int N = m_Objs.size();
168 TLorentzVector V(0.,0.,0.,0.);
169 for(
int i = 0; i < N; i++)
170 V += m_Objs[i]->GetFourVector();
174 TLorentzVector RFList<RestFrame>::GetFourVector()
const {
175 return GetFourVector(RestFrame::Empty());
178 TLorentzVector RFList<RestFrame>::GetFourVector(
const RestFrame& frame)
const {
179 int N = m_Objs.size();
180 TLorentzVector V(0.,0.,0.,0.);
181 for(
int i = 0; i < N; i++)
182 V += m_Objs[i]->GetFourVector(frame);
186 TLorentzVector RFList<RestFrame>::GetVisibleFourVector()
const {
187 return GetVisibleFourVector(RestFrame::Empty());
190 TLorentzVector RFList<RestFrame>::GetVisibleFourVector(
const RestFrame& frame)
const {
191 int N = m_Objs.size();
192 TLorentzVector V(0.,0.,0.,0.);
193 for(
int i = 0; i < N; i++)
194 V += m_Objs[i]->GetVisibleFourVector(frame);
198 TLorentzVector RFList<RestFrame>::GetInvisibleFourVector()
const {
199 return GetInvisibleFourVector(RestFrame::Empty());
202 TLorentzVector RFList<RestFrame>::GetInvisibleFourVector(
const RestFrame& frame)
const {
203 int N = m_Objs.size();
204 TLorentzVector V(0.,0.,0.,0.);
205 for(
int i = 0; i < N; i++)
206 V += m_Objs[i]->GetInvisibleFourVector(frame);
210 double RFList<RestFrame>::GetEnergy(
const RestFrame& frame)
const {
211 int N = m_Objs.size();
212 TLorentzVector V(0.,0.,0.,0.);
213 for(
int i = 0; i < N; i++)
214 V += m_Objs[i]->GetFourVector(frame);
218 double RFList<RestFrame>::GetMomentum(
const RestFrame& frame)
const {
219 int N = m_Objs.size();
220 TLorentzVector V(0.,0.,0.,0.);
221 for(
int i = 0; i < N; i++)
222 V += m_Objs[i]->GetFourVector(frame);
226 RFCharge RFList<RestFrame>::GetCharge()
const {
229 for(
int i = 0; i < N; i++)
230 charge += m_Objs[i]->GetCharge();
236 State& RFList<State>::GetFrame(
const RestFrame& frame)
const {
238 for(
int i = 0; i < N; i++)
239 if(m_Objs[i]->IsFrame(frame))
return *m_Objs[i];
241 return State::Empty();
244 TLorentzVector RFList<State>::GetFourVector()
const {
245 TLorentzVector V(0.,0.,0.,0.);
247 for(
int i = 0; i < N; i++)
248 V += m_Objs[i]->GetFourVector();
253 RFCharge RFList<State>::GetCharge()
const {
256 for(
int i = 0; i < N; i++)
257 charge += m_Objs[i]->GetCharge();
262 void RFList<State>::Boost(
const TVector3& B)
const {
264 for(
int i = 0; i < N; i++){
269 template class RFList<RFBase>;
270 template class RFList<RestFrame>;
271 template class RFList<const RestFrame>;
272 template class RFList<ReconstructionFrame>;
273 template class RFList<GeneratorFrame>;
274 template class RFList<VisibleRecoFrame>;
275 template class RFList<DecayRecoFrame>;
276 template class RFList<ResonanceGenFrame>;
277 template class RFList<Jigsaw>;
278 template class RFList<const Jigsaw>;
279 template class RFList<Group>;
280 template class RFList<const Group>;
281 template class RFList<State>;
282 template class RFList<VisibleState>;
283 template class RFList<InvisibleState>;
284 template class RFList<CombinatoricState>;
285 template class RFList<HistPlotVar>;
286 template class RFList<HistPlotCategory>;
287 template class RFList<const HistPlotCategory>;
289 template class RFListBase<RFBase,RFList<RFBase> >;
290 template class RFListBase<RestFrame,RFList<RestFrame> >;
291 template class RFListBase<const RestFrame,RFList<const RestFrame> >;
292 template class RFListBase<ReconstructionFrame,RFList<ReconstructionFrame> >;
293 template class RFListBase<GeneratorFrame,RFList<GeneratorFrame> >;
294 template class RFListBase<VisibleRecoFrame,RFList<VisibleRecoFrame> >;
295 template class RFListBase<DecayRecoFrame,RFList<DecayRecoFrame> >;
296 template class RFListBase<ResonanceGenFrame,RFList<ResonanceGenFrame> >;
297 template class RFListBase<Jigsaw,RFList<Jigsaw> >;
298 template class RFListBase<const Jigsaw,RFList<const Jigsaw> >;
299 template class RFListBase<Group,RFList<Group> >;
300 template class RFListBase<const Group,RFList<const Group> >;
301 template class RFListBase<State,RFList<State> >;
302 template class RFListBase<VisibleState,RFList<VisibleState> >;
303 template class RFListBase<InvisibleState,RFList<InvisibleState> >;
304 template class RFListBase<CombinatoricState,RFList<CombinatoricState> >;
305 template class RFListBase<HistPlotVar,RFList<HistPlotVar> >;
306 template class RFListBase<HistPlotCategory,RFList<HistPlotCategory> >;
307 template class RFListBase<const HistPlotCategory,RFList<const HistPlotCategory> >;