BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvent Class Reference

#include <BesEvent.h>

+ Inheritance diagram for BesEvent:

Public Member Functions

 BesEvent ()
 
virtual ~BesEvent ()
 
virtual void Clear (Option_t *option="")
 
virtual void Delete (Option_t *option="")
 
virtual void Print (Option_t *option="")
 
virtual void SetEvent (TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec)
 
virtual void SetHits ()
 
virtual void SetTracks (TDisTrack *recEvent)
 
virtual void SetMdcTracks (TDisTrack *recEvent)
 
virtual void SetTofTracks (TDisTrack *recEvent)
 
virtual void SetEmcShowers (TDisTrack *recEvent)
 
virtual void SetMucTracks (TDisTrack *recEvent)
 
virtual void SetExtTracks (TDisTrack *recEvent)
 
virtual void ConstructMdcTrackFromRec (BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
 
virtual void ConstructMucTrackFromRec (BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
 
virtual void ConstructEmcTrackFromRec (BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
 
virtual void ConstructTofTrackFromRec (BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
 
virtual void DrawHits (Option_t *option)
 
virtual void DrawTracks (Option_t *option)
 
void SetMagnetic (Double_t input)
 
const TObjArray * GetMdcDigiCol () const
 
const TObjArray * GetTofDigiCol () const
 
const TObjArray * GetEmcDigiCol () const
 
const TObjArray * GetMucDigiCol () const
 
const Int_t GetMdcDigiNum () const
 
const Int_t GetTofDigiNum () const
 
const Int_t GetEmcDigiNum () const
 
const Int_t GetMucDigiNum () const
 
const TMdcDigiGetMdcDigi (Int_t i) const
 
const TTofDigiGetTofDigi (Int_t i) const
 
const TEmcDigiGetEmcDigi (Int_t i) const
 
const TMucDigiGetMucDigi (Int_t i) const
 
const TObjArray * GetMdcTrackCol (TDisTrack *recEvent) const
 
const TObjArray * GetTofTrackCol (TDisTrack *recEvent) const
 
const TObjArray * GetEmcShowerCol (TDisTrack *recEvent) const
 
const TObjArray * GetMucTrackCol (TDisTrack *recEvent) const
 
const TObjArray * GetExtTrackCol () const
 
const TObjArray * GetDedxCol (TDisTrack *recEvent) const
 
const Int_t GetMdcTrackNum (TDisTrack *recEvent) const
 
const Int_t GetTofTrackNum (TDisTrack *recEvent) const
 
const Int_t GetEmcShowerNum (TDisTrack *recEvent) const
 
const Int_t GetMucTrackNum (TDisTrack *recEvent) const
 
const Int_t GetExtTrackNum () const
 
const Int_t GetDedxNum (TDisTrack *recEvent) const
 
const TRecMdcTrackGetMdcTrack (Int_t i, TDisTrack *recEvent) const
 
const TRecTofTrackGetTofTrack (Int_t i, TDisTrack *recEvent) const
 
const TRecEmcShowerGetEmcShower (Int_t i, TDisTrack *recEvent) const
 
const TRecMucTrackGetMucTrack (Int_t i, TDisTrack *recEvent) const
 
const TRecMdcDedxGetDedx (Int_t i) const
 
Long64_t GetRun ()
 
Long64_t GetEvent ()
 
Int_t GetYear ()
 
Int_t GetMonth ()
 
Int_t GetDay ()
 
Int_t GetHour ()
 
Int_t GetMin ()
 
Int_t GetSec ()
 
Int_t GetMC ()
 
BesEventHeader GetHeader ()
 

Detailed Description

Definition at line 23 of file BesEvent.h.

Constructor & Destructor Documentation

◆ BesEvent()

BesEvent::BesEvent ( )

◆ ~BesEvent()

BesEvent::~BesEvent ( )
virtual

Definition at line 48 of file BesEvent.cxx.

48 {
49 //
50 // BesEvent default destructor
51
52 // Delete all array elements
53 Delete();
54}
virtual void Delete(Option_t *option="")
Definition: BesEvent.cxx:58

Member Function Documentation

◆ Clear()

void BesEvent::Clear ( Option_t *  option = "")
virtual

Definition at line 103 of file BesEvent.cxx.

103 {
104 //
105 // Clear event
106 TString opt = option;
107 opt.ToUpper();
108
109 fDigiEvent->Clear("C");
110}
void Clear(Option_t *option="")
Definition: TDigiEvent.cxx:83

◆ ConstructEmcTrackFromRec()

void BesEvent::ConstructEmcTrackFromRec ( BesGeoTrack emcTrack,
const TRecEmcShower recTrack 
)
virtual

Definition at line 817 of file BesEvent.cxx.

817 {
818
819 Double_t x=0.0, y=0.0, z=0.0;
820 x = recTrack->x() * 10.0;
821 y = recTrack->y() * 10.0;
822 z = recTrack->z() * 10.0;
823
824 emcTrack->SetMarker(x, y, z);
825 // Add associated emc hits
826 vector<Int_t> vecHits(0);
827 map<Int_t, Double_t> cellMap = recTrack->cellIdMap();
828 map<Int_t, Double_t>::iterator iCellMap;
829 for (iCellMap = cellMap.begin(); iCellMap != cellMap.end(); iCellMap++){
830 Int_t cellId = iCellMap->first;
831 vecHits.push_back(cellId);
832 }
833 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
834 Identifier aEmcID( vecHits[i] );
835 int part = EmcID::barrel_ec( aEmcID );
836 int theta = EmcID::theta_module( aEmcID );
837 int phi = EmcID::phi_module( aEmcID );
838 if (part == 1) theta = 43-theta; // 43 = m_kThetaBr-1
839
840 Emc2DCrystal* aHit = gBesGeometry->GetEmcROOTGeo()->Get2DCrystal(part, phi, theta);
841 emcTrack->AddHit( aHit );
842 //Long Peixun's update: for Emc 3D track display
843 TGeoPhysicalNode* pHit = gBesGeometry->GetEmcROOTGeo()->GetPhysicalCrystal(part, phi, theta);
844 emcTrack->Add3DHit(pHit);
845 }
846
847 // Add Emc track info
848 char data[100];
849 TString info;
850
851 info = TString("EmcShower ");
852 info += recTrack->trackId();
853 emcTrack->AddInfo(info);
854
855 sprintf(data, "nHits = %i, status = %i", recTrack->numHits(), recTrack->status());
856 emcTrack->AddInfo( TString(data) );
857
858 sprintf(data, "energy= (%.2f #pm %-.2f) MeV", recTrack->energy()*1000.0, recTrack->dE()*1000.0);
859 emcTrack->AddInfo( TString(data) );
860
861 Identifier aEmcID( recTrack->cellId() );
862 int part = EmcID::barrel_ec( aEmcID );
863 int theta = EmcID::theta_module( aEmcID );
864 int phi = EmcID::phi_module( aEmcID );
865
866 sprintf(data, "cell Id= (%i, #theta %i, #phi %i)", part, theta, phi);
867 emcTrack->AddInfo( TString(data) );
868
869 sprintf(data, "module = %i", recTrack->module());
870 emcTrack->AddInfo( TString(data) );
871
872 //sprintf(data, "x = (%-.3f #pm %-.3f) mm", x, recTrack->dx());
873 //emcTrack->AddInfo( TString(data) );
874
875 //sprintf(data, "y = (%-.3f #pm %-.3f) mm", y, recTrack->dy());
876 //emcTrack->AddInfo( TString(data) );
877
878 //sprintf(data, "z = (%-.3f #pm %-.3f) mm", z, recTrack->dz());
879 //emcTrack->AddInfo( TString(data) );
880
881 sprintf(data, "#theta = (%-.3f #pm %-.3f)", recTrack->theta(), recTrack->dtheta());
882 emcTrack->AddInfo( TString(data) );
883
884 sprintf(data, "#phi = (%-.3f #pm %-.3f)", recTrack->phi(), recTrack->dphi());
885 emcTrack->AddInfo( TString(data) );
886
887// sprintf(data, "cos (x=%-.3f, y=%-.3f, z=%-.3f)", recTrack->cosx(), recTrack->cosy(), recTrack->cosz()); //from boss6.1.0. no these varibles
888// emcTrack->AddInfo( TString(data) );
889
890 emcTrack->CloseInfo();
891}
R__EXTERN BesGeometry * gBesGeometry
Definition: BesGeometry.h:108
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
TTree * data
Double_t x[10]
virtual void CloseInfo()
Definition: BesGeoTrack.cxx:54
virtual void SetMarker(Double_t x, Double_t y, Double_t z)
Definition: BesGeoTrack.cxx:68
virtual void AddInfo(TString info)
Definition: BesGeoTrack.h:23
virtual void AddHit(TObject *obj)
Definition: BesGeoTrack.h:21
virtual void Add3DHit(TObject *obj)
Definition: BesGeoTrack.h:22
EmcROOTGeo * GetEmcROOTGeo()
Definition: BesGeometry.h:45
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;.
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 y[1000]

Referenced by SetEmcShowers().

◆ ConstructMdcTrackFromRec()

void BesEvent::ConstructMdcTrackFromRec ( BesGeoTrack mdcTrack,
const TRecMdcTrack recTrack,
TDisTrack recEvent 
)
virtual

Definition at line 362 of file BesEvent.cxx.

362 {
363
364 Double_t field = -f_Magnetic; // Tesla
365 Double_t kvC = 3.0e8; // light speed
366 Int_t charge = recTrack->charge();
367 Double_t pt = recTrack->pxy(); // GeV
368 Double_t pz = recTrack->pz(); // GeV
369 Double_t pi = TMath::Pi();
370
371 // unit is "cm"
372 Double_t orgx = recTrack->x()*10;
373 Double_t orgy = recTrack->y()*10;
374 Double_t orgz = recTrack->z()*10;
375
376 Double_t mdcR = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetRmax();
377 Double_t mdcZ = ((TGeoTube*)gBesGeometry->GetMdcROOTGeo()->GetVolumeMdc()->GetShape())->GetDz();
378
379 Double_t radius,zStep;
380 if (charge == 0) {
381 radius = 1e9 ; // cosmic ray test
382 zStep = 1e9;
383 }
384 else {
385 radius = (pt * 1.0e9 / kvC * 1e3) / fabs(charge * field) ;
386 zStep = 2*pi*radius * fabs(pz/pt);
387 }
388 Double_t curvature = 1.0/radius;
389 Double_t step = 10.0; // mm
390 Double_t delt = step*(1.0e-3)/kvC;
391
392 mdcTrack->AddPoint(orgx, orgy, orgz, 0.0);
393 const Double_t *p;
394 Int_t nStep = 0;
395
396 Double_t x,y,z,t;
397 x = orgx;
398 y = orgy;
399 z = orgz;
400
401 if (charge == 0){ //cosmic ray test
402 do {
403 x = recTrack->helix(0)* 10 *
404 cos(recTrack->helix(1))
405 - nStep * step * sin(recTrack->helix(1));
406 y = recTrack->helix(0)* 10 *
407 sin(recTrack->helix(1))
408 + nStep * step * cos(recTrack->helix(1));
409 z = recTrack->helix(3)* 10 +
410 nStep * step * recTrack->helix(4);
411
412 mdcTrack->AddPoint(x, y, z, delt*nStep);
413 Double_t mp[3];
414 mp[0] = 0;
415 mp[1] = 0;
416 mp[2] = 0;
417 mdcTrack->PaintMarker(mp);
418 mdcTrack->SetMarkerColor(kBlack);
419 mdcTrack->SetMarkerSize(10);
420 mdcTrack->SetLineColor(kBlack);
421
422 nStep++;
423 }
424 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
425
426 nStep = 0;
427 do {
428 x = recTrack->helix(0)* 10 *
429 cos(recTrack->helix(1))
430 - nStep * step * sin(recTrack->helix(1));
431 y = recTrack->helix(0)* 10 *
432 sin(recTrack->helix(1))
433 + nStep * step * cos(recTrack->helix(1));
434 z = recTrack->helix(3)* 10 +
435 nStep * step * recTrack->helix(4);
436
437 mdcTrack->AddPoint(x, y, z, delt*nStep);
438 Double_t mp[3];
439 mp[0] = 0;
440 mp[1] = 0;
441 mp[2] = 0;
442 mdcTrack->PaintMarker(mp);
443 mdcTrack->SetMarkerColor(kBlack);
444 mdcTrack->SetMarkerSize(10);
445 mdcTrack->SetLineColor(kRed);
446
447 }
448 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
449 }
450 else{ //normal track
451 TGeoHelix helix(curvature, zStep, charge);
452 helix.InitPoint(orgx, orgy, orgz);
453
454 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
455 //helix.InitDirection(1000, 10, 10, kFALSE);
456 helix.SetField(0.0, 0.0, field, kFALSE);
457
458 do {
459 // helix Step before GetCurrentPoint, or first point will be wrong
460 helix.Step(step);
461 p = helix.GetCurrentPoint();
462
463 mdcTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
464 Double_t mp[3];
465 mp[0] = p[0];
466 mp[1] = p[1];
467 mp[2] = p[2];
468 mdcTrack->PaintMarker(mp);
469 mdcTrack->SetMarkerColor(kBlack);
470 mdcTrack->SetMarkerSize(10);
471 nStep++;
472 }
473 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
474
475 }
476
477 // Add associated mdc hits
478 vector<UInt_t> vecHits(0);
479 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
480 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
481 TRecMdcHit *recMdcHit = (TRecMdcHit*)recMdcHitCol->At(i);
482 Int_t recHitId = recMdcHit->getTrkId();
483 Int_t recTrkId = recTrack->trackId();
484 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->getMdcId());
485 }
486 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
487 Identifier aMdcID( vecHits[i] );
488 int layer = MdcID::layer( aMdcID );
489 int wire = MdcID::wire( aMdcID );
490
491 Mdc2DWire* aHit = gBesGeometry->GetMdcROOTGeo()->Get2DWire(layer, wire);
492 mdcTrack->AddHit( aHit );
493 //Long Peixun's update: for Mdc 3D track display
494 TGeoPhysicalNode* pHit = gBesGeometry->GetMdcROOTGeo()->GetPhysicalReplica(layer, wire);
495 mdcTrack->Add3DHit(pHit);
496 }
497
498 mdcTrack->SetCharge(recTrack->charge());
499
500 // Add mdc track info
501 char data[200]; //Long Peixun's update: 100 -> 200
502 TString info;
503
504 info = TString("MdcTrack ");
505 info += recTrack->trackId();
506 mdcTrack->AddInfo( info );
507
508 sprintf(data, "charge=%i, status=%i", recTrack->charge(), recTrack->stat());
509 mdcTrack->AddInfo( TString(data) );
510
511 sprintf(data, "P=%-.3f GeV, Pt=%-.3f GeV", recTrack->p(), recTrack->pxy());
512 mdcTrack->AddInfo( TString(data) );
513
514 //sprintf(data, "Pt= %-.3f GeV", recTrack->pxy());
515 //mdcTrack->AddInfo( TString(data) );
516
517 sprintf(data, "Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->px(),recTrack->py(),recTrack->pz());
518 mdcTrack->AddInfo( TString(data) );
519
520 sprintf(data, "helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->helix(0),recTrack->helix(1),recTrack->helix(2),recTrack->helix(3), recTrack->helix(4));
521 mdcTrack->AddInfo( TString(data) );
522
523 sprintf(data, "Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10); //recTrack->x(), recTrack->y(), recTrack->z());
524 mdcTrack->AddInfo( TString(data) );
525
526 sprintf(data, "#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->phi(),recTrack->theta(),cos(recTrack->theta()));
527 mdcTrack->AddInfo( TString(data) );
528
529
530 sprintf(data, "nHit=%i, #chi^{2}= %-.3f",recTrack->ndof()+5, recTrack->chi2());
531 mdcTrack->AddInfo( TString(data) );
532
533 // sprintf(data, "ndof= %i, rms= %-.3f", recTrack->ndof(), recTrack->rms());
534 // mdcTrack->AddInfo( TString(data) );
535
536 // sprintf(data, "extrp= %-.3f, pathL= %-.3f", recTrack->extrp(), recTrack->pathLength());
537 // mdcTrack->AddInfo( TString(data) );
538
539 //sprintf(data, "nHits= %i, nSter= %i", recTrack->getNhits(), recTrack->nster());
540 //mdcTrack->AddInfo( TString(data) ); //Long Peixun's update: this line should be annotated
541
542 mdcTrack->CloseInfo();
543}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
const double kvC
TTree * t
Definition: binning.cxx:23
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
Definition: BesGeoTrack.cxx:63
virtual void SetCharge(Int_t charge)
MdcROOTGeo * GetMdcROOTGeo()
Definition: BesGeometry.h:43
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;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
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
const double mp
Definition: incllambda.cxx:45
float charge
const float pi
Definition: vector3.h:133

Referenced by SetMdcTracks().

◆ ConstructMucTrackFromRec()

void BesEvent::ConstructMucTrackFromRec ( BesGeoTrack mucTrack,
const TRecMucTrack recTrack 
)
virtual

Definition at line 895 of file BesEvent.cxx.

895 {
896 if (recTrack->depth() <= 0.0) return; // bad track
897
898 Double_t field = 1e-3; // Tesla
899 Double_t kvC = 3.0e8; // light speed
900 Int_t charge = 1;
901 Double_t pz = recTrack->pz(); // GeV
902 Double_t pt =
903 sqrt(recTrack->px()*recTrack->px() + recTrack->py()*recTrack->py()); // GeV
904 Double_t pi = TMath::Pi();
905
906 Double_t mucR =
907 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDX();
908 Double_t mucZ =
909 ((TGeoBBox*)gBesGeometry->GetMucROOTGeo()->GetVolumeMuc()->GetShape())->GetDZ();
910
911 Double_t radius = 1.0e+9;
912 Double_t curvature = 1.0/radius;
913 Double_t zStep = 2*pi*radius * fabs(pz/pt);
914 Double_t step = 1.0; // mm
915 Double_t delt = step*(1.0e-3)/kvC;
916
917 TGeoHelix helix(curvature, zStep, charge);
918
919 Double_t x = recTrack->xPos() * 10.0;
920 Double_t y = recTrack->yPos() * 10.0;
921 Double_t z = recTrack->zPos() * 10.0;
922
923 helix.InitPoint(x, y, z);
924 helix.InitDirection(recTrack->px(), recTrack->py(), recTrack->pz(), kFALSE);
925 helix.SetField(0.0, 0.0, field, kFALSE);
926
927 mucTrack->AddPoint(x, y, z, 0.0);
928 const Double_t *p;
929 Int_t nStep = 0;
930 do {
931 // helix Step before GetCurrentPoint, or first point will be wrong
932 helix.Step(step);
933 p = helix.GetCurrentPoint();
934 mucTrack->AddPoint(p[0], p[1], p[2], delt*nStep);
935 Double_t mp[3];
936 mp[0] = p[0];
937 mp[1] = p[1];
938 mp[2] = p[2];
939 mucTrack->PaintMarker(mp);
940 mucTrack->SetMarkerColor(kBlack);
941 mucTrack->SetMarkerSize(10);
942 nStep++;
943 }
944 while ( (p[0]*p[0] + p[1]*p[1]) < mucR*mucR && fabs(p[2]) < mucZ );
945
946 // Add associated muc hits
947 vector<Int_t> vecHits = recTrack->vecHits();
948 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
949 Identifier aMucID( vecHits[i] );
950 int part = MucID::part( aMucID );
951 int seg = MucID::seg( aMucID );
952 int gap = MucID::gap( aMucID );
953 int strip = MucID::strip( aMucID );
954
955 Muc2DStrip* aHit = gBesGeometry->GetMucROOTGeo()->Get2DStrip(part, seg, gap, strip);
956 mucTrack->AddHit( aHit );
957 //Long Peixun's update: for Muc 3D track display
958 TGeoPhysicalNode* pHit = gBesGeometry->GetMucROOTGeo()->GetPhysicalStrip(part, seg, gap, strip);
959 mucTrack->Add3DHit(pHit);
960 }
961
962 mucTrack->SetCharge(charge);
963
964 // Add Muc track info
965 char data[100];
966 TString info;
967
968 info = TString("MucTrack ");
969 info += recTrack->trackId();
970 mucTrack->AddInfo(info);
971
972 sprintf(data, "nHits= %i, maxHits= %i, nLayers= %i", recTrack->numHits(), recTrack->maxHitsInLayer(), recTrack->numLayers());
973 mucTrack->AddInfo( TString(data) );
974
975 sprintf(data, "lastLayer (br= %i, ec= %i)", recTrack->brLastLayer(), recTrack->ecLastLayer());
976 mucTrack->AddInfo( TString(data) );
977
978 sprintf(data, "depth = %.3f cm", recTrack->depth());
979 mucTrack->AddInfo( TString(data) );
980
981 sprintf(data, "#chi^{2}= %-.3f, dof= %i, rms= %-.3f", recTrack->chi2(), recTrack->dof(), recTrack->rms());
982 mucTrack->AddInfo( TString(data) );
983
984 sprintf(data, "Origin (%-.2f, %-.2f, %-.2f) cm", recTrack->xPos(), recTrack->yPos(), recTrack->zPos());
985 mucTrack->AddInfo( TString(data) );
986
987 sprintf(data, "p (%-.3f, %-.3f, %-.3f) GeV", recTrack->px(), recTrack->py(), recTrack->pz());
988 mucTrack->AddInfo( TString(data) );
989
990 mucTrack->CloseInfo();
991}
MucROOTGeo * GetMucROOTGeo()
Definition: BesGeometry.h:46
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;.
Muc2DStrip * Get2DStrip(int part, int seg, int gap, int strip)
Get Muc2DStrip;.
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

Referenced by SetMucTracks().

◆ ConstructTofTrackFromRec()

void BesEvent::ConstructTofTrackFromRec ( BesGeoTrack tofTrack,
const TRecTofTrack recTrack,
TDisTrack recEvent 
)
virtual

Definition at line 663 of file BesEvent.cxx.

665 {
666
667 vector<Int_t> vecBHits(0);
668 vector<Int_t> vecEHits(0);
669
670 const TObjArray *recTofTrackCol = fRecEvent->getTofTrackCol();
671 for (Int_t i = 0; i < recTofTrackCol->GetEntriesFast(); i++){
672 TRecTofTrack *recHit = (TRecTofTrack*)recTofTrackCol->At(i);
673 if ( !Is_tofCounter( recHit->status())) continue;
674
675 Int_t recHitId = recHit->trackID();
676 Int_t recTrkId = recTrack->trackID();
677 if (recHitId == recTrkId) {
678 if ( Is_tofBarrel( recHit->status() ) ) {
679 vecBHits.push_back(recHit->tofID());
680 }
681 else {
682 vecEHits.push_back(recHit->tofID());
683 }
684 }
685 }
686
687 TGeoPhysicalNode *phyNode = 0;
688 Double_t x=0.0, y=0.0, z=0.0;
689
690 Int_t nHits;
691 if (vecBHits.size()){
692 nHits = vecBHits.size();
693 for (Int_t i = 0; i < nHits; i++) {
694
695 int part = 1;
696 int layer = 0;
697 int scin = 0;
698 if ( ( vecBHits[i] >= 0 ) && ( vecBHits[i] <= 87 ) ) {
699 layer = 0;
700 scin = vecBHits[i];
701 }
702 else {
703 layer = 1;
704 scin = vecBHits[i] - 88;
705 }
706
707 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
708 tofTrack->AddHit( aHit );
709
710 // calculate average position
711 Double_t local[3] = {0.0, 0.0, 0.0};
712 Double_t master[3] = {0.0, 0.0, 0.0};
713 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
714 tofTrack->Add3DHit(phyNode); //Long Peixun's update: for Tof 3D track display
715 if (phyNode)
716 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
717 // transform to top
718 x += master[0];
719 y += master[1];
720 z += master[2];
721 }
722 x /= nHits;
723 y /= nHits;
724 z /= nHits;
725
726 z = recTrack->zrhit();
727
728 tofTrack->SetMarker(x, y, z);
729 }
730
731 else if (vecEHits.size()){
732 nHits = vecEHits.size();
733 for (Int_t i = 0; i < nHits; i++) {
734
735 int part = 0;
736 int layer = 0;
737 int scin = 0;
738 if ( ( vecEHits[i] >= 0 ) && ( vecEHits[i] <= 47 ) ) {
739 part = 2;
740 scin = vecEHits[i];
741 }
742 else {
743 part = 0;
744 scin = vecEHits[i] - 48;
745 }
746
747
748 Tof2DScin* aHit = gBesGeometry->GetTofROOTGeo()->Get2DScin(part, layer, scin);
749 tofTrack->AddHit( aHit );
750
751 // calculate average position
752 Double_t local[3] = {0.0, 0.0, 0.0};
753 Double_t master[3] = {0.0, 0.0, 0.0};
754 phyNode = gBesGeometry->GetTofROOTGeo()->GetPhysicalScin(part, layer, scin);
755 tofTrack->Add3DHit(phyNode); //Long Peixun's update: for Tof 3D track display
756 if (phyNode)
757 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]);
758 // transform to top
759 x += master[0];
760 y += master[1];
761 z += master[2];
762 }
763 x /= nHits;
764 y /= nHits;
765 z /= nHits;
766
767 tofTrack->SetMarker(x, y, z);
768 }
769
770 // Add tof track info
771 char data[100];
772 TString info;
773
774 info = TString("TofTrack ");
775 info += recTrack->trackID();
776 tofTrack->AddInfo(info);
777
778 //sprintf(data, "Part = %i, Qual1 = %i, Qual2 = %i", recTrack->getPart(), recTrack->getQual1(), recTrack->getQual2());
779 //tofTrack->AddInfo( TString(data) );
780
781 //sprintf(data, "Tof = (%-.3f #pm %-.3f) ns", recTrack->getTof(), recTrack->getETof());
782 //tofTrack->AddInfo( TString(data) );
783
784 //sprintf(data, "Tof1 = (%-.3f #pm %-.3f) ns", recTrack->getTof1(), recTrack->getETof1());
785 //tofTrack->AddInfo( TString(data) );
786
787 //sprintf(data, "Tof2 = (%-.3f #pm %-.3f) ns", recTrack->getTof2(), recTrack->getETof2());
788 //tofTrack->AddInfo( TString(data) );
789
790 //sprintf(data, "Path(1=%-.2f, 2=%-.2f) mm", recTrack->getPath1(), recTrack->getPath2());
791 //tofTrack->AddInfo( TString(data) );
792
793 //sprintf(data, "Pulse(1=%-.0f, 2=%-.0f)", recTrack->getPh1(), recTrack->getPh2());
794 //tofTrack->AddInfo( TString(data) );
795
796 //sprintf(data, "ZHit(1=%-.2fmm, 2=%-.2f)mm", recTrack->getZHit1(), recTrack->getZHit2());
797 //tofTrack->AddInfo( TString(data) );
798
799 ////sprintf(data, "ZTDC1=%-.2fmm, ZTDC2=%-.2fmm", recTrack->getZTDC1(), recTrack->getZTDC2());
800 ////tofTrack->AddInfo( TString(data) );
801
802 //sprintf(data, "RHit = %-.3f, Beta = %-.3f", recTrack->getRHit(), recTrack->getBeta());
803 //tofTrack->AddInfo( TString(data) );
804
805 //sprintf(data, "w_e = %-.2f%%, w_mu = %-.2f%%", recTrack->getWeightElectron()*100.0, recTrack->getWeightMuon()*100.0);
806 //tofTrack->AddInfo( TString(data) );
807
808 //sprintf(data, "w_pi = %-.2f%%, w_K = %-.2f%%", recTrack->getWeightPion()*100.0, recTrack->getWeightKaon()*100.0);
809 //tofTrack->AddInfo( TString(data) );
810
811 //sprintf(data, "w_P = %-.2f%%", recTrack->getWeightProton()*100.0);
812 //tofTrack->AddInfo( TString(data) );
813
814 tofTrack->CloseInfo();
815}
TofROOTGeo * GetTofROOTGeo()
Definition: BesGeometry.h:44
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
Tof2DScin * Get2DScin(Int_t part, Int_t layer, Int_t scin)
Get Tof2DScin;.
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.

Referenced by SetTofTracks().

◆ Delete()

void BesEvent::Delete ( Option_t *  option = "")
virtual

Definition at line 58 of file BesEvent.cxx.

58 {
59 //
60 // Clear event
61 TString opt = option;
62 opt.ToUpper();
63
64 if (fMdcTrackCol) {
65 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
66 delete fMdcTrackCol->At(j);
67 }
68 fMdcTrackCol->Clear("C");
69 delete fMdcTrackCol;
70 }
71 if (fTofTrackCol) {
72 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
73 delete fTofTrackCol->At(j);
74 }
75 fTofTrackCol->Clear("C");
76 delete fTofTrackCol;
77 }
78 if (fEmcTrackCol) {
79 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
80 delete fEmcTrackCol->At(j);
81 }
82 fEmcTrackCol->Clear("C");
83 delete fEmcTrackCol;
84 }
85 if (fMucTrackCol) {
86 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
87 delete fMucTrackCol->At(j);
88 }
89 fMucTrackCol->Clear("C");
90 delete fMucTrackCol;
91 }
92 if (fExtTrackCol) {
93 for (int j = 0; j < fExtTrackCol->GetEntries(); j++){
94 delete fExtTrackCol->At(j);
95 }
96 fExtTrackCol->Clear("C");
97 delete fExtTrackCol;
98 }
99}

