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
 
typedef edm::DetSetVector< StripDigiSimLinkStripDigiSimLinks
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
 
std::unique_ptr< GEMDigiModulegemDigiModule_
 
const GEMGeometrygeometry_
 

Detailed Description

Definition at line 38 of file GEMDigiProducer.cc.

Member Typedef Documentation

Definition at line 42 of file GEMDigiProducer.cc.

Definition at line 40 of file GEMDigiProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 63 of file GEMDigiProducer.cc.

References cf_token, Exception, edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, and ~GEMDigiProducer().

63  : gemDigiModule_(std::make_unique<GEMDigiModule>(ps)) {
64  produces<GEMDigiCollection>();
65  produces<StripDigiSimLinks>("GEM");
66  produces<GEMDigiSimLinks>("GEM");
67 
69  if (!rng.isAvailable()) {
70  throw cms::Exception("Configuration")
71  << "GEMDigiProducer::GEMDigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
72  << "Add the service in the configuration file or remove the modules that require it.";
73  }
74 
75  std::string mix_(ps.getParameter<std::string>("mixLabel"));
76  std::string collection_(ps.getParameter<std::string>("inputCollection"));
77 
78  cf_token = consumes<CrossingFrame<PSimHit> >(edm::InputTag(mix_, collection_));
79 }
T getParameter(std::string const &) const
std::unique_ptr< GEMDigiModule > gemDigiModule_
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
GEMDigiProducer::~GEMDigiProducer ( )
overridedefault

Referenced by GEMDigiProducer().

Member Function Documentation

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

Definition at line 139 of file GEMDigiProducer.cc.

References gemDigiModule_, geometry_, and edm::EventSetup::get().

139  {
141  eventSetup.get<MuonGeometryRecord>().get(hGeom);
142  gemDigiModule_->setGeometry(&*hGeom);
143  geometry_ = &*hGeom;
144 }
std::unique_ptr< GEMDigiModule > gemDigiModule_
const GEMGeometry * geometry_
T get() const
Definition: EventSetup.h:73
void GEMDigiProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 83 of file GEMDigiProducer.cc.

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

83  {
85  desc.add<std::string>("inputCollection", "g4SimHitsMuonGEMHits");
86  desc.add<std::string>("mixLabel", "mix");
87 
88  desc.add<double>("signalPropagationSpeed", 0.66);
89  desc.add<double>("timeResolution", 5.);
90  desc.add<double>("timeJitter", 1.0);
91  desc.add<double>("averageShapingTime", 50.0);
92  desc.add<double>("averageEfficiency", 0.98);
93  desc.add<double>("averageNoiseRate", 0.001);
94  // intrinsic noise rate (Hz/cm^2)
95 
96  // in terms of 25 ns
97  desc.add<int>("minBunch", -5);
98  desc.add<int>("maxBunch", 3);
99 
100  desc.add<bool>("fixedRollRadius", true);
101  // Uses fixed radius in the center of the roll
102  desc.add<bool>("digitizeOnlyMuons", false);
103  desc.add<bool>("simulateBkgNoise", false);
104  // false == No background simulation
105  desc.add<bool>("simulateNoiseCLS", true);
106  desc.add<bool>("simulateElectronBkg", true);
107  // flase == simulate only neutral bkg
108  desc.add<bool>("simulateIntrinsicNoise", false);
109 
110  desc.add<double>("instLumi", 7.5);
111  // 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
112  desc.add<double>("rateFact", 1.0);
113  // 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
114  desc.add<double>("bxWidth", 25E-9);
115  desc.add<double>("referenceInstLumi", 5.);
116  // referecne inst. luminosity 5E+34 cm^-2s^-1
117  desc.add<double>("resolutionX", 0.03);
118 
119  // The follwing parameters are needed to model the background contribution
120  // The parameters have been obtained after the fit of th perdicted by FLUKA
121  // By default the backgroundmodeling with these parameters should be disabled with
122  // the 9_2_X release setting simulateBkgNoise = false
123  desc.add<double>("GE11ModNeuBkgParam0", 5710.23);
124  desc.add<double>("GE11ModNeuBkgParam1", -43.3928);
125  desc.add<double>("GE11ModNeuBkgParam2", 0.0863681);
126  desc.add<double>("GE21ModNeuBkgParam0", 1440.44);
127  desc.add<double>("GE21ModNeuBkgParam1", -7.48607);
128  desc.add<double>("GE21ModNeuBkgParam2", 0.0103078);
129  desc.add<double>("GE11ElecBkgParam0", 406.249);
130  desc.add<double>("GE11ElecBkgParam1", -2.90939);
131  desc.add<double>("GE11ElecBkgParam2", 0.00548191);
132  desc.add<double>("GE21ElecBkgParam0", 97.0505);
133  desc.add<double>("GE21ElecBkgParam1", -43.3928);
134  desc.add<double>("GE21ElecBkgParam2", 00.000550599);
135 
136  descriptions.add("simMuonGEMDigisDef", desc);
137 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEMDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 146 of file GEMDigiProducer.cc.

References cf_token, DEFINE_FWK_MODULE, GEMGeometry::etaPartitions(), gemDigiModule_, geometry_, edm::Event::getByToken(), edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), FastTrackerRecHitCombiner_cfi::simHits, and edm::Event::streamID().

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

Member Data Documentation

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

Definition at line 56 of file GEMDigiProducer.cc.

Referenced by GEMDigiProducer(), and produce().

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

Definition at line 60 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().

const GEMGeometry* GEMDigiProducer::geometry_
private

Definition at line 58 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().