CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
GEMCSCSegmentProducer Class Reference

#include <GEMCSCSegmentProducer.h>

Inheritance diagram for GEMCSCSegmentProducer:
edm::stream::EDProducer<>

Public Member Functions

 GEMCSCSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the GEM-CSCSegment collection. More...
 
 ~GEMCSCSegmentProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 generate gemcscSegment_cfi More...
 

Private Attributes

int iev
 
const edm::ESGetToken< CSCGeometry, MuonGeometryRecordkCSCGeometryToken_
 
const edm::EDGetTokenT< CSCSegmentCollectionkCSCSegmentCollectionToken_
 
const edm::ESGetToken< GEMGeometry, MuonGeometryRecordkGEMGeometryToken_
 
const edm::EDGetTokenT< GEMRecHitCollectionkGEMRecHitCollectionToken_
 
GEMCSCSegmentBuildersegmentBuilder_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Produces a collection of GEM-CSCSegments

Date
2014/02/06 12:19:20
Author
Raffaella Radogna

Definition at line 28 of file GEMCSCSegmentProducer.h.

Constructor & Destructor Documentation

◆ GEMCSCSegmentProducer()

GEMCSCSegmentProducer::GEMCSCSegmentProducer ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 20 of file GEMCSCSegmentProducer.cc.

References segmentBuilder_.

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMCSCSegmentBuilder * segmentBuilder_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryToken_
const edm::EDGetTokenT< GEMRecHitCollection > kGEMRecHitCollectionToken_
const edm::EDGetTokenT< CSCSegmentCollection > kCSCSegmentCollectionToken_
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > kCSCGeometryToken_

◆ ~GEMCSCSegmentProducer()

GEMCSCSegmentProducer::~GEMCSCSegmentProducer ( )
override

Destructor.

Definition at line 32 of file GEMCSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

32  {
33  LogDebug("GEMCSCSegment") << "deleting GEMCSCSegmentBuilder after " << iev << " events w/ gem and csc data.";
34  delete segmentBuilder_;
35 }
GEMCSCSegmentBuilder * segmentBuilder_
#define LogDebug(id)

Member Function Documentation

◆ fillDescriptions()

void GEMCSCSegmentProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

generate gemcscSegment_cfi

Definition at line 37 of file GEMCSCSegmentProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

37  {
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 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void GEMCSCSegmentProducer::produce ( edm::Event ev,
const edm::EventSetup setup 
)
override

Produce the GEM-CSCSegment collection.

Definition at line 61 of file GEMCSCSegmentProducer.cc.

References GEMCSCSegmentBuilder::build(), cscRecHitPSet::cscSegment, makeMEIFBenchmarkPlots::ev, gemRecHits_cfi::gemRecHits, iev, kCSCGeometryToken_, kCSCSegmentCollectionToken_, kGEMGeometryToken_, kGEMRecHitCollectionToken_, GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), LogDebug, eostools::move(), segmentBuilder_, GEMCSCSegmentBuilder::setGeometry(), and singleTopDQM_cfi::setup.

61  {
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 }
GEMCSCSegmentBuilder * segmentBuilder_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryToken_
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
const edm::EDGetTokenT< GEMRecHitCollection > kGEMRecHitCollectionToken_
Log< level::Error, false > LogError
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
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)

Member Data Documentation

◆ iev

int GEMCSCSegmentProducer::iev
private

Definition at line 45 of file GEMCSCSegmentProducer.h.

Referenced by produce(), and ~GEMCSCSegmentProducer().

◆ kCSCGeometryToken_

const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> GEMCSCSegmentProducer::kCSCGeometryToken_
private

Definition at line 40 of file GEMCSCSegmentProducer.h.

Referenced by produce().

◆ kCSCSegmentCollectionToken_

const edm::EDGetTokenT<CSCSegmentCollection> GEMCSCSegmentProducer::kCSCSegmentCollectionToken_
private

Definition at line 42 of file GEMCSCSegmentProducer.h.

Referenced by produce().

◆ kGEMGeometryToken_

const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMCSCSegmentProducer::kGEMGeometryToken_
private

Definition at line 41 of file GEMCSCSegmentProducer.h.

Referenced by produce().

◆ kGEMRecHitCollectionToken_

const edm::EDGetTokenT<GEMRecHitCollection> GEMCSCSegmentProducer::kGEMRecHitCollectionToken_
private

Definition at line 43 of file GEMCSCSegmentProducer.h.

Referenced by produce().

◆ segmentBuilder_

GEMCSCSegmentBuilder* GEMCSCSegmentProducer::segmentBuilder_
private

Definition at line 46 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), produce(), and ~GEMCSCSegmentProducer().