CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
24 
25 class Alignable;
26 class AlignableTracker;
27 class AlignableMuon;
28 class AlignableExtras;
30 class PedeLabelerBase;
32 
33 /***************************************
34 ****************************************/
36 {
37  public:
40  PedeSteerer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras,
43  const std::string &defaultDir, bool noSteerFiles);
45  ~PedeSteerer();
46 
48  bool isNoHiera(const Alignable* ali) const;
49 
51  void buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
53  std::string buildMasterSteer(const std::vector<std::string> &binaryFiles);
55  int runPede(const std::string &masterSteer) const;
59  bool isCorrectToRefSystem(const std::vector<Alignable*> &coordDefiners) const;
60 
61 
62  double cmsToPedeFactor(unsigned int parNum) const;
64  int parameterSign() const { return myParameterSign; }
66  const std::string& directory() const { return myDirectory;}
67 
68  private:
69  typedef std::map<const Alignable*,std::vector<float> > AlignablePresigmasMap;
70 
73  bool checkParameterChoices(const std::vector<Alignable*> &alis) const;
76  unsigned int buildNoHierarchyCollection(const std::vector<Alignable*> &alis);
81  std::pair<unsigned int, unsigned int> fixParameters(const std::vector<Alignable*> &alignables,
82  const std::string &file);
86  int fixParameter(Alignable *ali, unsigned int iRunRange,
87  unsigned int iParam, char selector, std::ofstream* &filePtr,
88  const std::string &fileName);
92  std::vector<Alignable*> selectCoordinateAlis(const std::vector<Alignable*> &alignables) const;
95  void defineCoordinates(const std::vector<Alignable*> &alis, Alignable *aliMaster,
96  const std::string &fileName);
97 
98  unsigned int hierarchyConstraints(const std::vector<Alignable*> &alis, const std::string &file);
99  void hierarchyConstraint(const Alignable *ali, const std::vector<Alignable*> &components,
100  std::ofstream &file) const;
101 
103  unsigned int presigmas(const std::vector<edm::ParameterSet> &cffPresi,
104  const std::string &fileName, const std::vector<Alignable*> &alis,
105  AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
107  unsigned int presigmasFile(const std::string &fileName, const std::vector<Alignable*> &alis,
108  const AlignablePresigmasMap &aliPresisMap);
110  std::string fileName(const std::string &addendum) const;
112  std::ofstream* createSteerFile(const std::string &name, bool addToList);
113 
114  // data members
117 
124  unsigned int theMinHieraParPerConstr;
125  unsigned int theConstrPrecision;
126 
127  std::vector<std::string> mySteeringFiles;
128 
129  std::set<const Alignable*> myNoHieraCollection;
131  std::vector<Alignable*> theCoordDefiners;
132 };
133 
134 #endif
void correctToReferenceSystem()
Definition: PedeSteerer.cc:394
bool checkParameterChoices(const std::vector< Alignable * > &alis) const
Definition: PedeSteerer.cc:202
std::vector< Alignable * > theCoordDefiners
master coordinates, must (?) be global frame
Definition: PedeSteerer.h:131
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:130
std::map< const Alignable *, std::vector< float > > AlignablePresigmasMap
Definition: PedeSteerer.h:69
unsigned int presigmasFile(const std::string &fileName, const std::vector< Alignable * > &alis, const AlignablePresigmasMap &aliPresisMap)
look for active &#39;alis&#39; in map of presigma values and create steering file
Definition: PedeSteerer.cc:593
std::string myDirectory
Definition: PedeSteerer.h:119
std::set< const Alignable * > myNoHieraCollection
keeps track of created &#39;secondary&#39; steering files
Definition: PedeSteerer.h:129
edm::ParameterSet myConfig
pointer to labeler (not the owner)
Definition: PedeSteerer.h:118
bool isCorrectToRefSystem(const std::vector< Alignable * > &coordDefiners) const
Definition: PedeSteerer.cc:368
unsigned int hierarchyConstraints(const std::vector< Alignable * > &alis, const std::string &file)
Definition: PedeSteerer.cc:442
unsigned int theMinHieraParPerConstr
min absolute value of coefficients in hierarchy constraints
Definition: PedeSteerer.h:124
int fixParameter(Alignable *ali, unsigned int iRunRange, unsigned int iParam, char selector, std::ofstream *&filePtr, const std::string &fileName)
Definition: PedeSteerer.cc:264
std::ofstream * createSteerFile(const std::string &name, bool addToList)
create and open file with name, if (addToList) append to mySteeringFiles
Definition: PedeSteerer.cc:642
const PedeLabelerBase * myLabels
not the owner!
Definition: PedeSteerer.h:116
int runPede(const std::string &masterSteer) const
run pede, masterSteer should be as returned from buildMasterSteer(...)
Definition: PedeSteerer.cc:794
unsigned int presigmas(const std::vector< edm::ParameterSet > &cffPresi, const std::string &fileName, const std::vector< Alignable * > &alis, AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras)
interprete content of presigma VPSet &#39;cffPresi&#39; and call presigmasFile
Definition: PedeSteerer.cc:548
std::string buildMasterSteer(const std::vector< std::string > &binaryFiles)
construct (and return name of) master steering file from config, binaryFiles etc. ...
Definition: PedeSteerer.cc:754
int myParameterSign
whether or not to fill pede steering files with debug info
Definition: PedeSteerer.h:122
double theMinHieraConstrCoeff
old pede versions (before May &#39;07) need a sign flip...
Definition: PedeSteerer.h:123
unsigned int theConstrPrecision
hierarchy constraints with less params are ignored
Definition: PedeSteerer.h:125
const AlignmentParameterStore * myParameterStore
Definition: PedeSteerer.h:115
std::pair< unsigned int, unsigned int > fixParameters(const std::vector< Alignable * > &alignables, const std::string &file)
Definition: PedeSteerer.cc:230
bool myNoSteerFiles
directory of all files
Definition: PedeSteerer.h:120
void hierarchyConstraint(const Alignable *ali, const std::vector< Alignable * > &components, std::ofstream &file) const
Definition: PedeSteerer.cc:478
void buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras)
construct steering files about hierarchy, fixing etc. an keep track of their names ...
Definition: PedeSteerer.cc:673
std::vector< std::string > mySteeringFiles
precision for writing constraints to text file
Definition: PedeSteerer.h:127
double cmsToPedeFactor(unsigned int parNum) const
Definition: PedeSteerer.cc:139
std::string fileName(const std::string &addendum) const
full name with directory and &#39;idenitfier&#39;
Definition: PedeSteerer.cc:661
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:133
unsigned int buildNoHierarchyCollection(const std::vector< Alignable * > &alis)
Definition: PedeSteerer.cc:160
bool myIsSteerFileDebug
flag to write steering files to /dev/null
Definition: PedeSteerer.h:121
std::vector< Alignable * > selectCoordinateAlis(const std::vector< Alignable * > &alignables) const
Definition: PedeSteerer.cc:303
const std::string & directory() const
directory from constructor input, &#39;/&#39; is attached if needed
Definition: PedeSteerer.h:66
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
void defineCoordinates(const std::vector< Alignable * > &alis, Alignable *aliMaster, const std::string &fileName)
Definition: PedeSteerer.cc:346
int parameterSign() const
results from pede (and start values for pede) might need a sign flip
Definition: PedeSteerer.h:64