25 using namespace AlignmentParametersFactory;
31 theAlignableTracker(alignableTracker),
32 theAlignableMuon(nullptr),
33 theAlignableExtras(alignableExtras) {}
40 theAlignableTracker(alignableTracker),
41 theAlignableMuon(alignableMuon),
42 theAlignableExtras(alignableExtras) {}
49 theAlignableTracker(alignableTracker),
50 theAlignableMuon(nullptr),
51 theAlignableExtras(alignableExtras) {
61 theAlignableTracker(alignableTracker),
62 theAlignableMuon(alignableMuon),
63 theAlignableExtras(alignableExtras) {
72 std::vector<std::string> selsTypes(pSet.
getParameter<std::vector<std::string> >(
"parameterTypes"));
74 for (
unsigned int i = 0;
i < selsTypes.size(); ++
i) {
75 std::vector<std::string> selSetType(selector.
decompose(selsTypes[
i],
','));
76 if (selSetType.size() != 2) {
78 <<
"parameterTypes should contain 2 comma separated strings"
79 <<
", but found '" << selsTypes[
i] <<
"'.";
96 align::Alignables::const_iterator iAli = alignables.begin();
97 std::vector<std::vector<char> >::const_iterator iParamSel = paramSels.begin();
98 unsigned int nHigherLevel = 0;
100 while (iAli != alignables.end() && iParamSel != paramSels.end()) {
101 std::vector<bool> boolParSel;
102 std::vector<char> parSel(*iParamSel);
104 if (this->
add(*iAli, parType, boolParSel))
106 if (charSelIsGeneral)
113 edm::LogInfo(
"Alignment") <<
"@SUB=AlignmentParameterBuilder::addSelections"
114 <<
" Added " << addedSets <<
" set(s) of alignables with "
115 <<
theAlignables.size() - oldAliSize <<
" alignables in total,"
116 <<
" of which " << nHigherLevel <<
" are higher level "
130 return isHigherLevel;
136 const std::vector<bool> &
sel) {
137 unsigned int nHigherLevel = 0;
139 for (align::Alignables::const_iterator iAli = alignables.begin(); iAli != alignables.end(); ++iAli) {
140 if (this->
add(*iAli, parType, sel))
149 if (n < 1 || n > 3) {
150 edm::LogError(
"BadArgument") <<
" n = " << n <<
" is not in [1,3]";
160 theNewAlignables.push_back(*ia);
161 else if (n == 2 && i > 1 && i < imax)
162 theNewAlignables.push_back(*ia);
163 else if (n == 3 && i > 2 && i < imax)
164 theNewAlignables.push_back(*ia);
169 edm::LogInfo(
"Alignment") <<
"@SUB=AlignmentParameterBuilder::fixAlignables"
170 <<
"removing " << n <<
" alignables, so that " <<
theAlignables.size()
171 <<
" alignables left";
178 paramSelChar.erase(
std::remove(paramSelChar.begin(), paramSelChar.end(),
' '), paramSelChar.end());
180 bool anyNon01 =
false;
182 for (
unsigned int pos = 0; pos < paramSelChar.size(); ++pos) {
183 switch (paramSelChar[pos]) {
188 result.push_back(
true);
191 result.push_back(
false);
201 const std::vector<char> &fullSel)
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)
Log< level::Error, false > LogError
const AlignableTracker * alignableTracker() const
Alignable tracker.
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.
Log< level::Info, false > LogInfo
const align::Alignables & selectedAlignables() const
vector of alignables selected so far
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
T getParameter(std::string const &) const
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.