CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TrackingTools/TrackAssociator/plugins/MuonDetIdAssociator.h

Go to the documentation of this file.
00001 #ifndef TrackAssociator_MuonDetIdAssociator_h
00002 #define TrackAssociator_MuonDetIdAssociator_h 1
00003 // -*- C++ -*-
00004 //
00005 // Package:    TrackAssociator
00006 // Class:      MuonDetIdAssociator
00007 // 
00008 /*
00009 
00010  Description: <one line class summary>
00011 
00012  Implementation:
00013      <Notes on implementation>
00014 */
00015 //
00016 // Original Author:  Dmytro Kovalskyi
00017 //         Created:  Fri Apr 21 10:59:41 PDT 2006
00018 // $Id: MuonDetIdAssociator.h,v 1.1 2011/04/07 09:12:02 innocent Exp $
00019 //
00020 //
00021 
00022 #include "TrackingTools/TrackAssociator/interface/DetIdAssociator.h"
00023 #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h"
00024 #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixStateInfo.h"
00025 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00026 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00027 #include "DataFormats/DetId/interface/DetId.h"
00028 #include "CondFormats/CSCObjects/interface/CSCBadChambers.h"
00029 
00030 #include "FWCore/Framework/interface/ESHandle.h"
00031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00032 
00033 class MuonDetIdAssociator: public DetIdAssociator{
00034  public:
00035    MuonDetIdAssociator():DetIdAssociator(48, 48 , 0.125),geometry_(0),cscbadchambers_(0),includeBadChambers_(0){};
00036    MuonDetIdAssociator(const int nPhi, const int nEta, const double etaBinSize)
00037      :DetIdAssociator(nPhi, nEta, etaBinSize),geometry_(0),cscbadchambers_(0),includeBadChambers_(0){};
00038 
00039    MuonDetIdAssociator(const edm::ParameterSet& pSet)
00040      :DetIdAssociator(pSet.getParameter<int>("nPhi"),pSet.getParameter<int>("nEta"),pSet.getParameter<double>("etaBinSize")),geometry_(0),cscbadchambers_(0),includeBadChambers_(pSet.getParameter<bool>("includeBadChambers")){};
00041    
00042    virtual void setGeometry(const GlobalTrackingGeometry* ptr){ geometry_ = ptr; }
00043 
00044    virtual void setGeometry(const DetIdAssociatorRecord& iRecord);
00045 
00046    virtual void setCSCBadChambers(const CSCBadChambers* ptr){ cscbadchambers_ = ptr; }
00047 
00048    virtual void setConditions(const DetIdAssociatorRecord& iRecord){
00049       edm::ESHandle<CSCBadChambers> cscbadchambersH;
00050       iRecord.getRecord<CSCBadChambersRcd>().get(cscbadchambersH);
00051       setCSCBadChambers(cscbadchambersH.product());
00052    };
00053 
00054    virtual const GeomDet* getGeomDet( const DetId& id ) const;
00055 
00056    virtual const char* name() const { return "AllMuonDetectors"; }
00057 
00058  protected:
00059    
00060    virtual void check_setup() const;
00061    
00062    virtual GlobalPoint getPosition(const DetId& id) const;
00063    
00064    virtual const std::vector<DetId>& getValidDetIds(unsigned int) const;
00065    
00066    virtual std::pair<const_iterator,const_iterator> getDetIdPoints(const DetId& id) const;
00067 
00068    virtual bool insideElement(const GlobalPoint& point, const DetId& id) const;
00069 
00070    const GlobalTrackingGeometry* geometry_;
00071 
00072    const CSCBadChambers* cscbadchambers_;
00073    bool includeBadChambers_;
00074    mutable std::vector<GlobalPoint> points_;
00075    mutable std::vector<DetId> validIds_;
00076 
00077 };
00078 #endif