MuonAlignment

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
#ifndef Alignment_MuonAlignment_MuonAlignment_H
#define Alignment_MuonAlignment_MuonAlignment_H

/** \class MuonAlignment
 *  The MuonAlignment helper class for alignment jobs
 *
 *  $Date: 2011/06/07 19:28:47 $
 *  $Revision: 1.14 $
 *  \author Andre Sznajder - UERJ(Brazil)
 */

#include <map>

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
#include "Alignment/MuonAlignment/interface/MuonAlignmentInputMethod.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

class MuonAlignment {
public:
  MuonAlignment(const DTGeometry* dtGeometry, const CSCGeometry* cscGeometry, const GEMGeometry* gemGeometry);

  MuonAlignment(const edm::EventSetup& iSetup, const MuonAlignmentInputMethod& input);

  ~MuonAlignment() {
    delete theAlignableMuon;
    delete theAlignableNavigator;
  }

  AlignableMuon* getAlignableMuon() { return theAlignableMuon; }

  AlignableNavigator* getAlignableNavigator() { return theAlignableNavigator; }

  void moveAlignableLocalCoord(DetId&, align::Scalars&, align::Scalars&);
  void moveAlignableGlobalCoord(DetId&, align::Scalars&, align::Scalars&);

  void recursiveList(const align::Alignables& alignables, align::Alignables& theList);
  void recursiveMap(const align::Alignables& alignables, std::map<align::ID, Alignable*>& theMap);
  void recursiveStructureMap(const align::Alignables& alignables,
                             std::map<std::pair<align::StructureType, align::ID>, Alignable*>& theMap);

  void copyAlignmentToSurvey(double shiftErr, double angleErr);
  void fillGapsInSurvey(double shiftErr, double angleErr);
  void copySurveyToAlignment();

  void writeXML(const edm::ParameterSet& iConfig,
                const DTGeometry* dtGeometryXML,
                const CSCGeometry* cscGeometryXML,
                const GEMGeometry* gemGeometryXML);

  void saveDTSurveyToDB();
  void saveCSCSurveyToDB();
  void saveSurveyToDB();

  void saveDTtoDB();
  void saveCSCtoDB();
  void saveGEMtoDB();
  void saveToDB();

private:
  void init();
  void recursiveCopySurveyToAlignment(Alignable* alignable);

  std::string theDTAlignRecordName, theDTErrorRecordName;
  std::string theCSCAlignRecordName, theCSCErrorRecordName;
  std::string theGEMAlignRecordName, theGEMErrorRecordName;
  std::string theDTSurveyRecordName, theDTSurveyErrorRecordName;
  std::string theCSCSurveyRecordName, theCSCSurveyErrorRecordName;

  const DTGeometry* dtGeometry_;
  const CSCGeometry* cscGeometry_;
  const GEMGeometry* gemGeometry_;

  align::Scalars displacements;

  align::Scalars rotations;

  AlignableMuon* theAlignableMuon;

  AlignableNavigator* theAlignableNavigator;
};

#endif  //MuonAlignment_H