From c0e9b83cb69cf32cf6cbc0344d114b94995eed16 Mon Sep 17 00:00:00 2001
From: Elmar Ritsch <Elmar.Ritsch@cern.ch>
Date: Fri, 6 Mar 2015 16:57:56 +0100
Subject: [PATCH] migrate CaloClusterContainer type to
 xAOD::CaloClusterContainer (EventTagRawAlgs-00-02-00)

	* migrate CaloClusterContainer type to xAOD::CaloClusterContainer
        * tagging EventTagRawAlgs-00-02-00
---
 .../EventTag/EventTagRawAlgs/cmt/requirements |  9 ++--
 .../src/RawInfoSummaryForTagWriter.cxx        | 41 ++++++++-----------
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/PhysicsAnalysis/EventTag/EventTagRawAlgs/cmt/requirements b/PhysicsAnalysis/EventTag/EventTagRawAlgs/cmt/requirements
index e4bf405900a..41e81de23d6 100755
--- a/PhysicsAnalysis/EventTag/EventTagRawAlgs/cmt/requirements
+++ b/PhysicsAnalysis/EventTag/EventTagRawAlgs/cmt/requirements
@@ -13,19 +13,18 @@ use MagFieldInterfaces  MagFieldInterfaces-*    MagneticField
 private
 use StoreGate		StoreGate-*		Control
 use AtlasCLHEP		AtlasCLHEP-*		External
+use xAODCaloEvent	xAODCaloEvent-*		Event/xAOD
 use CaloEvent		CaloEvent-*		Calorimeter
 use CommissionEvent	CommissionEvent-*	Commission
 use InDetBCM_RawData	InDetBCM_RawData-*	InnerDetector/InDetRawEvent
 use InDetPrepRawData	InDetPrepRawData-*	InnerDetector/InDetRecEvent
 use LArRecEvent		LArRecEvent-*		LArCalorimeter
-use Particle		Particle-*		Reconstruction
+use TrkTrackSummary	TrkTrackSummary-*	Tracking/TrkEvent
 use TagEvent		TagEvent-*		PhysicsAnalysis/EventTag
 use TileEvent		TileEvent-*		TileCalorimeter
 use TileIdentifier	TileIdentifier-*	TileCalorimeter
-use TrkMeasurementBase	TrkMeasurementBase-*	Tracking/TrkEvent
 use TrkSpacePoint	TrkSpacePoint-*		Tracking/TrkEvent 
 use TrkTrack            TrkTrack-*		Tracking/TrkEvent
-use VxVertex		VxVertex-*		Tracking/TrkEvent
 
 
 library EventTagRawAlgs *.cxx -s=components *.cxx
@@ -33,3 +32,7 @@ apply_pattern component_library
 
 apply_pattern declare_joboptions files="*.py"
 
+# use the following lines to compile this package with debug symbols
+#private
+#macro cppdebugflags '$(cppdebugflags_s)'
+#macro_remove componentshr_linkopts "-Wl,-s"
diff --git a/PhysicsAnalysis/EventTag/EventTagRawAlgs/src/RawInfoSummaryForTagWriter.cxx b/PhysicsAnalysis/EventTag/EventTagRawAlgs/src/RawInfoSummaryForTagWriter.cxx
index cb9952f3543..26f3810510e 100644
--- a/PhysicsAnalysis/EventTag/EventTagRawAlgs/src/RawInfoSummaryForTagWriter.cxx
+++ b/PhysicsAnalysis/EventTag/EventTagRawAlgs/src/RawInfoSummaryForTagWriter.cxx
@@ -18,33 +18,25 @@
 
 #include "TrkTrack/Track.h"
 #include "TrkTrack/TrackCollection.h"
-#include "Particle/TrackParticle.h"
-#include "Particle/TrackParticleContainer.h"
-#include "TrkSegment/SegmentCollection.h"
+#include "TrkTrackSummary/TrackSummary.h"
 #include "CommissionEvent/ComTime.h" 
-#include "TileEvent/TileContainer.h"
 #include "CaloEvent/CaloCellContainer.h"
-#include "CaloEvent/CaloClusterContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
 #include "InDetPrepRawData/TRT_DriftCircle.h"
 #include "TrkSpacePoint/SpacePointContainer.h" 
-#include "TrkTrack/TrackStateOnSurface.h"
-#include "TrkMeasurementBase/MeasurementBase.h"
 #include "InDetBCM_RawData/BCM_RDO_Container.h"
 
