Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-23 03:26:49

0001 // -*- C++ -*-
0002 //
0003 // Package:    MuonAlignmentAlgorithms
0004 // Class:      CSCOverlapsAlignmentAlgorithm
0005 //
0006 /**\class CSCOverlapsAlignmentAlgorithm CSCOverlapsAlignmentAlgorithm.cc Alignment/CSCOverlapsAlignmentAlgorithm/interface/CSCOverlapsAlignmentAlgorithm.h
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Jim Pivarski,,,
0015 //         Created:  Tue Oct  7 14:56:49 CDT 2008
0016 // $Id: CSCOverlapsAlignmentAlgorithm.h,v 1.6 2010/09/10 11:56:11 mussgill Exp $
0017 //
0018 //
0019 
0020 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
0021 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterSelector.h"
0022 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h"
0023 #include "Alignment/CommonAlignment/interface/Alignable.h"
0024 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
0025 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
0026 #include "Alignment/CommonAlignment/interface/AlignmentParameters.h"
0027 #include "Alignment/MuonAlignment/interface/AlignableMuon.h"
0028 #include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
0029 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0030 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0031 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0032 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
0033 #include "DataFormats/TrackReco/interface/Track.h"
0034 #include "FWCore/Framework/interface/ESHandle.h"
0035 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0036 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0037 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0038 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0039 #include "FWCore/ServiceRegistry/interface/Service.h"
0040 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0041 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0042 #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h"
0043 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0044 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0045 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0046 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0047 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0048 
0049 #include "Alignment/MuonAlignmentAlgorithms/interface/CSCPairConstraint.h"
0050 #include "Alignment/MuonAlignmentAlgorithms/plugins/CSCChamberFitter.h"
0051 #include "Alignment/MuonAlignmentAlgorithms/plugins/CSCAlignmentCorrections.h"
0052 
0053 #include "TH1F.h"
0054 #include "TH2F.h"
0055 #include "TProfile.h"
0056 #include "TStyle.h"
0057 
0058 #include <sstream>
0059 #include <map>
0060 
0061 class CSCOverlapsAlignmentAlgorithm : public AlignmentAlgorithmBase {
0062 public:
0063   CSCOverlapsAlignmentAlgorithm(const edm::ParameterSet &iConfig, edm::ConsumesCollector &);
0064   ~CSCOverlapsAlignmentAlgorithm() override;
0065 
0066   void initialize(const edm::EventSetup &iSetup,
0067                   AlignableTracker *alignableTracker,
0068                   AlignableMuon *alignableMuon,
0069                   AlignableExtras *alignableExtras,
0070                   AlignmentParameterStore *alignmentParameterStore) override;
0071   void run(const edm::EventSetup &iSetup, const EventInfo &eventInfo) override;
0072 
0073   void terminate(const edm::EventSetup &iSetup) override;
0074 
0075   // having to make read-only accessors for all of these would be ridiculous, so they're public
0076   TH1F *m_hitsPerChamber;
0077 
0078   TProfile *m_fiducial_ME11;
0079   TProfile *m_fiducial_ME12;
0080   TProfile *m_fiducial_MEx1;
0081   TProfile *m_fiducial_MEx2;
0082 
0083   TH1F *m_slope;
0084   TH1F *m_slope_MEp4;
0085   TH1F *m_slope_MEp3;
0086   TH1F *m_slope_MEp2;
0087   TH1F *m_slope_MEp1;
0088   TH1F *m_slope_MEm1;
0089   TH1F *m_slope_MEm2;
0090   TH1F *m_slope_MEm3;
0091   TH1F *m_slope_MEm4;
0092 
0093   TH1F *m_slopeResiduals;
0094   TH1F *m_slopeResiduals_weighted;
0095   TH1F *m_slopeResiduals_normalized;
0096   TH1F *m_offsetResiduals;
0097   TH1F *m_offsetResiduals_weighted;
0098   TH1F *m_offsetResiduals_normalized;
0099 
0100   TH1F *m_drdz;
0101 
0102   TH2F *m_occupancy;
0103   TH2F *m_XYpos_mep1;
0104   TH2F *m_XYpos_mep2;
0105   TH2F *m_XYpos_mep3;
0106   TH2F *m_XYpos_mep4;
0107   TH2F *m_XYpos_mem1;
0108   TH2F *m_XYpos_mem2;
0109   TH2F *m_XYpos_mem3;
0110   TH2F *m_XYpos_mem4;
0111   TH2F *m_RPhipos_mep1;
0112   TH2F *m_RPhipos_mep2;
0113   TH2F *m_RPhipos_mep3;
0114   TH2F *m_RPhipos_mep4;
0115   TH2F *m_RPhipos_mem1;
0116   TH2F *m_RPhipos_mem2;
0117   TH2F *m_RPhipos_mem3;
0118   TH2F *m_RPhipos_mem4;
0119 
0120   int m_mode;
0121   int m_minHitsPerChamber;
0122   double m_maxdrdz;
0123   bool m_fiducial;
0124   bool m_useHitWeights;
0125   bool m_slopeFromTrackRefit;
0126   int m_minStationsInTrackRefits;
0127   double m_truncateSlopeResid;
0128   double m_truncateOffsetResid;
0129   bool m_combineME11;
0130   bool m_useTrackWeights;
0131   bool m_errorFromRMS;
0132   int m_minTracksPerOverlap;
0133   bool m_makeHistograms;
0134 
0135 private:
0136   const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> m_cscGeometryToken;
0137   const edm::ESGetToken<Propagator, TrackingComponentsRecord> m_propToken;
0138   const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> m_tthbToken;
0139 
0140   std::string m_mode_string;
0141   std::string m_reportFileName;
0142   double m_minP;
0143   double m_maxRedChi2;
0144   std::string m_writeTemporaryFile;
0145   std::vector<std::string> m_readTemporaryFiles;
0146   bool m_doAlignment;
0147 
0148   AlignmentParameterStore *m_alignmentParameterStore;
0149   align::Alignables m_alignables;
0150   AlignableNavigator *m_alignableNavigator;
0151   std::vector<CSCChamberFitter> m_fitters;
0152   std::vector<CSCPairResidualsConstraint *> m_residualsConstraints;
0153   std::map<std::pair<CSCDetId, CSCDetId>, CSCPairResidualsConstraint *> m_quickChamberLookup;
0154 
0155   TrackTransformer *m_trackTransformer;
0156   const Propagator *m_propagatorPointer;
0157 
0158   TH1F *m_histP10;
0159   TH1F *m_histP100;
0160   TH1F *m_histP1000;
0161 };