Referenced by ~BesEvent().

◆ DrawHits()

void BesEvent::DrawHits ( Option_t *  option)
virtual

Definition at line 1060 of file BesEvent.cxx.

1060 {
1061 if (gBesGeometry)
1062 {
1067 }
1068}

Referenced by BesView::SetViewType().

◆ DrawTracks()

void BesEvent::DrawTracks ( Option_t *  option)
virtual

Definition at line 1072 of file BesEvent.cxx.

1072 {
1073
1074 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1075
1076 //Long Peixun's update: Always construct 3D line, whether draw it or not
1077 if (view)
1078 {
1079 for (Int_t i = 0; i < fMdcTrackCol->GetEntries(); i++)
1080 {
1081 BesGeoTrack *track = (BesGeoTrack*)fMdcTrackCol->At(i);
1082 if (view->GetVisTracksGlobal() && view->GetVisTracksMdc())
1083 track->Draw();
1084 else track->Construct3DLine();
1085 }
1086
1087 for (Int_t i = 0; i < fTofTrackCol->GetEntries(); i++)
1088 {
1089 BesGeoTrack *track = (BesGeoTrack*)fTofTrackCol->At(i);
1090 if (view->GetVisTracksGlobal() && view->GetVisTracksTof())
1091 track->Draw();
1092 else track->Construct3DLine();
1093 }
1094
1095 for (Int_t i = 0; i < fEmcTrackCol->GetEntries(); i++)
1096 {
1097 BesGeoTrack *track = (BesGeoTrack*)fEmcTrackCol->At(i);
1098 if (view->GetVisTracksGlobal() && view->GetVisTracksEmc())
1099 track->Draw();
1100 else track->Construct3DLine();
1101 }
1102
1103 for (Int_t i = 0; i < fMucTrackCol->GetEntries(); i++)
1104 {
1105 BesGeoTrack *track = (BesGeoTrack*)fMucTrackCol->At(i);
1106 if (view->GetVisTracksGlobal() && view->GetVisTracksMuc())
1107 track->Draw();
1108 else track->Construct3DLine();
1109 }
1110
1111 for (Int_t i = 0; i < fExtTrackCol->GetEntries(); i++)
1112 {
1113 BesGeoTrack *track = (BesGeoTrack*)fExtTrackCol->At(i);
1114 if (view->GetVisTracksGlobal() && view->GetVisTracksExt())
1115 track->Draw();
1116 else track->Construct3DLine();
1117 }
1118 }
1119}
virtual void Draw(Option_t *option="")
virtual void Construct3DLine()
Bool_t GetVisTracksExt()
Definition: BesView.h:240
Bool_t GetVisTracksGlobal()
Definition: BesView.h:235
Bool_t GetVisTracksMuc()
Definition: BesView.h:239
Bool_t GetVisTracksTof()
Definition: BesView.h:237
Bool_t GetVisTracksEmc()
Definition: BesView.h:238
Bool_t GetVisTracksMdc()
Definition: BesView.h:236

