1 |
fronga |
1.1 |
#ifndef Alignment_CommonAlignmentAlgorithm_AlignmentParameterBuilder_h
|
2 |
|
|
#define Alignment_CommonAlignmentAlgorithm_AlignmentParameterBuilder_h
|
3 |
|
|
|
4 |
|
|
#include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
|
5 |
|
|
#include "Alignment/TrackerAlignment/interface/TrackerAlignableId.h"
|
6 |
|
|
|
7 |
|
|
#include <string>
|
8 |
|
|
#include <vector>
|
9 |
|
|
|
10 |
flucke |
1.3 |
/** \class AlignmentParameterBuilder
|
11 |
|
|
*
|
12 |
|
|
* Build Alignment Parameter Structure
|
13 |
|
|
*
|
14 |
|
|
* $Date: 2006/10/17 11:02:42 $
|
15 |
|
|
* $Revision: 1.11 $
|
16 |
|
|
* (last update by $Author: flucke $)
|
17 |
|
|
*/
|
18 |
|
|
|
19 |
|
|
|
20 |
fronga |
1.1 |
|
21 |
|
|
class AlignmentParameterBuilder
|
22 |
|
|
{
|
23 |
|
|
public:
|
24 |
|
|
|
25 |
|
|
/// Constructor
|
26 |
flucke |
1.2 |
AlignmentParameterBuilder(AlignableTracker* alignableTracker);
|
27 |
fronga |
1.1 |
|
28 |
|
|
/// destructor
|
29 |
|
|
~AlignmentParameterBuilder() {};
|
30 |
|
|
|
31 |
flucke |
1.3 |
/// Add several selections defined by the PSet which must contain a vstring like e.g.
|
32 |
|
|
/// vstring alignableParamSelector = { "PixelHalfBarrelLadders,111000,pixelSelection",
|
33 |
|
|
/// "BarrelDSRods,111000",
|
34 |
|
|
/// "BarrelSSRods,101000"}
|
35 |
|
|
/// The '11100' part defines which d.o.f. to be aligned (x,y,z,alpha,beta,gamma)
|
36 |
|
|
/// returns number of added selections or -1 if problems (then also an error is logged)
|
37 |
|
|
/// If a string contains a third, comma separated part (e.g. ',pixelSelection'),
|
38 |
|
|
/// a further PSet of that name is expected to select eta/z/phi/r-ranges
|
39 |
|
|
int addSelections(const edm::ParameterSet &pset);
|
40 |
|
|
|
41 |
fronga |
1.1 |
/// Add predefined selection of alignables defined by a string
|
42 |
flucke |
1.2 |
void addSelection(const std::string &name, const std::vector<bool> &sel);
|
43 |
fronga |
1.1 |
|
44 |
|
|
/// Add arbitrary selection of Alignables
|
45 |
flucke |
1.2 |
void add (const std::vector<Alignable*>& alignables, const std::vector<bool> &sel);
|
46 |
fronga |
1.1 |
|
47 |
|
|
/// Add all level 1 objects (Dets)
|
48 |
flucke |
1.2 |
void addAllDets(const std::vector<bool> &sel);
|
49 |
fronga |
1.1 |
|
50 |
|
|
/// Add all level 2 (Rod or equivalent) objects
|
51 |
flucke |
1.2 |
void addAllRods(const std::vector<bool> &sel);
|
52 |
fronga |
1.1 |
|
53 |
|
|
/// Add all level 3 (Layer or equivalent) objects
|
54 |
flucke |
1.2 |
void addAllLayers(const std::vector<bool> &sel);
|
55 |
fronga |
1.1 |
|
56 |
|
|
/// Add all level 4 (Halfbarrel etc) objects
|
57 |
flucke |
1.2 |
void addAllComponents(const std::vector<bool> &sel);
|
58 |
fronga |
1.1 |
|
59 |
|
|
/// Add all alignables
|
60 |
flucke |
1.2 |
void addAllAlignables(const std::vector<bool> &sel);
|
61 |
fronga |
1.1 |
|
62 |
|
|
/// Get list of alignables for which AlignmentParameters are built
|
63 |
flucke |
1.2 |
std::vector<Alignable*> alignables() { return theAlignables; };
|
64 |
fronga |
1.1 |
|
65 |
|
|
/// Remove n Alignables from list
|
66 |
|
|
void fixAlignables( int n );
|
67 |
|
|
|
68 |
flucke |
1.3 |
/// Decoding string to select local rigid body parameters into vector<bool>,
|
69 |
|
|
/// "101001" will mean x,z,gamma, but not y,alpha,beta
|
70 |
|
|
/// LogError if problems while decoding (e.g. length of sring)
|
71 |
|
|
std::vector<bool> decodeParamSel(const std::string &selString) const;
|
72 |
|
|
std::vector<std::string> decompose(const std::string &s, std::string::value_type delimiter) const;
|
73 |
fronga |
1.1 |
private:
|
74 |
|
|
|
75 |
|
|
// data members
|
76 |
|
|
|
77 |
|
|
/// Vector of alignables
|
78 |
|
|
std::vector<Alignable*> theAlignables;
|
79 |
|
|
|
80 |
|
|
/// Alignable tracker
|
81 |
|
|
AlignableTracker* theAlignableTracker;
|
82 |
|
|
|
83 |
|
|
/// Alignable id converter
|
84 |
|
|
TrackerAlignableId* theTrackerAlignableId;
|
85 |
|
|
|
86 |
|
|
bool theOnlyDS;
|
87 |
|
|
bool theOnlySS;
|
88 |
|
|
int theMinLayer,theMaxLayer;
|
89 |
|
|
bool theSelLayers;
|
90 |
|
|
|
91 |
|
|
};
|
92 |
|
|
|
93 |
|
|
#endif
|