CMS 3D CMS Logo

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

#include <TracktoRPC.h>

Public Member Functions

std::unique_ptr< RPCRecHitCollection > && thePoints ()
 
 TracktoRPC (reco::TrackCollection const *alltracks, edm::EventSetup const &iSetup, bool debug, const edm::ParameterSet &iConfig, const edm::InputTag &tracklabel)
 
 ~TracktoRPC ()
 

Private Member Functions

bool ValidRPCSurface (RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup)
 

Private Attributes

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

Detailed Description

Definition at line 59 of file TracktoRPC.h.

Constructor & Destructor Documentation

TracktoRPC::TracktoRPC ( reco::TrackCollection const *  alltracks,
edm::EventSetup const &  iSetup,
bool  debug,
const edm::ParameterSet iConfig,
const edm::InputTag tracklabel 
)

Definition at line 54 of file TracktoRPC.cc.

References _ThePoints, edm::OwnVector< T, P >::begin(), trackerTree::check(), edm::OwnVector< T, P >::clear(), gather_cfg::cout, MuonSubdetId::CSC, SoftLeptonByDistance_cfi::distance, MuonSubdetId::DT, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, edm::OwnVector< T, P >::end(), CSCDetId::endcap(), GeomDet::geographicalId(), edm::EventSetup::get(), CSCObjectMap::getRolls(), DTObjectMap::getRolls(), TrajectoryStateOnSurface::globalPosition(), hcalTTPDigis_cfi::id, RPCRoll::id(), RPCGeometry::idToDet(), DTGeometry::idToDet(), CSCGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), edm::InputTag::label(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), TrajectoryStateOnSurface::localPosition(), MaxD, DetId::Muon, RPCGeomServ::name(), RPCRoll::nstrips(), Propagator::propagate(), edm::OwnVector< T, P >::push_back(), DetId::rawId(), RPCDetId::region(), RPCDetId::ring(), RPCGeometry::roll(), RPCPointVector, DTChamberId::sector(), RPCDetId::sector(), RPCGeomServ::segment(), TrackTransformerBase::setServices(), mathSSE::sqrt(), RPCDetId::station(), RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), GeomDet::surface(), groupFilesInBlocks::temp, thePropagator, theTrackTransformer, GeomDet::toGlobal(), Surface::toGlobal(), RPCRoll::topology(), HiIsolationCommonParameters_cff::track, rpcPointProducer_cfi::TrackTransformer, HiRegitMuonDetachedTripletStep_cff::trajectories, TrackTransformerBase::transform(), TrackInfoProducer_cfi::updatedState, ValidRPCSurface(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

54  {
55 
56  _ThePoints = std::make_unique<RPCRecHitCollection>();
57 // if(alltracks->empty()) return;
58 
59  if(tracklabel.label().find("cosmic")==0) theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig);
60  else if(tracklabel.label().find("globalCosmic")==0) theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig);
61  else theTrackTransformer = new TrackTransformer(iConfig);
63 
69 
70  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny",thePropagator);
71  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
72  iSetup.get<MuonGeometryRecord>().get(dtGeo);
73  iSetup.get<MuonGeometryRecord>().get(dtMap);
74  iSetup.get<MuonGeometryRecord>().get(cscGeo);
75  iSetup.get<MuonGeometryRecord>().get(cscMap);
76 
77 std::vector<uint32_t> rpcput;
78 double MaxD=999.;
79 
80 for (TrackCollection::const_iterator track = alltracks->begin(); track !=alltracks->end(); track++)
81 {
83  if(debug) std::cout << "Building Trajectory from Track. " << std::endl;
84 
85  std::vector<uint32_t> rpcrolls;
86  std::vector<uint32_t> rpcrolls2;
87  std::map<uint32_t, int> rpcNdtcsc;
88  std::map<uint32_t, int> rpcrollCounter;
89 
90  float tInX = track->innerPosition().X(), tInY = track->innerPosition().Y(), tInZ = track->innerPosition().Z();
91  float tOuX = track->outerPosition().X(), tOuY = track->outerPosition().Y(), tOuZ = track->outerPosition().Z();
92  if(tInX > tOuX) { float temp=tOuX; tOuX=tInX; tInX=temp; }
93  if(tInY > tOuY) { float temp=tOuY; tOuY=tInY; tInY=temp; }
94  if(tInZ > tOuZ) { float temp=tOuZ; tOuZ=tInZ; tInZ=temp; }
95 
96  if(debug) std::cout << "in (x,y,z): ("<< tInX <<", "<< tInY <<", "<< tInZ << ")" << std::endl;
97  if(debug) std::cout << "out (x,y,z): ("<< tOuX <<", "<< tOuY <<", "<< tOuZ << ")" << std::endl;
98 
99 if(debug) std::cout << "1. Search expeted RPC roll detid !!" << std::endl;
100 for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
101  {
102  if((*hit)->isValid())
103  {
104  DetId id = (*hit)->geographicalId();
105 
106  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
107  {
108  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
109  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
110  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
111  {
112  const BoundPlane & DTSurface = dtlayer->surface();
113  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
114 
115  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
116  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
117  if(upd2.isValid())
118  {
119  LocalPoint trajLP = upd2.localPosition();
120  LocalPoint trackLP = (*hit)->localPosition();
121  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
122  if( dx>10. && dy>10.) continue;
123 
124  DTChamberId dtid(geomDet->geographicalId().rawId());
125  int dtW=dtid.wheel(), dtS=dtid.sector(), dtT=dtid.station();
126  if(dtS==13) dtS=4;
127  if(dtS==14) dtS=10;
128  DTStationIndex theindex(0,dtW,dtS,dtT);
129  std::set<RPCDetId> rollsForThisDT = dtMap->getRolls(theindex);
130  for(std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++)
131  {
132  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
133 
134  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
135  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
136  {
137  rpcrollCounter[rollasociated->id().rawId()]++;
138  bool check = true;
139  std::vector<uint32_t>::iterator rpcroll;
140  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
141  if(rollasociated->id().rawId()== *rpcroll) check=false;
142  if(check==true)
143  {
144  rpcrolls.push_back(rollasociated->id().rawId());
145  RPCGeomServ servId(rollasociated->id().rawId());
146  if(debug) std::cout << "1\t Barrel RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
147  }
148  }
149  }
150  }
151  }
152  }
153  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
154  {
155  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
156  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
157 
158  CSCDetId cscid(geomDet->geographicalId().rawId());
159  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
160  {
161  const BoundPlane & CSCSurface = csclayer->surface();
162  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
163 
164  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
165  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
166 
167  if(upd2.isValid() && cscid.station()!=4 && cscid.ring()!=1 )
168  {
169  LocalPoint trajLP = upd2.localPosition();
170  LocalPoint trackLP = (*hit)->localPosition();
171  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
172  if( dx>10. && dy>10.) continue;
173 
174  int En = cscid.endcap(), St = cscid.station(), Ri = cscid.ring();
175  int rpcSegment = cscid.chamber();
176  if(En==2) En= -1;
177  if(Ri==4) Ri =1;
178 
179  CSCStationIndex theindex(En,St,Ri,rpcSegment);
180  std::set<RPCDetId> rollsForThisCSC = cscMap->getRolls(theindex);
181  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++)
182  {
183  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
184 
185  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
186  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
187  {
188  rpcrollCounter[rollasociated->id().rawId()]++;
189  bool check = true;
190  std::vector<uint32_t>::iterator rpcroll;
191  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
192  if(rollasociated->id().rawId()==*rpcroll) check=false;
193  if(check==true)
194  {
195  rpcrolls.push_back(rollasociated->id().rawId());
196  RPCGeomServ servId(rollasociated->id().rawId());
197  if(debug) std::cout << "1\t Forward RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
198  }
199  }
200  }
201  }
202  }
203  } else { if(debug) std::cout << "1\t The hit is not DT/CSC's. " << std::endl;}
204  }
205  }
206  if(debug) std::cout << "First step OK!!\n2. Search nearest DT/CSC sufrace!!" << std::endl;
207  std::vector<uint32_t>::iterator rpcroll;
208  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
209  {
210  RPCDetId rpcid(*rpcroll);
211  const GlobalPoint &rGP = rpcGeo->idToDet(*rpcroll)->surface().toGlobal(LocalPoint(0,0,0));
212  RPCGeomServ servId(rpcid);
213  int rEn=rpcid.region(), rSe=rpcid.sector(), rWr=rpcid.ring(), rSt=rpcid.station(), rCh=servId.segment();
214 
215  if(rpcrollCounter[*rpcroll]<3) continue ;
216 
217  uint32_t dtcscid=0; double distance= MaxD;
218 
219  // if(rSt ==2 && rEn==0) MaxD=100;
220  // else if(rSt ==3 && rEn==0) MaxD=100;
221  // else if(rSt ==4 && rEn==0) MaxD =150;
222  for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
223  {
224  if((*hit)->isValid())
225  {
226  DetId id = (*hit)->geographicalId();
227  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
228  {
229  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
230  //const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
231  const GlobalPoint &dtGP = dtGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
232  double dx = rGP.x()-dtGP.x(), dy = rGP.y()-dtGP.y(), dz = rGP.z()-dtGP.z();
233  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
234 
235  DTChamberId dtid(geomDet->geographicalId().rawId());
236  int Se = dtid.sector(), Wh = dtid.wheel(), St = dtid.station();
237  if(Se == 13) Se=4;
238  if(Se ==14) Se=10;
239 
240  if( rEn==0&& (rSe-Se)==0 && (rWr-Wh) ==0 && (rSt-St)==0 && distanceN < distance)
241  {
242  dtcscid=geomDet->geographicalId().rawId();
243  distance = distanceN;
244  if(debug) std::cout << "2\t DT "<< dtcscid << " Wheel : " << Wh << " station : " << St << " sector : " << Se << std::endl;
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  const GlobalPoint &cscGP = cscGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
252  double dx = rGP.x()-cscGP.x(), dy = rGP.y()-cscGP.y(), dz = rGP.z()-cscGP.z();
253  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
254 
255  CSCDetId cscid(geomDet->geographicalId().rawId());
256  int En =cscid.endcap(), Ri=cscid.ring(), St=cscid.station(), Ch=cscid.chamber();
257  if(En==2) En=-1;
258  if(Ri==4) Ri=1;
259 
260  if((rEn-En)==0 && (rSt-St)==0 && (Ch-rCh) ==0 && rWr!=1 && rSt!=4 && distanceN < distance)
261  {
262  dtcscid=geomDet->geographicalId().rawId();
263  distance = distanceN;
264  if(debug) std::cout << "2\t CSC " <<dtcscid <<" region : " << En << " station : " << St << " Ring : " << Ri << " chamber : " << Ch <<std::endl;
265  }
266  }
267  }
268  }
269  if(dtcscid != 0 && distance < MaxD)
270  {
271  rpcrolls2.push_back(*rpcroll);
272  rpcNdtcsc[*rpcroll] = dtcscid;
273  }
274  }
275  if(debug) std::cout << "Second step OK!! \n3. Propagate to RPC from DT/CSC!!" << std::endl;
276  //std::map<uint32_t, int> rpcput;
277  std::vector<uint32_t>::iterator rpcroll2;
278  for( rpcroll2=rpcrolls2.begin() ; rpcroll2 < rpcrolls2.end(); rpcroll2++ )
279  {
280  bool check = true;
281  std::vector<uint32_t>::iterator rpcput_;
282  for( rpcput_=rpcput.begin() ; rpcput_ < rpcput.end(); rpcput_++ )
283  if(*rpcroll2==*rpcput_) check = false;
284 
285  if(check == true)
286  {
287  uint32_t dtcscid = rpcNdtcsc[*rpcroll2];
288  DetId id(dtcscid);
289  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
290  {
291  const GeomDet *geomDet = dtGeo->idToDet(dtcscid);
292  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
293 
294  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
295  {
296  const BoundPlane & DTSurface = dtlayer->surface();
297  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
298 
299  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
300  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
301  if(upd2.isValid())
302  {
303  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
304  if(ptss.isValid()) if(ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
305  {
306  float rpcGPX = ptss.globalPosition().x();
307  float rpcGPY = ptss.globalPosition().y();
308  float rpcGPZ = ptss.globalPosition().z();
309 
310  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
311  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
312  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
313 
314  const GeomDet *geomDet2 = rpcGeo->idToDet(*rpcroll2);
315  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet2);
316  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(aroll->topology()));
317  LocalPoint xmin = top_->localPosition(0.);
318  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
319  float rsize = fabs( xmax.x()-xmin.x() );
320  float stripl = top_->stripLength();
321  //float stripw = top_->pitch();
322  float eyr=1;
323 
324  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
325  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
326  {
327  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
328 
329  RPCGeomServ servId(*rpcroll2);
330  if(debug) std::cout << "3\t Barrel Expected RPC " << servId.name().c_str() <<
331  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
333  RPCPointVector.push_back(RPCPoint);
334  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
335  rpcput.push_back(*rpcroll2);
336  }
337  }
338  }
339  }
340  }
341  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
342  {
343  const GeomDet *geomDet4 = cscGeo->idToDet(dtcscid);
344  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet4);
345 
346  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
347  {
348  const BoundPlane & CSCSurface = csclayer->surface();
349  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
350 
351  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
352  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
353  if(upd2.isValid())
354  {
355  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
356  if(ptss.isValid()) if( ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
357  {
358  float rpcGPX = ptss.globalPosition().x();
359  float rpcGPY = ptss.globalPosition().y();
360  float rpcGPZ = ptss.globalPosition().z();
361 
362  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
363  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
364  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
365 
366  RPCDetId rpcid(*rpcroll2);
367  const GeomDet *geomDet3 = rpcGeo->idToDet(*rpcroll2);
368  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet3);
369  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(aroll->topology()));
370  LocalPoint xmin = top_->localPosition(0.);
371  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
372  float rsize = fabs( xmax.x()-xmin.x() );
373  float stripl = top_->stripLength();
374  //float stripw = top_->pitch();
375 
376  float eyr=1;
378  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
379  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
380  {
381  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
382  RPCGeomServ servId(*rpcroll2);
383  if(debug) std::cout << "3\t Forward Expected RPC " << servId.name().c_str() <<
384  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
386  RPCPointVector.push_back(RPCPoint);
387  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
388  rpcput.push_back(*rpcroll2);
389 
390  }
391  }
392  }
393  }
394  }
395  }
396  }
397  if(debug) std::cout << "last steps OK!! " << std::endl;
398 }
399 }
std::vector< Trajectory > Trajectories
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
edm::ESHandle< Propagator > thePropagator
Definition: TracktoRPC.h:73
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
virtual std::vector< Trajectory > transform(const reco::Track &) const =0
Convert a reco::Track into Trajectory.
LocalPoint localPosition(float strip) const override
edm::OwnVector< RPCRecHit > RPCPointVector
Definition: TracktoRPC.h:69
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:99
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
int nstrips() const
Definition: RPCRoll.cc:46
virtual void setServices(const edm::EventSetup &)=0
set the services needed by the TrackTransformers
LocalPoint localPosition(float strip) const override
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
std::set< RPCDetId > const & getRolls(CSCStationIndex index) const
Definition: CSCObjectMap.cc:48
const Topology & topology() const override
Definition: RPCRoll.cc:30
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
std::set< RPCDetId > const & getRolls(DTStationIndex index) const
Definition: DTObjectMap.cc:43
iterator begin()
Definition: OwnVector.h:244
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int endcap() const
Definition: CSCDetId.h:93
TrackTransformerBase * theTrackTransformer
Definition: TracktoRPC.h:72
std::unique_ptr< RPCRecHitCollection > _ThePoints
Definition: TracktoRPC.h:68
void push_back(D *&d)
Definition: OwnVector.h:290
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:21
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
void clear()
Definition: OwnVector.h:445
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
float stripLength() const override
det heigth (strip length in the middle)
double MaxD
Definition: TracktoRPC.h:70
Definition: DetId.h:18
iterator end()
Definition: OwnVector.h:249
#define debug
Definition: HDRShower.cc:19
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
std::string const & label() const
Definition: InputTag.h:36
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:53
int sector() const
Definition: DTChamberId.h:61
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:75
static const int DT
Definition: MuonSubdetId.h:12
def check(config)
Definition: trackerTree.py:14
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
T x() const
Definition: PV3DBase.h:62
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
float stripLength() const override
TracktoRPC::~TracktoRPC ( )

