CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Phase2OTBarrelRodBuilder.cc
Go to the documentation of this file.
3 
4 using namespace edm;
5 using namespace std;
6 
8  const TrackerGeometry* theGeomDetGeometry)
9 {
10  vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components();
11 
12  vector<const GeomDet*> innerGeomDets;
13  vector<const GeomDet*> outerGeomDets;
14  vector<const GeomDet*> innerGeomDetBrothers;
15  vector<const GeomDet*> outerGeomDetBrothers;
16 
17  // compute meanR using the first and the third module because of the pt module pairs
18  LogDebug("Phase2OTBarrelRodRadii") << "mean computed with "
19  << allGeometricDets[0]->positionBounds().perp()
20  << " and " << allGeometricDets[2]->positionBounds().perp()
21  << " and " << allGeometricDets[1]->positionBounds().perp()
22  << " and " << allGeometricDets[3]->positionBounds().perp() ;
23  double meanR = (allGeometricDets[0]->positionBounds().perp()+allGeometricDets[2]->positionBounds().perp())/2;
24  double meanRBrothers = (allGeometricDets[1]->positionBounds().perp()+allGeometricDets[3]->positionBounds().perp())/2;
25 
26  unsigned int counter=0;
27  for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin();
28  it!=allGeometricDets.end(); it++,counter++){
29  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
30 
31  if(counter%2==0) {
32  if( (*it)->positionBounds().perp() < meanR)
33  innerGeomDets.push_back(theGeomDet);
34 
35  if( (*it)->positionBounds().perp() > meanR)
36  outerGeomDets.push_back(theGeomDet);
37  }
38  else {
39  if( (*it)->positionBounds().perp() < meanRBrothers)
40  innerGeomDetBrothers.push_back(theGeomDet);
41 
42  if( (*it)->positionBounds().perp() > meanRBrothers)
43  outerGeomDetBrothers.push_back(theGeomDet);
44  }
45  }
46 
47  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
48  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
49  return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers);
50 }
#define LogDebug(id)
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
static std::atomic< unsigned int > counter
virtual const TrackerGeomDet * idToDet(DetId) const