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 
16 #include <list>
17 #include <vector>
18 #include <map>
19 #include <set>
20 #include <string>
21 // forward ofstream:
22 #include <iosfwd>
23 
26 
29 
30 class Alignable;
31 class PedeLabelerBase;
32 
33 /***************************************
34 ****************************************/
35 
36 //FIXME: move GeometryConstraintConfigData to PedeSteererWeakModeConstraints?
38  public:
39  GeometryConstraintConfigData(const std::vector<double> co,
40  const std::string c,
41  const std::vector<std::pair<Alignable*,std::string> > &alisFile,
42  const int sd,
43  const std::vector<Alignable*> ex
44  );
45  const std::vector<double> coefficients_;
47  const std::vector<std::pair<Alignable*, std::string> > levelsFilenames_;
48  const std::vector<Alignable*> excludedAlignables_;
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
52 };
53 
55  public:
58  const PedeLabelerBase *labels,
59  const std::vector<edm::ParameterSet> &config,
60  std::string sf
61  );
62 
63  //FIXME: split the code of the method into smaller pieces/submethods
64  // Main method that configures everything and calculates also the constraints
65  unsigned int constructConstraints(const std::vector<Alignable*> &alis);
66 
67  // Returns a references to the container in which the configuration is stored
68  std::list<GeometryConstraintConfigData>* getConfigData() { return &ConstraintsConfigContainer_; }
69 
70  private:
71  // Method creates the data structures with the full configuration
72  unsigned int createAlignablesDataStructure();
73 
74  // Write the calculated constraints to the output files
75  void writeOutput(const std::list<std::pair<unsigned int,double> > &output,
76  const std::list<GeometryConstraintConfigData>::const_iterator &it, Alignable* iHLS, double sum_xi_x0);
77 
78  // Close the output files
79  void closeOutputfiles();
80 
81  // Checks whether lowleveldet is a daugther of HLS
82  bool checkMother(const Alignable * const lowleveldet, const Alignable * const HLS) const;
83 
84  std::pair<align::GlobalPoint, align::GlobalPoint> getDoubleSensorPosition(const Alignable *ali) const;
85 
86  double getPhase(const std::vector<double> &coefficients) const;
87 
88  // The function for the geometry deformation is defined as f(x).
89  // The methods returns x depending on the type of deformation
90  double getX(const int sysdeformation, const align::GlobalPoint &pos, const double phase) const;
91 
92  double getX0(std::list<std::pair<Alignable*, std::list<Alignable*> > >::iterator &iHLS,
93  std::list<GeometryConstraintConfigData>::iterator &it);
94 
95  // Calculates and returns the coefficient for alignment parameter iParameter
96  // for an alignable at position pos.
97  double getCoefficient(const int sysdeformation,
98  const align::GlobalPoint &pos,
99  const GlobalPoint gUDirection,
100  const GlobalPoint gVDirection,
101  const GlobalPoint gWDirection,
102  const int iParameter, const double &x0,
103  const std::vector<double> &constraintparameters) const;
104 
105  //returns true if iParameter of Alignable is selected in configuration file
106  bool checkSelectionShiftParameter(const Alignable *ali, unsigned int iParameter) const;
107 
108  // Method used to test the provided configuration for unknown parameters
109  void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const;
110 
111  // Method which creates the associative map between levels and coefficient file names
112  const std::vector<std::pair<Alignable*, std::string> > makeLevelsFilenames(
113  std::set<std::string> &steerFilePrefixContainer,
114  const std::vector<Alignable*> &alis,
115  const std::string &steerFilePrefix
116  ) const;
117 
118  // Verify that the name of the configured deformation is known and that the number of coefficients has been correctly configured
119  int verifyDeformationName(const std::string &name, const std::vector<double> &coefficients) const;
120 
121  //list of dead modules which are not used in any constraint
122  std::list<align::ID> deadmodules_;
123 
124  //the data structure that holds all needed informations for the constraint configuration
125  std::list<GeometryConstraintConfigData> ConstraintsConfigContainer_;
126 
127  const PedeLabelerBase *myLabels_; //PedeLabeler needed to get for the alignables the corresponding Pede label
128 
129  const std::vector<edm::ParameterSet> myConfig_; //the VPSet with the configurations for all constraints
130 
131  const std::string steerFile_; // the name of the PedeSteerer steering file
132 
134  kUnknown = 0,
144  };
145 };
146 
147 #endif
bool checkSelectionShiftParameter(const Alignable *ali, unsigned int iParameter) const
const std::vector< Alignable * > excludedAlignables_
void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const
std::pair< align::GlobalPoint, align::GlobalPoint > getDoubleSensorPosition(const Alignable *ali) const
double getX(const int sysdeformation, const align::GlobalPoint &pos, const double phase) const
std::map< std::string, std::ofstream * > mapFileName_
unsigned int constructConstraints(const std::vector< Alignable * > &alis)
double getX0(std::list< std::pair< Alignable *, std::list< Alignable * > > >::iterator &iHLS, std::list< GeometryConstraintConfigData >::iterator &it)
const std::vector< std::pair< Alignable *, std::string > > levelsFilenames_
void writeOutput(const std::list< std::pair< unsigned int, double > > &output, const std::list< GeometryConstraintConfigData >::const_iterator &it, Alignable *iHLS, double sum_xi_x0)
std::list< std::pair< Alignable *, std::list< Alignable * > > > HLSsubdets_
const std::vector< std::pair< Alignable *, std::string > > makeLevelsFilenames(std::set< std::string > &steerFilePrefixContainer, const std::vector< Alignable * > &alis, const std::string &steerFilePrefix) const
int verifyDeformationName(const std::string &name, const std::vector< double > &coefficients) const
const std::vector< double > coefficients_
PedeSteererWeakModeConstraints(AlignableTracker *aliTracker, const PedeLabelerBase *labels, const std::vector< edm::ParameterSet > &config, std::string sf)
const std::vector< edm::ParameterSet > myConfig_
std::list< GeometryConstraintConfigData > * getConfigData()
double sd
double getPhase(const std::vector< double > &coefficients) const
double getCoefficient(const int sysdeformation, const align::GlobalPoint &pos, const GlobalPoint gUDirection, const GlobalPoint gVDirection, const GlobalPoint gWDirection, const int iParameter, const double &x0, const std::vector< double > &constraintparameters) const
bool checkMother(const Alignable *const lowleveldet, const Alignable *const HLS) const
GeometryConstraintConfigData(const std::vector< double > co, const std::string c, const std::vector< std::pair< Alignable *, std::string > > &alisFile, const int sd, const std::vector< Alignable * > ex)
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