From 18cb6089ed7b98d18b5a3babb40058a1f28e3569 Mon Sep 17 00:00:00 2001 From: Marco Zanetti Date: Mon, 5 Oct 2009 10:40:17 +0000 Subject: [PATCH] --- yaml --- r: 74718 b: "refs/heads/CMSSW_7_1_X" c: d4aa8aecaf0b3374aa37a33991d54d223e9df430 h: "refs/heads/CMSSW_7_1_X" v: v3 --- [refs] | 2 +- .../Cosmics/interface/HLTMuonPointingFilter.h | 47 ++++++++++--------- .../Cosmics/src/HLTMuonPointingFilter.cc | 14 ++++-- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/[refs] b/[refs] index aa50ccd92e9f9..41d68365e1c28 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": ca7391601f7acd5815191f0047cf9e620cde2746 +"refs/heads/CMSSW_7_1_X": d4aa8aecaf0b3374aa37a33991d54d223e9df430 diff --git a/trunk/EventFilter/Cosmics/interface/HLTMuonPointingFilter.h b/trunk/EventFilter/Cosmics/interface/HLTMuonPointingFilter.h index 419a712172894..f7f07cc3bdf7c 100644 --- a/trunk/EventFilter/Cosmics/interface/HLTMuonPointingFilter.h +++ b/trunk/EventFilter/Cosmics/interface/HLTMuonPointingFilter.h @@ -6,8 +6,8 @@ * HLTFilter to select muons that points to a cylinder of configurable radius * and lenght. * - * $Date: 2007/11/12 16:21:13 $ - * $Revision: 1.1 $ + * $Date: 2008/06/04 14:17:37 $ + * $Revision: 1.2 $ * \author Stefano Lacaprara - INFN Legnaro * */ @@ -29,28 +29,29 @@ class Propagator; class HLTMuonPointingFilter : public HLTFilter { - public: - -/// Constructor - HLTMuonPointingFilter(const edm::ParameterSet&) ; - -/// Destructor - ~HLTMuonPointingFilter() ; - -/* Operations */ - virtual bool filter(edm::Event&, const edm::EventSetup&); - - private: - std::string theSTAMuonLabel; // label of muons - std::string thePropagatorName; // name of propagator to be used +public: + + /// Constructor + HLTMuonPointingFilter(const edm::ParameterSet&) ; + + /// Destructor + ~HLTMuonPointingFilter() ; + + /* Operations */ + virtual bool filter(edm::Event&, const edm::EventSetup&); + +private: + std::string theSTAMuonLabel; // label of muons + std::string thePropagatorName; // name of propagator to be used double theRadius; // radius of cylinder - double theMaxZ; // half lenght of cylinder - - Cylinder::CylinderPointer theCyl; - Plane::PlanePointer thePosPlane,theNegPlane; - - mutable Propagator* thePropagator; - + double theMaxZ; // half lenght of cylinder + + Cylinder::CylinderPointer theCyl; + Plane::PlanePointer thePosPlane,theNegPlane; + + mutable Propagator* thePropagator; + unsigned long long m_cacheRecordId; + }; #endif // Muon_HLTMuonPointingFilter_h diff --git a/trunk/EventFilter/Cosmics/src/HLTMuonPointingFilter.cc b/trunk/EventFilter/Cosmics/src/HLTMuonPointingFilter.cc index e4360b27b3807..ee51472ec194d 100644 --- a/trunk/EventFilter/Cosmics/src/HLTMuonPointingFilter.cc +++ b/trunk/EventFilter/Cosmics/src/HLTMuonPointingFilter.cc @@ -1,7 +1,7 @@ /** \file * - * $Date: 2008/06/04 14:17:38 $ - * $Revision: 1.2 $ + * $Date: 2008/06/11 08:19:14 $ + * $Revision: 1.3 $ * \author Stefano Lacaprara - INFN Legnaro */ @@ -12,6 +12,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetupRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/TrackReco/interface/Track.h" @@ -33,7 +34,7 @@ using namespace edm; /* ====================================================================== */ /// Constructor -HLTMuonPointingFilter::HLTMuonPointingFilter(const edm::ParameterSet& pset) { +HLTMuonPointingFilter::HLTMuonPointingFilter(const edm::ParameterSet& pset): m_cacheRecordId(0) { // the name of the STA rec hits collection theSTAMuonLabel = pset.getParameter("SALabel"); @@ -68,11 +69,14 @@ HLTMuonPointingFilter::~HLTMuonPointingFilter() { /* Operations */ bool HLTMuonPointingFilter::filter(edm::Event& event, const edm::EventSetup& eventSetup) { bool accept = false; - if (!thePropagator){ + + const TrackingComponentsRecord & tkRec = eventSetup.get(); + if (not thePropagator or tkRec.cacheIdentifier() != m_cacheRecordId) { ESHandle prop; - eventSetup.get().get(thePropagatorName, prop); + tkRec.get(thePropagatorName, prop); thePropagator = prop->clone(); thePropagator->setPropagationDirection(anyDirection); + m_cacheRecordId = tkRec.cacheIdentifier(); } ESHandle theMGField;