CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
TestMapping Class Reference

#include <TestMapping.h>

+ Inheritance diagram for TestMapping:

Public Member Functions

 TestMapping (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TestMapping ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
bool PositionCgemBoss ()
 
bool PositionGRAAL ()
 
 TestMapping (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TestMapping ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
bool PositionCgemBoss ()
 
bool PositionGRAAL ()
 
bool CheckCrossingCgemBoss ()
 
bool CheckFEBPositionCgemBoss ()
 
 TestMapping (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TestMapping ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
bool PositionCgemBoss ()
 
bool PositionGRAAL ()
 
bool CheckCrossingCgemBoss ()
 
bool CheckFEBPositionCgemBoss ()
 
 TestMapping (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TestMapping ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
bool PositionCgemBoss ()
 
bool PositionGRAAL ()
 
bool CheckCrossingCgemBoss ()
 
bool CheckFEBPositionCgemBoss ()
 
 TestMapping (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TestMapping ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
bool PositionCgemBoss ()
 
bool PositionGRAAL ()
 
bool CheckCrossingCgemBoss ()
 
bool CheckFEBPositionCgemBoss ()
 

Detailed Description

Constructor & Destructor Documentation

◆ TestMapping() [1/5]

TestMapping::TestMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 44 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

44 :
45 Algorithm(name,pSvcLocator){
46
47 declareProperty("CosmicRayDataSetID", CosmicRayDataSetID = "CR201909");
48}

◆ ~TestMapping() [1/5]

TestMapping::~TestMapping ( )

Definition at line 50 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

50{}

◆ TestMapping() [2/5]

TestMapping::TestMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~TestMapping() [2/5]

TestMapping::~TestMapping ( )

◆ TestMapping() [3/5]

TestMapping::TestMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~TestMapping() [3/5]

TestMapping::~TestMapping ( )

◆ TestMapping() [4/5]

TestMapping::TestMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~TestMapping() [4/5]

TestMapping::~TestMapping ( )

◆ TestMapping() [5/5]

TestMapping::TestMapping ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~TestMapping() [5/5]

TestMapping::~TestMapping ( )

Member Function Documentation

◆ CheckCrossingCgemBoss() [1/4]

bool TestMapping::CheckCrossingCgemBoss ( )

Definition at line 174 of file bak_ReadCosmicRayData-00-00-12/src/TestMapping.cxx.

174 {
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}
Double_t x[10]
double sin(const BesAngle a)
double cos(const BesAngle a)
void getStripID(G4ThreeVector pos, int &X_ID, int &V_ID) const
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0

◆ CheckCrossingCgemBoss() [2/4]

bool TestMapping::CheckCrossingCgemBoss ( )

◆ CheckCrossingCgemBoss() [3/4]

bool TestMapping::CheckCrossingCgemBoss ( )

◆ CheckCrossingCgemBoss() [4/4]

bool TestMapping::CheckCrossingCgemBoss ( )

◆ CheckFEBPositionCgemBoss() [1/4]

bool TestMapping::CheckFEBPositionCgemBoss ( )

Definition at line 341 of file bak_ReadCosmicRayData-00-00-12/src/TestMapping.cxx.

341 {
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}
double getPhiFromXID(int X_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)

◆ CheckFEBPositionCgemBoss() [2/4]

bool TestMapping::CheckFEBPositionCgemBoss ( )

◆ CheckFEBPositionCgemBoss() [3/4]

bool TestMapping::CheckFEBPositionCgemBoss ( )

◆ CheckFEBPositionCgemBoss() [4/4]

bool TestMapping::CheckFEBPositionCgemBoss ( )

◆ execute() [1/5]

StatusCode TestMapping::execute ( )

Definition at line 71 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

71 {
72 MsgStream log(msgSvc(), name());
73 cout << "->TestMapping::execute" << endl;
74 cout << "geomtry service pointer " << m_geomSvc << endl;
75 return StatusCode::SUCCESS;
76}

◆ execute() [2/5]

StatusCode TestMapping::execute ( )

◆ execute() [3/5]

StatusCode TestMapping::execute ( )

◆ execute() [4/5]

StatusCode TestMapping::execute ( )

◆ execute() [5/5]

StatusCode TestMapping::execute ( )

◆ finalize() [1/5]

StatusCode TestMapping::finalize ( )

Definition at line 226 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

226 {
227 MsgStream log(msgSvc(),name());
228 log << MSG::INFO << "TestMapping finalize()" << endreq;
229
230 gs_L1_S1 = new TGraph(nstrip_L1_x, stripid_L1_x, s_L1_S1);
231 gphi_L1_S1 = new TGraph(nstrip_L1_x, stripid_L1_x, phi_L1_S1);
232 gv_L1_S1 = new TGraph(nstrip_L1_v, stripid_L1_v, v_L1_S1);
233
234 gs_L2_S1 = new TGraph(nstrip_L2_x, stripid_L2_x, s_L2_S1);
235 gphi_L2_S1 = new TGraph(nstrip_L2_x, stripid_L2_x, phi_L2_S1);
236 gv_L2_S1 = new TGraph(nstrip_L2_v, stripid_L2_v, v_L2_S1);
237 gs_L2_S2 = new TGraph(nstrip_L2_x, stripid_L2_x, s_L2_S2);
238 gphi_L2_S2 = new TGraph(nstrip_L2_x, stripid_L2_x, phi_L2_S2);
239 gv_L2_S2 = new TGraph(nstrip_L2_v, stripid_L2_v, v_L2_S2);
240
241 gs_L3_S1 = new TGraph(nstrip_L3_x, stripid_L3_x, s_L3_S1);
242 gphi_L3_S1 = new TGraph(nstrip_L3_x, stripid_L3_x, phi_L3_S1);
243 gv_L3_S1 = new TGraph(nstrip_L3_v, stripid_L3_v, v_L3_S1);
244 gs_L3_S2 = new TGraph(nstrip_L3_x, stripid_L3_x, s_L3_S2);
245 gphi_L3_S2 = new TGraph(nstrip_L3_x, stripid_L3_x, phi_L3_S2);
246 gv_L3_S2 = new TGraph(nstrip_L3_v, stripid_L3_v, v_L3_S2);
247
248 gs_L1_S1->SetName("gs_L1_S1");
249 gphi_L1_S1->SetName("gphi_L1_S1");
250 gv_L1_S1->SetName("gv_L1_S1");
251
252 gs_L2_S1->SetName("gs_L2_S1");
253 gphi_L2_S1->SetName("gphi_L2_S1");
254 gv_L2_S1->SetName("gv_L2_S1");
255 gs_L2_S2->SetName("gs_L2_S2");
256 gphi_L2_S2->SetName("gphi_L2_S2");
257 gv_L2_S2->SetName("gv_L2_S2");
258
259 gs_L3_S1->SetName("gs_L3_S1");
260 gphi_L3_S1->SetName("gphi_L3_S1");
261 gv_L3_S1->SetName("gv_L3_S1");
262 gs_L3_S2->SetName("gs_L3_S2");
263 gphi_L3_S2->SetName("gphi_L3_S2");
264 gv_L3_S2->SetName("gv_L3_S2");
265
266 gs_L1_S1->Write();
267 gphi_L1_S1->Write();
268 gv_L1_S1->Write();
269
270 gs_L2_S1->Write();
271 gphi_L2_S1->Write();
272 gv_L2_S1->Write();
273 gs_L2_S2->Write();
274 gphi_L2_S2->Write();
275 gv_L2_S2->Write();
276
277 gs_L3_S1->Write();
278 gphi_L3_S1->Write();
279 gv_L3_S1->Write();
280 gs_L3_S2->Write();
281 gphi_L3_S2->Write();
282 gv_L3_S2->Write();
283
284 // ----------------------
285 gx_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, x_L1_GRAAL);
286 gz_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, z_L1_GRAAL);
287 gphi_L1_GRAAL = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL);
288 gv_L1_GRAAL = new TGraph(nstrip_L1_v, stripid_L1_v_GRAAL, v_L1_GRAAL);
289
290 gx_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, x_L2_GRAAL);
291 gz_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, z_L2_GRAAL);
292 gphi_L2_GRAAL = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL);
293 gv_L2_GRAAL = new TGraph(2*nstrip_L2_v, stripid_L2_v_GRAAL, v_L2_GRAAL);
294
295 gx_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, x_L3_GRAAL);
296 gz_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, z_L3_GRAAL);
297 gphi_L3_GRAAL = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL);
298 gv_L3_GRAAL = new TGraph(2*nstrip_L3_v, stripid_L3_v_GRAAL, v_L3_GRAAL);
299
300 gx_L1_GRAAL->SetName("gx_L1_GRAAL");
301 gz_L1_GRAAL->SetName("gz_L1_GRAAL");
302 gphi_L1_GRAAL->SetName("gphi_L1_GRAAL");
303 gv_L1_GRAAL->SetName("gv_L1_GRAAL");
304
305 gx_L2_GRAAL->SetName("gx_L2_GRAAL");
306 gz_L2_GRAAL->SetName("gz_L2_GRAAL");
307 gphi_L2_GRAAL->SetName("gphi_L2_GRAAL");
308 gv_L2_GRAAL->SetName("gv_L2_GRAAL");
309
310 gx_L3_GRAAL->SetName("gx_L3_GRAAL");
311 gz_L3_GRAAL->SetName("gz_L3_GRAAL");
312 gphi_L3_GRAAL->SetName("gphi_L3_GRAAL");
313 gv_L3_GRAAL->SetName("gv_L3_GRAAL");
314
315 gx_L1_GRAAL->Write();
316 gz_L1_GRAAL->Write();
317 gphi_L1_GRAAL->Write();
318 gv_L1_GRAAL->Write();
319
320 gx_L2_GRAAL->Write();
321 gz_L2_GRAAL->Write();
322 gphi_L2_GRAAL->Write();
323 gv_L2_GRAAL->Write();
324
325 gx_L3_GRAAL->Write();
326 gz_L3_GRAAL->Write();
327 gphi_L3_GRAAL->Write();
328 gv_L3_GRAAL->Write();
329
330 // -----
331 gphi_L1_GRAAL_corr = new TGraph(nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL_corr);
332 gphi_L2_GRAAL_corr = new TGraph(2*nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL_corr);
333 gphi_L3_GRAAL_corr = new TGraph(2*nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL_corr);
334
335 gphi_L1_GRAAL_corr->SetName("gphi_L1_GRAAL_corr");
336 gphi_L2_GRAAL_corr->SetName("gphi_L2_GRAAL_corr");
337 gphi_L3_GRAAL_corr->SetName("gphi_L3_GRAAL_corr");
338
339 gphi_L1_GRAAL_corr->Write();
340 gphi_L2_GRAAL_corr->Write();
341 gphi_L3_GRAAL_corr->Write();
342
343
344
345 output->Write();
346 output->Close();
347
348 return StatusCode::SUCCESS;
349}