Referenced by BesView::SetViewType().

◆ GetDay()

Int_t BesEvent::GetDay ( )
inline

Definition at line 257 of file BesEvent.h.

257 {
258 return fEventHeader.GetEventDay();
259 }
Int_t GetEventDay()

Referenced by BesVisDisplay::DrawHeader().

◆ GetDedx()

const TRecMdcDedx * BesEvent::GetDedx ( Int_t  i) const
inline

Definition at line 237 of file BesEvent.h.

237 {
238 // if (fRecEvent)
239 // return fRecEvent->getRecMdcDedx(i);
240 // else
241 return 0;
242 }

◆ GetDedxCol()

const TObjArray * BesEvent::GetDedxCol ( TDisTrack recEvent) const
inline

Definition at line 153 of file BesEvent.h.

153 {
154 // if (recEvent)
155 // return recEvent->getRecMdcDedxCol();
156 // else
157 return 0;
158 }

◆ GetDedxNum()

const Int_t BesEvent::GetDedxNum ( TDisTrack recEvent) const
inline

Definition at line 198 of file BesEvent.h.

198 {
199 // if (fRecEvent)
200 // return fRecEvent->getRecMdcDedxCol()->GetEntries();
201 // else
202 return -1;
203 }

◆ GetEmcDigi()

