source: trunk/MagicSoft/Cosy/caos/Rings.cc@ 1948

Last change on this file since 1948 was 1815, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 1020 bytes
Line 
1#include "Rings.h"
2
3#include <iostream.h>
4
5#include "Led.h"
6#include "Leds.h"
7
8ClassImp(Rings);
9
10void Rings::CalcCenters(const Leds &leds)
11{
12 Clear();
13
14 int nPoints = leds.GetEntries();
15
16 int n=0;
17 for (int i=0; i<nPoints-2; i++)
18 for (int j=i+1; j<nPoints-1; j++)
19 for (int k=j+1; k<nPoints; k++)
20 {
21 Ring &ring = *new ((*this)[n]) Ring;
22
23 if (!ring.CalcCenter(leds, i, j, k))
24 {
25 RemoveAt(n);
26 continue;
27 }
28
29 n++;
30 }
31
32 // Expand(n);
33}
34
35void Rings::CalcRings(Leds &leds)
36{
37 CalcCenters(leds);
38
39 fCenter.InterpolCenters(*this);
40
41 //
42 // angles v
43 //
44 const int n=leds.GetEntries();
45
46 for (int j=0; j<n; j++)
47 leds(j).CalcPhi(fCenter);
48}
49
50void Rings::Print(Option_t *o=NULL) const
51{
52 cout << "Number of Rings: " << GetEntries() << endl;
53 TClonesArray::Print();
54 cout << "Center: " << endl;
55 fCenter.Print();
56}
Note: See TracBrowser for help on using the repository browser.