◆ finalize() [2/5]

StatusCode TestMapping::finalize ( )

◆ finalize() [3/5]

StatusCode TestMapping::finalize ( )

◆ finalize() [4/5]

StatusCode TestMapping::finalize ( )

◆ finalize() [5/5]

StatusCode TestMapping::finalize ( )

◆ initialize() [1/5]

StatusCode TestMapping::initialize ( )

Definition at line 51 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

51 {
52 MsgStream log(msgSvc(), name());
53 log << MSG::INFO << "TestMapping initialize()" << endreq;
54
55 StatusCode sc = service("CgemGeomSvc", m_geomSvc);
56 if(sc != StatusCode::SUCCESS) {
57 log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
58 return StatusCode::FAILURE;
59 }
60
61 output = new TFile("Mappingtest_histo.root", "RECREATE");
62
63 bool iscgemboss = PositionCgemBoss();
64 bool isGRAAL = PositionGRAAL();
65
66
67 return StatusCode::SUCCESS;
68}

◆ initialize() [2/5]

StatusCode TestMapping::initialize ( )

◆ initialize() [3/5]

StatusCode TestMapping::initialize ( )

◆ initialize() [4/5]

StatusCode TestMapping::initialize ( )

◆ initialize() [5/5]

StatusCode TestMapping::initialize ( )

