Commit dfab2557 authored by Jiří Mašík's avatar Jiří Mašík
Browse files

add option to skip decoding of the bytestream in the pixel clusterization algorithm.

needed for MC samples mixing RDOs from different events (data overlay, ATLHI-229)
parent 3c451ebc
......@@ -14,9 +14,15 @@
#EF_SCTRDOKey="SCT_RDOs"
#EF_TRTRDOKey="TRT_RDOs"
EF_PixRDOKey="PixelRDOs_EF"
EF_SCTRDOKey="SCT_RDOs_EF"
EF_TRTRDOKey="TRT_RDOs_EF"
from TriggerJobOpts.TriggerFlags import TriggerFlags
if not TriggerFlags.doTransientByteStream():
EF_PixRDOKey="PixelRDOs"
from AthenaCommon.Logging import logging
log = logging.getLogger("EFID")
......@@ -45,6 +51,7 @@ class PixelClustering_EF( InDet__Pixel_TrgClusterization ):
Decoder = InDetTrigPixelRodDecoder)
ToolSvc += InDetTrigPixelRawDataProviderTool
from InDetTrigRawDataProvider.InDetTrigRawDataProviderConf import InDet__TrigPixRawDataProvider
InDetTrigPixRawDataProvider = \
......@@ -82,7 +89,9 @@ class PixelClustering_EF( InDet__Pixel_TrgClusterization ):
self.clusteringTool = InDetTrigMergedPixelsTool
self.gangedAmbiguitiesFinder = InDetTrigPixelGangedAmbiguitiesFinder
self.Pixel_RDOContainerName = EF_PixRDOKey
self.skipBSDecoding = not TriggerFlags.doTransientByteStream()
#self.OutputLevel=1 #VERBOSE
from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings
self.EtaHalfWidth = InDetTrigSliceSettings[('etaHalfWidth',type)]
self.PhiHalfWidth = InDetTrigSliceSettings[('phiHalfWidth',type)]
......
......@@ -133,7 +133,7 @@ namespace InDet {
ServiceHandle<IPixelByteStreamErrorsSvc> m_bsErrorSvc;
ServiceHandle<IROBDataProviderSvc> m_robDataProvider; //!< ROB Data Provide Service
bool m_doTimeOutChecks; //check global timer
bool m_skipBSDecoding; //option to skip BS decoding in MC
// Timing
TrigTimer *m_timerRegSel;
......
......@@ -85,6 +85,7 @@ namespace InDet{
declareProperty("Pixel_RDOContainerName", m_pixelRDOContainerName);
declareProperty("RawDataProvider", m_rawDataProvider);
declareProperty("doTimeOutChecks", m_doTimeOutChecks);
declareProperty("skipBSDecoding", m_skipBSDecoding);
declareMonitoredVariable("numPixClusters", m_numPixClusters );
declareMonitoredVariable("numPixIds", m_numPixIds );
......@@ -348,7 +349,6 @@ namespace InDet{
//-------------------------------------------------------------------------
//handling of decoding problems
StatusCode scdec = StatusCode::SUCCESS;
m_bsErrorSvc->resetCounts();
......@@ -390,21 +390,6 @@ namespace InDet{
ATH_MSG_DEBUG( "REGTEST:" << *roi );
if(doTiming()) m_timerDecoder->start();
scdec = m_rawDataProvider->decode(roi);
if(doTiming()) m_timerDecoder->stop();
// Get the Pixel RDO's:
// - First get the Pixel ID's using the RegionSelector
// - Retrieve from SG the RDOContainer:
// Identifiable Container that contains pointers to all the RDO
// collections (one collection per detector)
// - Retrieve from StoreGate the RDO collections.
// (the ByteStreamConvertors are called here).
if (!(roi->isFullscan())){
if(doTiming()) m_timerRegSel->start();
m_regionSelector->DetHashIDList( PIXEL, *roi, m_listOfPixIds);
......@@ -414,42 +399,59 @@ namespace InDet{
if(doTiming()) m_timerRegSel->stop();
}
if (scdec.isSuccess()){
//check for recoverable errors
int n_err_total = 0;
int bsErrors[IPixelByteStreamErrorsSvc::lastErrType+1];
if (!m_skipBSDecoding){
StatusCode scdec = StatusCode::SUCCESS;
if(doTiming()) m_timerDecoder->start();
scdec = m_rawDataProvider->decode(roi);
if(doTiming()) m_timerDecoder->stop();
// Get the Pixel RDO's:
// - First get the Pixel ID's using the RegionSelector
// - Retrieve from SG the RDOContainer:
// Identifiable Container that contains pointers to all the RDO
// collections (one collection per detector)
// - Retrieve from StoreGate the RDO collections.
// (the ByteStreamConvertors are called here).
for (size_t idx = 0; idx<=size_t(IPixelByteStreamErrorsSvc::lastErrType); idx++){
int n_errors = m_bsErrorSvc->getNumberOfErrors(idx);
n_err_total += n_errors;
bsErrors[idx] = n_errors;
}
ATH_MSG_DEBUG( "decoding errors: " << n_err_total );
if (n_err_total){
if (scdec.isSuccess()){
//check for recoverable errors
int n_err_total = 0;
int bsErrors[IPixelByteStreamErrorsSvc::lastErrType+1];
for (size_t idx = 0; idx<=size_t(IPixelByteStreamErrorsSvc::lastErrType); idx++){
// m_PixBSErr.push_back(bsErrors[idx]);
if (bsErrors[idx])
m_PixBSErr.push_back(idx);
if(msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << " " << bsErrors[idx];
int n_errors = m_bsErrorSvc->getNumberOfErrors(idx);
n_err_total += n_errors;
bsErrors[idx] = n_errors;
}
}
ATH_MSG_DEBUG( "" );
} else {
ATH_MSG_DEBUG( " m_rawDataProvider->decode failed" );
ATH_MSG_DEBUG( "decoding errors: " << n_err_total );
if (n_err_total){
for (size_t idx = 0; idx<=size_t(IPixelByteStreamErrorsSvc::lastErrType); idx++){
// m_PixBSErr.push_back(bsErrors[idx]);
if (bsErrors[idx])
m_PixBSErr.push_back(idx);
if(msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << " " << bsErrors[idx];
}
}
ATH_MSG_DEBUG( "" );
} else {
ATH_MSG_DEBUG( " m_rawDataProvider->decode failed" );
}
}
if(doTiming()) m_timerSGate->resume();
PixelRDO_Container* p_pixelRDOContainer;
const PixelRDO_Container* p_pixelRDOContainer;
if (store()->retrieve(p_pixelRDOContainer, m_pixelRDOContainerName).isFailure() ) {
ATH_MSG_WARNING( "Could not find the PixelRDO_Container "
<< m_pixelRDOContainerName );
......@@ -466,6 +468,7 @@ namespace InDet{
}
if(doTiming()) m_timerSGate->pause();
ATH_MSG_VERBOSE("Size of " << m_pixelRDOContainerName << ":" << p_pixelRDOContainer->size());
if (!(roi->isFullscan())){
......@@ -542,8 +545,6 @@ namespace InDet{
PixelRDO_Container::const_iterator rdoCollections = p_pixelRDOContainer->begin();
PixelRDO_Container::const_iterator rdoCollectionsEnd = p_pixelRDOContainer->end();
AtlasDetectorID detType;
if(doTiming()) m_timerCluster->resume();
for(; rdoCollections!=rdoCollectionsEnd; ++rdoCollections){
......
......@@ -320,6 +320,15 @@ class useOfflineSpacePoints(JobProperty):
_flags.append(useOfflineSpacePoints)
class doTransientByteStream(JobProperty):
""" switch off usage of the transient bytestream
and access RDO objects directly. Partial implementation.
"""
statusOn=True
allowedType=['bool']
StoredValue=False
_flags.append(doTransientByteStream)
class doNtuple(JobProperty):
""" """
statusOn=True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment