CMS 3D CMS Logo

CmsMTDTrayBuilder.cc
Go to the documentation of this file.
9 
10 #include <functional>
11 #include <vector>
12 #include <bitset>
13 
15 
16  CmsMTDModuleBuilder theCmsMTDModuleBuilder;
17 
21  theCmsMTDModuleBuilder.build(fv,subdet,side);
22  break;
23  default:
24  throw cms::Exception("CmsMTDTrayBuilder")<<" ERROR - I was expecting a Tray, I got a "<< fv.logicalPart().name().fullname();
25  }
26 
27  g->addComponent(subdet);
28 }
29 
31 
33 
34  //order ladder and rings together
36  rods.clear();
37 
38 
39  for(uint32_t i=0; i<comp.size();i++){
40  auto component = det->component(i);
41  if(component->type()== GeometricTimingDet::BTLTray){
42  rods.emplace_back(component);
43  } else {
44  edm::LogError("CmsMTDOTLayerBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type();
45  }
46  }
47 
48  // rods
49  if(!rods.empty()){
50  MTDStablePhiSort(rods.begin(), rods.end(), std::function<double(const GeometricTimingDet*)>(getPhi));
51  uint32_t totalrods = rods.size();
52 
53  LogTrace("DetConstruction") << " Rods ordered by phi: ";
54  for ( uint32_t rod = 0; rod < totalrods; rod++) {
55  uint32_t temp = rod+1;
56  temp|=(3<<8);
57  rods[rod]->setGeographicalID(DetId(temp));
58  LogTrace("BuildingMTDDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(rods[rod]->translation().Perp2()) << ", phi: " << rods[rod]->phi() << ", z: " << rods[rod]->translation().z() << ")";
59  }
60  }
61 
62  det->clearComponents();
63  det->addComponents(rods);
64 
65 }
66 
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 MTDStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
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
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer