ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/Alignment/CommonAlignmentAlgorithm/interface/IntegratedCalibrationBase.h
Revision: 1.2
Committed: Tue Aug 28 19:19:38 2012 UTC (12 years, 8 months ago) by flucke
Content type: text/plain
Branch: MAIN
CVS Tags: CMSSW_6_2_0_pre7_TS133806, CMSSW_6_1_2_SLHC6_patch1, CMSSW_6_1_2_SLHC6, CMSSW_6_1_2_SLHC5, CMSSW_6_2_0_pre7_TS132947, CMSSW_6_2_0_pre7_g496p02, CMSSW_6_2_0_pre7, CMSSW_6_1_2_SLHC4_patch1, CMSSW_6_1_2_SLHC4, CMSSW_6_1_2_SLHC2_patch3, CMSSW_6_2_0_pre6_patch1, CMSSW_6_1_2_SLHC2_patch2, CMSSW_6_2_0_pre6, CMSSW_6_1_2_SLHC3, CMSSW_6_1_2_SLHC2_patch1, CMSSW_6_1_2_SLHC2, CMSSW_6_2_0_pre5slc6, br53-00-04, br53-00-03, br53-00-02, CMSSW_6_1_2_SLHC1, CMSSW_6_2_0_pre5, CMSSW_6_1_X_2012-12-19-0200, CMSSW_6_1_2, CMSSW_6_2_0_pre4, CMSSW_6_2_0_pre3, CMSSW_6_1_1_SLHCphase2tk1, CMSSW_6_1_1_SLHCphase1tk1, br53-00-01, CMSSW_6_2_0_pre2, CMSSW_6_1_1, CMSSW_6_2_0_pre1, V04-00-11, CMSSW_6_1_0, CMSSW_6_1_0_pre8, V04-00-10, CMSSW_6_1_0_pre7_TS127013, CMSSW_6_1_0_pre7, V04-00-09, V04-00-08, V04-00-07, V04-00-06, V04-00-05, V04-00-04, V04-00-03, V04-00-02, V04-00-01
Branch point for: branch53X_calibration
Changes since 1.1: +5 -4 lines
Log Message:
correct docu

File Contents

# User Rev Content
1 flucke 1.1 #ifndef Alignment_CommonAlignmentAlgorithm_IntegratedCalibrationBase_h
2     #define Alignment_CommonAlignmentAlgorithm_IntegratedCalibrationBase_h
3    
4     /**
5     * \file IntegratedCalibrationBase.cc
6     *
7     * \author Gero Flucke
8     * \date August 2012
9 flucke 1.2 * $Revision: 1.1 $
10     * $Date: 2012/08/10 09:07:20 $
11     * (last update by $Author: flucke $)
12 flucke 1.1 *
13     * Base class for the calibrations that are integrated
14     * into the alignment algorithms.
15     * Note that not all algorithms support this...
16     * Limitations:
17     * o Hits are assumed to be (up to) 2D.
18 flucke 1.2 * o Derivatives depend only on local things (hit and track TSOS),
19     * EventSetup and AlignmentAlgorithmBase::EventInfo.
20 flucke 1.1 */
21    
22    
23     #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
24    
25     #include <vector>
26     #include <utility>
27     #include <string>
28    
29     class AlignableTracker;
30     class AlignableMuon;
31     class AlignableExtras;
32    
33     class TrajectoryStateOnSurface;
34     class TransientTrackingRecHit;
35    
36     namespace edm { class EventSetup; class ParameterSet; }
37    
38     class IntegratedCalibrationBase
39     {
40     public:
41    
42     typedef AlignmentAlgorithmBase::EventInfo EventInfo;
43     typedef std::pair<double,double> Values; /// x- and y-values
44     typedef std::pair<Values, unsigned int> ValuesIndexPair; /// Values and their parameter index
45    
46     /// Constructor
47     explicit IntegratedCalibrationBase(const edm::ParameterSet &cfg);
48    
49     /// Destructor
50     virtual ~IntegratedCalibrationBase() {};
51    
52     /// How many parameters does this calibration define?
53     virtual unsigned int numParameters() const = 0;
54    
55     /// Return all derivatives for x- (Values.first) and y-measurement (Values.second),
56     /// default implementation uses other derivatives(..) method,
57     /// but can be overwritten in derived class for efficiency.
58     virtual std::vector<Values> derivatives(const TransientTrackingRecHit &hit,
59     const TrajectoryStateOnSurface &tsos,
60     const edm::EventSetup &setup,
61     const EventInfo &eventInfo) const;
62    
63     /// Return non-zero derivatives for x- (ValuesIndexPair.first.first)
64     /// and y-measurement (ValuesIndexPair.first.second) with their
65     /// indices (ValuesIndexPair.second) by reference.
66     /// Return value is their number.
67     virtual unsigned int derivatives(std::vector<ValuesIndexPair> &outDerivInds,
68     const TransientTrackingRecHit &hit,
69     const TrajectoryStateOnSurface &tsos,
70     const edm::EventSetup &setup,
71     const EventInfo &eventInfo) const = 0;
72    
73     /// Setting the determined parameter identified by index,
74     /// should return false if out-of-bounds, true otherwise.
75     virtual bool setParameter(unsigned int index, double value) = 0;
76    
77     /// Setting the determined parameter uncertainty identified by index,
78     /// should return false if out-of-bounds or errors not treated, true otherwise.
79     virtual bool setParameterError(unsigned int index, double value) = 0;
80    
81     /// Return current value of parameter identified by index.
82     /// Should return 0. if index out-of-bounds.
83     virtual double getParameter(unsigned int index) const = 0;
84    
85     /// Return current value of parameter identified by index.
86     /// Should return 0. if index out-of-bounds or if errors not treated/undetermined.
87     virtual double getParameterError(unsigned int index) const = 0;
88    
89     /// Call at beginning of job:
90     /// default implementation is dummy, to be overwritten in derived class if useful.
91     virtual void beginOfJob(const AlignableTracker *tracker,
92     const AlignableMuon *muon,
93     const AlignableExtras *extras) {};
94    
95     /// Called at beginning of a loop of the AlignmentProducer,
96     /// to be used for iterative algorithms, default does nothing.
97     /// FIXME: move call to algorithm?
98     virtual void startNewLoop() {};
99    
100     /// Called at end of a loop of the AlignmentProducer,
101     /// to be used for iterative algorithms, default does nothing.
102     /// FIXME: move call to algorithm?
103     virtual void endOfLoop() {};
104    
105     /// Called at end of a the job of the AlignmentProducer.
106     /// Do here the necessary stuff with the results that should have been passed
107     /// by the algorithm to the calibration, e.g. write out to database.
108     /// FIXME: How to deal with single jobs for an iterative algorithm?
109     virtual void endOfJob() = 0;
110    
111     /* /// called at begin of run */
112     /* virtual void beginRun(const edm::EventSetup &setup) {}; */
113    
114     /* /// called at end of run - order of arguments like in EDProducer etc. */
115     /* virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {}; */
116    
117     /* /// called at begin of luminosity block (no lumi block info passed yet) */
118     /* virtual void beginLuminosityBlock(const edm::EventSetup &setup) {}; */
119    
120     /* /// called at end of luminosity block (no lumi block info passed yet) */
121     /* virtual void endLuminosityBlock(const edm::EventSetup &setup) {}; */
122    
123     /// name of this calibration
124     const std::string& name() const { return name_;} // non-virtual since refering to private member
125    
126     private:
127     const std::string name_; /// name of this calibration (i.e. defining plugin)
128     };
129    
130     #endif