CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TracktoRPC.cc
Go to the documentation of this file.
12 //#include "RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h"
13 //#include "RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h"
16 #include <ctime>
17 #include <TMath.h>
18 
20 
22  if (mapInstance == NULL){
23  mapInstance = new ObjectMap2(iSetup);
24  }
25  return mapInstance;
26 }
27 
31 
32  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
33  iSetup.get<MuonGeometryRecord>().get(dtGeo);
34 
35  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
36  if(dynamic_cast< RPCChamber const * >( *it ) != 0 ){
37  auto ch = dynamic_cast<const RPCChamber* >( *it );
38  std::vector< const RPCRoll*> roles = (ch->rolls());
39  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
40  RPCDetId rpcId = (*r)->id();
41  int region=rpcId.region();
42  if(region==0){
43  int wheel=rpcId.ring();
44  int sector=rpcId.sector();
45  int station=rpcId.station();
46  DTStationIndex2 ind(region,wheel,sector,station);
47  std::set<RPCDetId> myrolls;
48  if (rollstoreDT.find(ind)!=rollstoreDT.end()) myrolls=rollstoreDT[ind];
49  myrolls.insert(rpcId);
50  rollstoreDT[ind]=myrolls;
51  }
52  }
53  }
54  }
55 }
56 
57 int distsector2(int sector1,int sector2){
58  if(sector1==13) sector1=4;
59  if(sector1==14) sector1=10;
60 
61  if(sector2==13) sector2=4;
62  if(sector2==14) sector2=10;
63 
64  int distance = std::abs(sector1 - sector2);
65  if(distance>6) distance = 12-distance;
66  return distance;
67 }
68 
69 int distwheel2(int wheel1,int wheel2){
70  int distance = std::abs(wheel1 - wheel2);
71  return distance;
72 }
74 
76  if (mapInstance == NULL){
77  mapInstance = new ObjectMap2CSC(iSetup);
78  }
79  return mapInstance;
80 }
81 
85 
86  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
87  iSetup.get<MuonGeometryRecord>().get(cscGeo);
88 
89  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
90  if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
91  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
92  std::vector< const RPCRoll*> roles = (ch->rolls());
93  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
94  RPCDetId rpcId = (*r)->id();
95  int region=rpcId.region();
96  if(region!=0){
97  int station=rpcId.station();
98  int ring=rpcId.ring();
99  int cscring=ring;
100  int cscstation=station;
101  RPCGeomServ rpcsrv(rpcId);
102  int rpcsegment = rpcsrv.segment();
103  int cscchamber = rpcsegment; //FIX THIS ACCORDING TO RPCGeomServ::segment()Definition
104  if((station==2||station==3)&&ring==3){//Adding Ring 3 of RPC to the CSC Ring 2
105  cscring = 2;
106  }
107  CSCStationIndex2 ind(region,cscstation,cscring,cscchamber);
108  std::set<RPCDetId> myrolls;
109  if (rollstoreCSC.find(ind)!=rollstoreCSC.end()) myrolls=rollstoreCSC[ind];
110  myrolls.insert(rpcId);
111  rollstoreCSC[ind]=myrolls;
112  }
113  }
114  }
115  }
116 }
117 
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 }
150 
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 }
491 
493 }
std::vector< Trajectory > Trajectories
const double Pi
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 length() const =0
ObjectMap2CSC(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:82
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
#define NULL
Definition: scimark2.h:8
static ObjectMap2 * mapInstance
Definition: TracktoRPC.h:120
RPCRecHitCollection * _ThePoints
Definition: TracktoRPC.h:72
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
bool isBarrel() const
Definition: RPCRoll.cc:92
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
std::map< DTStationIndex2, std::set< RPCDetId > > rollstoreDT
Definition: TracktoRPC.h:117
void push_back(D *&d)
Definition: OwnVector.h:274
RPCDetId id() const
Definition: RPCRoll.cc:24
int iEvent
Definition: GenABIO.cc:230
static const int CSC
Definition: MuonSubdetId.h:13
virtual std::string name()
Definition: RPCGeomServ.cc:20
bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:118
int ring() const
Definition: RPCDetId.h:72
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
int distwheel2(int wheel1, int wheel2)
Definition: TracktoRPC.cc:69
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
static ObjectMap2CSC * mapInstance
Definition: TracktoRPC.h:162
double MaxD
Definition: TracktoRPC.h:74
ObjectMap2(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:28
Definition: DetId.h:18
iterator end()
Definition: OwnVector.h:233
virtual int segment()
Definition: RPCGeomServ.cc:467
edm::RangeMap< RPCDetId, edm::OwnVector< RPCRecHit, edm::ClonePolicy< RPCRecHit > >, edm::ClonePolicy< RPCRecHit > > RPCRecHitCollection
#define debug
Definition: HDRShower.cc:19
int distsector2(int sector1, int sector2)
Definition: TracktoRPC.cc:57
const T & get() const
Definition: EventSetup.h:55
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
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
Definition: Bounds.h:22
TracktoRPC(edm::Handle< reco::TrackCollection > alltracks, const edm::EventSetup &iSetup, const edm::Event &iEvent, bool debug, const edm::ParameterSet &iConfig, edm::InputTag &tracklabel)
Definition: TracktoRPC.cc:151
std::map< CSCStationIndex2, std::set< RPCDetId > > rollstoreCSC
Definition: TracktoRPC.h:159
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
static ObjectMap2 * GetInstance(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:21
bool isForward() const
Definition: RPCRoll.cc:98
T x() const
Definition: PV3DBase.h:62
virtual float width() const =0
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96