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);
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
HIPAlignmentAlgorithm::writeIterationFile
void writeIterationFile(std::string filename, int iter)
Definition: HIPAlignmentAlgorithm.cc:1011
AlignmentIORoot.h
HIPAlignmentAlgorithm::theMonitorConfig
HIPMonitorConfig theMonitorConfig
Definition: HIPAlignmentAlgorithm.h:98
HIPAlignmentAlgorithm::theCollectorNJobs
int theCollectorNJobs
Definition: HIPAlignmentAlgorithm.h:124
HIPAlignmentAlgorithm::fillAlignablesMonitor
void fillAlignablesMonitor(const edm::EventSetup &setup)
Definition: HIPAlignmentAlgorithm.cc:1154
start
Definition: start.py:1
HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
TFile * theTrackHitMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:138
HIPAlignmentAlgorithm::theApplyCutsPerComponent
bool theApplyCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:118
HIPAlignmentAlgorithm::alignableObjectId_
std::unique_ptr< AlignableObjectId > alignableObjectId_
Definition: HIPAlignmentAlgorithm.h:84
HIPAlignmentAlgorithm::smisalignedfile
std::string smisalignedfile
Definition: HIPAlignmentAlgorithm.h:102
HIPAlignmentAlgorithm::ssurveyfile
std::string ssurveyfile
Definition: HIPAlignmentAlgorithm.h:102
HIPAlignmentAlgorithm::theEtaFormula
std::unique_ptr< TFormula > theEtaFormula
Definition: HIPAlignmentAlgorithm.h:132
step
step
Definition: StallMonitor.cc:94
HIPAlignmentAlgorithm::HIPAlignmentAlgorithm
HIPAlignmentAlgorithm(const edm::ParameterSet &cfg)
Constructor.
Definition: HIPAlignmentAlgorithm.cc:45
muon
Definition: MuonCocktails.h:17
HIPAlignmentAlgorithm::theAlignablesMonitorTree
TTree * theAlignablesMonitorTree
Definition: HIPAlignmentAlgorithm.h:142
HIPAlignmentAlgorithm::bookRoot
void bookRoot(void)
Definition: HIPAlignmentAlgorithm.cc:1093
HIPAlignmentAlgorithm::uniEta
bool uniEta
Definition: HIPAlignmentAlgorithm.h:127
Alignable
Definition: Alignable.h:27
HIPAlignmentAlgorithm::IsCollision
bool IsCollision
Definition: HIPAlignmentAlgorithm.h:127
HIPAlignmentAlgorithm::m2_Id
align::ID m2_Id
Definition: HIPAlignmentAlgorithm.h:150
HIPAlignmentAlgorithm::theCutsPerComponent
std::vector< edm::ParameterSet > theCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:119
HIPAlignmentAlgorithm::processHit2D
bool processHit2D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:621
HIPAlignmentAlgorithm::m2_datatype
int m2_datatype
Definition: HIPAlignmentAlgorithm.h:153
HIPAlignmentAlgorithm::theAPEParameters
std::vector< std::pair< align::Alignables, std::vector< double > > > theAPEParameters
Definition: HIPAlignmentAlgorithm.h:110
HIPAlignmentAlgorithm::SetScanDet
std::vector< double > SetScanDet
Definition: HIPAlignmentAlgorithm.h:130
HIPAlignmentAlgorithm::m2_Layer
int m2_Layer
Definition: HIPAlignmentAlgorithm.h:152
HIPAlignmentAlgorithm::m2_dtype
SurfaceDeformationFactory::Type m2_dtype
Definition: HIPAlignmentAlgorithm.h:155
HIPAlignmentAlgorithm::outpath
std::string outpath
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::m_datatype
int m_datatype
Definition: HIPAlignmentAlgorithm.h:147
HIPAlignmentAlgorithm::theLevels
std::vector< align::StructureType > theLevels
Definition: HIPAlignmentAlgorithm.h:135
HIPAlignmentAlgorithm::theTrackMonitorTree
TTree * theTrackMonitorTree
Definition: HIPAlignmentAlgorithm.h:139
AlignableDetOrUnitPtr
Definition: AlignableDetOrUnitPtr.h:30
AlignmentAlgorithmBase
Definition: AlignmentAlgorithmBase.h:59
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
HIPAlignmentAlgorithm::calcAPE
double calcAPE(double *par, int iter, int function)
Definition: HIPAlignmentAlgorithm.cc:1076
HIPAlignmentAlgorithm::theApplyAPE
bool theApplyAPE
Definition: HIPAlignmentAlgorithm.h:108
HIPAlignmentAlgorithm::readIterationFile
int readIterationFile(std::string filename)
Definition: HIPAlignmentAlgorithm.cc:992
HIPAlignmentAlgorithm::sparameterfile
std::string sparameterfile
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::m2_nsurfdef
unsigned int m2_nsurfdef
Definition: HIPAlignmentAlgorithm.h:156
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
HIPAlignableSpecificParameters.h
HIPAlignmentAlgorithm::uniEtaFormula
std::string uniEtaFormula
Definition: HIPAlignmentAlgorithm.h:128
HIPAlignmentAlgorithm::m2_Type
int m2_Type
Definition: HIPAlignmentAlgorithm.h:152
HIPAlignmentAlgorithm::outfile2
std::string outfile2
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::theAlignableSpecifics
std::vector< HIPAlignableSpecificParameters > theAlignableSpecifics
Definition: HIPAlignmentAlgorithm.h:120
HIPAlignmentAlgorithm::theAlignablesMonitorIORootFile
TFile * theAlignablesMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:141
HIPAlignmentAlgorithm::findAlignableSpecs
HIPAlignableSpecificParameters * findAlignableSpecs(const Alignable *ali)
Definition: HIPAlignmentAlgorithm.cc:1549
HIPAlignmentAlgorithm::initialize
void initialize(const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) override
Call at beginning of job.
Definition: HIPAlignmentAlgorithm.cc:127
HIPAlignmentAlgorithm::m2_Xpos
float m2_Xpos
Definition: HIPAlignmentAlgorithm.h:154
HIPAlignmentAlgorithm::suvarfile
std::string suvarfile
Definition: HIPAlignmentAlgorithm.h:101
AlignableTracker
Definition: AlignableTracker.h:17
HIPAlignmentAlgorithm::m2_ObjId
align::StructureType m2_ObjId
Definition: HIPAlignmentAlgorithm.h:151
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HIPAlignmentAlgorithm::rewgtPerAli
bool rewgtPerAli
Definition: HIPAlignmentAlgorithm.h:127
HIPAlignmentAlgorithm::theAlignables
align::Alignables theAlignables
Definition: HIPAlignmentAlgorithm.h:86
AlignableExtras
Definition: AlignableExtras.h:19
HIPAlignmentAlgorithm::collector
void collector(void)
Definition: HIPAlignmentAlgorithm.cc:1331
HIPAlignmentAlgorithm::ioerr
int ioerr
Definition: HIPAlignmentAlgorithm.h:90
AlignableNavigator.h
SiPixelRecHit.h
HIPAlignmentAlgorithm::isCollector
bool isCollector
Definition: HIPAlignmentAlgorithm.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HIPAlignmentAlgorithm::startNewLoop
void startNewLoop(void) override
Called at start of new loop.
Definition: HIPAlignmentAlgorithm.cc:302
align::StructureType
StructureType
Definition: StructureType.h:16
SurfaceDeformation.h
HIPAlignmentAlgorithm::surveyResiduals_
const std::vector< std::string > surveyResiduals_
Definition: HIPAlignmentAlgorithm.h:134
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ZMuMuAnalysisNtupler_cff.eventInfo
eventInfo
Definition: ZMuMuAnalysisNtupler_cff.py:15
AlignmentAlgorithmBase::terminate
virtual void terminate()
Called at end of job (must be implemented in derived class)
Definition: AlignmentAlgorithmBase.h:157
HIPMonitorConfig
Definition: HIPMonitorConfig.h:112
edm::ParameterSet
Definition: ParameterSet.h:47
align::ID
uint32_t ID
Definition: Definitions.h:24
AlignableDetOrUnitPtr.h
HIPAlignmentAlgorithm::processHit1D
bool processHit1D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:519
HIPAlignmentAlgorithm::m2_surfDef
std::vector< float > m2_surfDef
Definition: HIPAlignmentAlgorithm.h:157
HIPAlignmentAlgorithm::theAlignableDetAccessor
std::unique_ptr< AlignableNavigator > theAlignableDetAccessor
Definition: HIPAlignmentAlgorithm.h:87
SurfaceDeformationFactory::Type
Type
Definition: SurfaceDeformationFactory.h:17
HIPAlignmentAlgorithm::theIteration
int theIteration
Definition: HIPAlignmentAlgorithm.h:91
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
HIPAlignmentAlgorithm::m2_Ypos
float m2_Ypos
Definition: HIPAlignmentAlgorithm.h:154
HIPAlignmentAlgorithm::theIO
AlignmentIORoot theIO
Definition: HIPAlignmentAlgorithm.h:89
HIPAlignmentAlgorithm::~HIPAlignmentAlgorithm
~HIPAlignmentAlgorithm() override
Destructor.
Definition: HIPAlignmentAlgorithm.h:37
AlignmentClusterFlag.h
HIPAlignmentAlgorithm::trackPs
bool trackPs
Definition: HIPAlignmentAlgorithm.h:127
edm::EventSetup
Definition: EventSetup.h:57
HIPAlignmentAlgorithm::theIOVrangeSet
std::vector< unsigned > theIOVrangeSet
Definition: HIPAlignmentAlgorithm.h:105
HIPAlignmentAlgorithm::themultiIOV
bool themultiIOV
Definition: HIPAlignmentAlgorithm.h:104
HIPAlignmentAlgorithm::calcParameters
bool calcParameters(Alignable *ali, int setDet, double start, double step)
Definition: HIPAlignmentAlgorithm.cc:1234
HIPAlignmentAlgorithm::theHitMonitorTree
TTree * theHitMonitorTree
Definition: HIPAlignmentAlgorithm.h:140
looper.cfg
cfg
Definition: looper.py:297
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripRecHit1D.h
HIPAlignmentAlgorithm::verbose
const bool verbose
Definition: HIPAlignmentAlgorithm.h:96
HIPAlignmentAlgorithm::struefile
std::string struefile
Definition: HIPAlignmentAlgorithm.h:102
SurfaceDeformationFactory.h
AlignableObjectId.h
HIPAlignmentAlgorithm::defaultAlignableSpecs
HIPAlignableSpecificParameters defaultAlignableSpecs
Definition: HIPAlignmentAlgorithm.h:116
HIPAlignmentAlgorithm::doTrackHitMonitoring
const bool doTrackHitMonitoring
Definition: HIPAlignmentAlgorithm.h:99
HIPAlignmentAlgorithm::theDataGroup
int theDataGroup
Definition: HIPAlignmentAlgorithm.h:126
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
HIPAlignmentAlgorithm::col_cut
double col_cut
Definition: HIPAlignmentAlgorithm.h:129
HIPAlignmentAlgorithm::theCollectorPath
std::string theCollectorPath
Definition: HIPAlignmentAlgorithm.h:125
HIPAlignmentAlgorithm::siterationfile
std::string siterationfile
Definition: HIPAlignmentAlgorithm.h:102
AlignmentParameterStore
Definition: AlignmentParameterStore.h:23
HIPAlignmentAlgorithm::theAlignmentParameterStore
AlignmentParameterStore * theAlignmentParameterStore
Definition: HIPAlignmentAlgorithm.h:85
HIPAlignableSpecificParameters
Definition: HIPAlignableSpecificParameters.h:7
ClassName.h
Alignable.h
HIPAlignmentAlgorithm::trackWt
bool trackWt
Definition: HIPAlignmentAlgorithm.h:127
HIPAlignmentAlgorithm::m3_par
float m3_par[6]
Definition: HIPAlignmentAlgorithm.h:162
HIPAlignmentAlgorithm::m2_Zpos
float m2_Zpos
Definition: HIPAlignmentAlgorithm.h:154
AlignmentAlgorithmBase.h
Interface/Base class for alignment algorithms, each alignment algorithm has to be derived from this c...
HIPAlignmentAlgorithm::salignedfile
std::string salignedfile
Definition: HIPAlignmentAlgorithm.h:102
AliClusterValueMap.h
HIPAlignmentAlgorithm::theSurveyTree
TTree * theSurveyTree
Definition: HIPAlignmentAlgorithm.h:144
AlignmentIORoot
Definition: AlignmentIORoot.h:15
HIPAlignmentAlgorithm::suvarfilecore
std::string suvarfilecore
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::cos_cut
double cos_cut
Definition: HIPAlignmentAlgorithm.h:129
ParameterSet.h
HIPAlignmentAlgorithm::m3_Id
align::ID m3_Id
Definition: HIPAlignmentAlgorithm.h:160
HIPAlignmentAlgorithm::setAlignmentPositionError
void setAlignmentPositionError(void)
Definition: HIPAlignmentAlgorithm.cc:1025
HIPAlignmentAlgorithm::theSurveyIORootFile
TFile * theSurveyIORootFile
Definition: HIPAlignmentAlgorithm.h:143
HIPAlignmentAlgorithm::run
void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm.
Definition: HIPAlignmentAlgorithm.cc:737
SiStripRecHit2D.h
HIPAlignmentAlgorithm::collectMonitorTrees
void collectMonitorTrees(const std::vector< std::string > &filenames)
Definition: HIPAlignmentAlgorithm.cc:1486
hit
Definition: SiStripHitEffFromCalibTree.cc:88
HIPAlignmentAlgorithm::m2_Nhit
int m2_Nhit
Definition: HIPAlignmentAlgorithm.h:152
AlignmentAlgorithmBase::EventInfo
define event information passed to algorithms
Definition: AlignmentAlgorithmBase.h:72
HIPAlignmentAlgorithm::theAPEParameterSet
std::vector< edm::ParameterSet > theAPEParameterSet
Definition: HIPAlignmentAlgorithm.h:109
HIPMonitorConfig.h
HIPAlignmentAlgorithm::m3_ObjId
align::StructureType m3_ObjId
Definition: HIPAlignmentAlgorithm.h:161
HIPAlignmentAlgorithm::Scale
double Scale
Definition: HIPAlignmentAlgorithm.h:129
HIPAlignmentAlgorithm
Definition: HIPAlignmentAlgorithm.h:31