const TEmcDigi * BesEvent::GetEmcDigi ( Int_t  i) const
inline

Definition at line 110 of file BesEvent.h.

110 {
111 if (fDigiEvent) return fDigiEvent->getEmcDigi(i);
112 else return 0;
113 }
const TEmcDigi * getEmcDigi(Int_t i) const
retrieve a EmcDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:134

Referenced by Print().

◆ GetEmcDigiCol()

const TObjArray * BesEvent::GetEmcDigiCol ( ) const
inline

Definition at line 78 of file BesEvent.h.

78 {
79 if (fDigiEvent) return fDigiEvent->getEmcDigiCol();
80 else return 0;
81 }
const TObjArray * getEmcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
Definition: TDigiEvent.h:44

Referenced by EmcROOTGeo::SetHits().

◆ GetEmcDigiNum()

const Int_t BesEvent::GetEmcDigiNum ( ) const
inline

Definition at line 94 of file BesEvent.h.

94 {
95 if (fDigiEvent) return fDigiEvent->getEmcDigiCol()->GetEntries();
96 else return -1;
97 }

Referenced by Print().

◆ GetEmcShower()

const TRecEmcShower * BesEvent::GetEmcShower ( Int_t  i,
TDisTrack recEvent 
) const
inline

Definition at line 220 of file BesEvent.h.

