1 |
fronga |
1.1 |
#ifndef Alignment_CommonAlignmentAlgorithm_AlignmentParameterBuilder_h
|
2 |
|
|
#define Alignment_CommonAlignmentAlgorithm_AlignmentParameterBuilder_h
|
3 |
|
|
|
4 |
|
|
#include <string>
|
5 |
|
|
#include <vector>
|
6 |
|
|
|
7 |
flucke |
1.3 |
/** \class AlignmentParameterBuilder
|
8 |
|
|
*
|
9 |
|
|
* Build Alignment Parameter Structure
|
10 |
|
|
*
|
11 |
flucke |
1.6 |
* $Date: 2006/11/07 10:22:56 $
|
12 |
|
|
* $Revision: 1.5 $
|
13 |
flucke |
1.3 |
* (last update by $Author: flucke $)
|
14 |
|
|
*/
|
15 |
|
|
|
16 |
flucke |
1.4 |
namespace edm {
|
17 |
|
|
class ParameterSet;
|
18 |
|
|
}
|
19 |
flucke |
1.6 |
class AlignableTracker;
|
20 |
|
|
class Alignable;
|
21 |
|
|
class AlignmentParameters;
|
22 |
fronga |
1.1 |
|
23 |
|
|
class AlignmentParameterBuilder
|
24 |
|
|
{
|
25 |
|
|
public:
|
26 |
|
|
|
27 |
|
|
/// Constructor
|
28 |
flucke |
1.4 |
explicit AlignmentParameterBuilder(AlignableTracker *alignableTracker);
|
29 |
flucke |
1.5 |
/// Constructor adding selections by passing the ParameterSet named 'AlignmentParameterSelector'
|
30 |
|
|
/// (expected in pSet) to addSelections(..)
|
31 |
flucke |
1.4 |
AlignmentParameterBuilder(AlignableTracker *alignableTracker, const edm::ParameterSet &pSet);
|
32 |
fronga |
1.1 |
|
33 |
|
|
/// destructor
|
34 |
flucke |
1.4 |
virtual ~AlignmentParameterBuilder() {};
|
35 |
fronga |
1.1 |
|
36 |
flucke |
1.5 |
/// Add selections of Alignables, using AlignmenParameterSelector::addSelections.
|
37 |
|
|
/// For each Alignable, (Composite)RigidBodyAlignmentParameters will be attached
|
38 |
|
|
/// using the selection of active parameters done in AlignmenParameterSelector,
|
39 |
|
|
/// e.g. a selection string '11100' selects the degrees of freedom in (x,y,z),
|
40 |
|
|
/// but not (alpha,beta,gamma).
|
41 |
|
|
/// Returns number of added selections
|
42 |
flucke |
1.4 |
unsigned int addSelections(const edm::ParameterSet &pset);
|
43 |
fronga |
1.1 |
|
44 |
flucke |
1.5 |
/// Add arbitrary selection of Alignables, return number of higher level Alignables
|
45 |
|
|
unsigned int add(const std::vector<Alignable*> &alignables, const std::vector<bool> &sel);
|
46 |
|
|
/// Add a single Alignable, true if it is higher level, false if it is an AlignableDet
|
47 |
|
|
bool add(Alignable *alignable, const std::vector<bool> &sel);
|
48 |
fronga |
1.1 |
|
49 |
|
|
/// Get list of alignables for which AlignmentParameters are built
|
50 |
flucke |
1.2 |
std::vector<Alignable*> alignables() { return theAlignables; };
|
51 |
fronga |
1.1 |
|
52 |
|
|
/// Remove n Alignables from list
|
53 |
|
|
void fixAlignables( int n );
|
54 |
|
|
|
55 |
|
|
private:
|
56 |
|
|
|
57 |
flucke |
1.6 |
/// convert char selection (from ParameterSelector) to bool (for AlignmentParameters)
|
58 |
|
|
/// true if anything else than 0 and 1 is found in vector<char>
|
59 |
|
|
bool decodeParamSel(const std::vector<char> ¶mSelChar, std::vector<bool> &result) const;
|
60 |
|
|
/// add SelectionUserVariables corresponding to fullSel
|
61 |
|
|
bool addFullParamSel(AlignmentParameters *aliPar, const std::vector<char> &fullSel) const;
|
62 |
|
|
|
63 |
fronga |
1.1 |
// data members
|
64 |
|
|
|
65 |
|
|
/// Vector of alignables
|
66 |
|
|
std::vector<Alignable*> theAlignables;
|
67 |
|
|
|
68 |
|
|
/// Alignable tracker
|
69 |
|
|
AlignableTracker* theAlignableTracker;
|
70 |
|
|
|
71 |
|
|
};
|
72 |
|
|
|
73 |
|
|
#endif
|