CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HLTRPCTrigNoSyncFilter Class Reference

#include <HLTRPCTrigNoSyncFilter.h>

Inheritance diagram for HLTRPCTrigNoSyncFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTRPCTrigNoSyncFilter (const edm::ParameterSet &)
 
 ~HLTRPCTrigNoSyncFilter () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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 HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 

Private Attributes

edm::InputTag m_GMTInputTag
 
edm::EDGetTokenT< L1MuGMTReadoutCollectionm_GMTInputToken
 
edm::InputTag rpcRecHitsLabel
 
edm::EDGetTokenT< RPCRecHitCollectionrpcRecHitsToken
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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

Definition at line 54 of file HLTRPCTrigNoSyncFilter.h.

Constructor & Destructor Documentation

HLTRPCTrigNoSyncFilter::HLTRPCTrigNoSyncFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file HLTRPCTrigNoSyncFilter.cc.

References edm::ParameterSet::getParameter(), m_GMTInputTag, m_GMTInputToken, rpcRecHitsLabel, and rpcRecHitsToken.

46  : HLTFilter(iConfig)
47 {
48  //now do what ever initialization is needed
49  m_GMTInputTag =iConfig.getParameter< edm::InputTag >("GMTInputTag");
50  rpcRecHitsLabel = iConfig.getParameter<edm::InputTag>("rpcRecHits");
51  m_GMTInputToken = consumes<L1MuGMTReadoutCollection>(m_GMTInputTag);
52  rpcRecHitsToken = consumes<RPCRecHitCollection>(rpcRecHitsLabel);
53 
54 }
T getParameter(std::string const &) const
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsToken
edm::EDGetTokenT< L1MuGMTReadoutCollection > m_GMTInputToken
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTRPCTrigNoSyncFilter::~HLTRPCTrigNoSyncFilter ( )
override

Definition at line 57 of file HLTRPCTrigNoSyncFilter.cc.

58 {
59  // do anything here that needs to be done at desctruction time
60  // (e.g. close files, deallocate resources etc.)
61 }

Member Function Documentation

void HLTRPCTrigNoSyncFilter::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDFilterBase.

Definition at line 219 of file HLTRPCTrigNoSyncFilter.cc.

219  {
220 }
void HLTRPCTrigNoSyncFilter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDFilterBase.

Definition at line 224 of file HLTRPCTrigNoSyncFilter.cc.

References DEFINE_FWK_MODULE.

224  {
225 }
void HLTRPCTrigNoSyncFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 64 of file HLTRPCTrigNoSyncFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLTFilter::makeHLTFilterDescription().

