From 5e2c9aad5c00e0372b9701e3721bde236b8f6775 Mon Sep 17 00:00:00 2001 From: Mark Sutton <mark.sutton@cern.ch> Date: Thu, 4 Sep 2014 22:06:39 +0200 Subject: [PATCH] remove obsolete classes (TrigCaloRec-00-04-31) * tagged as TrigCaloRec-00-04-31 * remove obsolete code 2014-08-23 sutt < sutt @ cern.ch > * tagged as TrigCaloRec-00-04-30 * replace TrigSuperRoi by TrigRoiDescriptor --- .../TrigCaloRec/CaloSuperRoIMaker.h | 79 ------ .../TrigCaloRec/PartialCaloCellContMaker.h | 75 ----- .../TrigCaloRec/src/CaloSuperRoIMaker.cxx | 257 ------------------ .../src/PartialCaloCellContMaker.cxx | 237 ---------------- .../TrigCaloRec/src/TrigCaloCellMaker.cxx | 43 ++- .../TrigCaloRec/src/TrigCaloClusterMaker.cxx | 21 +- .../TrigCaloRec/src/TrigCaloTowerMaker.cxx | 13 +- .../src/TrigFullCaloClusterMaker.cxx | 54 ++-- 8 files changed, 59 insertions(+), 720 deletions(-) delete mode 100644 Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/CaloSuperRoIMaker.h delete mode 100644 Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/PartialCaloCellContMaker.h delete mode 100644 Trigger/TrigAlgorithms/TrigCaloRec/src/CaloSuperRoIMaker.cxx delete mode 100644 Trigger/TrigAlgorithms/TrigCaloRec/src/PartialCaloCellContMaker.cxx diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/CaloSuperRoIMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/CaloSuperRoIMaker.h deleted file mode 100644 index a22ca36fae5..00000000000 --- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/CaloSuperRoIMaker.h +++ /dev/null @@ -1,79 +0,0 @@ -// emacs: this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: CaloSuperRoIMaker.h -// PACKAGE: Trigger/TrigAlgorithms/TrigCaloRec -// -// AUTHOR: Ademar Delgado, tavares@cern.ch -// -// Description: Receive all TE of the event and store them in a superRoi. -// Important: To be used in any Partial Scan before the -// TrigCaloCellMaker -// Updates: -// -// ******************************************************************** - -#ifndef TRIGCALOREC_CALOSUPERROIMAKER_H -#define TRIGCALOREC_CALOSUPERROIMAKER_H - -#include "TrigInterfaces/AllTEAlgo.h" -#include "TrigTimeAlgs/TrigTimerSvc.h" -#include "TrigSteeringEvent/TrigSuperRoi.h" - -class CaloSuperRoIMaker: public HLT::AllTEAlgo { -public: - // Functions - CaloSuperRoIMaker(const std::string & name, ISvcLocator* pSvcLocator); - ~CaloSuperRoIMaker(); - HLT::ErrorCode hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& input, unsigned int output); - HLT::ErrorCode hltInitialize(); - HLT::ErrorCode hltFinalize(); - - // Properties: - -private: - // Functions - bool initializeTimers(); //!< initialize the timers - void resetTimers(); //!< reset the monitoring timers - void storeTimers(); //!< store timings in the monitoring variables - void finalizeAccessories(); //!< finalize everything that's not the output - bool inputIsValid(const std::vector<std::vector<HLT::TriggerElement*> >& input) const; - HLT::TriggerElement* setupOutputTe(unsigned int type_out) ; //!< prepare the output trigger element - HLT::ErrorCode finalizeOutput(HLT::TriggerElement* outputTE); //!< finalize the output TE and attach superRoI - -private: - - // Properties: - bool m_doFS; - double m_RoISize; - std::string m_superRoIOutputKey; - std::string m_superRoIUniqueKey; - -protected: - // Functions - - // Properties - /** For Logging, in all tools we should use (*m_log) to avoid recalling of the MsgStream all the time. */ - MsgStream* m_log; - - // output - TrigSuperRoi* m_superRoi; - - // Timers to monitor - TrigTimer *m_fillSuperRoI_timer; //!< get the TE roiDescriptor and add it to superRoi (hltExecute) - TrigTimer *m_settingOutput_timer; //!< prepare the output TE (setupOutputTe & finalizeOutput) - - // Monitored Variables - float m_fillSuperRoITime; //!< see corresponding timer for details - float m_settingOutputTime; //!< see corresponding timer for details - long int m_TEnumb; //!< mumber of TE received - double m_eta; - double m_phi; - -}; -#endif diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/PartialCaloCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/PartialCaloCellContMaker.h deleted file mode 100644 index 2b98dbde6ee..00000000000 --- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/PartialCaloCellContMaker.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: PartialCaloCellContMaker.h -// PACKAGE: Trigger/TrigAlgorithms/TrigCaloRec -// -// AUTHOR: Ademar Delgado, tavares@cern.ch -// -// Description: Fill an partial CellContainer with the cells of the -// SuperRoI using the new unpacking prepared for L2 -// Important: Need to receive an TrigSuperRoi that should -// be made by the CaloSuperRoIMaker -// Updates: -// -// ******************************************************************** - -#ifndef TRIGCALOREC_PARTIALCALOCELLCONTMAKER_H -#define TRIGCALOREC_PARTIALCALOCELLCONTMAKER_H - -#include "TrigCaloRec/IAlgToolEFCalo.h" -//#include "TrigT2CaloCommon/T2GeometryTool.h" -#include "TrigT2CaloCommon/TrigDataAccess.h" -#include "IRegionSelector/IRoiDescriptor.h" -//#include "CaloInterface/ICalorimeterNoiseTool.h" - - -class PartialCaloCellContMaker : public IAlgToolEFCalo { - public: - // Constructor - PartialCaloCellContMaker(const std::string & type, const std::string & name, - const IInterface* parent); - // Destructor - virtual ~PartialCaloCellContMaker(); - - // AlgTool stages - StatusCode initialize(); - StatusCode finalize(); - using IAlgToolEFCalo::execute; - StatusCode execute(CaloCellContainer &pCaloCellContainer, const IRoiDescriptor &superRoi); - - private: - // Functions - void fillCellContainer(CaloCellContainer &pCaloCellContainer, const IRoiDescriptor &superRoi, - const DETID detid=TTEM, const int sampling=0); - - // Properties: -// BooleanProperty m_CheckCellWithinRoI; - -// IT2GeometryTool *m_geometryTool; - ITrigDataAccess *m_data; -// ToolHandle<ICalorimeterNoiseTool> m_noiseTool; - // configurable for noise suppression on LAr cells and TileCal -// int m_do_LArCells_noise_suppression; //<! 0 (1) -> no (yes) -// int m_do_TileCells_noise_suppression; //<! 0 (1) -> no (yes) -// float m_cutvalue; -// bool m_absEinSigma; -// bool m_twogaussiannoise; - - //iterators - LArTT_Selector<LArCellCont>::const_iterator m_iBegin; - LArTT_Selector<LArCellCont>::const_iterator m_iEnd; - LArTT_Selector<LArCellCont>::const_iterator m_it; - TileCellCollection::const_iterator m_itBegin; - TileCellCollection::const_iterator m_itEnd; - TileCellCollection::const_iterator m_itt; - - protected: - // Properties - /** For Logging, in all tools we should use (*m_log) to avoid recalling of the MsgStream all the time. */ - MsgStream* m_log; -}; -#endif diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/CaloSuperRoIMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/CaloSuperRoIMaker.cxx deleted file mode 100644 index d66cf952404..00000000000 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/CaloSuperRoIMaker.cxx +++ /dev/null @@ -1,257 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: CaloSuperRoIMaker.cxx -// PACKAGE: Trigger/TrigAlgorithms/TrigCaloRec -// -// AUTHOR: Ademar Delgado, tavares@cern.ch -// -// Description: Receive all TE of the event and store them in a superRoi. -// Important: To be used in any Partial Scan before the -// TrigCaloCellMaker -// Updates: -// -// ******************************************************************** - -#include "TrigCaloRec/CaloSuperRoIMaker.h" -#include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "TrigSteeringEvent/PhiHelper.h" - -//-------------------------------------------------------------- -CaloSuperRoIMaker::CaloSuperRoIMaker(const std::string & name, ISvcLocator* pSvcLocator) - : HLT::AllTEAlgo(name, pSvcLocator), - m_doFS(false), - m_RoISize(0.5), - m_superRoIOutputKey(""), - m_superRoIUniqueKey(""), - m_log(0), - m_superRoi(0), - m_fillSuperRoI_timer(0), - m_settingOutput_timer(0), - m_fillSuperRoITime(0.), - m_settingOutputTime(0.), - m_TEnumb(0), - m_eta(0.), - m_phi(0.) -{ - // unpacking tool - // configurables - declareProperty("superRoIOutputKey", m_superRoIOutputKey = "CaloSuperRoI"); - declareProperty("doFullScan", m_doFS = "false"); - declareProperty("RoISize", m_RoISize = 0.5); - - // monitoring - declareMonitoredVariable("FillSuperRoITime", m_fillSuperRoITime); - declareMonitoredVariable("SettingOutputTime", m_settingOutputTime); - declareMonitoredVariable("TE_Event", m_TEnumb); - - /// use msgsvc - // std::printf("####################### CaloSuperRoIMaker - tmpAlg - v-0.0.0 #######################\n"); -} - -//-------------------------------------------------------------- -CaloSuperRoIMaker::~CaloSuperRoIMaker(){ } - -//-------------------------------------------------------------- -HLT::ErrorCode CaloSuperRoIMaker::hltInitialize(){ - m_log = new MsgStream(msgSvc(), name()); - MsgStream &logStream = *m_log; - - if(logStream.level() <= MSG::INFO) - logStream << MSG::INFO << " Initalizing FEX algorithm: " << name() << endreq; - - initializeTimers(); - - // std::printf("T2AllRoiCellUnpacking::hltInitialize - RoISize - %f \n", m_RoISize); - // std::printf("####################### T2AllRoiCellUnpacking::hltInitialize #######################\n"); - return HLT::OK; -} - -//-------------------------------------------------------------- -HLT::ErrorCode CaloSuperRoIMaker::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& tes_in, unsigned int type_out){ - MsgStream &logStream = *m_log; - // since this is an AllTEAlgo, we have to call the monitoring ourselves: - beforeExecMonitors().ignore(); - // setup what we need (variables and tools) - resetTimers(); - - //--------------------- begin TE check and prepare superRoi --------------------- - if(m_settingOutput_timer) m_settingOutput_timer->start(); - - if(!inputIsValid(tes_in)) return HLT::ErrorCode(HLT::Action::ABORT_CHAIN,HLT::Reason::USERDEF_1); - // if the input is valid, take _the_ last TEVec and process it - const HLT::TEVec &tev = tes_in.back(); - HLT::TriggerElement* outputTE(setupOutputTe(type_out)); - - m_superRoi = new TrigSuperRoi(m_doFS); //if m_doFS true, do SuperRoi fullscan - m_superRoi->clear(); - - if ((getUniqueKey( m_superRoi, m_superRoIUniqueKey, m_superRoIOutputKey )) != HLT::OK) { - (*m_log) << MSG::DEBUG << "Unable to retrieve the superRoI unique key" << endreq; - } - if (evtStore()->record(m_superRoi, m_superRoIUniqueKey).isFailure()) { - (*m_log) << MSG::DEBUG << "Unable to record the superRoI with the key - " << m_superRoIUniqueKey << endreq; - } - - if(m_settingOutput_timer) m_settingOutput_timer->pause(); - //--------------------- finish TE check and prepare superRoi --------------------- - - - //--------------------- begin superRoI fill --------------------- - if(m_fillSuperRoI_timer) m_fillSuperRoI_timer->start(); - - for(unsigned int iTe=0; iTe<tev.size(); iTe++){ - const HLT::TriggerElement* inputTe = tev[iTe]; - - if(!inputTe){ - logStream<<MSG::ERROR<<"Invalid TriggerElement ("<<inputTe<<") pointer"<<endreq; - return HLT::ERROR; - } // end if(!inputTe) - - // get the RoiDescriptor - const TrigRoiDescriptor* roiDescriptor = 0; - HLT::ErrorCode hltStatus = getFeature(inputTe, roiDescriptor); - if(HLT::OK != hltStatus){ - logStream<<MSG::ERROR<<" Failed to find RoiDescriptor "<<endreq; - return hltStatus; - } // end if(not OK)*/ - - m_eta = roiDescriptor->eta(); - m_phi = roiDescriptor->phi(); - TrigRoiDescriptor* tmpRoiDescriptor = new TrigRoiDescriptor( m_eta, m_eta-m_RoISize, m_eta+m_RoISize, m_phi, HLT::wrapPhi(m_phi-m_RoISize), HLT::wrapPhi(m_phi+m_RoISize) ); - m_superRoi->push_back(tmpRoiDescriptor); - } // end for(iTe) - - if(m_fillSuperRoI_timer) m_fillSuperRoI_timer->stop(); - //--------------------- finish superRoI fill --------------------- - - m_TEnumb=tev.size(); - - //--------------------- begin TE finalize the output --------------------- - if(m_settingOutput_timer) m_settingOutput_timer->resume(); - // finalize the output and the monitoring variables - HLT::ErrorCode stat(finalizeOutput(outputTE)); - if(stat!= HLT::OK) return stat; - finalizeAccessories(); - if(m_settingOutput_timer) m_settingOutput_timer->stop(); - //--------------------- finish TE finalize the output --------------------- - - // since this is an AllTEAlgo, we have to call the monitoring ourselves: - afterExecMonitors().ignore(); - logStream<<MSG::DEBUG<<"Processed "<<tev.size()<<" TriggerElements."<<endreq; - - //std::printf("Test - m_doPFS=%d tev.size()= %u m_superRoi.size()=%d m_cellCont.size()=%lu \n",m_doPFS,tev.size(),m_superRoi.size(),m_cellCont->size()); - //std::printf("####################### CaloSuperRoIMaker::hltExecute #######################\n"); - - return HLT::OK; -} - -//-------------------------------------------------------------- -HLT::ErrorCode CaloSuperRoIMaker::hltFinalize(){ - MsgStream &logStream = *m_log; - if ( logStream.level() <= MSG::DEBUG ) - logStream << MSG::DEBUG << "Finalizing CaloSuperRoIMaker FEX " << name() << endreq; - - delete m_log; - //std::printf("####################### CaloSuperRoIMaker::hltFinalize #######################\n"); - return HLT::OK; -} - -//!____________________ core functions _____________________ - - -//!__________________ auxiliary functions __________________ -//---------------------------------------------------------- -bool CaloSuperRoIMaker::initializeTimers(){ - MsgStream &logStream = *m_log; - ITrigTimerSvc *pTimerService=0; - if( service( "TrigTimerSvc", pTimerService).isFailure() || !pTimerService){ - logStream<<MSG::ERROR <<name()<<": Unable to locate TrigTimer Service" <<endreq; - return false; - } - logStream << MSG::DEBUG << " Adding timers" << endreq; - //Add timers - m_fillSuperRoI_timer = addTimer("fillSuperRoI_timer"); - m_settingOutput_timer = addTimer("settingOutput_timer"); - - //std::printf("####################### CaloSuperRoIMaker::initializeTimers #######################\n"); - return true; -} - -//-------------------------------------------------------------- -void CaloSuperRoIMaker::resetTimers(){ - if(m_fillSuperRoI_timer) m_fillSuperRoI_timer->reset(); - if(m_settingOutput_timer) m_settingOutput_timer->reset(); - //std::printf("####################### CaloSuperRoIMaker::resetTimers #######################\n"); -} - -//-------------------------------------------------------------- -void CaloSuperRoIMaker::storeTimers(){ - if(m_fillSuperRoI_timer) m_fillSuperRoITime = m_fillSuperRoI_timer->elapsed(); - if(m_settingOutput_timer) m_settingOutputTime = m_settingOutput_timer->elapsed(); - //std::printf("####################### CaloSuperRoIMaker::storeTimers #######################\n AllRoi m_RoITime=%f \n AllRoi m_UnpckTime=%f \n AllRoi m_cellUnpckTime=%f \n", m_RoITime, m_UnpckTime, m_cellUnpckTime); -} - -//-------------------------------------------------------------- -bool CaloSuperRoIMaker::inputIsValid(const std::vector<std::vector<HLT::TriggerElement*> >& input) const { - MsgStream &logStream = *m_log; - if(logStream.level() <= MSG::DEBUG) - logStream<< MSG::DEBUG << "CaloSuperRoIMaker "<<name()<<"\n" - <<input.size()<<" input trigger elements for CaloSuperRoIMaker"<<endreq; - // sanity check on the input - if(input.size()==0){ - logStream<<MSG::ERROR<<"CaloSuperRoIMaker "<<name()<<"\n" - <<"Error! expected at least one vector<TriggerElement> as input,\n" - <<" that should contain the L1 jets. (got 0 vectors instead)\n" - <<"Exiting hltExecute."<<endreq; - //std::printf("####################### CaloSuperRoIMaker::inputIsValid - error #######################\n"); - return false; - } // end if(1!=input.size()) - - //std::printf("####################### CaloSuperRoIMaker::inputIsValid #######################\n"); - return true; -} - -//-------------------------------------------------------------- -void CaloSuperRoIMaker::finalizeAccessories(){ - storeTimers(); -} - -//-------------------------------------------------------------- -HLT::TriggerElement* CaloSuperRoIMaker::setupOutputTe(unsigned int type_out) { - (*m_log) <<MSG::ERROR<<"CaloSuperRoIMaker::setupOutputTE "<<name() <<" this class is obsolete now\n"; - // HLT::TriggerElement* outputTE = addRoI(type_out,0.,0.); // note: addRoI is defined in AllTEAlgo base class - // outputTE->setActiveState(true); - //std::printf("####################### CaloSuperRoIMaker::setupOutputTe #######################\n",type_out); - HLT::TriggerElement* outputTE = 0; - return outputTE; -} - -//-------------------------------------------------------------- -HLT::ErrorCode CaloSuperRoIMaker::finalizeOutput(HLT::TriggerElement* outputTE){ - MsgStream &logStream = *m_log; - - std::string m_superRoIUniqueKey=""; - HLT::ErrorCode stat = reAttachFeature(outputTE, m_superRoi, m_superRoIUniqueKey, m_superRoIOutputKey); - // HLT::ErrorCode stat = recordAndAttachFeature(outputTE, m_cellCont, tmp_cellCollUniqueKey, m_cellContOutputKey); - // HLT::ErrorCode stat = attachFeature(outputTE, m_cellCont, tmp_cellCollUniqueKey, m_cellContOutputKey,HLT::Navigation::ObjectToStoreGate); - if (stat != HLT::OK){ - logStream<<MSG::ERROR<<" recording of SuperRoI into StoreGate failed"<<endreq; - return stat; - } - - if(logStream.level() <= MSG::DEBUG) - logStream<<MSG::DEBUG<<" SuperRoIMaker done. "<<name()<<endreq; - - /// need to use msgsvc - // std::printf(" m_superRoIUniqueKey = %s \n m_superRoIOutputKey = %s \n",m_superRoIUniqueKey.c_str(), m_superRoIOutputKey.c_str()); - // std::printf(" outputTE->getId() = %u \n inputTE->getActiveState() = %d //1 true; 0 false \n",outputTE->getId(), outputTE->getActiveState()); - // std::printf("####################### CaloSuperRoIMaker TESTE -m_superRoi.size()=%d \n",m_superRoi->size()); - // std::printf("####################### CaloSuperRoIMaker::finalizeOutput #######################\n"); - - return stat; -} - diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/PartialCaloCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/PartialCaloCellContMaker.cxx deleted file mode 100644 index dfa6cd430f8..00000000000 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/PartialCaloCellContMaker.cxx +++ /dev/null @@ -1,237 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: PartialCaloCellContMaker.cxx -// PACKAGE: Trigger/TrigAlgorithms/TrigCaloRec -// -// AUTHOR: Ademar Delgado, tavares@cern.ch -// -// Description: Fill an partial CellContainer with the cells of the -// SuperRoI using the new unpacking prepared for L2 -// Important: Need to receive an TrigSuperRoi that should -// be made by the CaloSuperRoIMaker -// Updates: -// -// ******************************************************************** - -#include "TrigCaloRec/PartialCaloCellContMaker.h" - - -//-------------------------------------------------------------- -PartialCaloCellContMaker::PartialCaloCellContMaker(const std::string & type, - const std::string & name, const IInterface* parent) - : IAlgToolEFCalo(type, name, parent) -{ -// declareProperty("CheckCellWithinRoI", m_CheckCellWithinRoI = false); -// declareProperty("DoTileCellsNoiseSuppression", do_TileCells_noise_suppression = 0); -// declareProperty("CaloNoiseTool",m_noiseTool,"Tool Handle for noise tool"); -// declareProperty("CutValue",m_cutvalue = 2,"Cell accepted if e>m_cutvalue*tilecellnoise"); -// declareProperty("AbsEinSigma",m_absEinSigma = 0,"0=asymmetric noise-sigma cut(default)"); -// declareProperty("TwoGaussianNoise",m_twogaussiannoise = false,"false=do not use double gaussian description for tile(default)"); - -/// need to use message service -//std::printf("####################### PartialCaloCellContMaker - tmpAlg - v-0.0.0 #######################\n"); -} - -//-------------------------------------------------------------- -PartialCaloCellContMaker::~PartialCaloCellContMaker(){ -} - -//-------------------------------------------------------------- -StatusCode PartialCaloCellContMaker::initialize(){ - m_log = new MsgStream(msgSvc(), name()); - MsgStream &logStream = *m_log; - - if (toolSvc()->retrieveTool("TrigDataAccess", m_data).isFailure()) { - logStream << MSG::FATAL << "Unable to retrieve TrigDataAccess" << endreq; - return StatusCode::FAILURE; - } - - /* if (do_TileCells_noise_suppression!=0){ - - if (m_noiseTool.retrieve().isFailure()) return StatusCode::FAILURE; - - std::cout << name() << " Two-Gaussian noise for Tile set to " << (m_twogaussiannoise ? "true" : "false") << std::endl; - - }*/ - - if( service( "TrigTimerSvc", m_timersvc).isFailure() ) { - logStream<<MSG::ERROR << ": Unable to locate TrigTimer Service" << std::endl; - } - - // Initialize timing service - if (m_timersvc) { - m_timer.push_back(m_timersvc->addItem("TCRec_PartialTotal")); - m_timer.push_back(m_timersvc->addItem("TCRec_PartialRegionSelector")); - m_timer.push_back(m_timersvc->addItem("TCRec_PartialDataAccess")); - m_timer.push_back(m_timersvc->addItem("TCRec_PartialPushBackCells")); - } - - return StatusCode::SUCCESS; -} - -//-------------------------------------------------------------- -StatusCode PartialCaloCellContMaker::finalize(){ -// delete m_log; - return StatusCode::SUCCESS; -} - -//-------------------------------------------------------------- -StatusCode PartialCaloCellContMaker::execute(CaloCellContainer &pCaloCellContainer, - const IRoiDescriptor &superRoi){ - // reset error - m_error=(EFTILE<<28); - - if (m_timersvc) { - (m_timer.at(0))->start(); - (m_timer.at(1))->start(); (m_timer.at(1))->pause(); - (m_timer.at(2))->start(); (m_timer.at(2))->pause(); - (m_timer.at(3))->start(); (m_timer.at(3))->pause(); - } - - //--------------------- begin getting data --------------------- - //! Liquid Argon Trigger Tower EM Calorimeter - for(int sa=0;sa<4;sa++){ //for TTEM - fillCellContainer(pCaloCellContainer, superRoi, TTEM, sa); - }//end TTEM - - //! Liquid Argon Trigger Tower HEC Calorimeter - for(int sa=0;sa<4;sa++){ //for TTHEC - // fillCellContainer(pCaloCellContainer, superRoi, TTHEC, sa); - }//end TTHEC - - //! Liquid Argon Trigger Tower FCALEM Calorimeter - // fillCellContainer(pCaloCellContainer, superRoi, FCALEM, 0); - - //! Liquid Argon Trigger Tower FCALHAD Calorimeter - for(int sa=0;sa<2;sa++){ //for FCALHAD - // fillCellContainer(pCaloCellContainer, superRoi, FCALHAD, sa); - }//end FCALHAD - - //! Tile Calorimeters - fillCellContainer(pCaloCellContainer, superRoi, TILE, 0); - //--------------------- finish getting data --------------------- - -#if 0 - /// need to use message service - - //!***************************************************************************** - std::printf("-PartialCaloCellContMaker::finalizeOutput------------------ cheking PS container ------------------------------ \n"); - if(pCaloCellContainer.hasCalo(CaloCell_ID::LAREM)){ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LAREM----------- have calo ------------------------------ \n"); - }else{ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LAREM----------- haven't calo ------------------------------ \n"); - } - if(pCaloCellContainer.hasCalo(CaloCell_ID::LARHEC)){ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LARHEC---------- have calo ------------------------------ \n"); - }else{ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LARHEC---------- haven't calo ------------------------------ \n"); - } - if(pCaloCellContainer.hasCalo(CaloCell_ID::LARFCAL)){ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LARFCAL--------- have calo ------------------------------ \n"); - }else{ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::LARFCAL--------- haven't calo ------------------------------ \n"); - } - if(pCaloCellContainer.hasCalo(CaloCell_ID::TILE)){ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::TILE------------ have calo ------------------------------ \n"); - }else{ - std::printf("-PartialCaloCellContMaker::finalizeOutput-------CaloCell_ID::TILE------------ haven't calo ------------------------------ \n"); - } - std::printf("-PartialCaloCellContMaker::finalizeOutput------------------------------------------------------------------------- \n"); - //!***************************************************************************** -#endif - - if (m_timersvc) { (m_timer.at(0))->stop(); (m_timer.at(1))->stop(); (m_timer.at(2))->stop(); (m_timer.at(3))->stop(); } - return StatusCode::SUCCESS; -} - - -//!____________________ core functions _____________________ -void PartialCaloCellContMaker::fillCellContainer(CaloCellContainer &pCaloCellContainer, const IRoiDescriptor& superRoi, - const DETID detid, const int sampling){ - // MsgStream &logStream = *m_log; - - if (m_timersvc) (m_timer.at(1))->resume(); - m_data->RegionSelector(sampling,superRoi, detid);// 0 and TILE without meaning - if (m_timersvc) (m_timer.at(1))->pause(); - - CaloCell_ID::SUBCALO iSubCalo=CaloCell_ID::NOT_VALID; - - if( detid != TILE ){ // LAr - //Load cell Collections - if (m_timersvc) (m_timer.at(2))->resume(); - if(m_data->LoadCollections(m_iBegin,m_iEnd,sampling,!sampling).isFailure()){ - //logStream<<MSG::ERROR<<" Failed to load cell collections "<<endreq; - /* if (m_data->report_error()) { - m_error=m_data->report_error()+(EFTILE<<28); - }*/ - if (m_timersvc) (m_timer.at(2))->pause(); - return; - } - if (m_timersvc) (m_timer.at(2))->pause(); - - //set the CellContainer subCalo - if(m_iBegin!=m_iEnd){ - switch (detid) { - case TTEM: - iSubCalo=CaloCell_ID::LAREM; - break; - case TTHEC: - iSubCalo=CaloCell_ID::LARHEC; - break; - case FCALEM: - case FCALHAD: - iSubCalo=CaloCell_ID::LARFCAL; - break; - default: - break; - } - } - - //Fill the cell container - if (m_timersvc) (m_timer.at(3))->resume(); - for(m_it = m_iBegin;m_it != m_iEnd; ++m_it){ - CaloCell* cell = (CaloCell*)(*m_it); - pCaloCellContainer.push_back(cell); - } - if (m_timersvc) (m_timer.at(3))->pause(); - - }else if(m_data->TileContSize()!=0){ // TILE - for( unsigned int iR=0; iR!=m_data->TileContSize();++iR ){ - //Load cell Collections - if (m_timersvc) (m_timer.at(2))->resume(); - if(m_data->LoadCollections(m_itBegin,m_itEnd,sampling,!sampling).isFailure()){ - //logStream<<MSG::ERROR<<" Failed to load cell collections "<<endreq; - if (m_data->report_error()) { - m_error=m_data->report_error()+(EFTILE<<28); - } - if (m_timersvc) (m_timer.at(2))->pause(); - //continue; - } - if (m_timersvc) (m_timer.at(2))->pause(); - - //set the CellContainer subCalo - if(m_itBegin!=m_itEnd){ - iSubCalo=CaloCell_ID::TILE; - } - - //Fill the cell container - if (m_timersvc) (m_timer.at(3))->resume(); - for(m_itt = m_itBegin;m_itt != m_itEnd; ++m_itt){ - CaloCell* cell = (CaloCell*)(*m_itt); - pCaloCellContainer.push_back(cell); - } - if (m_timersvc) (m_timer.at(3))->pause(); - } - } - - pCaloCellContainer.setHasCalo(iSubCalo); -} - - - - - diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx index 3cdccff6ae6..662355e2481 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx @@ -24,7 +24,6 @@ // #include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "TrigSteeringEvent/TrigSuperRoi.h" #include "TrigSteeringEvent/PhiHelper.h" // #include "CaloEvent/CaloCellContainer.h" @@ -225,28 +224,16 @@ HLT::ErrorCode TrigCaloCellMaker::hltExecute(const HLT::TriggerElement* inputTE, #endif // Get RoiDescriptor - // bool createdRoI = false; - - const IRoiDescriptor* roiDescriptor = 0; - - const TrigSuperRoi* superRoi = 0; const TrigRoiDescriptor* tmpRoi = 0; - - HLT::ErrorCode sc = getFeature(inputTE, superRoi, ""); + HLT::ErrorCode sc = getFeature(inputTE, tmpRoi, ""); + if (sc != HLT::OK || tmpRoi==0 ) return sc; - if ( sc == HLT::OK && superRoi ) { - roiDescriptor = superRoi; - } - else { - sc = getFeature(inputTE, tmpRoi, ""); - - if (sc != HLT::OK || tmpRoi==0 ) return sc; - - roiDescriptor = tmpRoi; - + const IRoiDescriptor* roiDescriptor = tmpRoi; + + if ( !roiDescriptor->composite() ) { if ( !m_trustRoiLimits ){ - + double eta0 = roiDescriptor->eta(); /// don't really need to wrap phi, as the RoI does it anyway, so phi /// from the RoI should always be wrapped anyway @@ -260,7 +247,7 @@ HLT::ErrorCode TrigCaloCellMaker::hltExecute(const HLT::TriggerElement* inputTE, // while (phi0 <-M_PI) phi0 += 2. * M_PI; // set up the sampling windows (only for samp2??): - + //double etamin = std::max(-2.5,eta0-(m_detas2*(float)m_neta)/2.); //double etamax = std::min( 2.5,eta0+(m_detas2*(float)m_neta)/2.); double etamin = eta0-(m_detas2*(float)m_neta)/2.; @@ -276,7 +263,7 @@ HLT::ErrorCode TrigCaloCellMaker::hltExecute(const HLT::TriggerElement* inputTE, // while (phimax > M_PI) phimax -= 2. * M_PI; // while (phimax <-M_PI) phimax += 2. * M_PI; - + #ifndef NDEBUG if (msgLvl() <= MSG::DEBUG) { msg() << MSG::DEBUG << " eta0 = "<< eta0 << endreq; @@ -301,13 +288,11 @@ HLT::ErrorCode TrigCaloCellMaker::hltExecute(const HLT::TriggerElement* inputTE, #ifndef NDEBUG if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << " REGTEST: RoI id " << roiDescriptor->roiId() - << " located at phi = " << roiDescriptor->phi() - << ", eta = " << roiDescriptor->eta() << endreq; + msg() << MSG::DEBUG << " REGTEST: RoI id " << *roiDescriptor << roiDescriptor->eta() << endreq; #endif -//if (timerSvc()) m_timer[1]->start(); // Measures the time to retrieve the cells in the RoI + //if (timerSvc()) m_timer[1]->start(); // Measures the time to retrieve the cells in the RoI // The CellContainer is not the cell owner (SG::VIEW_ELEMENTS)... //CaloCellContainer* pCaloCellContainer = new CaloCellContainer(SG::VIEW_ELEMENTS); @@ -449,15 +434,23 @@ else { /// create and attache an RoI for the ID Trigger if ( m_createRoiForID ) { + + if ( roiDescriptor->composite() ) { + msg() << MSG::WARNING << " Request to build an RoI for the ID From a composite RoiDescriptor" << *roiDescriptor << endreq; + } + + TrigRoiDescriptor* _roi = new TrigRoiDescriptor( roiDescriptor->eta(), roiDescriptor->eta()-m_etaWidthForID, roiDescriptor->eta()+m_etaWidthForID, roiDescriptor->phi(), HLT::wrapPhi(roiDescriptor->phi()-m_phiWidthForID), HLT::wrapPhi(roiDescriptor->phi()+m_phiWidthForID) ); + if ( m_etaWidthForID==0 || m_phiWidthForID==0 ) { msg() << MSG::WARNING << "ZERO width RoI requested for the ID: " << *_roi << endreq; } + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "REGTEST: attach RoI for ID " << *_roi << endreq; attachFeature( outputTE, _roi, "forID" ); } diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloClusterMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloClusterMaker.cxx index b2f664bd0a0..22f1a631627 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloClusterMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloClusterMaker.cxx @@ -25,7 +25,6 @@ // #include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "TrigSteeringEvent/TrigSuperRoi.h" // #include "CaloEvent/CaloCellContainer.h" // @@ -213,24 +212,13 @@ HLT::ErrorCode TrigCaloClusterMaker::hltExecute(const HLT::TriggerElement* input const IRoiDescriptor* roiDescriptor = 0; const TrigRoiDescriptor* tmproi = 0; - const TrigSuperRoi* superroi = 0; - HLT::ErrorCode sc = getFeature(inputTE, superroi, ""); - if (sc == HLT::OK && superroi ) { - roiDescriptor = superroi; - } - else { - sc = getFeature(inputTE, tmproi, ""); - if (sc != HLT::OK || tmproi==0 ) return sc; - roiDescriptor = tmproi; - } - - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << " RoI id " << roiDescriptor->roiId() - << " located at phi = " << roiDescriptor->phi() - << ", eta = " << roiDescriptor->eta() << endreq; + HLT::ErrorCode sc = getFeature(inputTE, tmproi, ""); + if (sc != HLT::OK || tmproi==0 ) return sc; + roiDescriptor = tmproi; if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "roi " << *roiDescriptor << endreq; + #if 0 if (msgLvl() <= MSG::DEBUG) { double eta0 = roiDescriptor->eta(); @@ -429,6 +417,7 @@ HLT::ErrorCode TrigCaloClusterMaker::hltExecute(const HLT::TriggerElement* input std::stringstream strm; strm << roiDescriptor->roiId(); m_pCaloClusterContainer->setROIAuthor(m_clustersOutputName + "_" + strm.str()); #endif + // record and lock the Clusters Container with the new EDM helper... bool status = CaloClusterStoreHelper::finalizeClusters( store(), m_pCaloClusterContainer, clusterCollKey, msg()); diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloTowerMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloTowerMaker.cxx index 104e5634115..56f069a4f24 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloTowerMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloTowerMaker.cxx @@ -172,17 +172,10 @@ HLT::ErrorCode TrigCaloTowerMaker::hltExecute(const HLT::TriggerElement* inputTE const IRoiDescriptor* roiDescriptor = 0; const TrigRoiDescriptor* tmproi = 0; - // const TrigSuperRoi* superroi = 0; - // HLT::ErrorCode sc = getFeature(inputTE, superroi, ""); - // if (sc == HLT::OK && superroi ) { - // roiDescriptor = superroi; - // } - // else { HLT::ErrorCode sc = getFeature(inputTE, tmproi, ""); if (sc != HLT::OK || tmproi==0 ) return sc; roiDescriptor = tmproi; - // } if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " RoI id " << roiDescriptor->roiId() @@ -190,7 +183,13 @@ HLT::ErrorCode TrigCaloTowerMaker::hltExecute(const HLT::TriggerElement* inputTE << ", eta = " << roiDescriptor->eta() << endreq; /// ho hum, this needs a flag for using own wdiths rather than those from the roiDescriptor + /// in addition, this will *not* work properly for composite RoIs + if ( roiDescriptor->composite() ) { + msg() << MSG::WARNING << " Attempting to use composite RoI as a normal RoI - this is probably *not* what you want to do " + << *roiDescriptor << endreq; + } + double eta0 = roiDescriptor->eta(); double phi0 = roiDescriptor->phi(); diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloClusterMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloClusterMaker.cxx index 53f24be3418..7072b29921e 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloClusterMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloClusterMaker.cxx @@ -24,7 +24,6 @@ // #include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "TrigSteeringEvent/TrigSuperRoi.h" // #include "CaloEvent/CaloCellContainer.h" #include "xAODCaloEvent/CaloClusterContainer.h" @@ -203,38 +202,41 @@ HLT::ErrorCode TrigFullCaloClusterMaker::hltExecute( std::vector<std::vector<HLT // for (itrclus; itrclus != endclus; ++itrclus) { for (; cachedTEList_it!=cachedTEList_end ; ++cachedTEList_it) { + const IRoiDescriptor* roiDescriptor = 0; const TrigRoiDescriptor* tmproi = 0; - const TrigSuperRoi* superroi = 0; - + HLT::TriggerElement* AllTE_cached_outputTE = 0; - - HLT::ErrorCode sc = getFeature(cachedTEList_it->second, superroi); - if (sc != HLT::OK || superroi==0) { - - HLT::ErrorCode sc = getFeature(cachedTEList_it->second, tmproi); - - if (sc != HLT::OK || tmproi==0 ) { - if (msgLvl() <= MSG::ERROR) - msg() << MSG::ERROR << "Could not find Feature to be attached" << endreq; - return sc; - } - - roiDescriptor = tmproi; - /// copy the RoI since this is being attached to a new TE + HLT::ErrorCode sc = getFeature(cachedTEList_it->second, tmproi); + + if (sc != HLT::OK || tmproi==0 ) { + if (msgLvl() <= MSG::ERROR) + msg() << MSG::ERROR << "Could not find Feature to be attached" << endreq; + return sc; + } + + roiDescriptor = tmproi; + /// copy the RoI since this is being attached to a new TE + /// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING + /// NB: if this is a composite RoI, it probably won't perform a deep copy of + /// the RoI constituents, and may caus a crash in the event cleanup + /// or sooner. So this is probably NOT what you want to do + /// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING + if ( !tmproi->composite() ) { TrigRoiDescriptor* _tmproi = new TrigRoiDescriptor( *tmproi ); AllTE_cached_outputTE = addRoI(type_out,_tmproi); } else { - roiDescriptor = superroi; - /// copy the RoI since this is being attached to a new TE - /// perhaps will need a proper deep copy - TrigSuperRoi* _superroi = new TrigSuperRoi( *superroi ); - AllTE_cached_outputTE = addRoI(type_out,_superroi); + /// so try a deep copt here ... + TrigRoiDescriptor* _tmproi = new TrigRoiDescriptor( true ); + for ( unsigned i=tmproi->size() ; i-- ; ) _tmproi->push_back( new TrigRoiDescriptor( *dynamic_cast<const TrigRoiDescriptor*>(tmproi->at(i)) ) ); + _tmproi->setComposite(true); + _tmproi->manageConstituents(true); + AllTE_cached_outputTE = addRoI(type_out,_tmproi); } - + /// what is this roi about if it is for the full calorimeter?? // float roiwidth=0.1; // TrigRoiDescriptor *tmproi = new @@ -274,11 +276,15 @@ HLT::ErrorCode TrigFullCaloClusterMaker::hltExecute( std::vector<std::vector<HLT const TrigRoiDescriptor* roiDescriptor = 0; HLT::ErrorCode sc = getFeature(*inner_it, roiDescriptor, ""); if (sc != HLT::OK) return sc; - if (msgLvl() <= MSG::DEBUG) + if (msgLvl() <= MSG::DEBUG) { msg() << MSG::DEBUG << " REGTEST: RoI id " << roiDescriptor->roiId() << " located at phi = " << roiDescriptor->phi() << ", eta = " << roiDescriptor->eta() << endreq; + msg() << MSG::DEBUG << " REGTEST: RoI " << *roiDescriptor << endreq; + } //get the cluster and tower container names - there should only be one of each + + cellcontname = retrieveCellContName(*inner_it); towercontname = retrieveTowerContName(*inner_it); -- GitLab