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