CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTMuonPointingFilter Class Reference

#include <HLTMuonPointingFilter.h>

Inheritance diagram for HLTMuonPointingFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, edm::EventSetup const &) override
 
 HLTMuonPointingFilter (const edm::ParameterSet &)
 Constructor. More...
 
 ~HLTMuonPointingFilter ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

unsigned long long m_cacheRecordId
 
Cylinder::CylinderPointer theCyl
 
const double theMaxZ
 
Plane::PlanePointer theNegPlane
 
Plane::PlanePointer thePosPlane
 
PropagatorthePropagator
 
const std::string thePropagatorName
 
const double theRadius
 
const edm::EDGetTokenT
< reco::TrackCollection
theSTAMuonToken
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

EDFilter to select muons that points to a cylinder of configurable radius and lenght.

Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t

Definition at line 32 of file HLTMuonPointingFilter.h.

Constructor & Destructor Documentation

HLTMuonPointingFilter::HLTMuonPointingFilter ( const edm::ParameterSet pset)

Constructor.

Definition at line 37 of file HLTMuonPointingFilter.cc.

References Cylinder::build(), newFWLiteAna::build, edm::ParameterSet::getParameter(), LogDebug, theCyl, theMaxZ, theNegPlane, thePosPlane, and theRadius.

37  :
38  theSTAMuonToken( consumes<reco::TrackCollection>( pset.getParameter<edm::InputTag>("SALabel") ) ), // token to read the muons
39  thePropagatorName(pset.getParameter<std::string>("PropagatorName") ),
40  theRadius( pset.getParameter<double>("radius") ), // cyl's radius (cm)
41  theMaxZ( pset.getParameter<double>("maxZ") ), // cyl's half lenght (cm)
42  thePropagator(nullptr),
44 {
45  // Get a surface (here a cylinder of radius 1290mm) ECAL
48  theCyl = Cylinder::build(theRadius, pos0, rot0);
49 
50  Plane::PositionType posPos(0,0,theMaxZ);
51  Plane::PositionType posNeg(0,0,-theMaxZ);
52 
53  thePosPlane = Plane::build(posPos,rot0);
54  theNegPlane = Plane::build(posNeg,rot0);
55 
56  LogDebug("HLTMuonPointing") << " SALabel : " << pset.getParameter<edm::InputTag>("SALabel")
57  << " Radius : " << theRadius
58  << " Half lenght : " << theMaxZ;
59 }
#define LogDebug(id)
T getParameter(std::string const &) const
Plane::PlanePointer thePosPlane
Plane::PlanePointer theNegPlane
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
Cylinder::CylinderPointer theCyl
unsigned long long m_cacheRecordId
const edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken
const std::string thePropagatorName
HLTMuonPointingFilter::~HLTMuonPointingFilter ( )

Destructor.

Definition at line 62 of file HLTMuonPointingFilter.cc.

62  {
63 }

Member Function Documentation

void HLTMuonPointingFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 137 of file HLTMuonPointingFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns14e33_v1_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