220 {
221 if (recEvent)
222 return recEvent->getEmcShower(i);
223 else
224 return 0;
225 }
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
Definition: TDisTrack.cxx:157

Referenced by SetEvent().

◆ GetEmcShowerCol()

const TObjArray * BesEvent::GetEmcShowerCol ( TDisTrack recEvent) const
inline

Definition at line 135 of file BesEvent.h.

135 {
136 // if (recEvent)
137 // return recEvent->getEmcShowerCol();
138 // else
139 return 0;
140 }

◆ GetEmcShowerNum()

const Int_t BesEvent::GetEmcShowerNum ( TDisTrack recEvent) const
inline

Definition at line 178 of file BesEvent.h.

178 {
179 if (recEvent)
180 // return recEvent->getEmcShowerCol()->GetEntries();
181 return recEvent->getEmcShowerNum();
182 else
183 return -1;
184 }
int getEmcShowerNum()
Definition: TDisTrack.cxx:183

Referenced by SetEvent().

◆ GetEvent()

Long64_t BesEvent::GetEvent ( )
inline

Definition at line 248 of file BesEvent.h.

248 {
249 return fEventHeader.GetEventNumber();
250 }
Long64_t GetEventNumber()

Referenced by BesVisDisplay::DrawHeader().

◆ GetExtTrackCol()

const TObjArray * BesEvent::GetExtTrackCol ( ) const
inline

Definition at line 147 of file BesEvent.h.

147 {
148 return 0; // for test
149 //if (fRecEvent)
150 // return fRecEvent->getExtTrackCol();
151 //else return 0;
152 }

◆ GetExtTrackNum()

const Int_t BesEvent::GetExtTrackNum ( ) const
inline

Definition at line 192 of file BesEvent.h.

192 {
193 return -1;// for test
194 //if (fRecEvent)
195 // return fRecEvent->getExtTrackCol()->GetEntries();
196 //else return -1;
197 }

◆ GetHeader()

BesEventHeader BesEvent::GetHeader ( )
inline

Definition at line 272 of file BesEvent.h.

272 {
273 return fEventHeader;
274 }

Referenced by BesVisDisplay::DrawHeader(), and MdcROOTGeo::SetHits().

◆ GetHour()

Int_t BesEvent::GetHour ( )
inline

Definition at line 260 of file BesEvent.h.

260 {
261 return fEventHeader.GetEventHour();
262 }
Int_t GetEventHour()

Referenced by BesVisDisplay::DrawHeader().

◆ GetMC()

Int_t BesEvent::GetMC ( )
inline

Definition at line 269 of file BesEvent.h.

269 {
270 return fEventHeader.GetEventMC();
271 }
Bool_t GetEventMC()

Referenced by BesVisDisplay::DrawHeader().

◆ GetMdcDigi()

const TMdcDigi * BesEvent::GetMdcDigi ( Int_t  i) const
inline

Definition at line 102 of file BesEvent.h.

102 {
103 if (fDigiEvent) return fDigiEvent->getMdcDigi(i);
104 else return 0;
105 } //Long Peixun's update: Remove semicolon
const TMdcDigi * getMdcDigi(Int_t i) const
retrieve a TkrDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:124

Referenced by Print().

