Commit 67737dba authored by Walter Lampl's avatar Walter Lampl Committed by Graeme Stewart
Browse files

LArADC2MeVTool: Don't try to drop sub-factors from DetectorStore (LArRecUtils-00-14-24)

	* LArADC2MeVTool: Don't try to drop sub-factors from DetectorStore
	  (Doesn't work with COOL-inline constants and memory saving in MC is tiny (~3MB)
	* tag LArRecUtils-00-14-24

2014-12-02    <delsart@localhost>

	* python/LArHVScaleRetrieverDefault.py : improve the default config
	* tag LArRecUtils-00-14-23

	* python/LArHVScaleRetrieverDefault.py : added.
	* tag LArRecUtils-00-14-22

	* LArHVScaleRetriever.cxx/h : added. Acts as a unique tool to
	retrieve LAr HV correction factor on both MC and data
	* tag LArRecUtils-00-14-21

2014-11-25 Walter Lampl <walter.lampl@ cern.ch>
	* merge in change from branch tag LArRecUtils-00-14-09-05 + cosmetics
	* tag LArRecUtils-00-14-20

...
(Long ChangeLog diff - truncated)
parent 2044a938
......@@ -87,11 +87,13 @@ class LArFlatConditionSvc : public virtual IAddressProvider,
bool m_doRegularCells;
bool m_doSuperCells;
bool m_printChecksum;
template<class T>
T* createFlatObj(const CondAttrListCollection* attr, SG::TransientAddress* tad);
void printCheckSums(const objInfo_t& objInfo, const CondAttrListCollection* attr);
};
......
......@@ -114,6 +114,7 @@ class LArHVCorrTool: public AthAlgTool,
std::string m_keyOutput;
std::string m_keyOutputTd;
std::string m_folderName;
bool m_doTdrift;
unsigned int m_deltatupdate;
......
......@@ -71,4 +71,4 @@ apply_pattern athenarun_test \
name="LArFCalTowerBuilderTool_test" \
options="LArRecUtils/LArFCalTowerBuilderTool_test.py" \
pre_script="../cmt/setup.sh" \
post_script="${TESTTOOLSROOT}/share/post.sh LArFCalTowerBuilderTool_test $(q)[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info$(q)"
post_script="${TESTTOOLSROOT}/share/post.sh LArFCalTowerBuilderTool_test $(q)[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology$(q)"
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.Logging import logging
# import the base class
from LArRecUtils.LArRecUtilsConf import LArHVScaleRetriever
def LArHVScaleRetrieverDefault(name="LArHVScaleRetrieverDefault", **kw):
from AthenaCommon.AppMgr import ToolSvc
mlog = logging.getLogger( 'LArHVScaleRetrieverDefault' )
#Check if the tool exits already in ToolSvc
if hasattr(ToolSvc,name):
mlog.info("LArHVScaleRetriever with name "+ name+" already known to ToolSvc")
return getattr(ToolSvc,name)
# call base class constructor
from AthenaCommon import CfgMgr
from AthenaCommon.GlobalFlags import globalflags
# if not provided in kw, get the defaut LArHVCorrTool
if 'LArHVCorrTool' not in kw:
from LArRecUtils.LArHVCorrToolDefault import LArHVCorrToolDefault
kw['LArHVCorrTool'] = LArHVCorrToolDefault()
kw['name'] = name
kw.setdefault('IsMC', globalflags.DataSource()!='data' )
tool = CfgMgr.LArHVScaleRetriever(**kw)
mlog.info('configured for MC : '+ str(kw['IsMC']))
ToolSvc += tool
return tool
......@@ -424,34 +424,6 @@ StatusCode LArADC2MeVTool::getADC2MeV() const {
ATH_MSG_INFO("Low Gain: Channels without Ramp = " << count3[2]);
ATH_MSG_DEBUG( "end of loop over cells ");
// reset conditions
if ( !m_isSC )
if (!m_IOVDbSvc->dropObject(m_keyADC2DAC,true)) {
ATH_MSG_WARNING("Cannot drop " << m_keyADC2DAC);
}
if (m_useMphysOverMcal) {
if (!m_IOVDbSvc->dropObject(m_keyMphysMcal,true)) {
ATH_MSG_WARNING("Cannot drop " << m_keyMphysMcal);
}
}
if (m_useHVScaleCorr) {
if (!m_IOVDbSvc->dropObject(m_keyHVScaleCorr,true)) {
ATH_MSG_WARNING("Cannot drop " << m_keyHVScaleCorr);
}
}
if ( !m_isSC )
if (!m_IOVDbSvc->dropObject(m_keyDAC2uA,true)) {
ATH_MSG_WARNING("Cannot drop " << m_keyDAC2uA);
}
if ( !m_isSC )
if (!m_IOVDbSvc->dropObject(m_keyuA2MeV,true)) {
ATH_MSG_WARNING("Cannot drop " << m_keyuA2MeV);
}
m_cacheValid=true;
return StatusCode::SUCCESS;
......
......@@ -32,7 +32,10 @@
#include "LArCOOLConditions/LArPedestalSC.h"
#include "LArCOOLConditions/LArRampSC.h"
#include "LArCOOLConditions/LArShapeSC.h"
#include "LArCOOLConditions/LArMinBiasSC.h"
#include "CoralBase/Blob.h"
#include <boost/crc.hpp>
LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator* svc )
......@@ -40,7 +43,7 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator*
m_IOVSvc ("IOVSvc", name),
m_detStore ("DetectorStore", name),
m_clidSvc ("ClassIDSvc", name),
m_objInfo(16),
m_objInfo(17),
m_attrListClid(),
m_initializing(true),
m_doRegularCells(true),
......@@ -75,6 +78,7 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator*
m_objInfo[13].m_classname="LArPedestalSC";
m_objInfo[14].m_classname="LArRampSC";
m_objInfo[15].m_classname="LArShapeSC";
m_objInfo[16].m_classname="LArMinBiasSC";
//Interface names for SuperCell conditions
m_objInfo[8].m_ifacename="ILArAutoCorr";
......@@ -85,6 +89,7 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator*
m_objInfo[13].m_ifacename="ILArPedestal";
m_objInfo[14].m_ifacename="ILArRamp";
m_objInfo[15].m_ifacename="ILArShape";
m_objInfo[16].m_ifacename="ILArMinBias";
//StoreGate keys for conditions objects for regular cells
......@@ -106,6 +111,7 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator*
declareProperty("PedestalSCOutput", m_objInfo[13].m_outputKey="LArPedestalSC");
declareProperty("RampSCOutput", m_objInfo[14].m_outputKey="LArRampSC");
declareProperty("ShapeSCOutput", m_objInfo[15].m_outputKey="LArShapeSC");
declareProperty("MinBiasSCOutput", m_objInfo[16].m_outputKey="LArMinBiasSC");
//Folder names for flat conditions data for regular cells
......@@ -127,9 +133,11 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator*
declareProperty("PedestalSCInput", m_objInfo[13].m_inputKey="/LAR/ElecCalibMCSC/Pedestal");
declareProperty("RampSCInput", m_objInfo[14].m_inputKey="/LAR/ElecCalibMCSC/Ramp");
declareProperty("ShapeSCInput", m_objInfo[15].m_inputKey="/LAR/ElecCalibMCSC/Shape");
declareProperty("MinBiasSCInput", m_objInfo[16].m_inputKey="/LAR/ElecCalibMCSC/MinBias");
declareProperty("DoSuperCells", m_doSuperCells);
declareProperty("DoRegularCells", m_doRegularCells);
declareProperty("PrintChecksum", m_printChecksum=true);
}
LArFlatConditionSvc::~LArFlatConditionSvc() {}
......@@ -247,6 +255,7 @@ StatusCode LArFlatConditionSvc::updateAddress(StoreID::type, SG::TransientAddres
return StatusCode::FAILURE;
}
if(m_printChecksum) printCheckSums(*objIt,attrlist);
IOVRange range;
sc=m_IOVSvc->getRange(m_attrListClid,objIt->m_inputKey,range);
......@@ -383,6 +392,13 @@ StatusCode LArFlatConditionSvc::updateAddress(StoreID::type, SG::TransientAddres
return StatusCode::FAILURE;
}
break;
case 16:
if (this->createFlatObj<LArMinBiasSC>(attrlist,tad)==0) {
msg(MSG::ERROR) << "Problem creating LArMinBiasSC object" << endreq;
return StatusCode::FAILURE;
}
break;
default:
......@@ -433,3 +449,42 @@ T* LArFlatConditionSvc::createFlatObj(const CondAttrListCollection* attr, SG::T
}
return flat;
}
void LArFlatConditionSvc::printCheckSums(const objInfo_t& objInfo, const CondAttrListCollection* attrListColl) {
if (!msgLvl(MSG::INFO)) return;
union {
int sn;
unsigned usn;
} cnv;
boost::crc_32_type crc32;
msg(MSG::INFO) << "Loading " << objInfo.m_classname << " from folder " << objInfo.m_inputKey << endreq;
CondAttrListCollection::const_iterator it=attrListColl->begin();
CondAttrListCollection::const_iterator it_e=attrListColl->end();
for (;it!=it_e;++it) {
const coral::AttributeList& attrList=it->second;
const unsigned gain=it->first;
msg(MSG::INFO) << " Gain " << gain;
for (const auto& attr : attrList) {
const std::string& typeName=attr.specification().typeName();
if (typeName.find("blob")==0) {
//Got a blob:
const coral::Blob& blob = attr.data<coral::Blob>();
const std::string& blobName=attr.specification().name();
crc32.process_bytes(blob.startingAddress(),blob.size());
cnv.usn= crc32.checksum();
msg(MSG::INFO) << ", " << blobName << " checksum=" << cnv.sn;
crc32.reset();
}//end if blob
}//end loop over attributes
msg(MSG::INFO) << endreq;
}//end loop over gains
}
......@@ -9,7 +9,11 @@
#include "GaudiKernel/IIncidentSvc.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "xAODEventInfo/EventInfo.h"
#include "StoreGate/StoreGateSvc.h"
#include "AthenaPoolUtilities/CondAttrListCollection.h"
#include "AthenaPoolUtilities/AthenaAttributeList.h"
#include "CoralBase/Blob.h"
#include "LArCOOLConditions/LArHVScaleCorrFlat.h"
#include "GaudiKernel/IChronoStatSvc.h"
#include "CLHEP/Units/SystemOfUnits.h"
......@@ -46,8 +50,10 @@ LArHVCorrTool::LArHVCorrTool(const std::string& type,
m_T0 = 90.371; // parameter for vdrift
m_allCallBack=false;
declareProperty("keyOutput",m_keyOutput,"Output key for LArHVScaleCorr");
declareProperty("keyOutput",m_keyOutput="LArHVScaleCorr","Output key for LArHVScaleCorr");
declareProperty("keyOutputTd",m_keyOutputTd,"Output key for LArTdrift");
declareProperty("folderName",m_folderName="/LAR/ElecCalibFlat/HVScaleCorr",
"Folder to store the CondAttrListCollection containing the HVScale correction");
declareProperty("HVTool",m_hvtool,"HV tool used");
declareProperty("doTdrift",m_doTdrift,"Compute drift time");
declareProperty("allHVCallBack",m_allCallBack,"recompute correction for each HV db callback instead of only once per run/lbn");
......@@ -614,7 +620,7 @@ float LArHVCorrTool::Scale(const IdentifierHash& hash) const {
}
}
if (hash>m_vScale.size()) {
msg(MSG::ERROR) << "Cell outside hash range! " << endreq;
msg(MSG::ERROR) << "Cell outside hash range! hash=" << hash << " range=" << m_vScale.size() << endreq;
return 1;
}
return m_vScale[hash];
......@@ -629,29 +635,45 @@ StatusCode LArHVCorrTool::record() {
return sc;
}
}
LArHVScaleCorrComplete* scale=new LArHVScaleCorrComplete();
if( (scale->setGroupingType("ExtendedSubDetector",msg())).isFailure()) {
msg(MSG::ERROR) << " cannot setGroupingType " << endreq;
return StatusCode::FAILURE;
}
if( (scale->initialize()).isFailure()) {
msg(MSG::ERROR) << "cannot initialize Scale " << endreq;
return StatusCode::FAILURE;
}
const size_t nCells=m_vScale.size();
for (size_t idx=0;idx<nCells;++idx) {
const IdentifierHash oflHash(idx);
const HWIdentifier hwid=m_cablingService->createSignalChannelIDFromHash(oflHash);
scale->set(hwid,m_vScale[idx]);
const unsigned hashMax=m_lar_on_id->channelHashMax();
coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
spec->extend("HVScaleCorr", "blob");
spec->extend<unsigned>("version");
CondAttrListCollection* coll=new CondAttrListCollection(true);
coral::AttributeList* attrList = new coral::AttributeList(*spec);
(*attrList)["version"].setValue(0U);
coral::Blob& blob=(*attrList)["HVScaleCorr"].data<coral::Blob>();
blob.resize(hashMax*sizeof(float));
float* pblob=static_cast<float*>(blob.startingAddress());
//Loop over online hash (to make sure that *every* field of the blob gets filled
for (unsigned hs=0;hs<hashMax;++hs) {
float value=1.0;
if (m_cablingService->isOnlineConnectedFromHash(hs)) {
const Identifier id=m_cablingService->cnvToIdentifierFromHash(hs);
ATH_MSG_VERBOSE("Filling value for id " << id.get_identifier32().get_compact());
value=this->Scale(id);
}
pblob[hs]=value;
}
coll->add(1,*attrList); //Add as channel 1 to AttrListCollection
StatusCode sc=detStore()->record(scale,m_keyOutput);
StatusCode sc=detStore()->record(coll,m_folderName);
if (sc.isFailure()) {
msg(MSG::ERROR) << " cannot record HVScaleCorr in detStore " << endreq;
msg(MSG::ERROR) << " cannot record CondAttrListCollection with key " << m_folderName << endreq;
delete coll;
return sc;
}
LArHVScaleCorrFlat* flatHVScale=new LArHVScaleCorrFlat(coll);
sc=detStore()->record(flatHVScale,m_keyOutput);
if (sc.isFailure()) {
msg(MSG::ERROR) << "Failed to record LArHVScaleCorrFlat with key " << m_keyOutput << endreq;
delete flatHVScale;
return sc;
}
if (m_doTdrift) {
sc=detStore()->record(m_Tdrift,m_keyOutputTd);
if (sc.isFailure()) {
......@@ -659,13 +681,7 @@ StatusCode LArHVCorrTool::record() {
return sc;
}
}
m_ownScale = false;
sc=detStore()->symLink(scale, (ILArHVScaleCorr*)scale);
if (sc.isFailure()) {
msg(MSG::ERROR) << "Failed to symlink LArHVScaleCorr object" << endreq;
return sc;
}
m_ownScale = false; //Matters only for m_Tdrift
if (m_doTdrift) {
sc=detStore()->symLink(m_Tdrift, (ILArTdrift*)m_Tdrift);
......
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// LArHVScaleRetriever.cxx
// Implementation file for class LArHVScaleRetriever
// Author: P-A Delsart delsart at in2p3.fr
///////////////////////////////////////////////////////////////////
// LArTools includes
#include "LArHVScaleRetriever.h"
// STL includes
// FrameWork includes
#include "GaudiKernel/IToolSvc.h"
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
// Constructors
////////////////
LArHVScaleRetriever::LArHVScaleRetriever( const std::string& type,
const std::string& name,
const IInterface* parent ) :
::AthAlgTool ( type, name, parent )
, m_ilarhvcorrtool("LArHVCorrToolDefault")
, m_keyHVScaleCorr("LArHVScaleCorr")
, m_isMC(false)
{
declareInterface< ILArHVCorrTool >(this);
declareProperty( "IsMC", m_isMC );
declareProperty( "LArHVCorrTool", m_ilarhvcorrtool );
declareProperty("KeyHVScaleCorr",m_keyHVScaleCorr);
}
// Destructor
///////////////
LArHVScaleRetriever::~LArHVScaleRetriever()
{}
// Athena algtool's Hooks
////////////////////////////
StatusCode LArHVScaleRetriever::initialize()
{
ATH_MSG_INFO ("Initializing " << name() << "...");
if( m_isMC ) {
CHECK( detStore()->regHandle(m_ilarhvscalecorr,m_keyHVScaleCorr) );
}else {
CHECK( m_ilarhvcorrtool.retrieve() ) ;
}
return StatusCode::SUCCESS;
}
float LArHVScaleRetriever::Scale(const HWIdentifier& id) const {
if(m_isMC) return m_ilarhvscalecorr->HVScaleCorr(id) ;
return m_ilarhvcorrtool->Scale(id);
}
float LArHVScaleRetriever::Scale(const Identifier& id) const {
if(m_isMC) return m_ilarhvscalecorr->HVScaleCorr(id) ;
return m_ilarhvcorrtool->Scale(id);
}
StatusCode LArHVScaleRetriever::LoadCalibration(IOVSVC_CALLBACK_ARGS_P(i,k)) {
if(!m_isMC) return m_ilarhvcorrtool->LoadCalibration(i,k) ;
return StatusCode::FAILURE;
}
StatusCode LArHVScaleRetriever::record() {
if(!m_isMC) return m_ilarhvcorrtool->record();
return StatusCode::FAILURE;
}
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// LArHVScaleRetriever.h
// Header file for class LArHVScaleRetriever
// Author: P-A Delsart delsart at in2p3.fr
///////////////////////////////////////////////////////////////////
#ifndef LARTOOLS_LARHVSCALERETRIEVER_H
#define LARTOOLS_LARHVSCALERETRIEVER_H 1
// STL includes
#include <string>
// FrameWork includes
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ServiceHandle.h"
// LArElecCalib includes
#include "LArElecCalib/ILArHVCorrTool.h"
#include "LArElecCalib/ILArHVScaleCorr.h"
#include "GaudiKernel/ToolHandle.h"
// Forward declaration
///////////////////////////////////////////////////////////////////
/// \class LArHVScaleRetriever
/// \brief Single tool to retrieve LAr HV correction factor from MC or data input.
///
/// Retrieving LAr HV correction factors is done differently for MC and data input files.
/// This tool is a simple wrapper around the 2 corresponding methods.
///
/// It implements the ILArHVCorrTool interface and provide a IsMC property which should
/// be enough to configure it to read data or MC input.
///
/// Further configuration can be done through 2 properties :
/// - "LArHVCorrTool" : a ILArHVCorrTool instance (retrived by default from "LArHVCorrTool")
/// - KeyHVScaleCorr : a string used to retrieve the DataHandle<ILArHVScaleCorr> (default : "LArHVScaleCorr"
///
///////////////////////////////////////////////////////////////////
class LArHVScaleRetriever
: virtual public ::ILArHVCorrTool,
public ::AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
// Copy constructor:
/// Constructor with parameters:
LArHVScaleRetriever( const std::string& type,
const std::string& name,
const IInterface* parent );
/// Destructor:
virtual ~LArHVScaleRetriever();
// Athena algtool's Hooks
virtual StatusCode initialize();
// implement ILArHVCorrTool interface
virtual float Scale(const HWIdentifier& id) const ;
virtual float Scale(const Identifier& id) const ;
virtual StatusCode LoadCalibration(IOVSVC_CALLBACK_ARGS) ;
virtual StatusCode record() ;
private:
/// Default constructor:
LArHVScaleRetriever();
ToolHandle<ILArHVCorrTool> m_ilarhvcorrtool;
const DataHandle<ILArHVScaleCorr> m_ilarhvscalecorr;
std::string m_keyHVScaleCorr;
bool m_isMC;
};
// I/O operators
//////////////////////
///////////////////////////////////////////////////////////////////
// Inline methods:
///////////////////////////////////////////////////////////////////
#endif //> !LARTOOLS_LARHVSCALERETRIEVER_H
......@@ -42,7 +42,7 @@ LArOFPeakRecoTool::~LArOFPeakRecoTool() {
}
StatusCode LArOFPeakRecoTool::initialize() {
msg() << MSG::DEBUG << "initializing LArOFPeakRecoTool..." << endreq ;
ATH_MSG_DEBUG("initializing LArOFPeakRecoTool...");
// call back for OFC
......@@ -134,11 +134,11 @@ const LArOFPeakRecoTool::Result& LArOFPeakRecoTool::peak(
//Code will segfault if not the case.
const unsigned nSamples=samples.size();
if (samples.size()<5){
msg() << MSG::WARNING << "Not enough ADC samples (" << nSamples << ") found for channel 0x"
<< std::hex << chID.get_compact() << std::dec << endreq;
return m_result;
}
//if (samples.size()<5){
// msg() << MSG::WARNING << "Not enough ADC samples (" << nSamples << ") found for channel 0x"
// << std::hex << chID.get_compact() << std::dec << endreq;
// return m_result;
// }
// force uses of high gain if required for OFC and shape
CaloGain::CaloGain usedGain = gain;
......@@ -164,7 +164,7 @@ const LArOFPeakRecoTool::Result& LArOFPeakRecoTool::peak(
timeBinWidth=m_dd_ofc->timeBinWidth(chID,usedGain);
timeMax = (nOFCPhase-1)*timeBinWidth;
if (timeBinWidth==0.) {
msg() << MSG::ERROR << "timeBinWidth is zero for channel 0x" << std::hex << chID.get_compact() << std::dec << endreq;
msg() << MSG::ERROR << "timeBinWidth is zero for channel " << m_lar_on_id->channel_name(chID) << endreq;
return m_result;
}
//Check if initial delay isn't too big
......@@ -184,7 +184,7 @@ const LArOFPeakRecoTool::Result& LArOFPeakRecoTool::peak(
//some sanity check on the OFCs
if ( ofcSize == 0 || this_OFC_b.size() == 0 ) {
msg() << MSG::DEBUG << "OFC not found for channel 0x" << std::hex << chID.get_compact() << std::dec << endreq;
ATH_MSG_DEBUG("OFC not found for channel " << m_lar_on_id->channel_name(chID));
return m_result;
}
......@@ -256,7 +256,7 @@ const LArOFPeakRecoTool::Result& LArOFPeakRecoTool::peak(
//Validate the result
m_result.m_valid = true; //Doesn't mean that the result is really good, but we have something
if ( A == 0 ) {
msg() << MSG::DEBUG << "Null amplitude: " << A << " for channel 0x" << std::hex << chID.get_compact() << std::dec << endreq ;
ATH_MSG_DEBUG("Null amplitude: " << A << " for channel" << m_lar_on_id->channel_name(chID));
m_result.m_amplitude=0;
m_result.m_tau=0;
return m_result;
......@@ -373,7 +373,7 @@ const LArOFPeakRecoTool::Result& LArOFPeakRecoTool::peak(
}
}
else {
msg() << MSG::DEBUG << " No shape for this channel" << endreq ;
ATH_MSG_DEBUG("No shape for this channel");
}
}
......
......@@ -16,6 +16,7 @@
#include "LArRecUtils/LArFEBConfigReader.h"
#include "LArRecUtils/LArFlatConditionSvc.h"
#include "../LArFCalTowerBuilderToolTestAlg.h"
#include "../LArHVScaleRetriever.h"
DECLARE_TOOL_FACTORY( LArADC2MeVTool )
DECLARE_TOOL_FACTORY( LArAutoCorrNoiseTool )
......@@ -33,6 +34,7 @@ DECLARE_TOOL_FACTORY( LArFCalTowerBuilderTool )
DECLARE_TOOL_FACTORY( LArFEBConfigReader )
DECLARE_SERVICE_FACTORY( LArFlatConditionSvc)
DECLARE_ALGORITHM_FACTORY( LArFCalTowerBuilderToolTestAlg )
DECLARE_TOOL_FACTORY( LArHVScaleRetriever )