64  {
67  desc.add<edm::InputTag>("GMTInputTag",edm::InputTag("hltGtDigis"));
68  desc.add<edm::InputTag>("rpcRecHits",edm::InputTag("hltRpcRecHits"));
69  descriptions.add("hltRPCTrigNoSyncFilter",desc);
70 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTRPCTrigNoSyncFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overrideprivatevirtual

Implements HLTFilter.

Definition at line 77 of file HLTRPCTrigNoSyncFilter.cc.

References bigmag(), rpcdqm::BX, RPC4DHit::bx, configurableAnalysis::Candidate, PVValHelper::eta, edm::EventSetup::get(), edm::Event::getByToken(), RPC4DHit::gp, RPC4DHit::id, edm::HandleBase::isValid(), gen::k, m_GMTInputToken, phi, point, rpcPointValidation_cfi::recHit, RPCGeometry::roll(), JetIDParams_cfi::rpcRecHits, rpcRecHitsToken, jetUpdater_cfi::sort, and GeomDet::surface().

77  {
78 
79  std::vector<RPC4DHit> GlobalRPC4DHits;
80  std::vector<RPC4DHit> GlobalRPC4DHitsNoBx0;
81 
83 
84  //std::cout <<"\t Getting the RPC RecHits"<<std::endl;
85 
86  iEvent.getByToken(rpcRecHitsToken,rpcRecHits);
87 
88  if(!rpcRecHits.isValid()){
89  //std::cout<<"no valid RPC Collection"<<std::endl;
90  //std::cout<<"event skipped"<<std::endl;
91  return false;
92  }
93  if(rpcRecHits->begin() == rpcRecHits->end()){
94  //std::cout<<"no RPC Hits in this event"<<std::endl;
95  //std::cout<<"event skipped"<<std::endl;
96  return false;
97  }
98 
100 
102  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
103 
104  int k = 0;
105 
106  for (recHit = rpcRecHits->begin(); recHit != rpcRecHits->end(); recHit++){
107  RPCDetId rollId = (RPCDetId)(*recHit).rpcId();
108  LocalPoint recHitPos=recHit->localPosition();
109  const RPCRoll* rollasociated = rpcGeo->roll(rollId);
110  const BoundPlane & RPCSurface = rollasociated->surface();
111  GlobalPoint RecHitInGlobal = RPCSurface.toGlobal(recHitPos);
112 
113  int BX = recHit->BunchX();
114  //std::cout<<"\t \t We have an RPC Rec Hit! bx="<<BX<<" Roll="<<rollId<<" Global Position="<<RecHitInGlobal<<std::endl;
115 
116  RPC4DHit ThisHit;
117  ThisHit.bx = BX;
118  ThisHit.gp = RecHitInGlobal;
119  ThisHit.id = k;
120  GlobalRPC4DHits.push_back(ThisHit);
121  if(BX!=0)GlobalRPC4DHitsNoBx0.push_back(ThisHit);
122  k++;
123  }
124 
125  if(GlobalRPC4DHitsNoBx0.empty()){
126  //std::cout<<"all RPC Hits are syncrhonized"<<std::endl;
127  //std::cout<<"event skipped"<<std::endl;
128  return false;
129  }
130 
131  if(GlobalRPC4DHitsNoBx0.size()>100){
132  //std::cout<<"too many rpcHits preventing HLT eternal loop"<<std::endl;
133  //std::cout<<"event skipped"<<std::endl;
134  return false;
135  }
136 
138  iEvent.getByToken(m_GMTInputToken,gmtrc_handle);
139 
140  std::vector<L1MuGMTExtendedCand> gmt_candidates = (*gmtrc_handle).getRecord().getGMTCands();
141 
142  std::vector<L1MuGMTExtendedCand>::const_iterator candidate;
143  //std::cout<<"The number of GMT Candidates in this event is "<<gmt_candidates.size()<<std::endl;
144 
145  if(gmt_candidates.empty()){
146  //std::cout<<"event skipped no gmt candidates"<<std::endl;
147  return false;
148  }
149 
150  for(candidate=gmt_candidates.begin(); candidate!=gmt_candidates.end(); candidate++) {
151  int qual = candidate->quality();
152  //std::cout<<"quality of this GMT Candidate (should be >5)= "<<qual<<std::endl;
153  if(qual < 5) continue;
154  float eta=candidate->etaValue();
155  float phi=candidate->phiValue();
156 
157  //std::cout<<" phi="<<phi<<" eta="<<eta<<std::endl;
158 
159  //Creating container in this etaphi direction;
160 
161  std::vector<RPC4DHit> PointsForGMT;
162 
163  for(auto & Point : GlobalRPC4DHitsNoBx0){
164  float phiP = Point.gp.phi();
165  float etaP = Point.gp.eta();
166  //std::cout<<"\t \t GMT phi="<<phi<<" eta="<<eta<<std::endl;
167  //std::cout<<"\t \t Point phi="<<phiP<<" eta="<< etaP<<std::endl;
168  //std::cout<<"\t \t "<<fabs(phi-phiP)<<" < 0,1? "<<fabs(eta-etaP)<<" < 0.20 ?"<<std::endl;
169  if(fabs(phi-phiP) <=0.1 && fabs(eta-etaP)<=0.20){
170  PointsForGMT.push_back(Point);
171  //std::cout<<"\t \t match!"<<std::endl;
172  }
173  }
174 
175  //std::cout<<"\t Points matching this GMT="<<PointsForGMT.size()<<std::endl;
176 
177  if(PointsForGMT.empty()){
178  //std::cout<<"\t Not enough RPCRecHits not syncrhonized for this GMT!!!"<<std::endl;
179  continue;
180  }
181 
182  std::sort(PointsForGMT.begin(), PointsForGMT.end(), bigmag);
183 
184  //std::cout<<"GMT candidate phi="<<phi<<std::endl;
185  //std::cout<<"GMT candidate eta="<<eta<<std::endl;
186 
187  int lastbx=-7;
188  bool outOfTime = false;
189  bool incr = true;
190 
191  //std::cout<<"\t \t loop on the RPCHit4D!!!"<<std::endl;
192  for(auto point = PointsForGMT.begin(); point < PointsForGMT.end(); ++point) {
193  //float r=point->gp.mag();
194  outOfTime |= (point->bx!=0); //condition 1: at least one measurement must have BX!=0
195  incr &= (point->bx>=lastbx); //condition 2: BX must be increase when going inside-out.
196  lastbx = point->bx;
197  }
198  //std::cout<<"\t \t";
199 
200  //for(std::vector<RPC4DHit>::iterator point = PointsForGMT.begin(); point < PointsForGMT.end(); ++point) {
201  //std::cout<<point->bx;
202  //}
203  //std::cout<<std::endl;
204 
205  bool Candidate = (outOfTime&&incr);
206 
207  if(Candidate){
208  //std::cout<<" Event Passed We found an strange trigger Candidate phi="<<phi<<" eta="<<eta<<std::endl;
209  return true;
210  }
211  }
212 
213  //std::cout<<"event skipped rechits out of time but not related with a GMT "<<std::endl;
214  return false;
215 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsToken
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
edm::EDGetTokenT< L1MuGMTReadoutCollection > m_GMTInputToken
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
bool bigmag(const RPC4DHit &Point1, const RPC4DHit &Point2)
bool isValid() const
Definition: HandleBase.h:74
int k[5][pyjets_maxn]
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
T get() const
Definition: EventSetup.h:71
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75

Member Data Documentation

edm::InputTag HLTRPCTrigNoSyncFilter::m_GMTInputTag
private

Definition at line 64 of file HLTRPCTrigNoSyncFilter.h.

Referenced by HLTRPCTrigNoSyncFilter().

edm::EDGetTokenT<L1MuGMTReadoutCollection> HLTRPCTrigNoSyncFilter::m_GMTInputToken
private

Definition at line 66 of file HLTRPCTrigNoSyncFilter.h.

Referenced by hltFilter(), and HLTRPCTrigNoSyncFilter().

edm::InputTag HLTRPCTrigNoSyncFilter::rpcRecHitsLabel
private

Definition at line 65 of file HLTRPCTrigNoSyncFilter.h.

Referenced by HLTRPCTrigNoSyncFilter().

edm::EDGetTokenT<RPCRecHitCollection> HLTRPCTrigNoSyncFilter::rpcRecHitsToken
private

Definition at line 67 of file HLTRPCTrigNoSyncFilter.h.

Referenced by hltFilter(), and HLTRPCTrigNoSyncFilter().