BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcRawDataProvider Class Reference

#include <MdcRawDataProvider.h>

Inheritance diagram for MdcRawDataProvider:

Public Types

enum  MdcControlMode {
  i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 ,
  b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF ,
  b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 ,
  b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 ,
  b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 ,
  b_keepAllChannel = 0x40000
}
enum  MdcControlMode {
  i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 ,
  b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF ,
  b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 ,
  b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 ,
  b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 ,
  b_keepAllChannel = 0x40000
}
enum  MdcControlMode {
  i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 ,
  b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF ,
  b_keepUnmatch = 0x2000 , b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 ,
  b_unRedo = 0x20000 , b_keepAllChannel = 0x40000 , i_maxMdcDigi = 0x1FFF , b_keepUnmatch = 0x2000 ,
  b_dropHot = 0x4000 , b_keepSkipped = 0x8000 , b_keepBadTdc = 0x10000 , b_unRedo = 0x20000 ,
  b_keepAllChannel = 0x40000
}

Public Member Functions

 MdcRawDataProvider ()
 MdcRawDataProvider (const char *name)
 ~MdcRawDataProvider ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void handle (const Incident &)
void setSkipLayers (const std::vector< int > &skipLayers)
void setEffThreshold (float effThreshold)
void setAdcThresholds (const std::vector< float > &adcThresholds)
MdcDigiVecgetMdcDigiVec (uint32_t control=0)
 MdcRawDataProvider ()
 MdcRawDataProvider (const char *name)
 ~MdcRawDataProvider ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void handle (const Incident &)
void setSkipLayers (const std::vector< int > &skipLayers)
void setEffThreshold (float effThreshold)
void setAdcThresholds (const std::vector< float > &adcThresholds)
MdcDigiVecgetMdcDigiVec (uint32_t control=0)
 MdcRawDataProvider ()
 MdcRawDataProvider (const char *name)
 ~MdcRawDataProvider ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void handle (const Incident &)
void setSkipLayers (const std::vector< int > &skipLayers)
void setEffThreshold (float effThreshold)
void setAdcThresholds (const std::vector< float > &adcThresholds)
MdcDigiVecgetMdcDigiVec (uint32_t control=0)
Public Member Functions inherited from RawDataProviderBase
 RawDataProviderBase (const char *name)
virtual ~RawDataProviderBase ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void setSvcLocator (ISvcLocator *svcLoc)
void setMsgSvc (IMessageSvc *svc)
void setMsgName (const char *name)
 RawDataProviderBase (const char *name)
virtual ~RawDataProviderBase ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void setSvcLocator (ISvcLocator *svcLoc)
void setMsgSvc (IMessageSvc *svc)
void setMsgName (const char *name)
 RawDataProviderBase (const char *name)
virtual ~RawDataProviderBase ()
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
void setSvcLocator (ISvcLocator *svcLoc)
void setMsgSvc (IMessageSvc *svc)
void setMsgName (const char *name)

Additional Inherited Members

Protected Member Functions inherited from RawDataProviderBase
 RawDataProviderBase ()
 RawDataProviderBase ()
 RawDataProviderBase ()
Protected Attributes inherited from RawDataProviderBase
ISvcLocator * m_svcLocator
IMessageSvc * m_msgSvc
std::string m_name

Detailed Description

Member Enumeration Documentation

◆ MdcControlMode [1/3]

Enumerator
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 

Definition at line 37 of file Event/RawDataProviderSvc/include/RawDataProviderSvc/MdcRawDataProvider.h.

◆ MdcControlMode [2/3]

Enumerator
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataProviderSvc/MdcRawDataProvider.h.

37 {
38 i_maxMdcDigi = 0x1FFF,
39 b_keepUnmatch = 0x2000,
40 b_dropHot = 0x4000,
41 b_keepSkipped = 0x8000,
42 b_keepBadTdc = 0x10000,
43 b_unRedo = 0x20000,
44 b_keepAllChannel = 0x40000
45 };

◆ MdcControlMode [3/3]

Enumerator
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
b_keepAllChannel 

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataProviderSvc/MdcRawDataProvider.h.

37 {
38 i_maxMdcDigi = 0x1FFF,
39 b_keepUnmatch = 0x2000,
40 b_dropHot = 0x4000,
41 b_keepSkipped = 0x8000,
42 b_keepBadTdc = 0x10000,
43 b_unRedo = 0x20000,
44 b_keepAllChannel = 0x40000
45 };

