|
|
Go to the documentation of this file.
27 : theTracker(aliTracker),
30 theSelectedAlignables(),
70 unsigned int addedSets = 0;
72 for (
unsigned int iSel = 0; iSel <
selections.size(); ++iSel) {
73 std::vector<std::string> decompSel(this->
decompose(selections[iSel],
','));
74 if (decompSel.empty())
77 if (decompSel.size() < 2) {
79 <<
" from alignableParamSelector: "
80 <<
" should have at least 2 ','-separated parts";
81 }
else if (decompSel.size() > 2) {
102 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
106 if (*iParam ==
"etaRanges") {
108 }
else if (*iParam ==
"phiRanges") {
110 }
else if (*iParam ==
"rRanges") {
112 }
else if (*iParam ==
"xRanges") {
114 }
else if (*iParam ==
"yRanges") {
116 }
else if (*iParam ==
"zRanges") {
118 }
else if (*iParam ==
"detIds") {
120 }
else if (*iParam ==
"detIdRanges") {
122 }
else if (*iParam ==
"excludedDetIds") {
124 }
else if (*iParam ==
"excludedDetIdRanges") {
126 }
else if (*iParam ==
"pxbDetId") {
129 }
else if (*iParam ==
"pxfDetId") {
132 }
else if (*iParam ==
"tibDetId") {
135 }
else if (*iParam ==
"tidDetId") {
138 }
else if (*iParam ==
"tobDetId") {
141 }
else if (*iParam ==
"tecDetId") {
145 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setGeometryCuts] "
146 <<
"Unknown parameter '" << *iParam <<
"'.\n";
157 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
161 if (*iParam ==
"ladderRanges") {
163 }
else if (*iParam ==
"layerRanges") {
165 }
else if (*iParam ==
"moduleRanges") {
168 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setPXBDetIdCuts] "
169 <<
"Unknown parameter '" << *iParam <<
"'.\n";
180 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
184 if (*iParam ==
"bladeRanges") {
186 }
else if (*iParam ==
"diskRanges") {
188 }
else if (*iParam ==
"moduleRanges") {
190 }
else if (*iParam ==
"panelRanges") {
192 }
else if (*iParam ==
"sideRanges") {
195 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setPXFDetIdCuts] "
196 <<
"Unknown parameter '" << *iParam <<
"'.\n";
207 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
211 if (*iParam ==
"layerRanges") {
213 }
else if (*iParam ==
"moduleRanges") {
215 }
else if (*iParam ==
"stringRanges") {
217 }
else if (*iParam ==
"sideRanges") {
220 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTIBDetIdCuts] "
221 <<
"Unknown parameter '" << *iParam <<
"'.\n";
232 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
236 if (*iParam ==
"diskRanges") {
238 }
else if (*iParam ==
"moduleRanges") {
240 }
else if (*iParam ==
"ringRanges") {
242 }
else if (*iParam ==
"sideRanges") {
245 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTIDDetIdCuts] "
246 <<
"Unknown parameter '" << *iParam <<
"'.\n";
257 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
261 if (*iParam ==
"layerRanges") {
263 }
else if (*iParam ==
"moduleRanges") {
265 }
else if (*iParam ==
"sideRanges") {
267 }
else if (*iParam ==
"rodRanges") {
270 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTOBDetIdCuts] "
271 <<
"Unknown parameter '" << *iParam <<
"'.\n";
282 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
286 if (*iParam ==
"wheelRanges") {
288 }
else if (*iParam ==
"petalRanges") {
290 }
else if (*iParam ==
"moduleRanges") {
292 }
else if (*iParam ==
"ringRanges") {
294 }
else if (*iParam ==
"sideRanges") {
297 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTECDetIdCuts] "
298 <<
"Unknown parameter '" << *iParam <<
"'.\n";
305 const std::vector<char> ¶mSel,
315 unsigned int numAli = 0;
320 if (
name.find(
"Tracker") == 0) {
322 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] "
323 <<
"Configuration requires access to AlignableTracker"
324 <<
" (for " <<
name <<
") that is not initialized";
332 else if (
name ==
"AllDets")
334 else if (
name ==
"AllRods")
336 else if (
name ==
"AllLayers")
338 else if (
name ==
"AllComponents")
340 else if (
name ==
"AllAlignables")
345 else if (
name ==
"BarrelRods")
347 else if (
name ==
"BarrelDets")
349 else if (
name ==
"BarrelLayers")
351 else if (
name ==
"TOBDets")
353 else if (
name ==
"TOBRods")
355 else if (
name ==
"TOBLayers")
357 else if (
name ==
"TOBHalfBarrels")
359 else if (
name ==
"TIBDets")
361 else if (
name ==
"TIBRods")
363 else if (
name ==
"TIBLayers")
365 else if (
name ==
"TIBHalfBarrels")
370 else if (
name ==
"PixelHalfBarrelDets") {
372 }
else if (
name ==
"PixelHalfBarrelLadders") {
374 }
else if (
name ==
"PixelHalfBarrelLayers") {
376 }
else if (
name ==
"PixelHalfBarrels") {
382 else if (
name ==
"PXECDets")
384 else if (
name ==
"PXECPetals")
386 else if (
name ==
"PXECLayers")
388 else if (
name ==
"PXECHalfCylinders")
390 else if (
name ==
"PXEndCaps")
395 else if (
name ==
"PixelDets") {
398 }
else if (
name ==
"PixelRods") {
401 }
else if (
name ==
"PixelLayers") {
408 else if (
name ==
"TIDs")
410 else if (
name ==
"TIDLayers")
412 else if (
name ==
"TIDRings")
414 else if (
name ==
"TIDDets")
419 else if (
name ==
"TECDets")
421 else if (
name ==
"TECPetals")
423 else if (
name ==
"TECLayers")
425 else if (
name ==
"TECs")
430 else if (
name ==
"EndcapDets") {
433 }
else if (
name ==
"EndcapPetals") {
436 }
else if (
name ==
"EndcapLayers") {
443 else if (
name ==
"StripDets") {
447 }
else if (
name ==
"StripRods") {
451 }
else if (
name ==
"StripLayers") {
460 else if (
name.find(
"Muon") != std::string::npos) {
462 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] "
463 <<
"Configuration requires access to AlignableMuon"
464 <<
" which is not initialized";
465 }
else if (
name ==
"MuonDTLayers")
467 else if (
name ==
"MuonDTSuperLayers")
469 else if (
name ==
"MuonDTChambers")
471 else if (
name ==
"MuonDTStations")
473 else if (
name ==
"MuonDTWheels")
475 else if (
name ==
"MuonBarrel")
477 else if (
name ==
"MuonCSCLayers")
479 else if (
name ==
"MuonCSCRings")
481 else if (
name ==
"MuonCSCChambers")
483 else if (
name ==
"MuonCSCStations")
485 else if (
name ==
"MuonEndcaps")
492 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]"
493 <<
": Selection '" <<
name <<
"' invalid!";
500 else if (
name.find(
"Extras") == 0) {
502 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] "
503 <<
"Configuration requires access to AlignableExtras"
504 <<
" (for " <<
name <<
") that is not initialized";
512 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]"
513 <<
": Selection '" <<
name <<
"' invalid!";
523 unsigned int numAli = 0;
526 for (align::Alignables::const_iterator iAli = alignables.begin(); iAli != alignables.end(); ++iAli) {
546 int type = typeLayer.first;
547 int layer = typeLayer.second;
608 const DetId detId(alignable->
id());
609 const int subdetId = detId.
subdetId();
723 template <
typename T>
727 if (
ranges.size() % 2 != 0) {
728 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges"
729 <<
" need even number of entries in ranges instead of " <<
ranges.size();
733 for (
unsigned int i = 0;
i <
ranges.size();
i += 2) {
738 if (rangePhi1 <= valuePhi && valuePhi < rangePhi2) {
741 if (rangePhi2 < rangePhi1 && (rangePhi1 <= valuePhi || valuePhi < rangePhi2)) {
754 bool AlignmentParameterSelector::insideRanges<int>(
int value,
const std::vector<int> &
ranges,
bool )
const {
755 if (
ranges.size() % 2 != 0) {
756 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges"
757 <<
" need even number of entries in ranges instead of " <<
ranges.size();
761 for (
unsigned int i = 0;
i <
ranges.size();
i += 2) {
778 std::vector<std::string>
result;
783 if (delimiterPos == std::string::npos) {
784 result.push_back(
s.substr(previousPos));
787 result.push_back(
s.substr(previousPos, delimiterPos - previousPos));
788 previousPos = delimiterPos + 1;
801 std::vector<char>
result(selString.size());
817 if (
ss != std::string::npos) {
825 if (ds != std::string::npos) {
847 if (
newName.rfind(
"Unit") != std::string::npos) {
849 if (uRph != std::string::npos) {
854 if (uSte != std::string::npos) {
861 LogDebug(
"Alignment") <<
"@SUB=AlignmentParameterSelector::setSpecials" <<
name <<
" becomes " <<
newName
862 <<
", makes theOnlySS " <<
theOnlySS <<
", theOnlyDS " <<
theOnlyDS <<
", theSelLayers "
872 unsigned int numAli = 0;
885 unsigned int numAli = 0;
898 unsigned int numAli = 0;
911 unsigned int numAli = 0;
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
Alignables & TIDLayers()
Return TID layers.
unsigned int add(const align::Alignables &alignables, const std::vector< char > ¶mSel)
adding alignables which fulfil geometrical restrictions and special switches
std::vector< int > theRodRanges
Alignables & pixelEndCaps()
Return TPEs.
std::vector< std::string > decompose(const std::string &s, std::string::value_type delimiter) const
Decomposing input string 's' into parts separated by 'delimiter'.
unsigned int addAllAlignables(const std::vector< char > ¶mSel)
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
unsigned int pxfSide(const DetId &id) const
std::vector< int > theExcludedDetIdRanges
const Alignables & components() const override
Return vector of direct components.
unsigned int addAllRods(const std::vector< char > ¶mSel)
Alignables & innerHalfBarrels()
Return TIB half barrels.
align::Alignables CSCLayers()
unsigned int pxbLadder(const DetId &id) const
std::vector< int > theBladeRanges
std::vector< int > theModuleRanges
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
std::vector< int > theLadderRanges
std::vector< int > theLayerRanges
AlignableExtras * theExtras
Alignables & endCaps()
Return TECs.
Alignables & pixelEndcapLayers()
Return pixel endcap layers.
std::vector< int > theModuleRanges
std::vector< int > theExcludedDetIds
align::Alignables CSCChambers()
Alignables & innerBarrelRods()
Return inner barrel rods.
std::vector< int > theDiskRanges
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > theDetIdRanges
unsigned int tidModule(const DetId &id) const
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
align::Alignables CSCStations()
unsigned int tidRing(const DetId &id) const
Alignables barrelRods()
Return inner and outer barrel rods.
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
Alignables & outerBarrelLayers()
Return outer barrel layers.
unsigned int tobRod(const DetId &id) const
Alignables & outerBarrelRods()
Return outer barrel rods.
unsigned int tidWheel(const DetId &id) const
std::vector< int > theSideRanges
void setTECDetIdCuts(const edm::ParameterSet &pSet)
unsigned int pxbLayer(const DetId &id) const
unsigned int tibSide(const DetId &id) const
unsigned int pxfPanel(const DetId &id) const
Alignables & endcapGeomDets()
Return endcap GeomDets.
std::vector< int > theRingRanges
bool outsideGeometricalRanges(const Alignable *alignable) const
true if geometrical restrictions in eta, phi, r, x, y, z not satisfied
void setPXFDetIdCuts(const edm::ParameterSet &pSet)
align::Alignables DTChambers()
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
std::vector< int > theLayerRanges
std::string setSpecials(const std::string &name)
std::vector< int > theSideRanges
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
std::vector< int > theLayerRanges
Alignables & innerBarrelLayers()
Return inner barrel layers.
align::Alignables DTSuperLayers()
std::vector< int > theModuleRanges
align::Alignables DTLayers()
Methods to return specific of components.
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
Alignables & pixelHalfBarrels()
Return Pixel half barrels.
std::vector< int > theSideRanges
Alignables & TIDRings()
Return TID rings.
void clear()
remove all selected Alignables and geometrical restrictions
Alignables & subStructures(const std::string &subStructName)
align::Alignables DTBarrel()
Alignables & pixelHalfBarrelLadders()
Return pixel half barrel ladders (implemented as AlignableRods)
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
static constexpr auto TEC
std::vector< int > theModuleRanges
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
constexpr std::array< uint8_t, layerIndexSize > layer
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
std::vector< int > theModuleRanges
std::vector< int > thePetalRanges
align::Alignables theSelectedAlignables
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
unsigned int tibString(const DetId &id) const
RphiOrStereoDetUnit theRphiOrStereoDetUnit
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
bool layerDeselected(const Alignable *alignable) const
true if layer is deselected via "Layers<N><M>" or "DS/SS"
unsigned int tecPetalNumber(const DetId &id) const
const AlignableTracker * alignableTracker() const
Alignables & endcapLayers()
Return endcap layers.
align::Alignables DTWheels()
Alignables & pixelEndcapHalfCylinders()
Return pixel endcap half cylinders.
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
std::vector< std::string > getParameterNames() const
static int position[264][3]
Constructor of the full muon geometry.
unsigned int tibModule(const DetId &id) const
unsigned int tidSide(const DetId &id) const
Alignables barrelGeomDets()
Return inner and outer barrel GeomDets together.
unsigned int tecRing(const DetId &id) const
ring id
unsigned int pxfModule(const DetId &id) const
bool detUnitDeselected(const Alignable *alignable) const
true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection
unsigned int pxfDisk(const DetId &id) const
const DetId & geomDetId() const
Alignables & endcapPetals()
Return encap petals.
Alignables & outerHalfBarrels()
Return TOB half barrels.
static constexpr auto TOB
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection
Container::value_type value_type
std::vector< double > theRangesX
std::vector< double > theRangesZ
unsigned int addSelection(const std::string &name, const std::vector< char > ¶mSel)
align::Alignables CSCRings()
std::vector< int > theModuleRanges
void setGeometryCuts(const edm::ParameterSet &pSet)
std::vector< double > theRangesY
static constexpr auto TID
std::vector< int > theRingRanges
std::vector< Alignable * > Alignables
unsigned int tobLayer(const DetId &id) const
align::Alignables CSCEndcaps()
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
std::vector< int > theWheelRanges
unsigned int addSelections(const edm::ParameterSet &pSet)
align::Alignables DTStations()
unsigned int tobModule(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
std::vector< double > theRangesR
std::vector< int > theSideRanges
std::vector< int > theSideRanges
std::vector< std::vector< char > > theSelectedParameters
unsigned int addAllDets(const std::vector< char > ¶mSel)
some helper methods
std::vector< int > theDiskRanges
static constexpr auto TIB
void clearGeometryCuts()
remove all geometrical restrictions
void setTOBDetIdCuts(const edm::ParameterSet &pSet)
std::vector< int > thePanelRanges
T getParameter(std::string const &) const
Alignables & pixelEndcapPetals()
Return pixel endcap petals.
Alignables & TIDGeomDets()
Return TID GeomDets.
unsigned int tecModule(const DetId &id) const
unsigned int addAllLayers(const std::vector< char > ¶mSel)
void setPXBDetIdCuts(const edm::ParameterSet &pSet)
std::vector< int > theStringRanges
std::vector< double > theRangesPhi
unsigned int pxfBlade(const DetId &id) const
Abs< T >::type abs(const T &t)
Detector identifier class for the strip tracker.
const PositionType & globalPosition() const
Return the global position of the object.
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
unsigned int tecWheel(const DetId &id) const
AlignableTracker * theTracker
AlignmentParameterSelector(AlignableTracker *aliTracker, AlignableMuon *aliMuon=nullptr, AlignableExtras *aliExtras=nullptr)
Constructor from tracker only or from tracker and muon.
Alignables barrelLayers()
Return inner and outer barrel layers.
void setTIBDetIdCuts(const edm::ParameterSet &pSet)
ParameterSet const & getParameterSet(std::string const &) const
unsigned int tobSide(const DetId &id) const
Alignables & TIDs()
Return TIDs.
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
bool insideRanges(T value, const std::vector< T > &ranges, bool isPhi=false) const
unsigned int tibLayer(const DetId &id) const
bool outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
unsigned int tecSide(const DetId &id) const