BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/MdcSegUsage.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcSegUsage.h,v 1.2 2009/12/16 09:02:47 zhangy Exp $
4//
5// Description:
6// Records usage of a single hit in one of my segments. Association
7// with hit must be maintained externally.
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author(s):
13// Steve Schaffner
14// Zhang Yao(zhangyao@ihep.ac.cn) Migrate to BESIII
15//------------------------------------------------------------------------
16#ifndef MDCSEGUSAGE_H
17#define MDCSEGUSAGE_H
18
19class MdcSegUsage {
20public:
22 virtual ~MdcSegUsage();
23
24 inline bool usedSeg() const;
25 inline bool usedAmbig( int i ) const;
26 inline void setUsedAmbig( int i );
27 void killHit();
28 bool deadHit() const { return ( ( segUse & deadFlag() ) != 0 ); }
29
30private:
31 // Bit-mapping definitions for segment hit use word
32 unsigned usedNegAmb() const { return 1u; }
33 unsigned usedPosAmb() const { return 2u; }
34 unsigned deadFlag() const { return 4u; }
35
36 unsigned segUse;
37
38 // Preempt
39 MdcSegUsage& operator=( const MdcSegUsage& );
40 MdcSegUsage( const MdcSegUsage& );
41};
42
43// inline functs:
44bool MdcSegUsage::usedSeg( void ) const {
45 return ( ( segUse & ( usedNegAmb() | usedPosAmb() ) ) != 0 );
46}
47
48void MdcSegUsage::setUsedAmbig( int i ) {
49 if ( i <= 0 ) { segUse |= usedNegAmb(); }
50 else { segUse |= usedPosAmb(); }
51}
52
53bool MdcSegUsage::usedAmbig( int ambig ) const {
54 if ( ambig <= 0 ) { return ( usedNegAmb() & segUse ) != 0; }
55 else { return ( usedPosAmb() & segUse ) != 0; }
56}
57
58#endif
void setUsedAmbig(int i)
void killHit()
virtual ~MdcSegUsage()
bool usedAmbig(int i) const
bool usedSeg() const