Store calo reco
No reaction to the Jira post - so I push
Merge request reports
Activity
I'm not familiar with the intent of this MR, but if you just want to copy objects from one location to another, including references to other objects that the 'parent object' knows about, you could use the existing MicroDST machinery.
See !106 (merged) for example, where I've added an algorithm for copying
CaloHypo
objects. (TheCaloHypoCloner
class, which is used by this new copy algorithm for eachCaloHypo
, knows how to copy the relatedCaloCluster
andCaloDigit
objects.) These algorithms are all very similar to each other and lots already exist (e.g. for copyingMCParticle
orProtoParticle
objects), so adding new ones is relatively easy.Hi Alex,
thanks for the info. This is partly what the newly added storeCaloReco algorithm is doing. But for the purpose of the calo re-reconstruction there is some additional informations that also need to be stored (ExtraDigits attached to CaloHypo, CaloEntries attached to CaloClusters and the CaloADCs matching the CaloDigits that actually are not referenced in CaloDigits) taking care of avoiding duplicate. The references to other objects is actually not used and the calo reconstruction chain is restored using the ChannelID information.
mentioned in commit 27c3de10
Sorry I missed this commit before it was merged. It would be good if new code were following the C++14 style and modern Gaudi from the beginning. In particular, member variables should be initialised in the header file where they are declared (e.g. initialise all pointers as
nullptr
, and properties should be declared asGaudi::Property
, not throughdeclareProperty
13 // 2016-12-06 : Olivier Deschamps 14 //----------------------------------------------------------------------------- 15 16 // Declaration of the Algorithm Factory 17 DECLARE_ALGORITHM_FACTORY( StoreCaloRecoChain ) 18 19 //============================================================================= 20 // Standard constructor, initializes variables 21 //============================================================================= 22 StoreCaloRecoChain::StoreCaloRecoChain( const std::string& name, 23 ISvcLocator* pSvcLocator ) : DaVinciAlgorithm ( name , pSvcLocator ) 24 , m_status(LHCb::CaloDigitStatus::UseForEnergy|LHCb::CaloDigitStatus::UseForPosition|LHCb::CaloDigitStatus::UseForCovariance){ 25 declareProperty("TESprefix" ,m_prefix="CaloReco/"); 26 declareProperty("UseStatusMask",m_mask=true); // true : only store the masked digits 27 declareProperty("Verbose" ,m_verb=false); // activate verbose printing 28 } 18 19 //============================================================================= 20 // Standard constructor, initializes variables 21 //============================================================================= 22 StoreCaloRecoChain::StoreCaloRecoChain( const std::string& name, 23 ISvcLocator* pSvcLocator ) : DaVinciAlgorithm ( name , pSvcLocator ) 24 , m_status(LHCb::CaloDigitStatus::UseForEnergy|LHCb::CaloDigitStatus::UseForPosition|LHCb::CaloDigitStatus::UseForCovariance){ 25 declareProperty("TESprefix" ,m_prefix="CaloReco/"); 26 declareProperty("UseStatusMask",m_mask=true); // true : only store the masked digits 27 declareProperty("Verbose" ,m_verb=false); // activate verbose printing 28 } 29 30 //============================================================================= 31 // Destructor 32 //============================================================================= 33 StoreCaloRecoChain::~StoreCaloRecoChain() {} 12 // 13 // 2016-12-06 : Olivier Deschamps 14 //----------------------------------------------------------------------------- 15 16 // Declaration of the Algorithm Factory 17 DECLARE_ALGORITHM_FACTORY( StoreCaloRecoChain ) 18 19 //============================================================================= 20 // Standard constructor, initializes variables 21 //============================================================================= 22 StoreCaloRecoChain::StoreCaloRecoChain( const std::string& name, 23 ISvcLocator* pSvcLocator ) : DaVinciAlgorithm ( name , pSvcLocator ) 24 , m_status(LHCb::CaloDigitStatus::UseForEnergy|LHCb::CaloDigitStatus::UseForPosition|LHCb::CaloDigitStatus::UseForCovariance){ 25 declareProperty("TESprefix" ,m_prefix="CaloReco/"); 26 declareProperty("UseStatusMask",m_mask=true); // true : only store the masked digits 27 declareProperty("Verbose" ,m_verb=false); // activate verbose printing 248 if( NULL != adcs->object( id ) )return false; 249 int adc = (m_ecal(d)) ? m_edata->adc( id , -255 ) : m_pdata->adc( id , 0 ); 250 if(m_ecal(d ))m_counter("Ecal ADC"); 251 if(m_prs(d ))m_counter("Prs ADC"); 252 LHCb::CaloAdc* pAdc = new LHCb::CaloAdc( id, adc ); 253 adcs->insert( pAdc ); 254 return true; 255 } 256 257 //============================================================================= 258 // Finalize 259 //============================================================================= 260 StatusCode StoreCaloRecoChain::finalize() { 261 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Finalize" << endmsg; 262 return DaVinciAlgorithm::finalize(); 263 }