CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PedeSteererWeakModeConstraints.h
Go to the documentation of this file.
1 #ifndef PEDESTEERERWEAKMODECONSTRAINTS_H
2 #define PEDESTEERERWEAKMODECONSTRAINTS_H
3 
13 #include <list>
14 #include <vector>
15 #include <map>
16 #include <set>
17 #include <string>
18 // forward ofstream:
19 #include <iosfwd>
20 
24 
27 
28 class Alignable;
29 class PedeLabelerBase;
30 
31 /***************************************
32 ****************************************/
33 
34 //FIXME: move GeometryConstraintConfigData to PedeSteererWeakModeConstraints?
36  public:
37  GeometryConstraintConfigData(const std::vector<double>& co,
38  const std::string& c,
39  const std::vector<std::pair<Alignable*,std::string> >& alisFile,
40  const int sd,
41  const align::Alignables& ex,
42  const int instance,
43  const bool downToLowestLevel
44  );
45  const std::vector<double> coefficients_;
47  const std::vector<std::pair<Alignable*, std::string> > levelsFilenames_;
49  std::map<std::string, std::ofstream*> mapFileName_;
50  std::list<std::pair<Alignable*, std::list<Alignable*> > > HLSsubdets_; //first pointer to HLS object, second list is the list of pointers to the lowest components
51  const int sysdeformation_;
52  const int instance_;
53  const bool downToLowestLevel_;
54 };
55 
57  public:
60  const PedeLabelerBase *labels,
61  const std::vector<edm::ParameterSet> &config,
62  std::string sf
63  );
64 
65  //FIXME: split the code of the method into smaller pieces/submethods
66  // Main method that configures everything and calculates also the constraints
67  unsigned int constructConstraints(const align::Alignables&);
68 
69  // Returns a references to the container in which the configuration is stored
70  std::list<GeometryConstraintConfigData>& getConfigData() { return ConstraintsConfigContainer_; }
71 
72  private:
73  // Method creates the data structures with the full configuration
74  unsigned int createAlignablesDataStructure();
75 
76  // Write the calculated constraints to the output files
77  void writeOutput(const std::list<std::pair<unsigned int,double> > &output,
78  const GeometryConstraintConfigData &it, const Alignable* iHLS, double sum_xi_x0);
79 
80  // find the out file stream for a given constraint and high-level structure
81  std::ofstream* getFile(const GeometryConstraintConfigData &it, const Alignable* iHLS) const;
82 
83  // Close the output files
84  void closeOutputfiles();
85 
86  // Checks whether lowleveldet is a daugther of HLS
87  bool checkMother(const Alignable * const lowleveldet, const Alignable * const HLS) const;
88 
89  std::pair<align::GlobalPoint, align::GlobalPoint> getDoubleSensorPosition(const Alignable *ali) const;
90 
91  double getPhase(const std::vector<double> &coefficients) const;
92 
93  // The function for the geometry deformation is defined as f(x).
94  // The methods returns x depending on the type of deformation
95  double getX(const int sysdeformation, const align::GlobalPoint &pos, const double phase) const;
96 
97  double getX0(const std::pair<Alignable*, std::list<Alignable*> > &iHLS,
98  const GeometryConstraintConfigData &it) const;
99 
100  // Calculates and returns the coefficient for alignment parameter iParameter
101  // for an alignable at position pos.
102  double getCoefficient(const int sysdeformation,
103  const align::GlobalPoint &pos,
104  const GlobalPoint gUDirection,
105  const GlobalPoint gVDirection,
106  const GlobalPoint gWDirection,
107  const int iParameter, const double &x0,
108  const std::vector<double> &constraintparameters) const;
109 
110  //returns true if iParameter of Alignable is selected in configuration file
111  bool checkSelectionShiftParameter(const Alignable *ali, unsigned int iParameter) const;
112 
113  // Method used to test the provided configuration for unknown parameters
114  void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const;
115 
116  // Method which creates the associative map between levels and coefficient file names
117  const std::vector<std::pair<Alignable*, std::string> > makeLevelsFilenames(
118  std::set<std::string> &steerFilePrefixContainer,
119  const align::Alignables& alis,
120  const std::string &steerFilePrefix
121  ) const;
122 
123  // Verify that the name of the configured deformation is known and that the number of coefficients has been correctly configured
124  int verifyDeformationName(const std::string &name, const std::vector<double> &coefficients) const;
125 
126  //list of dead modules which are not used in any constraint
127  std::list<align::ID> deadmodules_;
128 
129  //the data structure that holds all needed informations for the constraint configuration
130  std::list<GeometryConstraintConfigData> ConstraintsConfigContainer_;
131 
132  const PedeLabelerBase *myLabels_; //PedeLabeler needed to get for the alignables the corresponding Pede label
133 
134  const std::vector<edm::ParameterSet> myConfig_; //the VPSet with the configurations for all constraints
135 
136  const std::string steerFile_; // the name of the PedeSteerer steering file
137 
139 
140 
142  kUnknown = 0,
151  kSkew
152  };
153 };
154 
155 #endif
static PFTauRenderPlugin instance
std::list< GeometryConstraintConfigData > & getConfigData()
Definition: config.py:1
std::map< std::string, std::ofstream * > mapFileName_
GeometryConstraintConfigData(const std::vector< double > &co, const std::string &c, const std::vector< std::pair< Alignable *, std::string > > &alisFile, const int sd, const align::Alignables &ex, const int instance, const bool downToLowestLevel)
const std::vector< std::pair< Alignable *, std::string > > levelsFilenames_
std::list< std::pair< Alignable *, std::list< Alignable * > > > HLSsubdets_
Allows conversion between type and name, and vice-versa.
const std::vector< double > coefficients_
const std::vector< edm::ParameterSet > myConfig_
double sd
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
std::list< GeometryConstraintConfigData > ConstraintsConfigContainer_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run