Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MdcRawDataProvider Class Reference

#include <MdcRawDataProvider.h>

Inheritance diagram for MdcRawDataProvider:

RawDataProviderBase RawDataProviderBase List of all members.

Public Types

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

Public Member Functions

MdcDigiVecgetMdcDigiVec (uint32_t control=0)
MdcDigiVecgetMdcDigiVec (uint32_t control=0)
void handle (const Incident &)
void handle (const Incident &)
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
StatusCode initialize (ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
 MdcRawDataProvider (const char *name)
 MdcRawDataProvider ()
 MdcRawDataProvider (const char *name)
 MdcRawDataProvider ()
void setMsgName (const char *name)
void setMsgName (const char *name)
void setMsgSvc (IMessageSvc *svc)
void setMsgSvc (IMessageSvc *svc)
void setSkipLayers (const std::vector< int > &skipLayers)
void setSkipLayers (const std::vector< int > &skipLayers)
void setSvcLocator (ISvcLocator *svcLoc)
void setSvcLocator (ISvcLocator *svcLoc)
 ~MdcRawDataProvider ()
 ~MdcRawDataProvider ()

Protected Attributes

IMessageSvc * m_msgSvc
IMessageSvc * m_msgSvc
std::string m_name
ISvcLocator * m_svcLocator
ISvcLocator * m_svcLocator

Private Attributes

MdcDigiVec digiRef
IMdcCalibFunSvcm_mdcCalibFunSvc
IMdcCalibFunSvcm_mdcCalibFunSvc
std::vector< int > m_skipLayers
std::vector< int > m_skipLayers

Member Enumeration Documentation

enum MdcRawDataProvider::MdcControlMode
 

Enumeration values:
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
00031                      {
00032     i_maxMdcDigi        = 0x1FFF,
00033     b_keepUnmatch       = 0x2000,
00034     b_dropHot           = 0x4000,
00035     b_keepSkipped       = 0x8000,
00036     b_keepBadTdc        = 0x10000,
00037     b_unRedo            = 0x20000
00038   };

enum MdcRawDataProvider::MdcControlMode
 

Enumeration values:
i_maxMdcDigi 
b_keepUnmatch 
b_dropHot 
b_keepSkipped 
b_keepBadTdc 
b_unRedo 
00031                      {
00032     i_maxMdcDigi        = 0x1FFF,
00033     b_keepUnmatch       = 0x2000,
00034     b_dropHot           = 0x4000,
00035     b_keepSkipped       = 0x8000,
00036     b_keepBadTdc        = 0x10000,
00037     b_unRedo            = 0x20000
00038   };


Constructor & Destructor Documentation

MdcRawDataProvider::MdcRawDataProvider  ) 
 

00028                                        :
00029   RawDataProviderBase(),
00030   digiRef(0),
00031   m_mdcCalibFunSvc(0) 
00032 {}

MdcRawDataProvider::MdcRawDataProvider const char *  name  ) 
 

00035                                                          :
00036   RawDataProviderBase( name ),
00037   digiRef(0),
00038   m_mdcCalibFunSvc(0) 
00039 {}

MdcRawDataProvider::~MdcRawDataProvider  ) 
 

00041                                         {
00042 }

MdcRawDataProvider::MdcRawDataProvider  ) 
 

MdcRawDataProvider::MdcRawDataProvider const char *  name  ) 
 

MdcRawDataProvider::~MdcRawDataProvider  ) 
 


Member Function Documentation

MdcDigiVec& MdcRawDataProvider::getMdcDigiVec uint32_t  control = 0  ) 
 

MdcDigiVec & MdcRawDataProvider::getMdcDigiVec uint32_t  control = 0  ) 
 

