CMS 3D CMS Logo

CosmicLayerPairs.cc
Go to the documentation of this file.
4 
6 
11 
14 
15 std::vector<SeedLayerPairs::LayerPair> CosmicLayerPairs::operator()() {
16  std::vector<SeedLayerPairs::LayerPair> result;
17 
18  if (_geometry == "STANDARD") {
19  // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
20  // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
21 
25 
28 
31 
34 
37 
40 
43 
46 
48 
51 
54 
57 
60 
63 
66 
69 
71 
72  } else if (_geometry == "TECPAIRS_TOBTRIPLETS") {
75 
78 
81 
84 
87 
90 
93 
95 
98 
101 
104 
107 
110 
113 
116 
118 
119  } else if (_geometry == "MTCC") {
122  //IMPORTANT
123  // The seed from overlaps must be at the end
126  } else if (_geometry == "CRACK") {
127  //TODO: clean all this. Now this is a random choice of layers
142  } else if (_geometry == "TIBD+") {
147  } else if (_geometry == "TOB") {
151 
152  } else if (_geometry == "TIBTOB") {
155 
159 
160  } else if (_geometry == "TEC+") {
163 
166 
169 
172 
175 
178 
181 
183 
184  } else if (_geometry == "CkfTIBD+") {
187  } else if (_geometry == "CkfTIBTOB") {
190 
194  } else if (_geometry == "CkfTIF3") {
197 
201 
204 
207 
210 
213 
216 
219 
222 
224 
225  } else if (_geometry == "CkfTOB") {
228 
232  } else {
233  throw cms::Exception("CosmicLayerPairs") << "The geometry " << _geometry << " is not implemented ";
234  }
235  return result;
236 }
238 
240  const SiStripRecHit2DCollection &collrphi,
241  const SiStripMatchedRecHit2DCollection &collmatched,
242  //std::string geometry,
243  const edm::EventSetup &iSetup) {
245  //_geometry=geometry;
246  //if(isFirstCall){
247  //std::cout << "in isFirtsCall" << std::endl;
250  //std::cout << "about to take barrel" << std::endl;
251  bl = track->barrelLayers();
252  //std::cout << "barrel taken" << std::endl;
253  fpos = track->posTecLayers();
254  //std::cout << "pos forw taken" << std::endl;
255  fneg = track->negTecLayers();
256  //std::cout << "neg forw taken" << std::endl;
257  //isFirstCall=false;
258 
260  iSetup.get<TrackerTopologyRcd>().get(httopo);
261  const TrackerTopology &ttopo = *httopo;
262 
263  if (_geometry ==
264  "MTCC") { //we have to distinguish the MTCC and CRACK case because they have special geometries with different neumbering of layers
265  MTCCLayerWithHits.push_back(new LayerWithHits(bl[0], selectTIBHit(collrphi, ttopo, 1)));
266  MTCCLayerWithHits.push_back(new LayerWithHits(bl[1], selectTIBHit(collrphi, ttopo, 2)));
267  MTCCLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 1)));
268  MTCCLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 2)));
269  return;
270  }
271  if (_geometry == "CRACK") {
272  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collmatched, ttopo, 7)));
273  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collmatched, ttopo, 6)));
274  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collmatched, ttopo, 4)));
275  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collmatched, ttopo, 3)));
276  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collrphi, ttopo, 7)));
277  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collrphi, ttopo, 6)));
278  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 4)));
279  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 3)));
280  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collrphi, ttopo, 5)));
281  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collrphi, ttopo, 2)));
282  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collrphi, ttopo, 1)));
283  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collmatched, ttopo, 5)));
284  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collmatched, ttopo, 2)));
285  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collmatched, ttopo, 1)));
286  return;
287  }
288 
289  TIBLayerWithHits.push_back(new LayerWithHits(bl[3], selectTIBHit(collrphi, ttopo, 1))); //layer
290  //std::cout << "TIB 0" << std::endl;
291  TIBLayerWithHits.push_back(new LayerWithHits(bl[4], selectTIBHit(collrphi, ttopo, 2)));
292  //std::cout << "TIB 1" << std::endl;
293  TIBLayerWithHits.push_back(new LayerWithHits(bl[5], selectTIBHit(collrphi, ttopo, 3)));
294  //std::cout << "TIB 2" << std::endl;
295  TIBLayerWithHits.push_back(new LayerWithHits(bl[6], selectTIBHit(collrphi, ttopo, 4)));
296  //std::cout << "TIB 3" << std::endl;
297 
298  TOBLayerWithHits.push_back(new LayerWithHits(bl[7], selectTOBHit(collrphi, ttopo, 1)));
299  //std::cout << "TOB 0" << std::endl;
300  TOBLayerWithHits.push_back(new LayerWithHits(bl[8], selectTOBHit(collrphi, ttopo, 2)));
301  //std::cout << "TOB 1" << std::endl;
302  TOBLayerWithHits.push_back(new LayerWithHits(bl[9], selectTOBHit(collrphi, ttopo, 3)));
303  //std::cout << "TOB 2" << std::endl;
304  TOBLayerWithHits.push_back(new LayerWithHits(bl[10], selectTOBHit(collrphi, ttopo, 4)));
305  //std::cout << "TOB 3" << std::endl;
306  TOBLayerWithHits.push_back(new LayerWithHits(bl[11], selectTOBHit(collrphi, ttopo, 5)));
307  //std::cout << "TOB 4" << std::endl;
308  TOBLayerWithHits.push_back(new LayerWithHits(bl[12], selectTOBHit(collrphi, ttopo, 6)));
309  //std::cout << "TOB 5" << std::endl;
310 
311  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[0], selectTECHit(collrphi, ttopo, 2, 1))); //side, disk
312  //std::cout << "wheel 0" << std::endl;
313  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[1], selectTECHit(collrphi, ttopo, 2, 2)));
314  //std::cout << "wheel 1" << std::endl;
315  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[2], selectTECHit(collrphi, ttopo, 2, 3)));
316  //std::cout << "wheel 2" << std::endl;
317  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[3], selectTECHit(collrphi, ttopo, 2, 4)));
318  //std::cout << "wheel 3" << std::endl;
319  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[4], selectTECHit(collrphi, ttopo, 2, 5)));
320  //std::cout << "wheel 4" << std::endl;
321  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[5], selectTECHit(collrphi, ttopo, 2, 6)));
322  //std::cout << "wheel 5" << std::endl;
323  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[6], selectTECHit(collrphi, ttopo, 2, 7)));
324  //std::cout << "wheel 6" << std::endl;
325  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[7], selectTECHit(collrphi, ttopo, 2, 8)));
326  //std::cout << "wheel 7" << std::endl;
327  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[8], selectTECHit(collrphi, ttopo, 2, 9)));
328  //std::cout << "wheel 8" << std::endl;
329 
330  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[0], selectTECHit(collrphi, ttopo, 1, 1))); //side, disk
331  //std::cout << "wheel 0" << std::endl;
332  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[1], selectTECHit(collrphi, ttopo, 1, 2)));
333  //std::cout << "wheel 1" << std::endl;
334  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[2], selectTECHit(collrphi, ttopo, 1, 3)));
335  //std::cout << "wheel 2" << std::endl;
336  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[3], selectTECHit(collrphi, ttopo, 1, 4)));
337  //std::cout << "wheel 3" << std::endl;
338  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[4], selectTECHit(collrphi, ttopo, 1, 5)));
339  //std::cout << "wheel 4" << std::endl;
340  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[5], selectTECHit(collrphi, ttopo, 1, 6)));
341  //std::cout << "wheel 5" << std::endl;
342  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[6], selectTECHit(collrphi, ttopo, 1, 7)));
343  //std::cout << "wheel 6" << std::endl;
344  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[7], selectTECHit(collrphi, ttopo, 1, 8)));
345  //std::cout << "wheel 7" << std::endl;
346  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[8], selectTECHit(collrphi, ttopo, 1, 9)));
347  //std::cout << "wheel 8" << std::endl;
348 }
349 
350 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripRecHit2DCollection &collrphi,
351  const TrackerTopology &ttopo,
352  int side,
353  int disk) {
354  std::vector<const TrackingRecHit *> theChoosedHits;
355  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
356  return theChoosedHits;
357 }
358 
359 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripRecHit2DCollection &collrphi,
360  const TrackerTopology &ttopo,
361  int layer) {
362  std::vector<const TrackingRecHit *> theChoosedHits;
363  //std::cout << "in selectTIBHit" << std::endl;
364  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
365  return theChoosedHits;
366 }
367 
368 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripRecHit2DCollection &collrphi,
369  const TrackerTopology &ttopo,
370  int layer) {
371  std::vector<const TrackingRecHit *> theChoosedHits;
372  //std::cout << "in selectTOBHit" << std::endl;
373  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
374  return theChoosedHits;
375 }
376 
377 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripMatchedRecHit2DCollection &collmatch,
378  const TrackerTopology &ttopo,
379  int side,
380  int disk) {
381  std::vector<const TrackingRecHit *> theChoosedHits;
382  //std::cout << "in selectTECHit" << std::endl;
383  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
384  return theChoosedHits;
385 }
386 
387 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripMatchedRecHit2DCollection &collmatch,
388  const TrackerTopology &ttopo,
389  int layer) {
390  std::vector<const TrackingRecHit *> theChoosedHits;
391  //std::cout << "in selectTIBHit" << std::endl;
392  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
393  return theChoosedHits;
394 }
395 
396 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripMatchedRecHit2DCollection &collmatch,
397  const TrackerTopology &ttopo,
398  int layer) {
399  std::vector<const TrackingRecHit *> theChoosedHits;
400  //std::cout << "in selectTOBHit" << std::endl;
401  edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
402  return theChoosedHits;
403 }
CosmicLayerPairs::TECMinusLayerWithHits
edm::OwnVector< LayerWithHits > TECMinusLayerWithHits
Definition: CosmicLayerPairs.h:41
TrackerTopology::tobDetIdLayerComparator
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:552
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
MessageLogger.h
TrackerGeometry.h
CosmicLayerPairs::MTCCLayerWithHits
edm::OwnVector< LayerWithHits > MTCCLayerWithHits
Definition: CosmicLayerPairs.h:44
CosmicLayerPairs::selectTECHit
std::vector< const TrackingRecHit * > selectTECHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int side, int disk)
Definition: CosmicLayerPairs.cc:350
ESHandle.h
TrackerTopology::tibDetIdLayerComparator
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:544
TrackerTopology
Definition: TrackerTopology.h:16
CosmicLayerPairs::bl
std::vector< BarrelDetLayer const * > bl
Definition: CosmicLayerPairs.h:37
TrackerRecoGeometryRecord.h
CosmicLayerPairs::_geometry
std::string _geometry
Definition: CosmicLayerPairs.h:35
CosmicLayerPairs::~CosmicLayerPairs
~CosmicLayerPairs() override
Definition: CosmicLayerPairs.cc:237
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:11
GeometricSearchTracker.h
TrackerTopology.h
TrackerTopologyRcd.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::ESHandle< GeometricSearchTracker >
CosmicLayerPairs::selectTOBHit
std::vector< const TrackingRecHit * > selectTOBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
Definition: CosmicLayerPairs.cc:368
edmNew::copyDetSetRange
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
Definition: DetSetAlgorithm.h:42
TrackerDigiGeometryRecord.h
CosmicLayerPairs::init
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &iSetup)
Definition: CosmicLayerPairs.cc:239
CosmicLayerPairs::operator()
std::vector< SeedLayerPairs::LayerPair > operator()() override
Definition: CosmicLayerPairs.cc:15
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
CosmicLayerPairs::TECPlusLayerWithHits
edm::OwnVector< LayerWithHits > TECPlusLayerWithHits
Definition: CosmicLayerPairs.h:40
CosmicLayerPairs.h
edmNew::DetSetVector
Definition: DetSetNew.h:13
TrackerTopology::tecDetIdWheelComparator
std::pair< DetId, SameLayerComparator > tecDetIdWheelComparator(uint32_t side, uint32_t wheel) const
Definition: TrackerTopology.h:540
Exception
Definition: hltDiff.cc:246
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
SeedLayerPairs::LayerPair
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
Definition: SeedLayerPairs.h:19
CosmicLayerPairs::CRACKLayerWithHits
edm::OwnVector< LayerWithHits > CRACKLayerWithHits
Definition: CosmicLayerPairs.h:45
mps_fire.result
result
Definition: mps_fire.py:311
CosmicLayerPairs::selectTIBHit
std::vector< const TrackingRecHit * > selectTIBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
Definition: CosmicLayerPairs.cc:359
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
CosmicLayerPairs::TOBLayerWithHits
edm::OwnVector< LayerWithHits > TOBLayerWithHits
Definition: CosmicLayerPairs.h:43
LayerWithHits
Definition: LayerWithHits.h:12
CosmicLayerPairs::fneg
std::vector< ForwardDetLayer const * > fneg
Definition: CosmicLayerPairs.h:39
CosmicLayerPairs::TIBLayerWithHits
edm::OwnVector< LayerWithHits > TIBLayerWithHits
Definition: CosmicLayerPairs.h:42
CosmicLayerPairs::fpos
std::vector< ForwardDetLayer const * > fpos
Definition: CosmicLayerPairs.h:38