CMS 3D CMS Logo

PedeSteerer.h
Go to the documentation of this file.
1 #ifndef PEDESTEERER_H
2 #define PEDESTEERER_H
3 
16 #include <vector>
17 #include <map>
18 #include <set>
19 #include <string>
20 // forward ofstream:
21 #include <iosfwd>
22 
26 
27 class Alignable;
28 class AlignableTracker;
29 class AlignableMuon;
30 class AlignableExtras;
32 class PedeLabelerBase;
34 
35 /***************************************
36 ****************************************/
38 {
39  public:
42  PedeSteerer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras,
45  const std::string &defaultDir, bool noSteerFiles);
47  ~PedeSteerer();
48 
50  bool isNoHiera(const Alignable* ali) const;
51 
53  void buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
55  std::string buildMasterSteer(const std::vector<std::string> &binaryFiles);
57  int runPede(const std::string &masterSteer) const;
61  bool isCorrectToRefSystem(const align::Alignables& coordDefiners) const;
62 
63 
64  double cmsToPedeFactor(unsigned int parNum) const;
66  int parameterSign() const { return myParameterSign; }
68  const std::string& directory() const { return myDirectory;}
69 
70  private:
71  typedef std::map<const Alignable*,std::vector<float> > AlignablePresigmasMap;
72 
75  bool checkParameterChoices(const align::Alignables&) const;
78  unsigned int buildNoHierarchyCollection(const align::Alignables&);
83  std::pair<unsigned int, unsigned int> fixParameters(const align::Alignables&,
84  const std::string &file);
88  int fixParameter(Alignable *ali, unsigned int iRunRange,
89  unsigned int iParam, char selector, std::ofstream* &filePtr,
90  const std::string &fileName);
97  void defineCoordinates(const align::Alignables&, Alignable *aliMaster,
98  const std::string &fileName);
99 
100  unsigned int hierarchyConstraints(const align::Alignables&, const std::string &file);
102  std::ofstream &file) const;
103 
105  unsigned int presigmas(const std::vector<edm::ParameterSet> &cffPresi,
106  const std::string &fileName, const align::Alignables&,
107  AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
109  unsigned int presigmasFile(const std::string &fileName, const align::Alignables&,
110  const AlignablePresigmasMap &aliPresisMap);
112  std::string fileName(const std::string &addendum) const;
114  std::ofstream* createSteerFile(const std::string &name, bool addToList);
115 
116  // data members
120 
127  unsigned int theMinHieraParPerConstr;
128  unsigned int theConstrPrecision;
129 
130  std::vector<std::string> mySteeringFiles;
131 
132  std::set<const Alignable*> myNoHieraCollection;
135 };
136 
137 #endif
void correctToReferenceSystem()
Definition: PedeSteerer.cc:391
const edm::ParameterSet myConfig
Definition: PedeSteerer.h:121
std::pair< unsigned int, unsigned int > fixParameters(const align::Alignables &, const std::string &file)
Definition: PedeSteerer.cc:228
unsigned int presigmas(const std::vector< edm::ParameterSet > &cffPresi, const std::string &fileName, const align::Alignables &, AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras)
interprete content of presigma VPSet &#39;cffPresi&#39; and call presigmasFile
Definition: PedeSteerer.cc:542
PedeSteerer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras, AlignmentParameterStore *store, const PedeLabelerBase *labels, const edm::ParameterSet &config, const std::string &defaultDir, bool noSteerFiles)
Definition: PedeSteerer.cc:54
Alignable * theCoordMaster
Alignables deselected for hierarchy constr.
Definition: PedeSteerer.h:133
std::map< const Alignable *, std::vector< float > > AlignablePresigmasMap
Definition: PedeSteerer.h:71
unsigned int presigmasFile(const std::string &fileName, const align::Alignables &, const AlignablePresigmasMap &aliPresisMap)
look for active &#39;alis&#39; in map of presigma values and create steering file
Definition: PedeSteerer.cc:587
unsigned int hierarchyConstraints(const align::Alignables &, const std::string &file)
Definition: PedeSteerer.cc:437
std::string myDirectory
Definition: PedeSteerer.h:122
Definition: config.py:1
align::Alignables selectCoordinateAlis(const align::Alignables &) const
Definition: PedeSteerer.cc:301
std::set< const Alignable * > myNoHieraCollection
keeps track of created &#39;secondary&#39; steering files
Definition: PedeSteerer.h:132
unsigned int theMinHieraParPerConstr
min absolute value of coefficients in hierarchy constraints
Definition: PedeSteerer.h:127
int fixParameter(Alignable *ali, unsigned int iRunRange, unsigned int iParam, char selector, std::ofstream *&filePtr, const std::string &fileName)
Definition: PedeSteerer.cc:262
std::ofstream * createSteerFile(const std::string &name, bool addToList)
create and open file with name, if (addToList) append to mySteeringFiles
Definition: PedeSteerer.cc:635
bool isCorrectToRefSystem(const align::Alignables &coordDefiners) const
Definition: PedeSteerer.cc:366
const PedeLabelerBase * myLabels
not the owner!
Definition: PedeSteerer.h:118
int runPede(const std::string &masterSteer) const
run pede, masterSteer should be as returned from buildMasterSteer(...)
Definition: PedeSteerer.cc:783
const AlignableObjectId alignableObjectId_
pointer to labeler (not the owner)
Definition: PedeSteerer.h:119
Allows conversion between type and name, and vice-versa.
std::string buildMasterSteer(const std::vector< std::string > &binaryFiles)
construct (and return name of) master steering file from config, binaryFiles etc. ...
Definition: PedeSteerer.cc:743
int myParameterSign
whether or not to fill pede steering files with debug info
Definition: PedeSteerer.h:125
double theMinHieraConstrCoeff
old pede versions (before May &#39;07) need a sign flip...
Definition: PedeSteerer.h:126
unsigned int theConstrPrecision
hierarchy constraints with less params are ignored
Definition: PedeSteerer.h:128
const AlignmentParameterStore * myParameterStore
Definition: PedeSteerer.h:117
bool myNoSteerFiles
directory of all files
Definition: PedeSteerer.h:123
align::Alignables theCoordDefiners
master coordinates, must (?) be global frame
Definition: PedeSteerer.h:134
void buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras)
construct steering files about hierarchy, fixing etc. an keep track of their names ...
Definition: PedeSteerer.cc:666
void defineCoordinates(const align::Alignables &, Alignable *aliMaster, const std::string &fileName)
Definition: PedeSteerer.cc:344
std::vector< std::string > mySteeringFiles
precision for writing constraints to text file
Definition: PedeSteerer.h:130
double cmsToPedeFactor(unsigned int parNum) const
Definition: PedeSteerer.cc:137
std::string fileName(const std::string &addendum) const
full name with directory and &#39;idenitfier&#39;
Definition: PedeSteerer.cc:654
bool isNoHiera(const Alignable *ali) const
True if &#39;ali&#39; was deselected from hierarchy and any ancestor (e.g. mother) has parameters.
Definition: PedeSteerer.cc:131
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
bool checkParameterChoices(const align::Alignables &) const
Definition: PedeSteerer.cc:200
bool myIsSteerFileDebug
flag to write steering files to /dev/null
Definition: PedeSteerer.h:124
const std::string & directory() const
directory from constructor input, &#39;/&#39; is attached if needed
Definition: PedeSteerer.h:68
void hierarchyConstraint(const Alignable *ali, const align::Alignables &components, std::ofstream &file) const
Definition: PedeSteerer.cc:472
Constructor of the full muon geometry.
Definition: AlignableMuon.h:37
unsigned int buildNoHierarchyCollection(const align::Alignables &)
Definition: PedeSteerer.cc:158
int parameterSign() const
results from pede (and start values for pede) might need a sign flip
Definition: PedeSteerer.h:66