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
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, HLT_25ns10e33_v2_cff::distance, MuonSubdetId::DT, edm::OwnVector< T, P >::end(), CSCDetId::endcap(), GeomDet::geographicalId(), edm::EventSetup::get(), 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(), groupFilesInBlocks::temp, thePropagator, theTrackTransformer, RPCRoll::topology(), HLT_25ns10e33_v2_cff::TrackTransformer, HLT_25ns10e33_v2_cff::trajectories, TrackTransformerBase::transform(), ValidRPCSurface(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), hlt_dqm_clientPB-live_cfg::xmax, hlt_dqm_clientPB-live_cfg::xmin, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

54  {
55 
56  _ThePoints.reset(new 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; if(dtS==14) dtS=10;
127  DTStationIndex theindex(0,dtW,dtS,dtT);
128  std::set<RPCDetId> rollsForThisDT = dtMap->getRolls(theindex);
129  for(std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin();iteraRoll != rollsForThisDT.end(); iteraRoll++)
130  {
131  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
132 
133  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
134  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
135  {
136  rpcrollCounter[rollasociated->id().rawId()]++;
137  bool check = true;
138  std::vector<uint32_t>::iterator rpcroll;
139  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
140  if(rollasociated->id().rawId()== *rpcroll) check=false;
141  if(check==true)
142  {
143  rpcrolls.push_back(rollasociated->id().rawId());
144  RPCGeomServ servId(rollasociated->id().rawId());
145  if(debug) std::cout << "1\t Barrel RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
146  }
147  }
148  }
149  }
150  }
151  }
152  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
153  {
154  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
155  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
156 
157  CSCDetId cscid(geomDet->geographicalId().rawId());
158  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
159  {
160  const BoundPlane & CSCSurface = csclayer->surface();
161  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
162 
163  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
164  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
165 
166  if(upd2.isValid() && cscid.station()!=4 && cscid.ring()!=1 )
167  {
168  LocalPoint trajLP = upd2.localPosition();
169  LocalPoint trackLP = (*hit)->localPosition();
170  float dx = trajLP.x()-trackLP.x(), dy=trajLP.y()-trackLP.y();//, dz=trajLP.z()-trackLP.z();
171  if( dx>10. && dy>10.) continue;
172 
173  int En = cscid.endcap(), St = cscid.station(), Ri = cscid.ring();
174  int rpcSegment = cscid.chamber();
175  if(En==2) En= -1; if(Ri==4) Ri =1;
176 
177  CSCStationIndex theindex(En,St,Ri,rpcSegment);
178  std::set<RPCDetId> rollsForThisCSC = cscMap->getRolls(theindex);
179  for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin();iteraRoll != rollsForThisCSC.end(); iteraRoll++)
180  {
181  const RPCRoll* rollasociated = rpcGeo->roll(*iteraRoll);
182 
183  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface());
184  if(ptss.isValid()) if(ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup))
185  {
186  rpcrollCounter[rollasociated->id().rawId()]++;
187  bool check = true;
188  std::vector<uint32_t>::iterator rpcroll;
189  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
190  if(rollasociated->id().rawId()==*rpcroll) check=false;
191  if(check==true)
192  {
193  rpcrolls.push_back(rollasociated->id().rawId());
194  RPCGeomServ servId(rollasociated->id().rawId());
195  if(debug) std::cout << "1\t Forward RPC roll" << rollasociated->id().rawId() << " "<< servId.name().c_str() <<std::endl;
196  }
197  }
198  }
199  }
200  }
201  } else { if(debug) std::cout << "1\t The hit is not DT/CSC's. " << std::endl;}
202  }
203  }
204  if(debug) std::cout << "First step OK!!\n2. Search nearest DT/CSC sufrace!!" << std::endl;
205  std::vector<uint32_t>::iterator rpcroll;
206  for( rpcroll=rpcrolls.begin() ; rpcroll < rpcrolls.end(); rpcroll++ )
207  {
208  RPCDetId rpcid(*rpcroll);
209  const GlobalPoint &rGP = rpcGeo->idToDet(*rpcroll)->surface().toGlobal(LocalPoint(0,0,0));
210  RPCGeomServ servId(rpcid);
211  int rEn=rpcid.region(), rSe=rpcid.sector(), rWr=rpcid.ring(), rSt=rpcid.station(), rCh=servId.segment();
212 
213  if(rpcrollCounter[*rpcroll]<3) continue ;
214 
215  uint32_t dtcscid=0; double distance= MaxD;
216 
217  // if(rSt ==2 && rEn==0) MaxD=100;
218  // else if(rSt ==3 && rEn==0) MaxD=100;
219  // else if(rSt ==4 && rEn==0) MaxD =150;
220  for(trackingRecHit_iterator hit=track->recHitsBegin(); hit != track->recHitsEnd(); hit++)
221  {
222  if((*hit)->isValid())
223  {
224  DetId id = (*hit)->geographicalId();
225  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
226  {
227  const GeomDet *geomDet = dtGeo->idToDet((*hit)->geographicalId());
228  //const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
229  const GlobalPoint &dtGP = dtGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
230  double dx = rGP.x()-dtGP.x(), dy = rGP.y()-dtGP.y(), dz = rGP.z()-dtGP.z();
231  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
232 
233  DTChamberId dtid(geomDet->geographicalId().rawId());
234  int Se = dtid.sector(), Wh = dtid.wheel(), St = dtid.station();
235  if(Se == 13) Se=4; if(Se ==14) Se=10;
236 
237  if( rEn==0&& (rSe-Se)==0 && (rWr-Wh) ==0 && (rSt-St)==0 && distanceN < distance)
238  {
239  dtcscid=geomDet->geographicalId().rawId();
240  distance = distanceN;
241  if(debug) std::cout << "2\t DT "<< dtcscid << " Wheel : " << Wh << " station : " << St << " sector : " << Se << std::endl;
242  }
243  }
244  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
245  {
246  const GeomDet *geomDet = cscGeo->idToDet((*hit)->geographicalId());
247  //const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet);
248  const GlobalPoint &cscGP = cscGeo->idToDet((*hit)->geographicalId())->surface().toGlobal(LocalPoint(0,0,0));
249  double dx = rGP.x()-cscGP.x(), dy = rGP.y()-cscGP.y(), dz = rGP.z()-cscGP.z();
250  double distanceN = sqrt(dx*dx+dy*dy+dz*dz);
251 
252  CSCDetId cscid(geomDet->geographicalId().rawId());
253  int En =cscid.endcap(), Ri=cscid.ring(), St=cscid.station(), Ch=cscid.chamber();
254  if(En==2) En=-1; if(Ri==4) Ri=1;
255 
256  if((rEn-En)==0 && (rSt-St)==0 && (Ch-rCh) ==0 && rWr!=1 && rSt!=4 && distanceN < distance)
257  {
258  dtcscid=geomDet->geographicalId().rawId();
259  distance = distanceN;
260  if(debug) std::cout << "2\t CSC " <<dtcscid <<" region : " << En << " station : " << St << " Ring : " << Ri << " chamber : " << Ch <<std::endl;
261  }
262  }
263  }
264  }
265  if(dtcscid != 0 && distance < MaxD)
266  {
267  rpcrolls2.push_back(*rpcroll);
268  rpcNdtcsc[*rpcroll] = dtcscid;
269  }
270  }
271  if(debug) std::cout << "Second step OK!! \n3. Propagate to RPC from DT/CSC!!" << std::endl;
272  //std::map<uint32_t, int> rpcput;
273  std::vector<uint32_t>::iterator rpcroll2;
274  for( rpcroll2=rpcrolls2.begin() ; rpcroll2 < rpcrolls2.end(); rpcroll2++ )
275  {
276  bool check = true;
277  std::vector<uint32_t>::iterator rpcput_;
278  for( rpcput_=rpcput.begin() ; rpcput_ < rpcput.end(); rpcput_++ )
279  if(*rpcroll2==*rpcput_) check = false;
280 
281  if(check == true)
282  {
283  uint32_t dtcscid = rpcNdtcsc[*rpcroll2];
284  DetId id(dtcscid);
285  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT)
286  {
287  const GeomDet *geomDet = dtGeo->idToDet(dtcscid);
288  const DTLayer *dtlayer = dynamic_cast<const DTLayer *>(geomDet);
289 
290  if(dtlayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
291  {
292  const BoundPlane & DTSurface = dtlayer->surface();
293  const GlobalPoint dcPoint = DTSurface.toGlobal(LocalPoint(0.,0.,0.));
294 
295  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
296  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
297  if(upd2.isValid())
298  {
299  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
300  if(ptss.isValid()) if(ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
301  {
302  float rpcGPX = ptss.globalPosition().x();
303  float rpcGPY = ptss.globalPosition().y();
304  float rpcGPZ = ptss.globalPosition().z();
305 
306  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
307  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
308  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
309 
310  const GeomDet *geomDet2 = rpcGeo->idToDet(*rpcroll2);
311  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet2);
312  const RectangularStripTopology* top_= dynamic_cast<const RectangularStripTopology*> (&(aroll->topology()));
313  LocalPoint xmin = top_->localPosition(0.);
314  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
315  float rsize = fabs( xmax.x()-xmin.x() );
316  float stripl = top_->stripLength();
317  //float stripw = top_->pitch();
318  float eyr=1;
319 
320  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
321  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
322  {
323  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
324 
325  RPCGeomServ servId(*rpcroll2);
326  if(debug) std::cout << "3\t Barrel Expected RPC " << servId.name().c_str() <<
327  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
329  RPCPointVector.push_back(RPCPoint);
330  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
331  rpcput.push_back(*rpcroll2);
332  }
333  }
334  }
335  }
336  }
337  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC)
338  {
339  const GeomDet *geomDet4 = cscGeo->idToDet(dtcscid);
340  const CSCLayer *csclayer = dynamic_cast<const CSCLayer *>(geomDet4);
341 
342  if(csclayer) for(Trajectories::const_iterator trajectory = trajectories.begin(); trajectory != trajectories.end(); ++trajectory)
343  {
344  const BoundPlane & CSCSurface = csclayer->surface();
345  const GlobalPoint dcPoint = CSCSurface.toGlobal(LocalPoint(0.,0.,0.));
346 
347  TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint);
348  TrajectoryStateOnSurface upd2 = (tMt).updatedState();
349  if(upd2.isValid())
350  {
351  TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface());
352  if(ptss.isValid()) if( ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup))
353  {
354  float rpcGPX = ptss.globalPosition().x();
355  float rpcGPY = ptss.globalPosition().y();
356  float rpcGPZ = ptss.globalPosition().z();
357 
358  if(tInX > rpcGPX || tOuX < rpcGPX ) continue;
359  if(tInY > rpcGPY || tOuY < rpcGPY ) continue;
360  if(tInZ > rpcGPZ || tOuZ < rpcGPZ ) continue;
361 
362  RPCDetId rpcid(*rpcroll2);
363  const GeomDet *geomDet3 = rpcGeo->idToDet(*rpcroll2);
364  const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(geomDet3);
365  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(aroll->topology()));
366  LocalPoint xmin = top_->localPosition(0.);
367  LocalPoint xmax = top_->localPosition((float)aroll->nstrips());
368  float rsize = fabs( xmax.x()-xmin.x() );
369  float stripl = top_->stripLength();
370  //float stripw = top_->pitch();
371 
372  float eyr=1;
374  float locx = ptss.localPosition().x(), locy = ptss.localPosition().y(), locz= ptss.localPosition().z();
375  if( locx < rsize*eyr && locy < stripl*eyr && locz < 1. )
376  {
377  RPCRecHit RPCPoint(*rpcroll2,0,LocalPoint(locx,locy,locz));
378  RPCGeomServ servId(*rpcroll2);
379  if(debug) std::cout << "3\t Forward Expected RPC " << servId.name().c_str() <<
380  " \tLocalposition X: " << locx << ", Y: "<< locy << " GlobalPosition(x,y,z) (" << rpcGPX <<", "<< rpcGPY <<", " << rpcGPZ << ")"<< std::endl;
382  RPCPointVector.push_back(RPCPoint);
383  _ThePoints->put(*rpcroll2,RPCPointVector.begin(),RPCPointVector.end());
384  rpcput.push_back(*rpcroll2);
385 
386  }
387  }
388  }
389  }
390  }
391  }
392  }
393  if(debug) std::cout << "last steps OK!! " << std::endl;
394 }
395 }
std::vector< Trajectory > Trajectories
edm::ESHandle< Propagator > thePropagator
Definition: TracktoRPC.h:73
const Topology & topology() const
Definition: RPCRoll.cc:30
virtual float stripLength() const
edm::OwnVector< RPCRecHit > RPCPointVector
Definition: TracktoRPC.h:69
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
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
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:451
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
double MaxD
Definition: TracktoRPC.h:70
Definition: DetId.h:18
iterator end()
Definition: OwnVector.h:249
edm::RangeMap< RPCDetId, edm::OwnVector< RPCRecHit, edm::ClonePolicy< RPCRecHit > >, edm::ClonePolicy< RPCRecHit > > RPCRecHitCollection
#define debug
Definition: HDRShower.cc:19
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:36
int sector() const
Definition: DTChamberId.h:61
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
static const int DT
Definition: MuonSubdetId.h:12
virtual LocalPoint localPosition(float strip) const
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
T x() const
Definition: PV3DBase.h:62
virtual float stripLength() const
det heigth (strip length in the middle)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
TracktoRPC::~TracktoRPC ( )

Definition at line 397 of file TracktoRPC.cc.

397  {
398 }

Member Function Documentation

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

Definition at line 63 of file TracktoRPC.h.

References _ThePoints, and eostools::move().

63 { return std::move(_ThePoints); }
std::unique_ptr< RPCRecHitCollection > _ThePoints
Definition: TracktoRPC.h:68
def move
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 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().

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
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:56
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

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().