00058                                                              {
00059   MsgStream log(m_msgSvc, m_name);
00060   StatusCode sc;
00061   bool unRedo = ((control&b_unRedo)==b_unRedo);
00062   if(!unRedo) digiRef.clear();
00063   else if(digiRef.size()>0) return digiRef;
00064   //---- get event service
00065   IDataProviderSvc* evtSvc;
00066   // tianhl for mt
00067   std::string evtDataSvc_name("EventDataSvc");
00068   if(isGaudiThreaded(m_name)){
00069     evtDataSvc_name += getGaudiThreadIDfromName(m_name);
00070   }
00071   // tianhl for mt
00072   sc = m_svcLocator->service(evtDataSvc_name.c_str(),evtSvc,true);
00073   if (!sc.isSuccess()){
00074     log << MSG::FATAL << "Could not load EventDataSvc" << endreq;
00075     return digiRef;
00076   } 
00077 
00078   //---- get max MdcDigi
00079   int maxMdcDigi = control&i_maxMdcDigi;
00080 
00081   //---- prepare for drop Bad TDC
00082   bool keepBadTdc = ((control&b_keepBadTdc)!=0x10000);
00083   double t0 = 0.;
00084   if (keepBadTdc){
00085     //get MdcCalibFunSvc
00086     IMdcCalibFunSvc* imdcCalibSvc;
00087     sc = m_svcLocator->service("MdcCalibFunSvc", m_mdcCalibFunSvc);
00088     if ( sc.isFailure() ){
00089       log << MSG::FATAL << "Could not load MdcCalibFunSvc!" << endreq;
00090       return digiRef; 
00091     }
00092 
00093     //get event start time t0
00094     SmartDataPtr<RecEsTimeCol> esTimeCol(evtSvc,"/Event/Recon/RecEsTimeCol");
00095     if (!esTimeCol){
00096       log << MSG::INFO<< " Could not retrieve RecEsTimeCol"<< endreq;
00097       keepBadTdc = false;
00098     }else if( (esTimeCol->size()==0)) {
00099       log << MSG::INFO<< " Could not retrieve RecEsTimeCol"<< endreq;
00100       keepBadTdc = false;
00101     }else{
00102       RecEsTimeCol::iterator iter= esTimeCol->begin();
00103       for(; iter!=esTimeCol->end(); iter++){
00104         t0 = (*iter)->getTest();
00105       }
00106     }//end esTimeCol
00107   }
00108 
00109   //----- mark hit on track
00110   bool m_hitInUse[43][288];
00111   for (int i=0; i<43; i++){
00112     for (int j=0; j<288; j++) m_hitInUse[i][j]=false;
00113   }
00114   bool dropHot = ((control&b_dropHot)==0x4000);
00115   if (dropHot){
00116     SmartDataPtr<RecMdcHitCol> recHitCol(evtSvc, "/Event/Recon/RecMdcHitCol");
00117     if (!recHitCol) {
00118       log << MSG::INFO << "Could not retrieve RecMdcHitCol" << endreq;
00119       dropHot = false;
00120     }else{
00121       RecMdcHitCol::iterator iter = recHitCol->begin();
00122       for ( ; iter != recHitCol->end(); iter++) {
00123         Identifier id = (*iter)->getMdcId();
00124         m_hitInUse[MdcID::layer(id)][MdcID::wire(id)] = true;
00125       }
00126     }
00127   }
00128 
00129   //----- mark skipped layers 
00130   bool isSkipLayers = ((control&b_keepSkipped)!=0x8000) && (m_skipLayers.size()>0);
00131 
00132   bool skipLayer[43];
00133   for (int i=0; i<43; i++){skipLayer[i]= false;}
00134   for(unsigned iSkip =0; iSkip < m_skipLayers.size(); iSkip++){
00135     skipLayer[m_skipLayers[iSkip]]=true;
00136   }
00137 
00138   //----- loop MdcDigiCol to select------------------
00139   int iDigi=0;
00140   int nMatchedDigi=0;
00141 
00142   SmartDataPtr<MdcDigiCol> mdcDigiCol(evtSvc,"/Event/Digi/MdcDigiCol");
00143   if (sc!=StatusCode::SUCCESS) {
00144     log << MSG::FATAL << "Could not find MdcDigiCol!" << endreq;
00145     return digiRef;
00146   }
00147   MdcDigiCol::iterator iter = mdcDigiCol->begin();
00148   for (;iter != mdcDigiCol->end(); iter++,iDigi++ ) {
00149     MdcDigi *aDigi = (*iter);
00150     Identifier id = aDigi->identify();
00151     int layer = MdcID::layer(id);
00152     int wire  = MdcID::wire(id);
00153     unsigned tdc = aDigi->getTimeChannel();
00154     unsigned adc = aDigi->getChargeChannel();
00155     unsigned overflow = aDigi->getOverflow();
00156 
00157     //--1. drop Mdc layer hits
00158     if( isSkipLayers && skipLayer[layer] ) continue;
00159 
00160     //--2. drop hit on track
00161     if ( dropHot && m_hitInUse[layer][wire]) continue;
00162 
00163     //--3. drop unmatched, overflow and multi TDC
00164     //overflow :
00165     // 1, T overflow
00166     // 2, Q overflow
00167     // 4, multi TDC
00168     // 8, multi TDC, earliest
00169     if ( ((control&b_keepUnmatch)!=0x2000) &&
00170         (((overflow & 3)>0) ||
00171          (((overflow&12)!=12)&&((overflow&12)!=0)) ||
00172          (tdc==0x7FFFFFFF) || (adc== 0x7FFFFFFF) ) ) { continue; }
00173 
00174 
00175 
00176     //--4. drop bad hit(Tdc - t0 < -10 ns)
00177     if(keepBadTdc){
00178       // Get T0
00179       double T0Walk = 0.;
00180       if (m_mdcCalibFunSvc) { T0Walk = m_mdcCalibFunSvc->getT0(layer,wire)
00181         + m_mdcCalibFunSvc->getTimeWalk(layer,adc); }
00182       if((RawDataUtil::MdcTime(tdc) - T0Walk - t0)<-10.) continue;
00183     }
00184 
00185     //--5. skip by max limit of digi number
00186     nMatchedDigi++;
00187     if ((maxMdcDigi>0) && (nMatchedDigi > maxMdcDigi)){
00188       digiRef.clear();
00189       return digiRef;
00190     }
00191 
00192     digiRef.push_back(aDigi);
00193   }//end loop of MdcDigiCol
00194   return digiRef;
00195 }

