CMS 3D CMS Logo

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

bool filter (edm::Event &, edm::EventSetup const &) override
 
 HLTMuonPointingFilter (const edm::ParameterSet &)
 Constructor. More...
 
 ~HLTMuonPointingFilter () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Attributes

unsigned long long m_cacheRecordId
 
Cylinder::CylinderPointer theCyl
 
const double theMaxZ
 
const unsigned int theMuonHits
 
Plane::PlanePointer theNegPlane
 
const unsigned int thePixHits
 
Plane::PlanePointer thePosPlane
 
PropagatorthePropagator
 
const std::string thePropagatorName
 
const double theRadius
 
const edm::EDGetTokenT< reco::TrackCollectiontheSTAMuonToken
 
const unsigned int theTkLayers
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Plane::build(), Cylinder::build(), edm::ParameterSet::getParameter(), LogDebug, theCyl, theMaxZ, theMuonHits, theNegPlane, thePixHits, thePosPlane, theRadius, theTkLayers, and ~HLTMuonPointingFilter().

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  thePixHits( pset.getParameter<unsigned int>("PixHits") ), // pixel hits
43  theTkLayers( pset.getParameter<unsigned int>("TkLayers") ), // tracker layers with measurements
44  theMuonHits( pset.getParameter<unsigned int>("MuonHits") ), // muon hits
45  thePropagator(nullptr),
47 {
48  // Get a surface (here a cylinder of radius 1290mm) ECAL
51  theCyl = Cylinder::build(theRadius, pos0, rot0);
52 
53  Plane::PositionType posPos(0,0,theMaxZ);
54  Plane::PositionType posNeg(0,0,-theMaxZ);
55 
56  thePosPlane = Plane::build(posPos,rot0);
57  theNegPlane = Plane::build(posNeg,rot0);
58 
59  LogDebug("HLTMuonPointing") << " SALabel : " << pset.getParameter<edm::InputTag>("SALabel")
60  << " Radius : " << theRadius
61  << " Half lenght : " << theMaxZ
62  << " Min pixel hits : " << thePixHits
63  << " Min tk layers measurements : " << theTkLayers
64  << " Min muon hits : " << theMuonHits;
65 
66 }
#define LogDebug(id)
T getParameter(std::string const &) const
const unsigned int thePixHits
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
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
const unsigned int theMuonHits
unsigned long long m_cacheRecordId
const edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken
const unsigned int theTkLayers
const std::string thePropagatorName
HLTMuonPointingFilter::~HLTMuonPointingFilter ( )
overridedefault

Destructor.

Referenced by HLTMuonPointingFilter().

Member Function Documentation

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

Definition at line 167 of file HLTMuonPointingFilter.cc.

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

167  {
169 
170  desc.add<edm::InputTag>("SALabel", edm::InputTag("hltCosmicMuonBarrelOnly"));
171  desc.add<std::string>("PropagatorName", "SteppingHelixPropagatorAny");
172  desc.add<double>("radius", 90.0);
173  desc.add<double>("maxZ", 280.0);
174  desc.add<unsigned int>("PixHits", 0);
175  desc.add<unsigned int>("TkLayers", 0);
176  desc.add<unsigned int>("MuonHits", 0);
177 
178  descriptions.add("hltMuonPointingFilter", desc);
179 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTMuonPointingFilter::filter ( edm::Event ,
edm::EventSetup const &   
)
overridevirtual

Implements edm::EDFilter.

Definition at line 72 of file HLTMuonPointingFilter.cc.

References accept(), anyDirection, edm::eventsetup::EventSetupRecord::cacheIdentifier(), Propagator::clone(), TrajectoryStateOnSurface::freeState(), edm::EventSetup::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::hitPattern(), reco::TransientTrack::innermostMeasurementState(), TrajectoryStateOnSurface::isValid(), LogDebug, m_cacheRecordId, reco::HitPattern::numberOfValidMuonHits(), reco::HitPattern::numberOfValidPixelHits(), or, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), NuclearInteractionSecond_cff::pixelHits, edm::ESHandle< T >::product(), Propagator::propagate(), Propagator::propagationDirection(), theCyl, theMaxZ, theMuonHits, theNegPlane, thePixHits, thePosPlane, thePropagator, thePropagatorName, theRadius, theSTAMuonToken, theTkLayers, HiIsolationCommonParameters_cff::track, reco::HitPattern::trackerLayersWithMeasurement(), and PV3DBase< T, PVType, FrameType >::z().

