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

Last change on this file since 2572 was 2278, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 1.4 KB
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, Float_t min, Float_t max)
11{
12 Clear();
13
14 int nPoints = leds.GetEntries();
15
16 if (nPoints<5)
17 return;
18
19 int n=0;
20 for (int i=0; i<nPoints-2; i++)
21 for (int j=i+1; j<nPoints-1; j++)
22 for (int k=j+1; k<nPoints; k++)
23 {
24 Ring &ring = *new ((*this)[n]) Ring;
25
26 if (!ring.CalcCenter(leds, i, j, k))
27 {
28 RemoveAt(n);
29 continue;
30 }
31
32 //
33 //filter and remove rings with too big or too small radius
34 //
35 if ((min>=0&&ring.GetR()<min) || (max>=0&&ring.GetR()>max))
36 {
37 RemoveAt(n);
38 continue;
39 }
40
41 n++;
42 }
43
44 // Expand(n);
45}
46
47void Rings::CalcRings(Leds &leds, Float_t min, Float_t max)
48{
49 CalcCenters(leds, min, max);
50
51 fCenter.InterpolCenters(*this);
52
53 //
54 // angles v
55 //
56 const int n=leds.GetEntries();
57
58 for (int j=0; j<n; j++)
59 leds(j).CalcPhi(fCenter);
60}
61
62void Rings::Print(Option_t *o=NULL) const
63{
64 cout << "Number of Rings: " << GetEntries() << endl;
65 if (GetEntriesFast()>0)
66 {
67 TClonesArray::Print();
68 cout << "Center: " << endl;
69 fCenter.Print();
70 }
71}
Note: See TracBrowser for help on using the repository browser.