Definition at line 401 of file TracktoRPC.cc.

401  {
402 }

Member Function Documentation

std::unique_ptr<RPCRecHitCollection>&& TracktoRPC::thePoints ( )
inline

Definition at line 63 of file TracktoRPC.h.

References _ThePoints, eostools::move(), and ValidRPCSurface().

63 { return std::move(_ThePoints); }
std::unique_ptr< RPCRecHitCollection > _ThePoints
Definition: TracktoRPC.h:68
def move(src, dest)
Definition: eostools.py:510
bool TracktoRPC::ValidRPCSurface ( RPCDetId  rpcid,
LocalPoint  LocalP,
const edm::EventSetup iSetup 
)
private

Definition at line 21 of file TracktoRPC.cc.

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

Referenced by thePoints(), and TracktoRPC().

22 {
24  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
25 
26  const GeomDet *whichdet3 = rpcGeo->idToDet(rpcid.rawId());
27  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(whichdet3);
28  float locx=LocalP.x(), locy=LocalP.y();//, locz=LocalP.z();
29  if(aroll->isBarrel())
30  {
31  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
32  float boundlength = rollbound.length();
33  float boundwidth = rollbound.width();
34 
35  if(fabs(locx) < boundwidth/2 && fabs(locy) < boundlength/2 && locy > -boundlength/2) return true;
36  else return false;
37 
38  }
39  else if(aroll->isForward())
40  {
41  const Bounds &rollbound = rpcGeo->idToDet((rpcid))->surface().bounds();
42  float boundlength = rollbound.length();
43  float boundwidth = rollbound.width();
44 
45  float nminx = TMath::Pi()*(18*boundwidth/ TMath::Pi() - boundlength)/18;
46  float ylimit = ((boundlength)/(boundwidth/2 - nminx/2))*fabs(locx) + boundlength/2 - ((boundlength)/(boundwidth/2 - nminx/2))*(boundwidth/2);
47  if(ylimit < -boundlength/2 ) ylimit = -boundlength/2;
48 
49  if(fabs(locx) < boundwidth/2 && fabs(locy) < boundlength/2 && locy > ylimit) return true;
50  else return false;
51  } else return false;
52 }
const double Pi
virtual float length() const =0
T y() const
Definition: PV3DBase.h:63
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
bool isBarrel() const
Definition: RPCRoll.cc:92
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual float width() const =0
const T & get() const
Definition: EventSetup.h:55
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:53
Definition: Bounds.h:22
bool isForward() const
Definition: RPCRoll.cc:98
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

std::unique_ptr<RPCRecHitCollection> TracktoRPC::_ThePoints
private

Definition at line 68 of file TracktoRPC.h.

Referenced by thePoints(), and TracktoRPC().

double TracktoRPC::MaxD
private

Definition at line 70 of file TracktoRPC.h.

Referenced by TracktoRPC().

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

Definition at line 69 of file TracktoRPC.h.

Referenced by TracktoRPC().

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

Definition at line 73 of file TracktoRPC.h.

Referenced by TracktoRPC().

TrackTransformerBase* TracktoRPC::theTrackTransformer
private

Definition at line 72 of file TracktoRPC.h.

Referenced by TracktoRPC().