File indexing completed on 2024-09-07 04:37:41
0001 #ifndef GEMCSCSegment_GEMCSCSegmentBuilder_h
0002 #define GEMCSCSegment_GEMCSCSegmentBuilder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include <FWCore/ParameterSet/interface/ParameterSet.h>
0019
0020 #include <Geometry/CSCGeometry/interface/CSCGeometry.h>
0021 #include <Geometry/GEMGeometry/interface/GEMGeometry.h>
0022
0023 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
0024
0025 #include <Geometry/GEMGeometry/interface/GEMEtaPartition.h>
0026 #include <DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h>
0027 #include <DataFormats/CSCRecHit/interface/CSCSegmentCollection.h>
0028 #include <DataFormats/GEMRecHit/interface/GEMRecHit.h>
0029 #include <DataFormats/GEMRecHit/interface/GEMRecHitCollection.h>
0030 #include <DataFormats/GEMRecHit/interface/GEMCSCSegmentCollection.h>
0031
0032 class CSCStationIndex {
0033 public:
0034 CSCStationIndex() : _region(0), _station(0), _ring(0), _chamber(0), _layer(0) {}
0035 CSCStationIndex(int region, int station, int ring, int chamber, int layer)
0036 : _region(region), _station(station), _ring(ring), _chamber(chamber), _layer(layer) {}
0037 ~CSCStationIndex() {}
0038
0039 int region() const { return _region; }
0040 int station() const { return _station; }
0041 int ring() const { return _ring; }
0042 int chamber() const { return _chamber; }
0043 int layer() const { return _layer; }
0044
0045 bool operator<(const CSCStationIndex& cscind) const {
0046 if (cscind.region() != this->region())
0047 return cscind.region() < this->region();
0048 else if (cscind.station() != this->station())
0049 return cscind.station() < this->station();
0050 else if (cscind.ring() != this->ring())
0051 return cscind.ring() < this->ring();
0052 else if (cscind.chamber() != this->chamber())
0053 return cscind.chamber() < this->chamber();
0054 else if (cscind.layer() != this->layer())
0055 return cscind.layer() < this->layer();
0056 return false;
0057 }
0058
0059 private:
0060 int _region;
0061 int _station;
0062 int _ring;
0063 int _chamber;
0064 int _layer;
0065 };
0066
0067 class GEMCSCSegmentAlgorithm;
0068
0069 class GEMCSCSegmentBuilder {
0070 public:
0071 explicit GEMCSCSegmentBuilder(const edm::ParameterSet&);
0072 ~GEMCSCSegmentBuilder();
0073 void build(const GEMRecHitCollection* rechits, const CSCSegmentCollection* cscsegments, GEMCSCSegmentCollection& oc);
0074
0075 void setGeometry(const GEMGeometry* gemgeom, const CSCGeometry* cscgeom);
0076 void LinkGEMRollsToCSCChamberIndex(const GEMGeometry* gemgeom, const CSCGeometry* cscgeom);
0077
0078 protected:
0079 std::map<CSCStationIndex, std::set<GEMDetId> > rollstoreCSC;
0080
0081 private:
0082 std::unique_ptr<GEMCSCSegmentAlgorithm> algo;
0083 const bool enable_me21_ge21_;
0084 const GEMGeometry* gemgeom_;
0085 const CSCGeometry* cscgeom_;
0086 };
0087
0088 #endif