![]() |
![]() |
#include <HLTMuonPointingFilter.h>
Public Member Functions | |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
HLTMuonPointingFilter (const edm::ParameterSet &) | |
Constructor. | |
~HLTMuonPointingFilter () | |
Destructor. | |
Private Attributes | |
unsigned long long | m_cacheRecordId |
Cylinder::CylinderPointer | theCyl |
double | theMaxZ |
Plane::PlanePointer | theNegPlane |
Plane::PlanePointer | thePosPlane |
Propagator * | thePropagator |
std::string | thePropagatorName |
double | theRadius |
std::string | theSTAMuonLabel |
HLTFilter to select muons that points to a cylinder of configurable radius and lenght.
Definition at line 30 of file HLTMuonPointingFilter.h.
HLTMuonPointingFilter::HLTMuonPointingFilter | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 37 of file HLTMuonPointingFilter.cc.
References newFWLiteAna::build, edm::ParameterSet::getParameter(), LogDebug, theCyl, theMaxZ, theNegPlane, thePosPlane, thePropagator, thePropagatorName, theRadius, and theSTAMuonLabel.
: m_cacheRecordId(0) { // the name of the STA rec hits collection theSTAMuonLabel = pset.getParameter<string>("SALabel"); thePropagatorName = pset.getParameter<std::string>("PropagatorName"); thePropagator = 0; theRadius = pset.getParameter<double>("radius"); // cyl's radius (cm) theMaxZ = pset.getParameter<double>("maxZ"); // cyl's half lenght (cm) // Get a surface (here a cylinder of radius 1290mm) ECAL Cylinder::PositionType pos0; Cylinder::RotationType rot0; theCyl = Cylinder::build(pos0, rot0, theRadius); Plane::PositionType posPos(0,0,theMaxZ); Plane::PositionType posNeg(0,0,-theMaxZ); thePosPlane = Plane::build(posPos,rot0); theNegPlane = Plane::build(posNeg,rot0); LogDebug("HLTMuonPointing") << " SALabel : " << theSTAMuonLabel << " Radius : " << theRadius << " Half lenght : " << theMaxZ; }
HLTMuonPointingFilter::~HLTMuonPointingFilter | ( | ) |
bool HLTMuonPointingFilter::filter | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Implements HLTFilter.
Definition at line 70 of file HLTMuonPointingFilter.cc.
References accept(), anyDirection, edm::eventsetup::EventSetupRecord::cacheIdentifier(), TrajectoryStateOnSurface::freeState(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::innermostMeasurementState(), TrajectoryStateOnSurface::isValid(), LogDebug, m_cacheRecordId, PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), Propagator::setPropagationDirection(), muonTagProbeFilters_cff::staTracks, theCyl, theMaxZ, theNegPlane, thePosPlane, thePropagator, thePropagatorName, theRadius, theSTAMuonLabel, and PV3DBase< T, PVType, FrameType >::z().
{ bool accept = false; const TrackingComponentsRecord & tkRec = eventSetup.get<TrackingComponentsRecord>(); if (not thePropagator or tkRec.cacheIdentifier() != m_cacheRecordId) { ESHandle<Propagator> prop; tkRec.get(thePropagatorName, prop); thePropagator = prop->clone(); thePropagator->setPropagationDirection(anyDirection); m_cacheRecordId = tkRec.cacheIdentifier(); } ESHandle<MagneticField> theMGField; eventSetup.get<IdealMagneticFieldRecord>().get(theMGField); ESHandle<GlobalTrackingGeometry> theTrackingGeometry; eventSetup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry); // Get the RecTrack collection from the event Handle<reco::TrackCollection> staTracks; event.getByLabel(theSTAMuonLabel, staTracks); reco::TrackCollection::const_iterator staTrack; for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){ reco::TransientTrack track(*staTrack,&*theMGField,theTrackingGeometry); TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState(); LogDebug("HLTMuonPointing") << " InnerTSOS " << innerTSOS; TrajectoryStateOnSurface tsosAtCyl = thePropagator->propagate(*innerTSOS.freeState(), *theCyl); if ( tsosAtCyl.isValid() ) { LogDebug("HLTMuonPointing") << " extrap TSOS " << tsosAtCyl; if (fabs(tsosAtCyl.globalPosition().z())<theMaxZ ) { accept=true; return accept; } else { LogDebug("HLTMuonPointing") << " extrap TSOS z too big " << tsosAtCyl.globalPosition().z(); TrajectoryStateOnSurface tsosAtPlane; if (tsosAtCyl.globalPosition().z()>0) tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *thePosPlane); else tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *theNegPlane); if (tsosAtPlane.isValid()){ if (tsosAtPlane.globalPosition().perp()< theRadius){ accept=true; return accept; } } else LogDebug("HLTMuonPointing") << " extrap to plane failed "; } } else { LogDebug("HLTMuonPointing") << " extrap to cyl failed "; } } return accept; }
unsigned long long HLTMuonPointingFilter::m_cacheRecordId [private] |
Definition at line 53 of file HLTMuonPointingFilter.h.
Referenced by filter().
Definition at line 49 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
double HLTMuonPointingFilter::theMaxZ [private] |
Definition at line 47 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
Definition at line 50 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
Definition at line 50 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
Propagator* HLTMuonPointingFilter::thePropagator [mutable, private] |
Definition at line 52 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
std::string HLTMuonPointingFilter::thePropagatorName [private] |
Definition at line 45 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
double HLTMuonPointingFilter::theRadius [private] |
Definition at line 46 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().
std::string HLTMuonPointingFilter::theSTAMuonLabel [private] |
Definition at line 44 of file HLTMuonPointingFilter.h.
Referenced by filter(), and HLTMuonPointingFilter().