◆ PositionCgemBoss() [1/5]

bool TestMapping::PositionCgemBoss ( )

Definition at line 79 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

79 {
80 const int nlayer = 3; // CHECK hardcoded
81 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
82 const int nview = 2;
83 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded
84
85 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
86 for(int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
87
88 CgemGeoReadoutPlane* anode = m_geomSvc->getReadoutPlane(ilayer, isheet);
89 int layerid = anode->getLayerId();
90 int sheetid = anode->getSheetId();
91 int nxstrip = anode->getNXstrips();
92 int nvstrip = anode->getNVstrips();
93 double anode_radius_x = anode->getRX();
94 double anode_radius_v = anode->getRV();
95
96 for(int iview = 0; iview < nview; iview++) {
97
98 int nstrip = nxstrip;
99 if(iview==1) nstrip = nvstrip;
100
101 for(int istrip=0; istrip < nstrip; istrip++) {
102 const Identifier ident = CgemID::strip_id(layerid, sheetid, iview, istrip);
103
104 // output
105 bool isxstrip = CgemID::is_xstrip(ident);
106 int stripid = CgemID::strip(ident);
107
108 if(isxstrip==true) {
109 double s = anode->getCentralXFromXID(stripid);
110 double phi = anode->getPhiFromXID(stripid);
111
112 if(layerid==0) {
113 stripid_L1_x[istrip] = stripid;
114 s_L1_S1[istrip] = s;
115 phi_L1_S1[istrip] = phi;
116 }
117 else if(layerid==1 && sheetid==0) {
118 stripid_L2_x[istrip] = stripid;
119 s_L2_S1[istrip] = s;
120 phi_L2_S1[istrip] = phi;
121 }
122 else if(layerid==1 && sheetid==1) {
123 s_L2_S2[istrip] = s;
124 phi_L2_S2[istrip] = phi;
125 }
126 else if(layerid==2 && sheetid==0) {
127 stripid_L3_x[istrip] = stripid;
128 s_L3_S1[istrip] = s;
129 phi_L3_S1[istrip] = phi;
130 }
131 else if(layerid==2 && sheetid==1) {
132 s_L3_S2[istrip] = s;
133 phi_L3_S2[istrip] = phi;
134 }
135 }
136 else {
137 double v = anode->getCentralVFromVID(stripid);
138
139 if(layerid==0) {
140 stripid_L1_v[istrip] = stripid;
141 v_L1_S1[istrip] = v;
142 }
143 else if(layerid==1 && sheetid==0) {
144 stripid_L2_v[istrip] = stripid;
145 v_L2_S1[istrip] = v;
146 }
147 else if(layerid==1 && sheetid==1) v_L2_S2[istrip] = v;
148 else if(layerid==2 && sheetid==0) {
149 stripid_L3_v[istrip] = stripid;
150 v_L3_S1[istrip] = v;
151 }
152 else if(layerid==2 && sheetid==1) v_L3_S2[istrip] = v;
153 }
154 }
155 }
156 }
157 }
158
159 return true;
160}
XmlRpcServer s
Definition: HelloServer.cpp:11
**********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

