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 
12 
13 std::vector<SeedLayerPairs::LayerPair> CosmicLayerPairs::operator()()
14 {
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 
21  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
22  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
23  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
24 
27 
30 
33 
36 
39 
42 
45 
47 
48 
51 
54 
57 
60 
63 
66 
69 
71 
72 
73  }
74  else if(_geometry=="TECPAIRS_TOBTRIPLETS"){
77 
80 
83 
86 
89 
92 
95 
97 
98 
101 
104 
107 
110 
113 
116 
119 
121 
122 
123  }
124  else if (_geometry=="MTCC"){
127  //IMPORTANT
128  // The seed from overlaps must be at the end
131  }
132  else if (_geometry=="CRACK"){
133  //TODO: clean all this. Now this is a random choice of layers
148  }
149  else if (_geometry=="TIBD+"){
150  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1],&TIBLayerWithHits[0]));
151  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2],&TIBLayerWithHits[3]));
152  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0],&TIBLayerWithHits[0]));
153  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1],&TIBLayerWithHits[1]));
154  }
155  else if (_geometry=="TOB") {
156  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
157  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
158  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
159 
160  }
161  else if(_geometry=="TIBTOB") {
162  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
163  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
164 
165  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
166  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
167  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
168 
169  }
170  else if (_geometry=="TEC+") {
173 
176 
179 
182 
185 
188 
191 
193 
194  }
195  else if (_geometry=="CkfTIBD+"){
196  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
197  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[3]));
198  }
199  else if (_geometry=="CkfTIBTOB"){
200  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
201  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
202 
203  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
204  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
205  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
206  }
207  else if (_geometry=="CkfTIF3"){
208  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
209  result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
210 
211  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
212  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
213  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
214 
217 
220 
223 
226 
229 
232 
235 
237 
238  }
239  else if (_geometry=="CkfTOB"){
240  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[1]));
241  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[2]));
242 
243  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
244  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
245  result.push_back( SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
246  }
247  else {throw cms::Exception("CosmicLayerPairs") << "The geometry " << _geometry << " is not implemented ";}
248  return result;
249 }
251 
252 
253 
255  const SiStripRecHit2DCollection &collrphi,
256  const SiStripMatchedRecHit2DCollection &collmatched,
257  //std::string geometry,
258  const edm::EventSetup& iSetup){
260  //_geometry=geometry;
261  //if(isFirstCall){
262  //std::cout << "in isFirtsCall" << std::endl;
264  iSetup.get<TrackerRecoGeometryRecord>().get( track );
265  //std::cout << "about to take barrel" << std::endl;
266  bl=track->barrelLayers();
267  //std::cout << "barrel taken" << std::endl;
268  fpos=track->posTecLayers();
269  //std::cout << "pos forw taken" << std::endl;
270  fneg=track->negTecLayers();
271  //std::cout << "neg forw taken" << std::endl;
272  //isFirstCall=false;
273 
274  if (_geometry=="MTCC"){//we have to distinguish the MTCC and CRACK case because they have special geometries with different neumbering of layers
279  return;
280  }
281  if (_geometry=="CRACK"){
282  CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collmatched, 7)));
283  CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collmatched, 6)));
284  CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collmatched, 4)));
285  CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collmatched, 3)));
293  CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collmatched, 5)));
294  CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collmatched, 2)));
295  CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collmatched, 1)));
296  return;
297  }
298 
299  TIBLayerWithHits.push_back(new LayerWithHits(bl[3], selectTIBHit(collrphi, 1))); //layer
300  //std::cout << "TIB 0" << std::endl;
301  TIBLayerWithHits.push_back(new LayerWithHits(bl[4], selectTIBHit(collrphi, 2)));
302  //std::cout << "TIB 1" << std::endl;
303  TIBLayerWithHits.push_back(new LayerWithHits(bl[5], selectTIBHit(collrphi, 3)));
304  //std::cout << "TIB 2" << std::endl;
305  TIBLayerWithHits.push_back(new LayerWithHits(bl[6], selectTIBHit(collrphi, 4)));
306  //std::cout << "TIB 3" << std::endl;
307 
308  TOBLayerWithHits.push_back(new LayerWithHits(bl[7], selectTOBHit(collrphi, 1)));
309  //std::cout << "TOB 0" << std::endl;
310  TOBLayerWithHits.push_back(new LayerWithHits(bl[8], selectTOBHit(collrphi, 2)));
311  //std::cout << "TOB 1" << std::endl;
312  TOBLayerWithHits.push_back(new LayerWithHits(bl[9], selectTOBHit(collrphi, 3)));
313  //std::cout << "TOB 2" << std::endl;
314  TOBLayerWithHits.push_back(new LayerWithHits(bl[10], selectTOBHit(collrphi, 4)));
315  //std::cout << "TOB 3" << std::endl;
316  TOBLayerWithHits.push_back(new LayerWithHits(bl[11], selectTOBHit(collrphi, 5)));
317  //std::cout << "TOB 4" << std::endl;
318  TOBLayerWithHits.push_back(new LayerWithHits(bl[12], selectTOBHit(collrphi, 6)));
319  //std::cout << "TOB 5" << std::endl;
320 
321 
322  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[0], selectTECHit(collrphi, 2, 1))); //side, disk
323  //std::cout << "wheel 0" << std::endl;
324  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[1], selectTECHit(collrphi, 2, 2)));
325  //std::cout << "wheel 1" << std::endl;
326  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[2], selectTECHit(collrphi, 2, 3)));
327  //std::cout << "wheel 2" << std::endl;
328  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[3], selectTECHit(collrphi, 2, 4)));
329  //std::cout << "wheel 3" << std::endl;
330  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[4], selectTECHit(collrphi, 2, 5)));
331  //std::cout << "wheel 4" << std::endl;
332  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[5], selectTECHit(collrphi, 2, 6)));
333  //std::cout << "wheel 5" << std::endl;
334  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[6], selectTECHit(collrphi, 2, 7)));
335  //std::cout << "wheel 6" << std::endl;
336  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[7], selectTECHit(collrphi, 2, 8)));
337  //std::cout << "wheel 7" << std::endl;
338  TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[8], selectTECHit(collrphi, 2, 9)));
339  //std::cout << "wheel 8" << std::endl;
340 
341  TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[0], selectTECHit(collrphi, 1, 1))); //side, disk
342  //std::cout << "wheel 0" << std::endl;
344  //std::cout << "wheel 1" << std::endl;
346  //std::cout << "wheel 2" << std::endl;
348  //std::cout << "wheel 3" << std::endl;
350  //std::cout << "wheel 4" << std::endl;
352  //std::cout << "wheel 5" << std::endl;
354  //std::cout << "wheel 6" << std::endl;
356  //std::cout << "wheel 7" << std::endl;
358  //std::cout << "wheel 8" << std::endl;
359 }
360 
361 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTECHit(const SiStripRecHit2DCollection &collrphi,
362  int side,
363  int disk){
364  std::vector<const TrackingRecHit*> theChoosedHits;
366  edmNew::copyDetSetRange(collrphi, theChoosedHits, acc.stripTECDisk(side,disk));
367  return theChoosedHits;
368 
369 }
370 
371 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTIBHit(const SiStripRecHit2DCollection &collrphi,
372  int layer){
373  std::vector<const TrackingRecHit*> theChoosedHits;
375  //std::cout << "in selectTIBHit" << std::endl;
376  edmNew::copyDetSetRange(collrphi,theChoosedHits,acc.stripTIBLayer(layer));
377  return theChoosedHits;
378 
379 }
380 
381 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTOBHit(const SiStripRecHit2DCollection &collrphi,
382  int layer){
383  std::vector<const TrackingRecHit*> theChoosedHits;
385  //std::cout << "in selectTOBHit" << std::endl;
386  edmNew::copyDetSetRange(collrphi,theChoosedHits,acc.stripTOBLayer(layer));
387  return theChoosedHits;
388 }
389 
390 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTECHit(const SiStripMatchedRecHit2DCollection &collmatch,
391  int side,
392  int disk){
393  std::vector<const TrackingRecHit*> theChoosedHits;
395  //std::cout << "in selectTECHit" << std::endl;
396  edmNew::copyDetSetRange(collmatch,theChoosedHits,acc.stripTECDisk(side,disk));
397  return theChoosedHits;
398 
399 }
400 
401 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTIBHit(const SiStripMatchedRecHit2DCollection &collmatch,
402  int layer){
403  std::vector<const TrackingRecHit*> theChoosedHits;
405  //std::cout << "in selectTIBHit" << std::endl;
406  edmNew::copyDetSetRange(collmatch,theChoosedHits,acc.stripTIBLayer(layer));
407  return theChoosedHits;
408 
409 }
410 
411 std::vector<const TrackingRecHit*> CosmicLayerPairs::selectTOBHit(const SiStripMatchedRecHit2DCollection &collmatch,
412  int layer){
413  std::vector<const TrackingRecHit*> theChoosedHits;
415  //std::cout << "in selectTOBHit" << std::endl;
416  edmNew::copyDetSetRange(collmatch,theChoosedHits,acc.stripTOBLayer(layer));
417  return theChoosedHits;
418 }
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
std::vector< const TrackingRecHit * > selectTOBHit(const SiStripRecHit2DCollection &collrphi, int layer)
std::vector< const TrackingRecHit * > selectTIBHit(const SiStripRecHit2DCollection &collrphi, int layer)
std::vector< SeedLayerPairs::LayerPair > operator()()
std::vector< ForwardDetLayer * > fneg
std::pair< DetId, DetIdTIBSameLayerComparator > stripTIBLayer(int layer)
edm::OwnVector< LayerWithHits > TIBLayerWithHits
edm::OwnVector< LayerWithHits > TOBLayerWithHits
void push_back(D *&d)
Definition: OwnVector.h:273
std::pair< DetId, DetIdTOBSameLayerComparator > stripTOBLayer(int layer)
std::vector< const TrackingRecHit * > selectTECHit(const SiStripRecHit2DCollection &collrphi, int side, int disk)
std::vector< BarrelDetLayer * > bl
tuple result
Definition: query.py:137
edm::OwnVector< LayerWithHits > MTCCLayerWithHits
std::pair< DetId, DetIdTECSameDiskComparator > stripTECDisk(int side, int disk)
edm::OwnVector< LayerWithHits > TECMinusLayerWithHits
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &iSetup)
edm::OwnVector< LayerWithHits > CRACKLayerWithHits
const T & get() const
Definition: EventSetup.h:55
std::vector< ForwardDetLayer * > fpos
edm::OwnVector< LayerWithHits > TECPlusLayerWithHits
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
std::string _geometry