CMS 3D CMS Logo

CosmicLayerPairs.cc
Go to the documentation of this file.
4 
6 
11 
14 std::vector<SeedLayerPairs::LayerPair> CosmicLayerPairs::operator()() {
15  std::vector<SeedLayerPairs::LayerPair> result;
16 
17  if (_geometry == "STANDARD") {
18  // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
19  // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
20 
24 
27 
30 
33 
36 
39 
42 
45 
47 
50 
53 
56 
59 
62 
65 
68 
70 
71  } else if (_geometry == "TECPAIRS_TOBTRIPLETS") {
74 
77 
80 
83 
86 
89 
92 
94 
97 
100 
103 
106 
109 
112 
115 
117 
118  } else if (_geometry == "MTCC") {
121  //IMPORTANT
122  // The seed from overlaps must be at the end
125  } else if (_geometry == "CRACK") {
126  //TODO: clean all this. Now this is a random choice of layers
141  } else if (_geometry == "TIBD+") {
146  } else if (_geometry == "TOB") {
150 
151  } else if (_geometry == "TIBTOB") {
154 
158 
159  } else if (_geometry == "TEC+") {
162 
165 
168 
171 
174 
177 
180 
182 
183  } else if (_geometry == "CkfTIBD+") {
186  } else if (_geometry == "CkfTIBTOB") {
189 
193  } else if (_geometry == "CkfTIF3") {
196 
200 
203 
206 
209 
212 
215 
218 
221 
223 
224  } else if (_geometry == "CkfTOB") {
227 
231  } else {
232  throw cms::Exception("CosmicLayerPairs") << "The geometry " << _geometry << " is not implemented ";
233  }
234  return result;
235 }
237 
239  const SiStripMatchedRecHit2DCollection &collmatched,
241  const TrackerTopology &ttopo) {
243  //std::cout << "about to take barrel" << std::endl;
244  bl = track.barrelLayers();
245  //std::cout << "barrel taken" << std::endl;
246  fpos = track.posTecLayers();
247  //std::cout << "pos forw taken" << std::endl;
248  fneg = track.negTecLayers();
249  //std::cout << "neg forw taken" << std::endl;
250  //isFirstCall=false;
251 
252  if (_geometry ==
253  "MTCC") { //we have to distinguish the MTCC and CRACK case because they have special geometries with different neumbering of layers
254  MTCCLayerWithHits.push_back(new LayerWithHits(bl[0], selectTIBHit(collrphi, ttopo, 1)));
255  MTCCLayerWithHits.push_back(new LayerWithHits(bl[1], selectTIBHit(collrphi, ttopo, 2)));
256  MTCCLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 1)));
257  MTCCLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 2)));
258  return;
259  }
260  if (_geometry == "CRACK") {
261  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collmatched, ttopo, 7)));
262  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collmatched, ttopo, 6)));
263  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collmatched, ttopo, 4)));
264  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collmatched, ttopo, 3)));
265  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collrphi, ttopo, 7)));
266  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collrphi, ttopo, 6)));
267  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 4)));
268  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 3)));
269  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collrphi, ttopo, 5)));
270  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collrphi, ttopo, 2)));
271  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collrphi, ttopo, 1)));
272  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collmatched, ttopo, 5)));
273  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collmatched, ttopo, 2)));
274  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collmatched, ttopo, 1)));
275  return;
276  }
277 
278  TIBLayerWithHits.push_back(new LayerWithHits(bl[3], selectTIBHit(collrphi, ttopo, 1))); //layer
279  //std::cout << "TIB 0" << std::endl;
280  TIBLayerWithHits.push_back(new LayerWithHits(bl[4], selectTIBHit(collrphi, ttopo, 2)));
281  //std::cout << "TIB 1" << std::endl;
282  TIBLayerWithHits.push_back(new LayerWithHits(bl[5], selectTIBHit(collrphi, ttopo, 3)));
283  //std::cout << "TIB 2" << std::endl;
284  TIBLayerWithHits.push_back(new LayerWithHits(bl[6], selectTIBHit(collrphi, ttopo, 4)));
285  //std::cout << "TIB 3" << std::endl;
286 
287  TOBLayerWithHits.push_back(new LayerWithHits(bl[7], selectTOBHit(collrphi, ttopo, 1)));
288  //std::cout << "TOB 0" << std::endl;
289  TOBLayerWithHits.push_back(new LayerWithHits(bl[8], selectTOBHit(collrphi, ttopo, 2)));
290  //std::cout << "TOB 1" << std::endl;
291  TOBLayerWithHits.push_back(new LayerWithHits(bl[9], selectTOBHit(collrphi, ttopo, 3)));
292  //std::cout << "TOB 2" << std::endl;
293  TOBLayerWithHits.push_back(new LayerWithHits(bl[10], selectTOBHit(collrphi, ttopo, 4)));
294  //std::cout << "TOB 3" << std::endl;
295  TOBLayerWithHits.push_back(new LayerWithHits(bl[11], selectTOBHit(collrphi, ttopo, 5)));
296  //std::cout << "TOB 4" << std::endl;
297  TOBLayerWithHits.push_back(new LayerWithHits(bl[12], selectTOBHit(collrphi, ttopo, 6)));
298  //std::cout << "TOB 5" << std::endl;
299 
300  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[0], selectTECHit(collrphi, ttopo, 2, 1))); //side, disk
301  //std::cout << "wheel 0" << std::endl;
302  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[1], selectTECHit(collrphi, ttopo, 2, 2)));
303  //std::cout << "wheel 1" << std::endl;
304  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[2], selectTECHit(collrphi, ttopo, 2, 3)));
305  //std::cout << "wheel 2" << std::endl;
306  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[3], selectTECHit(collrphi, ttopo, 2, 4)));
307  //std::cout << "wheel 3" << std::endl;
308  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[4], selectTECHit(collrphi, ttopo, 2, 5)));
309  //std::cout << "wheel 4" << std::endl;
310  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[5], selectTECHit(collrphi, ttopo, 2, 6)));
311  //std::cout << "wheel 5" << std::endl;
312  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[6], selectTECHit(collrphi, ttopo, 2, 7)));
313  //std::cout << "wheel 6" << std::endl;
314  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[7], selectTECHit(collrphi, ttopo, 2, 8)));
315  //std::cout << "wheel 7" << std::endl;
316  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[8], selectTECHit(collrphi, ttopo, 2, 9)));
317  //std::cout << "wheel 8" << std::endl;
318 
319  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[0], selectTECHit(collrphi, ttopo, 1, 1))); //side, disk
320  //std::cout << "wheel 0" << std::endl;
321  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[1], selectTECHit(collrphi, ttopo, 1, 2)));
322  //std::cout << "wheel 1" << std::endl;
323  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[2], selectTECHit(collrphi, ttopo, 1, 3)));
324  //std::cout << "wheel 2" << std::endl;
325  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[3], selectTECHit(collrphi, ttopo, 1, 4)));
326  //std::cout << "wheel 3" << std::endl;
327  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[4], selectTECHit(collrphi, ttopo, 1, 5)));
328  //std::cout << "wheel 4" << std::endl;
329  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[5], selectTECHit(collrphi, ttopo, 1, 6)));
330  //std::cout << "wheel 5" << std::endl;
331  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[6], selectTECHit(collrphi, ttopo, 1, 7)));
332  //std::cout << "wheel 6" << std::endl;
333  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[7], selectTECHit(collrphi, ttopo, 1, 8)));
334  //std::cout << "wheel 7" << std::endl;
335  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[8], selectTECHit(collrphi, ttopo, 1, 9)));
336  //std::cout << "wheel 8" << std::endl;
337 }
338 
339 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripRecHit2DCollection &collrphi,
340  const TrackerTopology &ttopo,
341  int side,
342  int disk) {
343  std::vector<const TrackingRecHit *> theChoosedHits;
344  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
345  return theChoosedHits;
346 }
347 
348 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripRecHit2DCollection &collrphi,
349  const TrackerTopology &ttopo,
350  int layer) {
351  std::vector<const TrackingRecHit *> theChoosedHits;
352  //std::cout << "in selectTIBHit" << std::endl;
353  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
354  return theChoosedHits;
355 }
356 
357 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripRecHit2DCollection &collrphi,
358  const TrackerTopology &ttopo,
359  int layer) {
360  std::vector<const TrackingRecHit *> theChoosedHits;
361  //std::cout << "in selectTOBHit" << std::endl;
362  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
363  return theChoosedHits;
364 }
365 
366 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripMatchedRecHit2DCollection &collmatch,
367  const TrackerTopology &ttopo,
368  int side,
369  int disk) {
370  std::vector<const TrackingRecHit *> theChoosedHits;
371  //std::cout << "in selectTECHit" << std::endl;
372  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
373  return theChoosedHits;
374 }
375 
376 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripMatchedRecHit2DCollection &collmatch,
377  const TrackerTopology &ttopo,
378  int layer) {
379  std::vector<const TrackingRecHit *> theChoosedHits;
380  //std::cout << "in selectTIBHit" << std::endl;
381  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
382  return theChoosedHits;
383 }
384 
385 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripMatchedRecHit2DCollection &collmatch,
386  const TrackerTopology &ttopo,
387  int layer) {
388  std::vector<const TrackingRecHit *> theChoosedHits;
389  //std::cout << "in selectTOBHit" << std::endl;
390  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
391  return theChoosedHits;
392 }
std::vector< ForwardDetLayer const * > fneg
std::pair< DetId, SameLayerComparator > tecDetIdWheelComparator(uint32_t side, uint32_t wheel) const
void copyDetSetRange(DSTV const &dstv, std::vector< T const *> &v, std::pair< A, B > const &sel)
std::vector< ForwardDetLayer const * > fpos
edm::OwnVector< LayerWithHits > TIBLayerWithHits
edm::OwnVector< LayerWithHits > TOBLayerWithHits
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
std::vector< SeedLayerPairs::LayerPair > operator()() override
void push_back(D *&d)
Definition: OwnVector.h:326
void init(const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const GeometricSearchTracker &, const TrackerTopology &)
std::vector< const TrackingRecHit * > selectTECHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int side, int disk)
edm::OwnVector< LayerWithHits > MTCCLayerWithHits
edm::OwnVector< LayerWithHits > TECMinusLayerWithHits
edm::OwnVector< LayerWithHits > CRACKLayerWithHits
std::vector< const TrackingRecHit * > selectTOBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
edm::OwnVector< LayerWithHits > TECPlusLayerWithHits
std::vector< const TrackingRecHit * > selectTIBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
~CosmicLayerPairs() override
std::string _geometry
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
std::vector< BarrelDetLayer const * > bl