◆ GetMdcDigiCol()

const TObjArray * BesEvent::GetMdcDigiCol ( ) const
inline

Definition at line 70 of file BesEvent.h.

70 {
71 if (fDigiEvent) return fDigiEvent->getMdcDigiCol();
72 else return 0;
73 }
const TObjArray * getMdcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
Definition: TDigiEvent.h:31

Referenced by MdcROOTGeo::SetHits().

◆ GetMdcDigiNum()

const Int_t BesEvent::GetMdcDigiNum ( ) const
inline

Definition at line 86 of file BesEvent.h.

86 {
87 if (fDigiEvent) return fDigiEvent->getMdcDigiCol()->GetEntries();
88 else return -1;
89 }

Referenced by Print().

◆ GetMdcTrack()

const TRecMdcTrack * BesEvent::GetMdcTrack ( Int_t  i,
TDisTrack recEvent 
) const
inline

Definition at line 204 of file BesEvent.h.

204 {
205 if (recEvent)
206 return recEvent->getRecMdcTrack(i);
207 else return 0;
208 }
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
Definition: TDisTrack.cxx:113

Referenced by SetEvent().

◆ GetMdcTrackCol()

const TObjArray * BesEvent::GetMdcTrackCol ( TDisTrack recEvent) const
inline

Definition at line 119 of file BesEvent.h.

119 {
120 if (recEvent)
121 return recEvent->getRecMdcTrackCol();
122 else return 0;
123 }
const TObjArray * getRecMdcTrackCol() const
retrieve the whole TObjArray of RecMdcTrack Data
Definition: TDisTrack.h:31

◆ GetMdcTrackNum()

const Int_t BesEvent::GetMdcTrackNum ( TDisTrack recEvent) const
inline

Definition at line 159 of file BesEvent.h.

159 {
160 if (recEvent)
161// return recEvent->getRecMdcTrackCol()->GetEntries();
162 return recEvent->getMdcTrackNum();
163 else
164 return -1;
165 }
int getMdcTrackNum()
Definition: TDisTrack.cxx:163

Referenced by SetEvent().

◆ GetMin()

Int_t BesEvent::GetMin ( )
inline

Definition at line 263 of file BesEvent.h.

263 {
264 return fEventHeader.GetEventMin();
265 }
Int_t GetEventMin()

Referenced by BesVisDisplay::DrawHeader().

◆ GetMonth()

Int_t BesEvent::GetMonth ( )
inline

Definition at line 254 of file BesEvent.h.

254 {
255 return fEventHeader.GetEventMonth();
256 }
Int_t GetEventMonth()

Referenced by BesVisDisplay::DrawHeader().

◆ GetMucDigi()

const TMucDigi * BesEvent::GetMucDigi ( Int_t  i) const
inline

Definition at line 114 of file BesEvent.h.

114 {
115 if (fDigiEvent) return fDigiEvent->getMucDigi(i);
116 else return 0;
117 }
const TMucDigi * getMucDigi(Int_t i) const
retrieve a MucDigi From the collection, using the index into the array
Definition: TDigiEvent.cxx:158

Referenced by Print().

◆ GetMucDigiCol()

const TObjArray * BesEvent::GetMucDigiCol ( ) const
inline

Definition at line 82 of file BesEvent.h.

82 {
83 if (fDigiEvent) return fDigiEvent->getMucDigiCol();
84 else return 0;
85 }
const TObjArray * getMucDigiCol() const
retrieve the whole TObjArray of MucDigi Data
Definition: TDigiEvent.h:68

Referenced by MucROOTGeo::SetHits().

◆ GetMucDigiNum()

const Int_t BesEvent::GetMucDigiNum ( ) const
inline

Definition at line 98 of file BesEvent.h.

98 {
99 if (fDigiEvent) return fDigiEvent->getMucDigiCol()->GetEntries();
100 else return -1;
101 }

Referenced by Print().

◆ GetMucTrack()

const TRecMucTrack * BesEvent::GetMucTrack ( Int_t  i,
TDisTrack recEvent 
) const
inline

Definition at line 226 of file BesEvent.h.

226 {
227 if (recEvent)
228 return recEvent->getMucTrack(i);
229 else
230 return 0;
231 }
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:145

◆ GetMucTrackCol()

const TObjArray * BesEvent::GetMucTrackCol ( TDisTrack recEvent) const
inline

Definition at line 141 of file BesEvent.h.

141 {
142 if (recEvent)
143 return recEvent->getMucTrackCol();
144 else
145 return 0;
146 }
const TObjArray * getMucTrackCol() const
retrieve the whole TObjArray of MucTrack Data
Definition: TDisTrack.h:63

◆ GetMucTrackNum()

const Int_t BesEvent::GetMucTrackNum ( TDisTrack recEvent) const
inline

Definition at line 185 of file BesEvent.h.

185 {
186 if (recEvent)
187 return recEvent->getMucTrackNum();
188 // return recEvent->getMucTrackCol()->GetEntries();
189 else
190 return -1;
191 }
int getMucTrackNum()
Definition: TDisTrack.cxx:193

◆ GetRun()

Long64_t BesEvent::GetRun ( )
inline

Definition at line 245 of file BesEvent.h.

245 {
246 return fEventHeader.GetRunNumber();
247 }
Long64_t GetRunNumber()

Referenced by BesVisDisplay::DrawHeader().

◆ GetSec()

Int_t BesEvent::GetSec ( )
inline

Definition at line 266 of file BesEvent.h.

266 {
267 return fEventHeader.GetEventSec();
268 }
Int_t GetEventSec()

Referenced by BesVisDisplay::DrawHeader().

◆ GetTofDigi()

const TTofDigi * BesEvent::GetTofDigi ( Int_t  i) const
inline

Definition at line 106 of file BesEvent.h.

106 {
107 if (fDigiEvent) return fDigiEvent->getTofDigi(i);
108 else return 0;
109 }
const TTofDigi * getTofDigi(Int_t i) const
retrieve a TofDigi From the collection, using the index into the array
Definition: TDigiEvent.cxx:146

Referenced by Print().

◆ GetTofDigiCol()

const TObjArray * BesEvent::GetTofDigiCol ( ) const
inline

Definition at line 74 of file BesEvent.h.

74 {
75 if (fDigiEvent) return fDigiEvent->getTofDigiCol();
76 else return 0;
77 }
const TObjArray * getTofDigiCol() const
retrieve the whole TObjArray of TofDigi Data
Definition: TDigiEvent.h:56

Referenced by TofROOTGeo::SetHits().

◆ GetTofDigiNum()

const Int_t BesEvent::GetTofDigiNum ( ) const
inline

Definition at line 90 of file BesEvent.h.

90 {
91 if (fDigiEvent) return fDigiEvent->getTofDigiCol()->GetEntries();
92 else return -1;
93 }

Referenced by Print().

◆ GetTofTrack()

const TRecTofTrack * BesEvent::GetTofTrack ( Int_t  i,
TDisTrack recEvent 
) const
inline

Definition at line 214 of file BesEvent.h.

214 {
215 if (recEvent)
216 return recEvent->getTofTrack(i);
217 else
218 return 0;
219 }
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:134

◆ GetTofTrackCol()

const TObjArray * BesEvent::GetTofTrackCol ( TDisTrack recEvent) const
inline

Definition at line 129 of file BesEvent.h.

129 {
130 if (recEvent)
131 return recEvent->getTofTrackCol();
132 else
133 return 0;
134 }
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
Definition: TDisTrack.h:52

◆ GetTofTrackNum()

const Int_t BesEvent::GetTofTrackNum ( TDisTrack recEvent) const
inline

Definition at line 171 of file BesEvent.h.

