FairRoot/PandaRoot
RhoCandList.cxx
Go to the documentation of this file.
1 // //
3 // RhoCandList //
4 // //
5 // Container class for RhoCandidates //
6 // //
7 // Author List: //
8 // Marcel Kunze, RUB, Feb. 99 //
9 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
10 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
11 // //
13 
14 #include <stdlib.h>
15 
16 #include "RhoBase/RhoCandList.h"
17 #include "RhoBase/RhoFactory.h"
18 #include "RhoBase/RhoCandidate.h"
22 
24 
25 #include <iostream>
26 using namespace std;
27 
28 RhoCandList::RhoCandList ( const char* name, UInt_t capacity ) :
29  TNamed ( name,name ), fFast ( kFALSE )
30 {
31  fOwnList = new TObjArray ( capacity );
32 }
33 
34 
35 // Perform a deep copy
37 {
38  fFast = l.fFast;
39  fOwnList = new TObjArray( l.GetLength() );
40 
41  Cleanup();
42  const Int_t n = l.GetLength();
43  for ( int i=0; i<n; i++ ) {
44  Put ( l.Get ( i ) );
45  }
46 }
47 
48 //--------------
49 // Destructor --
50 //--------------
51 // Deletes the list and the owned objects
53 {
54  Cleanup();
55  delete fOwnList;
56 }
57 
58 //----------------------
59 //-- public Functions --
60 //----------------------
61 
63 {
64  fOwnList->Clear(); //Delete() would destruct the candidates which will be cleaned by the TFactory!
65 }
66 
68 {
69  cerr << "RhoCandList::SetNumberOfTracks is deprecated. n="<<n << endl;
70 }
71 
73 {
74  return fOwnList->GetLast() +1;
75 }
76 
77 void RhoCandList::Put ( const RhoCandidate* c, Int_t i )
78 {
80  if ( i<0 ) {
81  fOwnList->Add ( newCand );
82  } else {
83  ( *fOwnList ) [i] = newCand;
84  }
85 }
86 
87 void RhoCandList::InsertAt ( Int_t i, const RhoCandidate* c )
88 {
89  fOwnList->AddAtAndExpand ( ( TObject* ) c,i );
90  Put ( c,i );
91 }
92 
93 
95 {
96  if ( i >= GetNumberOfTracks() ) { return 0; }
97  return ( RhoCandidate* ) ( fOwnList->UncheckedAt ( i ) );
98 }
99 
101 {
102  if ( i >= GetNumberOfTracks() ) { return 0; }
103  return ( RhoCandidate* ) ( fOwnList->UncheckedAt ( i ) );
104 }
105 
107 {
108  // Create and return a new list of the fitted candidates
109 
110  // new list with extended name from the unfitted and intelligent starting size
111  RhoCandList* fittedlist = new RhoCandList( Form("%s Fitted",fName.Data()) , GetNumberOfTracks() );
112  FillFittedList(*fittedlist);
113  return fittedlist;
114 }
115 
117 {
118  RhoCandidate* aFit=0;
119  fittedlist.Cleanup();
120  for(int j=0;j<GetNumberOfTracks();j++) {
121  aFit = GetConst(j)->GetFit();
122  if(!aFit) Error("RhoCandList::FillFittedList","Fit pointer does not exist!");
123  fittedlist.Put(aFit);
124  }
125  return;
126 }
127 
128 
129 // Compare the marker and remove corresponding entry (MK,12/99)
130 // This allows to remove objects in several lists
132 {
133  Int_t nRemoved = 0;
134  Int_t n = GetNumberOfTracks();
135  for ( Int_t i=0; i<n; i++ ) {
136  RhoCandidate* b = Get ( i );
137  if ( b->Equals ( c ) ) {
138  fOwnList->RemoveAt ( i );
139  nRemoved++;
140  }
141  }
142  fOwnList->Compress();
143  return nRemoved;
144 }
145 
147 {
148  Int_t nRemoved = 0;
149  Int_t n = GetNumberOfTracks();
150  for ( Int_t i=0; i<n; i++ ) {
151  RhoCandidate* b = Get ( i );
152  if ( b->Overlaps ( c ) ) {
153  fOwnList->RemoveAt ( i );
154  nRemoved++;
155  }
156  }
157  fOwnList->Compress();
158  return nRemoved;
159 }
160 
162 {
163  Int_t nRemoved = 0;
164  Int_t n = GetNumberOfTracks();
165  for ( Int_t i=0; i<n-1; i++ ) {
166  RhoCandidate* b = Get ( i );
167  if ( b==0 ) { continue; }
168  for ( Int_t j=i+1; j<n; ++j ) {
169  RhoCandidate* c = Get ( j );
170  if ( c==0 ) { continue; }
171  if ( b->Equals ( c ) ) {
172  fOwnList->RemoveAt ( j );
173  nRemoved++;
174  }
175  }
176  }
177  fOwnList->Compress();
178  return nRemoved;
179 }
180 
182 {
183  Int_t nCand = 0;
184  const Int_t n = GetNumberOfTracks();
185  for ( Int_t i=0; i<n; i++ ) {
186  RhoCandidate* b = Get ( i );
187  if ( b->Equals ( c ) ) { nCand++; }
188  }
189  return nCand;
190 }
191 
193 {
194  Double_t e = 0.0;
195  const Int_t n = GetNumberOfTracks();
196  for ( Int_t i=0; i<n; i++ ) {
197  RhoCandidate* c = Get ( i );
198  Double_t energy = c->Energy();
199  if ( energy > emin ) { e += energy; }
200  }
201  return e;
202 }
203 
205 {
206  TVector3 p ( 0.0,0.0,0.0 );
207  const Int_t n = GetNumberOfTracks();
208  for ( Int_t i=0; i<n; i++ ) {
209  RhoCandidate* c = Get ( i );
210  TVector3 p3 = c->P3();
211  if ( p3.Mag() > pmin ) { p = p + p3; }
212  }
213  return p;
214 }
215 
216 void RhoCandList::Boost ( const TVector3& p )
217 {
218  const Int_t n = GetNumberOfTracks();
219  for ( Int_t i=0; i<n; i++ ) {
220  Get ( i )->Boost ( p );
221  }
222 }
223 
225 {
226  const Int_t n = GetNumberOfTracks();
227  o << "content: " << n << " entries." << endl;
228  if ( n!=0 ) {
229  for ( Int_t i=0; i<n; i++ ) {
230  const RhoCandidate* c = GetConst ( i );
231  o << "[" << i << "] " << *c;
232  o << endl;
233  }
234  }
235 }
236 
238 {
239  const Int_t n = l.GetNumberOfTracks();
240  for ( int i=0; i<n; i++ ) {
241  const RhoCandidate* c = l.Get ( i );
242  if ( c->GetMarker() !=0 ) { fOwnList->RemoveAt ( i ); }
243  }
244  fOwnList->Compress();
245 }
246 
247 // Makes now a deep copy rather than just cpoying pointers (MK,12/99)
249 {
250  fFast = l.fFast;
251 
252  Cleanup();
253  const Int_t n = l.GetNumberOfTracks();
254  for ( int i=0; i<n; i++ ) {
255  Put ( l.GetConst( i ) );
256  }
257 }
258 
260 {
261  return Get(i);
262 }
263 
264 void RhoCandList::SetType ( const TParticlePDG* pdt, int start )
265 {
266  if (start<0) start=0;
267  for ( Int_t i=start; i<GetNumberOfTracks(); i++ ) {
268  Get(i)->SetType ( pdt );
269  }
270 }
271 
272 void RhoCandList::SetType ( const char* name, int start )
273 {
274  if (start<0) start=0;
275  for ( Int_t i=start; i<GetNumberOfTracks(); i++ ) {
276  Get(i)->SetType ( name );
277  }
278 }
279 
280 void RhoCandList::SetType ( Int_t pdgcode, int start )
281 {
282  if (start<0) start=0;
283  for ( Int_t i=start; i<GetNumberOfTracks(); i++ ) {
284  Get(i)->SetType ( pdgcode );
285  }
286 }
287 
288 
290 {
291  Cleanup();
292  CombineAndAppend ( l1, l2 );
293 }
294 
296 {
297  Cleanup();
298  CombineAndAppend ( l1, l2, l3 );
299 }
300 
302 {
303  Cleanup();
304  CombineAndAppend ( l1, l2, l3, l4 );
305 }
306 
308 {
309  Cleanup();
310  CombineAndAppend ( l1, l2, l3, l4, l5 );
311 }
312 
314 {
315  Cleanup();
316  CombineAndAppend ( l1, l2, l3, l4, l5, l6 );
317 }
318 
320 {
321  Cleanup();
322  CombineAndAppend ( l1, l2, l3, l4, l5, l6, l7 );
323 }
324 
326 {
327  Cleanup();
328  CombineAndAppend ( l1, l2, l3, l4, l5, l6, l7, l8 );
329 }
330 
332 {
333  Cleanup();
334  CombineAndAppend ( l1, l2, l3, l4, l5, l6, l7, l8, l9 );
335 }
336 
338 {
339  Cleanup();
340  CombineAndAppend ( l1, l2, l3, l4, l5, l6, l7, l8, l9, l10 );
341 }
342 
343 
345 {
346  //printf("RhoCandList::CombineAndAppend()\n");
347  TLorentzVector vl;
348  Double_t charge;
349 
350  const int len1=l1.GetLength();
351  const int len2=l2.GetLength();
352 
353  int i1,i2;
354  int st2;
355 
356  for ( i1=0; i1<len1; i1++ ) {
357  st2=0;
358  if ( &l1==&l2 ) { st2=i1+1; }
359 
360  for ( i2=st2; i2<len2; i2++ ) {
361  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
362 
363  vl=l1[i1]->P4() +l2[i2]->P4();
364  charge=l1[i1]->Charge() +l2[i2]->Charge();
365 
366  RhoCandidate c ( vl,charge );
367  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() );
368 //std::cout<<" -- Combining 2 Cov Matrices from candidates c1:"<<&(l1[i1]->P4Cov())<<" c2:"<<&(l2[i2]->P4Cov())<<std::endl;
369 //RhoCalculationTools::PrintMatrix(l1[i1]->P4Cov());
370 //RhoCalculationTools::PrintMatrix(l2[i2]->P4Cov());
371 //std::cout<<" -- result"<<std::endl;
373 //RhoCalculationTools::PrintMatrix( l1[i1]->P4Cov() + l2[i2]->P4Cov() );
374 //RhoCalculationTools::PrintMatrix( ((RhoError)l1[i1]->P4Cov()) +((RhoError)l2[i2]->P4Cov()));
375 //RhoCalculationTools::PrintMatrix( ((TMatrixD)l1[i1]->P4Cov()) +((TMatrixD)l2[i2]->P4Cov()));
376 
377  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ),0 );
378  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ),1 );
379  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ),2 );
380  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ),3 );
381 
382  c.SetInsertHistory(kFALSE);
383  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
384  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
385 
386  Put ( &c );
387  // after putting (does a copy and drops daughter links)
388  RhoCandidate* cInList = Get(GetLength()-1);
389  cInList->AddDaughterLinkSimple(l1[i1]) ;
390  cInList->AddDaughterLinkSimple(l2[i2]) ;
391  }
392  }
393 
394 }
395 
397 {
398  TLorentzVector vl;
399  Double_t charge;
400 
401  const int len1=l1.GetLength();
402  const int len2=l2.GetLength();
403  const int len3=l3.GetLength();
404 
405  int i1,i2,i3;
406  int st2,st3;
407 
408  for ( i1=0; i1<len1; i1++ ) {
409  st2=0;
410  if ( &l2==&l1 ) { st2=i1+1; }
411 
412  for ( i2=st2; i2<len2; i2++ ) {
413  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
414 
415  st3=0;
416  if ( &l3==&l2 ) { st3=i2+1; }
417  else if ( &l3==&l1 ) { st3=i1+1; }
418 
419  for ( i3=st3; i3<len3; i3++ ) {
420  if ( l3[i3]->Overlaps ( l2[i2] )
421  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
422 
423  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4();
424  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge();
425 
426  RhoCandidate c ( vl,charge );
427  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() );
428 
429  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ),0 );
430  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ),1 );
431  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ),2 );
432  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ),3 );
433 
434  c.SetInsertHistory(kFALSE);
435  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
436  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
437  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
438 
439  Put ( &c );
440  // after putting (does a copy and drops daughter links)
441  RhoCandidate* cInList = Get(GetLength()-1);
442  cInList->AddDaughterLinkSimple(l1[i1]) ;
443  cInList->AddDaughterLinkSimple(l2[i2]) ;
444  cInList->AddDaughterLinkSimple(l3[i3]) ;
445  }
446  }
447  }
448 }
449 
451 {
452  TLorentzVector vl;
453  Double_t charge;
454 
455  const int len1=l1.GetLength();
456  const int len2=l2.GetLength();
457  const int len3=l3.GetLength();
458  const int len4=l4.GetLength();
459 
460  int i1,i2,i3,i4;
461  int st2,st3,st4;
462 
463  for ( i1=0; i1<len1; i1++ ) {
464  st2=0;
465  if ( &l2==&l1 ) { st2=i1+1; }
466 
467  for ( i2=st2; i2<len2; i2++ ) {
468  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
469 
470  st3=0;
471  if ( &l3==&l2 ) { st3=i2+1; }
472  else if ( &l3==&l1 ) { st3=i1+1; }
473 
474  for ( i3=st3; i3<len3; i3++ ) {
475  if ( l3[i3]->Overlaps ( l2[i2] )
476  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
477 
478  st4=0;
479  if ( &l4==&l3 ) { st4=i3+1; }
480  else if ( &l4==&l2 ) { st4=i2+1; }
481  else if ( &l4==&l1 ) { st4=i1+1; }
482 
483  for ( i4=st4; i4<len4; i4++ ) {
484  if ( l4[i4]->Overlaps ( l3[i3] )
485  || l4[i4]->Overlaps ( l2[i2] )
486  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
487 
488  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4();
489  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge();
490 
491  RhoCandidate c ( vl,charge );
492  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() );
493 
494  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ),0 );
495  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ),1 );
496  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ),2 );
497  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ),3 );
498 
499  c.SetInsertHistory(kFALSE);
500  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
501  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
502  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
503  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
504 
505  Put ( &c );
506  // after putting (does a copy and drops daughter links)
507  RhoCandidate* cInList = Get(GetLength()-1);
508  cInList->AddDaughterLinkSimple(l1[i1]) ;
509  cInList->AddDaughterLinkSimple(l2[i2]) ;
510  cInList->AddDaughterLinkSimple(l3[i3]) ;
511  cInList->AddDaughterLinkSimple(l4[i4]) ;
512  }
513  }
514  }
515  }
516 }
517 
519 {
520  TLorentzVector vl;
521  Double_t charge;
522 
523  const int len1=l1.GetLength();
524  const int len2=l2.GetLength();
525  const int len3=l3.GetLength();
526  const int len4=l4.GetLength();
527  const int len5=l5.GetLength();
528 
529  int i1,i2,i3,i4,i5;
530  int st2,st3,st4,st5;
531 
532  for ( i1=0; i1<len1; i1++ ) {
533  st2=0;
534  if ( &l2==&l1 ) { st2=i1+1; }
535 
536  for ( i2=st2; i2<len2; i2++ ) {
537  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
538 
539  st3=0;
540  if ( &l3==&l2 ) { st3=i2+1; }
541  else if ( &l3==&l1 ) { st3=i1+1; }
542 
543  for ( i3=st3; i3<len3; i3++ ) {
544  if ( l3[i3]->Overlaps ( l2[i2] )
545  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
546 
547  st4=0;
548  if ( &l4==&l3 ) { st4=i3+1; }
549  else if ( &l4==&l2 ) { st4=i2+1; }
550  else if ( &l4==&l1 ) { st4=i1+1; }
551 
552  for ( i4=st4; i4<len4; i4++ ) {
553  if ( l4[i4]->Overlaps ( l3[i3] )
554  || l4[i4]->Overlaps ( l2[i2] )
555  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
556 
557  st5=0;
558  if ( &l5==&l4 ) { st5=i4+1; }
559  else if ( &l5==&l3 ) { st5=i3+1; }
560  else if ( &l5==&l2 ) { st5=i2+1; }
561  else if ( &l5==&l1 ) { st5=i1+1; }
562 
563  for ( i5=st5; i5<len5; i5++ ) {
564  if ( l5[i5]->Overlaps ( l4[i4] )
565  || l5[i5]->Overlaps ( l3[i3] )
566  || l5[i5]->Overlaps ( l2[i2] )
567  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
568 
569  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4();
570  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() ;
571 
572  RhoCandidate c ( vl,charge );
573  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() );
574 
575  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) ,0 );
576  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) ,1 );
577  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) ,2 );
578  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) ,3 );
579 
580  c.SetInsertHistory(kFALSE);
581  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
582  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
583  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
584  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
585  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
586 
587 
588  Put ( &c );
589  // after putting (does a copy and drops daughter links)
590  RhoCandidate* cInList = Get(GetLength()-1);
591  cInList->AddDaughterLinkSimple(l1[i1]) ;
592  cInList->AddDaughterLinkSimple(l2[i2]) ;
593  cInList->AddDaughterLinkSimple(l3[i3]) ;
594  cInList->AddDaughterLinkSimple(l4[i4]) ;
595  cInList->AddDaughterLinkSimple(l5[i5]) ;
596  } //loop5
597  } //loop4
598  } //loop3
599  } //loop2
600  } //loop1
601 }
602 
603 
605 {
606  TLorentzVector vl;
607  Double_t charge;
608 
609  const int len1=l1.GetLength();
610  const int len2=l2.GetLength();
611  const int len3=l3.GetLength();
612  const int len4=l4.GetLength();
613  const int len5=l5.GetLength();
614  const int len6=l6.GetLength();
615 
616  int i1,i2,i3,i4,i5,i6;
617  int st2,st3,st4,st5,st6;
618 
619  for ( i1=0; i1<len1; i1++ ) {
620  st2=0;
621  if ( &l2==&l1 ) { st2=i1+1; }
622 
623  for ( i2=st2; i2<len2; i2++ ) {
624  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
625 
626  st3=0;
627  if ( &l3==&l2 ) { st3=i2+1; }
628  else if ( &l3==&l1 ) { st3=i1+1; }
629 
630  for ( i3=st3; i3<len3; i3++ ) {
631  if ( l3[i3]->Overlaps ( l2[i2] )
632  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
633 
634  st4=0;
635  if ( &l4==&l3 ) { st4=i3+1; }
636  else if ( &l4==&l2 ) { st4=i2+1; }
637  else if ( &l4==&l1 ) { st4=i1+1; }
638 
639  for ( i4=st4; i4<len4; i4++ ) {
640  if ( l4[i4]->Overlaps ( l3[i3] )
641  || l4[i4]->Overlaps ( l2[i2] )
642  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
643 
644  st5=0;
645  if ( &l5==&l4 ) { st5=i4+1; }
646  else if ( &l5==&l3 ) { st5=i3+1; }
647  else if ( &l5==&l2 ) { st5=i2+1; }
648  else if ( &l5==&l1 ) { st5=i1+1; }
649 
650  for ( i5=st5; i5<len5; i5++ ) {
651  if ( l5[i5]->Overlaps ( l4[i4] )
652  || l5[i5]->Overlaps ( l3[i3] )
653  || l5[i5]->Overlaps ( l2[i2] )
654  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
655 
656  st6=0;
657  if ( &l6==&l5 ) { st6=i5+1; }
658  else if ( &l6==&l4 ) { st6=i4+1; }
659  else if ( &l6==&l3 ) { st6=i3+1; }
660  else if ( &l6==&l2 ) { st6=i2+1; }
661  else if ( &l6==&l1 ) { st6=i1+1; }
662  for ( i6=st6; i6<len6; i6++ ) { //loop 6
663  if (l6[i6]->Overlaps ( l5[i5] )
664  || l6[i6]->Overlaps ( l4[i4] )
665  || l6[i6]->Overlaps ( l3[i3] )
666  || l6[i6]->Overlaps ( l2[i2] )
667  || l6[i6]->Overlaps ( l1[i1] ) ) { continue; }//overlap 6
668 
669  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4() +l6[i6]->P4();
670  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() +l6[i6]->Charge();
671 
672  RhoCandidate c ( vl,charge );
673  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() +l6[i6]->P4Cov() );
674 
675  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) |l6[i6]->GetMarker ( 0 ) ,0 );
676  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) |l6[i6]->GetMarker ( 1 ) ,1 );
677  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) |l6[i6]->GetMarker ( 2 ) ,2 );
678  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) |l6[i6]->GetMarker ( 3 ) ,3 );
679 
680  c.SetInsertHistory(kFALSE);
681  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
682  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
683  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
684  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
685  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
686  if(l6[i6]->GetPointerToLinks() != 0) c.AddLinks(*l6[i6]->GetPointerToLinks());
687 
688 
689  Put ( &c );
690  // after putting (does a copy and drops daughter links)
691  RhoCandidate* cInList = Get(GetLength()-1);
692  cInList->AddDaughterLinkSimple(l1[i1]) ;
693  cInList->AddDaughterLinkSimple(l2[i2]) ;
694  cInList->AddDaughterLinkSimple(l3[i3]) ;
695  cInList->AddDaughterLinkSimple(l4[i4]) ;
696  cInList->AddDaughterLinkSimple(l5[i5]) ;
697  cInList->AddDaughterLinkSimple(l6[i6]) ;
698  } //loop6
699  } //loop5
700  } //loop4
701  } //loop3
702  } //loop2
703  } //loop1
704 }
705 
706 
708 {
709  TLorentzVector vl;
710  Double_t charge;
711 
712  const int len1=l1.GetLength();
713  const int len2=l2.GetLength();
714  const int len3=l3.GetLength();
715  const int len4=l4.GetLength();
716  const int len5=l5.GetLength();
717  const int len6=l6.GetLength();
718  const int len7=l7.GetLength();
719 
720  int i1,i2,i3,i4,i5,i6,i7;
721  int st2,st3,st4,st5,st6,st7;
722 
723  for ( i1=0; i1<len1; i1++ ) {
724  st2=0;
725  if ( &l2==&l1 ) { st2=i1+1; }
726 
727  for ( i2=st2; i2<len2; i2++ ) {
728  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
729 
730  st3=0;
731  if ( &l3==&l2 ) { st3=i2+1; }
732  else if ( &l3==&l1 ) { st3=i1+1; }
733 
734  for ( i3=st3; i3<len3; i3++ ) {
735  if ( l3[i3]->Overlaps ( l2[i2] )
736  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
737 
738  st4=0;
739  if ( &l4==&l3 ) { st4=i3+1; }
740  else if ( &l4==&l2 ) { st4=i2+1; }
741  else if ( &l4==&l1 ) { st4=i1+1; }
742 
743  for ( i4=st4; i4<len4; i4++ ) {
744  if ( l4[i4]->Overlaps ( l3[i3] )
745  || l4[i4]->Overlaps ( l2[i2] )
746  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
747 
748  st5=0;
749  if ( &l5==&l4 ) { st5=i4+1; }
750  else if ( &l5==&l3 ) { st5=i3+1; }
751  else if ( &l5==&l2 ) { st5=i2+1; }
752  else if ( &l5==&l1 ) { st5=i1+1; }
753 
754  for ( i5=st5; i5<len5; i5++ ) {
755  if ( l5[i5]->Overlaps ( l4[i4] )
756  || l5[i5]->Overlaps ( l3[i3] )
757  || l5[i5]->Overlaps ( l2[i2] )
758  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
759 
760  st6=0;
761  if ( &l6==&l5 ) { st6=i5+1; }
762  else if ( &l6==&l4 ) { st6=i4+1; }
763  else if ( &l6==&l3 ) { st6=i3+1; }
764  else if ( &l6==&l2 ) { st6=i2+1; }
765  else if ( &l6==&l1 ) { st6=i1+1; }
766  for ( i6=st6; i6<len6; i6++ ) { //loop 6
767  if (l6[i6]->Overlaps ( l5[i5] )
768  || l6[i6]->Overlaps ( l4[i4] )
769  || l6[i6]->Overlaps ( l3[i3] )
770  || l6[i6]->Overlaps ( l2[i2] )
771  || l6[i6]->Overlaps ( l1[i1] ) ) { continue; }//overlap 6
772 
773  st7=0;
774  if ( &l7==&l6 ) { st7=i6+1; }
775  else if ( &l7==&l5 ) { st7=i5+1; }
776  else if ( &l7==&l4 ) { st7=i4+1; }
777  else if ( &l7==&l3 ) { st7=i3+1; }
778  else if ( &l7==&l2 ) { st7=i2+1; }
779  else if ( &l7==&l1 ) { st7=i1+1; }
780  for ( i7=st7; i7<len7; i7++ ) { //loop 7
781  if (l7[i7]->Overlaps ( l6[i6] )
782  || l7[i7]->Overlaps ( l5[i5] )
783  || l7[i7]->Overlaps ( l4[i4] )
784  || l7[i7]->Overlaps ( l3[i3] )
785  || l7[i7]->Overlaps ( l2[i2] )
786  || l7[i7]->Overlaps ( l1[i1] ) ) { continue; }//overlap 7
787 
788  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4() +l6[i6]->P4() +l7[i7]->P4();
789  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() +l6[i6]->Charge() +l7[i7]->Charge();
790 
791  RhoCandidate c ( vl,charge );
792  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() +l6[i6]->P4Cov() +l7[i7]->P4Cov());
793 
794  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) |l6[i6]->GetMarker ( 0 ) |l7[i7]->GetMarker ( 0 ),0 );
795  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) |l6[i6]->GetMarker ( 1 ) |l7[i7]->GetMarker ( 1 ),1 );
796  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) |l6[i6]->GetMarker ( 2 ) |l7[i7]->GetMarker ( 2 ),2 );
797  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) |l6[i6]->GetMarker ( 3 ) |l7[i7]->GetMarker ( 3 ),3 );
798 
799  c.SetInsertHistory(kFALSE);
800  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
801  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
802  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
803  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
804  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
805  if(l6[i6]->GetPointerToLinks() != 0) c.AddLinks(*l6[i6]->GetPointerToLinks());
806  if(l7[i7]->GetPointerToLinks() != 0) c.AddLinks(*l7[i7]->GetPointerToLinks());
807 
808 
809  Put ( &c );
810  // after putting (does a copy and drops daughter links)
811  RhoCandidate* cInList = Get(GetLength()-1);
812  cInList->AddDaughterLinkSimple(l1[i1]) ;
813  cInList->AddDaughterLinkSimple(l2[i2]) ;
814  cInList->AddDaughterLinkSimple(l3[i3]) ;
815  cInList->AddDaughterLinkSimple(l4[i4]) ;
816  cInList->AddDaughterLinkSimple(l5[i5]) ;
817  cInList->AddDaughterLinkSimple(l6[i6]) ;
818  cInList->AddDaughterLinkSimple(l7[i7]) ;
819  } //loop7
820  } //loop6
821  } //loop5
822  } //loop4
823  } //loop3
824  } //loop2
825  } //loop1
826 }
827 
828 
830 {
831  TLorentzVector vl;
832  Double_t charge;
833 
834  const int len1=l1.GetLength();
835  const int len2=l2.GetLength();
836  const int len3=l3.GetLength();
837  const int len4=l4.GetLength();
838  const int len5=l5.GetLength();
839  const int len6=l6.GetLength();
840  const int len7=l7.GetLength();
841  const int len8=l8.GetLength();
842 
843  int i1,i2,i3,i4,i5,i6,i7,i8;
844  int st2,st3,st4,st5,st6,st7,st8;
845 
846  for ( i1=0; i1<len1; i1++ ) {
847  st2=0;
848  if ( &l2==&l1 ) { st2=i1+1; }
849 
850  for ( i2=st2; i2<len2; i2++ ) {
851  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
852 
853  st3=0;
854  if ( &l3==&l2 ) { st3=i2+1; }
855  else if ( &l3==&l1 ) { st3=i1+1; }
856 
857  for ( i3=st3; i3<len3; i3++ ) {
858  if ( l3[i3]->Overlaps ( l2[i2] )
859  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
860 
861  st4=0;
862  if ( &l4==&l3 ) { st4=i3+1; }
863  else if ( &l4==&l2 ) { st4=i2+1; }
864  else if ( &l4==&l1 ) { st4=i1+1; }
865 
866  for ( i4=st4; i4<len4; i4++ ) {
867  if ( l4[i4]->Overlaps ( l3[i3] )
868  || l4[i4]->Overlaps ( l2[i2] )
869  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
870 
871  st5=0;
872  if ( &l5==&l4 ) { st5=i4+1; }
873  else if ( &l5==&l3 ) { st5=i3+1; }
874  else if ( &l5==&l2 ) { st5=i2+1; }
875  else if ( &l5==&l1 ) { st5=i1+1; }
876 
877  for ( i5=st5; i5<len5; i5++ ) {
878  if ( l5[i5]->Overlaps ( l4[i4] )
879  || l5[i5]->Overlaps ( l3[i3] )
880  || l5[i5]->Overlaps ( l2[i2] )
881  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
882 
883  st6=0;
884  if ( &l6==&l5 ) { st6=i5+1; }
885  else if ( &l6==&l4 ) { st6=i4+1; }
886  else if ( &l6==&l3 ) { st6=i3+1; }
887  else if ( &l6==&l2 ) { st6=i2+1; }
888  else if ( &l6==&l1 ) { st6=i1+1; }
889  for ( i6=st6; i6<len6; i6++ ) { //loop 6
890  if (l6[i6]->Overlaps ( l5[i5] )
891  || l6[i6]->Overlaps ( l4[i4] )
892  || l6[i6]->Overlaps ( l3[i3] )
893  || l6[i6]->Overlaps ( l2[i2] )
894  || l6[i6]->Overlaps ( l1[i1] ) ) { continue; }//overlap 6
895 
896  st7=0;
897  if ( &l7==&l6 ) { st7=i6+1; }
898  else if ( &l7==&l5 ) { st7=i5+1; }
899  else if ( &l7==&l4 ) { st7=i4+1; }
900  else if ( &l7==&l3 ) { st7=i3+1; }
901  else if ( &l7==&l2 ) { st7=i2+1; }
902  else if ( &l7==&l1 ) { st7=i1+1; }
903  for ( i7=st7; i7<len7; i7++ ) { //loop 7
904  if (l7[i7]->Overlaps ( l6[i6] )
905  || l7[i7]->Overlaps ( l5[i5] )
906  || l7[i7]->Overlaps ( l4[i4] )
907  || l7[i7]->Overlaps ( l3[i3] )
908  || l7[i7]->Overlaps ( l2[i2] )
909  || l7[i7]->Overlaps ( l1[i1] ) ) { continue; }//overlap 7
910 
911  st8=0;
912  if ( &l8==&l7 ) { st8=i7+1; }
913  else if ( &l8==&l6 ) { st8=i6+1; }
914  else if ( &l8==&l5 ) { st8=i5+1; }
915  else if ( &l8==&l4 ) { st8=i4+1; }
916  else if ( &l8==&l3 ) { st8=i3+1; }
917  else if ( &l8==&l2 ) { st8=i2+1; }
918  else if ( &l8==&l1 ) { st8=i1+1; }
919  for ( i8=st8; i8<len8; i8++ ) { //loop 8
920  if (l8[i8]->Overlaps ( l7[i7] )
921  || l8[i8]->Overlaps ( l6[i6] )
922  || l8[i8]->Overlaps ( l5[i5] )
923  || l8[i8]->Overlaps ( l4[i4] )
924  || l8[i8]->Overlaps ( l3[i3] )
925  || l8[i8]->Overlaps ( l2[i2] )
926  || l8[i8]->Overlaps ( l1[i1] ) ) { continue; }//overlap 8
927 
928  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4() +l6[i6]->P4() +l7[i7]->P4() +l8[i8]->P4();
929  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() +l6[i6]->Charge() +l7[i7]->Charge() +l8[i8]->Charge();
930 
931  RhoCandidate c ( vl,charge );
932  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() +l6[i6]->P4Cov() +l7[i7]->P4Cov() +l8[i8]->P4Cov() );
933 
934  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) |l6[i6]->GetMarker ( 0 ) |l7[i7]->GetMarker ( 0 ) |l8[i8]->GetMarker ( 0 ),0 );
935  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) |l6[i6]->GetMarker ( 1 ) |l7[i7]->GetMarker ( 1 ) |l8[i8]->GetMarker ( 1 ),1 );
936  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) |l6[i6]->GetMarker ( 2 ) |l7[i7]->GetMarker ( 2 ) |l8[i8]->GetMarker ( 2 ),2 );
937  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) |l6[i6]->GetMarker ( 3 ) |l7[i7]->GetMarker ( 3 ) |l8[i8]->GetMarker ( 3 ),3 );
938 
939  c.SetInsertHistory(kFALSE);
940  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
941  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
942  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
943  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
944  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
945  if(l6[i6]->GetPointerToLinks() != 0) c.AddLinks(*l6[i6]->GetPointerToLinks());
946  if(l7[i7]->GetPointerToLinks() != 0) c.AddLinks(*l7[i7]->GetPointerToLinks());
947  if(l8[i8]->GetPointerToLinks() != 0) c.AddLinks(*l8[i8]->GetPointerToLinks());
948 
949 
950  Put ( &c );
951  // after putting (does a copy and drops daughter links)
952  RhoCandidate* cInList = Get(GetLength()-1);
953  cInList->AddDaughterLinkSimple(l1[i1]) ;
954  cInList->AddDaughterLinkSimple(l2[i2]) ;
955  cInList->AddDaughterLinkSimple(l3[i3]) ;
956  cInList->AddDaughterLinkSimple(l4[i4]) ;
957  cInList->AddDaughterLinkSimple(l5[i5]) ;
958  cInList->AddDaughterLinkSimple(l6[i6]) ;
959  cInList->AddDaughterLinkSimple(l7[i7]) ;
960  cInList->AddDaughterLinkSimple(l8[i8]) ;
961  } //loop8
962  } //loop7
963  } //loop6
964  } //loop5
965  } //loop4
966  } //loop3
967  } //loop2
968  } //loop1
969 }
970 
971 
973 {
974  TLorentzVector vl;
975  Double_t charge;
976 
977  const int len1=l1.GetLength();
978  const int len2=l2.GetLength();
979  const int len3=l3.GetLength();
980  const int len4=l4.GetLength();
981  const int len5=l5.GetLength();
982  const int len6=l6.GetLength();
983  const int len7=l7.GetLength();
984  const int len8=l8.GetLength();
985  const int len9=l9.GetLength();
986 
987  int i1,i2,i3,i4,i5,i6,i7,i8,i9;
988  int st2,st3,st4,st5,st6,st7,st8,st9;
989 
990  for ( i1=0; i1<len1; i1++ ) {
991  st2=0;
992  if ( &l2==&l1 ) { st2=i1+1; }
993 
994  for ( i2=st2; i2<len2; i2++ ) {
995  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
996 
997  st3=0;
998  if ( &l3==&l2 ) { st3=i2+1; }
999  else if ( &l3==&l1 ) { st3=i1+1; }
1000 
1001  for ( i3=st3; i3<len3; i3++ ) {
1002  if ( l3[i3]->Overlaps ( l2[i2] )
1003  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
1004 
1005  st4=0;
1006  if ( &l4==&l3 ) { st4=i3+1; }
1007  else if ( &l4==&l2 ) { st4=i2+1; }
1008  else if ( &l4==&l1 ) { st4=i1+1; }
1009 
1010  for ( i4=st4; i4<len4; i4++ ) {
1011  if ( l4[i4]->Overlaps ( l3[i3] )
1012  || l4[i4]->Overlaps ( l2[i2] )
1013  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
1014 
1015  st5=0;
1016  if ( &l5==&l4 ) { st5=i4+1; }
1017  else if ( &l5==&l3 ) { st5=i3+1; }
1018  else if ( &l5==&l2 ) { st5=i2+1; }
1019  else if ( &l5==&l1 ) { st5=i1+1; }
1020 
1021  for ( i5=st5; i5<len5; i5++ ) {
1022  if ( l5[i5]->Overlaps ( l4[i4] )
1023  || l5[i5]->Overlaps ( l3[i3] )
1024  || l5[i5]->Overlaps ( l2[i2] )
1025  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
1026 
1027  st6=0;
1028  if ( &l6==&l5 ) { st6=i5+1; }
1029  else if ( &l6==&l4 ) { st6=i4+1; }
1030  else if ( &l6==&l3 ) { st6=i3+1; }
1031  else if ( &l6==&l2 ) { st6=i2+1; }
1032  else if ( &l6==&l1 ) { st6=i1+1; }
1033  for ( i6=st6; i6<len6; i6++ ) { //loop 6
1034  if (l6[i6]->Overlaps ( l5[i5] )
1035  || l6[i6]->Overlaps ( l4[i4] )
1036  || l6[i6]->Overlaps ( l3[i3] )
1037  || l6[i6]->Overlaps ( l2[i2] )
1038  || l6[i6]->Overlaps ( l1[i1] ) ) { continue; }//overlap 6
1039 
1040  st7=0;
1041  if ( &l7==&l6 ) { st7=i6+1; }
1042  else if ( &l7==&l5 ) { st7=i5+1; }
1043  else if ( &l7==&l4 ) { st7=i4+1; }
1044  else if ( &l7==&l3 ) { st7=i3+1; }
1045  else if ( &l7==&l2 ) { st7=i2+1; }
1046  else if ( &l7==&l1 ) { st7=i1+1; }
1047  for ( i7=st7; i7<len7; i7++ ) { //loop 7
1048  if (l7[i7]->Overlaps ( l6[i6] )
1049  || l7[i7]->Overlaps ( l5[i5] )
1050  || l7[i7]->Overlaps ( l4[i4] )
1051  || l7[i7]->Overlaps ( l3[i3] )
1052  || l7[i7]->Overlaps ( l2[i2] )
1053  || l7[i7]->Overlaps ( l1[i1] ) ) { continue; }//overlap 7
1054 
1055  st8=0;
1056  if ( &l8==&l7 ) { st8=i7+1; }
1057  else if ( &l8==&l6 ) { st8=i6+1; }
1058  else if ( &l8==&l5 ) { st8=i5+1; }
1059  else if ( &l8==&l4 ) { st8=i4+1; }
1060  else if ( &l8==&l3 ) { st8=i3+1; }
1061  else if ( &l8==&l2 ) { st8=i2+1; }
1062  else if ( &l8==&l1 ) { st8=i1+1; }
1063  for ( i8=st8; i8<len8; i8++ ) { //loop 8
1064  if (l8[i8]->Overlaps ( l7[i7] )
1065  || l8[i8]->Overlaps ( l6[i6] )
1066  || l8[i8]->Overlaps ( l5[i5] )
1067  || l8[i8]->Overlaps ( l4[i4] )
1068  || l8[i8]->Overlaps ( l3[i3] )
1069  || l8[i8]->Overlaps ( l2[i2] )
1070  || l8[i8]->Overlaps ( l1[i1] ) ) { continue; }//overlap 8
1071 
1072  st9=0;
1073  if ( &l9==&l8 ) { st9=i8+1; }
1074  else if ( &l9==&l7 ) { st9=i7+1; }
1075  else if ( &l9==&l6 ) { st9=i6+1; }
1076  else if ( &l9==&l5 ) { st9=i5+1; }
1077  else if ( &l9==&l4 ) { st9=i4+1; }
1078  else if ( &l9==&l3 ) { st9=i3+1; }
1079  else if ( &l9==&l2 ) { st9=i2+1; }
1080  else if ( &l9==&l1 ) { st9=i1+1; }
1081  for ( i9=st9; i9<len9; i9++ ) { //loop 9
1082  if (l9[i9]->Overlaps ( l8[i8] )
1083  || l9[i9]->Overlaps ( l7[i7] )
1084  || l9[i9]->Overlaps ( l6[i6] )
1085  || l9[i9]->Overlaps ( l5[i5] )
1086  || l9[i9]->Overlaps ( l4[i4] )
1087  || l9[i9]->Overlaps ( l3[i3] )
1088  || l9[i9]->Overlaps ( l2[i2] )
1089  || l9[i9]->Overlaps ( l1[i1] ) ) { continue; }//overlap 9
1090 
1091  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4() +l6[i6]->P4() +l7[i7]->P4() +l8[i8]->P4() +l9[i9]->P4();
1092  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() +l6[i6]->Charge() +l7[i7]->Charge() +l8[i8]->Charge() +l9[i9]->Charge();
1093 
1094  RhoCandidate c ( vl,charge );
1095  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() +l6[i6]->P4Cov() +l7[i7]->P4Cov() +l8[i8]->P4Cov() +l9[i9]->P4Cov() );
1096 
1097  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) |l6[i6]->GetMarker ( 0 ) |l7[i7]->GetMarker ( 0 ) |l8[i8]->GetMarker ( 0 ) |l9[i9]->GetMarker ( 0 ),0 );
1098  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) |l6[i6]->GetMarker ( 1 ) |l7[i7]->GetMarker ( 1 ) |l8[i8]->GetMarker ( 1 ) |l9[i9]->GetMarker ( 1 ),1 );
1099  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) |l6[i6]->GetMarker ( 2 ) |l7[i7]->GetMarker ( 2 ) |l8[i8]->GetMarker ( 2 ) |l9[i9]->GetMarker ( 2 ),2 );
1100  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) |l6[i6]->GetMarker ( 3 ) |l7[i7]->GetMarker ( 3 ) |l8[i8]->GetMarker ( 3 ) |l9[i9]->GetMarker ( 3 ),3 );
1101 
1102  c.SetInsertHistory(kFALSE);
1103  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
1104  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
1105  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
1106  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
1107  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
1108  if(l6[i6]->GetPointerToLinks() != 0) c.AddLinks(*l6[i6]->GetPointerToLinks());
1109  if(l7[i7]->GetPointerToLinks() != 0) c.AddLinks(*l7[i7]->GetPointerToLinks());
1110  if(l8[i8]->GetPointerToLinks() != 0) c.AddLinks(*l8[i8]->GetPointerToLinks());
1111  if(l9[i9]->GetPointerToLinks() != 0) c.AddLinks(*l9[i9]->GetPointerToLinks());
1112 
1113 
1114  Put ( &c );
1115  // after putting (does a copy and drops daughter links)
1116  RhoCandidate* cInList = Get(GetLength()-1);
1117  cInList->AddDaughterLinkSimple(l1[i1]) ;
1118  cInList->AddDaughterLinkSimple(l2[i2]) ;
1119  cInList->AddDaughterLinkSimple(l3[i3]) ;
1120  cInList->AddDaughterLinkSimple(l4[i4]) ;
1121  cInList->AddDaughterLinkSimple(l5[i5]) ;
1122  cInList->AddDaughterLinkSimple(l6[i6]) ;
1123  cInList->AddDaughterLinkSimple(l7[i7]) ;
1124  cInList->AddDaughterLinkSimple(l8[i8]) ;
1125  cInList->AddDaughterLinkSimple(l9[i9]) ;
1126  } //loop9
1127  } //loop8
1128  } //loop7
1129  } //loop6
1130  } //loop5
1131  } //loop4
1132  } //loop3
1133  } //loop2
1134  } //loop1
1135 }
1136 
1138 {
1139  TLorentzVector vl;
1140  Double_t charge;
1141 
1142  const int len1=l1.GetLength();
1143  const int len2=l2.GetLength();
1144  const int len3=l3.GetLength();
1145  const int len4=l4.GetLength();
1146  const int len5=l5.GetLength();
1147  const int len6=l6.GetLength();
1148  const int len7=l7.GetLength();
1149  const int len8=l8.GetLength();
1150  const int len9=l9.GetLength();
1151  const int len10=l10.GetLength();
1152 
1153  int i1,i2,i3,i4,i5,i6,i7,i8,i9,i10;
1154  int st2,st3,st4,st5,st6,st7,st8,st9,st10;
1155 
1156  for ( i1=0; i1<len1; i1++ ) {
1157  st2=0;
1158  if ( &l2==&l1 ) { st2=i1+1; }
1159 
1160  for ( i2=st2; i2<len2; i2++ ) {
1161  if ( l1[i1]->Overlaps ( l2[i2] ) ) { continue; }
1162 
1163  st3=0;
1164  if ( &l3==&l2 ) { st3=i2+1; }
1165  else if ( &l3==&l1 ) { st3=i1+1; }
1166 
1167  for ( i3=st3; i3<len3; i3++ ) {
1168  if ( l3[i3]->Overlaps ( l2[i2] )
1169  || l3[i3]->Overlaps ( l1[i1] ) ) { continue; }
1170 
1171  st4=0;
1172  if ( &l4==&l3 ) { st4=i3+1; }
1173  else if ( &l4==&l2 ) { st4=i2+1; }
1174  else if ( &l4==&l1 ) { st4=i1+1; }
1175 
1176  for ( i4=st4; i4<len4; i4++ ) {
1177  if ( l4[i4]->Overlaps ( l3[i3] )
1178  || l4[i4]->Overlaps ( l2[i2] )
1179  || l4[i4]->Overlaps ( l1[i1] ) ) { continue; }
1180 
1181  st5=0;
1182  if ( &l5==&l4 ) { st5=i4+1; }
1183  else if ( &l5==&l3 ) { st5=i3+1; }
1184  else if ( &l5==&l2 ) { st5=i2+1; }
1185  else if ( &l5==&l1 ) { st5=i1+1; }
1186 
1187  for ( i5=st5; i5<len5; i5++ ) {
1188  if ( l5[i5]->Overlaps ( l4[i4] )
1189  || l5[i5]->Overlaps ( l3[i3] )
1190  || l5[i5]->Overlaps ( l2[i2] )
1191  || l5[i5]->Overlaps ( l1[i1] ) ) { continue; }
1192 
1193  st6=0;
1194  if ( &l6==&l5 ) { st6=i5+1; }
1195  else if ( &l6==&l4 ) { st6=i4+1; }
1196  else if ( &l6==&l3 ) { st6=i3+1; }
1197  else if ( &l6==&l2 ) { st6=i2+1; }
1198  else if ( &l6==&l1 ) { st6=i1+1; }
1199  for ( i6=st6; i6<len6; i6++ ) { //loop 6
1200  if (l6[i6]->Overlaps ( l5[i5] )
1201  || l6[i6]->Overlaps ( l4[i4] )
1202  || l6[i6]->Overlaps ( l3[i3] )
1203  || l6[i6]->Overlaps ( l2[i2] )
1204  || l6[i6]->Overlaps ( l1[i1] ) ) { continue; }//overlap 6
1205 
1206  st7=0;
1207  if ( &l7==&l6 ) { st7=i6+1; }
1208  else if ( &l7==&l5 ) { st7=i5+1; }
1209  else if ( &l7==&l4 ) { st7=i4+1; }
1210  else if ( &l7==&l3 ) { st7=i3+1; }
1211  else if ( &l7==&l2 ) { st7=i2+1; }
1212  else if ( &l7==&l1 ) { st7=i1+1; }
1213  for ( i7=st7; i7<len7; i7++ ) { //loop 7
1214  if (l7[i7]->Overlaps ( l6[i6] )
1215  || l7[i7]->Overlaps ( l5[i5] )
1216  || l7[i7]->Overlaps ( l4[i4] )
1217  || l7[i7]->Overlaps ( l3[i3] )
1218  || l7[i7]->Overlaps ( l2[i2] )
1219  || l7[i7]->Overlaps ( l1[i1] ) ) { continue; }//overlap 7
1220 
1221  st8=0;
1222  if ( &l8==&l7 ) { st8=i7+1; }
1223  else if ( &l8==&l6 ) { st8=i6+1; }
1224  else if ( &l8==&l5 ) { st8=i5+1; }
1225  else if ( &l8==&l4 ) { st8=i4+1; }
1226  else if ( &l8==&l3 ) { st8=i3+1; }
1227  else if ( &l8==&l2 ) { st8=i2+1; }
1228  else if ( &l8==&l1 ) { st8=i1+1; }
1229  for ( i8=st8; i8<len8; i8++ ) { //loop 8
1230  if (l8[i8]->Overlaps ( l7[i7] )
1231  || l8[i8]->Overlaps ( l6[i6] )
1232  || l8[i8]->Overlaps ( l5[i5] )
1233  || l8[i8]->Overlaps ( l4[i4] )
1234  || l8[i8]->Overlaps ( l3[i3] )
1235  || l8[i8]->Overlaps ( l2[i2] )
1236  || l8[i8]->Overlaps ( l1[i1] ) ) { continue; }//overlap 8
1237 
1238  st9=0;
1239  if ( &l9==&l8 ) { st9=i8+1; }
1240  else if ( &l9==&l7 ) { st9=i7+1; }
1241  else if ( &l9==&l6 ) { st9=i6+1; }
1242  else if ( &l9==&l5 ) { st9=i5+1; }
1243  else if ( &l9==&l4 ) { st9=i4+1; }
1244  else if ( &l9==&l3 ) { st9=i3+1; }
1245  else if ( &l9==&l2 ) { st9=i2+1; }
1246  else if ( &l9==&l1 ) { st9=i1+1; }
1247  for ( i9=st9; i9<len9; i9++ ) { //loop 9
1248  if (l9[i9]->Overlaps ( l8[i8] )
1249  || l9[i9]->Overlaps ( l7[i7] )
1250  || l9[i9]->Overlaps ( l6[i6] )
1251  || l9[i9]->Overlaps ( l5[i5] )
1252  || l9[i9]->Overlaps ( l4[i4] )
1253  || l9[i9]->Overlaps ( l3[i3] )
1254  || l9[i9]->Overlaps ( l2[i2] )
1255  || l9[i9]->Overlaps ( l1[i1] ) ) { continue; }//overlap 9
1256 
1257  st10=0;
1258  if ( &l10==&l9 ) { st10=i9+1; }
1259  else if ( &l10==&l8 ) { st10=i8+1; }
1260  else if ( &l10==&l7 ) { st10=i7+1; }
1261  else if ( &l10==&l6 ) { st10=i6+1; }
1262  else if ( &l10==&l5 ) { st10=i5+1; }
1263  else if ( &l10==&l4 ) { st10=i4+1; }
1264  else if ( &l10==&l3 ) { st10=i3+1; }
1265  else if ( &l10==&l2 ) { st10=i2+1; }
1266  else if ( &l10==&l1 ) { st10=i1+1; }
1267  for ( i10=st10; i10<len10; i10++ ) { //loop 10
1268  if ( l10[i10]->Overlaps ( l9[i9] )
1269  || l10[i10]->Overlaps ( l8[i8] )
1270  || l10[i10]->Overlaps ( l7[i7] )
1271  || l10[i10]->Overlaps ( l6[i6] )
1272  || l10[i10]->Overlaps ( l5[i5] )
1273  || l10[i10]->Overlaps ( l4[i4] )
1274  || l10[i10]->Overlaps ( l3[i3] )
1275  || l10[i10]->Overlaps ( l2[i2] )
1276  || l10[i10]->Overlaps ( l1[i1] ) ) { continue; }//overlap 10
1277 
1278 
1279 
1280  vl=l1[i1]->P4() +l2[i2]->P4() +l3[i3]->P4() +l4[i4]->P4() +l5[i5]->P4() +l6[i6]->P4() +l7[i7]->P4() +l8[i8]->P4() +l9[i9]->P4() +l10[i10]->P4();
1281  charge=l1[i1]->Charge() +l2[i2]->Charge() +l3[i3]->Charge() +l4[i4]->Charge() +l5[i5]->Charge() +l6[i6]->Charge() +l7[i7]->Charge() +l8[i8]->Charge() +l9[i9]->Charge() +l10[i10]->Charge();
1282 
1283  RhoCandidate c ( vl,charge );
1284  c.SetCovP4 ( l1[i1]->P4Cov() +l2[i2]->P4Cov() +l3[i3]->P4Cov() +l4[i4]->P4Cov() +l5[i5]->P4Cov() +l6[i6]->P4Cov() +l7[i7]->P4Cov() +l8[i8]->P4Cov() +l9[i9]->P4Cov() +l10[i10]->P4Cov() );
1285 
1286  c.SetMarker ( l1[i1]->GetMarker ( 0 ) |l2[i2]->GetMarker ( 0 ) |l3[i3]->GetMarker ( 0 ) |l4[i4]->GetMarker ( 0 ) |l5[i5]->GetMarker ( 0 ) |l6[i6]->GetMarker ( 0 ) |l7[i7]->GetMarker ( 0 ) |l8[i8]->GetMarker ( 0 ) |l9[i9]->GetMarker ( 0 ) |l10[i10]->GetMarker ( 0 ),0 );
1287  c.SetMarker ( l1[i1]->GetMarker ( 1 ) |l2[i2]->GetMarker ( 1 ) |l3[i3]->GetMarker ( 1 ) |l4[i4]->GetMarker ( 1 ) |l5[i5]->GetMarker ( 1 ) |l6[i6]->GetMarker ( 1 ) |l7[i7]->GetMarker ( 1 ) |l8[i8]->GetMarker ( 1 ) |l9[i9]->GetMarker ( 1 ) |l10[i10]->GetMarker ( 1 ),1 );
1288  c.SetMarker ( l1[i1]->GetMarker ( 2 ) |l2[i2]->GetMarker ( 2 ) |l3[i3]->GetMarker ( 2 ) |l4[i4]->GetMarker ( 2 ) |l5[i5]->GetMarker ( 2 ) |l6[i6]->GetMarker ( 2 ) |l7[i7]->GetMarker ( 2 ) |l8[i8]->GetMarker ( 2 ) |l9[i9]->GetMarker ( 2 ) |l10[i10]->GetMarker ( 2 ),2 );
1289  c.SetMarker ( l1[i1]->GetMarker ( 3 ) |l2[i2]->GetMarker ( 3 ) |l3[i3]->GetMarker ( 3 ) |l4[i4]->GetMarker ( 3 ) |l5[i5]->GetMarker ( 3 ) |l6[i6]->GetMarker ( 3 ) |l7[i7]->GetMarker ( 3 ) |l8[i8]->GetMarker ( 3 ) |l9[i9]->GetMarker ( 3 ) |l10[i10]->GetMarker ( 3 ),3 );
1290 
1291  c.SetInsertHistory(kFALSE);
1292  if(l1[i1]->GetPointerToLinks() != 0) c.AddLinks(*l1[i1]->GetPointerToLinks());
1293  if(l2[i2]->GetPointerToLinks() != 0) c.AddLinks(*l2[i2]->GetPointerToLinks());
1294  if(l3[i3]->GetPointerToLinks() != 0) c.AddLinks(*l3[i3]->GetPointerToLinks());
1295  if(l4[i4]->GetPointerToLinks() != 0) c.AddLinks(*l4[i4]->GetPointerToLinks());
1296  if(l5[i5]->GetPointerToLinks() != 0) c.AddLinks(*l5[i5]->GetPointerToLinks());
1297  if(l6[i6]->GetPointerToLinks() != 0) c.AddLinks(*l6[i6]->GetPointerToLinks());
1298  if(l7[i7]->GetPointerToLinks() != 0) c.AddLinks(*l7[i7]->GetPointerToLinks());
1299  if(l8[i8]->GetPointerToLinks() != 0) c.AddLinks(*l8[i8]->GetPointerToLinks());
1300  if(l9[i9]->GetPointerToLinks() != 0) c.AddLinks(*l9[i9]->GetPointerToLinks());
1301  if(l10[i10]->GetPointerToLinks() != 0) c.AddLinks(*l10[i10]->GetPointerToLinks());
1302 
1303 
1304  Put ( &c );
1305  // after putting (does a copy and drops daughter links)
1306  RhoCandidate* cInList = Get(GetLength()-1);
1307  cInList->AddDaughterLinkSimple(l1[i1]) ;
1308  cInList->AddDaughterLinkSimple(l2[i2]) ;
1309  cInList->AddDaughterLinkSimple(l3[i3]) ;
1310  cInList->AddDaughterLinkSimple(l4[i4]) ;
1311  cInList->AddDaughterLinkSimple(l5[i5]) ;
1312  cInList->AddDaughterLinkSimple(l6[i6]) ;
1313  cInList->AddDaughterLinkSimple(l7[i7]) ;
1314  cInList->AddDaughterLinkSimple(l8[i8]) ;
1315  cInList->AddDaughterLinkSimple(l9[i9]) ;
1316  cInList->AddDaughterLinkSimple(l10[i10]) ;
1317  } //loop10
1318  } //loop9
1319  } //loop8
1320  } //loop7
1321  } //loop6
1322  } //loop5
1323  } //loop4
1324  } //loop3
1325  } //loop2
1326  } //loop1
1327 }
1328 
1330 {
1331  a.PrintOn ( o );
1332  return o;
1333 }
1334 
1335 //extern "C" void qsort(void *, size_t, size_t, int (const void *,const void *));
1336 
1337 typedef int compare_function ( const void*, const void* );
1338 
1339 void RhoCandList::Sort ( int ( *compfunc ) ( const RhoCandidate**, const RhoCandidate** ) )
1340 {
1341  qsort ( fOwnList, GetNumberOfTracks(), sizeof ( void* ), ( compare_function* ) compfunc );
1342 }
1343 
1344 
1345 void RhoCandList::Select ( RhoCandList& l, Bool_t ( *selfunc ) ( RhoCandidate* ) )
1346 {
1347  Cleanup();
1348  const Int_t n = l.GetNumberOfTracks();
1349  for ( Int_t i=0; i<n; i++ ) {
1350  RhoCandidate* c = Get ( i );
1351  if ( selfunc ( c ) ) {
1352  Put ( c );
1353  }
1354  }
1355 }
1356 
1357 // Destructive selection
1358 
1360 {
1361  const Int_t n = GetNumberOfTracks();
1362  for ( Int_t i=0; i<n; i++ ) {
1363  RhoCandidate* c = Get ( i );
1364  if ( !pidmgr->Accept ( c ) ) { fOwnList->RemoveAt ( i ); }
1365  }
1366  fOwnList->Compress();
1367 }
1368 
1369 // Non-destructive selection
1370 
1372 {
1373  Cleanup();
1374  const Int_t n = l.GetNumberOfTracks();
1375  for ( Int_t i=0; i<n; i++ ) {
1376  RhoCandidate* c = l.Get ( i );
1377  if ( pidmgr->Accept ( c ) ) {
1378  Put ( c );
1379  }
1380  }
1381 }
1382 
1384 {
1385  const Int_t n = l.GetNumberOfTracks();
1386  for ( Int_t i=0; i<n; i++ ) {
1387  RhoCandidate* c = l.Get ( i );
1388  if ( 0==pidmgr || pidmgr->Accept ( c ) ) {
1389  Put ( c );
1390  }
1391  }
1392 }
void AddDaughterLinkSimple(const RhoCandidate *, bool verbose=true)
void InsertAt(Int_t i, const RhoCandidate *c)
Definition: RhoCandList.cxx:87
Double_t p
Definition: anasim.C:58
Int_t RemoveClones()
void Append(const RhoCandidate *c)
Definition: RhoCandList.h:52
void Cleanup()
Definition: RhoCandList.cxx:62
TObjArray * fOwnList
Definition: RhoCandList.h:185
Int_t i
Definition: run_full.C:25
TTree * b
void SetNumberOfTracks(Int_t)
Definition: RhoCandList.cxx:67
Int_t GetLength() const
Definition: RhoCandList.h:46
RhoCandList(const char *name="RhoCandList", UInt_t capacity=512)
Definition: RhoCandList.cxx:28
void Boost(const TVector3 &)
int n
virtual Bool_t Accept(RhoCandidate *)=0
TVector3 GetTotalMomentum(Double_t pmin=0.0)
void Boost(Double_t bx, Double_t by, Double_t bz)
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
RhoCandidate * operator[](Int_t)
void SetType(const TParticlePDG *pdt)
Bool_t fFast
Definition: RhoCandList.h:186
void CombineAndAppend(RhoCandList &l1, RhoCandList &l2)
Int_t a
Definition: anaLmdDigi.C:126
Double_t Energy() const
Definition: RhoCandidate.h:203
void Combine(RhoCandList &l1, RhoCandList &l2)
Double_t
Bool_t Overlaps(const RhoCandidate *c) const
Definition: RhoCandidate.h:396
void operator=(const RhoCandList &)
void Select(RhoParticleSelectorBase *pidmgr)
void SetType(const TParticlePDG *pdt, int start=0)
static RhoFactory * Instance()
Definition: RhoFactory.cxx:34
Int_t Remove(RhoCandidate *)
TString name
Int_t GetNumberOfTracks() const
Definition: RhoCandList.cxx:72
Bool_t Equals(const RhoCandidate *c) const
Definition: RhoCandidate.h:401
Int_t RemoveFamily(RhoCandidate *)
void Sort(int(*compfunc)(const RhoCandidate **, const RhoCandidate **))
Int_t OccurrencesOf(RhoCandidate *)
void SetCovP4(const TMatrixD &covP4)
static RhoCandidate * NewCandidate()
Definition: RhoFactory.cxx:52
int compare_function(const void *, const void *)
void Remainder(RhoCandList &)
virtual ~RhoCandList()
Definition: RhoCandList.cxx:52
void PrintOn(std::ostream &o=std::cout) const
void FillFittedList(RhoCandList &fittedlist)
ClassImp(PndAnaContFact)
RhoCandidate * GetFit() const
Definition: RhoCandidate.h:293
void Put(const RhoCandidate *, Int_t i=-1)
Definition: RhoCandList.cxx:77
void SetMarker(UInt_t l, UInt_t m)
RhoCandidate * GetConst(Int_t) const
UInt_t GetMarker(UInt_t m=0) const
Definition: RhoCandidate.h:406
Double_t GetTotalEnergy(Double_t emin=0.0)
RhoCandList * GetFittedList()
TVector3 P3() const
Definition: RhoCandidate.h:199
RhoCandidate * Get(Int_t)
Definition: RhoCandList.cxx:94
Double_t energy
Definition: plot_dirc.C:15