Referenced by initialize().

◆ PositionCgemBoss() [2/5]

bool TestMapping::PositionCgemBoss ( )

◆ PositionCgemBoss() [3/5]

bool TestMapping::PositionCgemBoss ( )

◆ PositionCgemBoss() [4/5]

bool TestMapping::PositionCgemBoss ( )

◆ PositionCgemBoss() [5/5]

bool TestMapping::PositionCgemBoss ( )

◆ PositionGRAAL() [1/5]

bool TestMapping::PositionGRAAL ( )

Definition at line 162 of file bak_ReadCosmicRayData-00-00-09/src/TestMapping.cxx.

162 {
163
164
165 if(CosmicRayDataSetID=="CR201909") {
166
167 const int nlayer = 3; // CHECK hardcoded
168 const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded
169 const int nview = 2;
170 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded
171
172 double pitch = 0.660; // CHECK
173 double anode_radius[3] = {90., 132.5, 175};
174 double overlap_gap[3] = {0.407, 0.32, 0.415};
175
176 double phi;
177 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
178 for(int iview = 0; iview < nview; iview++) {
179 int ntot = nstrip[ilayer][iview] * nsheet[ilayer];
180
181 for(int istrip = 0; istrip < ntot; istrip++) {
182 int stripid = istrip+1;
183
184 if(iview==0) {
185 phi = TMath::TwoPi() - (pitch/anode_radius[ilayer]) * stripid;
186 double x = cos(phi) * anode_radius[ilayer];
187 double z = sin(phi) * anode_radius[ilayer];
188 double phi_corr = TMath::Pi() - phi;
189
190 if(ilayer==0) {
191 stripid_L1_x_GRAAL[istrip] = stripid;
192 x_L1_GRAAL[istrip] = x;
193 z_L1_GRAAL[istrip] = z;
194 phi_L1_GRAAL[istrip] = phi;
195 phi_L1_GRAAL_corr[istrip] = phi_corr;
196 }
197 else if(ilayer==1) {
198 stripid_L2_x_GRAAL[istrip] = stripid;
199 x_L2_GRAAL[istrip] = x;
200 z_L2_GRAAL[istrip] = z;
201 phi_L2_GRAAL[istrip] = phi;
202 phi_L2_GRAAL_corr[istrip] = phi_corr;
203 }
204 else if(ilayer==2) {
205 stripid_L3_x_GRAAL[istrip] = stripid;
206 x_L3_GRAAL[istrip] = x;
207 z_L3_GRAAL[istrip] = z;
208 phi_L3_GRAAL[istrip] = phi;
209 phi_L3_GRAAL_corr[istrip] = phi_corr;
210 }
211 }
212 else {
213 // ......
214 }
215 }
216 }
217 }
218
219
220 return true;
221 }
222
223 return false;
224}

Referenced by initialize().

◆ PositionGRAAL() [2/5]

bool TestMapping::PositionGRAAL ( )

◆ PositionGRAAL() [3/5]

bool TestMapping::PositionGRAAL ( )

◆ PositionGRAAL() [4/5]

bool TestMapping::PositionGRAAL ( )

◆ PositionGRAAL() [5/5]

bool TestMapping::PositionGRAAL ( )

The documentation for this class was generated from the following files: