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), m_id_i(id_i), m_id_j(id_j)
32  , m_sum1(0.), m_sumx(0.), m_sumy(0.), m_sumxx(0.), m_sumyy(0.), m_sumxy(0.), m_sumN(0)
33  , m_Zplane(1000.), m_iZ1(1000.), m_iZ6(1000.), m_jZ1(1000.), m_jZ6(1000.), m_cscGeometry(nullptr), m_propagator(nullptr)
34  {};
36 
37  enum {
42  };
43 
44  double value() const override;
45  double error() const override;
46  CSCDetId id_i() const { return m_id_i; };
47  CSCDetId id_j() const { return m_id_j; };
48  bool valid() const override;
49  double radius(bool is_i) const { return m_cscGeometry->idToDet((is_i ? m_id_i : m_id_j))->surface().position().perp(); };
50 
52  void setZplane(const CSCGeometry *cscGeometry);
53  void setPropagator(const Propagator *propagator);
54  bool addTrack(const std::vector<TrajectoryMeasurement> &measurements, const reco::TransientTrack &track, const TrackTransformer *trackTransformer);
55 
56  void write(std::ofstream &output);
57  void read(std::vector<std::ifstream*> &input, std::vector<std::string> &filenames);
58 
59 protected:
60  void calculatePhi(const TransientTrackingRecHit *hit, double &phi, double &phierr2, bool doRphi=false, bool globalPhi=false);
61  bool isFiducial(std::vector<const TransientTrackingRecHit*> &hits, bool is_i);
62  bool dphidzFromTrack(const std::vector<TrajectoryMeasurement> &measurements, const reco::TransientTrack &track, const TrackTransformer *trackTransformer, double &drphidz);
63 
64  unsigned int m_identifier;
67  int m_sumN;
68 
70 
75 
78  TH1F *m_radial;
79 };
80 
81 #endif // Alignment_MuonAlignmentAlgorithms_CSCPairResidualsConstraint_H
void read(std::vector< std::ifstream * > &input, std::vector< std::string > &filenames)
T perp() const
Definition: PV3DBase.h:72
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:99
void setZplane(const CSCGeometry *cscGeometry)
#define nullptr
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
static std::string const input
Definition: EdmProvDump.cc:44
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)