Constructor & Destructor Documentation

◆ MdcRawDataProvider() [1/6]

MdcRawDataProvider::MdcRawDataProvider ( )

Definition at line 26 of file MdcRawDataProvider.cxx.

27 : RawDataProviderBase(), digiRef( 0 ), m_mdcCalibFunSvc( 0 ) {}

◆ MdcRawDataProvider() [2/6]

MdcRawDataProvider::MdcRawDataProvider ( const char * name)

Definition at line 29 of file MdcRawDataProvider.cxx.

30 : RawDataProviderBase( name ), digiRef( 0 ), m_mdcCalibFunSvc( 0 ) {}

◆ ~MdcRawDataProvider() [1/3]

MdcRawDataProvider::~MdcRawDataProvider ( )

Definition at line 32 of file MdcRawDataProvider.cxx.

32{}

◆ MdcRawDataProvider() [3/6]

MdcRawDataProvider::MdcRawDataProvider ( )

◆ MdcRawDataProvider() [4/6]

MdcRawDataProvider::MdcRawDataProvider ( const char * name)

◆ ~MdcRawDataProvider() [2/3]

MdcRawDataProvider::~MdcRawDataProvider ( )

◆ MdcRawDataProvider() [5/6]

MdcRawDataProvider::MdcRawDataProvider ( )

◆ MdcRawDataProvider() [6/6]

MdcRawDataProvider::MdcRawDataProvider ( const char * name)

◆ ~MdcRawDataProvider() [3/3]

MdcRawDataProvider::~MdcRawDataProvider ( )

Member Function Documentation

◆ getMdcDigiVec() [1/3]

MdcDigiVec & MdcRawDataProvider::getMdcDigiVec ( uint32_t control = 0)

Definition at line 46 of file MdcRawDataProvider.cxx.

