CMS 3D CMS Logo

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

#include <HLTRPCTrigNoSyncFilter.h>

Inheritance diagram for HLTRPCTrigNoSyncFilter:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 HLTRPCTrigNoSyncFilter (const edm::ParameterSet &)
 
 ~HLTRPCTrigNoSyncFilter ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag m_GMTInputTag
 
edm::InputTag rpcRecHitsLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 51 of file HLTRPCTrigNoSyncFilter.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file HLTRPCTrigNoSyncFilter.cc.

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

47  : HLTFilter(iConfig)
48 {
49  //now do what ever initialization is needed
50  m_GMTInputTag =iConfig.getParameter< edm::InputTag >("GMTInputTag");
51  rpcRecHitsLabel = iConfig.getParameter<edm::InputTag>("rpcRecHits");
52 }
T getParameter(std::string const &) const
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
HLTRPCTrigNoSyncFilter::~HLTRPCTrigNoSyncFilter ( )

Definition at line 55 of file HLTRPCTrigNoSyncFilter.cc.

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

Member Function Documentation

void HLTRPCTrigNoSyncFilter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 214 of file HLTRPCTrigNoSyncFilter.cc.

214  {
215 }
void HLTRPCTrigNoSyncFilter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 219 of file HLTRPCTrigNoSyncFilter.cc.

219  {
220 }
bool HLTRPCTrigNoSyncFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
privatevirtual

Implements HLTFilter.

Definition at line 67 of file HLTRPCTrigNoSyncFilter.cc.

References bigmag(), RPC4DHit::bx, configurableAnalysis::Candidate, eta(), edm::EventSetup::get(), edm::Event::getByLabel(), RPC4DHit::gp, RPC4DHit::id, edm::HandleBase::isValid(), gen::k, m_GMTInputTag, phi, point, RPCDetId, rpcRecHits_cfi::rpcRecHits, rpcRecHitsLabel, python.multivaluedict::sort(), GeomDet::surface(), and Surface::toGlobal().