171 {
172 if (recEvent)
173 // return recEvent->getTofTrackCol()->GetEntries();
174 return recEvent->getTofTrackNum();
175 else
176 return -1;
177 }
int getTofTrackNum()
Definition: TDisTrack.cxx:173

◆ GetYear()

Int_t BesEvent::GetYear ( )
inline

Definition at line 251 of file BesEvent.h.

251 {
252 return fEventHeader.GetEventYear();
253 }
Int_t GetEventYear()

Referenced by BesVisDisplay::DrawHeader().

◆ Print()

void BesEvent::Print ( Option_t *  option = "")
virtual

Definition at line 1123 of file BesEvent.cxx.

1123 {
1124 //
1125 // Print event information
1126 //
1127 // Options available:
1128 // '' - quiet, i.e. only numbers of hits and tracks etc. (default)
1129 // 'ALL' - very detailed output (might be hundreds of lines!)
1130 // 'Digi' - only Digi information
1131 // 'Dst' - only Dst information
1132 //
1133 TString opt = option;
1134 opt.ToUpper();
1135 Int_t i;
1136
1137 //cout << endl
1138 // << "==========================================================" << endl
1139 // << "Run: " << GetRun() << endl
1140 // << "Event: " << GetEvent() << endl
1141 // << "----------------------------------------------------------" << endl
1142 // << "Mdc digis: " << GetMdcDigiNum() << endl
1143 // << "Tof digis: " << GetTofDigiNum() << endl
1144 // << "Emc digis: " << GetEmcDigiNum() << endl
1145 // << "Muc digis: " << GetMucDigiNum() << endl
1146 // << "Mdc tracks: " << GetMdcTrackNum() << endl
1147 // << "Tof tracks: " << "debug++++++" /*GetTofTrackNum()*/ << endl
1148 // << "Emc tracks: " << GetEmcShowerNum() << endl
1149 // << "Muc tracks: " << GetMucTrackNum() << endl
1150 // << "Ext tracks: " << GetExtTrackNum() << endl
1151 // << "Dedx : " << GetDedxNum() << endl
1152 // << "----------------------------------------------------------" << endl;
1153
1154 if ( opt.Contains("ALL") || opt.Contains("Digi") ) {
1155 for ( i = 0; i < GetMdcDigiNum(); i++ ) GetMdcDigi(i)->Print();
1156 for ( i = 0; i < GetTofDigiNum(); i++ ) GetTofDigi(i)->Print();
1157 for ( i = 0; i < GetEmcDigiNum(); i++ ) GetEmcDigi(i)->Print();
1158 for ( i = 0; i < GetMucDigiNum(); i++ ) GetMucDigi(i)->Print();
1159 }
1160
1161 /* if ( opt.Contains("ALL") || opt.Contains("Dst") ) {
1162 for ( i = 0; i < GetMdcTrackNum(); i++ ) GetMdcTrack(i)->Print();
1163 // Tof -> BTof ETof
1164 //for ( i = 0; i < GetTofTrackNum(); i++ ) GetTofTrack(i)->Print();
1165 for ( i = 0; i < GetEmcShowerNum(); i++ ) GetEmcShower(i)->Print();
1166 for ( i = 0; i < GetMucTrackNum(); i++ ) GetMucTrack(i)->Print();
1167 cout << "wait for TRecExtEvent, BesEvent" << endl;
1168 //for ( i = 0; i < GetExtTrackNum(); i++ ) GetExtTrack(i)->Print();
1169 for ( i = 0; i < GetDedxNum(); i++ ) GetDedx(i)->Print();
1170 }
1171 */
1172 //cout << "=========================================================="
1173 //<< endl << endl;
1174}
const Int_t GetMucDigiNum() const
Definition: BesEvent.h:98
const Int_t GetTofDigiNum() const
Definition: BesEvent.h:90
const TTofDigi * GetTofDigi(Int_t i) const
Definition: BesEvent.h:106
const Int_t GetMdcDigiNum() const
Definition: BesEvent.h:86
const TMucDigi * GetMucDigi(Int_t i) const
Definition: BesEvent.h:114
const Int_t GetEmcDigiNum() const
Definition: BesEvent.h:94
const TMdcDigi * GetMdcDigi(Int_t i) const
Definition: BesEvent.h:102
const TEmcDigi * GetEmcDigi(Int_t i) const
Definition: BesEvent.h:110
void Print(Option_t *option="") const
Definition: TRawData.cxx:25

◆ SetEmcShowers()

void BesEvent::SetEmcShowers ( TDisTrack recEvent)
virtual

Definition at line 306 of file BesEvent.cxx.

306 {
307 if (fEmcTrackCol) {
308 for (int j = 0; j < fEmcTrackCol->GetEntries(); j++){
309 delete fEmcTrackCol->At(j);
310 }
311 fEmcTrackCol->Clear("C");
312 }
313 int emc_no = recEvent->getEmcShowerNum();
314
315 for (Int_t i = 0; i < emc_no; i++) {
316 const TRecEmcShower* recShower =recEvent->getEmcShower(i);
317 BesGeoTrack *emcTrack = new BesGeoTrack();
318 emcTrack->SetTrackType(2);
319
320 ConstructEmcTrackFromRec(emcTrack, recShower);
321 fEmcTrackCol->Add(emcTrack);
322 }
323}
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
Definition: BesEvent.cxx:817
virtual void SetTrackType(Int_t type)
Definition: BesGeoTrack.h:26

Referenced by SetTracks().

◆ SetEvent()

void BesEvent::SetEvent ( TDigiEvent digiEvent,
TDisTrack recEvent,
TEvtHeader evtHeader,
TRecEvTime recEvTime,
Bool_t  isRec 
)
virtual

Definition at line 114 of file BesEvent.cxx.