46 {
47 MsgStream log( m_msgSvc, m_name );
48 StatusCode sc;
49 bool unRedo = ( ( control & b_unRedo ) == b_unRedo );
50 if ( !unRedo ) digiRef.clear();
51 else if ( digiRef.size() > 0 ) return digiRef;
52 //---- get event service
53 IDataProviderSvc* evtSvc;
54 // tianhl for mt
55 std::string evtDataSvc_name( "EventDataSvc" );
56 // if (isGaudiThreaded(m_name)) {
57 // evtDataSvc_name += getGaudiThreadIDfromName(m_name);
58 // }
59 // tianhl for mt
60 sc = m_svcLocator->service( evtDataSvc_name, evtSvc, true );
61 if ( !sc.isSuccess() )
62 {
63 log << MSG::FATAL << "Could not load EventDataSvc" << endmsg;
64 return digiRef;
65 }
66
67 //---- get max MdcDigi
68 int maxMdcDigi = control & i_maxMdcDigi;
69
70 //---- prepare for drop Bad TDC
71 bool keepBadTdc = ( ( control & b_keepBadTdc ) != 0x10000 );
72 double t0 = 0.;
73 if ( keepBadTdc )
74 {
75 // get MdcCalibFunSvc
76 sc = m_svcLocator->service( "MdcCalibFunSvc", m_mdcCalibFunSvc );
77 if ( sc.isFailure() )
78 {
79 log << MSG::FATAL << "Could not load MdcCalibFunSvc!" << endmsg;
80 return digiRef;
81 }
82
83 // get event start time t0
84 SmartDataPtr<RecEsTimeCol> esTimeCol( evtSvc, "/Event/Recon/RecEsTimeCol" );
85 if ( !esTimeCol )
86 {
87 log << MSG::INFO << " Could not retrieve RecEsTimeCol" << endmsg;
88 keepBadTdc = false;
89 }
90 else if ( ( esTimeCol->size() == 0 ) )
91 {
92 log << MSG::INFO << " Could not retrieve RecEsTimeCol" << endmsg;
93 keepBadTdc = false;
94 }
95 else
96 {
97 RecEsTimeCol::iterator iter = esTimeCol->begin();
98 for ( ; iter != esTimeCol->end(); iter++ ) { t0 = ( *iter )->getTest(); }
99 } // end esTimeCol
100 }
101
102 //----- mark hit on track
103 bool m_hitInUse[43][288];
104 for ( int i = 0; i < 43; i++ )
105 {
106 for ( int j = 0; j < 288; j++ ) m_hitInUse[i][j] = false;
107 }
108 bool dropHot = ( ( control & b_dropHot ) == 0x4000 );
109 if ( dropHot )
110 {
111 SmartDataPtr<RecMdcHitCol> recHitCol( evtSvc, "/Event/Recon/RecMdcHitCol" );
112 if ( !recHitCol )
113 {
114 log << MSG::INFO << "Could not retrieve RecMdcHitCol" << endmsg;
115 dropHot = false;
116 }
117 else
118 {
119 RecMdcHitCol::iterator iter = recHitCol->begin();
120 for ( ; iter != recHitCol->end(); iter++ )
121 {
122 Identifier id = ( *iter )->getMdcId();
123 m_hitInUse[MdcID::layer( id )][MdcID::wire( id )] = true;
124 }
125 }
126 }
127
128 //----- mark skipped layers
129 bool isSkipLayers = ( ( control & b_keepSkipped ) != 0x8000 ) && ( m_skipLayers.size() > 0 );
130
131 bool skipLayer[43];
132 for ( int i = 0; i < 43; i++ ) { skipLayer[i] = false; }
133 for ( unsigned iSkip = 0; iSkip < m_skipLayers.size(); iSkip++ )
134 { skipLayer[m_skipLayers[iSkip]] = true; }
135
136 //----- loop MdcDigiCol to select------------------
137 int iDigi = 0;
138 int nMatchedDigi = 0;
139
140 SmartDataPtr<MdcDigiCol> mdcDigiCol( evtSvc, "/Event/Digi/MdcDigiCol" );
141 if ( sc != StatusCode::SUCCESS )
142 {
143 log << MSG::FATAL << "Could not find MdcDigiCol!" << endmsg;
144 return digiRef;
145 }
146 MdcDigiCol::iterator iter = mdcDigiCol->begin();
147 for ( ; iter != mdcDigiCol->end(); iter++, iDigi++ )
148 {
149 MdcDigi* aDigi = ( *iter );
150 Identifier id = aDigi->identify();
151 int layer = MdcID::layer( id );
152 int wire = MdcID::wire( id );
153 unsigned tdc = aDigi->getTimeChannel();
154 unsigned adc = aDigi->getChargeChannel();
155 unsigned overflow = aDigi->getOverflow();
156
157 // Give an adc threshold
158 if ( m_adcThresholds.size() > 0 && adc < m_adcThresholds[layer] ) continue;
159
160 //--0. skip dead channel
161 if ( ( ( control & b_keepAllChannel ) != 0x40000 ) && m_mdcCalibFunSvc &&
162 m_mdcCalibFunSvc->getWireEff( layer, wire ) < m_effThreshold )
163 continue;
164
165 //--1. drop Mdc layer hits
166 if ( isSkipLayers && skipLayer[layer] ) continue;
167
168 //--2. drop hit on track
169 if ( dropHot && m_hitInUse[layer][wire] ) continue;
170
171 //--3. drop unmatched, overflow and multi TDC
172 // overflow :
173 // 1, T overflow
174 // 2, Q overflow
175 // 4, multi TDC
176 // 8, multi TDC, earliest
177 if ( ( ( control & b_keepUnmatch ) != 0x2000 ) &&
178 ( ( ( overflow & 1 ) > 0 ) ||
179 ( ( ( overflow & 12 ) != 12 ) && ( ( overflow & 12 ) != 0 ) ) ||
180 ( tdc == 0x7FFFFFFF ) || ( adc == 0x7FFFFFFF ) ) )
181 { continue; }
182
183 //--4. drop bad hit(Tdc - t0 < -10 ns)
184 if ( keepBadTdc )
185 {
186 // Get T0
187 double T0Walk = 0.;
188 if ( m_mdcCalibFunSvc )
189 {
190 T0Walk = m_mdcCalibFunSvc->getT0( layer, wire ) +
191 m_mdcCalibFunSvc->getTimeWalk( layer, adc );
192 }
193 if ( ( RawDataUtil::MdcTime( tdc ) - T0Walk - t0 ) < -10. ) continue;
194 }
195
196 //--5. skip by max limit of digi number
197 nMatchedDigi++;
198 if ( ( maxMdcDigi > 0 ) && ( nMatchedDigi > maxMdcDigi ) )
199 {
200 digiRef.clear();
201 return digiRef;
202 }
203
204 digiRef.push_back( aDigi );
205 } // end loop of MdcDigiCol
206 return digiRef;
207}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< HoughRecHit > recHitCol
Definition Hough2D.h:22
static int layer(const Identifier &id)
Values of different levels (failure returns 0).
Definition MdcID.cxx:47
static int wire(const Identifier &id)
Definition MdcID.cxx:52
static double MdcTime(int timeChannel)
virtual Identifier identify() const
Definition RawData.cxx:15
unsigned int getChargeChannel() const
Definition RawData.cxx:35
unsigned int getTimeChannel() const
Definition RawData.cxx:32

