BOSS 6.6.4.p01
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
20
21using namespace std;
22
23#ifndef __CINT__
25#endif
26
27//__________________________________________________________
28// BesEvent
29// BesVis Event
30//
31//
32BesEvent::BesEvent() : TObject() {
33 //
34 // BesEvent default constructor
35
36 // Init
37 f_Magnetic = 1.0;
38 fMdcTrackCol = new TObjArray();
39 fTofTrackCol = new TObjArray();
40 fEmcTrackCol = new TObjArray();
41 fMucTrackCol = new TObjArray();
42 fExtTrackCol = new TObjArray();
43}
44
45//__________________________________________________________
46
48 //
49 // BesEvent default destructor
50
51 // Delete all array elements
52 Delete();
53}
54
55//__________________________________________________________
56
57void BesEvent::Delete(Option_t *option) {
58 //
59 // Clear event
60 TString opt = option;
61 opt.ToUpper();
62
63 if (fMdcTrackCol) {
64 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
65 delete fMdcTrackCol->At(j);
66 }
67 fMdcTrackCol->Clear("C");
68 delete fMdcTrackCol;
69 }
70 if (fTofTrackCol) {
71 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
72 delete fTofTrackCol->At(j);
73 }
74 fTofTrackCol->Clear("C");
75 delete fTofTrackCol;
76 }
77 if (fEmcTrackCol) {
78 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
79 delete fEmcTrackCol->At(j);
80 }
81 fEmcTrackCol->Clear("C");
82 delete fEmcTrackCol;
83 }
84 if (fMucTrackCol) {
85 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
86 delete fMucTrackCol->At(j);
87 }
88 fMucTrackCol->Clear("C");
89 delete fMucTrackCol;
90 }
91 if (fExtTrackCol) {
92 for (int j = 0; j < fExtTrackCol->GetEntries(); j++){
93 delete fExtTrackCol->At(j);
94 }
95 fExtTrackCol->Clear("C");
96 delete fExtTrackCol;
97 }
98}
99
100//__________________________________________________________
101
102void BesEvent::Clear(Option_t *option) {
103 //
104 // Clear event
105 TString opt = option;
106 opt.ToUpper();
107
108 fDigiEvent->Clear("C");
109}
110
111//__________________________________________________________
112
113void BesEvent::SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime) {
114 //fDigiEvent = 0;
115 fDigiEvent = digiEvent;
116 fEvtHeader = evtHeader;
117 fRecEvTime = recEvTime;
118 //fTrigEvent = trigEvt;
119 fTrigEvent = 0;
120 // ========================================
121 // set trig information
122 // ========================================
123 if (fTrigEvent != 0){
124 vector<Int_t> trigConditionVector;
125 vector<Int_t> trigChannelVector;
126
127 const TTrigData* trigData = fTrigEvent->getTrigData();
128 const Int_t timeType = trigData->getTimingType();
129 //std::cout << "BesEvent::timing type: " << timeType << std::endl;
130 Int_t trigCondition;
131 Int_t trigChannel;
132 for (Int_t i = 0; i < 48; i++){
133 trigCondition = trigData->getTrigCondition(i);
134 if (trigCondition) trigConditionVector.push_back(i);
135 //std::cout << "BesEvent::trig condition: " << trigCondition << std::endl;
136 }
137 for (Int_t i = 0; i < 16; i++){
138 trigChannel = trigData->getTrigChannel(i);
139 if (trigChannel) trigChannelVector.push_back(i);
140 //std::cout << "BesEvent::trigChannel: " << trigChannel << std::endl;
141 }
142 fEventHeader.SetEventTrig(timeType, trigConditionVector, trigChannelVector);
143 }
144 else {
145 std::cout << "fTrigEvent does not exit!" << std::endl;
146 }
147 // ========================================
148 // set time information
149 // ========================================
150 if (fEvtHeader != 0){
151 time_t now;
152 //now = time(NULL);
153 now = (time_t)evtHeader->time();
154 //char str_time[256];
155 //sprintf(str_time, ctime(&now));
156 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
157 //cout << "time now: " << str_time << endl;
158 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
159
160 struct tm *local_time;
161 local_time = localtime(&now);
162 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
163 //cout << "time now sec: " << local_time->tm_sec << endl;
164 //cout << "time now min: " << local_time->tm_min << endl;
165 //cout << "time now hour: "<< local_time->tm_hour << endl;
166 //cout << "time now day: " << local_time->tm_mday << endl;
167 //cout << "time now mon: " << local_time->tm_mon << endl;
168 //cout << "time now year: "<< local_time->tm_year << endl;
169 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
170
171 Int_t time1 = (1900 + local_time->tm_year) * 10000 + (1 + local_time->tm_mon) * 100
172 + local_time->tm_mday;
173 Int_t time2 = local_time->tm_hour * 10000 + local_time->tm_min * 100
174 + local_time->tm_sec;
175
176 fEventHeader.SetEventHeaderGeneral(fEvtHeader->getRunId(),
177 fEvtHeader->getEventId(), time1, time2);
178 }
179 else {
180 cout << "fEvtHeader does not exit" << endl;
181 }
182 // ========================================
183 // set event start time information
184 // ========================================
185 if (fRecEvTime != 0){
186 fEventHeader.SetEventEvTime(fRecEvTime->estime(),fRecEvTime->status(),fRecEvTime->quality());
187 }else{
188 cout << "fRecEvTime does not exit" << endl;
189 }
190
191 // ========================================
192 // set Mdc information
193 // ========================================
194 Double_t p = 0.0, pt = 0.0, px = 0.0, py = 0.0, pz = 0.0;
195 for (Int_t i = 0; i < GetMdcTrackNum(recEvent); i++) {
196 p += GetMdcTrack(i,recEvent)->p();
197 pt += GetMdcTrack(i,recEvent)->pxy();
198 px += GetMdcTrack(i,recEvent)->px();
199 py += GetMdcTrack(i,recEvent)->py();
200 pz += GetMdcTrack(i,recEvent)->pz();
201 }
202 fEventHeader.SetEventMdc(p, pt, px, py, pz);
203
204 // ========================================
205 // set Emc information
206 // ========================================
207 Double_t t = 9999.0;
208 Double_t e = 0.0;
209 for (Int_t i = 0; i < GetEmcShowerNum(recEvent); i++) {
210 e += GetEmcShower(i,recEvent)->energy();
211 }
212 fEventHeader.SetEventEmc(e);
213 // ========================================
214 // set digi and rec
215 // ========================================
216 if (fDigiEvent != 0){
217 SetHits();
218 fEventHeader.SetEventMC(fDigiEvent->getFromMc());
219 }
220 if (recEvent != 0)
221 SetTracks(recEvent);
222
223}
224
225//__________________________________________________________
226
228 if (gBesGeometry) {
233 }
234}
235
236//__________________________________________________________
237
239 SetMdcTracks(recEvent);
240 SetTofTracks(recEvent);
241 SetEmcShowers(recEvent);
242 SetMucTracks(recEvent);
243 SetExtTracks(recEvent);
244}
245
246//__________________________________________________________
247
249 if (fMdcTrackCol){
250 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
251 delete fMdcTrackCol->At(j);
252 }
253 fMdcTrackCol->Clear("C");
254 }
255 int mdc_no = recEvent->getMdcTrackNum();
256 for (Int_t i = 0; i < mdc_no; i++) {
257 const TRecMdcTrack* recTrack =recEvent->getRecMdcTrack(i);
258 BesGeoTrack *mdcTrack = new BesGeoTrack();
259 mdcTrack->SetTrackType(0);
260
261 ConstructMdcTrackFromRec(mdcTrack, recTrack,recEvent);
262 fMdcTrackCol->Add(mdcTrack);
263 }
264}
265
266//__________________________________________________________
267
269 if (fTofTrackCol) {
270 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
271 delete fTofTrackCol->At(j);
272 }
273 fTofTrackCol->Clear("C");
274 }
275 int tof_no = recEvent->getTofTrackNum();
276
277 for (Int_t i = 0; i < tof_no; i++) {
278 const TRecTofTrack* recTrack = recEvent->getTofTrack(i);
279 if ( !Is_tofCounter( recTrack->status())) continue;
280 BesGeoTrack *tofTrack = new BesGeoTrack();
281 tofTrack->SetTrackType(1);
282
283 ConstructTofTrackFromRec(tofTrack, recTrack,recEvent);
284 fTofTrackCol->Add(tofTrack);
285 }
286}
287
288//__________________________________________________________
289
291 if (fEmcTrackCol) {
292 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
293 delete fEmcTrackCol->At(j);
294 }
295 fEmcTrackCol->Clear("C");
296 }
297 int emc_no = recEvent->getEmcShowerNum();
298
299 for (Int_t i = 0; i < emc_no; i++) {
300 const TRecEmcShower* recShower =recEvent->getEmcShower(i);
301 BesGeoTrack *emcTrack = new BesGeoTrack();
302 emcTrack->SetTrackType(2);
303
304 ConstructEmcTrackFromRec(emcTrack, recShower);
305 fEmcTrackCol->Add(emcTrack);
306 }
307}
308
309//__________________________________________________________
310
312 if (fMucTrackCol) {
313 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
314 delete fMucTrackCol->At(j);
315 }
316 fMucTrackCol->Clear("C");
317 }
318 int muc_no = recEvent->getMucTrackNum();
319 for (Int_t i = 0; i < muc_no; i++) {
320 const TRecMucTrack* recTrack =recEvent->getMucTrack(i);
321 BesGeoTrack *mucTrack = new BesGeoTrack();
322 mucTrack->SetTrackType(3);
323
324 ConstructMucTrackFromRec(mucTrack, recTrack);
325 fMucTrackCol->Add(mucTrack);
326 }
327}
328
329//__________________________________________________________
330
332 //if (fExtTrackCol) fExtTrackCol->Clear("C");
333
334 //for (Int_t i = 0; i < GetExtTrackNum(); i++) {
335 // const TExtTrack* recTrack = GetExtTrack(i);
336 // BesGeoTrack *extTrack = new BesGeoTrack();
337 // extTrack->SetTrackType(4);
338
339 // ConstructExtTrackFromRec(extTrack, recTrack);
340 // fExtTrackCol->Add(extTrack);
341 //}
342}
343
344//__________________________________________________________
345
346void BesEvent::ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *fRecEvent) {
347
348 Double_t field = -f_Magnetic; // Tesla
349 Double_t kvC = 3.0e8; // light speed
350 Int_t charge = recTrack->charge();
351 Double_t pt = recTrack->pxy(); // GeV
352 Double_t pz = recTrack->pz(); // GeV
353 Double_t pi = TMath::Pi();
354
355 // unit is "cm"
356 Double_t orgx = recTrack->x()*10;
357 Double_t orgy = recTrack->y()*10;
358 Double_t orgz = recTrack->z()*10;
359
360
361 Double_t mdcR = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetRmax();
362 Double_t mdcZ = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetDz();
363
364 Double_t radius,zStep;
365 if (charge == 0) {
366 radius = 1e9 ; // cosmic ray test
367 zStep = 1e9;
368 }
369 else {
370 radius = (pt * 1.0e9 / kvC * 1e3) / fabs(charge * field) ;
371 zStep = 2*pi*radius * fabs(pz/pt);
372 }
373 Double_t curvature = 1.0/radius;
374 Double_t step = 10.0; // mm
375 Double_t delt = step*(1.0e-3)/kvC;
376
377 mdcTrack->AddPoint(orgx, orgy, orgz, 0.0);
378 const Double_t *p;
379 Int_t nStep = 0;
380
381 Double_t x,y,z,t;
382 x = orgx;
383 y = orgy;
384 z = orgz;
385
386 if (charge == 0){ //cosmic ray test
387 do {
388 x = recTrack->helix(0)* 10 *
389 cos(recTrack->helix(1))
390 - nStep * step * sin(recTrack->helix(1));
391 y = recTrack->helix(0)* 10 *
392 sin(recTrack->helix(1))
393 + nStep * step * cos(recTrack->helix(1));
394 z = recTrack->helix(3)* 10 +
395 nStep * step * recTrack->helix(4);
396
397 mdcTrack->AddPoint(x, y, z, delt*nStep);
398 Double_t mp[3];
399 mp[0] = 0;
400 mp[1] = 0;
401 mp[2] = 0;
402 mdcTrack->PaintMarker(mp);
403 mdcTrack->SetMarkerColor(kBlack);
404 mdcTrack->SetMarkerSize(10);
405 mdcTrack->SetLineColor(kBlack);
406
407 nStep++;
408 }
409 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
410
411 nStep = 0;
412 do {
413 x = recTrack->helix(0)* 10 *
414 cos(recTrack->helix(1))
415 - nStep * step * sin(recTrack->helix(1));
416 y = recTrack->helix(0)* 10 *
417 sin(recTrack->helix(1))
418 + nStep * step * cos(recTrack->helix(1));
419 z = recTrack->helix(3)* 10 +
420 nStep * step * recTrack->helix(4);
421
422 mdcTrack->AddPoint(x, y, z, delt*nStep);
423 Double_t mp[3];
424 mp[0] = 0;
425 mp[1] = 0;
426 mp[2] = 0;
427 mdcTrack->PaintMarker(mp);
428 mdcTrack->SetMarkerColor(kBlack);
429 mdcTrack->SetMarkerSize(10);
430 mdcTrack->SetLineColor(kRed);
431
432 }
433 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
434 }
435 else{ //normal track
436 TGeoHelix helix(curvature, zStep, charge);
437 helix.InitPoint(orgx, orgy, orgz);
438
439 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
440 //helix.InitDirection(1000, 10, 10, kFALSE);
441 helix.SetField(0.0, 0.0, field, kFALSE);
442
443 do {
444 // helix Step before GetCurrentPoint, or first point will be wrong
445 helix.Step(step);
446 p = helix.GetCurrentPoint();
447
448 mdcTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
449 Double_t mp[3];
450 mp[0] = p[0];
451 mp[1] = p[1];
452 mp[2] = p[2];
453 mdcTrack->PaintMarker(mp);
454 mdcTrack->SetMarkerColor(kBlack);
455 mdcTrack->SetMarkerSize(10);
456 nStep++;
457 }
458 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
459
460 }
461
462 // Add associated mdc hits
463 vector<UInt_t> vecHits(0);
464 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
465 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
466 TRecMdcHit *recMdcHit = (TRecMdcHit*)recMdcHitCol->At(i);
467 Int_t recHitId = recMdcHit->getTrkId();
468 Int_t recTrkId = recTrack->trackId();
469 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->getMdcId());
470 }
471 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
472 Identifier aMdcID( vecHits[i] );
473 int layer = MdcID::layer( aMdcID );
474 int wire = MdcID::wire( aMdcID );
475
476 Mdc2DWire* aHit = gBesGeometry->GetMdcROOTGeo()->Get2DWire(layer, wire);
477 mdcTrack->AddHit( aHit );
478 }
479
480 mdcTrack->SetCharge(recTrack->charge());
481
482 // Add mdc track info
483 char data[100];
484 TString info;
485
486 info = TString("MdcTrack ");
487 info += recTrack->trackId();
488 mdcTrack->AddInfo( info );
489
490 sprintf(data, "charge=%i, status=%i", recTrack->charge(), recTrack->stat());
491 mdcTrack->AddInfo( TString(data) );
492
493 sprintf(data, "P=%-.3f GeV, Pt=%-.3f GeV", recTrack->p(), recTrack->pxy());
494 mdcTrack->AddInfo( TString(data) );
495
496 //sprintf(data, "Pt= %-.3f GeV", recTrack->pxy());
497 //mdcTrack->AddInfo( TString(data) );
498
499 sprintf(data, "Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->px(),recTrack->py(),recTrack->pz());
500 mdcTrack->AddInfo( TString(data) );
501
502 sprintf(data, "helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->helix(0),recTrack->helix(1),recTrack->helix(2),recTrack->helix(3), recTrack->helix(4));
503 mdcTrack->AddInfo( TString(data) );
504
505 sprintf(data, "Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10); //recTrack->x(), recTrack->y(), recTrack->z());
506 mdcTrack->AddInfo( TString(data) );
507
508 sprintf(data, "#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->phi(),recTrack->theta(),cos(recTrack->theta()));
509 mdcTrack->AddInfo( TString(data) );
510
511
512 sprintf(data, "nHit=%i, #chi^{2}= %-.3f",recTrack->ndof()+5, recTrack->chi2());
513 mdcTrack->AddInfo( TString(data) );
514
515 // sprintf(data, "ndof= %i, rms= %-.3f", recTrack->ndof(), recTrack->rms());
516 // mdcTrack->AddInfo( TString(data) );
517
518 // sprintf(data, "extrp= %-.3f, pathL= %-.3f", recTrack->extrp(), recTrack->pathLength());
519 // mdcTrack->AddInfo( TString(data) );
520
521 //sprintf(data, "nHits= %i, nSter= %i", recTrack->getNhits(), recTrack->nster());
522 mdcTrack->AddInfo( TString(data) );
523
524 mdcTrack->CloseInfo();
525}
526
527//__________________________________________________________
528
529//void BesEvent::ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecETofTrack *recETrack){
530//
531// // Add associated tof hits
532// //vector<Int_t> vecBHits = recTrack->vecBHits();
533// //vector<Int_t> vecEHits = recTrack->vecEHits();
534// //vector<Int_t> vecHits;
535// //for (Int_t i = 0; i < (Int_t)vecBHits.size(); i++)
536// // vecHits.push_back( vecBHits[i] );
537// //for (Int_t i = 0; i < (Int_t)vecEHits.size(); i++)
538// // vecHits.push_back( vecEHits[i] );
539//
540// vector<Int_t> vecHits(0);
541// const TObjArray *recETofTrackCol = fRecEvent->getETofTrackCol();
542// for (Int_t i = 0; i < recETofTrackCol->GetEntriesFast(); i++){
543// TRecETofTrack *recHit = (TRecETofTrack*)recETofTrackCol->At(i);
544// if ( !Is_tofCounter( recHit->status())) continue;
545//
546// Int_t recHitId = recHit->trackID();
547// Int_t recTrkId = recETrack->trackID();
548// if (recHitId == recTrkId) vecHits.push_back(recHit->tofID());
549// }
550//
551// TGeoPhysicalNode *phyNode = 0;
552// Double_t x=0.0, y=0.0, z=0.0;
553// Int_t nHits = vecHits.size();
554// for (Int_t i = 0; i < nHits; i++) {
555// Identifier aTofID( vecHits[i] );
556//
557// int part;
558// if (recETrack->tofID() < 48) part = 0;
559// else part = 2;
560//
561// int layer = TofID::layer( aTofID );
562// int scin = TofID::phi_module( aTofID );
563//
564// Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
565// tofTrack->AddHit( aHit );
566//
567// // calculate average position
568// Double_t local[3] = {0.0, 0.0, 0.0};
569// Double_t master[3] = {0.0, 0.0, 0.0};
570// phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
571// if (phyNode)
572// phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
573// // transform to top
574// x += master[0];
575// y += master[1];
576// z += master[2];
577// }
578// x /= nHits;
579// y /= nHits;
580// z /= nHits;
581//
582// //if (recTrack->getPart() == 1) {
583// // z = 0.5*(recTrack->getZHit1() + recTrack->getZHit2());
584// //}
585// //else {
586// Double_t curR = TMath::Sqrt(x*x+y*y);
587// Double_t newR = recETrack->zrhit();
588// if (curR != 0.0) {
589// x = x * (newR/curR);
590// y = y * (newR/curR);
591// }
592//
593//
594// tofTrack->SetMarker(x, y, z);
595//
596// // Add tof track info
597// char data[100];
598// TString info;
599//
600// info = TString("TofTrack ");
601// info += recETrack->trackID();
602// tofTrack->AddInfo(info);
603//
604// //sprintf(data, "Part = %i, Qual1 = %i, Qual2 = %i", recTrack->getPart(), recTrack->getQual1(), recTrack->getQual2());
605// //tofTrack->AddInfo( TString(data) );
606//
607// //sprintf(data, "Tof = (%-.3f #pm %-.3f) ns", recTrack->getTof(), recTrack->getETof());
608// //tofTrack->AddInfo( TString(data) );
609//
610// //sprintf(data, "Tof1 = (%-.3f #pm %-.3f) ns", recTrack->getTof1(), recTrack->getETof1());
611// //tofTrack->AddInfo( TString(data) );
612//
613// //sprintf(data, "Tof2 = (%-.3f #pm %-.3f) ns", recTrack->getTof2(), recTrack->getETof2());
614// //tofTrack->AddInfo( TString(data) );
615//
616// //sprintf(data, "Path(1=%-.2f, 2=%-.2f) mm", recTrack->getPath1(), recTrack->getPath2());
617// //tofTrack->AddInfo( TString(data) );
618//
619// //sprintf(data, "Pulse(1=%-.0f, 2=%-.0f)", recTrack->getPh1(), recTrack->getPh2());
620// //tofTrack->AddInfo( TString(data) );
621//
622// //sprintf(data, "ZHit(1=%-.2fmm, 2=%-.2f)mm", recTrack->getZHit1(), recTrack->getZHit2());
623// //tofTrack->AddInfo( TString(data) );
624//
625// ////sprintf(data, "ZTDC1=%-.2fmm, ZTDC2=%-.2fmm", recTrack->getZTDC1(), recTrack->getZTDC2());
626// ////tofTrack->AddInfo( TString(data) );
627//
628// //sprintf(data, "RHit = %-.3f, Beta = %-.3f", recTrack->getRHit(), recTrack->getBeta());
629// //tofTrack->AddInfo( TString(data) );
630//
631// //sprintf(data, "w_e = %-.2f%%, w_mu = %-.2f%%", recTrack->getWeightElectron()*100.0, recTrack->getWeightMuon()*100.0);
632// //tofTrack->AddInfo( TString(data) );
633//
634// //sprintf(data, "w_pi = %-.2f%%, w_K = %-.2f%%", recTrack->getWeightPion()*100.0, recTrack->getWeightKaon()*100.0);
635// //tofTrack->AddInfo( TString(data) );
636//
637// //sprintf(data, "w_P = %-.2f%%", recTrack->getWeightProton()*100.0);
638// //tofTrack->AddInfo( TString(data) );
639//
640// tofTrack->CloseInfo();
641//}
642
643
644//__________________________________________________________
646 const TRecTofTrack *recTrack,
647 TDisTrack *fRecEvent){
648
649 vector<Int_t> vecBHits(0);
650 vector<Int_t> vecEHits(0);
651
652 const TObjArray *recTofTrackCol = fRecEvent->getTofTrackCol();
653 for (Int_t i = 0; i < recTofTrackCol->GetEntriesFast(); i++){
654 TRecTofTrack *recHit = (TRecTofTrack*)recTofTrackCol->At(i);
655 if ( !Is_tofCounter( recHit->status())) continue;
656
657 Int_t recHitId = recHit->trackID();
658 Int_t recTrkId = recTrack->trackID();
659 if (recHitId == recTrkId) {
660 if ( Is_tofBarrel( recHit->status() ) ) {
661 vecBHits.push_back(recHit->tofID());
662 }
663 else {
664 vecEHits.push_back(recHit->tofID());
665 }
666 }
667 }
668
669 TGeoPhysicalNode *phyNode = 0;
670 Double_t x=0.0, y=0.0, z=0.0;
671
672 Int_t nHits;
673 if (vecBHits.size()){
674 nHits = vecBHits.size();
675 for (Int_t i = 0; i < nHits; i++) {
676
677 int part = 1;
678 int layer = 0;
679 int scin = 0;
680 if ( ( vecBHits[i] >= 0 ) && ( vecBHits[i] <= 87 ) ) {
681 layer = 0;
682 scin = vecBHits[i];
683 }
684 else {
685 layer = 1;
686 scin = vecBHits[i] - 88;
687 }
688
689 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
690 tofTrack->AddHit( aHit );
691
692 // calculate average position
693 Double_t local[3] = {0.0, 0.0, 0.0};
694 Double_t master[3] = {0.0, 0.0, 0.0};
695 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
696 if (phyNode)
697 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
698 // transform to top
699 x += master[0];
700 y += master[1];
701 z += master[2];
702 }
703 x /= nHits;
704 y /= nHits;
705 z /= nHits;
706
707 z = recTrack->zrhit();
708
709 tofTrack->SetMarker(x, y, z);
710 }
711
712 else if (vecEHits.size()){
713 nHits = vecEHits.size();
714 for (Int_t i = 0; i < nHits; i++) {
715
716 int part = 0;
717 int layer = 0;
718 int scin = 0;
719 if ( ( vecEHits[i] >= 0 ) && ( vecEHits[i] <= 47 ) ) {
720 part = 2;
721 scin = vecEHits[i];
722 }
723 else {
724 part = 0;
725 scin = vecEHits[i] - 48;
726 }
727
728
729 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
730 tofTrack->AddHit( aHit );
731
732 // calculate average position
733 Double_t local[3] = {0.0, 0.0, 0.0};
734 Double_t master[3] = {0.0, 0.0, 0.0};
735 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
736 if (phyNode)
737 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
738 // transform to top
739 x += master[0];
740 y += master[1];
741 z += master[2];
742 }
743 x /= nHits;
744 y /= nHits;
745 z /= nHits;
746
747 tofTrack->SetMarker(x, y, z);
748 }
749
750 // Add tof track info
751 char data[100];
752 TString info;
753
754 info = TString("TofTrack ");
755 info += recTrack->trackID();
756 tofTrack->AddInfo(info);
757
758 //sprintf(data, "Part = %i, Qual1 = %i, Qual2 = %i", recTrack->getPart(), recTrack->getQual1(), recTrack->getQual2());
759 //tofTrack->AddInfo( TString(data) );
760
761 //sprintf(data, "Tof = (%-.3f #pm %-.3f) ns", recTrack->getTof(), recTrack->getETof());
762 //tofTrack->AddInfo( TString(data) );
763
764 //sprintf(data, "Tof1 = (%-.3f #pm %-.3f) ns", recTrack->getTof1(), recTrack->getETof1());
765 //tofTrack->AddInfo( TString(data) );
766
767 //sprintf(data, "Tof2 = (%-.3f #pm %-.3f) ns", recTrack->getTof2(), recTrack->getETof2());
768 //tofTrack->AddInfo( TString(data) );
769
770 //sprintf(data, "Path(1=%-.2f, 2=%-.2f) mm", recTrack->getPath1(), recTrack->getPath2());
771 //tofTrack->AddInfo( TString(data) );
772
773 //sprintf(data, "Pulse(1=%-.0f, 2=%-.0f)", recTrack->getPh1(), recTrack->getPh2());
774 //tofTrack->AddInfo( TString(data) );
775
776 //sprintf(data, "ZHit(1=%-.2fmm, 2=%-.2f)mm", recTrack->getZHit1(), recTrack->getZHit2());
777 //tofTrack->AddInfo( TString(data) );
778
779 ////sprintf(data, "ZTDC1=%-.2fmm, ZTDC2=%-.2fmm", recTrack->getZTDC1(), recTrack->getZTDC2());
780 ////tofTrack->AddInfo( TString(data) );
781
782 //sprintf(data, "RHit = %-.3f, Beta = %-.3f", recTrack->getRHit(), recTrack->getBeta());
783 //tofTrack->AddInfo( TString(data) );
784
785 //sprintf(data, "w_e = %-.2f%%, w_mu = %-.2f%%", recTrack->getWeightElectron()*100.0, recTrack->getWeightMuon()*100.0);
786 //tofTrack->AddInfo( TString(data) );
787
788 //sprintf(data, "w_pi = %-.2f%%, w_K = %-.2f%%", recTrack->getWeightPion()*100.0, recTrack->getWeightKaon()*100.0);
789 //tofTrack->AddInfo( TString(data) );
790
791 //sprintf(data, "w_P = %-.2f%%", recTrack->getWeightProton()*100.0);
792 //tofTrack->AddInfo( TString(data) );
793
794 tofTrack->CloseInfo();
795}
796
798
799 Double_t x=0.0, y=0.0, z=0.0;
800 x = recTrack->x() * 10.0;
801 y = recTrack->y() * 10.0;
802 z = recTrack->z() * 10.0;
803
804 emcTrack->SetMarker(x, y, z);
805 // Add associated emc hits
806 vector<Int_t> vecHits(0);
807 map<Int_t, Double_t> cellMap = recTrack->cellIdMap();
808 map<Int_t, Double_t>::iterator iCellMap;
809 for (iCellMap = cellMap.begin(); iCellMap != cellMap.end(); iCellMap++){
810 Int_t cellId = iCellMap->first;
811 vecHits.push_back(cellId);
812 }
813 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
814 Identifier aEmcID( vecHits[i] );
815 int part = EmcID::barrel_ec( aEmcID );
816 int theta = EmcID::theta_module( aEmcID );
817 int phi = EmcID::phi_module( aEmcID );
818 if (part == 1) theta = 43-theta; // 43 = m_kThetaBr-1
819
820 Emc2DCrystal* aHit = gBesGeometry->GetEmcROOTGeo()->Get2DCrystal(part, phi, theta);
821 emcTrack->AddHit( aHit );
822 }
823
824 // Add Emc track info
825 char data[100];
826 TString info;
827
828 info = TString("EmcShower ");
829 info += recTrack->trackId();
830 emcTrack->AddInfo(info);
831
832 sprintf(data, "nHits = %i, status = %i", recTrack->numHits(), recTrack->status());
833 emcTrack->AddInfo( TString(data) );
834
835 sprintf(data, "energy= (%.2f #pm %-.2f) MeV", recTrack->energy()*1000.0, recTrack->dE()*1000.0);
836 emcTrack->AddInfo( TString(data) );
837
838 Identifier aEmcID( recTrack->cellId() );
839 int part = EmcID::barrel_ec( aEmcID );
840 int theta = EmcID::theta_module( aEmcID );
841 int phi = EmcID::phi_module( aEmcID );
842
843 sprintf(data, "cell Id= (%i, #theta %i, #phi %i)", part, theta, phi);
844 emcTrack->AddInfo( TString(data) );
845
846 sprintf(data, "module = %i", recTrack->module());
847 emcTrack->AddInfo( TString(data) );
848
849 //sprintf(data, "x = (%-.3f #pm %-.3f) mm", x, recTrack->dx());
850 //emcTrack->AddInfo( TString(data) );
851
852 //sprintf(data, "y = (%-.3f #pm %-.3f) mm", y, recTrack->dy());
853 //emcTrack->AddInfo( TString(data) );
854
855 //sprintf(data, "z = (%-.3f #pm %-.3f) mm", z, recTrack->dz());
856 //emcTrack->AddInfo( TString(data) );
857
858 sprintf(data, "#theta = (%-.3f #pm %-.3f)", recTrack->theta(), recTrack->dtheta());
859 emcTrack->AddInfo( TString(data) );
860
861 sprintf(data, "#phi = (%-.3f #pm %-.3f)", recTrack->phi(), recTrack->dphi());
862 emcTrack->AddInfo( TString(data) );
863
864// sprintf(data, "cos (x=%-.3f, y=%-.3f, z=%-.3f)", recTrack->cosx(), recTrack->cosy(), recTrack->cosz()); //from boss6.1.0. no these varibles
865// emcTrack->AddInfo( TString(data) );
866
867 emcTrack->CloseInfo();
868}
869
870//__________________________________________________________
871
873 if (recTrack->depth() <= 0.0) return; // bad track
874
875 Double_t field = 1e-3; // Tesla
876 Double_t kvC = 3.0e8; // light speed
877 Int_t charge = 1;
878 Double_t pz = recTrack->pz(); // GeV
879 Double_t pt =
880 sqrt(recTrack->px()*recTrack->px() + recTrack->py()*recTrack->py()); // GeV
881 Double_t pi = TMath::Pi();
882
883 Double_t mucR =
884 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDX();
885 Double_t mucZ =
886 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDZ();
887
888 Double_t radius = 1.0e+9;
889 Double_t curvature = 1.0/radius;
890 Double_t zStep = 2*pi*radius * fabs(pz/pt);
891 Double_t step = 1.0; // mm
892 Double_t delt = step*(1.0e-3)/kvC;
893
894 TGeoHelix helix(curvature, zStep, charge);
895
896 Double_t x = recTrack->xPos() * 10.0;
897 Double_t y = recTrack->yPos() * 10.0;
898 Double_t z = recTrack->zPos() * 10.0;
899
900 helix.InitPoint(x, y, z);
901 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
902 helix.SetField(0.0, 0.0, field, kFALSE);
903
904 mucTrack->AddPoint(x, y, z, 0.0);
905 const Double_t *p;
906 Int_t nStep = 0;
907 do {
908 // helix Step before GetCurrentPoint, or first point will be wrong
909 helix.Step(step);
910 p = helix.GetCurrentPoint();
911 mucTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
912 Double_t mp[3];
913 mp[0] = p[0];
914 mp[1] = p[1];
915 mp[2] = p[2];
916 mucTrack->PaintMarker(mp);
917 mucTrack->SetMarkerColor(kBlack);
918 mucTrack->SetMarkerSize(10);
919 nStep++;
920 }
921 while ( (p[0]*p[0] + p[1]*p[1]) < mucR*mucR && fabs(p[2]) < mucZ );
922
923 // Add associated muc hits
924 vector<Int_t> vecHits = recTrack->vecHits();
925 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
926 Identifier aMucID( vecHits[i] );
927 int part = MucID::part( aMucID );
928 int seg = MucID::seg( aMucID );
929 int gap = MucID::gap( aMucID );
930 int strip = MucID::strip( aMucID );
931
932 Muc2DStrip* aHit = gBesGeometry->GetMucROOTGeo()->Get2DStrip(part, seg, gap, strip);
933 mucTrack->AddHit( aHit );
934 }
935
936 mucTrack->SetCharge(charge);
937
938 // Add Muc track info
939 char data[100];
940 TString info;
941
942 info = TString("MucTrack ");
943 info += recTrack->trackId();
944 mucTrack->AddInfo(info);
945
946 sprintf(data, "nHits= %i, maxHits= %i, nLayers= %i", recTrack->numHits(), recTrack->maxHitsInLayer(), recTrack->numLayers());
947 mucTrack->AddInfo( TString(data) );
948
949 sprintf(data, "lastLayer (br= %i, ec= %i)", recTrack->brLastLayer(), recTrack->ecLastLayer());
950 mucTrack->AddInfo( TString(data) );
951
952 sprintf(data, "depth = %.3f cm", recTrack->depth());
953 mucTrack->AddInfo( TString(data) );
954
955 sprintf(data, "#chi^{2}= %-.3f, dof= %i, rms= %-.3f", recTrack->chi2(), recTrack->dof(), recTrack->rms());
956 mucTrack->AddInfo( TString(data) );
957
958 sprintf(data, "Origin (%-.2f, %-.2f, %-.2f) cm", recTrack->xPos(), recTrack->yPos(), recTrack->zPos());
959 mucTrack->AddInfo( TString(data) );
960
961 sprintf(data, "p (%-.3f, %-.3f, %-.3f) GeV", recTrack->px(), recTrack->py(), recTrack->pz());
962 mucTrack->AddInfo( TString(data) );
963
964 mucTrack->CloseInfo();
965}
966
967//__________________________________________________________
968
969//void BesEvent::ConstructExtTrackFromRec(BesGeoTrack *extTrack, const TExtTrack *recTrack) {
970//
971// extTrack->AddPoint(recTrack->GetTof1PositionX(),
972// recTrack->GetTof1PositionY(),
973// recTrack->GetTof1PositionZ(),
974// 0.0);
975// extTrack->AddPoint(recTrack->GetTof2PositionX(),
976// recTrack->GetTof2PositionY(),
977// recTrack->GetTof2PositionZ(),
978// 0.1);
979// extTrack->AddPoint(recTrack->GetEmcPositionX(),
980// recTrack->GetEmcPositionY(),
981// recTrack->GetEmcPositionZ(),
982// 0.2);
983// extTrack->AddPoint(recTrack->GetMucPositionX(),
984// recTrack->GetMucPositionY(),
985// recTrack->GetMucPositionZ(),
986// 0.3);
987//
988// // Add Ext track info
989// char data[100];
990// TString info;
991//
992// info = TString("ExtTrack ");
993// info += recTrack->GetTrackId();
994// extTrack->AddInfo(info);
995//
996// sprintf(data, "Tof1 pos (%-.2f, %-.2f, %-.2f) mm",
997// recTrack->GetTof1PositionX(), recTrack->GetTof1PositionY(), recTrack->GetTof1PositionZ());
998// extTrack->AddInfo( TString(data) );
999//
1000// sprintf(data, "Tof2 pos (%-.2f, %-.2f, %-.2f) mm",
1001// recTrack->GetTof2PositionX(), recTrack->GetTof2PositionY(), recTrack->GetTof2PositionZ());
1002// extTrack->AddInfo( TString(data) );
1003//
1004// sprintf(data, "Emc pos (%-.2f, %-.2f, %-.2f) mm",
1005// recTrack->GetEmcPositionX(), recTrack->GetEmcPositionY(), recTrack->GetEmcPositionZ());
1006// extTrack->AddInfo( TString(data) );
1007//
1008// sprintf(data, "Muc pos (%-.2f, %-.2f, %-.2f) mm",
1009// recTrack->GetMucPositionX(), recTrack->GetMucPositionY(), recTrack->GetMucPositionZ());
1010// extTrack->AddInfo( TString(data) );
1011//
1012// sprintf(data, "Tof1 p (%-.3f, %-.3f, %-.3f) GeV",
1013// recTrack->GetTof1MomentumX()/1000.0, recTrack->GetTof1MomentumY()/1000.0, recTrack->GetTof1MomentumZ()/1000.0);
1014// extTrack->AddInfo( TString(data) );
1015//
1016// sprintf(data, "Tof2 p (%-.3f, %-.3f, %-.3f) GeV",
1017// recTrack->GetTof2MomentumX()/1000.0, recTrack->GetTof2MomentumY()/1000.0, recTrack->GetTof2MomentumZ()/1000.0);
1018// extTrack->AddInfo( TString(data) );
1019//
1020// sprintf(data, "Emc p (%-.3f, %-.3f, %-.3f) GeV",
1021// recTrack->GetEmcMomentumX()/1000.0, recTrack->GetEmcMomentumY()/1000.0, recTrack->GetEmcMomentumZ()/1000.0);
1022// extTrack->AddInfo( TString(data) );
1023//
1024// sprintf(data, "Muc p (%-.3f, %-.3f, %-.3f) GeV",
1025// recTrack->GetMucMomentumX()/1000.0, recTrack->GetMucMomentumY()/1000.0, recTrack->GetMucMomentumZ()/1000.0);
1026// extTrack->AddInfo( TString(data) );
1027//
1028// extTrack->CloseInfo();
1029//}
1030
1031
1032//__________________________________________________________
1033
1034void BesEvent::DrawHits(Option_t *option) {
1035 if (gBesGeometry) {
1040 }
1041}
1042
1043//__________________________________________________________
1044
1045void BesEvent::DrawTracks(Option_t *option) {
1046
1047 BesView *view = (BesView*)gPad->GetView();
1048
1049 if (view && view->GetVisTracksGlobal()) {
1050
1051 if (view->GetVisTracksMdc()) {
1052 for (Int_t i = 0; i < fMdcTrackCol->GetEntries(); i++) {
1053 BesGeoTrack *track = (BesGeoTrack*)fMdcTrackCol->At(i);
1054 track->Draw();
1055 }
1056 }
1057
1058 if (view->GetVisTracksTof()) {
1059 for (Int_t i = 0; i < fTofTrackCol->GetEntries(); i++) {
1060 BesGeoTrack *track = (BesGeoTrack*)fTofTrackCol->At(i);
1061 track->Draw();
1062 }
1063 }
1064
1065 if (view->GetVisTracksEmc()) {
1066 for (Int_t i = 0; i < fEmcTrackCol->GetEntries(); i++) {
1067 BesGeoTrack *track = (BesGeoTrack*)fEmcTrackCol->At(i);
1068 track->Draw();
1069 }
1070 }
1071
1072 if (view->GetVisTracksMuc()) {
1073 for (Int_t i = 0; i < fMucTrackCol->GetEntries(); i++) {
1074 BesGeoTrack *track = (BesGeoTrack*)fMucTrackCol->At(i);
1075 track->Draw();
1076 }
1077 }
1078
1079 if (view->GetVisTracksExt()) {
1080 for (Int_t i = 0; i < fExtTrackCol->GetEntries(); i++) {
1081 BesGeoTrack *track = (BesGeoTrack*)fExtTrackCol->At(i);
1082 track->Draw();
1083 }
1084 }
1085 }
1086}
1087
1088//__________________________________________________________
1089
1090void BesEvent::Print(Option_t *option) {
1091 //
1092 // Print event information
1093 //
1094 // Options available:
1095 // '' - quiet, i.e. only numbers of hits and tracks etc. (default)
1096 // 'ALL' - very detailed output (might be hundreds of lines!)
1097 // 'Digi' - only Digi information
1098 // 'Dst' - only Dst information
1099 //
1100 TString opt = option;
1101 opt.ToUpper();
1102 Int_t i;
1103
1104 //cout << endl
1105 // << "==========================================================" << endl
1106 // << "Run: " << GetRun() << endl
1107 // << "Event: " << GetEvent() << endl
1108 // << "----------------------------------------------------------" << endl
1109 // << "Mdc digis: " << GetMdcDigiNum() << endl
1110 // << "Tof digis: " << GetTofDigiNum() << endl
1111 // << "Emc digis: " << GetEmcDigiNum() << endl
1112 // << "Muc digis: " << GetMucDigiNum() << endl
1113 // << "Mdc tracks: " << GetMdcTrackNum() << endl
1114 // << "Tof tracks: " << "debug++++++" /*GetTofTrackNum()*/ << endl
1115 // << "Emc tracks: " << GetEmcShowerNum() << endl
1116 // << "Muc tracks: " << GetMucTrackNum() << endl
1117 // << "Ext tracks: " << GetExtTrackNum() << endl
1118 // << "Dedx : " << GetDedxNum() << endl
1119 // << "----------------------------------------------------------" << endl;
1120
1121 if ( opt.Contains("ALL") || opt.Contains("Digi") ) {
1122 for ( i = 0; i < GetMdcDigiNum(); i++ ) GetMdcDigi(i)->Print();
1123 for ( i = 0; i < GetTofDigiNum(); i++ ) GetTofDigi(i)->Print();
1124 for ( i = 0; i < GetEmcDigiNum(); i++ ) GetEmcDigi(i)->Print();
1125 for ( i = 0; i < GetMucDigiNum(); i++ ) GetMucDigi(i)->Print();
1126 }
1127
1128 /* if ( opt.Contains("ALL") || opt.Contains("Dst") ) {
1129 for ( i = 0; i < GetMdcTrackNum(); i++ ) GetMdcTrack(i)->Print();
1130 // Tof -> BTof ETof
1131 //for ( i = 0; i < GetTofTrackNum(); i++ ) GetTofTrack(i)->Print();
1132 for ( i = 0; i < GetEmcShowerNum(); i++ ) GetEmcShower(i)->Print();
1133 for ( i = 0; i < GetMucTrackNum(); i++ ) GetMucTrack(i)->Print();
1134 cout << "wait for TRecExtEvent, BesEvent" << endl;
1135 //for ( i = 0; i < GetExtTrackNum(); i++ ) GetExtTrack(i)->Print();
1136 for ( i = 0; i < GetDedxNum(); i++ ) GetDedx(i)->Print();
1137 }
1138 */
1139 //cout << "=========================================================="
1140 //<< endl << endl;
1141}
1142
1143bool BesEvent::Is_tofCounter(UInt_t status){
1144 const unsigned int Counter_Mask = 0x00000004;
1145 const unsigned int Counter_Index = 2;
1146 return ((status & Counter_Mask) >> Counter_Index) ? true: false;
1147}
1148
1149bool BesEvent::Is_tofBarrel(UInt_t status) {
1150 const unsigned int Barrel_Index = 4;
1151 const unsigned int Barrel_Mask = 0x00000010;
1152 return ((status & Barrel_Mask) >> Barrel_Index ) ? true : false;
1153}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
BesEvent * gEvent
Definition: BesEvent.cxx:19
ClassImp(BesEvent) BesEvent
Definition: BesEvent.cxx:24
R__EXTERN BesGeometry * gBesGeometry
Definition: BesGeometry.h:103
TTree * data
Double_t x[10]
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 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:57
virtual void SetHits()
Definition: BesEvent.cxx:227
virtual ~BesEvent()
Definition: BesEvent.cxx:47
const Int_t GetMucDigiNum() const
Definition: BesEvent.h:98
virtual void Clear(Option_t *option="")
Definition: BesEvent.cxx:102
const Int_t GetTofDigiNum() const
Definition: BesEvent.h:90
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:645
virtual void SetTofTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:268
const TTofDigi * GetTofDigi(Int_t i) const
Definition: BesEvent.h:106
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:203
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:158
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
Definition: BesEvent.cxx:797
virtual void Print(Option_t *option="")
Definition: BesEvent.cxx:1090
const Int_t GetMdcDigiNum() const
Definition: BesEvent.h:86
virtual void SetMucTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:311
virtual void SetMdcTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:248
virtual void SetEmcShowers(TDisTrack *recEvent)
Definition: BesEvent.cxx:290
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
Definition: BesEvent.h:177
const TMucDigi * GetMucDigi(Int_t i) const
Definition: BesEvent.h:114
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:219
const Int_t GetEmcDigiNum() const
Definition: BesEvent.h:94
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
Definition: BesEvent.cxx:872
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime)
Definition: BesEvent.cxx:113
const TMdcDigi * GetMdcDigi(Int_t i) const
Definition: BesEvent.h:102
const TEmcDigi * GetEmcDigi(Int_t i) const
Definition: BesEvent.h:110
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:346
virtual void DrawHits(Option_t *option)
Definition: BesEvent.cxx:1034
virtual void DrawTracks(Option_t *option)
Definition: BesEvent.cxx:1045
virtual void SetTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:238
virtual void SetExtTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:331
virtual void CloseInfo()
Definition: BesGeoTrack.cxx:53
virtual void SetTrackType(Int_t type)
Definition: BesGeoTrack.h:25
virtual void Draw(Option_t *option="")
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
Definition: BesGeoTrack.cxx:62
virtual void SetMarker(Double_t x, Double_t y, Double_t z)
Definition: BesGeoTrack.cxx:67
virtual void AddInfo(TString info)
Definition: BesGeoTrack.h:22
virtual void AddHit(TObject *obj)
Definition: BesGeoTrack.h:21
virtual void SetCharge(Int_t charge)
EmcROOTGeo * GetEmcROOTGeo()
Definition: BesGeometry.h:43
MdcROOTGeo * GetMdcROOTGeo()
Definition: BesGeometry.h:41
MucROOTGeo * GetMucROOTGeo()
Definition: BesGeometry.h:44
TofROOTGeo * GetTofROOTGeo()
Definition: BesGeometry.h:42
Bool_t GetVisTracksExt()
Definition: BesView.h:209
Bool_t GetVisTracksGlobal()
Definition: BesView.h:204
Bool_t GetVisTracksMuc()
Definition: BesView.h:208
Bool_t GetVisTracksTof()
Definition: BesView.h:206
Bool_t GetVisTracksEmc()
Definition: BesView.h:207
Bool_t GetVisTracksMdc()
Definition: BesView.h:205
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;.
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
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
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
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="")
Definition: TDigiEvent.cxx:83
Bool_t getFromMc()
Definition: TDigiEvent.h:27
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:134
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:145
const TObjArray * getRecMdcHitCol() const
retrieve the whole TObjArray of RecMdcHit Data
Definition: TDisTrack.h:43
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
Definition: TDisTrack.cxx:157
int getMdcTrackNum()
Definition: TDisTrack.cxx:163
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
Definition: TDisTrack.h:52
int getMucTrackNum()
Definition: TDisTrack.cxx:193
int getEmcShowerNum()
Definition: TDisTrack.cxx:183
int getTofTrackNum()
Definition: TDisTrack.cxx:173
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
Definition: TDisTrack.cxx:113
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
void Print(Option_t *option="") const
Definition: TRawData.cxx:25
Int_t module() const
Definition: TRecEmcShower.h:27
Double_t phi() const
Definition: TRecEmcShower.h:33
Double_t z() const
Definition: TRecEmcShower.h:30
Double_t dtheta() const
Definition: TRecEmcShower.h:32
Double_t dphi() const
Definition: TRecEmcShower.h:34
Int_t cellId() const
Definition: TRecEmcShower.h:26
map< Int_t, Double_t > cellIdMap() const
Definition: TRecEmcShower.h:49
Double_t theta() const
Definition: TRecEmcShower.h:31
Double_t x() const
Definition: TRecEmcShower.h:28
Int_t status() const
Definition: TRecEmcShower.h:25
Double_t dE() const
Definition: TRecEmcShower.h:36
Double_t energy() const
Definition: TRecEmcShower.h:35
Double_t y() const
Definition: TRecEmcShower.h:29
Int_t trackId() const
Definition: TRecEmcShower.h:23
Int_t numHits() const
Definition: TRecEmcShower.h:24
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
Definition: TRecMdcTrack.h:32
const Int_t trackId() const
Definition: TRecMdcTrack.h:17
const Double_t y() const
const Int_t stat() const
Definition: TRecMdcTrack.h:31
const Double_t pxy() const
const Int_t ndof() const
Definition: TRecMdcTrack.h:33
const Double_t theta() const
const Int_t charge() const
const Double_t py() const
const Double_t helix(Int_t i) const
Definition: TRecMdcTrack.h:18
Int_t brLastLayer() const
Definition: TRecMucTrack.h:30
Double_t yPos() const
Definition: TRecMucTrack.h:44
Double_t zPos() const
Definition: TRecMucTrack.h:45
Int_t trackId() const
Definition: TRecMucTrack.h:23
Int_t numLayers() const
Definition: TRecMucTrack.h:33
vector< Int_t > vecHits() const
Definition: TRecMucTrack.h:55
Double_t chi2() const
Definition: TRecMucTrack.h:37
Double_t xPos() const
Definition: TRecMucTrack.h:43
Double_t rms() const
Definition: TRecMucTrack.h:39
Int_t numHits() const
Definition: TRecMucTrack.h:32
Int_t maxHitsInLayer() const
Definition: TRecMucTrack.h:34
Double_t depth() const
Definition: TRecMucTrack.h:36
Int_t ecLastLayer() const
Definition: TRecMucTrack.h:31
Double_t pz() const
Definition: TRecMucTrack.h:53
Int_t dof() const
Definition: TRecMucTrack.h:38
Double_t px() const
Definition: TRecMucTrack.h:51
Double_t py() const
Definition: TRecMucTrack.h:52
Int_t tofID() const
Definition: TRecTofTrack.h:18
Int_t trackID() const
Definition: TRecTofTrack.h:17
Double_t zrhit() const
Definition: TRecTofTrack.h:23
UInt_t status() const
Definition: TRecTofTrack.h:20
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
Definition: TTrigEvent.cxx:50
void SetHits()
Set all physicalNodes corresponding to digiCol;.
void DrawHits(Option_t *option)
Draw 2D hits.
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
const float pi
Definition: vector3.h:133