72  {
73  bool accept = false;
74 
75  const TrackingComponentsRecord & tkRec = eventSetup.get<TrackingComponentsRecord>();
76  if (not thePropagator or tkRec.cacheIdentifier() != m_cacheRecordId) {
77  // delete the old propagator
78  delete thePropagator;
79 
80  // get the new propagator from the EventSetup and clone it (for thread safety)
81  ESHandle<Propagator> propagatorHandle;
82  tkRec.get(thePropagatorName, propagatorHandle);
83  thePropagator = propagatorHandle.product()->clone();
85  throw cms::Exception("Configuration") << "the propagator " << thePropagatorName << " should be configured with PropagationDirection = \"anyDirection\"" << std::endl;
87  }
88 
89  ESHandle<MagneticField> theMGField;
90  eventSetup.get<IdealMagneticFieldRecord>().get(theMGField);
91 
92  ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
93  eventSetup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry);
94 
95  // Get the RecTrack collection from the event
97  event.getByToken(theSTAMuonToken, staTracks);
98 
99  reco::TrackCollection::const_iterator staTrack;
100 
101  for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
102  reco::TransientTrack track(*staTrack,&*theMGField,theTrackingGeometry);
103 
104  const reco::HitPattern& p = track.hitPattern();
105 
106  const unsigned int pixelHits = p.numberOfValidPixelHits();
107  const unsigned int trkLayers = p.trackerLayersWithMeasurement();
108  const unsigned int nMuonHits = p.numberOfValidMuonHits();
109 
110  TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState();
111 
112  LogDebug("HLTMuonPointing") << " InnerTSOS " << innerTSOS;
113 
114  TrajectoryStateOnSurface tsosAtCyl =
115  thePropagator->propagate(*innerTSOS.freeState(), *theCyl);
116 
117  if ( tsosAtCyl.isValid() ) {
118  LogDebug("HLTMuonPointing") << " extrap TSOS " << tsosAtCyl
119  << " number of pixel hits " << pixelHits
120  << " number of tracker layers with interactions " << trkLayers
121  << " number of muon hits " << nMuonHits;
122  if (fabs(tsosAtCyl.globalPosition().z())<theMaxZ ) {
123  if(pixelHits >= thePixHits){
124  if(trkLayers >= theTkLayers){
125  if(nMuonHits >= theMuonHits){
126  accept=true;
127  return accept;
128  }
129  }
130  }
131  }
132  else {
133  LogDebug("HLTMuonPointing") << " extrap TSOS z too big " << tsosAtCyl.globalPosition().z()
134  << " number of pixel hits " << pixelHits
135  << " number of tracker layers with interactions " << trkLayers
136  << " number of muon hits " << nMuonHits;
137  TrajectoryStateOnSurface tsosAtPlane;
138  if (tsosAtCyl.globalPosition().z()>0)
139  tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *thePosPlane);
140  else
141  tsosAtPlane=thePropagator->propagate(*innerTSOS.freeState(), *theNegPlane);
142 
143  if (tsosAtPlane.isValid()){
144  if (tsosAtPlane.globalPosition().perp()< theRadius){
145  if (pixelHits >= thePixHits){
146  if(trkLayers >= theTkLayers){
147  if(nMuonHits >= theMuonHits){
148  accept=true;
149  return accept;
150  }
151  }
152  }
153  }
154  }
155  else
156  LogDebug("HLTMuonPointing") << " extrap to plane failed ";
157  }
158  } else {
159  LogDebug("HLTMuonPointing") << " extrap to cyl failed ";
160  }
161 
162  }
163 
164  return accept;
165 }
#define LogDebug(id)
unsigned long long cacheIdentifier() const
virtual Propagator * clone() const =0
T perp() const
Definition: PV3DBase.h:72
const unsigned int thePixHits
Plane::PlanePointer thePosPlane
GlobalPoint globalPosition() const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:557
Plane::PlanePointer theNegPlane
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
Cylinder::CylinderPointer theCyl
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
const unsigned int theMuonHits
unsigned long long m_cacheRecordId
const edm::EDGetTokenT< reco::TrackCollection > theSTAMuonToken
const unsigned int theTkLayers
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
const std::string thePropagatorName
int numberOfValidPixelHits() const
Definition: HitPattern.h:916
int numberOfValidMuonHits() const
Definition: HitPattern.h:906
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

unsigned long long HLTMuonPointingFilter::m_cacheRecordId
private

Definition at line 60 of file HLTMuonPointingFilter.h.

Referenced by filter().

Cylinder::CylinderPointer HLTMuonPointingFilter::theCyl
private

Definition at line 56 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().

const unsigned int HLTMuonPointingFilter::theMuonHits
private

Definition at line 54 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Plane::PlanePointer HLTMuonPointingFilter::theNegPlane
private

Definition at line 57 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

const unsigned int HLTMuonPointingFilter::thePixHits
private

Definition at line 52 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Plane::PlanePointer HLTMuonPointingFilter::thePosPlane
private

Definition at line 57 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().

Propagator* HLTMuonPointingFilter::thePropagator
mutableprivate

Definition at line 59 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().

const unsigned int HLTMuonPointingFilter::theTkLayers
private

Definition at line 53 of file HLTMuonPointingFilter.h.

Referenced by filter(), and HLTMuonPointingFilter().