CMS 3D CMS Logo

GEMCSCSegmentProducer.cc
Go to the documentation of this file.
1 
7 
11 
15 
19 
21  : kCSCGeometryToken_(esConsumes<CSCGeometry, MuonGeometryRecord>()),
22  kGEMGeometryToken_(esConsumes<GEMGeometry, MuonGeometryRecord>()),
23  kCSCSegmentCollectionToken_(consumes<CSCSegmentCollection>(pas.getParameter<edm::InputTag>("inputObjectsCSC"))),
24  kGEMRecHitCollectionToken_(consumes<GEMRecHitCollection>(pas.getParameter<edm::InputTag>("inputObjectsGEM"))),
25  iev(0) {
26  segmentBuilder_ = new GEMCSCSegmentBuilder(pas); // pass on the parameterset
27 
28  // register what this produces
29  produces<GEMCSCSegmentCollection>();
30 }
31 
33  LogDebug("GEMCSCSegment") << "deleting GEMCSCSegmentBuilder after " << iev << " events w/ gem and csc data.";
34  delete segmentBuilder_;
35 }
36 
38  // gemcscSegments
40  desc.add<edm::InputTag>("inputObjectsGEM", edm::InputTag("gemRecHits"));
41  desc.add<edm::InputTag>("inputObjectsCSC", edm::InputTag("cscSegments"));
42  desc.add<bool>("enableME21GE21", false);
43  desc.add<std::string>("algo_name", "GEMCSCSegAlgoRR");
44  {
46  psd0.addUntracked<bool>("GEMCSCDebug", true);
47  psd0.add<unsigned int>("minHitsPerSegment", 2);
48  psd0.add<bool>("preClustering", true);
49  psd0.add<double>("dXclusBoxMax", 1.0);
50  psd0.add<double>("dYclusBoxMax", 5.0);
51  psd0.add<bool>("preClusteringUseChaining", true);
52  psd0.add<double>("dPhiChainBoxMax", 1.0);
53  psd0.add<double>("dThetaChainBoxMax", 0.02);
54  psd0.add<double>("dRChainBoxMax", 0.5);
55  psd0.add<int>("maxRecHitsInCluster", 6);
56  desc.add<edm::ParameterSetDescription>("algo_psets", psd0);
57  }
58  descriptions.add("gemcscSegments", desc);
59 }
60 
62  LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";
63 
64  // find the geometry (& conditions?) for this event & cache it in the builder
65  const auto cscg = setup.getHandle(kCSCGeometryToken_);
66  if (not cscg.isValid()) {
67  edm::LogError("GEMCSCSegment") << "invalid CSCGeometry";
68  return;
69  }
70  const CSCGeometry* cgeom = &*cscg;
71 
72  const auto gemg = setup.getHandle(kGEMGeometryToken_);
73  if (not gemg.isValid()) {
74  edm::LogError("GEMCSCSegment") << "invalid GEMGeometry";
75  return;
76  }
77  const GEMGeometry* ggeom = &*gemg;
78 
79  // cache the geometry in the builder
80  segmentBuilder_->setGeometry(ggeom, cgeom);
81 
82  // fill the map with matches between GEM and CSC chambers
84 
85  // get the collection of CSCSegment and GEMRecHits
86  const auto cscSegment = ev.getHandle(kCSCSegmentCollectionToken_);
87  if (not cscSegment.isValid()) {
88  edm::LogError("GEMCSCSegment") << "invalid CSCSegmentCollection";
89  return;
90  }
91 
92  const auto gemRecHits = ev.getHandle(kGEMRecHitCollectionToken_);
93  if (not gemRecHits.isValid()) {
94  edm::LogError("GEMCSCSegment") << "invalid GEMRecHitCollection";
95  return;
96  }
97 
98  // create empty collection of GEMCSC Segments
99  auto oc = std::make_unique<GEMCSCSegmentCollection>();
100 
101  // pass the empty collection of GEMCSC Segments and fill it
102  segmentBuilder_->build(gemRecHits.product(), cscSegment.product(), *oc); //@@ FILL oc
103 
104  // put the filled collection in event
105  ev.put(std::move(oc));
106 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
GEMCSCSegmentBuilder * segmentBuilder_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryToken_
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
const edm::EDGetTokenT< GEMRecHitCollection > kGEMRecHitCollectionToken_
GEMCSCSegmentProducer(const edm::ParameterSet &)
Constructor.
Log< level::Error, false > LogError
~GEMCSCSegmentProducer() override
Destructor.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
void produce(edm::Event &, const edm::EventSetup &) override
Produce the GEM-CSCSegment collection.
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int32_t int iev
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
generate gemcscSegment_cfi
HLT enums.
const edm::EDGetTokenT< CSCSegmentCollection > kCSCSegmentCollectionToken_
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
def move(src, dest)
Definition: eostools.py:511
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > kCSCGeometryToken_
#define LogDebug(id)