Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:32

0001 /****************************************************************************
0002 * Authors: 
0003 *  Jan Kašpar (jan.kaspar@gmail.com) 
0004 ****************************************************************************/
0005 
0006 #ifndef CalibPPS_AlignmentRelative_AlignmentAlgorithm_h
0007 #define CalibPPS_AlignmentRelative_AlignmentAlgorithm_h
0008 
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 
0011 #include "CalibPPS/AlignmentRelative/interface/LocalTrackFit.h"
0012 #include "CalibPPS/AlignmentRelative/interface/AlignmentGeometry.h"
0013 #include "CalibPPS/AlignmentRelative/interface/HitCollection.h"
0014 #include "CalibPPS/AlignmentRelative/interface/AlignmentConstraint.h"
0015 #include "CalibPPS/AlignmentRelative/interface/AlignmentResult.h"
0016 #include "Geometry/VeryForwardGeometryBuilder/interface/CTPPSGeometry.h"
0017 
0018 #include <string>
0019 #include <map>
0020 
0021 class AlignmentTask;
0022 class TDirectory;
0023 
0024 namespace edm {
0025   class ParameterSet;
0026 }
0027 
0028 /**
0029  *\brief Abstract parent for all (track-based) alignment algorithms
0030  **/
0031 class AlignmentAlgorithm {
0032 protected:
0033   unsigned int verbosity;
0034 
0035   /// the tasked to be completed
0036   AlignmentTask *task;
0037 
0038   /// eigenvalues in (-singularLimit, singularLimit) are treated as singular
0039   double singularLimit;
0040 
0041 public:
0042   /// dummy constructor (not to be used)
0043   AlignmentAlgorithm() {}
0044 
0045   /// normal constructor
0046   AlignmentAlgorithm(const edm::ParameterSet &ps, AlignmentTask *_t);
0047 
0048   virtual ~AlignmentAlgorithm() {}
0049 
0050   virtual std::string getName() { return "Base"; }
0051 
0052   /// returns whether this algorithm is capable of estimating result uncertainties
0053   virtual bool hasErrorEstimate() = 0;
0054 
0055   /// prepare for processing
0056   virtual void begin(const CTPPSGeometry *geometryReal, const CTPPSGeometry *geometryMisaligned) = 0;
0057 
0058   /// process one track
0059   virtual void feed(const HitCollection &, const LocalTrackFit &) = 0;
0060 
0061   /// saves diagnostic histograms/plots
0062   virtual void saveDiagnostics(TDirectory *) = 0;
0063 
0064   /// analyzes the data collected
0065   virtual void analyze() = 0;
0066 
0067   /// solves the alignment problem with the given constraints
0068   /// \param dir a directory (in StraightTrackAlignment::taskDataFileName) where
0069   /// intermediate results can be stored
0070   virtual unsigned int solve(const std::vector<AlignmentConstraint> &,
0071                              std::map<unsigned int, AlignmentResult> &results,
0072                              TDirectory *dir = nullptr) = 0;
0073 
0074   /// cleans up after processing
0075   virtual void end() = 0;
0076 };
0077 
0078 #endif