BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcTrkRecon/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([email protected]) Migrate to BESIII
15//------------------------------------------------------------------------
16#ifndef MDCSEGUSAGE_H
17#define MDCSEGUSAGE_H
18
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
46 return ( (segUse & (usedNegAmb() | usedPosAmb())) != 0);
47}
48
50 if (i <= 0) { segUse |= usedNegAmb(); }
51 else { segUse |= usedPosAmb(); }
52}
53
54bool
55MdcSegUsage::usedAmbig(int ambig) const {
56 if (ambig <= 0) {
57 return (usedNegAmb() & segUse) != 0;
58 }
59 else {
60 return (usedPosAmb() & segUse) != 0;
61 }
62}
63
64#endif
65
virtual ~MdcSegUsage()
Definition: MdcSegUsage.cxx:16
void killHit()
Definition: MdcSegUsage.cxx:21