CMS 3D CMS Logo

HIPAlignmentAlgorithm.h
Go to the documentation of this file.
1 #ifndef Alignment_HIPAlignmentAlgorithm_HIPAlignmentAlgorithm_h
2 #define Alignment_HIPAlignmentAlgorithm_HIPAlignmentAlgorithm_h
3 
4 #include <vector>
12 #include "Riostream.h"
13 
20 
23 
26 #include "TFormula.h"
27 
28 class TFile;
29 class TTree;
30 
32 public:
35 
37  ~HIPAlignmentAlgorithm() override{};
38 
40  void initialize(const edm::EventSetup& setup,
43  AlignableExtras* extras,
44  AlignmentParameterStore* store) override;
45 
47  void terminate(const edm::EventSetup& setup) override;
48 
50  void startNewLoop(void) override;
51 
53  void run(const edm::EventSetup& setup, const EventInfo& eventInfo) override;
54 
55 private:
56  bool processHit1D(const AlignableDetOrUnitPtr& alidet,
57  const Alignable* ali,
58  const HIPAlignableSpecificParameters* alispecifics,
59  const TrajectoryStateOnSurface& tsos,
60  const TrackingRecHit* hit,
61  double hitwt);
62 
63  bool processHit2D(const AlignableDetOrUnitPtr& alidet,
64  const Alignable* ali,
65  const HIPAlignableSpecificParameters* alispecifics,
66  const TrajectoryStateOnSurface& tsos,
67  const TrackingRecHit* hit,
68  double hitwt);
69 
71  void writeIterationFile(std::string filename, int iter);
72  void setAlignmentPositionError(void);
73  double calcAPE(double* par, int iter, int function);
74  void bookRoot(void);
75  void fillAlignablesMonitor(const edm::EventSetup& setup);
76  bool calcParameters(Alignable* ali, int setDet, double start, double step);
77  void collector(void);
78  void collectMonitorTrees(const std::vector<std::string>& filenames);
79 
81 
82  // private data members
83 
84  std::unique_ptr<AlignableObjectId> alignableObjectId_;
87  std::unique_ptr<AlignableNavigator> theAlignableDetAccessor;
88 
90  int ioerr;
92 
93  // steering parameters
94 
95  // verbosity flag
96  const bool verbose;
97  // Monitor configuration
100  // names of IO root files
103 
105  std::vector<unsigned> theIOVrangeSet;
106 
107  // alignment position error parameters
109  std::vector<edm::ParameterSet> theAPEParameterSet;
110  std::vector<std::pair<align::Alignables, std::vector<double> > > theAPEParameters;
111 
112  // Default alignment specifications
113  // - min number of hits on alignable to calc parameters
114  // - max allowed rel error on parameter (else not used)
115  // - max allowed pull (residual / uncertainty) on a hit used in alignment
117 
119  std::vector<edm::ParameterSet> theCutsPerComponent;
120  std::vector<HIPAlignableSpecificParameters> theAlignableSpecifics;
121 
122  // collector mode (parallel processing)
126  int theDataGroup; // The data type specified in the cfg
130  std::vector<double> SetScanDet;
131 
132  std::unique_ptr<TFormula> theEtaFormula;
133 
134  const std::vector<std::string> surveyResiduals_;
135  std::vector<align::StructureType> theLevels; // for survey residuals
136 
137  // root tree variables
139  TTree* theTrackMonitorTree; // event-wise tree
140  TTree* theHitMonitorTree; // hit-wise tree
142  TTree* theAlignablesMonitorTree; // alignable-wise tree
144  TTree* theSurveyTree; // survey tree
145 
146  // common variables for monitor trees
148 
149  // variables for alignable-wise tree
156  unsigned int m2_nsurfdef;
157  std::vector<float> m2_surfDef;
158 
159  // variables for survey tree
162  float m3_par[6];
163 };
164 
165 #endif
Definition: start.py:1
std::vector< HIPAlignableSpecificParameters > theAlignableSpecifics
HIPAlignableSpecificParameters defaultAlignableSpecs
AlignmentParameterStore * theAlignmentParameterStore
HIPAlignableSpecificParameters * findAlignableSpecs(const Alignable *ali)
void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm.
void initialize(const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) override
Call at beginning of job.
uint32_t ID
Definition: Definitions.h:24
align::StructureType m2_ObjId
void writeIterationFile(std::string filename, int iter)
~HIPAlignmentAlgorithm() override
Destructor.
Interface/Base class for alignment algorithms, each alignment algorithm has to be derived from this c...
std::unique_ptr< AlignableNavigator > theAlignableDetAccessor
define event information passed to algorithms
std::vector< unsigned > theIOVrangeSet
bool calcParameters(Alignable *ali, int setDet, double start, double step)
HIPAlignmentAlgorithm(const edm::ParameterSet &cfg)
Constructor.
std::vector< edm::ParameterSet > theCutsPerComponent
int readIterationFile(std::string filename)
std::vector< double > SetScanDet
void collectMonitorTrees(const std::vector< std::string > &filenames)
double calcAPE(double *par, int iter, int function)
std::unique_ptr< AlignableObjectId > alignableObjectId_
std::vector< edm::ParameterSet > theAPEParameterSet
align::StructureType m3_ObjId
std::unique_ptr< TFormula > theEtaFormula
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
align::Alignables theAlignables
virtual void terminate()
Called at end of job (must be implemented in derived class)
std::vector< float > m2_surfDef
HIPMonitorConfig theMonitorConfig
void fillAlignablesMonitor(const edm::EventSetup &setup)
void startNewLoop(void) override
Called at start of new loop.
const std::vector< std::string > surveyResiduals_
step
Definition: StallMonitor.cc:94
bool processHit2D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
bool processHit1D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
std::vector< std::pair< align::Alignables, std::vector< double > > > theAPEParameters
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
std::vector< align::StructureType > theLevels
SurfaceDeformationFactory::Type m2_dtype