void MdcRawDataProvider::handle const Incident &   ) 
 

void MdcRawDataProvider::handle const Incident &   ) 
 

00049                                                   {
00050   MsgStream log( m_msgSvc, m_name );
00051   log << MSG::DEBUG << "handle: " << inc.type() << endreq;
00052   if ( inc.type() == "BeginEvent" ){
00053     digiRef.clear();
00054   }
00055   return;
00056 }

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

Reimplemented from RawDataProviderBase.

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

Reimplemented from RawDataProviderBase.

00044                                                                                    {
00045   RawDataProviderBase::initialize( pSvcLoc,pMsg );
00046   return StatusCode::SUCCESS; 
00047 }

void RawDataProviderBase::setMsgName const char *  name  )  [inline, inherited]
 

00029 { m_name = std::string(name); };

void RawDataProviderBase::setMsgName const char *  name  )  [inline, inherited]
 

00029 { m_name = std::string(name); };

void RawDataProviderBase::setMsgSvc IMessageSvc *  svc  )  [inline, inherited]
 

00028 { m_msgSvc=svc; };

void RawDataProviderBase::setMsgSvc IMessageSvc *  svc  )  [inline, inherited]
 

00028 { m_msgSvc=svc; };

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

00026 {m_skipLayers=skipLayers;}

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

00026 {m_skipLayers=skipLayers;}

void RawDataProviderBase::setSvcLocator ISvcLocator *  svcLoc  )  [inline, inherited]
 

00027 { m_svcLocator=svcLoc; };

void RawDataProviderBase::setSvcLocator ISvcLocator *  svcLoc  )  [inline, inherited]
 

00027 { m_svcLocator=svcLoc; };


Member Data Documentation

MdcDigiVec MdcRawDataProvider::digiRef [private]
 

IMdcCalibFunSvc* MdcRawDataProvider::m_mdcCalibFunSvc [private]
 

IMdcCalibFunSvc* MdcRawDataProvider::m_mdcCalibFunSvc [private]
 

IMessageSvc* RawDataProviderBase::m_msgSvc [protected, inherited]
 

IMessageSvc* RawDataProviderBase::m_msgSvc [protected, inherited]
 

std::string RawDataProviderBase::m_name [protected, inherited]
 

std::vector<int> MdcRawDataProvider::m_skipLayers [private]
 

std::vector<int> MdcRawDataProvider::m_skipLayers [private]
 

ISvcLocator* RawDataProviderBase::m_svcLocator [protected, inherited]
 

ISvcLocator* RawDataProviderBase::m_svcLocator [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:27:33 2011 for BOSS6.5.5 by  doxygen 1.3.9.1