115{
116 //fDigiEvent = 0;
117 fDigiEvent = digiEvent;
118 fEvtHeader = evtHeader;
119 fRecEvTime = recEvTime;
120 //fTrigEvent = trigEvt;
121 fTrigEvent = 0;
122 // ========================================
123 // set trig information
124 // ========================================
125 if (fTrigEvent != 0){
126 vector<Int_t> trigConditionVector;
127 vector<Int_t> trigChannelVector;
128
129 const TTrigData* trigData = fTrigEvent->getTrigData();
130 const Int_t timeType = trigData->getTimingType();
131 //std::cout << "BesEvent::timing type: " << timeType << std::endl;
132 Int_t trigCondition;
133 Int_t trigChannel;
134 for (Int_t i = 0; i < 48; i++){
135 trigCondition = trigData->getTrigCondition(i);
136 if (trigCondition) trigConditionVector.push_back(i);
137 //std::cout << "BesEvent::trig condition: " << trigCondition << std::endl;
138 }
139 for (Int_t i = 0; i < 16; i++){
140 trigChannel = trigData->getTrigChannel(i);
141 if (trigChannel) trigChannelVector.push_back(i);
142 //std::cout << "BesEvent::trigChannel: " << trigChannel << std::endl;
143 }
144 fEventHeader.SetEventTrig(timeType, trigConditionVector, trigChannelVector);
145 }
146 else {
147 std::cout << "fTrigEvent does not exit!" << std::endl;
148 }
149 // ========================================
150 // set time information
151 // ========================================
152 if (fEvtHeader != 0){
153 time_t now;
154 //now = time(NULL);
155 now = (time_t)evtHeader->time();
156 //char str_time[256];
157 //sprintf(str_time, ctime(&now));
158 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
159 //cout << "time now: " << str_time << endl;
160 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
161
162 struct tm *local_time;
163 local_time = localtime(&now);
164 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
165 //cout << "time now sec: " << local_time->tm_sec << endl;
166 //cout << "time now min: " << local_time->tm_min << endl;
167 //cout << "time now hour: "<< local_time->tm_hour << endl;
168 //cout << "time now day: " << local_time->tm_mday << endl;
169 //cout << "time now mon: " << local_time->tm_mon << endl;
170 //cout << "time now year: "<< local_time->tm_year << endl;
171 //cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
172
173 Int_t time1 = (1900 + local_time->tm_year) * 10000 + (1 + local_time->tm_mon) * 100
174 + local_time->tm_mday;
175 Int_t time2 = local_time->tm_hour * 10000 + local_time->tm_min * 100
176 + local_time->tm_sec;
177
178 fEventHeader.SetEventHeaderGeneral(fEvtHeader->getRunId(),
179 fEvtHeader->getEventId(), time1, time2);
180 }
181 else {
182 cout << "fEvtHeader does not exit" << endl;
183 }
184
185 // ========================================
186 // set event start time information
187 // ========================================
188 //Long Peixun's update: if this event is not a rec event, don't show estime, status and quality
189 if (fRecEvTime != 0)
190 {
191 fEventHeader.SetEventRec(isRec);
192 if (isRec)
193 fEventHeader.SetEventEvTime(fRecEvTime->estime(),fRecEvTime->status(),fRecEvTime->quality());
194 else
195 fEventHeader.SetEventEvTime(0.0, 0, 0.0);
196 }
197 else
198 {
199 cout << "fRecEvTime does not exit" << endl;
200 fEventHeader.SetEventRec(false);
201 fEventHeader.SetEventEvTime(0.0, 0, 0.0);
202 }
203
204 // ========================================
205 // set Mdc information
206 // ========================================
207 Double_t p = 0.0, pt = 0.0, px = 0.0, py = 0.0, pz = 0.0;
208 for (Int_t i = 0; i < GetMdcTrackNum(recEvent); i++) {
209 p += GetMdcTrack(i,recEvent)->p();
210 pt += GetMdcTrack(i,recEvent)->pxy();
211 px += GetMdcTrack(i,recEvent)->px();
212 py += GetMdcTrack(i,recEvent)->py();
213 pz += GetMdcTrack(i,recEvent)->pz();
214 }
215 fEventHeader.SetEventMdc(p, pt, px, py, pz);
216
217 // ========================================
218 // set Emc information
219 // ========================================
220 Double_t t = 9999.0;
221 Double_t e = 0.0;
222 for (Int_t i = 0; i < GetEmcShowerNum(recEvent); i++) {
223 e += GetEmcShower(i,recEvent)->energy();
224 }
225 fEventHeader.SetEventEmc(e);
226 // ========================================
227 // set digi and rec
228 // ========================================
229 if (fDigiEvent != 0){
230 SetHits();
231 fEventHeader.SetEventMC(fDigiEvent->getFromMc());
232 }
233 if (recEvent != 0)
234 SetTracks(recEvent);
235}
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 SetHits()
Definition: BesEvent.cxx:239
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:204
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:159
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
Definition: BesEvent.h:178
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:220
virtual void SetTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:250
Bool_t getFromMc()
Definition: TDigiEvent.h:27
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
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 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

Referenced by BesClient::GetEvent().

◆ SetExtTracks()

void BesEvent::SetExtTracks ( TDisTrack recEvent)
virtual

Definition at line 347 of file BesEvent.cxx.

347 {
348 //if (fExtTrackCol) fExtTrackCol->Clear("C");
349
350 //for (Int_t i = 0; i < GetExtTrackNum(); i++) {
351 // const TExtTrack* recTrack = GetExtTrack(i);
352 // BesGeoTrack *extTrack = new BesGeoTrack();
353 // extTrack->SetTrackType(4);
354
355 // ConstructExtTrackFromRec(extTrack, recTrack);
356 // fExtTrackCol->Add(extTrack);
357 //}
358}

Referenced by SetTracks().

◆ SetHits()

void BesEvent::SetHits ( )
virtual

Definition at line 239 of file BesEvent.cxx.

239 {
240 if (gBesGeometry) {
245 }
246}
void SetHits()
Set all physicalNodes corresponding to digiCol;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.

Referenced by SetEvent().

◆ SetMagnetic()

void BesEvent::SetMagnetic ( Double_t  input)
inline

Definition at line 68 of file BesEvent.h.

68{f_Magnetic = input;}

Referenced by BesClient::ExecuteReturn().

◆ SetMdcTracks()

void BesEvent::SetMdcTracks ( TDisTrack recEvent)
virtual

Definition at line 264 of file BesEvent.cxx.

264 {
265 if (fMdcTrackCol){
266 for (int j = 0; j < fMdcTrackCol->GetEntries(); j++){
267 delete fMdcTrackCol->At(j);
268 }
269 fMdcTrackCol->Clear("C");
270 }
271 int mdc_no = recEvent->getMdcTrackNum();
272 for (Int_t i = 0; i < mdc_no; i++) {
273 const TRecMdcTrack* recTrack =recEvent->getRecMdcTrack(i);
274 BesGeoTrack *mdcTrack = new BesGeoTrack();
275 mdcTrack->SetTrackType(0);
276
277 ConstructMdcTrackFromRec(mdcTrack, recTrack,recEvent);
278 fMdcTrackCol->Add(mdcTrack);
279 }
280}
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:362

Referenced by SetTracks().

◆ SetMucTracks()

void BesEvent::SetMucTracks ( TDisTrack recEvent)
virtual

Definition at line 327 of file BesEvent.cxx.

327 {
328 if (fMucTrackCol) {
329 for (int j = 0; j < fMucTrackCol->GetEntries(); j++){
330 delete fMucTrackCol->At(j);
331 }
332 fMucTrackCol->Clear("C");
333 }
334 int muc_no = recEvent->getMucTrackNum();
335 for (Int_t i = 0; i < muc_no; i++) {
336 const TRecMucTrack* recTrack =recEvent->getMucTrack(i);
337 BesGeoTrack *mucTrack = new BesGeoTrack();
338 mucTrack->SetTrackType(3);
339
340 ConstructMucTrackFromRec(mucTrack, recTrack);
341 fMucTrackCol->Add(mucTrack);
342 }
343}
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
Definition: BesEvent.cxx:895

Referenced by SetTracks().

◆ SetTofTracks()

void BesEvent::SetTofTracks ( TDisTrack recEvent)
virtual

Definition at line 284 of file BesEvent.cxx.

284 {
285 if (fTofTrackCol) {
286 for (int j = 0; j < fTofTrackCol->GetEntries(); j++){
287 delete fTofTrackCol->At(j);
288 }
289 fTofTrackCol->Clear("C");
290 }
291 int tof_no = recEvent->getTofTrackNum();
292
293 for (Int_t i = 0; i < tof_no; i++) {
294 const TRecTofTrack* recTrack = recEvent->getTofTrack(i);
295 if ( !Is_tofCounter( recTrack->status())) continue;
296 BesGeoTrack *tofTrack = new BesGeoTrack();
297 tofTrack->SetTrackType(1);
298
299 ConstructTofTrackFromRec(tofTrack, recTrack,recEvent);
300 fTofTrackCol->Add(tofTrack);
301 }
302}
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:663

Referenced by SetTracks().

◆ SetTracks()

void BesEvent::SetTracks ( TDisTrack recEvent)
virtual

Definition at line 250 of file BesEvent.cxx.

250 {
251 if (gBesGeometry)
252 {
253 //Long Peixun's update: Add judging detector geometry code
254 SetMdcTracks(recEvent);
255 SetTofTracks(recEvent);
256 SetEmcShowers(recEvent);
257 SetMucTracks(recEvent);
258 SetExtTracks(recEvent);
259 }
260}
virtual void SetTofTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:284
virtual void SetMucTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:327
virtual void SetMdcTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:264
virtual void SetEmcShowers(TDisTrack *recEvent)
Definition: BesEvent.cxx:306
virtual void SetExtTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:347

Referenced by SetEvent().


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