Go to the documentation of this file.00001 #ifndef TRACKTORPC_H
00002 #define TRACKTORPC_H
00003
00004
00005 #include "FWCore/Framework/interface/Frameworkfwd.h"
00006 #include "FWCore/Framework/interface/EDAnalyzer.h"
00007
00008 #include "FWCore/Framework/interface/Event.h"
00009 #include "FWCore/Framework/interface/MakerMacros.h"
00010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00011 #include "FWCore/Utilities/interface/InputTag.h"
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 #include "FWCore/ServiceRegistry/interface/Service.h"
00014
00015 #include "DataFormats/TrackReco/interface/Track.h"
00016 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00017 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
00018 #include "DataFormats/MuonReco/interface/MuonTrackLinks.h"
00019 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00020 #include "DataFormats/MuonReco/interface/Muon.h"
00021
00022 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00023 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
00024 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00025 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00026 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
00027 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
00028 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00029 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00030 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00031
00032 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
00033 #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h"
00034 #include "RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h"
00035 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00036
00037 #include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
00038 #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
00039 #include "DataFormats/Common/interface/Ref.h"
00040
00041 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00042 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00043 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00044 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
00045 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00046 #include "Geometry/DTGeometry/interface/DTLayer.h"
00047 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
00048 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
00049 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
00050
00051 #include "TrackingTools/TrackRefitter/interface/TrackTransformerForCosmicMuons.h"
00052 #include "TrackingTools/TrackRefitter/interface/TrackTransformerBase.h"
00053 #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h"
00054
00055
00056
00057 using reco::MuonCollection;
00058 using reco::TrackCollection;
00059 typedef std::vector<Trajectory> Trajectories;
00060
00061 class TracktoRPC {
00062 public:
00063
00064
00065 explicit TracktoRPC(edm::Handle<reco::TrackCollection> alltracks,const edm::EventSetup& iSetup, const edm::Event& iEvent,bool debug, const edm::ParameterSet& iConfig,edm::InputTag& tracklabel);
00066
00067 ~TracktoRPC();
00068 RPCRecHitCollection* thePoints(){return _ThePoints;}
00069 bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup);
00070
00071 private:
00072 RPCRecHitCollection* _ThePoints;
00073 edm::OwnVector<RPCRecHit> RPCPointVector;
00074 double MaxD;
00075
00076 TrackTransformerBase *theTrackTransformer;
00077 edm::ESHandle<Propagator> thePropagator;
00078 };
00079
00080 class DTStationIndex2{
00081 public:
00082 DTStationIndex2():_region(0),_wheel(0),_sector(0),_station(0){}
00083 DTStationIndex2(int region, int wheel, int sector, int station) :
00084 _region(region),
00085 _wheel(wheel),
00086 _sector(sector),
00087 _station(station){}
00088 ~DTStationIndex2(){}
00089 int region() const {return _region;}
00090 int wheel() const {return _wheel;}
00091 int sector() const {return _sector;}
00092 int station() const {return _station;}
00093 bool operator<(const DTStationIndex2& dtind) const{
00094 if(dtind.region()!=this->region())
00095 return dtind.region()<this->region();
00096 else if(dtind.wheel()!=this->wheel())
00097 return dtind.wheel()<this->wheel();
00098 else if(dtind.sector()!=this->sector())
00099 return dtind.sector()<this->sector();
00100 else if(dtind.station()!=this->station())
00101 return dtind.station()<this->station();
00102 return false;
00103 }
00104
00105 private:
00106 int _region;
00107 int _wheel;
00108 int _sector;
00109 int _station;
00110 };
00111
00112 class ObjectMap2{
00113 public:
00114 static ObjectMap2* GetInstance(const edm::EventSetup& iSetup);
00115 std::set<RPCDetId> GetRolls(DTStationIndex2 dtstationindex){return mapInstance->rollstoreDT[dtstationindex];}
00116
00117 std::map<DTStationIndex2,std::set<RPCDetId> > rollstoreDT;
00118 ObjectMap2(const edm::EventSetup& iSetup);
00119 private:
00120 static ObjectMap2* mapInstance;
00121 };
00122 class CSCStationIndex2{
00123 public:
00124 CSCStationIndex2():_region(0),_station(0),_ring(0),_chamber(0){}
00125 CSCStationIndex2(int region, int station, int ring, int chamber):
00126 _region(region),
00127 _station(station),
00128 _ring(ring),
00129 _chamber(chamber){}
00130 ~CSCStationIndex2(){}
00131 int region() const {return _region;}
00132 int station() const {return _station;}
00133 int ring() const {return _ring;}
00134 int chamber() const {return _chamber;}
00135 bool operator<(const CSCStationIndex2& cscind) const{
00136 if(cscind.region()!=this->region())
00137 return cscind.region()<this->region();
00138 else if(cscind.station()!=this->station())
00139 return cscind.station()<this->station();
00140 else if(cscind.ring()!=this->ring())
00141 return cscind.ring()<this->ring();
00142 else if(cscind.chamber()!=this->chamber())
00143 return cscind.chamber()<this->chamber();
00144 return false;
00145 }
00146
00147 private:
00148 int _region;
00149 int _station;
00150 int _ring;
00151 int _chamber;
00152 };
00153
00154 class ObjectMap2CSC{
00155 public:
00156 static ObjectMap2CSC* GetInstance(const edm::EventSetup& iSetup);
00157 std::set<RPCDetId> GetRolls(CSCStationIndex2 cscstationindex){return mapInstance->rollstoreCSC[cscstationindex];}
00158
00159 std::map<CSCStationIndex2,std::set<RPCDetId> > rollstoreCSC;
00160 ObjectMap2CSC(const edm::EventSetup& iSetup);
00161 private:
00162 static ObjectMap2CSC* mapInstance;
00163 };
00164
00165 #endif