test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CosmicLayerPairs.cc
Go to the documentation of this file.
4 
6 
11 
14 
15 std::vector<SeedLayerPairs::LayerPair> CosmicLayerPairs::operator()()
16 {
17  std::vector<SeedLayerPairs::LayerPair> result;
18 
19  if (_geometry=="STANDARD"){
20 // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
21 // result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
22 
23  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
24  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
25  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
26 
29 
32 
35 
38 
41 
44 
47 
49 
50 
53 
56 
59 
62 
65 
68 
71 
73 
74 
75  }
76  else if(_geometry=="TECPAIRS_TOBTRIPLETS"){
79 
82 
85 
88 
91 
94 
97 
99 
100 
103 
106 
109 
112 
115 
118 
121 
123 
124 
125  }
126  else if (_geometry=="MTCC"){
129  //IMPORTANT
130  // The seed from overlaps must be at the end
133  }
134  else if (_geometry=="CRACK"){
135  //TODO: clean all this. Now this is a random choice of layers
150  }
151  else if (_geometry=="TIBD+"){
152  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1],&TIBLayerWithHits[0]));
153  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2],&TIBLayerWithHits[3]));
154  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0],&TIBLayerWithHits[0]));
155  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1],&TIBLayerWithHits[1]));
156  }
157  else if (_geometry=="TOB") {
158  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
159  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
160  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
161 
162  }
163  else if(_geometry=="TIBTOB") {
164  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
165  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
166 
167  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
168  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
169  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
170 
171  }
172  else if (_geometry=="TEC+") {
175 
178 
181 
184 
187 
190 
193 
195 
196  }
197  else if (_geometry=="CkfTIBD+"){
198  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
199  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[3]));
200  }
201  else if (_geometry=="CkfTIBTOB"){
202  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
203  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
204 
205  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
206  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
207  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
208  }
209  else if (_geometry=="CkfTIF3"){
210  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
211  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
212 
213  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
214  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
215  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
216 
219 
222 
225 
228 
231 
234 
237 
239 
240  }
241  else if (_geometry=="CkfTOB"){
242  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[1]));
243  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[2]));
244 
245  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
246  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
247  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
248  }
249  else {throw cms::Exception("CosmicLayerPairs") << "The geometry " << _geometry << " is not implemented ";}
250  return result;
251 }
253 
254 
255 
257  const SiStripRecHit2DCollection &collrphi,
258  const SiStripMatchedRecHit2DCollection &collmatched,
259  //std::string geometry,
260  const edm::EventSetup& iSetup){
262  //_geometry=geometry;
263  //if(isFirstCall){
264  //std::cout << "in isFirtsCall" << std::endl;
266  iSetup.get<TrackerRecoGeometryRecord>().get( track );
267  //std::cout << "about to take barrel" << std::endl;
268  bl=track->barrelLayers();
269  //std::cout << "barrel taken" << std::endl;
270  fpos=track->posTecLayers();
271  //std::cout << "pos forw taken" << std::endl;
272  fneg=track->negTecLayers();
273  //std::cout << "neg forw taken" << std::endl;
274  //isFirstCall=false;
275 
277  iSetup.get<TrackerTopologyRcd>().get(httopo);
278  const TrackerTopology& ttopo = *httopo;
279 
280  if (_geometry=="MTCC"){//we have to distinguish the MTCC and CRACK case because they have special geometries with different neumbering of layers
281  MTCCLayerWithHits.push_back(new LayerWithHits(bl[0], selectTIBHit(collrphi, ttopo, 1)));
282  MTCCLayerWithHits.push_back(new LayerWithHits(bl[1], selectTIBHit(collrphi, ttopo, 2)));
283  MTCCLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 1)));
284  MTCCLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 2)));
285  return;
286  }
287  if (_geometry=="CRACK"){
288  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collmatched, ttopo, 7)));
289  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collmatched, ttopo, 6)));
290  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collmatched, ttopo, 4)));
291  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collmatched, ttopo, 3)));
292  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collrphi, ttopo, 7)));
293  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collrphi, ttopo, 6)));
294  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 4)));
295  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 3)));
296  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collrphi, ttopo, 5)));
297  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collrphi, ttopo, 2)));
298  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collrphi, ttopo, 1)));
299  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collmatched, ttopo, 5)));
300  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collmatched, ttopo, 2)));
301  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collmatched, ttopo, 1)));
302  return;
303  }
304 
305  TIBLayerWithHits.push_back(new LayerWithHits(bl[3], selectTIBHit(collrphi, ttopo, 1))); //layer
306  //std::cout << "TIB 0" << std::endl;
307  TIBLayerWithHits.push_back(new LayerWithHits(bl[4], selectTIBHit(collrphi, ttopo, 2)));
308  //std::cout << "TIB 1" << std::endl;
309  TIBLayerWithHits.push_back(new LayerWithHits(bl[5], selectTIBHit(collrphi, ttopo, 3)));
310  //std::cout << "TIB 2" << std::endl;
311  TIBLayerWithHits.push_back(new LayerWithHits(bl[6], selectTIBHit(collrphi, ttopo, 4)));
312  //std::cout << "TIB 3" << std::endl;
313 
314  TOBLayerWithHits.push_back(new LayerWithHits(bl[7], selectTOBHit(collrphi, ttopo, 1)));
315  //std::cout << "TOB 0" << std::endl;
316  TOBLayerWithHits.push_back(new LayerWithHits(bl[8], selectTOBHit(collrphi, ttopo, 2)));
317  //std::cout << "TOB 1" << std::endl;
318  TOBLayerWithHits.push_back(new LayerWithHits(bl[9], selectTOBHit(collrphi, ttopo, 3)));
319  //std::cout << "TOB 2" << std::endl;
320  TOBLayerWithHits.push_back(new LayerWithHits(bl[10], selectTOBHit(collrphi, ttopo, 4)));
321  //std::cout << "TOB 3" << std::endl;
322  TOBLayerWithHits.push_back(new LayerWithHits(bl[11], selectTOBHit(collrphi, ttopo, 5)));
323  //std::cout << "TOB 4" << std::endl;
324  TOBLayerWithHits.push_back(new LayerWithHits(bl[12], selectTOBHit(collrphi, ttopo, 6)));
325  //std::cout << "TOB 5" << std::endl;
326 
327 
328  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[0], selectTECHit(collrphi, ttopo, 2, 1))); //side, disk
329  //std::cout << "wheel 0" << std::endl;
330  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[1], selectTECHit(collrphi, ttopo, 2, 2)));
331  //std::cout << "wheel 1" << std::endl;
332  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[2], selectTECHit(collrphi, ttopo, 2, 3)));
333  //std::cout << "wheel 2" << std::endl;
334  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[3], selectTECHit(collrphi, ttopo, 2, 4)));
335  //std::cout << "wheel 3" << std::endl;
336  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[4], selectTECHit(collrphi, ttopo, 2, 5)));
337  //std::cout << "wheel 4" << std::endl;
338  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[5], selectTECHit(collrphi, ttopo, 2, 6)));
339  //std::cout << "wheel 5" << std::endl;
340  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[6], selectTECHit(collrphi, ttopo, 2, 7)));
341  //std::cout << "wheel 6" << std::endl;
342  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[7], selectTECHit(collrphi, ttopo, 2, 8)));
343  //std::cout << "wheel 7" << std::endl;
344  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[8], selectTECHit(collrphi, ttopo, 2, 9)));
345  //std::cout << "wheel 8" << std::endl;
346 
347  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[0], selectTECHit(collrphi, ttopo, 1, 1))); //side, disk
348  //std::cout << "wheel 0" << std::endl;
349  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[1], selectTECHit(collrphi, ttopo, 1, 2)));
350  //std::cout << "wheel 1" << std::endl;
351  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[2], selectTECHit(collrphi, ttopo, 1, 3)));
352  //std::cout << "wheel 2" << std::endl;
353  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[3], selectTECHit(collrphi, ttopo, 1, 4)));
354  //std::cout << "wheel 3" << std::endl;
355  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[4], selectTECHit(collrphi, ttopo, 1, 5)));
356  //std::cout << "wheel 4" << std::endl;
357  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[5], selectTECHit(collrphi, ttopo, 1, 6)));
358  //std::cout << "wheel 5" << std::endl;
359  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[6], selectTECHit(collrphi, ttopo, 1, 7)));
360  //std::cout << "wheel 6" << std::endl;
361  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[7], selectTECHit(collrphi, ttopo, 1, 8)));
362  //std::cout << "wheel 7" << std::endl;
363  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[8], selectTECHit(collrphi, ttopo, 1, 9)));
364  //std::cout << "wheel 8" << std::endl;
365 }
366 
367 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTECHit(const SiStripRecHit2DCollection &collrphi,
368  const TrackerTopology& ttopo,
369  int side,
370  int disk){
371  std::vector<const TrackingRecHit*> theChoosedHits;
372  edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tecDetIdWheelComparator(side,disk));
373  return theChoosedHits;
374 
375 }
376 
377 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTIBHit(const SiStripRecHit2DCollection &collrphi,
378  const TrackerTopology& ttopo,
379  int layer){
380  std::vector<const TrackingRecHit*> theChoosedHits;
381  //std::cout << "in selectTIBHit" << std::endl;
382  edmNew::copyDetSetRange(collrphi,theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
383  return theChoosedHits;
384 
385 }
386 
387 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTOBHit(const SiStripRecHit2DCollection &collrphi,
388  const TrackerTopology& ttopo,
389  int layer){
390  std::vector<const TrackingRecHit*> theChoosedHits;
391  //std::cout << "in selectTOBHit" << std::endl;
392  edmNew::copyDetSetRange(collrphi,theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
393  return theChoosedHits;
394 }
395 
396 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTECHit(const SiStripMatchedRecHit2DCollection &collmatch,
397  const TrackerTopology& ttopo,
398  int side,
399  int disk){
400  std::vector<const TrackingRecHit*> theChoosedHits;
401  //std::cout << "in selectTECHit" << std::endl;
402  edmNew::copyDetSetRange(collmatch,theChoosedHits, ttopo.tecDetIdWheelComparator(side,disk));
403  return theChoosedHits;
404 
405 }
406 
407 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTIBHit(const SiStripMatchedRecHit2DCollection &collmatch,
408  const TrackerTopology& ttopo,
409  int layer){
410  std::vector<const TrackingRecHit*> theChoosedHits;
411  //std::cout << "in selectTIBHit" << std::endl;
412  edmNew::copyDetSetRange(collmatch,theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
413  return theChoosedHits;
414 
415 }
416 
417 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTOBHit(const SiStripMatchedRecHit2DCollection &collmatch,
418  const TrackerTopology& ttopo,
419  int layer){
420  std::vector<const TrackingRecHit*> theChoosedHits;
421  //std::cout << "in selectTOBHit" << std::endl;
422  edmNew::copyDetSetRange(collmatch,theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
423  return theChoosedHits;
424 }
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
std::vector< SeedLayerPairs::LayerPair > operator()()
edm::OwnVector< LayerWithHits > TIBLayerWithHits
edm::OwnVector< LayerWithHits > TOBLayerWithHits
void push_back(D *&d)
Definition: OwnVector.h:280
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
std::vector< BarrelDetLayer const * > bl
std::vector< const TrackingRecHit * > selectTECHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int side, int disk)
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
tuple result
Definition: query.py:137
edm::OwnVector< LayerWithHits > MTCCLayerWithHits
edm::OwnVector< LayerWithHits > TECMinusLayerWithHits
std::pair< DetId, SameLayerComparator > tecDetIdWheelComparator(uint32_t side, uint32_t wheel) const
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &iSetup)
edm::OwnVector< LayerWithHits > CRACKLayerWithHits
std::vector< const TrackingRecHit * > selectTOBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
const T & get() const
Definition: EventSetup.h:56
std::vector< ForwardDetLayer const * > fneg
std::vector< ForwardDetLayer const * > fpos
edm::OwnVector< LayerWithHits > TECPlusLayerWithHits
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
std::vector< const TrackingRecHit * > selectTIBHit(const SiStripRecHit2DCollection &collrphi, const TrackerTopology &ttopo, int layer)
std::string _geometry