137  {
139 
140  desc.add<edm::InputTag>("SALabel", edm::InputTag("hltCosmicMuonBarrelOnly"));
141  desc.add<std::string>("PropagatorName", "SteppingHelixPropagatorAny");
142  desc.add<double>("radius", 90.0);
143  desc.add<double>("maxZ", 280.0);
144 
145  descriptions.add("hltMuonPointingFilter", desc);
146 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTMuonPointingFilter::filter ( edm::Event event,
edm::EventSetup const &  eventSetup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 66 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, or, PV3DBase< T, PVType, FrameType >::perp(), edm::ESHandle< class >::product(), Propagator::propagate(), Propagator::propagationDirection(), muonTagProbeFilters_cff::staTracks, theCyl, theMaxZ, theNegPlane, thePosPlane, thePropagator, thePropagatorName, theRadius, theSTAMuonToken, and PV3DBase< T, PVType, FrameType >::z().

66  {
67  bool accept = false;
68 
69  const TrackingComponentsRecord & tkRec = eventSetup.get<TrackingComponentsRecord>();
70  if (not thePropagator or tkRec.cacheIdentifier() != m_cacheRecordId) {
71  // delete the old propagator
72  delete thePropagator;
73 
74  // get the new propagator from the EventSetup and clone it (for thread safety)
75  ESHandle<Propagator> propagatorHandle;
76  tkRec.get(thePropagatorName, propagatorHandle);
77  thePropagator = propagatorHandle.product()->clone();
79  throw cms::Exception("Configuration") << "the propagator " << thePropagatorName << " should be configured with PropagationDirection = \"anyDirection\"" << std::endl;
81  }
82 
83  ESHandle<MagneticField> theMGField;
84  eventSetup.get<IdealMagneticFieldRecord>().get(theMGField);
85 
86  ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
87  eventSetup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry);
88 
89  // Get the RecTrack collection from the event
91  event.getByToken(theSTAMuonToken, staTracks);
92 
93  reco::TrackCollection::const_iterator staTrack;
94 
95  for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
96  reco::TransientTrack track(*staTrack,&*theMGField,theTrackingGeometry);
97 
98  TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState();
99 
100  LogDebug("HLTMuonPointing") << " InnerTSOS " << innerTSOS;
101 
102  TrajectoryStateOnSurface tsosAtCyl =
103  thePropagator->propagate(*innerTSOS.freeState(), *theCyl);
104 
105  if ( tsosAtCyl.isValid() ) {
106  LogDebug("HLTMuonPointing") << " extrap TSOS " << tsosAtCyl;
107  if (fabs(tsosAtCyl.globalPosition().z())<theMaxZ ) {
108  accept=true;
109  return accept;
110  }
111  else {
112  LogDebug("HLTMuonPointing") << " extrap TSOS z too big " << tsosAtCyl.globalPosition().z();
113  TrajectoryStateOnSurface tsosAtPlane;
114  if (tsosAtCyl.globalPosition().z()>0)
115  tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *thePosPlane);
116  else
117  tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *theNegPlane);
118 
119  if (tsosAtPlane.isValid()){
120  if (tsosAtPlane.globalPosition().perp()< theRadius){
121  accept=true;
122  return accept;
123  }
124  }
125  else
126  LogDebug("HLTMuonPointing") << " extrap to plane failed ";
127  }
128  } else {
129  LogDebug("HLTMuonPointing") << " extrap to cyl failed ";
130  }
131 
132  }
133 
134  return accept;
135 }
#define LogDebug(id)
unsigned long long cacheIdentifier() const
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
T perp() const
Definition: PV3DBase.h:72
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:155
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Plane::PlanePointer thePosPlane
GlobalPoint globalPosition() const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:24
Plane::PlanePointer theNegPlane
Cylinder::CylinderPointer theCyl
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
void get(HolderT &iHolder) const
unsigned long long m_cacheRecordId
const edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken
T const * product() const
Definition: ESHandle.h:86
const std::string thePropagatorName

Member Data Documentation

unsigned long long HLTMuonPointingFilter::m_cacheRecordId
private

Definition at line 57 of file HLTMuonPointingFilter.h.

Referenced by filter().

Cylinder::CylinderPointer HLTMuonPointingFilter::theCyl
private

Definition at line 53 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

const double HLTMuonPointingFilter::theMaxZ
private

Definition at line 51 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Plane::PlanePointer HLTMuonPointingFilter::theNegPlane
private

Definition at line 54 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Plane::PlanePointer HLTMuonPointingFilter::thePosPlane
private

Definition at line 54 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Propagator* HLTMuonPointingFilter::thePropagator
mutableprivate

Definition at line 56 of file HLTMuonPointingFilter.h.

Referenced by filter().

const std::string HLTMuonPointingFilter::thePropagatorName
private

Definition at line 49 of file HLTMuonPointingFilter.h.

Referenced by filter().

const double HLTMuonPointingFilter::theRadius
private

Definition at line 50 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

const edm::EDGetTokenT<reco::TrackCollection> HLTMuonPointingFilter::theSTAMuonToken
private

Definition at line 48 of file HLTMuonPointingFilter.h.

Referenced by filter().