25 using namespace AlignmentParametersFactory;
31 theAlignableTracker(alignableTracker),
33 theAlignableExtras(alignableExtras)
42 theAlignableTracker(alignableTracker),
43 theAlignableMuon(alignableMuon),
44 theAlignableExtras(alignableExtras)
54 theAlignableTracker(alignableTracker),
56 theAlignableExtras(alignableExtras)
67 theAlignableTracker(alignableTracker),
68 theAlignableMuon(alignableMuon),
69 theAlignableExtras(alignableExtras)
78 std::vector<std::string> selsTypes(pSet.
getParameter<std::vector<std::string> >(
"parameterTypes"));
80 for (
unsigned int i = 0;
i < selsTypes.size(); ++
i) {
81 std::vector<std::string> selSetType(selector.
decompose(selsTypes[
i],
','));
82 if (selSetType.size() != 2) {
84 <<
"parameterTypes should contain 2 comma separated strings"
85 <<
", but found '" << selsTypes[
i] <<
"'.";
105 align::Alignables::const_iterator iAli = alignables.begin();
106 std::vector<std::vector<char> >::const_iterator iParamSel = paramSels.begin();
107 unsigned int nHigherLevel = 0;
109 while (iAli != alignables.end() && iParamSel != paramSels.end()) {
110 std::vector<bool> boolParSel;
111 std::vector<char> parSel(*iParamSel);
113 if (this->
add(*iAli, parType, boolParSel)) ++nHigherLevel;
114 if (charSelIsGeneral) this->
addFullParamSel((*iAli)->alignmentParameters(), parSel);
120 edm::LogInfo(
"Alignment") <<
"@SUB=AlignmentParameterBuilder::addSelections"
121 <<
" Added " << addedSets <<
" set(s) of alignables with "
122 <<
theAlignables.size() - oldAliSize <<
" alignables in total,"
123 <<
" of which " << nHigherLevel <<
" are higher level "
132 const std::vector<bool> &
sel)
141 return isHigherLevel;
150 unsigned int nHigherLevel = 0;
152 for (align::Alignables::const_iterator iAli = alignables.begin();
153 iAli != alignables.end(); ++iAli) {
154 if (this->
add(*iAli, parType, sel)) ++nHigherLevel;
166 edm::LogError(
"BadArgument") <<
" n = " << n <<
" is not in [1,3]";
173 for ( align::Alignables::const_iterator ia=
theAlignables.begin();
178 theNewAlignables.push_back(*ia);
179 else if ( n==2 && i>1 && i<imax )
180 theNewAlignables.push_back(*ia);
181 else if ( n==3 && i>2 && i<imax)
182 theNewAlignables.push_back(*ia);
187 edm::LogInfo(
"Alignment") <<
"@SUB=AlignmentParameterBuilder::fixAlignables"
188 <<
"removing " << n <<
" alignables, so that "
194 std::vector<bool> &
result)
const
198 paramSelChar.erase(
std::remove(paramSelChar.begin(), paramSelChar.end(),
' '),
201 bool anyNon01 =
false;
203 for (
unsigned int pos = 0;
pos < paramSelChar.size(); ++
pos) {
205 switch (paramSelChar[
pos]) {
210 result.push_back(
true);
213 result.push_back(
false);
223 const std::vector<char> &fullSel)
const
225 if (!aliParams)
return false;
T getParameter(std::string const &) const
AlignmentParameterBuilder(AlignableTracker *alignableTracker, AlignableExtras *alignableExtras)
Constructor from tracker only.
unsigned int addSelections(const edm::ParameterSet &pset, AlignmentParametersFactory::ParametersType parType)
std::string parametersTypeName(ParametersType parType)
convert ParametersType to string understood by parametersType(string &typeString) ...
bool decodeParamSel(std::vector< char > ¶mSelChar, std::vector< bool > &result) const
ParametersType
enums for all available AlignmentParameters
AlignableExtras * theAlignableExtras
extra Alignables
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
bool addFullParamSel(AlignmentParameters *aliPar, const std::vector< char > &fullSel) const
add SelectionUserVariables corresponding to fullSel
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.
void fixAlignables(int n)
Remove n Alignables from list.
AlignableMuon * theAlignableMuon
Alignable muon.
AlignmentParameters * createParameters(Alignable *ali, ParametersType parType, const std::vector< bool > &sel)
unsigned int add(const align::Alignables &alignables, AlignmentParametersFactory::ParametersType parType, const std::vector< bool > &sel)
Add arbitrary selection of Alignables, return number of higher level Alignables.
const align::Alignables & selectedAlignables() const
vector of alignables selected so far
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
std::vector< Alignable * > Alignables
unsigned int addSelections(const edm::ParameterSet &pSet)
align::Alignables theAlignables
Vector of alignables.
ParametersType parametersType(const std::string &typeString)
convert string to ParametersType - exception if not known
const std::vector< std::vector< char > > & selectedParameters() const
vector of selection 'strings' for alignables, parallel to selectedAlignables()
Constructor of the full muon geometry.
AlignableTracker * theAlignableTracker
Alignable tracker.
void addAllSelections(const edm::ParameterSet &pSet)
master initialisation method, PSet must have form as constructor wants it
const align::Alignables & alignables() const
Get list of alignables for which AlignmentParameters are built.