31 theTracker(aliTracker), theMuon(aliMuon), theExtras(aliExtras), theSelectedAlignables(),
32 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";
335 const std::string substructName(name, 7);
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") {
382 else if (name ==
"PixelDets") {
385 }
else if (name ==
"PixelRods") {
388 }
else if (name ==
"PixelLayers") {
409 else if (name ==
"EndcapDets") {
412 }
else if (name ==
"EndcapPetals") {
415 }
else if (name ==
"EndcapLayers") {
422 else if (name ==
"StripDets") {
426 }
else if (name ==
"StripRods") {
430 }
else if (name ==
"StripLayers") {
439 else if (name.find(
"Muon") != std::string::npos) {
441 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] "
442 <<
"Configuration requires access to AlignableMuon"
443 <<
" which is not initialized";
461 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]"
462 <<
": Selection '" << name <<
"' invalid!";
469 else if (name.find(
"Extras") == 0) {
471 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection] "
472 <<
"Configuration requires access to AlignableExtras"
473 <<
" (for " << name <<
") that is not initialized";
475 const std::string substructName(name, 6);
481 throw cms::Exception(
"BadConfig") <<
"[AlignmentParameterSelector::addSelection]"
482 <<
": Selection '" << name <<
"' invalid!";
492 const std::vector<char> ¶mSel)
494 unsigned int numAli = 0;
497 for (align::Alignables::const_iterator iAli = alignables.begin();
498 iAli != alignables.end(); ++iAli) {
520 int type = typeLayer.first;
521 int layer = typeLayer.second;
583 const DetId detId(alignable->
id());
584 const int subdetId = detId.
subdetId();
589 !this->insideRanges<int>((detId.rawId()),
theDetIdRanges))
return true;
678 const std::vector<T> &
ranges,
683 if (ranges.size()%2 != 0) {
684 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges"
685 <<
" need even number of entries in ranges instead of "
690 for (
unsigned int i = 0;
i < ranges.size();
i += 2) {
695 if (rangePhi1 <= valuePhi && valuePhi < rangePhi2) {
698 if (rangePhi2 < rangePhi1 && (rangePhi1 <= valuePhi || valuePhi < rangePhi2)) {
701 }
else if (ranges[
i] <= value && value < ranges[
i+1]) {
710 template<>
bool AlignmentParameterSelector::insideRanges<int>(
int value,
711 const std::vector<int> &
ranges,
714 if (
ranges.size()%2 != 0) {
715 cms::Exception(
"BadConfig") <<
"@SUB=AlignmentParameterSelector::insideRanges"
716 <<
" need even number of entries in ranges instead of "
721 for (
unsigned int i = 0;
i <
ranges.size();
i += 2) {
730 if (
std::find(values.begin(), values.end(),
value)!=values.end())
return true;
735 std::vector<std::string>
739 std::vector<std::string>
result;
744 if (delimiterPos == std::string::npos) {
745 result.push_back(s.substr(previousPos));
748 result.push_back(s.substr(previousPos, delimiterPos - previousPos));
749 previousPos = delimiterPos + 1;
764 std::vector<char>
result(selString.size());
779 std::string newName(name);
782 if (ss != std::string::npos) {
783 newName.erase(ss, 2);
790 if (ds != std::string::npos) {
791 newName.erase(ds, 2);
799 if (layers != std::string::npos && size - layers - 2 == 6
800 && isdigit(newName[size-1]) && isdigit(newName[size-2])) {
804 newName.erase(layers);
812 if (newName.rfind(
"Unit") != std::string::npos) {
814 if (uRph != std::string::npos) {
815 newName.erase(uRph + 4, 4);
819 if (uSte != std::string::npos) {
820 newName.erase(uSte + 4, 6);
825 if (newName != name) {
826 LogDebug(
"Alignment") <<
"@SUB=AlignmentParameterSelector::setSpecials"
827 << name <<
" becomes " << newName <<
", makes theOnlySS " <<
theOnlySS
839 unsigned int numAli = 0;
853 unsigned int numAli = 0;
867 unsigned int numAli = 0;
881 unsigned int numAli = 0;
unsigned int rodNumber() const
T getParameter(std::string const &) const
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
unsigned int side() const
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
unsigned int panel() const
panel id
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
unsigned int petalNumber() const
unsigned int stringNumber() const
unsigned int layer() const
layer id
align::Alignables DTLayers()
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
std::vector< int > theDetIdRanges
std::vector< std::vector< char > > theSelectedParameters
align::Alignables DTBarrel()
align::Alignables CSCStations()
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
std::vector< int > theStringRanges
std::vector< int > thePetalRanges
unsigned int ladder() const
ladder id
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
unsigned int side() const
std::vector< int > theModuleRanges
unsigned int module() const
det id
std::vector< int > theExcludedDetIds
static int position[TOTALCHAMBERS][3]
std::vector< int > theDiskRanges
std::vector< int > theSideRanges
unsigned int layer() const
layer id
unsigned int side() const
positive or negative id
std::vector< int > theModuleRanges
void setGeometryCuts(const edm::ParameterSet &pSet)
unsigned int blade() const
blade id
void clear()
remove all selected Alignables and geometrical restrictions
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
align::Alignables CSCEndcaps()
std::vector< int > theModuleRanges
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 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)
std::vector< int > theSideRanges
unsigned int ring() const
ring id
std::vector< std::string > decompose(const std::string &s, std::string::value_type delimiter) const
Decomposing input string 's' into parts separated by 'delimiter'.
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
unsigned int module() const
det id
unsigned int module() const
det id
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.
Container::value_type value_type
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
unsigned int disk() const
disk id
Alignables barrelLayers()
Return inner and outer barrel layers.
Alignables & endcapGeomDets()
Return endcap GeomDets.
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
align::Alignables CSCLayers()
std::vector< int > theSideRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
Alignables & TIDs()
Return TIDs.
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
unsigned int module() const
detector id
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()
unsigned int side() const
positive or negative id
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 ...
unsigned int wheel() const
wheel id
std::vector< int > theExcludedDetIdRanges
std::vector< int > theDiskRanges
std::vector< Alignable * > Alignables
Alignables & innerBarrelLayers()
Return inner barrel layers.
unsigned int layer() const
layer id
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
unsigned int ring() const
ring id
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 side() const
positive or negative id
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId) const
unsigned int module() const
detector id
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.
std::vector< int > thePanelRanges
std::vector< int > theLayerRanges
Constructor of the full muon geometry.
Alignables & endcapLayers()
Return endcap layers.
unsigned int moduleNumber() const
std::vector< double > theRangesX
const DetId & geomDetId() const
tuple size
Write out results.
Alignables & pixelEndcapLayers()
Return pixel endcap layers.
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"
unsigned int diskNumber() const
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)