67  {
68 
69  std::vector<RPC4DHit> GlobalRPC4DHits;
70  std::vector<RPC4DHit> GlobalRPC4DHitsNoBx0;
71 
73 
74  //std::cout <<"\t Getting the RPC RecHits"<<std::endl;
75 
76  iEvent.getByLabel(rpcRecHitsLabel,rpcRecHits);
77 
78  if(!rpcRecHits.isValid()){
79  //std::cout<<"no valid RPC Collection"<<std::endl;
80  //std::cout<<"event skipped"<<std::endl;
81  return false;
82  }
83  if(rpcRecHits->begin() == rpcRecHits->end()){
84  //std::cout<<"no RPC Hits in this event"<<std::endl;
85  //std::cout<<"event skipped"<<std::endl;
86  return false;
87  }
88 
90 
92  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
93 
94  int k = 0;
95 
96  for (recHit = rpcRecHits->begin(); recHit != rpcRecHits->end(); recHit++){
97  RPCDetId rollId = (RPCDetId)(*recHit).rpcId();
98  LocalPoint recHitPos=recHit->localPosition();
99  const RPCRoll* rollasociated = rpcGeo->roll(rollId);
100  const BoundPlane & RPCSurface = rollasociated->surface();
101  GlobalPoint RecHitInGlobal = RPCSurface.toGlobal(recHitPos);
102 
103  int BX = recHit->BunchX();
104  //std::cout<<"\t \t We have an RPC Rec Hit! bx="<<BX<<" Roll="<<rollId<<" Global Position="<<RecHitInGlobal<<std::endl;
105 
106  RPC4DHit ThisHit;
107  ThisHit.bx = BX;
108  ThisHit.gp = RecHitInGlobal;
109  ThisHit.id = k;
110  GlobalRPC4DHits.push_back(ThisHit);
111  if(BX!=0)GlobalRPC4DHitsNoBx0.push_back(ThisHit);
112  k++;
113  }
114 
115  if(GlobalRPC4DHitsNoBx0.size()==0){
116  //std::cout<<"all RPC Hits are syncrhonized"<<std::endl;
117  //std::cout<<"event skipped"<<std::endl;
118  return false;
119  }
120 
121  if(GlobalRPC4DHitsNoBx0.size()>100){
122  //std::cout<<"too many rpcHits preventing HLT eternal loop"<<std::endl;
123  //std::cout<<"event skipped"<<std::endl;
124  return false;
125  }
126 
128  iEvent.getByLabel(m_GMTInputTag,gmtrc_handle);
129 
130  std::vector<L1MuGMTExtendedCand> gmt_candidates = (*gmtrc_handle).getRecord().getGMTCands();
131 
132  std::vector<L1MuGMTExtendedCand>::const_iterator candidate;
133  //std::cout<<"The number of GMT Candidates in this event is "<<gmt_candidates.size()<<std::endl;
134 
135  if(gmt_candidates.size()==0){
136  //std::cout<<"event skipped no gmt candidates"<<std::endl;
137  return false;
138  }
139 
140  for(candidate=gmt_candidates.begin(); candidate!=gmt_candidates.end(); candidate++) {
141  int qual = candidate->quality();
142  //std::cout<<"quality of this GMT Candidate (should be >5)= "<<qual<<std::endl;
143  if(qual < 5) continue;
144  float eta=candidate->etaValue();
145  float phi=candidate->phiValue();
146 
147  //std::cout<<" phi="<<phi<<" eta="<<eta<<std::endl;
148 
149  //Creating container in this etaphi direction;
150 
151  std::vector<RPC4DHit> PointsForGMT;
152 
153  for(std::vector<RPC4DHit>::iterator Point = GlobalRPC4DHitsNoBx0.begin(); Point!=GlobalRPC4DHitsNoBx0.end(); ++Point){
154  float phiP = Point->gp.phi();
155  float etaP = Point->gp.eta();
156  //std::cout<<"\t \t GMT phi="<<phi<<" eta="<<eta<<std::endl;
157  //std::cout<<"\t \t Point phi="<<phiP<<" eta="<< etaP<<std::endl;
158  //std::cout<<"\t \t "<<fabs(phi-phiP)<<" < 0,1? "<<fabs(eta-etaP)<<" < 0.20 ?"<<std::endl;
159  if(fabs(phi-phiP) <=0.1 && fabs(eta-etaP)<=0.20){
160  PointsForGMT.push_back(*Point);
161  //std::cout<<"\t \t match!"<<std::endl;
162  }
163  }
164 
165  //std::cout<<"\t Points matching this GMT="<<PointsForGMT.size()<<std::endl;
166 
167  if(PointsForGMT.size()<1){
168  //std::cout<<"\t Not enough RPCRecHits not syncrhonized for this GMT!!!"<<std::endl;
169  continue;
170  }
171 
172  std::sort(PointsForGMT.begin(), PointsForGMT.end(), bigmag);
173 
174  //std::cout<<"GMT candidate phi="<<phi<<std::endl;
175  //std::cout<<"GMT candidate eta="<<eta<<std::endl;
176 
177  int lastbx=-7;
178  bool outOfTime = false;
179  bool incr = true;
180  bool anydifferentzero = true;
181  bool anydifferentone = true;
182 
183  //std::cout<<"\t \t loop on the RPCHit4D!!!"<<std::endl;
184  for(std::vector<RPC4DHit>::iterator point = PointsForGMT.begin(); point < PointsForGMT.end(); ++point) {
185  //float r=point->gp.mag();
186  outOfTime |= (point->bx!=0); //condition 1: at least one measurement must have BX!=0
187  incr &= (point->bx>=lastbx); //condition 2: BX must be increase when going inside-out.
188  anydifferentzero &= (!point->bx==0); //to check one knee withoutzeros
189  anydifferentone &= (!point->bx==1); //to check one knee withoutones
190  lastbx = point->bx;
191  //std::cout<<"\t \t r="<<r<<" phi="<<point->gp.phi()<<" eta="<<point->gp.eta()<<" bx="<<point->bx<<" outOfTime"<<outOfTime<<" incr"<<incr<<" anydifferentzero"<<anydifferentzero<<std::endl;
192  }
193  //std::cout<<"\t \t";
194 
195  //for(std::vector<RPC4DHit>::iterator point = PointsForGMT.begin(); point < PointsForGMT.end(); ++point) {
196  //std::cout<<point->bx;
197  //}
198  //std::cout<<std::endl;
199 
200  bool Candidate = (outOfTime&&incr);
201 
202  if(Candidate){
203  //std::cout<<" Event Passed We found an strange trigger Candidate phi="<<phi<<" eta="<<eta<<std::endl;
204  return true;
205  }
206  }
207 
208  //std::cout<<"event skipped rechits out of time but not related with a GMT "<<std::endl;
209  return false;
210 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
T eta() const
std::pair< double, double > Point
Definition: CaloEllipse.h:18
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
bool bigmag(const RPC4DHit &Point1, const RPC4DHit &Point2)
math::XYZPoint Point
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
int k[5][pyjets_maxn]
const T & get() const
Definition: EventSetup.h:55
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
*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
Definition: DDAxes.h:10

Member Data Documentation

edm::InputTag HLTRPCTrigNoSyncFilter::m_GMTInputTag
private

Definition at line 60 of file HLTRPCTrigNoSyncFilter.h.

Referenced by hltFilter(), and HLTRPCTrigNoSyncFilter().

edm::InputTag HLTRPCTrigNoSyncFilter::rpcRecHitsLabel
private

Definition at line 61 of file HLTRPCTrigNoSyncFilter.h.

Referenced by hltFilter(), and HLTRPCTrigNoSyncFilter().