CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvent.cxx
Go to the documentation of this file.
1//
2// BesEvent.cxx
3//
4
5#include <TGeoHelix.h>
6#include <TMath.h>
7#include <TGeoTube.h>
8#include <iostream>
9
10#include "BesVisLib/BesEvent.h"
11#include "BesVisLib/BesVisDisplay.h"
12#include "BesVisLib/BesGeometry.h"
13#include "Identifier/Identifier.h"
14#include "Identifier/MdcID.h"
15#include "Identifier/TofID.h"
16#include "Identifier/EmcID.h"
17#include "Identifier/MucID.h"
18
19#include "Identifier/CgemID.h" //Long Peixun's update: for CGEM
20#include "BesVisLib/CgemROOTGeo.h" //...
21
23
24using namespace std;
25
26#ifndef __CINT__
28#endif
29
30 //__________________________________________________________
31 // BesEvent
32 // BesVis Event
33 //
34 //
35 BesEvent::BesEvent() : TObject() {
36 //
37 // BesEvent default constructor
38
39 // Init
40 f_Magnetic = 1.0;
41 fCgemClusterCol = new TObjArray(); //Long Peixun's update: for CGEM clusters
42 fCgemClusterUFCol[0] = new TObjArray(); //Long Peixun's update: for CGEM clusters in UF view
43 fCgemClusterUFCol[1] = new TObjArray(); //...
44 fCgemClusterUFCol[2] = new TObjArray(); //...
45
46 fMdcTrackCol = new TObjArray();
47 fTofTrackCol = new TObjArray();
48 fEmcTrackCol = new TObjArray();
49 fMucTrackCol = new TObjArray();
50 fExtTrackCol = new TObjArray();
51 fMcParticleCol = new TObjArray();
52
53 pdgTable = new TDatabasePDG();
54}
55
56//__________________________________________________________
57
59 //
60 // BesEvent default destructor
61
62 // Delete all array elements
63 Delete();
64}
65
66//__________________________________________________________
67
68void BesEvent::Delete(Option_t *option) {
69 //
70 // Clear event
71 TString opt = option;
72 opt.ToUpper();
73
74 //Long Peixun's update: delete CGEM clusters
75 if (fCgemClusterCol)
76 {
77 for (int j = 0; j < fCgemClusterCol->GetEntries(); ++j)
78 delete fCgemClusterCol->At(j);
79 fCgemClusterCol->Clear("C");
80 delete fCgemClusterCol;
81 }
82 for (int i = 0; i < 3; ++i)
83 {
84 if (fCgemClusterUFCol[i])
85 {
86 for (int j = 0; j < fCgemClusterUFCol[i]->GetEntries(); ++j)
87 delete fCgemClusterUFCol[i]->At(j);
88 fCgemClusterUFCol[i]->Clear("C");
89 delete fCgemClusterUFCol[i];
90 }
91 }
92
93 if (fMdcTrackCol) {
94 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
95 delete fMdcTrackCol->At(j);
96 }
97 fMdcTrackCol->Clear("C");
98 delete fMdcTrackCol;
99 }
100 if (fTofTrackCol) {
101 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
102 delete fTofTrackCol->At(j);
103 }
104 fTofTrackCol->Clear("C");
105 delete fTofTrackCol;
106 }
107 if (fEmcTrackCol) {
108 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
109 delete fEmcTrackCol->At(j);
110 }
111 fEmcTrackCol->Clear("C");
112 delete fEmcTrackCol;
113 }
114 if (fMucTrackCol) {
115 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
116 delete fMucTrackCol->At(j);
117 }
118 fMucTrackCol->Clear("C");
119 delete fMucTrackCol;
120 }
121 if (fExtTrackCol) {
122 for (int j = 0; j < fExtTrackCol->GetEntries(); j++){
123 delete fExtTrackCol->At(j);
124 }
125 fExtTrackCol->Clear("C");
126 delete fExtTrackCol;
127 }
128 if (fMcParticleCol) {
129 for (int j = 0; j < fMcParticleCol->GetEntries(); j++){
130 delete fMcParticleCol->At(j);
131 }
132 fMcParticleCol->Clear("C");
133 delete fMcParticleCol;
134 }
135}
136
137//__________________________________________________________
138
139void BesEvent::Clear(Option_t *option) {
140 //
141 // Clear event
142 TString opt = option;
143 opt.ToUpper();
144
145 fDigiEvent->Clear("C");
146}
147
148//__________________________________________________________
149
150void BesEvent::SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec, TMcEvent *mcEvt)
151{
152 //fDigiEvent = 0;
153 fMcEvent = mcEvt;
154 fDigiEvent = digiEvent;
155 fEvtHeader = evtHeader;
156 fRecEvTime = recEvTime;
157 //fTrigEvent = trigEvt;
158 fTrigEvent = 0;
159 // ========================================
160 // set trig information
161 // ========================================
162 if (fTrigEvent != 0){
163 vector<Int_t> trigConditionVector;
164 vector<Int_t> trigChannelVector;
165
166 const TTrigData* trigData = fTrigEvent->getTrigData();
167 const Int_t timeType = trigData->getTimingType();
168 //std::cout << "BesEvent::timing type: " << timeType << std::endl;
169 Int_t trigCondition;
170 Int_t trigChannel;
171 for (Int_t i = 0; i < 48; i++){
172 trigCondition = trigData->getTrigCondition(i);
173 if (trigCondition) trigConditionVector.push_back(i);
174 //std::cout << "BesEvent::trig condition: " << trigCondition << std::endl;
175 }
176 for (Int_t i = 0; i < 16; i++){
177 trigChannel = trigData->getTrigChannel(i);
178 if (trigChannel) trigChannelVector.push_back(i);
179 //std::cout << "BesEvent::trigChannel: " << trigChannel << std::endl;
180 }
181 fEventHeader.SetEventTrig(timeType, trigConditionVector, trigChannelVector);
182 }
183 else {
184 std::cout << "fTrigEvent does not exit!" << std::endl;
185 }
186 // ========================================
187 // set time information
188 // ========================================
189 if (fEvtHeader != 0){
190 time_t now;
191 //now = time(NULL);
192 now = (time_t)evtHeader->time();
193 //char str_time[256];
194 //sprintf(str_time, ctime(&now));
195 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
196 //cout << "time now: " << str_time << endl;
197 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
198
199 struct tm *local_time;
200 local_time = localtime(&now);
201 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
202 //cout << "time now sec: " << local_time->tm_sec << endl;
203 //cout << "time now min: " << local_time->tm_min << endl;
204 //cout << "time now hour: "<< local_time->tm_hour << endl;
205 //cout << "time now day: " << local_time->tm_mday << endl;
206 //cout << "time now mon: " << local_time->tm_mon << endl;
207 //cout << "time now year: "<< local_time->tm_year << endl;
208 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
209
210 Int_t time1 = (1900 + local_time->tm_year) * 10000 + (1 + local_time->tm_mon) * 100
211 + local_time->tm_mday;
212 Int_t time2 = local_time->tm_hour * 10000 + local_time->tm_min * 100
213 + local_time->tm_sec;
214
215 fEventHeader.SetEventHeaderGeneral(fEvtHeader->getRunId(),
216 fEvtHeader->getEventId(), time1, time2);
217 }
218 else {
219 cout << "fEvtHeader does not exit" << endl;
220 }
221
222 // ========================================
223 // set event start time information
224 // ========================================
225 //Long Peixun's update: if this event is not a rec event, don't show estime, status and quality
226 if (fRecEvTime != 0)
227 {
228 fEventHeader.SetEventRec(isRec);
229 if (isRec)
230 fEventHeader.SetEventEvTime(fRecEvTime->estime(),fRecEvTime->status(),fRecEvTime->quality());
231 else
232 fEventHeader.SetEventEvTime(0.0, 0, 0.0);
233 }
234 else
235 {
236 cout << "fRecEvTime does not exit" << endl;
237 fEventHeader.SetEventRec(false);
238 fEventHeader.SetEventEvTime(0.0, 0, 0.0);
239 }
240
241 // ========================================
242 // set Mdc information
243 // ========================================
244 Double_t p = 0.0, pt = 0.0, px = 0.0, py = 0.0, pz = 0.0;
245 for (Int_t i = 0; i < GetMdcTrackNum(recEvent); i++) {
246 p += GetMdcTrack(i,recEvent)->p();
247 pt += GetMdcTrack(i,recEvent)->pxy();
248 px += GetMdcTrack(i,recEvent)->px();
249 py += GetMdcTrack(i,recEvent)->py();
250 pz += GetMdcTrack(i,recEvent)->pz();
251 }
252 fEventHeader.SetEventMdc(p, pt, px, py, pz);
253
254 // ========================================
255 // set Emc information
256 // ========================================
257 Double_t t = 9999.0;
258 Double_t e = 0.0;
259 for (Int_t i = 0; i < GetEmcShowerNum(recEvent); i++) {
260 e += GetEmcShower(i,recEvent)->energy();
261 }
262 fEventHeader.SetEventEmc(e);
263 // ========================================
264 // set digi and rec
265 // ========================================
266 if (fDigiEvent)
267 {
268 SetHits();
269 fEventHeader.SetEventMC(fDigiEvent->getFromMc());
270 }
271 else ClearHits(); //Long Peixun's update: If there is no hit in the event, clear previous hits
272 if (recEvent)
273 SetTracks(recEvent);
274 if (fMcEvent)
275 SetMcEvent(fMcEvent);
276}
277
278//__________________________________________________________
279
281{
282 if (!gBesGeometry) return;
283 //Long Peixun's update: for CGEM hits
290}
291
292//__________________________________________________________
293//Long Peixun's update: Clear all hits in detector
295 if (!gBesGeometry) return;
296
303}
304
305//__________________________________________________________
306
308 if (gBesGeometry)
309 {
310 //Long Peixun's update: Add judging detector geometry code
311 SetMdcTracks(recEvent);
312 SetTofTracks(recEvent);
313 SetEmcShowers(recEvent);
314 SetMucTracks(recEvent);
315 SetExtTracks(recEvent);
316 }
317}
318
319//__________________________________________________________
320//Long Peixun's update: for CGEM clusters
321void BesEvent::SetCgemClusters(const TRecCgemCluster* recCluster, int ncluster)
322{
323 if (!gBesGeometry || !gBesGeometry->GetCgemROOTGeo()) return;
325 if (fCgemClusterCol)
326 {
327 for (int j = 0; j < fCgemClusterCol->GetEntries(); ++j)
328 delete fCgemClusterCol->At(j);
329 fCgemClusterCol->Clear("C");
330 }
331 for (int i = 0; i < 3; ++i)
332 {
333 if (fCgemClusterUFCol[i])
334 {
335 for (int j = 0; j < fCgemClusterUFCol[i]->GetEntries(); ++j)
336 delete fCgemClusterUFCol[i]->At(j);
337 fCgemClusterUFCol[i]->Clear("C");
338 }
339 }
340
341 for (Int_t i = 0; i < ncluster; ++i)
342 {
343 if (recCluster[i].getflag() != 2) continue; //Only XY-clusters need to be displayed
344 double phi = recCluster[i].getrecphi();
345 double v = recCluster[i].getrecv();
346 double z = recCluster[i].getRecZ();
347 int layer = recCluster[i].getlayerid();
348 int sheet = recCluster[i].getsheetid();
349 int asstrk = recCluster[i].getTrkId();
350 int startx = recCluster[i].getstripid(0, 0);
351 int endx = recCluster[i].getstripid(0, 1);
352 int startv = recCluster[i].getstripid(1, 0);
353 int endv = recCluster[i].getstripid(1, 1);
354
355 double wid = cgem->getSheetWidth(layer, sheet);
356 double r = cgem->getRFromLayerSheet(layer, sheet);
357 if (layer < 0 || layer >= 3) continue;
358
359 //Construct CGEM clusters in unfolded view
360 double cx = phi * r;
361 if (layer == 0) cx -= 0.5 * wid;
362 else cx -= wid;
363 double cy = z; //cgem->calcZFromLayerSheetVIDPhi(layer, sheet, v, phi);
364 double cz = 0;
365 char data[100];
366 TString info;
367
368 BesGeoTrack* cgemClusterUF = 0;
369 //if (cgem->isPointInSheet(layer, sheet, phi, cy))
370 //{
371 cgemClusterUF = new BesGeoTrack();
372 cgemClusterUF->SetTrackType(7);
373 cgemClusterUF->SetMarker(cx, cy, cz);
374 cgemClusterUF->SetTrackID(asstrk);
375
376 info = "CgemCluster ";
377 info += recCluster[i].getclusterid();
378 cgemClusterUF->AddInfo(info);
379 sprintf(data, "layer=%i, sheet=%i", layer, sheet);
380 cgemClusterUF->AddInfo(TString(data));
381 sprintf(data, "#phi=%-.3f, V=%-.3f mm", phi, v);
382 cgemClusterUF->AddInfo(TString(data));
383 sprintf(data, "X-strips: %i to %i", startx, endx);
384 cgemClusterUF->AddInfo(TString(data));
385 sprintf(data, "V-strips: %i to %i", startv, endv);
386 cgemClusterUF->AddInfo(TString(data));
387 cgemClusterUF->CloseInfo();
388
389 fCgemClusterUFCol[layer]->Add(cgemClusterUF);
390 //}
391
392 //Construct CGEM clusters in normal view
393 cz = cy;
394 cx = r * TMath::Cos(phi);
395 cy = r * TMath::Sin(phi);
396
397 BesGeoTrack* cgemCluster = 0;
398 //if (cgem->isPointInSheet(layer, sheet, phi, cz))
399 //{
400 cgemCluster = new BesGeoTrack();
401 cgemCluster->SetTrackType(6);
402 cgemCluster->SetMarker(cx, cy, cz);
403 cgemCluster->SetTrackID(asstrk);
404
405 info = "CgemCluster ";
406 info += recCluster[i].getclusterid();
407 cgemCluster->AddInfo(info);
408 sprintf(data, "layer=%i, sheet=%i", layer, sheet);
409 cgemCluster->AddInfo(TString(data));
410 sprintf(data, "#phi=%-.3f, V=%-.3f mm", phi, v);
411 cgemCluster->AddInfo(TString(data));
412 sprintf(data, "X-strips: %i to %i", startx, endx);
413 cgemCluster->AddInfo(TString(data));
414 sprintf(data, "V-strips: %i to %i", startv, endv);
415 cgemCluster->AddInfo(TString(data));
416 cgemCluster->CloseInfo();
417 //}
418 fCgemClusterCol->Add(cgemCluster);
419 }
420}
421
422//__________________________________________________________
423
425 if (fMdcTrackCol){
426 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
427 delete fMdcTrackCol->At(j);
428 }
429 fMdcTrackCol->Clear("C");
430 }
431 int mdc_no = recEvent->getMdcTrackNum();
432 for (Int_t i = 0; i < mdc_no; i++) {
433 const TRecMdcTrack* recTrack =recEvent->getRecMdcTrack(i);
434 BesGeoTrack *mdcTrack = new BesGeoTrack();
435 mdcTrack->SetTrackType(0);
436 mdcTrack->SetTrackID(recTrack->trackId()); //Long Peixun's update: Set trackID in BesGeoTrack
437
438 ConstructMdcTrackFromRec(mdcTrack, recTrack,recEvent);
439 fMdcTrackCol->Add(mdcTrack);
440 }
441}
442
443//__________________________________________________________
444
446 if (fTofTrackCol) {
447 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
448 delete fTofTrackCol->At(j);
449 }
450 fTofTrackCol->Clear("C");
451 }
452 int tof_no = recEvent->getTofTrackNum();
453
454 for (Int_t i = 0; i < tof_no; i++) {
455 const TRecTofTrack* recTrack = recEvent->getTofTrack(i);
456 if ( !Is_tofCounter( recTrack->status())) continue;
457 BesGeoTrack *tofTrack = new BesGeoTrack();
458 tofTrack->SetTrackType(1);
459 tofTrack->SetTrackID(recTrack->trackID()); //Long Peixun's update: Set trackID in BesGeoTrack
460
461 ConstructTofTrackFromRec(tofTrack, recTrack,recEvent);
462 fTofTrackCol->Add(tofTrack);
463 }
464}
465
466//__________________________________________________________
467
469 if (fEmcTrackCol) {
470 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
471 delete fEmcTrackCol->At(j);
472 }
473 fEmcTrackCol->Clear("C");
474 }
475 int emc_no = recEvent->getEmcShowerNum();
476
477 for (Int_t i = 0; i < emc_no; i++) {
478 const TRecEmcShower* recShower =recEvent->getEmcShower(i);
479 BesGeoTrack *emcTrack = new BesGeoTrack();
480 emcTrack->SetTrackType(2);
481 emcTrack->SetTrackID(recShower->trackId()); //Long Peixun's update: Set trackID in BesGeoTrack
482
483 ConstructEmcTrackFromRec(emcTrack, recShower);
484 fEmcTrackCol->Add(emcTrack);
485 }
486}
487
488//__________________________________________________________
489
491 if (fMucTrackCol) {
492 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
493 delete fMucTrackCol->At(j);
494 }
495 fMucTrackCol->Clear("C");
496 }
497 int muc_no = recEvent->getMucTrackNum();
498 for (Int_t i = 0; i < muc_no; i++) {
499 const TRecMucTrack* recTrack =recEvent->getMucTrack(i);
500 BesGeoTrack *mucTrack = new BesGeoTrack();
501 mucTrack->SetTrackType(3);
502 mucTrack->SetTrackID(recTrack->trackId()); //Long Peixun's update: Set trackID in BesGeoTrack
503
504 ConstructMucTrackFromRec(mucTrack, recTrack);
505 fMucTrackCol->Add(mucTrack);
506 }
507}
508
509//__________________________________________________________
510
512 //if (fExtTrackCol) fExtTrackCol->Clear("C");
513
514 //for (Int_t i = 0; i < GetExtTrackNum(); i++) {
515 // const TExtTrack* recTrack = GetExtTrack(i);
516 // BesGeoTrack *extTrack = new BesGeoTrack();
517 // extTrack->SetTrackType(4);
518
519 // ConstructExtTrackFromRec(extTrack, recTrack);
520 // fExtTrackCol->Add(extTrack);
521 //}
522}
523
524//__________________________________________________________
525
527 if (fMcParticleCol){
528 for (int j = 0; j < fMcParticleCol->GetEntries(); j++){
529 delete fMcParticleCol->At(j);
530 }
531 fMcParticleCol->Clear("C");
532 }
533 int no = mcEvt->getMcParticleCol()->GetEntries();
534 for (Int_t i = 0; i < no; i++) {
535 const TMcParticle* mcPart = mcEvt->getMcParticle(i);
536 Int_t pdgID = mcPart->getParticleID();
537
538 // Skip the particle if not stable
539 // if( !mcPart->leafParticle() || mcPart->getDaughters().size() )
540 // continue;
541 // Skip beam electrons and intermediate quarks
542 if( mcPart->primaryParticle() || abs(pdgID) < 11)
543 continue;
544
545 BesMcTrack *mcTrack = new BesMcTrack();
546 mcTrack->SetTrackType(8);
547 // mcTrack->SetTrackID(mcPart->...); //Long Peixun's update: Set trackID in BesGeoTrack
548
549 ConstructMcTrack(mcTrack, mcPart);
550 fMcParticleCol->Add(mcTrack);
551 }
552}
553
554void BesEvent::ConstructMcTrack(BesMcTrack *mcTrack, const TMcParticle *mcPart) {
555
556 Int_t pdgID = mcPart->getParticleID();
557
558 TParticlePDG* partPDG = pdgTable->GetParticle(pdgID);
559 Int_t charge = 0;
560 if ( partPDG ) // Set charge of unknown particles to zero
561 charge = partPDG->Charge()/3; // Charge() gives e*3
562
563 Double_t pi = TMath::Pi();
564
565 Double_t px = mcPart->getInitialMomentumX(); // GeV
566 Double_t py = mcPart->getInitialMomentumY(); // GeV
567 Double_t pz = mcPart->getInitialMomentumZ(); // GeV
568 Double_t pt = std::sqrt(px*px+py*py);
569 Double_t ptot = std::sqrt(px*px+py*py+pz*pz);
570 Double_t cosTheta = (ptot == 0.0 ? 1.0 : pz/ptot);
571 Double_t phi = atan2(py, px);
572
573 Double_t field = -f_Magnetic; // Tesla
574 Double_t kvC = 3.0e8; // light speed
575
576 // unit is "cm"
577 Double_t orgx = mcPart->getInitialPositionX()*10;
578 Double_t orgy = mcPart->getInitialPositionY()*10;
579 Double_t orgz = mcPart->getInitialPositionZ()*10;
580
581
582 Double_t mdcR = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetRmax();
583 Double_t mdcZ = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetDz();
584
585 Double_t radius,zStep;
586 if (charge == 0) {
587 radius = 1e9 ; // cosmic ray test
588 zStep = 1e9;
589 }
590 else {
591 radius = (pt * 1.0e9 / kvC * 1e3) / fabs(charge * field) ;
592 zStep = 2*pi*radius * fabs(pz/pt);
593 }
594 Double_t curvature = 1.0/radius;
595 Double_t step = 10.0; // mm
596 Double_t delt = step*(1.0e-3)/kvC;
597
598 mcTrack->AddPoint(orgx, orgy, orgz, 0.0);
599 const Double_t *p;
600 Int_t nStep = 0;
601
602 Double_t x,y,z,t;
603 x = orgx;
604 y = orgy;
605 z = orgz;
606
607 if (charge == 0){ //cosmic ray test
608 //FIXME: What shall we do with neutral tracks?
609 // do {
610 // x = recTrack->helix(0)* 10 *
611 // cos(recTrack->helix(1))
612 // - nStep * step * sin(recTrack->helix(1));
613 // y = recTrack->helix(0)* 10 *
614 // sin(recTrack->helix(1))
615 // + nStep * step * cos(recTrack->helix(1));
616 // z = recTrack->helix(3)* 10 +
617 // nStep * step * recTrack->helix(4);
618 //
619 // mdcTrack->AddPoint(x, y, z, delt*nStep);
620 // Double_t mp[3];
621 // mp[0] = 0;
622 // mp[1] = 0;
623 // mp[2] = 0;
624 // mdcTrack->PaintMarker(mp);
625 // mdcTrack->SetMarkerColor(kBlack);
626 // mdcTrack->SetMarkerSize(10);
627 // mdcTrack->SetLineColor(kBlack);
628 //
629 // nStep++;
630 // }
631 // while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
632 //
633 // nStep = 0;
634 // do {
635 // x = recTrack->helix(0)* 10 *
636 // cos(recTrack->helix(1))
637 // - nStep * step * sin(recTrack->helix(1));
638 // y = recTrack->helix(0)* 10 *
639 // sin(recTrack->helix(1))
640 // + nStep * step * cos(recTrack->helix(1));
641 // z = recTrack->helix(3)* 10 +
642 // nStep * step * recTrack->helix(4);
643 //
644 // mdcTrack->AddPoint(x, y, z, delt*nStep);
645 // Double_t mp[3];
646 // mp[0] = 0;
647 // mp[1] = 0;
648 // mp[2] = 0;
649 // mdcTrack->PaintMarker(mp);
650 // mdcTrack->SetMarkerColor(kBlack);
651 // mdcTrack->SetMarkerSize(10);
652 // mdcTrack->SetLineColor(kRed);
653 //
654 // }
655 // while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
656 }
657 else{ //normal track
658 TGeoHelix helix(curvature, zStep, charge);
659 helix.InitPoint(orgx, orgy, orgz);
660
661 helix.InitDirection(px, py, pz, kFALSE);
662 //helix.InitDirection(1000, 10, 10, kFALSE);
663 helix.SetField(0.0, 0.0, field, kFALSE);
664
665 do {
666 // helix Step before GetCurrentPoint, or first point will be wrong
667 helix.Step(step);
668 p = helix.GetCurrentPoint();
669
670 mcTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
671 Double_t mp[3];
672 mp[0] = p[0];
673 mp[1] = p[1];
674 mp[2] = p[2];
675 mcTrack->PaintMarker(mp);
676 mcTrack->SetMarkerColor(kBlue);
677 mcTrack->SetLineColor(kBlue);
678 // mcTrack->SetLineStyle(10); // dashed-dotted line
679 // mcTrack->SetMarkerSize(10);
680 nStep++;
681 }
682 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
683
684 }
685 char data[200];
686 sprintf(data, "McTrack pdg=%i, charge=%i", mcPart->getParticleID(), charge);
687 mcTrack->AddInfo( TString(data) );
688
689 sprintf(data, "P=%-.3f GeV, Pt=%-.3f GeV", ptot, pt);
690 mcTrack->AddInfo( TString(data) );
691
692 sprintf(data, "Pxyz=(%-.3f,%-.3f,%-.3f) GeV", px, py, pz);
693 mcTrack->AddInfo( TString(data) );
694
695 sprintf(data, "#phi=%-.3f, #theta=%-.3f, cos#Theta=%-.3f", phi, acos(cosTheta), cosTheta);
696 mcTrack->AddInfo( TString(data) );
697
698 sprintf(data, "Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10);
699 mcTrack->AddInfo( TString(data) );
700
701 // sprintf(data, "#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->phi(),recTrack->theta(),cos(recTrack->theta()));
702 // mcTrack->AddInfo( TString(data) );
703
704 mcTrack->CloseInfo();
705}
706
707//__________________________________________________________
708
709void BesEvent::ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *fRecEvent) {
710
711 Double_t field = -f_Magnetic; // Tesla
712 Double_t kvC = 3.0e8; // light speed
713 Int_t charge = recTrack->charge();
714 Double_t pt = recTrack->pxy(); // GeV
715 Double_t pz = recTrack->pz(); // GeV
716 Double_t pi = TMath::Pi();
717
718 // unit is "cm"
719 Double_t orgx = recTrack->x()*10;
720 Double_t orgy = recTrack->y()*10;
721 Double_t orgz = recTrack->z()*10;
722
723
724 Double_t mdcR = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetRmax();
725 Double_t mdcZ = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetDz();
726
727 Double_t radius,zStep;
728 if (charge == 0) {
729 radius = 1e9 ; // cosmic ray test
730 zStep = 1e9;
731 }
732 else {
733 radius = (pt * 1.0e9 / kvC * 1e3) / fabs(charge * field) ;
734 zStep = 2*pi*radius * fabs(pz/pt);
735 }
736 Double_t curvature = 1.0/radius;
737 Double_t step = 10.0; // mm
738 Double_t delt = step*(1.0e-3)/kvC;
739
740 mdcTrack->AddPoint(orgx, orgy, orgz, 0.0);
741 const Double_t *p;
742 Int_t nStep = 0;
743
744 Double_t x,y,z,t;
745 x = orgx;
746 y = orgy;
747 z = orgz;
748
749 if (charge == 0){ //cosmic ray test
750 do {
751 x = recTrack->helix(0)* 10 *
752 cos(recTrack->helix(1))
753 - nStep * step * sin(recTrack->helix(1));
754 y = recTrack->helix(0)* 10 *
755 sin(recTrack->helix(1))
756 + nStep * step * cos(recTrack->helix(1));
757 z = recTrack->helix(3)* 10 +
758 nStep * step * recTrack->helix(4);
759
760 mdcTrack->AddPoint(x, y, z, delt*nStep);
761 Double_t mp[3];
762 mp[0] = 0;
763 mp[1] = 0;
764 mp[2] = 0;
765 mdcTrack->PaintMarker(mp);
766 mdcTrack->SetMarkerColor(kBlack);
767 mdcTrack->SetMarkerSize(10);
768 mdcTrack->SetLineColor(kBlack);
769
770 nStep++;
771 }
772 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
773
774 nStep = 0;
775 do {
776 x = recTrack->helix(0)* 10 *
777 cos(recTrack->helix(1))
778 - nStep * step * sin(recTrack->helix(1));
779 y = recTrack->helix(0)* 10 *
780 sin(recTrack->helix(1))
781 + nStep * step * cos(recTrack->helix(1));
782 z = recTrack->helix(3)* 10 +
783 nStep * step * recTrack->helix(4);
784
785 mdcTrack->AddPoint(x, y, z, delt*nStep);
786 Double_t mp[3];
787 mp[0] = 0;
788 mp[1] = 0;
789 mp[2] = 0;
790 mdcTrack->PaintMarker(mp);
791 mdcTrack->SetMarkerColor(kBlack);
792 mdcTrack->SetMarkerSize(10);
793 mdcTrack->SetLineColor(kRed);
794
795 }
796 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
797 }
798 else{ //normal track
799 TGeoHelix helix(curvature, zStep, charge);
800 helix.InitPoint(orgx, orgy, orgz);
801
802 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
803 //helix.InitDirection(1000, 10, 10, kFALSE);
804 helix.SetField(0.0, 0.0, field, kFALSE);
805
806 do {
807 // helix Step before GetCurrentPoint, or first point will be wrong
808 helix.Step(step);
809 p = helix.GetCurrentPoint();
810
811 mdcTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
812 Double_t mp[3];
813 mp[0] = p[0];
814 mp[1] = p[1];
815 mp[2] = p[2];
816 mdcTrack->PaintMarker(mp);
817 mdcTrack->SetMarkerColor(kBlack);
818 mdcTrack->SetMarkerSize(10);
819 nStep++;
820 }
821 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
822
823 }
824
825 // Add associated mdc hits
826 vector<UInt_t> vecHits(0);
827 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
828 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
829 TRecMdcHit *recMdcHit = (TRecMdcHit*)recMdcHitCol->At(i);
830 Int_t recHitId = recMdcHit->getTrkId();
831 Int_t recTrkId = recTrack->trackId();
832 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->getMdcId());
833 }
834 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
835 Identifier aMdcID( vecHits[i] );
836 int layer = MdcID::layer( aMdcID );
837 int wire = MdcID::wire( aMdcID );
838
839 Mdc2DWire* aHit = gBesGeometry->GetMdcROOTGeo()->Get2DWire(layer, wire);
840 mdcTrack->AddHit( aHit );
841 //Long Peixun's update: for Mdc 3D track display
842 TGeoPhysicalNode* pHit = gBesGeometry->GetMdcROOTGeo()->GetPhysicalReplica(layer, wire);
843 mdcTrack->Add3DHit(pHit);
844 }
845
846 //Long Peixun's update: Add associated cgem clusters
847 for (Int_t j = 0; j < fCgemClusterCol->GetEntries(); ++j)
848 {
849 BesGeoTrack *cluster = (BesGeoTrack*)fCgemClusterCol->At(j);
850 Int_t asstrk = cluster->GetTrackID();
851 Int_t recTrkId = recTrack->trackId();
852 if (recTrkId == asstrk)
853 mdcTrack->AddCluster(cluster);
854 }
855
856 mdcTrack->SetCharge(recTrack->charge());
857
858 // Add mdc track info
859 char data[200]; //Long Peixun's update: 100 -> 200
860 TString info;
861
862 info = TString("MdcTrack ");
863 info += recTrack->trackId();
864 mdcTrack->AddInfo( info );
865
866 sprintf(data, "charge=%i, status=%i", recTrack->charge(), recTrack->stat());
867 mdcTrack->AddInfo( TString(data) );
868
869 sprintf(data, "P=%-.3f GeV, Pt=%-.3f GeV", recTrack->p(), recTrack->pxy());
870 mdcTrack->AddInfo( TString(data) );
871
872 //sprintf(data, "Pt= %-.3f GeV", recTrack->pxy());
873 //mdcTrack->AddInfo( TString(data) );
874
875 sprintf(data, "Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->px(),recTrack->py(),recTrack->pz());
876 mdcTrack->AddInfo( TString(data) );
877
878 sprintf(data, "#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->phi(),recTrack->theta(),cos(recTrack->theta()));
879 mdcTrack->AddInfo( TString(data) );
880
881 sprintf(data, "Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10); //recTrack->x(), recTrack->y(), recTrack->z());
882 mdcTrack->AddInfo( TString(data) );
883
884 sprintf(data, "helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->helix(0),recTrack->helix(1),recTrack->helix(2),recTrack->helix(3), recTrack->helix(4));
885 mdcTrack->AddInfo( TString(data) );
886
887 sprintf(data, "nHit=%i, #chi^{2}= %-.3f",recTrack->ndof()+5, recTrack->chi2());
888 mdcTrack->AddInfo( TString(data) );
889
890 // sprintf(data, "ndof= %i, rms= %-.3f", recTrack->ndof(), recTrack->rms());
891 // mdcTrack->AddInfo( TString(data) );
892
893 // sprintf(data, "extrp= %-.3f, pathL= %-.3f", recTrack->extrp(), recTrack->pathLength());
894 // mdcTrack->AddInfo( TString(data) );
895
896 //sprintf(data, "nHits= %i, nSter= %i", recTrack->getNhits(), recTrack->nster());
897 //mdcTrack->AddInfo( TString(data) ); //Long Peixun's update: this line should be annotated
898
899 mdcTrack->CloseInfo();
900}
901
902//__________________________________________________________
903
904//void BesEvent::ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecETofTrack *recETrack){
905//
906// // Add associated tof hits
907// //vector<Int_t> vecBHits = recTrack->vecBHits();
908// //vector<Int_t> vecEHits = recTrack->vecEHits();
909// //vector<Int_t> vecHits;
910// //for (Int_t i = 0; i < (Int_t)vecBHits.size(); i++)
911// // vecHits.push_back( vecBHits[i] );
912// //for (Int_t i = 0; i < (Int_t)vecEHits.size(); i++)
913// // vecHits.push_back( vecEHits[i] );
914//
915// vector<Int_t> vecHits(0);
916// const TObjArray *recETofTrackCol = fRecEvent->getETofTrackCol();
917// for (Int_t i = 0; i < recETofTrackCol->GetEntriesFast(); i++){
918// TRecETofTrack *recHit = (TRecETofTrack*)recETofTrackCol->At(i);
919// if ( !Is_tofCounter( recHit->status())) continue;
920//
921// Int_t recHitId = recHit->trackID();
922// Int_t recTrkId = recETrack->trackID();
923// if (recHitId == recTrkId) vecHits.push_back(recHit->tofID());
924// }
925//
926// TGeoPhysicalNode *phyNode = 0;
927// Double_t x=0.0, y=0.0, z=0.0;
928// Int_t nHits = vecHits.size();
929// for (Int_t i = 0; i < nHits; i++) {
930// Identifier aTofID( vecHits[i] );
931//
932// int part;
933// if (recETrack->tofID() < 48) part = 0;
934// else part = 2;
935//
936// int layer = TofID::layer( aTofID );
937// int scin = TofID::phi_module( aTofID );
938//
939// Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
940// tofTrack->AddHit( aHit );
941//
942// // calculate average position
943// Double_t local[3] = {0.0, 0.0, 0.0};
944// Double_t master[3] = {0.0, 0.0, 0.0};
945// phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
946// if (phyNode)
947// phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
948// // transform to top
949// x += master[0];
950// y += master[1];
951// z += master[2];
952// }
953// x /= nHits;
954// y /= nHits;
955// z /= nHits;
956//
957// //if (recTrack->getPart() == 1) {
958// // z = 0.5*(recTrack->getZHit1() + recTrack->getZHit2());
959// //}
960// //else {
961// Double_t curR = TMath::Sqrt(x*x+y*y);
962// Double_t newR = recETrack->zrhit();
963// if (curR != 0.0) {
964// x = x * (newR/curR);
965// y = y * (newR/curR);
966// }
967//
968//
969// tofTrack->SetMarker(x, y, z);
970//
971// // Add tof track info
972// char data[100];
973// TString info;
974//
975// info = TString("TofTrack ");
976// info += recETrack->trackID();
977// tofTrack->AddInfo(info);
978//
979// //sprintf(data, "Part = %i, Qual1 = %i, Qual2 = %i", recTrack->getPart(), recTrack->getQual1(), recTrack->getQual2());
980// //tofTrack->AddInfo( TString(data) );
981//
982// //sprintf(data, "Tof = (%-.3f #pm %-.3f) ns", recTrack->getTof(), recTrack->getETof());
983// //tofTrack->AddInfo( TString(data) );
984//
985// //sprintf(data, "Tof1 = (%-.3f #pm %-.3f) ns", recTrack->getTof1(), recTrack->getETof1());
986// //tofTrack->AddInfo( TString(data) );
987//
988// //sprintf(data, "Tof2 = (%-.3f #pm %-.3f) ns", recTrack->getTof2(), recTrack->getETof2());
989// //tofTrack->AddInfo( TString(data) );
990//
991// //sprintf(data, "Path(1=%-.2f, 2=%-.2f) mm", recTrack->getPath1(), recTrack->getPath2());
992// //tofTrack->AddInfo( TString(data) );
993//
994// //sprintf(data, "Pulse(1=%-.0f, 2=%-.0f)", recTrack->getPh1(), recTrack->getPh2());
995// //tofTrack->AddInfo( TString(data) );
996//
997// //sprintf(data, "ZHit(1=%-.2fmm, 2=%-.2f)mm", recTrack->getZHit1(), recTrack->getZHit2());
998// //tofTrack->AddInfo( TString(data) );
999//
1000// ////sprintf(data, "ZTDC1=%-.2fmm, ZTDC2=%-.2fmm", recTrack->getZTDC1(), recTrack->getZTDC2());
1001// ////tofTrack->AddInfo( TString(data) );
1002//
1003// //sprintf(data, "RHit = %-.3f, Beta = %-.3f", recTrack->getRHit(), recTrack->getBeta());
1004// //tofTrack->AddInfo( TString(data) );
1005//
1006// //sprintf(data, "w_e = %-.2f%%, w_mu = %-.2f%%", recTrack->getWeightElectron()*100.0, recTrack->getWeightMuon()*100.0);
1007// //tofTrack->AddInfo( TString(data) );
1008//
1009// //sprintf(data, "w_pi = %-.2f%%, w_K = %-.2f%%", recTrack->getWeightPion()*100.0, recTrack->getWeightKaon()*100.0);
1010// //tofTrack->AddInfo( TString(data) );
1011//
1012// //sprintf(data, "w_P = %-.2f%%", recTrack->getWeightProton()*100.0);
1013// //tofTrack->AddInfo( TString(data) );
1014//
1015// tofTrack->CloseInfo();
1016//}
1017
1018
1019//__________________________________________________________
1021 const TRecTofTrack *recTrack,
1022 TDisTrack *fRecEvent){
1023
1024 vector<Int_t> vecBHits(0);
1025 vector<Int_t> vecEHits(0);
1026
1027 const TObjArray *recTofTrackCol = fRecEvent->getTofTrackCol();
1028 for (Int_t i = 0; i < recTofTrackCol->GetEntriesFast(); i++){
1029 TRecTofTrack *recHit = (TRecTofTrack*)recTofTrackCol->At(i);
1030 if ( !Is_tofCounter( recHit->status())) continue;
1031
1032 Int_t recHitId = recHit->trackID();
1033 Int_t recTrkId = recTrack->trackID();
1034 if (recHitId == recTrkId) {
1035 if ( Is_tofBarrel( recHit->status() ) ) {
1036 vecBHits.push_back(recHit->tofID());
1037 }
1038 else {
1039 vecEHits.push_back(recHit->tofID());
1040 }
1041 }
1042 }
1043
1044 TGeoPhysicalNode *phyNode = 0;
1045 Double_t x=0.0, y=0.0, z=0.0;
1046
1047 Int_t nHits;
1048 if (vecBHits.size()){
1049 nHits = vecBHits.size();
1050 for (Int_t i = 0; i < nHits; i++) {
1051
1052 int part = 1;
1053 int layer = 0;
1054 int scin = 0;
1055 if ( ( vecBHits[i] >= 0 ) && ( vecBHits[i] <= 87 ) ) {
1056 layer = 0;
1057 scin = vecBHits[i];
1058 }
1059 else {
1060 layer = 1;
1061 scin = vecBHits[i] - 88;
1062 }
1063
1064 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
1065 tofTrack->AddHit( aHit );
1066
1067 // calculate average position
1068 Double_t local[3] = {0.0, 0.0, 0.0};
1069 Double_t master[3] = {0.0, 0.0, 0.0};
1070 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
1071 tofTrack->Add3DHit(phyNode); //Long Peixun's update: for Tof 3D track display
1072 if (phyNode)
1073 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
1074 // transform to top
1075 x += master[0];
1076 y += master[1];
1077 z += master[2];
1078 }
1079 x /= nHits;
1080 y /= nHits;
1081 z /= nHits;
1082
1083 z = recTrack->zrhit();
1084
1085 tofTrack->SetMarker(x, y, z);
1086 }
1087
1088 else if (vecEHits.size()){
1089 nHits = vecEHits.size();
1090 for (Int_t i = 0; i < nHits; i++) {
1091
1092 int part = 0;
1093 int layer = 0;
1094 int scin = 0;
1095 if ( ( vecEHits[i] >= 0 ) && ( vecEHits[i] <= 47 ) ) {
1096 part = 2;
1097 scin = vecEHits[i];
1098 }
1099 else {
1100 part = 0;
1101 scin = vecEHits[i] - 48;
1102 }
1103
1104
1105 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
1106 tofTrack->AddHit( aHit );
1107
1108 // calculate average position
1109 Double_t local[3] = {0.0, 0.0, 0.0};
1110 Double_t master[3] = {0.0, 0.0, 0.0};
1111 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
1112 tofTrack->Add3DHit(phyNode); //Long Peixun's update: for Tof 3D track display
1113 if (phyNode)
1114 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
1115 // transform to top
1116 x += master[0];
1117 y += master[1];
1118 z += master[2];
1119 }
1120 x /= nHits;
1121 y /= nHits;
1122 z /= nHits;
1123
1124 tofTrack->SetMarker(x, y, z);
1125 }
1126
1127 // Add tof track info
1128 char data[100];
1129 TString info;
1130
1131 info = TString("TofTrack ");
1132 info += recTrack->trackID();
1133 tofTrack->AddInfo(info);
1134
1135 //sprintf(data, "Part = %i, Qual1 = %i, Qual2 = %i", recTrack->getPart(), recTrack->getQual1(), recTrack->getQual2());
1136 //tofTrack->AddInfo( TString(data) );
1137
1138 //sprintf(data, "Tof = (%-.3f #pm %-.3f) ns", recTrack->getTof(), recTrack->getETof());
1139 //tofTrack->AddInfo( TString(data) );
1140
1141 //sprintf(data, "Tof1 = (%-.3f #pm %-.3f) ns", recTrack->getTof1(), recTrack->getETof1());
1142 //tofTrack->AddInfo( TString(data) );
1143
1144 //sprintf(data, "Tof2 = (%-.3f #pm %-.3f) ns", recTrack->getTof2(), recTrack->getETof2());
1145 //tofTrack->AddInfo( TString(data) );
1146
1147 //sprintf(data, "Path(1=%-.2f, 2=%-.2f) mm", recTrack->getPath1(), recTrack->getPath2());
1148 //tofTrack->AddInfo( TString(data) );
1149
1150 //sprintf(data, "Pulse(1=%-.0f, 2=%-.0f)", recTrack->getPh1(), recTrack->getPh2());
1151 //tofTrack->AddInfo( TString(data) );
1152
1153 //sprintf(data, "ZHit(1=%-.2fmm, 2=%-.2f)mm", recTrack->getZHit1(), recTrack->getZHit2());
1154 //tofTrack->AddInfo( TString(data) );
1155
1156 ////sprintf(data, "ZTDC1=%-.2fmm, ZTDC2=%-.2fmm", recTrack->getZTDC1(), recTrack->getZTDC2());
1157 ////tofTrack->AddInfo( TString(data) );
1158
1159 //sprintf(data, "RHit = %-.3f, Beta = %-.3f", recTrack->getRHit(), recTrack->getBeta());
1160 //tofTrack->AddInfo( TString(data) );
1161
1162 //sprintf(data, "w_e = %-.2f%%, w_mu = %-.2f%%", recTrack->getWeightElectron()*100.0, recTrack->getWeightMuon()*100.0);
1163 //tofTrack->AddInfo( TString(data) );
1164
1165 //sprintf(data, "w_pi = %-.2f%%, w_K = %-.2f%%", recTrack->getWeightPion()*100.0, recTrack->getWeightKaon()*100.0);
1166 //tofTrack->AddInfo( TString(data) );
1167
1168 //sprintf(data, "w_P = %-.2f%%", recTrack->getWeightProton()*100.0);
1169 //tofTrack->AddInfo( TString(data) );
1170
1171 tofTrack->CloseInfo();
1172}
1173
1175
1176 Double_t x=0.0, y=0.0, z=0.0;
1177 x = recTrack->x() * 10.0;
1178 y = recTrack->y() * 10.0;
1179 z = recTrack->z() * 10.0;
1180
1181 emcTrack->SetMarker(x, y, z);
1182 // Add associated emc hits
1183 vector<Int_t> vecHits(0);
1184 map<Int_t, Double_t> cellMap = recTrack->cellIdMap();
1185 map<Int_t, Double_t>::iterator iCellMap;
1186 for (iCellMap = cellMap.begin(); iCellMap != cellMap.end(); iCellMap++){
1187 Int_t cellId = iCellMap->first;
1188 vecHits.push_back(cellId);
1189 }
1190 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
1191 Identifier aEmcID( vecHits[i] );
1192 int part = EmcID::barrel_ec( aEmcID );
1193 int theta = EmcID::theta_module( aEmcID );
1194 int phi = EmcID::phi_module( aEmcID );
1195 if (part == 1) theta = 43-theta; // 43 = m_kThetaBr-1
1196
1197 Emc2DCrystal* aHit = gBesGeometry->GetEmcROOTGeo()->Get2DCrystal(part, phi, theta);
1198 emcTrack->AddHit( aHit );
1199 //Long Peixun's update: for Emc 3D track display
1200 TGeoPhysicalNode* pHit = gBesGeometry->GetEmcROOTGeo()->GetPhysicalCrystal(part, phi, theta);
1201 emcTrack->Add3DHit(pHit);
1202 }
1203
1204 // Add Emc track info
1205 char data[100];
1206 TString info;
1207
1208 info = TString("EmcShower ");
1209 info += recTrack->trackId();
1210 emcTrack->AddInfo(info);
1211
1212 sprintf(data, "nHits = %i, status = %i", recTrack->numHits(), recTrack->status());
1213 emcTrack->AddInfo( TString(data) );
1214
1215 sprintf(data, "energy= (%.2f #pm %-.2f) MeV", recTrack->energy()*1000.0, recTrack->dE()*1000.0);
1216 emcTrack->AddInfo( TString(data) );
1217
1218 Identifier aEmcID( recTrack->cellId() );
1219 int part = EmcID::barrel_ec( aEmcID );
1220 int theta = EmcID::theta_module( aEmcID );
1221 int phi = EmcID::phi_module( aEmcID );
1222
1223 sprintf(data, "cell Id= (%i, #theta %i, #phi %i)", part, theta, phi);
1224 emcTrack->AddInfo( TString(data) );
1225
1226 sprintf(data, "module = %i", recTrack->module());
1227 emcTrack->AddInfo( TString(data) );
1228
1229 //sprintf(data, "x = (%-.3f #pm %-.3f) mm", x, recTrack->dx());
1230 //emcTrack->AddInfo( TString(data) );
1231
1232 //sprintf(data, "y = (%-.3f #pm %-.3f) mm", y, recTrack->dy());
1233 //emcTrack->AddInfo( TString(data) );
1234
1235 //sprintf(data, "z = (%-.3f #pm %-.3f) mm", z, recTrack->dz());
1236 //emcTrack->AddInfo( TString(data) );
1237
1238 sprintf(data, "#theta = (%-.3f #pm %-.3f)", recTrack->theta(), recTrack->dtheta());
1239 emcTrack->AddInfo( TString(data) );
1240
1241 sprintf(data, "#phi = (%-.3f #pm %-.3f)", recTrack->phi(), recTrack->dphi());
1242 emcTrack->AddInfo( TString(data) );
1243
1244 // sprintf(data, "cos (x=%-.3f, y=%-.3f, z=%-.3f)", recTrack->cosx(), recTrack->cosy(), recTrack->cosz()); //from boss6.1.0. no these varibles
1245 // emcTrack->AddInfo( TString(data) );
1246
1247 emcTrack->CloseInfo();
1248}
1249
1250//__________________________________________________________
1251
1253 if (recTrack->depth() <= 0.0) return; // bad track
1254
1255 Double_t field = 1e-3; // Tesla
1256 Double_t kvC = 3.0e8; // light speed
1257 Int_t charge = 1;
1258 Double_t pz = recTrack->pz(); // GeV
1259 Double_t pt =
1260 sqrt(recTrack->px()*recTrack->px() + recTrack->py()*recTrack->py()); // GeV
1261 Double_t pi = TMath::Pi();
1262
1263 Double_t mucR =
1264 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDX();
1265 Double_t mucZ =
1266 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDZ();
1267
1268 Double_t radius = 1.0e+9;
1269 Double_t curvature = 1.0/radius;
1270 Double_t zStep = 2*pi*radius * fabs(pz/pt);
1271 Double_t step = 1.0; // mm
1272 Double_t delt = step*(1.0e-3)/kvC;
1273
1274 TGeoHelix helix(curvature, zStep, charge);
1275
1276 Double_t x = recTrack->xPos() * 10.0;
1277 Double_t y = recTrack->yPos() * 10.0;
1278 Double_t z = recTrack->zPos() * 10.0;
1279
1280 helix.InitPoint(x, y, z);
1281 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
1282 helix.SetField(0.0, 0.0, field, kFALSE);
1283
1284 mucTrack->AddPoint(x, y, z, 0.0);
1285 const Double_t *p;
1286 Int_t nStep = 0;
1287 do {
1288 // helix Step before GetCurrentPoint, or first point will be wrong
1289 helix.Step(step);
1290 p = helix.GetCurrentPoint();
1291 mucTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
1292 Double_t mp[3];
1293 mp[0] = p[0];
1294 mp[1] = p[1];
1295 mp[2] = p[2];
1296 mucTrack->PaintMarker(mp);
1297 mucTrack->SetMarkerColor(kBlack);
1298 mucTrack->SetMarkerSize(10);
1299 nStep++;
1300 }
1301 while ( (p[0]*p[0] + p[1]*p[1]) < mucR*mucR && fabs(p[2]) < mucZ );
1302
1303 // Add associated muc hits
1304 vector<Int_t> vecHits = recTrack->vecHits();
1305 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
1306 Identifier aMucID( vecHits[i] );
1307 int part = MucID::part( aMucID );
1308 int seg = MucID::seg( aMucID );
1309 int gap = MucID::gap( aMucID );
1310 int strip = MucID::strip( aMucID );
1311
1312 Muc2DStrip* aHit = gBesGeometry->GetMucROOTGeo()->Get2DStrip(part, seg, gap, strip);
1313 mucTrack->AddHit( aHit );
1314 //Long Peixun's update: for Muc 3D track display
1315 TGeoPhysicalNode* pHit = gBesGeometry->GetMucROOTGeo()->GetPhysicalStrip(part, seg, gap, strip);
1316 mucTrack->Add3DHit(pHit);
1317 }
1318
1319 mucTrack->SetCharge(charge);
1320
1321 // Add Muc track info
1322 char data[100];
1323 TString info;
1324
1325 info = TString("MucTrack ");
1326 info += recTrack->trackId();
1327 mucTrack->AddInfo(info);
1328
1329 sprintf(data, "nHits= %i, maxHits= %i, nLayers= %i", recTrack->numHits(), recTrack->maxHitsInLayer(), recTrack->numLayers());
1330 mucTrack->AddInfo( TString(data) );
1331
1332 sprintf(data, "lastLayer (br= %i, ec= %i)", recTrack->brLastLayer(), recTrack->ecLastLayer());
1333 mucTrack->AddInfo( TString(data) );
1334
1335 sprintf(data, "depth = %.3f cm", recTrack->depth());
1336 mucTrack->AddInfo( TString(data) );
1337
1338 sprintf(data, "#chi^{2}= %-.3f, dof= %i, rms= %-.3f", recTrack->chi2(), recTrack->dof(), recTrack->rms());
1339 mucTrack->AddInfo( TString(data) );
1340
1341 sprintf(data, "Origin (%-.2f, %-.2f, %-.2f) cm", recTrack->xPos(), recTrack->yPos(), recTrack->zPos());
1342 mucTrack->AddInfo( TString(data) );
1343
1344 sprintf(data, "p (%-.3f, %-.3f, %-.3f) GeV", recTrack->px(), recTrack->py(), recTrack->pz());
1345 mucTrack->AddInfo( TString(data) );
1346
1347 mucTrack->CloseInfo();
1348}
1349
1350//__________________________________________________________
1351
1352//void BesEvent::ConstructExtTrackFromRec(BesGeoTrack *extTrack, const TExtTrack *recTrack) {
1353//
1354// extTrack->AddPoint(recTrack->GetTof1PositionX(),
1355// recTrack->GetTof1PositionY(),
1356// recTrack->GetTof1PositionZ(),
1357// 0.0);
1358// extTrack->AddPoint(recTrack->GetTof2PositionX(),
1359// recTrack->GetTof2PositionY(),
1360// recTrack->GetTof2PositionZ(),
1361// 0.1);
1362// extTrack->AddPoint(recTrack->GetEmcPositionX(),
1363// recTrack->GetEmcPositionY(),
1364// recTrack->GetEmcPositionZ(),
1365// 0.2);
1366// extTrack->AddPoint(recTrack->GetMucPositionX(),
1367// recTrack->GetMucPositionY(),
1368// recTrack->GetMucPositionZ(),
1369// 0.3);
1370//
1371// // Add Ext track info
1372// char data[100];
1373// TString info;
1374//
1375// info = TString("ExtTrack ");
1376// info += recTrack->GetTrackId();
1377// extTrack->AddInfo(info);
1378//
1379// sprintf(data, "Tof1 pos (%-.2f, %-.2f, %-.2f) mm",
1380// recTrack->GetTof1PositionX(), recTrack->GetTof1PositionY(), recTrack->GetTof1PositionZ());
1381// extTrack->AddInfo( TString(data) );
1382//
1383// sprintf(data, "Tof2 pos (%-.2f, %-.2f, %-.2f) mm",
1384// recTrack->GetTof2PositionX(), recTrack->GetTof2PositionY(), recTrack->GetTof2PositionZ());
1385// extTrack->AddInfo( TString(data) );
1386//
1387// sprintf(data, "Emc pos (%-.2f, %-.2f, %-.2f) mm",
1388// recTrack->GetEmcPositionX(), recTrack->GetEmcPositionY(), recTrack->GetEmcPositionZ());
1389// extTrack->AddInfo( TString(data) );
1390//
1391// sprintf(data, "Muc pos (%-.2f, %-.2f, %-.2f) mm",
1392// recTrack->GetMucPositionX(), recTrack->GetMucPositionY(), recTrack->GetMucPositionZ());
1393// extTrack->AddInfo( TString(data) );
1394//
1395// sprintf(data, "Tof1 p (%-.3f, %-.3f, %-.3f) GeV",
1396// recTrack->GetTof1MomentumX()/1000.0, recTrack->GetTof1MomentumY()/1000.0, recTrack->GetTof1MomentumZ()/1000.0);
1397// extTrack->AddInfo( TString(data) );
1398//
1399// sprintf(data, "Tof2 p (%-.3f, %-.3f, %-.3f) GeV",
1400// recTrack->GetTof2MomentumX()/1000.0, recTrack->GetTof2MomentumY()/1000.0, recTrack->GetTof2MomentumZ()/1000.0);
1401// extTrack->AddInfo( TString(data) );
1402//
1403// sprintf(data, "Emc p (%-.3f, %-.3f, %-.3f) GeV",
1404// recTrack->GetEmcMomentumX()/1000.0, recTrack->GetEmcMomentumY()/1000.0, recTrack->GetEmcMomentumZ()/1000.0);
1405// extTrack->AddInfo( TString(data) );
1406//
1407// sprintf(data, "Muc p (%-.3f, %-.3f, %-.3f) GeV",
1408// recTrack->GetMucMomentumX()/1000.0, recTrack->GetMucMomentumY()/1000.0, recTrack->GetMucMomentumZ()/1000.0);
1409// extTrack->AddInfo( TString(data) );
1410//
1411// extTrack->CloseInfo();
1412//}
1413
1414
1415//__________________________________________________________
1416
1417void BesEvent::DrawHits(Option_t *option) {
1418 if (gBesGeometry)
1419 {
1420 if (gBesGeometry->GetCgemROOTGeo()) //Long Peixun's update: for CGEM hits
1426 }
1427}
1428
1429//__________________________________________________________
1430
1431void BesEvent::DrawTracks(Option_t *option) {
1432
1433 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1434
1435 //Long Peixun's update: Always construct 3D line, whether draw it or not
1436 if (view)
1437 {
1438 // for (Int_t i = 0; i < fCgemTrackCol->GetEntries(); i++)
1439 // {
1440 // BesGeoTrack *track = (BesGeoTrack*)fCgemTrackCol->At(i);
1441 // if (view->GetVisTracksGlobal() && view->GetVisTracksCgem())
1442 // track->Draw();
1443 // else track->Construct3DLine();
1444 // }
1445
1446 for (Int_t i = 0; i < fMdcTrackCol->GetEntries(); i++)
1447 {
1448 BesGeoTrack *track = (BesGeoTrack*)fMdcTrackCol->At(i);
1449 if (view->GetVisTracksGlobal() && view->GetVisTracksMdc())
1450 track->Draw();
1451 else track->Construct3DLine();
1452 }
1453
1454 for (Int_t i = 0; i < fTofTrackCol->GetEntries(); i++)
1455 {
1456 BesGeoTrack *track = (BesGeoTrack*)fTofTrackCol->At(i);
1457 if (view->GetVisTracksGlobal() && view->GetVisTracksTof())
1458 track->Draw();
1459 else track->Construct3DLine();
1460 }
1461
1462 for (Int_t i = 0; i < fEmcTrackCol->GetEntries(); i++)
1463 {
1464 BesGeoTrack *track = (BesGeoTrack*)fEmcTrackCol->At(i);
1465 if (view->GetVisTracksGlobal() && view->GetVisTracksEmc())
1466 track->Draw();
1467 else track->Construct3DLine();
1468 }
1469
1470 for (Int_t i = 0; i < fMucTrackCol->GetEntries(); i++)
1471 {
1472 BesGeoTrack *track = (BesGeoTrack*)fMucTrackCol->At(i);
1473 if (view->GetVisTracksGlobal() && view->GetVisTracksMuc())
1474 track->Draw();
1475 else track->Construct3DLine();
1476 }
1477
1478 for (Int_t i = 0; i < fExtTrackCol->GetEntries(); i++)
1479 {
1480 BesGeoTrack *track = (BesGeoTrack*)fExtTrackCol->At(i);
1481 if (view->GetVisTracksGlobal() && view->GetVisTracksExt())
1482 track->Draw();
1483 else track->Construct3DLine();
1484 }
1485 }
1486}
1487
1488//__________________________________________________________
1489//Long Peixun's update: hits in CGEM 3D display
1490void BesEvent::DrawCgem3DHits(Option_t* option)
1491{
1494}
1495
1496//Long Peixun's update: hits in CGEM unfolded display
1497void BesEvent::DrawCgemUFHits(Option_t* option)
1498{
1501}
1502
1503//Long Peixun's update: clusters in CGEM display
1504void BesEvent::DrawCgemClusters(Option_t* option)
1505{
1506 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1507 if (view)
1508 {
1509 for (Int_t i = 0; i < fCgemClusterCol->GetEntries(); ++i)
1510 {
1511 BesGeoTrack* cluster = (BesGeoTrack*)fCgemClusterCol->At(i);
1512 if (view->GetVisCgemHitsGlobal() && view->GetVisCgemHitsClusters())
1513 cluster->Draw(option);
1514 }
1515 }
1516}
1517
1518//Long Peixun's update: clusters in CGEM unfolded display
1519void BesEvent::DrawCgemUFClusters(int layer, Option_t* option)
1520{
1521 if (layer < 0 || layer >= 3) return;
1522 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1523 if (view)
1524 {
1525 for (Int_t i = 0; i < fCgemClusterUFCol[layer]->GetEntries(); ++i)
1526 {
1527 BesGeoTrack* cluster = (BesGeoTrack*)fCgemClusterUFCol[layer]->At(i);
1528 if (view->GetVisCgemHitsGlobal() && view->GetVisCgemHitsClusters())
1529 cluster->Draw(option);
1530 }
1531 }
1532}
1533
1534//__________________________________________________________
1535
1536void BesEvent::DrawMcParticles(Option_t *option){
1537 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1538
1539 if (view)
1540 {
1541 for (Int_t i = 0; i < fMcParticleCol->GetEntries(); i++)
1542 {
1543 BesMcTrack *track = (BesMcTrack*)fMcParticleCol->At(i);
1544 if (view->GetVisMCTruthTrack())
1545 {
1546 track->Draw();
1547 }
1548 else track->Construct3DLine();
1549 }
1550 }
1551}
1552
1553//__________________________________________________________
1554
1555void BesEvent::Print(Option_t *option) {
1556 //
1557 // Print event information
1558 //
1559 // Options available:
1560 // '' - quiet, i.e. only numbers of hits and tracks etc. (default)
1561 // 'ALL' - very detailed output (might be hundreds of lines!)
1562 // 'Digi' - only Digi information
1563 // 'Dst' - only Dst information
1564 //
1565 TString opt = option;
1566 opt.ToUpper();
1567 Int_t i;
1568
1569 //cout << endl
1570 // << "==========================================================" << endl
1571 // << "Run: " << GetRun() << endl
1572 // << "Event: " << GetEvent() << endl
1573 // << "----------------------------------------------------------" << endl
1574 // << "Mdc digis: " << GetMdcDigiNum() << endl
1575 // << "Tof digis: " << GetTofDigiNum() << endl
1576 // << "Emc digis: " << GetEmcDigiNum() << endl
1577 // << "Muc digis: " << GetMucDigiNum() << endl
1578 // << "Mdc tracks: " << GetMdcTrackNum() << endl
1579 // << "Tof tracks: " << "debug++++++" /*GetTofTrackNum()*/ << endl
1580 // << "Emc tracks: " << GetEmcShowerNum() << endl
1581 // << "Muc tracks: " << GetMucTrackNum() << endl
1582 // << "Ext tracks: " << GetExtTrackNum() << endl
1583 // << "Dedx : " << GetDedxNum() << endl
1584 // << "----------------------------------------------------------" << endl;
1585
1586 if ( opt.Contains("ALL") || opt.Contains("Digi") ) {
1587 for ( i = 0; i < GetMdcDigiNum(); i++ ) GetMdcDigi(i)->Print();
1588 for ( i = 0; i < GetTofDigiNum(); i++ ) GetTofDigi(i)->Print();
1589 for ( i = 0; i < GetEmcDigiNum(); i++ ) GetEmcDigi(i)->Print();
1590 for ( i = 0; i < GetMucDigiNum(); i++ ) GetMucDigi(i)->Print();
1591 }
1592
1593 /* if ( opt.Contains("ALL") || opt.Contains("Dst") ) {
1594 for ( i = 0; i < GetMdcTrackNum(); i++ ) GetMdcTrack(i)->Print();
1595 // Tof -> BTof ETof
1596 //for ( i = 0; i < GetTofTrackNum(); i++ ) GetTofTrack(i)->Print();
1597 for ( i = 0; i < GetEmcShowerNum(); i++ ) GetEmcShower(i)->Print();
1598 for ( i = 0; i < GetMucTrackNum(); i++ ) GetMucTrack(i)->Print();
1599 cout << "wait for TRecExtEvent, BesEvent" << endl;
1600 //for ( i = 0; i < GetExtTrackNum(); i++ ) GetExtTrack(i)->Print();
1601 for ( i = 0; i < GetDedxNum(); i++ ) GetDedx(i)->Print();
1602 }
1603 */
1604 //cout << "=========================================================="
1605 //<< endl << endl;
1606}
1607
1608bool BesEvent::Is_tofCounter(UInt_t status){
1609 const unsigned int Counter_Mask = 0x00000004;
1610 const unsigned int Counter_Index = 2;
1611 return ((status & Counter_Mask) >> Counter_Index) ? true: false;
1612}
1613
1614bool BesEvent::Is_tofBarrel(UInt_t status) {
1615 const unsigned int Barrel_Index = 4;
1616 const unsigned int Barrel_Mask = 0x00000010;
1617 return ((status & Barrel_Mask) >> Barrel_Index ) ? true : false;
1618}
BesEvent * gEvent
Definition: BesEvent.cxx:22
ClassImp(BesEvent) BesEvent
Definition: BesEvent.cxx:27
TTree * data
Double_t x[10]
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:212
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
virtual void SetEventTrig(Int_t timeType, vector< Int_t > &trigConditionVector, vector< Int_t > &trigChannelVector)
virtual void SetEventMdc(Double_t p, Double_t pt, Double_t px, Double_t py, Double_t pz)
virtual void SetEventHeaderGeneral(Long64_t run, Long64_t event, Int_t time1, Int_t time2)
virtual void SetEventRec(Bool_t rec)
virtual void SetEventEvTime(Double_t time, Int_t status, Double_t quality)
virtual void SetEventEmc(Double_t e)
virtual void SetEventMC(Bool_t mc)
virtual void Delete(Option_t *option="")
Definition: BesEvent.cxx:68
virtual void SetHits()
Definition: BesEvent.cxx:280
virtual void DrawCgem3DHits(Option_t *option)
Definition: BesEvent.cxx:1490
virtual ~BesEvent()
Definition: BesEvent.cxx:58
virtual void Clear(Option_t *option="")
Definition: BesEvent.cxx:139
virtual void ClearHits()
Definition: BesEvent.cxx:294
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:1020
virtual void DrawCgemUFHits(Option_t *option)
Definition: BesEvent.cxx:1497
virtual void SetTofTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:445
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
virtual void SetMcEvent(TMcEvent *mcEvt)
Definition: BesEvent.cxx:526
virtual void SetCgemClusters(const TRecCgemCluster *recCluster, int ncluster)
Definition: BesEvent.cxx:321
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
Definition: BesEvent.cxx:1174
virtual void Print(Option_t *option="")
Definition: BesEvent.cxx:1555
virtual void SetMucTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:490
virtual void ConstructMcTrack(BesMcTrack *mcTrack, const TMcParticle *mcPart)
Definition: BesEvent.cxx:554
virtual void DrawCgemUFClusters(int layer, Option_t *option)
Definition: BesEvent.cxx:1519
virtual void DrawCgemClusters(Option_t *option)
Definition: BesEvent.cxx:1504
virtual void SetMdcTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:424
virtual void SetEmcShowers(TDisTrack *recEvent)
Definition: BesEvent.cxx:468
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
Definition: BesEvent.cxx:1252
virtual void DrawMcParticles(Option_t *option)
Definition: BesEvent.cxx:1536
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:709
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec, TMcEvent *mcEvt=0)
Definition: BesEvent.cxx:150
virtual void DrawHits(Option_t *option)
Definition: BesEvent.cxx:1417
virtual void DrawTracks(Option_t *option)
Definition: BesEvent.cxx:1431
virtual void SetTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:307
virtual void SetExtTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:511
virtual void CloseInfo()
Definition: BesGeoTrack.cxx:56
virtual void Draw(Option_t *option="")
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
Definition: BesGeoTrack.cxx:65
virtual void Construct3DLine()
virtual void SetMarker(Double_t x, Double_t y, Double_t z)
Definition: BesGeoTrack.cxx:70
virtual void SetCharge(Int_t charge)
double getRFromLayerSheet(int layer, int sheet) const
void SetHits()
void Draw3DHits(Option_t *option)
double getSheetWidth(int layer, int sheet) const
void ClearHits()
void DrawHits(Option_t *option)
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static unsigned int theta_module(const Identifier &id)
static unsigned int phi_module(const Identifier &id)
Emc2DCrystal * Get2DCrystal(Int_t part, Int_t phi, Int_t theta)
Get Emc2DCrystal;.
TGeoPhysicalNode * GetPhysicalCrystal(int part, int phi, int theta)
Get crystal physical node;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
void ClearHits()
Set all physicalNodes corresponding to digiCol;.
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
static int part(const Identifier &id)
static int gap(const Identifier &id)
static int seg(const Identifier &id)
static int strip(const Identifier &id)
TGeoPhysicalNode * GetPhysicalStrip(int part, int seg, int gap, int strip)
Get strip physical node;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
Muc2DStrip * Get2DStrip(int part, int seg, int gap, int strip)
Get Muc2DStrip;.
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
const TObjArray * getRecMdcHitCol() const
retrieve the whole TObjArray of RecMdcHit Data
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
const TMcParticle * getMcParticle(Int_t i) const
void Print(Option_t *option="") const
const TTrigData * getTrigData() const
void SetHits()
Set all physicalNodes corresponding to digiCol;.
Tof2DScin * Get2DScin(Int_t part, Int_t layer, Int_t scin)
Get Tof2DScin;.
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.
const double mp
Definition: incllambda.cxx:45
int t()
Definition: t.c:1