CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Alignment/MillePedeAlignmentAlgorithm/src/PedeSteerer.h

Go to the documentation of this file.
00001 #ifndef PEDESTEERER_H
00002 #define PEDESTEERER_H
00003 
00016 #include <vector>
00017 #include <map> 
00018 #include <set> 
00019 #include <string>
00020 // forward ofstream:
00021 #include <iosfwd> 
00022 
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 
00025 class Alignable;
00026 class AlignableTracker;
00027 class AlignableMuon;
00028 class AlignableExtras;
00029 class AlignmentParameterStore;
00030 class PedeLabeler;
00031 
00032 /***************************************
00033 ****************************************/
00034 class PedeSteerer
00035 {
00036  public:
00039   PedeSteerer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras,
00040               AlignmentParameterStore *store,
00041               const PedeLabeler *labels, const edm::ParameterSet &config,
00042               const std::string &defaultDir, bool noSteerFiles);
00044   ~PedeSteerer();
00045     
00047   bool isNoHiera(const Alignable* ali) const;
00048 
00050   void buildSubSteer(AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
00052   std::string buildMasterSteer(const std::vector<std::string> &binaryFiles);
00054   int runPede(const std::string &masterSteer) const;
00057   void correctToReferenceSystem();
00058   bool isCorrectToRefSystem(const std::vector<Alignable*> &coordDefiners) const;
00059 
00060 
00061   double cmsToPedeFactor(unsigned int parNum) const;
00063   int parameterSign() const { return myParameterSign; }
00065   const std::string& directory() const { return myDirectory;}
00066 
00067  private:
00068   typedef std::map<const Alignable*,std::vector<float> > AlignablePresigmasMap;
00069 
00072   bool checkParameterChoices(const std::vector<Alignable*> &alis) const;
00075   unsigned int buildNoHierarchyCollection(const std::vector<Alignable*> &alis);
00080   std::pair<unsigned int, unsigned int> fixParameters(const std::vector<Alignable*> &alignables,
00081                                                       const std::string &file);
00085   int fixParameter(Alignable *ali, unsigned int iParam, char selector, std::ofstream* &filePtr,
00086                    const std::string &fileName);
00090   std::vector<Alignable*> selectCoordinateAlis(const std::vector<Alignable*> &alignables) const;
00093   void defineCoordinates(const std::vector<Alignable*> &alis, Alignable *aliMaster,
00094                          const std::string &fileName);
00095 
00096   unsigned int hierarchyConstraints(const std::vector<Alignable*> &alis, const std::string &file);
00097   void hierarchyConstraint(const Alignable *ali, const std::vector<Alignable*> &components,
00098                            std::ofstream &file) const;
00099 
00101   unsigned int presigmas(const std::vector<edm::ParameterSet> &cffPresi,
00102                          const std::string &fileName, const std::vector<Alignable*> &alis,
00103                          AlignableTracker *aliTracker, AlignableMuon *aliMuon, AlignableExtras *aliExtras);
00105   unsigned int presigmasFile(const std::string &fileName, const std::vector<Alignable*> &alis,
00106                              const AlignablePresigmasMap &aliPresisMap); 
00108   std::string fileName(const std::string &addendum) const;
00110   std::ofstream* createSteerFile(const std::string &name, bool addToList);
00111 
00112   // data members
00113   const AlignmentParameterStore *myParameterStore; 
00114   const PedeLabeler             *myLabels; 
00115 
00116   edm::ParameterSet myConfig;
00117   std::string myDirectory; 
00118   bool myNoSteerFiles; 
00119   bool myIsSteerFileDebug; 
00120   int myParameterSign; 
00121   double theMinHieraConstrCoeff; 
00122   unsigned int theMinHieraParPerConstr; 
00123 
00124   std::vector<std::string> mySteeringFiles; 
00125 
00126   std::set<const Alignable*> myNoHieraCollection; 
00127   Alignable *theCoordMaster;                      
00128   std::vector<Alignable*> theCoordDefiners;      
00129 };
00130 
00131 #endif