AlignableData

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
#ifndef Alignment_CommonAlignmentAlgorithm_AlignableData_h
#define Alignment_CommonAlignmentAlgorithm_AlignableData_h

#include "Alignment/CommonAlignment/interface/StructureType.h"
#include "CondFormats/Alignment/interface/Definitions.h"
#include <vector>

///  Helper class to store position data of an alignable;
///  Contents: position vector, rotation matrix, DetId and TypeId;
///            also surface deformation parameters are foreseen;
///  can be used for both absolute and relative positions/rotations

template <class T>
class AlignableData {
public:
  /// constructor
  /// deformationParameters can be given if detUnit
  AlignableData(const T& pos,
                const align::RotationType& rot,
                align::ID id,
                align::StructureType objid,
                const std::vector<double>& deformationParameters = std::vector<double>())
      : thePos(pos), theRot(rot), theObjId(objid), theId(id), theDeformationParameters(deformationParameters) {}

  /// accessors
  const T& pos() const { return thePos; }
  const align::RotationType& rot() const { return theRot; }
  align::StructureType objId() const { return theObjId; }
  align::ID id() const { return theId; }
  const std::vector<double> deformationParameters() const { return theDeformationParameters; }

private:
  // data members

  T thePos;
  align::RotationType theRot;
  align::StructureType theObjId;
  align::ID theId;
  std::vector<double> theDeformationParameters;
};

/// Absolute position/rotation
typedef AlignableData<align::GlobalPoint> AlignableAbsData;
/// relative position/rotation
typedef AlignableData<align::GlobalVector> AlignableRelData;

typedef std::vector<AlignableAbsData> AlignablePositions;
typedef std::vector<AlignableRelData> AlignableShifts;

#endif