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(), 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(), GeomDet::surface(), groupFilesInBlocks::temp, thePropagator, theTrackTransformer, RPCRoll::topology(), TrackTransformerBase::transform(), ValidRPCSurface(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, 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 
227  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
228  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
229  {
230  rpcrollCounter[rollasociated->id().rawId()]++;
231  bool check = true;
232  std::vector<uint32_t>::iterator rpcroll;
233  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
234  if(rollasociated->id().rawId()== *rpcroll) check=false;
235  if(check==true)
236  {
237  rpcrolls.push_back(rollasociated->id().rawId());
238  RPCGeomServ servId(rollasociated->id().rawId());
239  if(debug) std::cout << "1\t Barrel RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
240  }
241  }
242  }
243  }
244  }
245  }
246  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
247  {
248  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
249  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
250 
251  CSCDetId cscid(geomDet->geographicalId().rawId());
252  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
253  {
254  const BoundPlane & CSCSurface = csclayer->surface();
255  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
256 
257  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
258  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
259 
260  if(upd2.isValid() && cscid.station()!=4 && cscid.ring()!=1 )
261  {
262  LocalPoint trajLP = upd2.localPosition();
263  LocalPoint trackLP = (*hit)->localPosition();
264  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
265  if( dx>10. && dy>10.) continue;
266 
267  ObjectMap2CSC* TheObjectCSC = ObjectMap2CSC::GetInstance(iSetup);
268  int En = cscid.endcap(), St = cscid.station(), Ri = cscid.ring();
269  int rpcSegment = cscid.chamber();
270  if(En==2) En= -1; if(Ri==4) Ri =1;
271 
272  CSCStationIndex2 theindex(En,St,Ri,rpcSegment);
273  std::set<RPCDetId> rollsForThisCSC = TheObjectCSC->GetInstance(iSetup)->GetRolls(theindex);
274  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++)
275  {
276  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
277 
278  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
279  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
280  {
281  rpcrollCounter[rollasociated->id().rawId()]++;
282  bool check = true;
283  std::vector<uint32_t>::iterator rpcroll;
284  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
285  if(rollasociated->id().rawId()==*rpcroll) check=false;
286  if(check==true)
287  {
288  rpcrolls.push_back(rollasociated->id().rawId());
289  RPCGeomServ servId(rollasociated->id().rawId());
290  if(debug) std::cout << "1\t Forward RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
291  }
292  }
293  }
294  }
295  }
296  } else { if(debug) std::cout << "1\t The hit is not DT/CSC's. " << std::endl;}
297  }
298  }
299  if(debug) std::cout << "First step OK!!\n2. Search nearest DT/CSC sufrace!!" << std::endl;
300  std::vector<uint32_t>::iterator rpcroll;
301  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
302  {
303  RPCDetId rpcid(*rpcroll);
304  const GlobalPoint &rGP = rpcGeo->idToDet(*rpcroll)->surface().toGlobal(LocalPoint(0,0,0));
305  RPCGeomServ servId(rpcid);
306  int rEn=rpcid.region(), rSe=rpcid.sector(), rWr=rpcid.ring(), rSt=rpcid.station(), rCh=servId.segment();
307 
308  if(rpcrollCounter[*rpcroll]<3) continue ;
309 
310  uint32_t dtcscid=0; double distance= MaxD;
311 
312  // if(rSt ==2 && rEn==0) MaxD=100;
313  // else if(rSt ==3 && rEn==0) MaxD=100;
314  // else if(rSt ==4 && rEn==0) MaxD =150;
315  for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
316  {
317  if((*hit)->isValid())
318  {
319  DetId id = (*hit)->geographicalId();
320  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
321  {
322  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
323  //const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
324  const GlobalPoint &dtGP = dtGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
325  double dx = rGP.x()-dtGP.x(), dy = rGP.y()-dtGP.y(), dz = rGP.z()-dtGP.z();
326  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
327 
328  DTChamberId dtid(geomDet->geographicalId().rawId());
329  int Se = dtid.sector(), Wh = dtid.wheel(), St = dtid.station();
330  if(Se == 13) Se=4; if(Se ==14) Se=10;
331 
332  if( rEn==0&& (rSe-Se)==0 && (rWr-Wh) ==0 && (rSt-St)==0 && distanceN < distance)
333  {
334  dtcscid=geomDet->geographicalId().rawId();
335  distance = distanceN;
336  if(debug) std::cout << "2\t DT "<< dtcscid << " Wheel : " << Wh << " station : " << St << " sector : " << Se << std::endl;
337  }
338  }
339  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
340  {
341  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
342  //const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
343  const GlobalPoint &cscGP = cscGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
344  double dx = rGP.x()-cscGP.x(), dy = rGP.y()-cscGP.y(), dz = rGP.z()-cscGP.z();
345  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
346 
347  CSCDetId cscid(geomDet->geographicalId().rawId());
348  int En =cscid.endcap(), Ri=cscid.ring(), St=cscid.station(), Ch=cscid.chamber();
349  if(En==2) En=-1; if(Ri==4) Ri=1;
350 
351  if((rEn-En)==0 && (rSt-St)==0 && (Ch-rCh) ==0 && rWr!=1 && rSt!=4 && distanceN < distance)
352  {
353  dtcscid=geomDet->geographicalId().rawId();
354  distance = distanceN;
355  if(debug) std::cout << "2\t CSC " <<dtcscid <<" region : " << En << " station : " << St << " Ring : " << Ri << " chamber : " << Ch <<std::endl;
356  }
357  }
358  }
359  }
360  if(dtcscid != 0 && distance < MaxD)
361  {
362  rpcrolls2.push_back(*rpcroll);
363  rpcNdtcsc[*rpcroll] = dtcscid;
364  }
365  }
366  if(debug) std::cout << "Second step OK!! \n3. Propagate to RPC from DT/CSC!!" << std::endl;
367  //std::map<uint32_t, int> rpcput;
368  std::vector<uint32_t>::iterator rpcroll2;
369  for( rpcroll2=rpcrolls2.begin() ; rpcroll2 < rpcrolls2.end(); rpcroll2++ )
370  {
371  bool check = true;
372  std::vector<uint32_t>::iterator rpcput_;
373  for( rpcput_=rpcput.begin() ; rpcput_ < rpcput.end(); rpcput_++ )
374  if(*rpcroll2==*rpcput_) check = false;
375 
376  if(check == true)
377  {
378  uint32_t dtcscid = rpcNdtcsc[*rpcroll2];
379  DetId id(dtcscid);
380  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
381  {
382  const GeomDet *geomDet = dtGeo->idToDet(dtcscid);
383  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
384 
385  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
386  {
387  const BoundPlane & DTSurface = dtlayer->surface();
388  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
389 
390  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
391  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
392  if(upd2.isValid())
393  {
394  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
395  if(ptss.isValid()) if(ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
396  {
397  float rpcGPX = ptss.globalPosition().x();
398  float rpcGPY = ptss.globalPosition().y();
399  float rpcGPZ = ptss.globalPosition().z();
400 
401  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
402  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
403  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
404 
405  const GeomDet *geomDet2 = rpcGeo->idToDet(*rpcroll2);
406  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet2);
407  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(aroll->topology()));
408  LocalPoint xmin = top_->localPosition(0.);
409  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
410  float rsize = fabs( xmax.x()-xmin.x() );
411  float stripl = top_->stripLength();
412  //float stripw = top_->pitch();
413  float eyr=1;
414 
415  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
416  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
417  {
418  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
419 
420  RPCGeomServ servId(*rpcroll2);
421  if(debug) std::cout << "3\t Barrel Expected RPC " << servId.name().c_str() <<
422  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
424  RPCPointVector.push_back(RPCPoint);
425  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
426  rpcput.push_back(*rpcroll2);
427  }
428  }
429  }
430  }
431  }
432  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
433  {
434  const GeomDet *geomDet4 = cscGeo->idToDet(dtcscid);
435  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet4);
436 
437  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
438  {
439  const BoundPlane & CSCSurface = csclayer->surface();
440  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
441 
442  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
443  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
444  if(upd2.isValid())
445  {
446  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
447  if(ptss.isValid()) if( ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
448  {
449  float rpcGPX = ptss.globalPosition().x();
450  float rpcGPY = ptss.globalPosition().y();
451  float rpcGPZ = ptss.globalPosition().z();
452 
453  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
454  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
455  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
456 
457  RPCDetId rpcid(*rpcroll2);
458  const GeomDet *geomDet3 = rpcGeo->idToDet(*rpcroll2);
459  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet3);
460  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(aroll->topology()));
461  LocalPoint xmin = top_->localPosition(0.);
462  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
463  float rsize = fabs( xmax.x()-xmin.x() );
464  float stripl = top_->stripLength();
465  //float stripw = top_->pitch();
466 
467  float eyr=1;
469  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
470  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
471  {
472  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
473  RPCGeomServ servId(*rpcroll2);
474  if(debug) std::cout << "3\t Forward Expected RPC " << servId.name().c_str() <<
475  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
477  RPCPointVector.push_back(RPCPoint);
478  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
479  rpcput.push_back(*rpcroll2);
480 
481  }
482  }
483  }
484  }
485  }
486  }
487  }
488  if(debug) std::cout << "last steps OK!! " << std::endl;
489 }
490 }
std::vector< Trajectory > Trajectories
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
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:63
GlobalPoint globalPosition() const
RPCRecHitCollection * _ThePoints
Definition: TracktoRPC.h:72
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
iterator begin()
Definition: OwnVector.h:228
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int endcap() const
Definition: CSCDetId.h:106
TrackTransformerBase * theTrackTransformer
Definition: TracktoRPC.h:76
void push_back(D *&d)
Definition: OwnVector.h:274
RPCDetId id() const
Definition: RPCRoll.cc:24
static const int CSC
Definition: MuonSubdetId.h:13
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:118
T sqrt(T t)
Definition: SSEVec.h:48
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
T z() const
Definition: PV3DBase.h:64
void clear()
Definition: OwnVector.h:371
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
double MaxD
Definition: TracktoRPC.h:74
Definition: DetId.h:18
iterator end()
Definition: OwnVector.h:233
edm::RangeMap< RPCDetId, edm::OwnVector< RPCRecHit, edm::ClonePolicy< RPCRecHit > >, edm::ClonePolicy< RPCRecHit > > RPCRecHitCollection
#define debug
Definition: HDRShower.cc:19
const T & get() const
Definition: EventSetup.h:55
virtual std::vector< Trajectory > transform(const reco::Track &) const =0
Convert a reco::Track into Trajectory.
std::string const & label() const
Definition: InputTag.h:42
int sector() const
Definition: DTChamberId.h:61
std::set< RPCDetId > GetRolls(CSCStationIndex2 cscstationindex)
Definition: TracktoRPC.h:157
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
static const int DT
Definition: MuonSubdetId.h:12
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
static ObjectMap2 * GetInstance(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:21
T x() const
Definition: PV3DBase.h:62
TracktoRPC::~TracktoRPC ( )

Definition at line 492 of file TracktoRPC.cc.

492  {
493 }

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:63
bool isBarrel() const
Definition: RPCRoll.cc:92
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const T & get() const
Definition: EventSetup.h:55
Definition: Bounds.h:22
bool isForward() const
Definition: RPCRoll.cc:98
T x() const
Definition: PV3DBase.h:62
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().