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