CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< GEMDigiSimLink
GEMDigiSimLinks
 
- 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,
MuonGeometryRecord
geom_token_
 
const GEMGeometrygeometry_
 

Detailed Description

Definition at line 38 of file GEMDigiProducer.cc.

Member Typedef Documentation

Definition at line 40 of file GEMDigiProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 62 of file GEMDigiProducer.cc.

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

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

Member Function Documentation

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

Definition at line 139 of file GEMDigiProducer.cc.

References gemDigiModule_, geom_token_, geometry_, and edm::EventSetup::getHandle().

139  {
141  gemDigiModule_->setGeometry(&*hGeom);
142  geometry_ = &*hGeom;
143 }
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
std::unique_ptr< GEMDigiModule > gemDigiModule_
const GEMGeometry * geometry_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
void GEMDigiProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 82 of file GEMDigiProducer.cc.

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

82  {
84  desc.add<std::string>("inputCollection", "g4SimHitsMuonGEMHits");
85  desc.add<std::string>("mixLabel", "mix");
86 
87  desc.add<double>("signalPropagationSpeed", 0.66);
88  desc.add<double>("timeResolution", 5.);
89  desc.add<double>("timeJitter", 1.0);
90  desc.add<double>("averageShapingTime", 50.0);
91  desc.add<double>("averageEfficiency", 0.98);
92  desc.add<double>("averageNoiseRate", 0.001);
93  // intrinsic noise rate (Hz/cm^2)
94 
95  // in terms of 25 ns
96  desc.add<int>("minBunch", -5);
97  desc.add<int>("maxBunch", 3);
98 
99  desc.add<bool>("fixedRollRadius", true);
100  // Uses fixed radius in the center of the roll
101  desc.add<bool>("digitizeOnlyMuons", false);
102  desc.add<bool>("simulateBkgNoise", false);
103  // false == No background simulation
104  desc.add<bool>("simulateNoiseCLS", true);
105  desc.add<bool>("simulateElectronBkg", true);
106  // flase == simulate only neutral bkg
107  desc.add<bool>("simulateIntrinsicNoise", false);
108  desc.add<bool>("bx0filter", 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 145 of file GEMDigiProducer.cc.

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

145  {
147  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
148 
150  e.getByToken(cf_token, cf);
151 
152  MixCollection<PSimHit> hits{cf.product()};
153 
154  // Create empty output
155  auto digis = std::make_unique<GEMDigiCollection>();
156  auto gemDigiSimLinks = std::make_unique<GEMDigiSimLinks>();
157 
158  // arrange the hits by eta partition
159  std::map<uint32_t, edm::PSimHitContainer> hitMap;
160  for (const auto& hit : hits) {
161  hitMap[GEMDetId(hit.detUnitId()).rawId()].emplace_back(hit);
162  }
163 
164  // simulate signal and noise for each eta partition
165  const auto& etaPartitions(geometry_->etaPartitions());
166 
167  for (const auto& roll : etaPartitions) {
168  const GEMDetId detId(roll->id());
169  const uint32_t rawId(detId.rawId());
170  const auto& simHits(hitMap[rawId]);
171 
172  LogDebug("GEMDigiProducer") << "GEMDigiProducer: found " << simHits.size() << " hit(s) in eta partition" << rawId;
173 
174  gemDigiModule_->simulate(roll, simHits, engine);
175  gemDigiModule_->fillDigis(rawId, *digis);
176  (*gemDigiSimLinks).insert(gemDigiModule_->gemDigiSimLinks());
177  }
178 
179  // store them in the event
180  e.put(std::move(digis));
181  e.put(std::move(gemDigiSimLinks), "GEM");
182 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
def move
Definition: eostools.py:511
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:70
tuple simHits
Definition: trackerHits.py:16
const GEMGeometry * geometry_
StreamID streamID() const
Definition: Event.h:98
#define LogDebug(id)

Member Data Documentation

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

Definition at line 54 of file GEMDigiProducer.cc.

Referenced by GEMDigiProducer(), and produce().

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

Definition at line 59 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().

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

Definition at line 55 of file GEMDigiProducer.cc.

Referenced by beginRun(), and GEMDigiProducer().

const GEMGeometry* GEMDigiProducer::geometry_
private

Definition at line 57 of file GEMDigiProducer.cc.

Referenced by beginRun(), and produce().