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