-#include "TileIdentifier/TileTBID.h"
-#include "TileEvent/TileContainer.h"
+#include "TileEvent/TileCellContainer.h"
 #include "TileEvent/MBTSCollisionTime.h"
 
 #include "EventTagRawAlgs/RawInfoSummaryForTagWriter.h"
+#include "TileIdentifier/TileTBID.h"
 
 #include <algorithm>
 
 #include "LArRecEvent/LArCollisionTime.h"
 
-#include "VxVertex/VxContainer.h"
-#include "VxVertex/VxCandidate.h"
-
 //----------------------------------------------------------------
 
 RawInfoSummaryForTagWriter::RawInfoSummaryForTagWriter(const std::string& name,
@@ -53,11 +45,10 @@ RawInfoSummaryForTagWriter::RawInfoSummaryForTagWriter(const std::string& name,
   m_doTileMuonFitter(true),
   m_fieldServiceHandle("AtlasFieldSvc",name)
 {
-  declareProperty("IDTrackKey",m_sgKeyIDtrack);  
+  declareProperty("IDTrackKey",m_sgKeyIDtrack);
   declareProperty("doClusterSums",m_doClusterSums=true);
   declareProperty("TRT_DriftCircleContainerName", m_TRT_DriftCircleName="TRT_DriftCircles");
   declareProperty("MBTS_Threshold",  m_mbts_threshold = 40.0/222.0 );  // Value in pC
-  declareProperty("vertexCollectionName", m_vertexCollectionName="VxPrimaryCandidate");
   declareProperty("MagFieldSvc"        , m_fieldServiceHandle);
 }
 
@@ -115,7 +106,7 @@ StatusCode RawInfoSummaryForTagWriter::execute()
  
 
   ATH_MSG_DEBUG("making RawInfoSummaryForTag object ");
-   RawInfoSummaryForTag* RISFTobject = new RawInfoSummaryForTag();
+  RawInfoSummaryForTag* RISFTobject = new RawInfoSummaryForTag();
 
 
    ///////////////////////////////////////////////////////////////
@@ -299,7 +290,7 @@ StatusCode RawInfoSummaryForTagWriter::execute()
         CellEx += energy*(cell->cosPhi())*(cell->sinTh());
         CellEy += energy*(cell->sinPhi())*(cell->sinTh());
 
-        // sum per subcalo
+       // sum per subcalo
        unsigned int iCaloNum = static_cast<unsigned int>(cell->caloDDE()->getSubCalo()); 
        if (iCaloNum==CaloCell_ID::LAREM) {
           int inum = cell->caloDDE()->getSampling();
@@ -319,21 +310,21 @@ StatusCode RawInfoSummaryForTagWriter::execute()
 
     // clusters crashes if Tile=False so protect with a JO switch
     if(m_doClusterSums){
-      const CaloClusterContainer* cluster_container;
+      const xAOD::CaloClusterContainer* cluster_container;
       std::string m_clustersContName="CaloTopoCluster";
       //Retrieve Cluster collection from SG
-      if ( m_storeGate->contains<CaloClusterContainer>(m_clustersContName)){
+      if ( m_storeGate->contains<xAOD::CaloClusterContainer>(m_clustersContName)){
         sc = m_storeGate->retrieve(cluster_container, m_clustersContName);
-	CaloClusterContainer::const_iterator iCluster = cluster_container->begin();
-	CaloClusterContainer::const_iterator lastCluster  = cluster_container->end();
+        xAOD::CaloClusterContainer::const_iterator iCluster = cluster_container->begin();
+        xAOD::CaloClusterContainer::const_iterator lastCluster  = cluster_container->end();
         for( ; iCluster != lastCluster; ++iCluster) {
-          float energy = (*iCluster)->energy();
+          float energy = (*iCluster)->e();
           totClusterEne += energy;
           if (std::fabs(energy) > clusE1) {
-	    clusE1=energy;
-	    clusEta1=(*iCluster)->eta();
-	    clusPhi1=(*iCluster)->phi();
-	    clusEt1 = (*iCluster)->et();
+            clusE1=energy;
+            clusEta1=(*iCluster)->eta();
+            clusPhi1=(*iCluster)->phi();
+            clusEt1 = (*iCluster)->et();
           }
         }
       }
-- 
GitLab