◆ getMdcDigiVec() [2/3]

MdcDigiVec & MdcRawDataProvider::getMdcDigiVec ( uint32_t control = 0)

◆ getMdcDigiVec() [3/3]

MdcDigiVec & MdcRawDataProvider::getMdcDigiVec ( uint32_t control = 0)

◆ handle() [1/3]

void MdcRawDataProvider::handle ( const Incident & inc)

Definition at line 39 of file MdcRawDataProvider.cxx.

39 {
40 MsgStream log( m_msgSvc, m_name );
41 log << MSG::DEBUG << "handle: " << inc.type() << endmsg;
42 if ( inc.type() == "BeginEvent" ) { digiRef.clear(); }
43 return;
44}

◆ handle() [2/3]

void MdcRawDataProvider::handle ( const Incident & )

◆ handle() [3/3]

void MdcRawDataProvider::handle ( const Incident & )

◆ initialize() [1/3]

StatusCode MdcRawDataProvider::initialize ( ISvcLocator * svcLoc = 0,
IMessageSvc * pMsg = 0 )

Definition at line 34 of file MdcRawDataProvider.cxx.

34 {
35 RawDataProviderBase::initialize( pSvcLoc, pMsg );
36 return StatusCode::SUCCESS;
37}
StatusCode initialize(ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)

◆ initialize() [2/3]

StatusCode MdcRawDataProvider::initialize ( ISvcLocator * svcLoc = 0,
IMessageSvc * pMsg = 0 )

◆ initialize() [3/3]

StatusCode MdcRawDataProvider::initialize ( ISvcLocator * svcLoc = 0,
IMessageSvc * pMsg = 0 )

◆ setAdcThresholds() [1/3]

void MdcRawDataProvider::setAdcThresholds ( const std::vector< float > & adcThresholds)
inline

Definition at line 30 of file Event/RawDataProviderSvc/include/RawDataProviderSvc/MdcRawDataProvider.h.

30 {
31 m_adcThresholds = adcThresholds;
32 }

◆ setAdcThresholds() [2/3]

void MdcRawDataProvider::setAdcThresholds ( const std::vector< float > & adcThresholds)
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataProviderSvc/MdcRawDataProvider.h.

30 {
31 m_adcThresholds = adcThresholds;
32 }

◆ setAdcThresholds() [3/3]

void MdcRawDataProvider::setAdcThresholds ( const std::vector< float > & adcThresholds)
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataProviderSvc/MdcRawDataProvider.h.

30 {
31 m_adcThresholds = adcThresholds;
32 }

◆ setEffThreshold() [1/3]

void MdcRawDataProvider::setEffThreshold ( float effThreshold)
inline

Definition at line 29 of file Event/RawDataProviderSvc/include/RawDataProviderSvc/MdcRawDataProvider.h.

29{ m_effThreshold = effThreshold; }

◆ setEffThreshold() [2/3]

void MdcRawDataProvider::setEffThreshold ( float effThreshold)
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataProviderSvc/MdcRawDataProvider.h.

29{ m_effThreshold = effThreshold; }

◆ setEffThreshold() [3/3]

void MdcRawDataProvider::setEffThreshold ( float effThreshold)
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataProviderSvc/MdcRawDataProvider.h.

29{ m_effThreshold = effThreshold; }

◆ setSkipLayers() [1/3]

void MdcRawDataProvider::setSkipLayers ( const std::vector< int > & skipLayers)
inline

Definition at line 28 of file Event/RawDataProviderSvc/include/RawDataProviderSvc/MdcRawDataProvider.h.

28{ m_skipLayers = skipLayers; }

◆ setSkipLayers() [2/3]

void MdcRawDataProvider::setSkipLayers ( const std::vector< int > & skipLayers)
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataProviderSvc/MdcRawDataProvider.h.

28{ m_skipLayers = skipLayers; }

◆ setSkipLayers() [3/3]

void MdcRawDataProvider::setSkipLayers ( const std::vector< int > & skipLayers)
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataProviderSvc/MdcRawDataProvider.h.

28{ m_skipLayers = skipLayers; }

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