CMS 3D CMS Logo

CmsMTDTrayBuilder.cc
Go to the documentation of this file.
9 
10 #include <vector>
11 #include <bitset>
12 
14 
15  CmsMTDModuleBuilder theCmsMTDModuleBuilder;
16 
20  theCmsMTDModuleBuilder.build(fv,subdet,side);
21  break;
22  default:
23  throw cms::Exception("CmsMTDTrayBuilder")<<" ERROR - I was expecting a Tray, I got a "<< fv.logicalPart().name().fullname();
24  }
25 
26  g->addComponent(subdet);
27 }
28 
30 
32 
33  //order ladder and rings together
35  rods.clear();
36 
37 
38  for(uint32_t i=0; i<comp.size();i++){
39  auto component = det->component(i);
40  if(component->type()== GeometricTimingDet::BTLTray){
41  rods.emplace_back(component);
42  } else {
43  edm::LogError("CmsMTDOTLayerBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type();
44  }
45  }
46 
47  // rods
48  if(!rods.empty()){
49  mtdStablePhiSort(rods.begin(), rods.end(), getPhi);
50  uint32_t totalrods = rods.size();
51 
52  LogTrace("DetConstruction") << " Rods ordered by phi: ";
53  for ( uint32_t rod = 0; rod < totalrods; rod++) {
54  uint32_t temp = rod+1;
55  temp|=(3<<8);
56  rods[rod]->setGeographicalID(DetId(temp));
57  LogTrace("BuildingMTDDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(rods[rod]->translation().Perp2()) << ", phi: " << rods[rod]->phi() << ", z: " << rods[rod]->translation().z() << ")";
58  }
59  }
60 
61  det->clearComponents();
62  det->addComponents(rods);
63 
64 }
65 
std::vector< GeometricTimingDet * > GeometricTimingDetContainer
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:74
void sortNS(DDFilteredView &, GeometricTimingDet *) override
CmsMTDStringToEnum theCmsMTDStringToEnum
static double getPhi(const GeometricTimingDet *a)
void addComponents(GeometricTimingDetContainer const &cont)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
ConstGeometricTimingDetContainer & components()
T sqrt(T t)
Definition: SSEVec.h:18
void addComponent(GeometricTimingDet *)
const std::string fullname() const
Definition: DDName.h:43
GeometricTimingDet * component(size_t index)
#define LogTrace(id)
void build(DDFilteredView &, GeometricTimingDet *, std::string) override
Definition: DetId.h:18
void buildComponent(DDFilteredView &, GeometricTimingDet *, std::string) override
void mtdStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer