Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:52

0001 // -*- C++ -*-
0002 //
0003 // Package:    Validation/MuonIdentification
0004 // Class:      MuonIdVal
0005 //
0006 /*
0007 
0008  Description:  Makes and fills lots of histograms using the various reco::Muon
0009                methods.
0010 
0011 
0012 */
0013 //
0014 // Original Author:  Jacob Ribnik
0015 //         Created:  Wed Apr 18 13:48:08 CDT 2007
0016 //
0017 //
0018 
0019 #ifndef Validation_MuonIdentification_MuonIdVal_h
0020 #define Validation_MuonIdentification_MuonIdVal_h
0021 
0022 // system include files
0023 #include <string>
0024 
0025 // user include files
0026 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0027 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0028 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0029 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0030 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
0031 #include "DataFormats/MuonReco/interface/Muon.h"
0032 #include "DataFormats/MuonReco/interface/MuonCosmicCompatibility.h"
0033 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0034 #include "DataFormats/MuonReco/interface/MuonQuality.h"
0035 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0036 #include "DataFormats/MuonReco/interface/MuonShower.h"
0037 #include "DataFormats/MuonReco/interface/MuonTime.h"
0038 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
0039 #include "DataFormats/MuonReco/interface/MuonTimeExtraMap.h"
0040 
0041 #include "FWCore/Framework/interface/ESHandle.h"
0042 #include "FWCore/Framework/interface/Event.h"
0043 #include "FWCore/Framework/interface/Frameworkfwd.h"
0044 #include "FWCore/Framework/interface/MakerMacros.h"
0045 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0046 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0047 #include "FWCore/ServiceRegistry/interface/Service.h"
0048 
0049 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0050 #include "DQMServices/Core/interface/DQMStore.h"
0051 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0052 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0053 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0054 
0055 // class MuonIdVal : public edm::EDAnalyzer {
0056 class MuonIdVal : public DQMEDAnalyzer {
0057 public:
0058   explicit MuonIdVal(const edm::ParameterSet &);
0059   ~MuonIdVal() override;
0060 
0061 private:
0062   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0063   void analyze(const edm::Event &, const edm::EventSetup &) override;
0064   virtual void Fill(MonitorElement *, float);
0065 
0066   edm::ParameterSet iConfig;
0067   edm::ParameterSet parameters_;
0068   std::string eventInfoFolder_;
0069   std::string subsystemname_;
0070 
0071   // ----------member data ---------------------------
0072   edm::InputTag inputMuonCollection_;
0073   edm::InputTag inputDTRecSegment4DCollection_;
0074   edm::InputTag inputCSCSegmentCollection_;
0075   edm::InputTag inputMuonTimeExtraValueMap_;
0076   edm::InputTag inputMuonCosmicCompatibilityValueMap_;
0077   edm::InputTag inputMuonShowerInformationValueMap_;
0078   edm::EDGetTokenT<reco::MuonCollection> inputMuonCollectionToken_;
0079   edm::EDGetTokenT<DTRecSegment4DCollection> inputDTRecSegment4DCollectionToken_;
0080   edm::EDGetTokenT<CSCSegmentCollection> inputCSCSegmentCollectionToken_;
0081   edm::EDGetTokenT<reco::MuonTimeExtraMap> inputMuonTimeExtraValueMapCombToken_;
0082   edm::EDGetTokenT<reco::MuonTimeExtraMap> inputMuonTimeExtraValueMapDTToken_;
0083   edm::EDGetTokenT<reco::MuonTimeExtraMap> inputMuonTimeExtraValueMapCSCToken_;
0084   edm::EDGetTokenT<edm::ValueMap<reco::MuonCosmicCompatibility>> inputMuonCosmicCompatibilityValueMapToken_;
0085   edm::EDGetTokenT<edm::ValueMap<reco::MuonShower>> inputMuonShowerInformationValueMapToken_;
0086   bool useTrackerMuons_;
0087   bool useGlobalMuons_;
0088   bool useTrackerMuonsNotGlobalMuons_;
0089   bool useGlobalMuonsNotTrackerMuons_;
0090   bool makeEnergyPlots_;
0091   bool makeTimePlots_;
0092   bool make2DPlots_;
0093   bool makeAllChamberPlots_;
0094   bool makeCosmicCompatibilityPlots_;
0095   bool makeShowerInformationPlots_;
0096   std::string baseFolder_;
0097 
0098   edm::Handle<reco::MuonCollection> muonCollectionH_;
0099   edm::Handle<DTRecSegment4DCollection> dtSegmentCollectionH_;
0100   edm::Handle<CSCSegmentCollection> cscSegmentCollectionH_;
0101   edm::Handle<reco::MuonTimeExtraMap> combinedMuonTimeExtraValueMapH_;
0102   edm::Handle<reco::MuonTimeExtraMap> cscMuonTimeExtraValueMapH_;
0103   edm::Handle<reco::MuonTimeExtraMap> dtMuonTimeExtraValueMapH_;
0104   edm::Handle<edm::ValueMap<reco::MuonCosmicCompatibility>> muonCosmicCompatibilityValueMapH_;
0105   edm::Handle<edm::ValueMap<reco::MuonShower>> muonShowerInformationValueMapH_;
0106 
0107   edm::ESHandle<GlobalTrackingGeometry> geometry_;
0108   const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> trackingGeomToken_;
0109 
0110   // trackerMuon == 0; globalMuon == 1
0111   // energy deposits
0112   MonitorElement *hEnergyEMBarrel[4];
0113   MonitorElement *hEnergyHABarrel[4];
0114   MonitorElement *hEnergyHO[4];
0115   MonitorElement *hEnergyEMEndcap[4];
0116   MonitorElement *hEnergyHAEndcap[4];
0117 
0118   // time information
0119   MonitorElement *hMuonTimeNDOF[4];
0120   MonitorElement *hMuonTimeTimeAtIpInOut[4];
0121   MonitorElement *hMuonTimeTimeAtIpInOutErr[4];
0122   MonitorElement *hMuonTimeTimeAtIpOutIn[4];
0123   MonitorElement *hMuonTimeTimeAtIpOutInErr[4];
0124   MonitorElement *hMuonTimeExtraCombinedNDOF[4];
0125   MonitorElement *hMuonTimeExtraCombinedTimeAtIpInOut[4];
0126   MonitorElement *hMuonTimeExtraCombinedTimeAtIpInOutErr[4];
0127   MonitorElement *hMuonTimeExtraCombinedTimeAtIpOutIn[4];
0128   MonitorElement *hMuonTimeExtraCombinedTimeAtIpOutInErr[4];
0129   MonitorElement *hMuonTimeExtraCSCNDOF[4];
0130   MonitorElement *hMuonTimeExtraCSCTimeAtIpInOut[4];
0131   MonitorElement *hMuonTimeExtraCSCTimeAtIpInOutErr[4];
0132   MonitorElement *hMuonTimeExtraCSCTimeAtIpOutIn[4];
0133   MonitorElement *hMuonTimeExtraCSCTimeAtIpOutInErr[4];
0134   MonitorElement *hMuonTimeExtraDTNDOF[4];
0135   MonitorElement *hMuonTimeExtraDTTimeAtIpInOut[4];
0136   MonitorElement *hMuonTimeExtraDTTimeAtIpInOutErr[4];
0137   MonitorElement *hMuonTimeExtraDTTimeAtIpOutIn[4];
0138   MonitorElement *hMuonTimeExtraDTTimeAtIpOutInErr[4];
0139 
0140   // muonid
0141   MonitorElement *hCaloCompat[4];
0142   MonitorElement *hSegmentCompat[4];
0143   MonitorElement *hCaloSegmentCompat[4];
0144   MonitorElement *hMuonQualityTrkRelChi2[4];
0145   MonitorElement *hMuonQualityStaRelChi2[4];
0146   MonitorElement *hMuonQualityTrkKink[4];
0147   MonitorElement *hGlobalMuonPromptTightBool[4];
0148   MonitorElement *hTMLastStationLooseBool[4];
0149   MonitorElement *hTMLastStationTightBool[4];
0150   MonitorElement *hTM2DCompatibilityLooseBool[4];
0151   MonitorElement *hTM2DCompatibilityTightBool[4];
0152   MonitorElement *hTMOneStationLooseBool[4];
0153   MonitorElement *hTMOneStationTightBool[4];
0154   MonitorElement *hTMLastStationOptimizedLowPtLooseBool[4];
0155   MonitorElement *hTMLastStationOptimizedLowPtTightBool[4];
0156   MonitorElement *hGMTkChiCompatibilityBool[4];
0157   MonitorElement *hGMStaChiCompatibilityBool[4];
0158   MonitorElement *hGMTkKinkTightBool[4];
0159   MonitorElement *hTMLastStationAngLooseBool[4];
0160   MonitorElement *hTMLastStationAngTightBool[4];
0161   MonitorElement *hTMOneStationAngLooseBool[4];
0162   MonitorElement *hTMOneStationAngTightBool[4];
0163   MonitorElement *hTMLastStationOptimizedBarrelLowPtLooseBool[4];
0164   MonitorElement *hTMLastStationOptimizedBarrelLowPtTightBool[4];
0165 
0166   // cosmic compatibilities
0167   MonitorElement *hCombinedCosmicCompat[4];
0168   MonitorElement *hTimeCosmicCompat[4];
0169   MonitorElement *hB2BCosmicCompat[4];
0170   MonitorElement *hOverlapCosmicCompat[4];
0171 
0172   // by station
0173 
0174   // shower information
0175   MonitorElement *hMuonShowerSizeT[4][4];
0176   MonitorElement *hMuonShowerDeltaR[4][4];
0177   MonitorElement *hMuonAllHits[4][4];
0178   MonitorElement *hMuonHitsFromSegments[4][4];
0179   MonitorElement *hMuonUncorrelatedHits[4][4];
0180 
0181   MonitorElement *hDTPullxPropErr[4][4];
0182   MonitorElement *hDTPulldXdZPropErr[4][4];
0183   MonitorElement *hDTPullyPropErr[4][3];
0184   MonitorElement *hDTPulldYdZPropErr[4][3];
0185   MonitorElement *hDTDistWithSegment[4][4];
0186   MonitorElement *hDTDistWithNoSegment[4][4];
0187   MonitorElement *hDTPullDistWithSegment[4][4];
0188   MonitorElement *hDTPullDistWithNoSegment[4][4];
0189   MonitorElement *hCSCPullxPropErr[4][4];
0190   MonitorElement *hCSCPulldXdZPropErr[4][4];
0191   MonitorElement *hCSCPullyPropErr[4][4];
0192   MonitorElement *hCSCPulldYdZPropErr[4][4];
0193   MonitorElement *hCSCDistWithSegment[4][4];
0194   MonitorElement *hCSCDistWithNoSegment[4][4];
0195   MonitorElement *hCSCPullDistWithSegment[4][4];
0196   MonitorElement *hCSCPullDistWithNoSegment[4][4];
0197 
0198   // by chamber, trackerMuons only
0199   // DT:  [station][wheel][sector]
0200   // CSC: [endcap][station][ring][chamber]
0201   MonitorElement *hDTChamberDx[4][5][14];
0202   MonitorElement *hDTChamberDy[3][5][14];
0203   MonitorElement *hDTChamberEdgeXWithSegment[4][5][14];
0204   MonitorElement *hDTChamberEdgeXWithNoSegment[4][5][14];
0205   MonitorElement *hDTChamberEdgeYWithSegment[4][5][14];
0206   MonitorElement *hDTChamberEdgeYWithNoSegment[4][5][14];
0207   MonitorElement *hCSCChamberDx[2][4][4][36];
0208   MonitorElement *hCSCChamberDy[2][4][4][36];
0209   MonitorElement *hCSCChamberEdgeXWithSegment[2][4][4][36];
0210   MonitorElement *hCSCChamberEdgeXWithNoSegment[2][4][4][36];
0211   MonitorElement *hCSCChamberEdgeYWithSegment[2][4][4][36];
0212   MonitorElement *hCSCChamberEdgeYWithNoSegment[2][4][4][36];
0213 
0214   // segment matching "efficiency"
0215   MonitorElement *hSegmentIsAssociatedRZ;
0216   MonitorElement *hSegmentIsAssociatedXY;
0217   MonitorElement *hSegmentIsNotAssociatedRZ;
0218   MonitorElement *hSegmentIsNotAssociatedXY;
0219   MonitorElement *hSegmentIsBestDrAssociatedRZ;
0220   MonitorElement *hSegmentIsBestDrAssociatedXY;
0221   MonitorElement *hSegmentIsBestDrNotAssociatedRZ;
0222   MonitorElement *hSegmentIsBestDrNotAssociatedXY;
0223 };
0224 
0225 #endif