CMS 3D CMS Logo

CSCPairResidualsConstraint.h
Go to the documentation of this file.
1 #ifndef Alignment_MuonAlignmentAlgorithms_CSCPairResidualsConstraint_H
2 #define Alignment_MuonAlignmentAlgorithms_CSCPairResidualsConstraint_H
3 
10 #include <fstream>
11 
12 #include "TH1F.h"
13 
24 
26 
28 public:
29  CSCPairResidualsConstraint(unsigned int identifier, int i, int j, CSCDetId id_i, CSCDetId id_j)
30  : CSCPairConstraint(i, j, 0., 0.),
31  m_identifier(identifier),
32  m_id_i(id_i),
33  m_id_j(id_j),
34  m_sum1(0.),
35  m_sumx(0.),
36  m_sumy(0.),
37  m_sumxx(0.),
38  m_sumyy(0.),
39  m_sumxy(0.),
40  m_sumN(0),
41  m_Zplane(1000.),
42  m_iZ1(1000.),
43  m_iZ6(1000.),
44  m_jZ1(1000.),
45  m_jZ6(1000.),
49 
51 
52  double value() const override;
53  double error() const override;
54  CSCDetId id_i() const { return m_id_i; };
55  CSCDetId id_j() const { return m_id_j; };
56  bool valid() const override;
57  double radius(bool is_i) const {
58  return m_cscGeometry->idToDet((is_i ? m_id_i : m_id_j))->surface().position().perp();
59  };
60 
62  void setZplane(const CSCGeometry *cscGeometry);
63  void setPropagator(const Propagator *propagator);
64  bool addTrack(const std::vector<TrajectoryMeasurement> &measurements,
66  const TrackTransformer *trackTransformer);
67 
68  void write(std::ofstream &output);
69  void read(std::vector<std::ifstream *> &input, std::vector<std::string> &filenames);
70 
71 protected:
72  void calculatePhi(
73  const TransientTrackingRecHit *hit, double &phi, double &phierr2, bool doRphi = false, bool globalPhi = false);
74  bool isFiducial(std::vector<const TransientTrackingRecHit *> &hits, bool is_i);
75  bool dphidzFromTrack(const std::vector<TrajectoryMeasurement> &measurements,
76  const reco::TransientTrack &track,
77  const TrackTransformer *trackTransformer,
78  double &drphidz);
79 
80  unsigned int m_identifier;
83  int m_sumN;
84 
86 
91 
94  TH1F *m_radial;
95 };
96 
97 #endif // Alignment_MuonAlignmentAlgorithms_CSCPairResidualsConstraint_H
void read(std::vector< std::ifstream * > &input, std::vector< std::string > &filenames)
T perp() const
Definition: PV3DBase.h:69
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
#define nullptr
void setZplane(const CSCGeometry *cscGeometry)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
static std::string const input
Definition: EdmProvDump.cc:48
CSCPairResidualsConstraint(unsigned int identifier, int i, int j, CSCDetId id_i, CSCDetId id_j)
virtual int i() const
void configure(CSCOverlapsAlignmentAlgorithm *parent)
void write(std::ofstream &output)
bool isFiducial(std::vector< const TransientTrackingRecHit * > &hits, bool is_i)
void calculatePhi(const TransientTrackingRecHit *hit, double &phi, double &phierr2, bool doRphi=false, bool globalPhi=false)
virtual int j() const
bool addTrack(const std::vector< TrajectoryMeasurement > &measurements, const reco::TransientTrack &track, const TrackTransformer *trackTransformer)
CSCOverlapsAlignmentAlgorithm * m_parent
bool dphidzFromTrack(const std::vector< TrajectoryMeasurement > &measurements, const reco::TransientTrack &track, const TrackTransformer *trackTransformer, double &drphidz)
const PositionType & position() const
void setPropagator(const Propagator *propagator)