CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Private Member Functions
CmsTrackerWheelBuilder Class Reference

#include <CmsTrackerWheelBuilder.h>

Inheritance diagram for CmsTrackerWheelBuilder:
CmsTrackerLevelBuilder CmsTrackerAbstractConstruction

Private Member Functions

virtual void buildComponent (DDFilteredView &, GeometricDet *, std::string)
 
virtual void sortNS (DDFilteredView &, GeometricDet *)
 

Additional Inherited Members

- Public Member Functions inherited from CmsTrackerLevelBuilder
virtual void build (DDFilteredView &, GeometricDet *, std::string)
 
virtual ~CmsTrackerLevelBuilder ()
 
- Protected Attributes inherited from CmsTrackerLevelBuilder
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

Class which builds TEC wheels

Definition at line 11 of file CmsTrackerWheelBuilder.h.

Member Function Documentation

void CmsTrackerWheelBuilder::buildComponent ( DDFilteredView fv,
GeometricDet g,
std::string  s 
)
privatevirtual

Implements CmsTrackerLevelBuilder.

Definition at line 14 of file CmsTrackerWheelBuilder.cc.

References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), GeometricDet::petal, GeometricDet::ring, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum, and CmsTrackerStringToEnum::type().

14  {
15  CmsTrackerRingBuilder theCmsTrackerRingBuilder ;
16  CmsTrackerPetalBuilder theCmsTrackerPetalBuilder ;
17 
20  case GeometricDet::ring:
21  theCmsTrackerRingBuilder.build(fv,subdet,s);
22  break;
24  theCmsTrackerPetalBuilder.build(fv,subdet,s);
25  break;
26  default:
27  edm::LogError("CmsTrackerWheelBuilder")<<" ERROR - I was expecting a Ring or Petal, I got a "<<ExtractStringFromDDD::getString(s,&fv);
28  }
29  g->addComponent(subdet);
30 }
static std::string getString(std::string const &, DDFilteredView *)
void addComponent(GeometricDet *)
virtual void build(DDFilteredView &, GeometricDet *, std::string)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
void CmsTrackerWheelBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
privatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 32 of file CmsTrackerWheelBuilder.cc.

References GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), i, GeometricDet::petal, GeometricDet::setGeographicalID(), groupFilesInBlocks::temp, TrackerStablePhiSort(), GeometricDet::translation(), and z.

32  {
34 
35  if(comp.size()){
36  if(comp.front()->type()==GeometricDet::petal){
39  compfw.clear();
40  compbw.clear();
41  for(uint32_t i=0; i<comp.size();i++){
42  if(fabs(comp[i]->translation().z())<fabs(det->translation().z())){
43  compfw.push_back(det->component(i));
44  }else{
45  compbw.push_back(det->component(i));
46  }
47  }
48 
49  TrackerStablePhiSort(compfw.begin(), compfw.end(), ExtractPhiModule());
50  TrackerStablePhiSort(compbw.begin(), compbw.end(), ExtractPhiModule());
51 
52  //
53  // TEC
54  // Wheel Part: 3 bits [back:1 front:2]
55  // Petal Number: 4 bits [1,...,8]
56  //
57  for(uint32_t i=0; i<compbw.size(); i++){
58  uint32_t temp = i+1;
59  temp|=(1<<4);
60  compbw[i]->setGeographicalID(DetId(temp));
61  }
62  for(uint32_t i=0; i<compfw.size(); i++){
63  uint32_t temp = i+1;
64  temp|=(2<<4);
65  compfw[i]->setGeographicalID(DetId(temp));
66  }
67 
68  det->clearComponents();
69  det->addComponents(compfw);
70  det->addComponents(compbw);
71 
72  }else{
73  std::stable_sort(comp.begin(),comp.end(),LessR_module());
74 
75  // TID
76  // Disk Number: 2 bits [1,2,3]
77  for(uint32_t i=0; i<comp.size(); i++){
78  det->component(i)->setGeographicalID(DetId(i+1));
79  }
80  }
81  }else{
82  edm::LogError("CmsTrackerWheelBuilder")<<"Where are the Petals or Rings?";
83  }
84 
85 }
int i
Definition: DBlmapReader.cc:9
void clearComponents()
Definition: GeometricDet.h:96
void setGeographicalID(DetId id)
Definition: GeometricDet.h:80
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
void TrackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
DDTranslation const & translation() const
Definition: GeometricDet.h:123
GeometricDet * component(size_t index)
Definition: GeometricDet.h:112
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
Definition: DetId.h:18
void addComponents(GeometricDetContainer const &cont)