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 Attributes
TracktoRPC Class Reference

#include <TracktoRPC.h>

Public Member Functions

RPCRecHitCollectionthePoints ()
 
 TracktoRPC (edm::Handle< reco::TrackCollection > alltracks, const edm::EventSetup &iSetup, const edm::Event &iEvent, bool debug, const edm::ParameterSet &iConfig, edm::InputTag &tracklabel)
 
bool ValidRPCSurface (RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup)
 
 ~TracktoRPC ()
 

Private Attributes

RPCRecHitCollection_ThePoints
 
double MaxD
 
edm::OwnVector< RPCRecHitRPCPointVector
 
edm::ESHandle< PropagatorthePropagator
 
TrackTransformerBasetheTrackTransformer
 

Detailed Description

Definition at line 61 of file TracktoRPC.h.

Constructor & Destructor Documentation

TracktoRPC::TracktoRPC ( edm::Handle< reco::TrackCollection alltracks,
const edm::EventSetup iSetup,
const edm::Event iEvent,
bool  debug,
const edm::ParameterSet iConfig,
edm::InputTag tracklabel 
)
explicit

Definition at line 151 of file TracktoRPC.cc.

References _ThePoints, edm::OwnVector< T, P >::begin(), CastorDataFrameFilter_impl::check(), edm::OwnVector< T, P >::clear(), gather_cfg::cout, MuonSubdetId::CSC, MuonSubdetId::DT, edm::OwnVector< T, P >::end(), CSCDetId::endcap(), GeomDet::geographicalId(), edm::EventSetup::get(), ObjectMap2::GetInstance(), ObjectMap2CSC::GetInstance(), ObjectMap2::GetRolls(), ObjectMap2CSC::GetRolls(), TrajectoryStateOnSurface::globalPosition(), RPCRoll::id(), TrajectoryStateOnSurface::isValid(), edm::InputTag::label(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), TrajectoryStateOnSurface::localPosition(), MaxD, DetId::Muon, RPCGeomServ::name(), RPCRoll::nstrips(), edm::OwnVector< T, P >::push_back(), DetId::rawId(), RPCDetId::region(), RPCDetId::ring(), RPCPointVector, DTChamberId::sector(), RPCDetId::sector(), RPCGeomServ::segment(), TrackTransformerBase::setServices(), mathSSE::sqrt(), RPCDetId::station(), RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), GeomDet::surface(), cond::rpcobtemp::temp, thePropagator, theTrackTransformer, Surface::toGlobal(), RPCRoll::topology(), TrackTransformerBase::transform(), ValidRPCSurface(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

151  {
152 
154 // if(alltracks->empty()) return;
155 
156  if(tracklabel.label().find("cosmic")==0) theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig);
157  else if(tracklabel.label().find("globalCosmic")==0) theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig);
158  else theTrackTransformer = new TrackTransformer(iConfig);
160 
164 
165  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny",thePropagator);
166  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
167  iSetup.get<MuonGeometryRecord>().get(dtGeo);
168  iSetup.get<MuonGeometryRecord>().get(cscGeo);
169 
170 std::vector<uint32_t> rpcput;
171 double MaxD=999.;
172 
173 for (TrackCollection::const_iterator track = alltracks->begin(); track !=alltracks->end(); track++)
174 {
175  Trajectories trajectories = theTrackTransformer->transform(*track);
176  if(debug) std::cout << "Building Trajectory from Track. " << std::endl;
177 
178  std::vector<uint32_t> rpcrolls;
179  std::vector<uint32_t> rpcrolls2;
180  std::map<uint32_t, int> rpcNdtcsc;
181  std::map<uint32_t, int> rpcrollCounter;
182 
183  float tInX = track->innerPosition().X(), tInY = track->innerPosition().Y(), tInZ = track->innerPosition().Z();
184  float tOuX = track->outerPosition().X(), tOuY = track->outerPosition().Y(), tOuZ = track->outerPosition().Z();
185  if(tInX > tOuX) { float temp=tOuX; tOuX=tInX; tInX=temp; }
186  if(tInY > tOuY) { float temp=tOuY; tOuY=tInY; tInY=temp; }
187  if(tInZ > tOuZ) { float temp=tOuZ; tOuZ=tInZ; tInZ=temp; }
188 
189  if(debug) std::cout << "in (x,y,z): ("<< tInX <<", "<< tInY <<", "<< tInZ << ")" << std::endl;
190  if(debug) std::cout << "out (x,y,z): ("<< tOuX <<", "<< tOuY <<", "<< tOuZ << ")" << std::endl;
191 
192 if(debug) std::cout << "1. Search expeted RPC roll detid !!" << std::endl;
193 for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
194  {
195  if((*hit)->isValid())
196  {
197  DetId id = (*hit)->geographicalId();
198 
199  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
200  {
201  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
202  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
203  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
204  {
205  const BoundPlane & DTSurface = dtlayer->surface();
206  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
207 
208  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
209  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
210  if(upd2.isValid())
211  {
212  LocalPoint trajLP = upd2.localPosition();
213  LocalPoint trackLP = (*hit)->localPosition();
214  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
215  if( dx>10. && dy>10.) continue;
216 
217  DTChamberId dtid(geomDet->geographicalId().rawId());
218  int dtW=dtid.wheel(), dtS=dtid.sector(), dtT=dtid.station();
219  if(dtS==13) dtS=4; if(dtS==14) dtS=10;
220  ObjectMap2* TheObject = ObjectMap2::GetInstance(iSetup);
221  DTStationIndex2 theindex(0,dtW,dtS,dtT);
222  std::set<RPCDetId> rollsForThisDT = TheObject->GetInstance(iSetup)->GetRolls(theindex);
223  for(std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++)
224  {
225  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
226  RPCDetId rpcId = rollasociated->id();
227 
228  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
229  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
230  {
231  rpcrollCounter[rollasociated->id().rawId()]++;
232  bool check = true;
233  std::vector<uint32_t>::iterator rpcroll;
234  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
235  if(rollasociated->id().rawId()== *rpcroll) check=false;
236  if(check==true)
237  {
238  rpcrolls.push_back(rollasociated->id().rawId());
239  RPCGeomServ servId(rollasociated->id().rawId());
240  if(debug) std::cout << "1\t Barrel RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
241  }
242  }
243  }
244  }
245  }
246  }
247  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
248  {
249  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
250  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
251 
252  CSCDetId cscid(geomDet->geographicalId().rawId());
253  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
254  {
255  const BoundPlane & CSCSurface = csclayer->surface();
256  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
257 
258  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
259  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
260 
261  if(upd2.isValid() && cscid.station()!=4 && cscid.ring()!=1 )
262  {
263  LocalPoint trajLP = upd2.localPosition();
264  LocalPoint trackLP = (*hit)->localPosition();
265  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
266  if( dx>10. && dy>10.) continue;
267 
268  ObjectMap2CSC* TheObjectCSC = ObjectMap2CSC::GetInstance(iSetup);
269  int En = cscid.endcap(), St = cscid.station(), Ri = cscid.ring();
270  int rpcSegment = cscid.chamber();
271  if(En==2) En= -1; if(Ri==4) Ri =1;
272 
273  CSCStationIndex2 theindex(En,St,Ri,rpcSegment);
274  std::set<RPCDetId> rollsForThisCSC = TheObjectCSC->GetInstance(iSetup)->GetRolls(theindex);
275  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++)
276  {
277  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
278  RPCDetId rpcId = rollasociated->id();
279 
280  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
281  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
282  {
283  rpcrollCounter[rollasociated->id().rawId()]++;
284  bool check = true;
285  std::vector<uint32_t>::iterator rpcroll;
286  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
287  if(rollasociated->id().rawId()==*rpcroll) check=false;
288  if(check==true)
289  {
290  rpcrolls.push_back(rollasociated->id().rawId());
291  RPCGeomServ servId(rollasociated->id().rawId());
292  if(debug) std::cout << "1\t Forward RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
293  }
294  }
295  }
296  }
297  }
298  } else { if(debug) std::cout << "1\t The hit is not DT/CSC's. " << std::endl;}
299  }
300  }
301  if(debug) std::cout << "First step OK!!\n2. Search nearest DT/CSC sufrace!!" << std::endl;
302  std::vector<uint32_t>::iterator rpcroll;
303  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
304  {
305  RPCDetId rpcid(*rpcroll);
306  const GlobalPoint &rGP = rpcGeo->idToDet(*rpcroll)->surface().toGlobal(LocalPoint(0,0,0));
307  RPCGeomServ servId(rpcid);
308  int rEn=rpcid.region(), rSe=rpcid.sector(), rWr=rpcid.ring(), rSt=rpcid.station(), rCh=servId.segment();
309 
310  if(rpcrollCounter[*rpcroll]<3) continue ;
311 
312  uint32_t dtcscid=0; double distance= MaxD;
313 
314  // if(rSt ==2 && rEn==0) MaxD=100;
315  // else if(rSt ==3 && rEn==0) MaxD=100;
316  // else if(rSt ==4 && rEn==0) MaxD =150;
317  for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
318  {
319  if((*hit)->isValid())
320  {
321  DetId id = (*hit)->geographicalId();
322  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
323  {
324  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
325  //const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
326  const GlobalPoint &dtGP = dtGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
327  double dx = rGP.x()-dtGP.x(), dy = rGP.y()-dtGP.y(), dz = rGP.z()-dtGP.z();
328  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
329 
330  DTChamberId dtid(geomDet->geographicalId().rawId());
331  int Se = dtid.sector(), Wh = dtid.wheel(), St = dtid.station();
332  if(Se == 13) Se=4; if(Se ==14) Se=10;
333 
334  if( rEn==0&& (rSe-Se)==0 && (rWr-Wh) ==0 && (rSt-St)==0 && distanceN < distance)
335  {
336  dtcscid=geomDet->geographicalId().rawId();
337  distance = distanceN;
338  if(debug) std::cout << "2\t DT "<< dtcscid << " Wheel : " << Wh << " station : " << St << " sector : " << Se << std::endl;
339  }
340  }
341  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
342  {
343  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
344  //const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
345  const GlobalPoint &cscGP = cscGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
346  double dx = rGP.x()-cscGP.x(), dy = rGP.y()-cscGP.y(), dz = rGP.z()-cscGP.z();
347  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
348 
349  CSCDetId cscid(geomDet->geographicalId().rawId());
350  int En =cscid.endcap(), Ri=cscid.ring(), St=cscid.station(), Ch=cscid.chamber();
351  if(En==2) En=-1; if(Ri==4) Ri=1;
352 
353  if((rEn-En)==0 && (rSt-St)==0 && (Ch-rCh) ==0 && rWr!=1 && rSt!=4 && distanceN < distance)
354  {
355  dtcscid=geomDet->geographicalId().rawId();
356  distance = distanceN;
357  if(debug) std::cout << "2\t CSC " <<dtcscid <<" region : " << En << " station : " << St << " Ring : " << Ri << " chamber : " << Ch <<std::endl;
358  }
359  }
360  }
361  }
362  if(dtcscid != 0 && distance < MaxD)
363  {
364  rpcrolls2.push_back(*rpcroll);
365  rpcNdtcsc[*rpcroll] = dtcscid;
366  }
367  }
368  if(debug) std::cout << "Second step OK!! \n3. Propagate to RPC from DT/CSC!!" << std::endl;
369  //std::map<uint32_t, int> rpcput;
370  std::vector<uint32_t>::iterator rpcroll2;
371  for( rpcroll2=rpcrolls2.begin() ; rpcroll2 < rpcrolls2.end(); rpcroll2++ )
372  {
373  bool check = true;
374  std::vector<uint32_t>::iterator rpcput_;
375  for( rpcput_=rpcput.begin() ; rpcput_ < rpcput.end(); rpcput_++ )
376  if(*rpcroll2==*rpcput_) check = false;
377 
378  if(check == true)
379  {
380  uint32_t dtcscid = rpcNdtcsc[*rpcroll2];
381  DetId id(dtcscid);
382  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
383  {
384  const GeomDet *geomDet = dtGeo->idToDet(dtcscid);
385  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
386 
387  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
388  {
389  const BoundPlane & DTSurface = dtlayer->surface();
390  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
391 
392  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
393  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
394  if(upd2.isValid())
395  {
396  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
397  if(ptss.isValid()) if(ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
398  {
399  float rpcGPX = ptss.globalPosition().x();
400  float rpcGPY = ptss.globalPosition().y();
401  float rpcGPZ = ptss.globalPosition().z();
402 
403  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
404  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
405  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
406 
407  const GeomDet *geomDet2 = rpcGeo->idToDet(*rpcroll2);
408  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet2);
409  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(aroll->topology()));
410  LocalPoint xmin = top_->localPosition(0.);
411  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
412  float rsize = fabs( xmax.x()-xmin.x() );
413  float stripl = top_->stripLength();
414  //float stripw = top_->pitch();
415  float eyr=1;
416 
417  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
418  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
419  {
420  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
421 
422  RPCGeomServ servId(*rpcroll2);
423  if(debug) std::cout << "3\t Barrel Expected RPC " << servId.name().c_str() <<
424  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
426  RPCPointVector.push_back(RPCPoint);
427  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
428  rpcput.push_back(*rpcroll2);
429  }
430  }
431  }
432  }
433  }
434  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
435  {
436  const GeomDet *geomDet4 = cscGeo->idToDet(dtcscid);
437  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet4);
438 
439  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
440  {
441  const BoundPlane & CSCSurface = csclayer->surface();
442  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
443 
444  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
445  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
446  if(upd2.isValid())
447  {
448  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
449  if(ptss.isValid()) if( ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
450  {
451  float rpcGPX = ptss.globalPosition().x();
452  float rpcGPY = ptss.globalPosition().y();
453  float rpcGPZ = ptss.globalPosition().z();
454 
455  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
456  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
457  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
458 
459  RPCDetId rpcid(*rpcroll2);
460  const GeomDet *geomDet3 = rpcGeo->idToDet(*rpcroll2);
461  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet3);
462  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(aroll->topology()));
463  LocalPoint xmin = top_->localPosition(0.);
464  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
465  float rsize = fabs( xmax.x()-xmin.x() );
466  float stripl = top_->stripLength();
467  //float stripw = top_->pitch();
468 
469  float eyr=1;
471  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
472  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
473  {
474  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
475  RPCGeomServ servId(*rpcroll2);
476  if(debug) std::cout << "3\t Forward Expected RPC " << servId.name().c_str() <<
477  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
479  RPCPointVector.push_back(RPCPoint);
480  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
481  rpcput.push_back(*rpcroll2);
482 
483  }
484  }
485  }
486  }
487  }
488  }
489  }
490  if(debug) std::cout << "last steps OK!! " << std::endl;
491 }
492 }
std::vector< Trajectory > Trajectories
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
edm::ESHandle< Propagator > thePropagator
Definition: TracktoRPC.h:77
std::set< RPCDetId > GetRolls(DTStationIndex2 dtstationindex)
Definition: TracktoRPC.h:115
const Topology & topology() const
Definition: RPCRoll.cc:30
virtual float stripLength() const
static ObjectMap2CSC * GetInstance(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:75
edm::OwnVector< RPCRecHit > RPCPointVector
Definition: TracktoRPC.h:73
int nstrips() const
Definition: RPCRoll.cc:46
virtual void setServices(const edm::EventSetup &)=0
set the services needed by the TrackTransformers
T y() const
Definition: PV3DBase.h:57
GlobalPoint globalPosition() const
RPCRecHitCollection * _ThePoints
Definition: TracktoRPC.h:72
iterator begin()
Definition: OwnVector.h:236
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int endcap() const
Definition: CSCDetId.h:95
TrackTransformerBase * theTrackTransformer
Definition: TracktoRPC.h:76
void push_back(D *&d)
Definition: OwnVector.h:290
RPCDetId id() const
Definition: RPCRoll.cc:24
static const int CSC
Definition: MuonSubdetId.h:15
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:118
T sqrt(T t)
Definition: SSEVec.h:28
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
T z() const
Definition: PV3DBase.h:58
void clear()
Definition: OwnVector.h:399
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
double MaxD
Definition: TracktoRPC.h:74
Definition: DetId.h:20
iterator end()
Definition: OwnVector.h:243
edm::RangeMap< RPCDetId, edm::OwnVector< RPCRecHit, edm::ClonePolicy< RPCRecHit > >, edm::ClonePolicy< RPCRecHit > > RPCRecHitCollection
const T & get() const
Definition: EventSetup.h:55
virtual LocalPoint localPosition(float strip) const
virtual std::vector< Trajectory > transform(const reco::Track &) const =0
Convert a reco::Track into Trajectory.
std::string const & label() const
Definition: InputTag.h:25
int sector() const
Definition: DTChamberId.h:63
std::set< RPCDetId > GetRolls(CSCStationIndex2 cscstationindex)
Definition: TracktoRPC.h:157
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:41
static const int DT
Definition: MuonSubdetId.h:14
virtual LocalPoint localPosition(float strip) const
#define debug
Definition: MEtoEDMFormat.h:34
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
static ObjectMap2 * GetInstance(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:21
T x() const
Definition: PV3DBase.h:56
virtual float stripLength() const
det heigth (strip length in the middle)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TracktoRPC::~TracktoRPC ( )

Definition at line 494 of file TracktoRPC.cc.

494  {
495 }

Member Function Documentation

RPCRecHitCollection* TracktoRPC::thePoints ( )
inline

Definition at line 68 of file TracktoRPC.h.

References _ThePoints.

Referenced by RPCPointProducer::produce().

68 {return _ThePoints;}
RPCRecHitCollection * _ThePoints
Definition: TracktoRPC.h:72
bool TracktoRPC::ValidRPCSurface ( RPCDetId  rpcid,
LocalPoint  LocalP,
const edm::EventSetup iSetup 
)

Definition at line 118 of file TracktoRPC.cc.

References edm::EventSetup::get(), RPCRoll::isBarrel(), RPCRoll::isForward(), Bounds::length(), Pi, DetId::rawId(), Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by TracktoRPC().

119 {
121  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
122 
123  const GeomDet *whichdet3 = rpcGeo->idToDet(rpcid.rawId());
124  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(whichdet3);
125  float locx=LocalP.x(), locy=LocalP.y();//, locz=LocalP.z();
126  if(aroll->isBarrel())
127  {
128  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
129  float boundlength = rollbound.length();
130  float boundwidth = rollbound.width();
131 
132  if(fabs(locx) < boundwidth/2 && fabs(locy) < boundlength/2 && locy > -boundlength/2) return true;
133  else return false;
134 
135  }
136  else if(aroll->isForward())
137  {
138  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
139  float boundlength = rollbound.length();
140  float boundwidth = rollbound.width();
141 
142  float nminx = TMath::Pi()*(18*boundwidth/ TMath::Pi() - boundlength)/18;
143  float ylimit = ((boundlength)/(boundwidth/2 - nminx/2))*fabs(locx) + boundlength/2 - ((boundlength)/(boundwidth/2 - nminx/2))*(boundwidth/2);
144  if(ylimit < -boundlength/2 ) ylimit = -boundlength/2;
145 
146  if(fabs(locx) < boundwidth/2 && fabs(locy) < boundlength/2 && locy > ylimit) return true;
147  else return false;
148  } else return false;
149 }
const double Pi
virtual float length() const =0
T y() const
Definition: PV3DBase.h:57
bool isBarrel() const
Definition: RPCRoll.cc:92
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const T & get() const
Definition: EventSetup.h:55
Definition: Bounds.h:18
bool isForward() const
Definition: RPCRoll.cc:98
T x() const
Definition: PV3DBase.h:56
virtual float width() const =0

Member Data Documentation

RPCRecHitCollection* TracktoRPC::_ThePoints
private

Definition at line 72 of file TracktoRPC.h.

Referenced by thePoints(), and TracktoRPC().

double TracktoRPC::MaxD
private

Definition at line 74 of file TracktoRPC.h.

Referenced by TracktoRPC().

edm::OwnVector<RPCRecHit> TracktoRPC::RPCPointVector
private

Definition at line 73 of file TracktoRPC.h.

Referenced by TracktoRPC().

edm::ESHandle<Propagator> TracktoRPC::thePropagator
private

Definition at line 77 of file TracktoRPC.h.

Referenced by TracktoRPC().

TrackTransformerBase* TracktoRPC::theTrackTransformer
private

Definition at line 76 of file TracktoRPC.h.

Referenced by TracktoRPC().