CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
ReadCosmicRayData-00-00-23/src/TestMapping.cxx
Go to the documentation of this file.
1// **************************************************************************
2// authors: L. Lavezzi (univ. of Torino & INFN, Italy)
3//
4
5//include system lib
6#include <iostream>
7#include <iomanip>
8#include <string>
9#include <cmath>
10
11// Include files
12#include "GaudiKernel/AlgFactory.h"
13#include "GaudiKernel/DataObject.h"
14#include "GaudiKernel/IEventProcessor.h"
15
16#include "GaudiKernel/Incident.h"
17#include "GaudiKernel/IIncidentSvc.h"
18#include "GaudiKernel/Memory.h"
19
20#include <csignal>
21
22// for save digit & cluster
23#include "GaudiKernel/ISvcLocator.h"
24#include "GaudiKernel/IDataProviderSvc.h"
25#include "GaudiKernel/Bootstrap.h"
26#include "GaudiKernel/RegistryEntry.h"
27#include "GaudiKernel/MsgStream.h"
28
29#include "CgemRawEvent/CgemDigi.h"
30#include "CgemRecEvent/RecCgemCluster.h"
31
32#include "Identifier/CgemID.h"
33#include "RawEvent/RawDataUtil.h"
34#include "RawEvent/DigiEvent.h"
35#include "ReconEvent/ReconEvent.h"
36#include "EventModel/EventHeader.h"
37#include "GaudiKernel/SmartDataPtr.h"
38
39#include "ReadCosmicRayData/TestMapping.h"
40#include "TMath.h"
41//using namespace std;
42
43
44TestMapping::TestMapping(const std::string& name, ISvcLocator* pSvcLocator):
45 Algorithm(name,pSvcLocator){
46
47 declareProperty("CosmicRayDataSetID", CosmicRayDataSetID = "CR201909");
48
49 // mapper = new StripMapper(CosmicRayDataSetID);
50
51}
52
54
55StatusCode TestMapping::initialize(){
56 MsgStream log(msgSvc(), name());
57 log << MSG::INFO << "TestMapping initialize()" << endreq;
58
59 StatusCode sc = service("CgemGeomSvc", m_geomSvc);
60 if(sc != StatusCode::SUCCESS) {
61 log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
62 return StatusCode::FAILURE;
63 }
64
65 output = new TFile("Mappingtest_histo.root", "RECREATE");
66
67 bool iscgemboss = PositionCgemBoss();
68 bool isGRAAL = PositionGRAAL();
69
70 cout << "CHECK CROSSING" << endl;
71 bool iscross = CheckCrossingCgemBoss();
72
73 cout << "CHECK FEB POSITIONS" << endl;
74 // bool ismap = mapper->FillMap();
75 bool isfeb = CheckFEBPositionCgemBoss();
76
77 return StatusCode::SUCCESS;
78}
79
80
81StatusCode TestMapping::execute(){
82 MsgStream log(msgSvc(), name());
83 cout << "->TestMapping::execute" << endl;
84 cout << "geomtry service pointer " << m_geomSvc << endl;
85 return StatusCode::SUCCESS;
86}
87
88
90 const int nlayer = 3; // CHECK hardcoded
91 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
92 const int nview = 2;
93 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded
94
95 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
96 for(int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
97
98 CgemGeoReadoutPlane* anode = m_geomSvc->getReadoutPlane(ilayer, isheet);
99 int layerid = anode->getLayerId();
100 int sheetid = anode->getSheetId();
101 int nxstrip = anode->getNXstrips();
102 int nvstrip = anode->getNVstrips();
103 double anode_radius_x = anode->getRX();
104 double anode_radius_v = anode->getRV();
105
106 for(int iview = 0; iview < nview; iview++) {
107
108 int nstrip = nxstrip;
109 if(iview==1) nstrip = nvstrip;
110
111 for(int istrip=0; istrip < nstrip; istrip++) {
112 const Identifier ident = CgemID::strip_id(layerid, sheetid, iview, istrip);
113
114 // output
115 bool isxstrip = CgemID::is_xstrip(ident);
116 int stripid = CgemID::strip(ident);
117
118 if(isxstrip==true) {
119 double s = anode->getCentralXFromXID(stripid);
120 double phi = anode->getPhiFromXID(stripid);
121
122 if(layerid==0) {
123 stripid_L1_x[istrip] = stripid;
124 s_L1_S1[istrip] = s;
125 phi_L1_S1[istrip] = phi;
126 }
127 else if(layerid==1 && sheetid==0) {
128 stripid_L2_x[istrip] = stripid;
129 s_L2_S1[istrip] = s;
130 phi_L2_S1[istrip] = phi;
131 }
132 else if(layerid==1 && sheetid==1) {
133 s_L2_S2[istrip] = s;
134 phi_L2_S2[istrip] = phi;
135 }
136 else if(layerid==2 && sheetid==0) {
137 stripid_L3_x[istrip] = stripid;
138 s_L3_S1[istrip] = s;
139 phi_L3_S1[istrip] = phi;
140 }
141 else if(layerid==2 && sheetid==1) {
142 s_L3_S2[istrip] = s;
143 phi_L3_S2[istrip] = phi;
144 }
145 }
146 else {
147 double v = anode->getCentralVFromVID(stripid);
148
149 if(layerid==0) {
150 stripid_L1_v[istrip] = stripid;
151 v_L1_S1[istrip] = v;
152 }
153 else if(layerid==1 && sheetid==0) {
154 stripid_L2_v[istrip] = stripid;
155 v_L2_S1[istrip] = v;
156 }
157 else if(layerid==1 && sheetid==1) v_L2_S2[istrip] = v;
158 else if(layerid==2 && sheetid==0) {
159 stripid_L3_v[istrip] = stripid;
160 v_L3_S1[istrip] = v;
161 }
162 else if(layerid==2 && sheetid==1) v_L3_S2[istrip] = v;
163
164 }
165 }
166 }
167 }
168 }
169
170 return true;
171}
172
173
175 const int nlayer = 3; // CHECK hardcoded
176 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
177 const int nview = 2;
178 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded
179
180 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
181 for(int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
182
183 CgemGeoReadoutPlane* anode = m_geomSvc->getReadoutPlane(ilayer, isheet);
184 int layerid = anode->getLayerId();
185 int sheetid = anode->getSheetId();
186 int nxstrip = anode->getNXstrips();
187 int nvstrip = anode->getNVstrips();
188 double anode_radius_x = anode->getRX();
189 double anode_radius_v = anode->getRV();
190 double radius = 0.5 * (anode_radius_x + anode_radius_v);
191 double zlength = anode->getLength();
192 double zmin = anode->getZmin();
193 double sangle = anode->getStereoAngle();
194
195 cout << "layerid " << layerid << " sheetid " << sheetid << endl;
196 cout << "nxstrip " << nxstrip << " nvstrip " << nvstrip << endl;
197 cout << "length " << zlength << " zmin " << zmin << endl;
198 cout << "middle radius " << radius << endl;
199 cout << "stereo angle " << sangle << " in deg " << sangle * TMath::RadToDeg() << endl;
200
201
202 // shoot
203 int nphi = nphistep;
204 double dphi = (360./nphi) * TMath::DegToRad();
205 if(layerid > 0) nphi *= 0.5;
206
207 int nz = nzstep;
208 double phimin = -180 * TMath::DegToRad();
209 if(sheetid > 0) phimin = 0. * TMath::DegToRad();
210 nphi -= dphi;
211 phimin += dphi;
212
213 double dz = zlength/nz;
214 // zmin defined
215
216 // cout << "PHI from " << phimin*TMath::RadToDeg() << " to " << (phimin + nphi * dphi) * TMath::RadToDeg() << endl;
217
218 for(int iphi = 0; iphi < nphi; iphi++) {
219 double phi = phimin + iphi * dphi;
220 double x = radius * cos(phi);
221 double y = radius * sin(phi);
222
223 if(layerid==0) {
224 phi_runner_L1_S1[iphi] = phi * TMath::RadToDeg();
225 x_runner_L1_S1[iphi] = x;
226 y_runner_L1_S1[iphi] = y;
227 }
228 else if(layerid==1 && sheetid==0) {
229 phi_runner_L2_S1[iphi] = phi * TMath::RadToDeg();
230 x_runner_L2_S1[iphi] = x;
231 y_runner_L2_S1[iphi] = y;
232 }
233 else if(layerid==1 && sheetid==1) {
234 phi_runner_L2_S2[iphi] = phi * TMath::RadToDeg();
235 x_runner_L2_S2[iphi] = x;
236 y_runner_L2_S2[iphi] = y;
237 }
238 else if(layerid==2 && sheetid==0) {
239 phi_runner_L3_S1[iphi] = phi * TMath::RadToDeg();
240 x_runner_L3_S1[iphi] = x;
241 y_runner_L3_S1[iphi] = y;
242 }
243 else if(layerid==2 && sheetid==1) {
244 phi_runner_L3_S2[iphi] = phi * TMath::RadToDeg();
245 x_runner_L3_S2[iphi] = x;
246 y_runner_L3_S2[iphi] = y;
247 }
248
249 // cout << endl;
250 // cout << "PHI " << phi * TMath::RadToDeg() << " degree" << endl;
251 // cout << "x " << x << " y " << y << endl;
252 // cout << "scan in z: " << endl;
253 for(int iz = 0; iz < nz; iz++) {
254 double dz = zlength/nz;
255 double z = zmin + iz * dz;
256 G4ThreeVector pos(x, y, z);
257
258 int X_ID, V_ID;
259 anode->getStripID(pos, X_ID, V_ID); // get the closest XID/VID
260
261 // cout << "z " << pos.z() << " X_ID " << X_ID << " V_ID " << V_ID << endl;
262 // cout << "X_ID " << X_ID << " " << ((int) (nxstrip * 0.5)) << endl;
263
264 if( X_ID < ((int) (nxstrip * 0.5))) {
265
266 // if(iz==0) cout << "PHI " << phi * TMath::RadToDeg() << " degree" << endl;
267 // cout << "X_ID " << X_ID << " V_ID " << V_ID << " x " << x << " y " << y << " z " << z << endl;
268
269 if(layerid==0) {
270 z_runner_L1_S1[iz] = z;
271 V_ID_atphi0_L1_S1[iz] = V_ID;
272 }
273 else if(layerid==1 && sheetid==0) {
274 z_runner_L2_S1[iz] = z;
275 V_ID_atphi0_L2_S1[iz] = V_ID;
276 }
277 else if(layerid==1 && sheetid==1) {
278 z_runner_L2_S2[iz] = z;
279 V_ID_atphi0_L2_S2[iz] = V_ID;
280 }
281 else if(layerid==2 && sheetid==0) {
282 z_runner_L3_S1[iz] = z;
283 V_ID_atphi0_L3_S1[iz] = V_ID;
284 }
285 else if(layerid==2 && sheetid==1) {
286 z_runner_L3_S2[iz] = z;
287 V_ID_atphi0_L3_S2[iz] = V_ID;
288 }
289 }
290
291 if(iz == 0) {
292
293
294 // cout << iz << " PHI " << phi << " X_ID " << X_ID << " V_ID " << V_ID << " x " << x << " y " << y << " z " << z << endl;
295
296 if(layerid==0) {
297 X_ID_L1_S1[iphi] = X_ID;
298 V_ID_atzmin_L1_S1[iphi] = V_ID;
299 }
300 else if(layerid==1 && sheetid==0) {
301 X_ID_L2_S1[iphi] = X_ID;
302 V_ID_atzmin_L2_S1[iphi] = V_ID;
303 }
304 else if(layerid==1 && sheetid==1) {
305 X_ID_L2_S2[iphi] = X_ID;
306 V_ID_atzmin_L2_S2[iphi] = V_ID;
307 }
308 else if(layerid==2 && sheetid==0) {
309 X_ID_L3_S1[iphi] = X_ID;
310 V_ID_atzmin_L3_S1[iphi] = V_ID;
311 }
312 else if(layerid==2 && sheetid==1) {
313 X_ID_L3_S2[iphi] = X_ID;
314 V_ID_atzmin_L3_S2[iphi] = V_ID;
315 }
316 }
317 else if(iz == nz-1) {
318 if(layerid==0) {
319 V_ID_atzmax_L1_S1[iphi] = V_ID;
320 }
321 else if(layerid==1 && sheetid==0) {
322 V_ID_atzmax_L2_S1[iphi] = V_ID;
323 }
324 else if(layerid==1 && sheetid==1) {
325 V_ID_atzmax_L2_S2[iphi] = V_ID;
326 }
327 else if(layerid==2 && sheetid==0) {
328 V_ID_atzmax_L3_S1[iphi] = V_ID;
329 }
330 else if(layerid==2 && sheetid==1) {
331 V_ID_atzmax_L3_S2[iphi] = V_ID;
332 }
333 }
334 }
335 }
336 }
337 }
338}
339
340
342 const int nlayer = 3; // CHECK hardcoded
343 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
344 const int nview = 2;
345
346 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
347 for(int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
348
349 CgemGeoReadoutPlane* anode = m_geomSvc->getReadoutPlane(ilayer, isheet);
350 int layerid = anode->getLayerId();
351 int sheetid = anode->getSheetId();
352 int nxstrip = anode->getNXstrips();
353 int nvstrip = anode->getNVstrips();
354
355 // cout << "LAYER " << layerid << " SHEET " << sheetid << endl;
356
357 int iview = 0;
358 int nstrip = nxstrip;
359 if(iview==1) nstrip = nvstrip;
360 // cout << "VIEW " << iview << endl;
361
362 for(int istrip=0; istrip < nstrip; istrip++) {
363 const Identifier ident = CgemID::strip_id(layerid, sheetid, iview, istrip);
364
365 // output
366 bool isxstrip = CgemID::is_xstrip(ident);
367 int stripid = CgemID::strip(ident);
368 double phi = anode->getPhiFromXID(stripid) * TMath::RadToDeg();
369
370 if(isxstrip == iview) cout << "ERROR " << isxstrip << " " << iview << endl;
371 // cout << "STRIP " << stripid << " PHI " << phi << " FEB " << mapper->GetFEB(stripid, iview, layerid, sheetid) << endl;
372 }
373
374 }
375 }
376
377 return true;
378}
379
380
381
383
384
385 if(CosmicRayDataSetID=="CR201909") {
386
387 const int nlayer = 3; // CHECK hardcoded
388 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
389 const int nview = 2;
390 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded
391
392 double pitch = 0.660; // CHECK
393 double anode_radius[3] = {90., 132.5, 175};
394 double overlap_gap[3] = {0.407, 0.32, 0.415};
395
396 double phi;
397 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
398 for(int iview = 0; iview < nview; iview++) {
399 int ntot = nstrip[ilayer][iview] * nsheet[ilayer];
400
401 for(int istrip = 0; istrip < ntot; istrip++) {
402 int stripid = istrip+1;
403
404 if(iview==0) {
405 phi = TMath::TwoPi() - (pitch/anode_radius[ilayer]) * stripid;
406 double x = cos(phi) * anode_radius[ilayer];
407 double z = sin(phi) * anode_radius[ilayer];
408 double phi_corr = TMath::Pi() - phi;
409
410 if(ilayer==0) {
411 stripid_L1_x_GRAAL[istrip] = stripid;
412 x_L1_GRAAL[istrip] = x;
413 z_L1_GRAAL[istrip] = z;
414 phi_L1_GRAAL[istrip] = phi;
415 phi_L1_GRAAL_corr[istrip] = phi_corr;
416 }
417 else if(ilayer==1) {
418 stripid_L2_x_GRAAL[istrip] = stripid;
419 x_L2_GRAAL[istrip] = x;
420 z_L2_GRAAL[istrip] = z;
421 phi_L2_GRAAL[istrip] = phi;
422 phi_L2_GRAAL_corr[istrip] = phi_corr;
423 }
424 else if(ilayer==2) {
425 stripid_L3_x_GRAAL[istrip] = stripid;
426 x_L3_GRAAL[istrip] = x;
427 z_L3_GRAAL[istrip] = z;
428 phi_L3_GRAAL[istrip] = phi;
429 phi_L3_GRAAL_corr[istrip] = phi_corr;
430 }
431 }
432 else {
433 // ......
434 }
435 }
436 }
437 }
438
439
440 return true;
441 }
442
443 return false;
444}
445
446StatusCode TestMapping::finalize(){
447 MsgStream log(msgSvc(),name());
448 log << MSG::INFO << "TestMapping finalize()" << endreq;
449
450 gs_L1_S1 = new TGraph(nstrip_L1_x, stripid_L1_x, s_L1_S1);
451 gphi_L1_S1 = new TGraph(nstrip_L1_x, stripid_L1_x, phi_L1_S1);
452 gv_L1_S1 = new TGraph(nstrip_L1_v, stripid_L1_v, v_L1_S1);
453
454 gs_L2_S1 = new TGraph(nstrip_L2_x, stripid_L2_x, s_L2_S1);
455 gphi_L2_S1 = new TGraph(nstrip_L2_x, stripid_L2_x, phi_L2_S1);
456 gv_L2_S1 = new TGraph(nstrip_L2_v, stripid_L2_v, v_L2_S1);
457 gs_L2_S2 = new TGraph(nstrip_L2_x, stripid_L2_x, s_L2_S2);
458 gphi_L2_S2 = new TGraph(nstrip_L2_x, stripid_L2_x, phi_L2_S2);
459 gv_L2_S2 = new TGraph(nstrip_L2_v, stripid_L2_v, v_L2_S2);
460
461 gs_L3_S1 = new TGraph(nstrip_L3_x, stripid_L3_x, s_L3_S1);
462 gphi_L3_S1 = new TGraph(nstrip_L3_x, stripid_L3_x, phi_L3_S1);
463 gv_L3_S1 = new TGraph(nstrip_L3_v, stripid_L3_v, v_L3_S1);
464 gs_L3_S2 = new TGraph(nstrip_L3_x, stripid_L3_x, s_L3_S2);
465 gphi_L3_S2 = new TGraph(nstrip_L3_x, stripid_L3_x, phi_L3_S2);
466 gv_L3_S2 = new TGraph(nstrip_L3_v, stripid_L3_v, v_L3_S2);
467
468 gs_L1_S1->SetName("gs_L1_S1");
469 gphi_L1_S1->SetName("gphi_L1_S1");
470 gv_L1_S1->SetName("gv_L1_S1");
471
472 gs_L2_S1->SetName("gs_L2_S1");
473 gphi_L2_S1->SetName("gphi_L2_S1");
474 gv_L2_S1->SetName("gv_L2_S1");
475 gs_L2_S2->SetName("gs_L2_S2");
476 gphi_L2_S2->SetName("gphi_L2_S2");
477 gv_L2_S2->SetName("gv_L2_S2");
478
479 gs_L3_S1->SetName("gs_L3_S1");
480 gphi_L3_S1->SetName("gphi_L3_S1");
481 gv_L3_S1->SetName("gv_L3_S1");
482 gs_L3_S2->SetName("gs_L3_S2");
483 gphi_L3_S2->SetName("gphi_L3_S2");
484 gv_L3_S2->SetName("gv_L3_S2");
485
486 gs_L1_S1->Write();
487 gphi_L1_S1->Write();
488 gv_L1_S1->Write();
489
490 gs_L2_S1->Write();
491 gphi_L2_S1->Write();
492 gv_L2_S1->Write();
493 gs_L2_S2->Write();
494 gphi_L2_S2->Write();
495 gv_L2_S2->Write();
496
497 gs_L3_S1->Write();
498 gphi_L3_S1->Write();
499 gv_L3_S1->Write();
500 gs_L3_S2->Write();
501 gphi_L3_S2->Write();
502 gv_L3_S2->Write();
503
504 // XSSING ----
505 gx_runner_L1_S1 = new TGraph(nphistep, phi_runner_L1_S1, x_runner_L1_S1);
506 gy_runner_L1_S1 = new TGraph(nphistep, phi_runner_L1_S1, y_runner_L1_S1);
507 gX_ID_L1_S1 = new TGraph(nphistep, phi_runner_L1_S1, X_ID_L1_S1);
508 gV_ID_atzmin_L1_S1 = new TGraph(nphistep, phi_runner_L1_S1, V_ID_atzmin_L1_S1);
509 gV_ID_atzmax_L1_S1 = new TGraph(nphistep, phi_runner_L1_S1, V_ID_atzmax_L1_S1);
510 gV_ID_atphi0_L1_S1 = new TGraph(nzstep, z_runner_L1_S1, V_ID_atphi0_L1_S1);
511
512 gx_runner_L2_S1 = new TGraph(0.5*nphistep, phi_runner_L2_S1, x_runner_L2_S1);
513 gy_runner_L2_S1 = new TGraph(0.5*nphistep, phi_runner_L2_S1, y_runner_L2_S1);
514 gX_ID_L2_S1 = new TGraph(0.5*nphistep, phi_runner_L2_S1, X_ID_L2_S1);
515 gV_ID_atzmin_L2_S1 = new TGraph(0.5*nphistep, phi_runner_L2_S1, V_ID_atzmin_L2_S1);
516 gV_ID_atzmax_L2_S1 = new TGraph(0.5*nphistep, phi_runner_L2_S1, V_ID_atzmax_L2_S1);
517 gV_ID_atphi0_L2_S1 = new TGraph(nzstep, z_runner_L2_S1, V_ID_atphi0_L2_S1);
518
519 gx_runner_L2_S2 = new TGraph(0.5*nphistep, phi_runner_L2_S2, x_runner_L2_S2);
520 gy_runner_L2_S2 = new TGraph(0.5*nphistep, phi_runner_L2_S2, y_runner_L2_S2);
521 gX_ID_L2_S2 = new TGraph(0.5*nphistep, phi_runner_L2_S2, X_ID_L2_S2);
522 gV_ID_atzmin_L2_S2 = new TGraph(0.5*nphistep, phi_runner_L2_S2, V_ID_atzmin_L2_S2);
523 gV_ID_atzmax_L2_S2 = new TGraph(0.5*nphistep, phi_runner_L2_S2, V_ID_atzmax_L2_S2);
524 gV_ID_atphi0_L2_S2 = new TGraph(nzstep, z_runner_L2_S2, V_ID_atphi0_L2_S2);
525
526 gx_runner_L3_S1 = new TGraph(0.5*nphistep, phi_runner_L3_S1, x_runner_L3_S1);
527 gy_runner_L3_S1 = new TGraph(0.5*nphistep, phi_runner_L3_S1, y_runner_L3_S1);
528 gX_ID_L3_S1 = new TGraph(0.5*nphistep, phi_runner_L3_S1, X_ID_L3_S1);
529 gV_ID_atzmin_L3_S1 = new TGraph(0.5*nphistep, phi_runner_L3_S1, V_ID_atzmin_L3_S1);
530 gV_ID_atzmax_L3_S1 = new TGraph(0.5*nphistep, phi_runner_L3_S1, V_ID_atzmax_L3_S1);
531 gV_ID_atphi0_L3_S1 = new TGraph(nzstep, z_runner_L3_S1, V_ID_atphi0_L3_S1);
532
533 gx_runner_L3_S2 = new TGraph(0.5*nphistep, phi_runner_L3_S2, x_runner_L3_S2);
534 gy_runner_L3_S2 = new TGraph(0.5*nphistep, phi_runner_L3_S2, y_runner_L3_S2);
535 gX_ID_L3_S2 = new TGraph(0.5*nphistep, phi_runner_L3_S2, X_ID_L3_S2);
536 gV_ID_atzmin_L3_S2 = new TGraph(0.5*nphistep, phi_runner_L3_S2, V_ID_atzmin_L3_S2);
537 gV_ID_atzmax_L3_S2 = new TGraph(0.5*nphistep, phi_runner_L3_S2, V_ID_atzmax_L3_S2);
538 gV_ID_atphi0_L3_S2 = new TGraph(nzstep, z_runner_L3_S2, V_ID_atphi0_L3_S2);
539
540
541 gx_runner_L1_S1->SetName("gx_runner_L1_S1");
542 gy_runner_L1_S1->SetName("gy_runner_L1_S1");
543 gX_ID_L1_S1->SetName("gX_ID_L1_S1");
544 gV_ID_atzmin_L1_S1->SetName("gV_ID_atzmin_L1_S1");
545 gV_ID_atzmax_L1_S1->SetName("gV_ID_atzmax_L1_S1");
546 gV_ID_atphi0_L1_S1->SetName("gV_ID_atphi0_L1_S1");
547
548 gx_runner_L2_S1->SetName("gx_runner_L2_S1");
549 gy_runner_L2_S1->SetName("gy_runner_L2_S1");
550 gX_ID_L2_S1->SetName("gX_ID_L2_S1");
551 gV_ID_atzmin_L2_S1->SetName("gV_ID_atzmin_L2_S1");
552 gV_ID_atzmax_L2_S1->SetName("gV_ID_atzmax_L2_S1");
553 gV_ID_atphi0_L2_S1->SetName("gV_ID_atphi0_L2_S1");
554
555 gx_runner_L2_S2->SetName("gx_runner_L2_S2");
556 gy_runner_L2_S2->SetName("gy_runner_L2_S2");
557 gX_ID_L2_S2->SetName("gX_ID_L2_S2");
558 gV_ID_atzmin_L2_S2->SetName("gV_ID_atzmin_L2_S2");
559 gV_ID_atzmax_L2_S2->SetName("gV_ID_atzmax_L2_S2");
560 gV_ID_atphi0_L2_S2->SetName("gV_ID_atphi0_L2_S2");
561
562 gx_runner_L3_S1->SetName("gx_runner_L3_S1");
563 gy_runner_L3_S1->SetName("gy_runner_L3_S1");
564 gX_ID_L3_S1->SetName("gX_ID_L3_S1");
565 gV_ID_atzmin_L3_S1->SetName("gV_ID_atzmin_L3_S1");
566 gV_ID_atzmax_L3_S1->SetName("gV_ID_atzmax_L3_S1");
567 gV_ID_atphi0_L3_S1->SetName("gV_ID_atphi0_L3_S1");
568
569 gx_runner_L3_S2->SetName("gx_runner_L3_S2");
570 gy_runner_L3_S2->SetName("gy_runner_L3_S2");
571 gX_ID_L3_S2->SetName("gX_ID_L3_S2");
572 gV_ID_atzmin_L3_S2->SetName("gV_ID_atzmin_L3_S2");
573 gV_ID_atzmax_L3_S2->SetName("gV_ID_atzmax_L3_S2");
574 gV_ID_atphi0_L3_S2->SetName("gV_ID_atphi0_L3_S2");
575
576 gx_runner_L1_S1->Write();
577 gy_runner_L1_S1->Write();
578 gX_ID_L1_S1->Write();
579 gV_ID_atzmin_L1_S1->Write();
580 gV_ID_atzmax_L1_S1->Write();
581 gV_ID_atphi0_L1_S1->Write();
582
583 gx_runner_L2_S1->Write();
584 gy_runner_L2_S1->Write();
585 gX_ID_L2_S1->Write();
586 gV_ID_atzmin_L2_S1->Write();
587 gV_ID_atzmax_L2_S1->Write();
588 gV_ID_atphi0_L2_S1->Write();
589
590 gx_runner_L2_S2->Write();
591 gy_runner_L2_S2->Write();
592 gX_ID_L2_S2->Write();
593 gV_ID_atzmin_L2_S2->Write();
594 gV_ID_atzmax_L2_S2->Write();
595 gV_ID_atphi0_L2_S2->Write();
596
597 gx_runner_L3_S1->Write();
598 gy_runner_L3_S1->Write();
599 gX_ID_L3_S1->Write();
600 gV_ID_atzmin_L3_S1->Write();
601 gV_ID_atzmax_L3_S1->Write();
602 gV_ID_atphi0_L3_S1->Write();
603
604 gx_runner_L3_S2->Write();
605 gy_runner_L3_S2->Write();
606 gX_ID_L3_S2->Write();
607 gV_ID_atzmin_L3_S2->Write();
608 gV_ID_atzmax_L3_S2->Write();
609 gV_ID_atphi0_L3_S2->Write();
610
611
612
613 // ----------------------
614 gx_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, x_L1_GRAAL);
615 gz_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, z_L1_GRAAL);
616 gphi_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL);
617 gv_L1_GRAAL = new TGraph(nstrip_L1_v, stripid_L1_v_GRAAL, v_L1_GRAAL);
618
619 gx_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, x_L2_GRAAL);
620 gz_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, z_L2_GRAAL);
621 gphi_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL);
622 gv_L2_GRAAL = new TGraph(2*nstrip_L2_v, stripid_L2_v_GRAAL, v_L2_GRAAL);
623
624 gx_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, x_L3_GRAAL);
625 gz_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, z_L3_GRAAL);
626 gphi_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL);
627 gv_L3_GRAAL = new TGraph(2*nstrip_L3_v, stripid_L3_v_GRAAL, v_L3_GRAAL);
628
629 gx_L1_GRAAL->SetName("gx_L1_GRAAL");
630 gz_L1_GRAAL->SetName("gz_L1_GRAAL");
631 gphi_L1_GRAAL->SetName("gphi_L1_GRAAL");
632 gv_L1_GRAAL->SetName("gv_L1_GRAAL");
633
634 gx_L2_GRAAL->SetName("gx_L2_GRAAL");
635 gz_L2_GRAAL->SetName("gz_L2_GRAAL");
636 gphi_L2_GRAAL->SetName("gphi_L2_GRAAL");
637 gv_L2_GRAAL->SetName("gv_L2_GRAAL");
638
639 gx_L3_GRAAL->SetName("gx_L3_GRAAL");
640 gz_L3_GRAAL->SetName("gz_L3_GRAAL");
641 gphi_L3_GRAAL->SetName("gphi_L3_GRAAL");
642 gv_L3_GRAAL->SetName("gv_L3_GRAAL");
643
644 gx_L1_GRAAL->Write();
645 gz_L1_GRAAL->Write();
646 gphi_L1_GRAAL->Write();
647 gv_L1_GRAAL->Write();
648
649 gx_L2_GRAAL->Write();
650 gz_L2_GRAAL->Write();
651 gphi_L2_GRAAL->Write();
652 gv_L2_GRAAL->Write();
653
654 gx_L3_GRAAL->Write();
655 gz_L3_GRAAL->Write();
656 gphi_L3_GRAAL->Write();
657 gv_L3_GRAAL->Write();
658
659 // -----
660 gphi_L1_GRAAL_corr = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL_corr);
661 gphi_L2_GRAAL_corr = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL_corr);
662 gphi_L3_GRAAL_corr = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL_corr);
663
664 gphi_L1_GRAAL_corr->SetName("gphi_L1_GRAAL_corr");
665 gphi_L2_GRAAL_corr->SetName("gphi_L2_GRAAL_corr");
666 gphi_L3_GRAAL_corr->SetName("gphi_L3_GRAAL_corr");
667
668 gphi_L1_GRAAL_corr->Write();
669 gphi_L2_GRAAL_corr->Write();
670 gphi_L3_GRAAL_corr->Write();
671
672
673
674 output->Write();
675 output->Close();
676
677 return StatusCode::SUCCESS;
678}
679
680
Double_t x[10]
XmlRpcServer s
Definition: HelloServer.cpp:11
double sin(const BesAngle a)
double cos(const BesAngle a)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
double getPhiFromXID(int X_ID) const
void getStripID(G4ThreeVector pos, int &X_ID, int &V_ID) const
static int strip(const Identifier &id)
static bool is_xstrip(const Identifier &id)
static Identifier strip_id(int f_layer, int f_sheet, int f_strip_type, int f_strip)
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0
TestMapping(const std::string &name, ISvcLocator *pSvcLocator)