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>
13 #include "Riostream.h"
14 
21 
24 
28 
31 #include "TFormula.h"
32 
33 class TFile;
34 class TTree;
35 
37 public:
40 
42  ~HIPAlignmentAlgorithm() override{};
43 
45  void initialize(const edm::EventSetup& setup,
48  AlignableExtras* extras,
49  AlignmentParameterStore* store) override;
50 
52  void terminate(const edm::EventSetup& setup) override;
53 
55  void startNewLoop(void) override;
56 
58  void run(const edm::EventSetup& setup, const EventInfo& eventInfo) override;
59 
60 private:
61  bool processHit1D(const AlignableDetOrUnitPtr& alidet,
62  const Alignable* ali,
63  const HIPAlignableSpecificParameters* alispecifics,
64  const TrajectoryStateOnSurface& tsos,
65  const TrackingRecHit* hit,
66  double hitwt);
67 
68  bool processHit2D(const AlignableDetOrUnitPtr& alidet,
69  const Alignable* ali,
70  const HIPAlignableSpecificParameters* alispecifics,
71  const TrajectoryStateOnSurface& tsos,
72  const TrackingRecHit* hit,
73  double hitwt);
74 
76  void writeIterationFile(std::string filename, int iter);
77  void setAlignmentPositionError(void);
78  double calcAPE(double* par, int iter, int function);
79  void bookRoot(void);
81  bool calcParameters(Alignable* ali, int setDet, double start, double step);
82  void collector(void);
83  void collectMonitorTrees(const std::vector<std::string>& filenames);
84 
86 
87  // private data members
90 
91  std::unique_ptr<AlignableObjectId> alignableObjectId_;
94  std::unique_ptr<AlignableNavigator> theAlignableDetAccessor;
95 
97  int ioerr;
99 
100  // steering parameters
101 
102  // verbosity flag
103  const bool verbose;
104  // Monitor configuration
107  // names of IO root files
110 
112  std::vector<unsigned> theIOVrangeSet;
113 
114  // alignment position error parameters
116  std::vector<edm::ParameterSet> theAPEParameterSet;
117  std::vector<std::pair<align::Alignables, std::vector<double> > > theAPEParameters;
118 
119  // Default alignment specifications
120  // - min number of hits on alignable to calc parameters
121  // - max allowed rel error on parameter (else not used)
122  // - max allowed pull (residual / uncertainty) on a hit used in alignment
124 
126  std::vector<edm::ParameterSet> theCutsPerComponent;
127  std::vector<HIPAlignableSpecificParameters> theAlignableSpecifics;
128 
129  // collector mode (parallel processing)
133  int theDataGroup; // The data type specified in the cfg
137  std::vector<double> SetScanDet;
138 
139  std::unique_ptr<TFormula> theEtaFormula;
140 
141  const std::vector<std::string> surveyResiduals_;
142  std::vector<align::StructureType> theLevels; // for survey residuals
143 
144  // root tree variables
146  TTree* theTrackMonitorTree; // event-wise tree
147  TTree* theHitMonitorTree; // hit-wise tree
149  TTree* theAlignablesMonitorTree; // alignable-wise tree
151  TTree* theSurveyTree; // survey tree
152 
153  // common variables for monitor trees
155 
156  // variables for alignable-wise tree
163  unsigned int m2_nsurfdef;
164  std::vector<float> m2_surfDef;
165 
166  // variables for survey tree
169  float m3_par[6];
170 };
171 
172 #endif
HIPAlignmentAlgorithm::writeIterationFile
void writeIterationFile(std::string filename, int iter)
Definition: HIPAlignmentAlgorithm.cc:1005
AlignmentIORoot.h
HIPAlignmentAlgorithm::theMonitorConfig
HIPMonitorConfig theMonitorConfig
Definition: HIPAlignmentAlgorithm.h:105
HIPAlignmentAlgorithm::theCollectorNJobs
int theCollectorNJobs
Definition: HIPAlignmentAlgorithm.h:131
HIPAlignmentAlgorithm::fillAlignablesMonitor
void fillAlignablesMonitor(const edm::EventSetup &setup)
Definition: HIPAlignmentAlgorithm.cc:1148
start
Definition: start.py:1
HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
TFile * theTrackHitMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:145
HIPAlignmentAlgorithm::theApplyCutsPerComponent
bool theApplyCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:125
HIPAlignmentAlgorithm::alignableObjectId_
std::unique_ptr< AlignableObjectId > alignableObjectId_
Definition: HIPAlignmentAlgorithm.h:91
HIPAlignmentAlgorithm::smisalignedfile
std::string smisalignedfile
Definition: HIPAlignmentAlgorithm.h:109
HIPAlignmentAlgorithm::HIPAlignmentAlgorithm
HIPAlignmentAlgorithm(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Constructor.
Definition: HIPAlignmentAlgorithm.cc:41
HIPAlignmentAlgorithm::ssurveyfile
std::string ssurveyfile
Definition: HIPAlignmentAlgorithm.h:109
HIPAlignmentAlgorithm::theEtaFormula
std::unique_ptr< TFormula > theEtaFormula
Definition: HIPAlignmentAlgorithm.h:139
step
step
Definition: StallMonitor.cc:94
muon
Definition: MuonCocktails.h:17
HIPAlignmentAlgorithm::theAlignablesMonitorTree
TTree * theAlignablesMonitorTree
Definition: HIPAlignmentAlgorithm.h:149
HIPAlignmentAlgorithm::bookRoot
void bookRoot(void)
Definition: HIPAlignmentAlgorithm.cc:1087
HIPAlignmentAlgorithm::uniEta
bool uniEta
Definition: HIPAlignmentAlgorithm.h:134
Alignable
Definition: Alignable.h:27
HIPAlignmentAlgorithm::IsCollision
bool IsCollision
Definition: HIPAlignmentAlgorithm.h:134
HIPAlignmentAlgorithm::m2_Id
align::ID m2_Id
Definition: HIPAlignmentAlgorithm.h:157
HIPAlignmentAlgorithm::theCutsPerComponent
std::vector< edm::ParameterSet > theCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:126
HIPAlignmentAlgorithm::processHit2D
bool processHit2D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:615
HIPAlignmentAlgorithm::m2_datatype
int m2_datatype
Definition: HIPAlignmentAlgorithm.h:160
HIPAlignmentAlgorithm::theAPEParameters
std::vector< std::pair< align::Alignables, std::vector< double > > > theAPEParameters
Definition: HIPAlignmentAlgorithm.h:117
HIPAlignmentAlgorithm::SetScanDet
std::vector< double > SetScanDet
Definition: HIPAlignmentAlgorithm.h:137
HIPAlignmentAlgorithm::m2_Layer
int m2_Layer
Definition: HIPAlignmentAlgorithm.h:159
HIPAlignmentAlgorithm::m2_dtype
SurfaceDeformationFactory::Type m2_dtype
Definition: HIPAlignmentAlgorithm.h:162
HIPAlignmentAlgorithm::outpath
std::string outpath
Definition: HIPAlignmentAlgorithm.h:108
HIPAlignmentAlgorithm::m_datatype
int m_datatype
Definition: HIPAlignmentAlgorithm.h:154
HIPAlignmentAlgorithm::theLevels
std::vector< align::StructureType > theLevels
Definition: HIPAlignmentAlgorithm.h:142
HIPAlignmentAlgorithm::theTrackMonitorTree
TTree * theTrackMonitorTree
Definition: HIPAlignmentAlgorithm.h:146
AlignableDetOrUnitPtr
Definition: AlignableDetOrUnitPtr.h:30
AlignmentAlgorithmBase
Definition: AlignmentAlgorithmBase.h:60
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
HIPAlignmentAlgorithm::calcAPE
double calcAPE(double *par, int iter, int function)
Definition: HIPAlignmentAlgorithm.cc:1070
HIPAlignmentAlgorithm::theApplyAPE
bool theApplyAPE
Definition: HIPAlignmentAlgorithm.h:115
HIPAlignmentAlgorithm::readIterationFile
int readIterationFile(std::string filename)
Definition: HIPAlignmentAlgorithm.cc:986
HIPAlignmentAlgorithm::sparameterfile
std::string sparameterfile
Definition: HIPAlignmentAlgorithm.h:108
HIPAlignmentAlgorithm::m2_nsurfdef
unsigned int m2_nsurfdef
Definition: HIPAlignmentAlgorithm.h:163
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrackerTopology.h
HIPAlignableSpecificParameters.h
HIPAlignmentAlgorithm::uniEtaFormula
std::string uniEtaFormula
Definition: HIPAlignmentAlgorithm.h:135
HIPAlignmentAlgorithm::m2_Type
int m2_Type
Definition: HIPAlignmentAlgorithm.h:159
TrackerTopologyRcd.h
HIPAlignmentAlgorithm::outfile2
std::string outfile2
Definition: HIPAlignmentAlgorithm.h:108
HIPAlignmentAlgorithm::theAlignableSpecifics
std::vector< HIPAlignableSpecificParameters > theAlignableSpecifics
Definition: HIPAlignmentAlgorithm.h:127
HIPAlignmentAlgorithm::theAlignablesMonitorIORootFile
TFile * theAlignablesMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:148
HIPAlignmentAlgorithm::findAlignableSpecs
HIPAlignableSpecificParameters * findAlignableSpecs(const Alignable *ali)
Definition: HIPAlignmentAlgorithm.cc:1539
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:125
HIPAlignmentAlgorithm::m2_Xpos
float m2_Xpos
Definition: HIPAlignmentAlgorithm.h:161
HIPAlignmentAlgorithm::suvarfile
std::string suvarfile
Definition: HIPAlignmentAlgorithm.h:108
AlignableTracker
Definition: AlignableTracker.h:17
HIPAlignmentAlgorithm::m2_ObjId
align::StructureType m2_ObjId
Definition: HIPAlignmentAlgorithm.h:158
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HIPAlignmentAlgorithm::rewgtPerAli
bool rewgtPerAli
Definition: HIPAlignmentAlgorithm.h:134
HIPAlignmentAlgorithm::theAlignables
align::Alignables theAlignables
Definition: HIPAlignmentAlgorithm.h:93
AlignableExtras
Definition: AlignableExtras.h:19
HIPAlignmentAlgorithm::collector
void collector(void)
Definition: HIPAlignmentAlgorithm.cc:1321
HIPAlignmentAlgorithm::ioerr
int ioerr
Definition: HIPAlignmentAlgorithm.h:97
AlignableNavigator.h
SiPixelRecHit.h
HIPAlignmentAlgorithm::isCollector
bool isCollector
Definition: HIPAlignmentAlgorithm.h:130
HIPAlignmentAlgorithm::startNewLoop
void startNewLoop(void) override
Called at start of new loop.
Definition: HIPAlignmentAlgorithm.cc:298
align::StructureType
StructureType
Definition: StructureType.h:16
SurfaceDeformation.h
HIPAlignmentAlgorithm::surveyResiduals_
const std::vector< std::string > surveyResiduals_
Definition: HIPAlignmentAlgorithm.h:141
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
HIPAlignmentAlgorithm::topoToken_
const edm::ESGetToken< TrackerTopology, IdealGeometryRecord > topoToken_
Definition: HIPAlignmentAlgorithm.h:88
AlignmentAlgorithmBase::terminate
virtual void terminate()
Called at end of job (must be implemented in derived class)
Definition: AlignmentAlgorithmBase.h:158
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:513
HIPAlignmentAlgorithm::m2_surfDef
std::vector< float > m2_surfDef
Definition: HIPAlignmentAlgorithm.h:164
HIPAlignmentAlgorithm::theAlignableDetAccessor
std::unique_ptr< AlignableNavigator > theAlignableDetAccessor
Definition: HIPAlignmentAlgorithm.h:94
SurfaceDeformationFactory::Type
Type
Definition: SurfaceDeformationFactory.h:17
HIPAlignmentAlgorithm::theIteration
int theIteration
Definition: HIPAlignmentAlgorithm.h:98
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
HIPAlignmentAlgorithm::m2_Ypos
float m2_Ypos
Definition: HIPAlignmentAlgorithm.h:161
HIPAlignmentAlgorithm::theIO
AlignmentIORoot theIO
Definition: HIPAlignmentAlgorithm.h:96
HIPAlignmentAlgorithm::~HIPAlignmentAlgorithm
~HIPAlignmentAlgorithm() override
Destructor.
Definition: HIPAlignmentAlgorithm.h:42
AlignmentClusterFlag.h
HIPAlignmentAlgorithm::topoToken2_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken2_
Definition: HIPAlignmentAlgorithm.h:89
HIPAlignmentAlgorithm::trackPs
bool trackPs
Definition: HIPAlignmentAlgorithm.h:134
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:58
HIPAlignmentAlgorithm::theIOVrangeSet
std::vector< unsigned > theIOVrangeSet
Definition: HIPAlignmentAlgorithm.h:112
HIPAlignmentAlgorithm::themultiIOV
bool themultiIOV
Definition: HIPAlignmentAlgorithm.h:111
HIPAlignmentAlgorithm::calcParameters
bool calcParameters(Alignable *ali, int setDet, double start, double step)
Definition: HIPAlignmentAlgorithm.cc:1224
edm::ESGetToken< TrackerTopology, IdealGeometryRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HIPAlignmentAlgorithm::theHitMonitorTree
TTree * theHitMonitorTree
Definition: HIPAlignmentAlgorithm.h:147
looper.cfg
cfg
Definition: looper.py:296
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripRecHit1D.h
HIPAlignmentAlgorithm::verbose
const bool verbose
Definition: HIPAlignmentAlgorithm.h:103
HIPAlignmentAlgorithm::struefile
std::string struefile
Definition: HIPAlignmentAlgorithm.h:109
SurfaceDeformationFactory.h
AlignableObjectId.h
dumpTauVariables_cfi.eventInfo
eventInfo
add run, event number and lumi section
Definition: dumpTauVariables_cfi.py:12
HIPAlignmentAlgorithm::defaultAlignableSpecs
HIPAlignableSpecificParameters defaultAlignableSpecs
Definition: HIPAlignmentAlgorithm.h:123
HIPAlignmentAlgorithm::doTrackHitMonitoring
const bool doTrackHitMonitoring
Definition: HIPAlignmentAlgorithm.h:106
HIPAlignmentAlgorithm::theDataGroup
int theDataGroup
Definition: HIPAlignmentAlgorithm.h:133
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
HIPAlignmentAlgorithm::col_cut
double col_cut
Definition: HIPAlignmentAlgorithm.h:136
HIPAlignmentAlgorithm::theCollectorPath
std::string theCollectorPath
Definition: HIPAlignmentAlgorithm.h:132
HIPAlignmentAlgorithm::siterationfile
std::string siterationfile
Definition: HIPAlignmentAlgorithm.h:109
AlignmentParameterStore
Definition: AlignmentParameterStore.h:23
HIPAlignmentAlgorithm::theAlignmentParameterStore
AlignmentParameterStore * theAlignmentParameterStore
Definition: HIPAlignmentAlgorithm.h:92
HIPAlignableSpecificParameters
Definition: HIPAlignableSpecificParameters.h:7
ClassName.h
Alignable.h
HIPAlignmentAlgorithm::trackWt
bool trackWt
Definition: HIPAlignmentAlgorithm.h:134
HIPAlignmentAlgorithm::m3_par
float m3_par[6]
Definition: HIPAlignmentAlgorithm.h:169
HIPAlignmentAlgorithm::m2_Zpos
float m2_Zpos
Definition: HIPAlignmentAlgorithm.h:161
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:109
AliClusterValueMap.h
HIPAlignmentAlgorithm::theSurveyTree
TTree * theSurveyTree
Definition: HIPAlignmentAlgorithm.h:151
AlignmentIORoot
Definition: AlignmentIORoot.h:15
HIPAlignmentAlgorithm::suvarfilecore
std::string suvarfilecore
Definition: HIPAlignmentAlgorithm.h:108
ConsumesCollector.h
HIPAlignmentAlgorithm::cos_cut
double cos_cut
Definition: HIPAlignmentAlgorithm.h:136
ParameterSet.h
HIPAlignmentAlgorithm::m3_Id
align::ID m3_Id
Definition: HIPAlignmentAlgorithm.h:167
HIPAlignmentAlgorithm::setAlignmentPositionError
void setAlignmentPositionError(void)
Definition: HIPAlignmentAlgorithm.cc:1019
HIPAlignmentAlgorithm::theSurveyIORootFile
TFile * theSurveyIORootFile
Definition: HIPAlignmentAlgorithm.h:150
HIPAlignmentAlgorithm::run
void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm.
Definition: HIPAlignmentAlgorithm.cc:731
SiStripRecHit2D.h
HIPAlignmentAlgorithm::collectMonitorTrees
void collectMonitorTrees(const std::vector< std::string > &filenames)
Definition: HIPAlignmentAlgorithm.cc:1476
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88
HIPAlignmentAlgorithm::m2_Nhit
int m2_Nhit
Definition: HIPAlignmentAlgorithm.h:159
AlignmentAlgorithmBase::EventInfo
define event information passed to algorithms
Definition: AlignmentAlgorithmBase.h:73
HIPAlignmentAlgorithm::theAPEParameterSet
std::vector< edm::ParameterSet > theAPEParameterSet
Definition: HIPAlignmentAlgorithm.h:116
HIPMonitorConfig.h
HIPAlignmentAlgorithm::m3_ObjId
align::StructureType m3_ObjId
Definition: HIPAlignmentAlgorithm.h:168
HIPAlignmentAlgorithm::Scale
double Scale
Definition: HIPAlignmentAlgorithm.h:136
HIPAlignmentAlgorithm
Definition: HIPAlignmentAlgorithm.h:36