/[PAMELA software]/tracker/flight/PamelaViewer/src/AcViewer.cpp
ViewVC logotype

Contents of /tracker/flight/PamelaViewer/src/AcViewer.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jan 20 10:29:57 2009 UTC (15 years, 10 months ago) by pam-fi
Branch point for: MAIN, tracker
Initial revision

1 /**
2 * \file AcViewer.cpp
3 * \author Elena Vannuccini
4 */
5 #include <AcViewer.h>
6
7
8 #define COLO 5
9 #define LCOL 13 // color of tof-volume lines
10
11
12
13 /**
14 * Ac volume (projections) constructor
15 */
16 GAcVolume::GAcVolume(){
17
18 }
19 //
20 void GAcVolume::DrawProjectionX(){
21 }
22 //
23 void GAcVolume::DrawProjectionY(){
24 }
25 //
26 void GAcVolume::Delete(){
27 };
28
29
30
31
32
33 //===============================================================
34 //
35 //
36 //===============================================================
37
38
39 /**
40 * Constructor
41 */
42 GAcLevel2::GAcLevel2(){
43
44 HitX = new TClonesArray("GAcHit");
45 HitY = new TClonesArray("GAcHit");
46
47 }
48
49 /**
50 * Constructor
51 */
52 GAcLevel2::GAcLevel2(AcLevel2* l2){
53
54 HitX = new TClonesArray("GAcHit");
55 HitY = new TClonesArray("GAcHit");
56 SetLevel2(l2);
57
58 };
59
60 /**
61 * Constructor
62 */
63 GAcLevel2::GAcLevel2(PamLevel2* l2){
64
65 HitX = new TClonesArray("GAcHit");
66 HitY = new TClonesArray("GAcHit");
67 SetLevel2(l2->GetAcLevel2());
68
69 };
70
71 void GAcLevel2::SetLevel2(AcLevel2* l2){
72
73 TClonesArray &hx = *HitX; //Int_t nhx =0;
74 TClonesArray &hy = *HitY; //Int_t nhy =0;
75
76 // --------------------------------------------
77 // loop over anticounters
78 // --------------------------------------------
79 Int_t nhitx = 0;
80 Int_t nhity = 0;
81 for(Int_t ipa=0; ipa<16; ipa++){
82 for(Int_t ibo=0; ibo<2; ibo++){
83 GAcHit hitx = GAcHit(ipa,(Int_t)(l2->HitPaddle(iplane,ipaddle)));
84 new((hx[nhitx])) GAcHit(&hitx); // << PADDLE HIT X
85 nhitx++;
86
87 GAcHit hity = GAcHit(ipa,(Int_t)(l2->HitPaddle(iplane,ipaddle)));
88 new((hy[nhity])) GAcHit(&hity); // << PADDLE HIT X
89 nhity++;
90 }
91 }
92
93 }
94
95 void GAcLevel2::Delete(){
96 HitX->Delete();
97 HitY->Delete();
98 }
99 void GAcLevel2::Clear(){
100 HitX->Clear("C");
101 HitY->Clear("C");
102 }
103
104 void GAcLevel2::DrawProjectionX(){
105 TClonesArray &s = *(HitX);
106 cout<<"Ac: X paddles: "<<HitX->GetEntries()<<endl;
107 // for(Int_t is=0; is<HitX->GetEntries(); is++){
108 // ((GAcHit*)s[is])->Draw();
109 // };
110 for(Int_t is=0; is<HitX->GetEntries(); is++){
111 // ((TBox*)s[is])->Draw();
112 ((GAcHit*)s[is])->DrawProjectionX();
113 };
114 }
115
116 void GAcLevel2::DrawProjectionY(){
117 TClonesArray &s = *(HitY);
118 cout<<"Ac: Y paddles: "<<HitY->GetEntries()<<endl;
119 // for(Int_t is=0; is<HitY->GetEntries(); is++){
120 // ((GAcHit*)s[is])->Draw();
121 // };
122 for(Int_t is=0; is<HitY->GetEntries(); is++){
123 // ((TBox*)s[is])->Draw();
124 ((GAcHit*)s[is])->DrawProjectionY();
125 };
126 };
127
128
129
130 //===============================================================
131 //
132 //
133 //===============================================================
134 GAcHit::GAcHit(){
135 hit_x = new TBox();
136 hit_y = new TBox();
137 }
138
139 GAcHit::GAcHit(Int_t iboard, Int_t ipaddle){
140
141 //---------------------------------------
142 // retrieve paddle positions
143 //---------------------------------------
144
145 }
146
147 GAcHit::GAcHit( GAcHit* gc ){
148 hit_x = new TBox(*(gc->hit_x));
149 hit_y = new TBox(*(gc->hit_y));
150 };
151
152 void GAcHit::Delete(){
153 hit_x->Delete();
154 hit_y->Delete();
155 };
156
157 void GAcHit::DrawProjectionX(){
158 hit_x->Draw();
159 };
160 void GAcHit::DrawProjectionY(){
161 hit_y->Draw();
162 };
163
164
165 ClassImp(GAcVolume);
166 ClassImp(GAcLevel2);

  ViewVC Help
Powered by ViewVC 1.1.23