BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSegData Class Reference

#include <MdcSegData.h>

Public Types

typedef MdcMap< const MdcHit *, MdcSegUsage * > MdcHitDict
 

Public Member Functions

 MdcSegData (bool skipUsedHit)
 
virtual ~MdcSegData ()
 
int nevent () const
 
int nhits () const
 
int runNumber () const
 
const MdcHithit (int hitno) const
 
const MdcHitDictsegUsage () const
 
const MdcHitMaphitMap () const
 
void loadevent (MdcHitCol *col, MdcHitMap *hmap, double tbunch)
 
double bunchTime (void) const
 
bool skippingUsed () const
 
void poisonHits (const MdcDetector *gm, int debug=0)
 

Detailed Description

Definition at line 26 of file MdcSegData.h.

Member Typedef Documentation

◆ MdcHitDict

Definition at line 29 of file MdcSegData.h.

Constructor & Destructor Documentation

◆ MdcSegData()

MdcSegData::MdcSegData ( bool  skipUsedHit)

Definition at line 16 of file MdcSegData.cxx.

18{
19 eventNumber=0;
20 _segUsage = 0;
21 _hitMap = 0;
22 _bunchTime = 0;
23 _skipUsed = skip;
24
25 _theHits = 0;
26}

◆ ~MdcSegData()

MdcSegData::~MdcSegData ( void  )
virtual

Definition at line 29 of file MdcSegData.cxx.

29 {
30//------------------------------------------------------------------------
31 delete [] _segUsage;
32}

Member Function Documentation

◆ bunchTime()

double MdcSegData::bunchTime ( void  ) const
inline

Definition at line 41 of file MdcSegData.h.

41{return _bunchTime;}

◆ hit()

const MdcHit * MdcSegData::hit ( int  hitno) const

Definition at line 73 of file MdcSegData.cxx.

73 {
74//------------------------------------------------------------------------
75return (*_theHits)[hitno];
76}

◆ hitMap()

const MdcHitMap * MdcSegData::hitMap ( ) const
inline

Definition at line 39 of file MdcSegData.h.

39{return _hitMap;}

Referenced by poisonHits().

◆ loadevent()

void MdcSegData::loadevent ( MdcHitCol col,
MdcHitMap hmap,
double  tbunch 
)

Definition at line 43 of file MdcSegData.cxx.

43 {
44//------------------------------------------------------------------------
45 _bunchTime = tb;
46 _theHits = hitcol;
47 _hitMap = hitmap;
48 assert (_hitMap != 0);
49
50 _segUsageDict.clear();
51 delete [] _segUsage;
52 _segUsage = 0;
53 eventNumber++;
54
55 _segUsage = new MdcSegUsage[nhits()];
56
57 MdcHit* aHit = 0;
58 MdcHitCol::iterator iter = _theHits->begin();
59 int index = 0;
60 for (;iter != _theHits->end(); iter++) {
61 aHit = *iter;
62 _segUsageDict.put(aHit, &(_segUsage[index]));
63 if (skippingUsed() && aHit->usedHit()) {
64 // Mark for later skipping
65 _segUsage[index].killHit();
66 }
67 index++;
68 }
69}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
Definition: MdcHit.h:44
void clear()
void put(const K &, const V &)
bool skippingUsed() const
Definition: MdcSegData.h:42
int nhits() const
Definition: MdcSegData.cxx:36
void killHit()
Definition: MdcSegUsage.cxx:21
bool usedHit(void) const
Definition: TrkFundHit.h:57

◆ nevent()

int MdcSegData::nevent ( ) const
inline

Definition at line 34 of file MdcSegData.h.

34{return eventNumber;}

◆ nhits()

int MdcSegData::nhits ( ) const

Definition at line 36 of file MdcSegData.cxx.

36 {
37//------------------------------------------------------------------------
38 return _theHits->size();
39}

Referenced by loadevent().

◆ poisonHits()

void MdcSegData::poisonHits ( const MdcDetector gm,
int  debug = 0 
)

Definition at line 81 of file MdcSegData.cxx.

81 {
82//------------------------------------------------------------------------
83 // Mark hits as poor candidates for segment-finding, if they are located
84 // within a string of consecutive hits in the same layer (end hits are
85 // not marked).
86 for (int ilayer = 0; ilayer < gm->nLayer(); ilayer++) {
87 int nwire = gm->Layer(ilayer)->nWires();
88 for (int iwire=0; iwire < nwire;++iwire) {
89 int wireNext = mdcWrapWire(iwire+1, nwire);
90 if ( 0 == hitMap()->hitWire(ilayer, wireNext) ) {
91 // 0 1 2 3 4
92 // next wire not there: ? o ? ? ?
93 // so the next-to-next wire shouldn't be poisened
94 // (it's left neighbour is empty)
95 // and the next candidate to check is + 3
96 iwire+=2; continue;
97 }
98
99 MdcHit* theHit = hitMap()->hitWire(ilayer, iwire);
100 if (theHit == 0) {
101 // 0 1 2 3 4
102 // next wire is there, this one isn't : o x ? ? ?
103 // and the next candidate to check is + 2
104 ++iwire; continue;
105 }
106
107 int wirePrev = mdcWrapWire(iwire-1, nwire);
108 if ( 0 != hitMap()->hitWire(ilayer, wirePrev)) {
109 segUsage().get(theHit)->killHit();
110 if(debug>1){
111 theHit->print(std::cout);
112 std::cout<< " killed " << std::endl;
113 }
114 }else{
115 if(debug>1){
116 theHit->print(std::cout);
117 std::cout<< " ok " << std::endl;
118 }
119 }
120 } // end wire loop
121 } // end layer loop
122
123 return;
124}
int nLayer() const
Definition: MdcDetector.h:54
const MdcLayer * Layer(unsigned id) const
Definition: MdcDetector.h:33
MdcHit * hitWire(int lay, int wire) const
Definition: MdcHitMap.h:34
void print(std::ostream &o) const
Definition: MdcHit.cxx:121
int nWires(void) const
Definition: MdcLayer.h:30
bool get(const K &theKey, V &theAnswer) const
const MdcHitDict & segUsage() const
Definition: MdcSegData.h:38
const MdcHitMap * hitMap() const
Definition: MdcSegData.h:39
int mdcWrapWire(int wireIn, int nCell)
Definition: mdcWrapWire.h:6

◆ runNumber()

int MdcSegData::runNumber ( ) const
inline

Definition at line 36 of file MdcSegData.h.

36{return _runNumber;}

◆ segUsage()

const MdcHitDict & MdcSegData::segUsage ( ) const
inline

Definition at line 38 of file MdcSegData.h.

38{return _segUsageDict;}

Referenced by poisonHits().

◆ skippingUsed()

bool MdcSegData::skippingUsed ( ) const
inline

Definition at line 42 of file MdcSegData.h.

42{return _skipUsed;}

Referenced by loadevent().


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