CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
GEMDigiProducer Class Reference
Inheritance diagram for GEMDigiProducer:
edm::stream::EDProducer<>

Public Types

typedef edm::DetSetVector< GEMDigiSimLinkGEMDigiSimLinks
 
- 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
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 GEMDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GEMDigiProducer () override
 
- 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)
 

Private Attributes

edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
 
std::unique_ptr< GEMDigiModulegemDigiModule_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeom_token_
 
const GEMGeometrygeometry_
 

Detailed Description

Definition at line 37 of file GEMDigiProducer.cc.

Member Typedef Documentation

◆ GEMDigiSimLinks

Definition at line 39 of file GEMDigiProducer.cc.

Constructor & Destructor Documentation

◆ GEMDigiProducer()

GEMDigiProducer::GEMDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 61 of file GEMDigiProducer.cc.

References cf_token, Exception, geom_token_, edm::ParameterSet::getParameter(), ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

61  : gemDigiModule_(std::make_unique<GEMDigiModule>(ps)) {
62  produces<GEMDigiCollection>();
63  produces<GEMDigiSimLinks>("GEM");
64 
66  if (!rng.isAvailable()) {
67  throw cms::Exception("Configuration")
68  << "GEMDigiProducer::GEMDigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
69  << "Add the service in the configuration file or remove the modules that require it.";
70  }
71 
72  std::string mix_(ps.getParameter<std::string>("mixLabel"));
73  std::string collection_(ps.getParameter<std::string>("inputCollection"));
74 
75  cf_token = consumes<CrossingFrame<PSimHit> >(edm::InputTag(mix_, collection_));
76  geom_token_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
77 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
std::unique_ptr< GEMDigiModule > gemDigiModule_
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token

◆ ~GEMDigiProducer()

GEMDigiProducer::~GEMDigiProducer ( )
overridedefault

Member Function Documentation

◆ beginRun()

void GEMDigiProducer::beginRun ( const edm::Run ,
const edm::EventSetup eventSetup 
)
override

Definition at line 137 of file GEMDigiProducer.cc.

References options_cfi::eventSetup, gemDigiModule_, geom_token_, and geometry_.

137  {
139  gemDigiModule_->setGeometry(&*hGeom);
140  geometry_ = &*hGeom;
141 }
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
std::unique_ptr< GEMDigiModule > gemDigiModule_
const GEMGeometry * geometry_

◆ fillDescriptions()

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

Definition at line 81 of file GEMDigiProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

81  {
83  desc.add<std::string>("inputCollection", "g4SimHitsMuonGEMHits");
84  desc.add<std::string>("mixLabel", "mix");
85 
86  desc.add<double>("signalPropagationSpeed", 0.66);
87  desc.add<double>("timeResolution", 18.);
88  desc.add<double>("timeJitter", 1.0);
89  desc.add<double>("averageShapingTime", 50.0);
90  desc.add<double>("averageEfficiency", 0.98);
91  desc.add<double>("averageNoiseRate", 0.001);
92  // intrinsic noise rate (Hz/cm^2)
93 
94  // in terms of 25 ns
95  desc.add<int>("minBunch", -5);
96  desc.add<int>("maxBunch", 3);
97 
98  desc.add<bool>("fixedRollRadius", true);
99  // Uses fixed radius in the center of the roll
100  desc.add<bool>("digitizeOnlyMuons", false);
101  desc.add<bool>("simulateBkgNoise", false);
102  // false == No background simulation
103  desc.add<bool>("simulateNoiseCLS", true);
104  desc.add<bool>("simulateElectronBkg", true);
105  // flase == simulate only neutral bkg
106  desc.add<bool>("simulateIntrinsicNoise", false);
107 
108  desc.add<double>("instLumi", 7.5);
109  // in units of 1E34 cm^-2 s^-1. Internally the background is parmetrized from FLUKA+GEANT result at 5E+34 (PU 140). We are adding a 1.5 factor for PU 200
110  desc.add<double>("rateFact", 1.0);
111  // We are adding also a safety factor of 2 to tak into account the new beam pipe effect (not yet known). Hits can be thrown away later at re-digi step. Parameters are kept in sync with the ones used in the GEM digitizer
112  desc.add<double>("bxWidth", 25E-9);
113  desc.add<double>("referenceInstLumi", 5.);
114  // referecne inst. luminosity 5E+34 cm^-2s^-1
115  desc.add<double>("resolutionX", 0.03);
116 
117  // The follwing parameters are needed to model the background contribution
118  // The parameters have been obtained after the fit of th perdicted by FLUKA
119  // By default the backgroundmodeling with these parameters should be disabled with
120  // the 9_2_X release setting simulateBkgNoise = false
121  desc.add<double>("GE11ModNeuBkgParam0", 5710.23);
122  desc.add<double>("GE11ModNeuBkgParam1", -43.3928);
123  desc.add<double>("GE11ModNeuBkgParam2", 0.0863681);
124  desc.add<double>("GE21ModNeuBkgParam0", 1440.44);
125  desc.add<double>("GE21ModNeuBkgParam1", -7.48607);
126  desc.add<double>("GE21ModNeuBkgParam2", 0.0103078);
127  desc.add<double>("GE11ElecBkgParam0", 406.249);
128  desc.add<double>("GE11ElecBkgParam1", -2.90939);
129  desc.add<double>("GE11ElecBkgParam2", 0.00548191);
130  desc.add<double>("GE21ElecBkgParam0", 97.0505);
131  desc.add<double>("GE21ElecBkgParam1", -43.3928);
132  desc.add<double>("GE21ElecBkgParam2", 00.000550599);
133 
134  descriptions.add("simMuonGEMDigisDef", desc);
135 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void GEMDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 143 of file GEMDigiProducer.cc.

References cf_token, hcalRecHitTable_cff::detId, MillePedeFileConverter_cfg::e, GEMGeometry::etaPartitions(), gemDigiModule_, geometry_, edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, LogDebug, eostools::move(), edm::Handle< T >::product(), nano_mu_digi_cff::rawId, nano_mu_digi_cff::roll, and FastTrackerRecHitCombiner_cfi::simHits.

143  {
145  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
146 
148  e.getByToken(cf_token, cf);
149 
151 
152  // Create empty output
153  auto digis = std::make_unique<GEMDigiCollection>();
154  auto gemDigiSimLinks = std::make_unique<GEMDigiSimLinks>();
155 
156  // arrange the hits by eta partition
157  std::map<uint32_t, edm::PSimHitContainer> hitMap;
158  for (const auto& hit : hits) {
159  hitMap[GEMDetId(hit.detUnitId()).rawId()].emplace_back(hit);
160  }
161 
162  // simulate signal and noise for each eta partition
163  const auto& etaPartitions(geometry_->etaPartitions());
164 
165  for (const auto& roll : etaPartitions) {
166  const GEMDetId detId(roll->id());
167  const uint32_t rawId(detId.rawId());
168  const auto& simHits(hitMap[rawId]);
169 
170  LogDebug("GEMDigiProducer") << "GEMDigiProducer: found " << simHits.size() << " hit(s) in eta partition" << rawId;
171 
172  gemDigiModule_->simulate(roll, simHits, engine);
173  gemDigiModule_->fillDigis(rawId, *digis);
174  (*gemDigiSimLinks).insert(gemDigiModule_->gemDigiSimLinks());
175  }
176 
177  // store them in the event
178  e.put(std::move(digis));
179  e.put(std::move(gemDigiSimLinks), "GEM");
180 }
T const * product() const
Definition: Handle.h:70
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unique_ptr< GEMDigiModule > gemDigiModule_
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
const GEMGeometry * geometry_
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40

Member Data Documentation

◆ cf_token

edm::EDGetTokenT<CrossingFrame<PSimHit> > GEMDigiProducer::cf_token
private

Definition at line 53 of file GEMDigiProducer.cc.

Referenced by GEMDigiProducer(), and produce().

◆ gemDigiModule_

std::unique_ptr<GEMDigiModule> GEMDigiProducer::gemDigiModule_
private

Definition at line 58 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().

◆ geom_token_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMDigiProducer::geom_token_
private

Definition at line 54 of file GEMDigiProducer.cc.

Referenced by beginRun(), and GEMDigiProducer().

◆ geometry_

const GEMGeometry* GEMDigiProducer::geometry_
private

Definition at line 56 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().