2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 /// @author Nils Krumnack
8 #ifndef PATINTERFACES_CORRECTIONTOOL_ICC
9 #define PATINTERFACES_CORRECTIONTOOL_ICC
16 CorrectionCode CorrectionTool< T >::
17 correctedCopy( const xAODObjectType& inputObject,
18 xAODObjectType*& outputObject ) {
20 // Choose a smart pointer type according to the standard used:
21 std::unique_ptr< xAODObjectType > myobject( new xAODObjectType );
23 // Make a deep copy of the input object:
24 myobject->makePrivateStore( inputObject );
26 // Call the function implemented in the concrete tool:
27 CorrectionCode result = applyCorrection( *myobject );
28 if( result != CorrectionCode::Error ) {
29 outputObject = myobject.release();
36 CorrectionCode CorrectionTool< T >::
37 applyContainerCorrection( xAODContainerType& inputContainer ) {
39 // Loop over the container:
40 typename xAODContainerType::iterator itr = inputContainer.begin();
41 typename xAODContainerType::iterator end = inputContainer.end();
42 for( ; itr != end; ++itr ) {
43 // Apply the correction for this object:
44 CorrectionCode subresult = applyCorrection( **itr );
45 if( subresult == CorrectionCode::Error ) {
50 // We were successful:
51 return CorrectionCode::Ok;
56 #endif // PATINTERFACES_CORRECTIONTOOL_ICC