26 theTracker(aliTracker), theMuon(aliMuon), theExtras(aliExtras), theSelectedAlignables(),
27 theRangesEta(), theRangesPhi(), theRangesR(), theRangesX(), theRangesY(), theRangesZ()
67 const std::vector<std::string> selections
68 = pSet.
getParameter<std::vector<std::string> >(
"alignParams");
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())
continue;
76 if (decompSel.size() < 2) {
77 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::addSelections" 78 << selections[iSel]<<
" from alignableParamSelector: " 79 <<
" should have at least 2 ','-separated parts";
80 }
else if (decompSel.size() > 2) {
102 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
103 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
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";
158 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
159 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
162 if (*iParam ==
"ladderRanges") {
164 }
else if (*iParam ==
"layerRanges") {
166 }
else if (*iParam ==
"moduleRanges") {
169 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setPXBDetIdCuts] " 170 <<
"Unknown parameter '" << *iParam <<
"'.\n";
182 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
183 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
186 if (*iParam ==
"bladeRanges") {
188 }
else if (*iParam ==
"diskRanges") {
190 }
else if (*iParam ==
"moduleRanges") {
192 }
else if (*iParam ==
"panelRanges") {
194 }
else if (*iParam ==
"sideRanges") {
197 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setPXFDetIdCuts] " 198 <<
"Unknown parameter '" << *iParam <<
"'.\n";
210 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
211 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
214 if (*iParam ==
"layerRanges") {
216 }
else if (*iParam ==
"moduleRanges") {
218 }
else if (*iParam ==
"stringRanges") {
220 }
else if (*iParam ==
"sideRanges") {
223 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTIBDetIdCuts] " 224 <<
"Unknown parameter '" << *iParam <<
"'.\n";
236 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
237 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
240 if (*iParam ==
"diskRanges") {
242 }
else if (*iParam ==
"moduleRanges") {
244 }
else if (*iParam ==
"ringRanges") {
246 }
else if (*iParam ==
"sideRanges") {
249 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTIDDetIdCuts] " 250 <<
"Unknown parameter '" << *iParam <<
"'.\n";
262 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
263 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
266 if (*iParam ==
"layerRanges") {
268 }
else if (*iParam ==
"moduleRanges") {
270 }
else if (*iParam ==
"sideRanges") {
272 }
else if (*iParam ==
"rodRanges") {
275 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTOBDetIdCuts] " 276 <<
"Unknown parameter '" << *iParam <<
"'.\n";
288 for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
289 iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
292 if (*iParam ==
"wheelRanges") {
294 }
else if (*iParam ==
"petalRanges") {
296 }
else if (*iParam ==
"moduleRanges") {
298 }
else if (*iParam ==
"ringRanges") {
300 }
else if (*iParam ==
"sideRanges") {
303 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::setTECDetIdCuts] " 304 <<
"Unknown parameter '" << *iParam <<
"'.\n";
311 const std::vector<char> ¶mSel,
320 const std::vector<char> ¶mSel)
324 unsigned int numAli = 0;
329 if (name.find(
"Tracker") == 0) {
331 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] " 332 <<
"Configuration requires access to AlignableTracker" 333 <<
" (for " << name <<
") that is not initialized";
341 else if (name ==
"AllDets") numAli += this->
addAllDets(paramSel);
342 else if (name ==
"AllRods") numAli += this->
addAllRods(paramSel);
343 else if (name ==
"AllLayers") numAli += this->
addAllLayers(paramSel);
345 else if (name ==
"AllAlignables") numAli += this->
addAllAlignables(paramSel);
363 else if (name ==
"PixelHalfBarrelDets") {
365 }
else if (name ==
"PixelHalfBarrelLadders") {
367 }
else if (name ==
"PixelHalfBarrelLayers") {
369 }
else if (name ==
"PixelHalfBarrels") {
383 else if (name ==
"PixelDets") {
386 }
else if (name ==
"PixelRods") {
389 }
else if (name ==
"PixelLayers") {
410 else if (name ==
"EndcapDets") {
413 }
else if (name ==
"EndcapPetals") {
416 }
else if (name ==
"EndcapLayers") {
423 else if (name ==
"StripDets") {
427 }
else if (name ==
"StripRods") {
431 }
else if (name ==
"StripLayers") {
440 else if (name.find(
"Muon") != std::string::npos) {
442 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] " 443 <<
"Configuration requires access to AlignableMuon" 444 <<
" which is not initialized";
462 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]" 463 <<
": Selection '" << name <<
"' invalid!";
470 else if (name.find(
"Extras") == 0) {
472 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] " 473 <<
"Configuration requires access to AlignableExtras" 474 <<
" (for " << name <<
") that is not initialized";
482 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]" 483 <<
": Selection '" << name <<
"' invalid!";
493 const std::vector<char> ¶mSel)
495 unsigned int numAli = 0;
498 for (align::Alignables::const_iterator iAli = alignables.begin();
499 iAli != alignables.end(); ++iAli) {
521 int type = typeLayer.first;
522 int layer = typeLayer.second;
584 const DetId detId(alignable->
id());
585 const int subdetId = detId.
subdetId();
594 !this->insideRanges<int>((detId.rawId()),
theDetIdRanges))
return true;
677 const std::vector<T> &
ranges,
682 if (ranges.size()%2 != 0) {
683 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges" 684 <<
" need even number of entries in ranges instead of " 689 for (
unsigned int i = 0;
i < ranges.size();
i += 2) {
694 if (rangePhi1 <= valuePhi && valuePhi < rangePhi2) {
697 if (rangePhi2 < rangePhi1 && (rangePhi1 <= valuePhi || valuePhi < rangePhi2)) {
700 }
else if (ranges[
i] <= value && value < ranges[
i+1]) {
709 template<>
bool AlignmentParameterSelector::insideRanges<int>(
int value,
710 const std::vector<int> &
ranges,
713 if (
ranges.size()%2 != 0) {
714 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges" 715 <<
" need even number of entries in ranges instead of " 720 for (
unsigned int i = 0;
i <
ranges.size();
i += 2) {
729 if (
std::find(values.begin(), values.end(),
value)!=values.end())
return true;
734 std::vector<std::string>
738 std::vector<std::string>
result;
743 if (delimiterPos == std::string::npos) {
744 result.push_back(s.substr(previousPos));
747 result.push_back(s.substr(previousPos, delimiterPos - previousPos));
748 previousPos = delimiterPos + 1;
763 std::vector<char>
result(selString.size());
781 if (ss != std::string::npos) {
782 newName.erase(ss, 2);
789 if (ds != std::string::npos) {
790 newName.erase(ds, 2);
798 if (layers != std::string::npos && size - layers - 2 == 6
799 && isdigit(newName[size-1]) && isdigit(newName[size-2])) {
803 newName.erase(layers);
811 if (newName.rfind(
"Unit") != std::string::npos) {
813 if (uRph != std::string::npos) {
814 newName.erase(uRph + 4, 4);
818 if (uSte != std::string::npos) {
819 newName.erase(uSte + 4, 6);
824 if (newName != name) {
825 LogDebug(
"Alignment") <<
"@SUB=AlignmentParameterSelector::setSpecials" 826 << name <<
" becomes " << newName <<
", makes theOnlySS " <<
theOnlySS 838 unsigned int numAli = 0;
852 unsigned int numAli = 0;
866 unsigned int numAli = 0;
880 unsigned int numAli = 0;
T getParameter(std::string const &) const
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
AlignableExtras * theExtras
bool outsideGeometricalRanges(const Alignable *alignable) const
true if geometrical restrictions in eta, phi, r, x, y, z not satisfied
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
std::vector< double > theRangesPhi
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
unsigned int tibLayer(const DetId &id) const
unsigned int tibString(const DetId &id) const
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
unsigned int tidRing(const DetId &id) const
align::Alignables DTLayers()
Methods to return specific of components.
unsigned int addAllAlignables(const std::vector< char > ¶mSel)
AlignmentParameterSelector(AlignableTracker *aliTracker, AlignableMuon *aliMuon=0, AlignableExtras *aliExtras=0)
Constructor from tracker only or from tracker and muon.
bool insideRanges(T value, const std::vector< T > &ranges, bool isPhi=false) const
align::Alignables CSCChambers()
align::Alignables theSelectedAlignables
void clearGeometryCuts()
remove all geometrical restrictions
unsigned int pxfDisk(const DetId &id) const
std::vector< int > theDetIdRanges
unsigned int tecRing(const DetId &id) const
ring id
std::vector< std::vector< char > > theSelectedParameters
align::Alignables DTBarrel()
unsigned int pxbLadder(const DetId &id) const
align::Alignables CSCStations()
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
std::vector< int > theStringRanges
std::vector< int > thePetalRanges
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
align::Alignables DTStations()
std::vector< int > theLadderRanges
Alignables barrelGeomDets()
Return inner and outer barrel GeomDets together.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
std::vector< int > theModuleRanges
std::vector< int > theExcludedDetIds
std::vector< int > theDiskRanges
std::vector< int > theSideRanges
std::vector< int > theModuleRanges
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
void setGeometryCuts(const edm::ParameterSet &pSet)
unsigned int tibSide(const DetId &id) const
void clear()
remove all selected Alignables and geometrical restrictions
Container::value_type value_type
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
align::Alignables CSCEndcaps()
unsigned int tidSide(const DetId &id) const
std::vector< int > theModuleRanges
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
align::Alignables DTChambers()
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
void setPXBDetIdCuts(const edm::ParameterSet &pSet)
align::Alignables DTWheels()
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
std::vector< double > theRangesZ
Alignables & endCaps()
Return TECs.
unsigned int tidModule(const DetId &id) const
unsigned int addAllDets(const std::vector< char > ¶mSel)
some helper methods
void setTECDetIdCuts(const edm::ParameterSet &pSet)
Alignables & TIDGeomDets()
Return TID GeomDets.
unsigned int addAllLayers(const std::vector< char > ¶mSel)
unsigned int tobSide(const DetId &id) const
std::vector< int > theSideRanges
std::vector< std::string > decompose(const std::string &s, std::string::value_type delimiter) const
Decomposing input string 's' into parts separated by 'delimiter'.
Abs< T >::type abs(const T &t)
std::vector< int > theSideRanges
Alignables & outerBarrelRods()
Return outer barrel rods.
Alignables barrelRods()
Return inner and outer barrel rods.
std::vector< int > theLayerRanges
std::vector< std::string > getParameterNames() const
Alignables & pixelEndcapPetals()
Return pixel endcap petals.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
std::vector< int > theWheelRanges
AlignableTracker * theTracker
Alignables barrelLayers()
Return inner and outer barrel layers.
Alignables & endcapGeomDets()
Return endcap GeomDets.
unsigned int tibModule(const DetId &id) const
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
unsigned int pxfModule(const DetId &id) const
align::Alignables CSCLayers()
std::vector< int > theSideRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
Alignables & TIDs()
Return TIDs.
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
RphiOrStereoDetUnit theRphiOrStereoDetUnit
std::vector< int > theRingRanges
unsigned int addAllRods(const std::vector< char > ¶mSel)
Detector identifier class for the strip tracker.
Alignables & outerBarrelLayers()
Return outer barrel layers.
void setPXFDetIdCuts(const edm::ParameterSet &pSet)
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
std::vector< int > theModuleRanges
std::vector< int > theBladeRanges
Alignables & TIDLayers()
Return TID layers.
std::vector< double > theRangesY
Alignables & TIDRings()
Return TID rings.
std::vector< int > theRodRanges
ParameterSet const & getParameterSet(std::string const &) const
Alignables & pixelHalfBarrels()
Return Pixel half barrels.
Alignables & pixelEndCaps()
Return TPEs.
align::Alignables DTSuperLayers()
Alignables & subStructures(const std::string &subStructName)
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
std::vector< int > theExcludedDetIdRanges
std::vector< int > theDiskRanges
std::vector< Alignable * > Alignables
unsigned int tobModule(const DetId &id) const
Alignables & innerBarrelLayers()
Return inner barrel layers.
std::vector< int > theModuleRanges
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
unsigned int addSelection(const std::string &name, const std::vector< char > ¶mSel)
align::Alignables CSCRings()
void setTOBDetIdCuts(const edm::ParameterSet &pSet)
std::vector< int > theRingRanges
static int position[264][3]
unsigned int add(const align::Alignables &alignables, const std::vector< char > ¶mSel)
adding alignables which fulfil geometrical restrictions and special switches
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
unsigned int addSelections(const edm::ParameterSet &pSet)
Alignables & pixelHalfBarrelLadders()
Return pixel half barrel ladders (implemented as AlignableRods)
bool outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied
unsigned int pxfSide(const DetId &id) const
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
unsigned int tecPetalNumber(const DetId &id) const
std::vector< double > theRangesR
virtual Alignables components() const
Return vector of direct components.
std::vector< int > theLayerRanges
const PositionType & globalPosition() const
Return the global position of the object.
std::vector< int > theModuleRanges
std::vector< int > theSideRanges
Alignables & endcapPetals()
Return encap petals.
Alignables & innerHalfBarrels()
Return TIB half barrels.
unsigned int tobRod(const DetId &id) const
std::vector< int > thePanelRanges
std::vector< int > theLayerRanges
const AlignableTracker * alignableTracker() const
Constructor of the full muon geometry.
unsigned int tecWheel(const DetId &id) const
Alignables & endcapLayers()
Return endcap layers.
Alignables & pixelEndcapHalfCylinders()
Return pixel endcap half cylinders.
std::vector< double > theRangesX
const DetId & geomDetId() const
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
Alignables & pixelEndcapLayers()
Return pixel endcap layers.
unsigned int tecSide(const DetId &id) const
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
Alignables & outerHalfBarrels()
Return TOB half barrels.
bool layerDeselected(const Alignable *alignable) const
true if layer is deselected via "Layers<N><M>" or "DS/SS"
bool detUnitDeselected(const Alignable *alignable) const
true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection
Alignables & innerBarrelRods()
Return inner barrel rods.
std::string setSpecials(const std::string &name)
void setTIBDetIdCuts(const edm::ParameterSet &pSet)