CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ME0ReDigiProducer Class Reference
Inheritance diagram for ME0ReDigiProducer:
edm::stream::EDProducer<>

Classes

class  TemporaryGeometry
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void buildDigis (const ME0DigiPreRecoCollection &, ME0DigiPreRecoCollection &, ME0DigiPreRecoMap &, CLHEP::HepRandomEngine *engine)
 
 ME0ReDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ME0ReDigiProducer () 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
 

Private Types

typedef std::map< DigiIndicies,
unsigned int > 
ChamberDigiMap
 
typedef std::tuple< unsigned
int, unsigned int, unsigned
int > 
DigiIndicies
 

Private Member Functions

void fillCentralTOFs ()
 
unsigned int fillDigiMap (ChamberDigiMap &chDigiMap, unsigned int bx, unsigned int part, unsigned int strip, unsigned int currentIDX) const
 
int getCustomStripProperties (const ME0DetId &detId, const ME0DigiPreReco *inDigi, float &tof, int &strip, LocalPoint &digiLocalPoint, LocalError &digiLocalError) const
 
void getStripProperties (const ME0EtaPartition *etaPart, const ME0DigiPreReco *inDigi, float &tof, int &strip, LocalPoint &digiLocalPoint, LocalError &digiLocalError) const
 

Private Attributes

const float bxWidth
 
edm::ESGetToken< ME0Geometry,
MuonGeometryRecord
geom_token_
 
const ME0Geometrygeometry
 
std::vector< int > layerReadout
 
int maxBXReadout
 
bool mergeDigis
 
int minBXReadout
 
double neutronAcceptance
 
unsigned int numberOfPartitions
 
unsigned int numberOfStrips
 
TemporaryGeometrytempGeo
 
double timeResolution
 
std::vector< std::vector
< double > > 
tofs
 
edm::EDGetTokenT
< ME0DigiPreRecoCollection
token
 
bool useBuiltinGeo
 
bool useCusGeoFor1PartGeo
 
bool usePads
 

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

Definition at line 41 of file ME0ReDigiProducer.cc.

Member Typedef Documentation

typedef std::map<DigiIndicies, unsigned int> ME0ReDigiProducer::ChamberDigiMap
private

Definition at line 102 of file ME0ReDigiProducer.cc.

typedef std::tuple<unsigned int, unsigned int, unsigned int> ME0ReDigiProducer::DigiIndicies
private

Definition at line 101 of file ME0ReDigiProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 268 of file ME0ReDigiProducer.cc.

References Exception, geometry, neutronAcceptance, numberOfPartitions, numberOfStrips, tempGeo, useBuiltinGeo, useCusGeoFor1PartGeo, and usePads.

269  : bxWidth(25.0),
270  useCusGeoFor1PartGeo(ps.getParameter<bool>("useCusGeoFor1PartGeo")),
271  usePads(ps.getParameter<bool>("usePads")),
272  numberOfStrips(ps.getParameter<unsigned int>("numberOfStrips")),
273  numberOfPartitions(ps.getParameter<unsigned int>("numberOfPartitions")),
274  neutronAcceptance(ps.getParameter<double>("neutronAcceptance")),
275  timeResolution(ps.getParameter<double>("timeResolution")),
276  minBXReadout(ps.getParameter<int>("minBXReadout")),
277  maxBXReadout(ps.getParameter<int>("maxBXReadout")),
278  layerReadout(ps.getParameter<std::vector<int>>("layerReadout")),
279  mergeDigis(ps.getParameter<bool>("mergeDigis")),
280  token(consumes<ME0DigiPreRecoCollection>(edm::InputTag(ps.getParameter<std::string>("inputCollection")))),
281  geom_token_(esConsumes<ME0Geometry, MuonGeometryRecord, edm::Transition::BeginRun>()) {
282  produces<ME0DigiPreRecoCollection>();
283  produces<ME0DigiPreRecoMap>();
284 
286  if (!rng.isAvailable()) {
287  throw cms::Exception("Configuration")
288  << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - RandomNumberGeneratorService is not present in configuration "
289  "file.\n"
290  << "Add the service in the configuration file or remove the modules that require it.";
291  }
292  geometry = nullptr;
293  tempGeo = nullptr;
294  useBuiltinGeo = true;
295 
296  if (useCusGeoFor1PartGeo) {
297  if (usePads)
299  if (numberOfStrips == 0)
300  throw cms::Exception("Setup")
301  << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - Must have at least one strip if using custom geometry.";
302  if (numberOfPartitions == 0)
303  throw cms::Exception("Setup")
304  << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - Must have at least one partition if using custom geometry.";
305  }
306 
307  if (neutronAcceptance < 0)
308  throw cms::Exception("Setup") << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - neutronAcceptance must be >= 0.";
309 }
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
const ME0Geometry * geometry
edm::EDGetTokenT< ME0DigiPreRecoCollection > token
std::vector< int > layerReadout
TemporaryGeometry * tempGeo
unsigned int numberOfPartitions
unsigned int numberOfStrips
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ME0ReDigiProducer::~ME0ReDigiProducer ( )
override

Definition at line 311 of file ME0ReDigiProducer.cc.

References tempGeo.

311  {
312  if (tempGeo)
313  delete tempGeo;
314 }
TemporaryGeometry * tempGeo

Member Function Documentation

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

Definition at line 316 of file ME0ReDigiProducer.cc.

References ME0Geometry::chambers(), chambers, Exception, fillCentralTOFs(), geom_token_, geometry, edm::EventSetup::getHandle(), layerReadout, LogDebug, numberOfPartitions, numberOfStrips, ME0ReDigiProducer::TemporaryGeometry::numLayers(), tempGeo, useBuiltinGeo, and useCusGeoFor1PartGeo.

316  {
317  // set geometry
319  geometry = &*hGeom;
320 
321  const auto& chambers = geometry->chambers();
322  if (chambers.empty())
323  throw cms::Exception("Setup") << "ME0ReDigiProducer::beginRun() - No ME0Chambers in geometry.";
324 
325  const unsigned int nLayers = chambers.front()->nLayers();
326  if (!nLayers)
327  throw cms::Exception("Setup") << "ME0ReDigiProducer::beginRun() - No layers in ME0 geometry.";
328 
329  const unsigned int nPartitions = chambers.front()->layers()[0]->nEtaPartitions();
330 
331  if (useCusGeoFor1PartGeo && nPartitions == 1) {
332  useBuiltinGeo = false;
333  }
334 
335  if (useBuiltinGeo) {
336  if (nLayers != layerReadout.size())
337  throw cms::Exception("Configuration")
338  << "ME0ReDigiProducer::beginRun() - The geometry has " << nLayers << " layers, but the readout of "
339  << layerReadout.size() << " were specified with the layerReadout parameter.";
340  fillCentralTOFs();
341  } else {
342  LogDebug("ME0ReDigiProducer") << "Building temporary geometry:" << std::endl;
343  tempGeo = new TemporaryGeometry(geometry, numberOfStrips, numberOfPartitions);
344  LogDebug("ME0ReDigiProducer") << "Done building temporary geometry!" << std::endl;
345 
346  if (tempGeo->numLayers() != layerReadout.size())
347  throw cms::Exception("Configuration")
348  << "ME0ReDigiProducer::beginRun() - The geometry has " << tempGeo->numLayers()
349  << " layers, but the readout of " << layerReadout.size()
350  << " were specified with the layerReadout parameter.";
351  }
352 }
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
const ME0Geometry * geometry
std::vector< int > layerReadout
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:29
TemporaryGeometry * tempGeo
unsigned int numberOfPartitions
unsigned int numberOfStrips
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
#define LogDebug(id)
void ME0ReDigiProducer::buildDigis ( const ME0DigiPreRecoCollection input_digis,
ME0DigiPreRecoCollection output_digis,
ME0DigiPreRecoMap output_digimap,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 372 of file ME0ReDigiProducer.cc.

References bxWidth, ME0Geometry::etaPartition(), fillDigiMap(), geometry, getCustomStripProperties(), getStripProperties(), MuonDigiCollection< IndexType, DigiType >::insertDigi(), layerReadout, LogDebug, LogTrace, maxBXReadout, mergeDigis, minBXReadout, neutronAcceptance, sistrip::SpyUtilities::range(), BeamSpotPI::sigmaX, BeamSpotPI::sigmaY, mathSSE::sqrt(), digitizers_cfi::strip, timeResolution, useBuiltinGeo, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by produce().

375  {
376  /*
377  Starting form the incoming pseudo-digi, which has perfect time and position resolution:
378  1A. Smear time using sigma_t by some value
379  1B. Correct the smeared time with the central arrival time for partition
380  1C. Apply discretization: if the smeared time is outside the BX window (-12.5ns;+12.5ns),
381  the hit should be assigned to the next (or previous) BX
382 
383  2A. Find strip that the digi belongs to
384  2B. Get the center of this strip and the error on the position assuming the geometry
385 
386  3A. Filter event if a digi at this partition/strip/BX already exists
387  3B. Add to collection
388  */
389 
390  LogDebug("ME0ReDigiProducer::buildDigis") << "Begin building digis." << std::endl;
392  for (me0dgIt = input_digis.begin(); me0dgIt != input_digis.end(); ++me0dgIt) {
393  const auto& me0Id = (*me0dgIt).first;
394  LogTrace("ME0ReDigiProducer::buildDigis") << "Starting with roll: " << me0Id << std::endl;
395 
396  //setup map for this chamber/eta partition
397  ChamberDigiMap chDigiMap;
398 
399  int newDigiIdx = 0;
400  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
401  for (ME0DigiPreRecoCollection::const_iterator digi = range.first; digi != range.second; digi++) {
402  LogTrace("ME0ReDigiProducer::buildDigis") << std::endl
403  << "(" << digi->x() << "," << digi->y() << "," << digi->tof() << ","
404  << digi->pdgid() << "," << digi->prompt() << ")-> ";
405 
406  //If we don't readout this layer skip
407  if (!layerReadout[me0Id.layer() - 1]) {
408  output_digimap.insertDigi(me0Id, -1);
409  continue;
410  }
411 
412  //if neutron and we are filtering skip
413  if (!digi->prompt() && neutronAcceptance < 1.0)
414  if (CLHEP::RandFlat::shoot(engine) > neutronAcceptance) {
415  output_digimap.insertDigi(me0Id, -1);
416  continue;
417  }
418 
419  //smear TOF if necessary
420  float tof = digi->tof() + (timeResolution < 0 ? 0.0 : CLHEP::RandGaussQ::shoot(engine, 0, timeResolution));
421 
422  //Values used to fill objet
423  int mapPartIDX = me0Id.roll() - 1;
424  int strip = 0;
425  LocalPoint digiLocalPoint;
426  LocalError digiLocalError;
427  if (useBuiltinGeo) {
428  getStripProperties(geometry->etaPartition(me0Id), &*digi, tof, strip, digiLocalPoint, digiLocalError);
429  } else {
430  mapPartIDX = getCustomStripProperties(me0Id, &*digi, tof, strip, digiLocalPoint, digiLocalError);
431  }
432 
433  //filter if outside of readout window
434  const int bxIdx = std::round(tof / bxWidth);
435  LogTrace("ME0ReDigiProducer::buildDigis") << tof << "(" << bxIdx << ") ";
436  if (bxIdx < minBXReadout) {
437  output_digimap.insertDigi(me0Id, -1);
438  continue;
439  }
440  if (bxIdx > maxBXReadout) {
441  output_digimap.insertDigi(me0Id, -1);
442  continue;
443  }
444  tof = bxIdx * bxWidth;
445 
446  //If we are merging check to see if it already exists
447  LogTrace("ME0ReDigiProducer::buildDigis") << "(" << bxIdx << "," << mapPartIDX << "," << strip << ") ";
448  if (mergeDigis) {
449  int matchIDX = fillDigiMap(chDigiMap, bxIdx, mapPartIDX, strip, newDigiIdx);
450  if (matchIDX >= 0) {
451  output_digimap.insertDigi(me0Id, matchIDX);
452  continue;
453  }
454  }
455 
456  //Digis store sigmaX,sigmaY, correlationCoef
457  const float sigmaX = std::sqrt(digiLocalError.xx());
458  const float sigmaY = std::sqrt(digiLocalError.yy());
459  const float corrCoef = digiLocalError.xy() / (sigmaX * sigmaY);
460 
461  //Fill in the new collection
462  ME0DigiPreReco out_digi(
463  digiLocalPoint.x(), digiLocalPoint.y(), sigmaX, sigmaY, corrCoef, tof, digi->pdgid(), digi->prompt());
464  output_digis.insertDigi(me0Id, out_digi);
465 
466  // store index of previous detid and digi
467  output_digimap.insertDigi(me0Id, newDigiIdx);
468  newDigiIdx++;
469 
470  LogTrace("ME0ReDigiProducer::buildDigis") << "(" << digiLocalPoint.x() << "," << digiLocalPoint.y() << ","
471  << sigmaX << "," << sigmaY << "," << tof << ") ";
472  }
473 
474  chDigiMap.clear();
475  }
476 }
float xx() const
Definition: LocalError.h:22
const ME0Geometry * geometry
int getCustomStripProperties(const ME0DetId &detId, const ME0DigiPreReco *inDigi, float &tof, int &strip, LocalPoint &digiLocalPoint, LocalError &digiLocalError) const
std::vector< int > layerReadout
T y() const
Definition: PV3DBase.h:60
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
unsigned int fillDigiMap(ChamberDigiMap &chDigiMap, unsigned int bx, unsigned int part, unsigned int strip, unsigned int currentIDX) const
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:35
#define LogTrace(id)
const uint16_t range(const Frame &aFrame)
float xy() const
Definition: LocalError.h:23
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
std::map< DigiIndicies, unsigned int > ChamberDigiMap
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
T x() const
Definition: PV3DBase.h:59
void getStripProperties(const ME0EtaPartition *etaPart, const ME0DigiPreReco *inDigi, float &tof, int &strip, LocalPoint &digiLocalPoint, LocalError &digiLocalError) const
#define LogDebug(id)
void ME0ReDigiProducer::fillCentralTOFs ( )
private

Definition at line 478 of file ME0ReDigiProducer.cc.

References ME0Geometry::chambers(), Exception, geometry, phase1PixelTopology::layer, LogDebug, and tofs.

Referenced by beginRun().

478  {
479  const auto* mainChamber = geometry->chambers().front();
480  const unsigned int nLayers = mainChamber->nLayers();
481  //Get TOF at center of each partition
482  tofs.clear();
483  tofs.resize(nLayers);
484  LogDebug("ME0ReDigiProducer::fillCentralTOFs()") << "TOF numbers [layer][partition]: ";
485  for (unsigned int iL = 0; iL < nLayers; ++iL) {
486  const auto* layer = mainChamber->layers()[iL];
487  const unsigned int mapLayIDX = layer->id().layer() - 1;
488  const unsigned int nPartitions = layer->nEtaPartitions();
489  if (!nPartitions)
490  throw cms::Exception("Setup") << "ME0ReDigiProducer::fillCentralTOFs() - ME0Layer has no partitions.";
491  tofs[mapLayIDX].resize(nPartitions);
492  for (unsigned int iP = 0; iP < nPartitions; ++iP) {
493  const unsigned int mapPartIDX = layer->etaPartitions()[iP]->id().roll() - 1;
494  const GlobalPoint centralGP(layer->etaPartitions()[iP]->position());
495  tofs[mapLayIDX][mapPartIDX] = (centralGP.mag() / (CLHEP::c_light / CLHEP::cm)); //speed of light [cm/ns]
496  LogDebug("ME0ReDigiProducer::fillCentralTOFs()")
497  << "[" << mapLayIDX << "][" << mapPartIDX << "]=" << tofs[mapLayIDX][mapPartIDX] << " " << std::endl;
498  }
499  }
500 }
const ME0Geometry * geometry
constexpr std::array< uint8_t, layerIndexSize > layer
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:29
std::vector< std::vector< double > > tofs
#define LogDebug(id)
unsigned int ME0ReDigiProducer::fillDigiMap ( ChamberDigiMap chDigiMap,
unsigned int  bx,
unsigned int  part,
unsigned int  strip,
unsigned int  currentIDX 
) const
private

Definition at line 557 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

558  {
559  DigiIndicies newIDX(bx, part, strip);
560  auto it1 = chDigiMap.find(newIDX);
561  if (it1 == chDigiMap.end()) {
562  chDigiMap[newIDX] = currentIDX;
563  return -1;
564  }
565  return it1->second;
566 }
std::tuple< unsigned int, unsigned int, unsigned int > DigiIndicies
part
Definition: HCALResponse.h:20
int ME0ReDigiProducer::getCustomStripProperties ( const ME0DetId detId,
const ME0DigiPreReco inDigi,
float &  tof,
int &  strip,
LocalPoint digiLocalPoint,
LocalError digiLocalError 
) const
private

Definition at line 501 of file ME0ReDigiProducer.cc.

References ME0ReDigiProducer::TemporaryGeometry::findEtaPartition(), ME0ReDigiProducer::TemporaryGeometry::getCentralTOF(), ME0ReDigiProducer::TemporaryGeometry::getPartCenter(), ME0ReDigiProducer::TemporaryGeometry::getTopo(), LogTrace, partIdx(), mathSSE::sqrt(), tempGeo, ME0DigiPreReco::x(), PV3DBase< T, PVType, FrameType >::x(), ME0DigiPreReco::y(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by buildDigis().

506  {
507  const unsigned int partIdx = tempGeo->findEtaPartition(inDigi->y());
508  LogTrace("ME0ReDigiProducer::buildDigis") << partIdx << " ";
509  const float partMeanTof = tempGeo->getCentralTOF(detId, partIdx);
510 
511  //convert to relative to partition
512  tof -= partMeanTof;
513 
514  //get coordinates and errors
515  const float partCenter = tempGeo->getPartCenter(partIdx);
516  const auto* topo = tempGeo->getTopo(partIdx);
517 
518  //find channel
519  const LocalPoint partLocalPoint(inDigi->x(), inDigi->y() - partCenter, 0.);
520  strip = topo->channel(partLocalPoint);
521  const float stripF = float(strip) + 0.5;
522 
523  //get digitized location
524  LocalPoint digiPartLocalPoint = topo->localPosition(stripF);
525  digiLocalError = topo->localError(
526  stripF,
527  1. /
528  sqrt(
529  12.)); //std dev. flat distribution with length L is L/sqrt(12). The strip topology expects the error in units of strips.
530  digiLocalPoint = LocalPoint(digiPartLocalPoint.x(), digiPartLocalPoint.y() + partCenter, 0.0);
531  return partIdx;
532 }
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
float y() const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
float getCentralTOF(const ME0DetId &me0Id, unsigned int partIdx) const
T y() const
Definition: PV3DBase.h:60
#define LogTrace(id)
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int findEtaPartition(float locY) const
float getPartCenter(const unsigned int partIdx) const
TemporaryGeometry * tempGeo
float x() const
T x() const
Definition: PV3DBase.h:59
const TrapezoidalStripTopology * getTopo(const unsigned int partIdx) const
void ME0ReDigiProducer::getStripProperties ( const ME0EtaPartition etaPart,
const ME0DigiPreReco inDigi,
float &  tof,
int &  strip,
LocalPoint digiLocalPoint,
LocalError digiLocalError 
) const
private

Definition at line 533 of file ME0ReDigiProducer.cc.

References ME0EtaPartition::id(), ME0DetId::layer(), TrapezoidalStripTopology::nstrips(), TrapezoidalStripTopology::pitch(), TrapezoidalStripTopology::radius(), ME0DetId::roll(), ME0EtaPartition::specificTopology(), mathSSE::sqrt(), TrapezoidalStripTopology::stripLength(), tofs, usePads, ME0DigiPreReco::x(), and ME0DigiPreReco::y().

Referenced by buildDigis().

538  {
539  //convert to relative to partition
540  tof -= tofs[etaPart->id().layer() - 1][etaPart->id().roll() - 1];
541 
542  const TrapezoidalStripTopology* origTopo = (const TrapezoidalStripTopology*)(&etaPart->specificTopology());
543  TrapezoidalStripTopology padTopo(
544  origTopo->nstrips() / 2, origTopo->pitch() * 2, origTopo->stripLength(), origTopo->radius());
545  const auto& topo = usePads ? padTopo : etaPart->specificTopology();
546 
547  //find channel
548  const LocalPoint partLocalPoint(inDigi->x(), inDigi->y(), 0.);
549  strip = topo.channel(partLocalPoint);
550  const float stripF = float(strip) + 0.5;
551 
552  //get digitized location
553  digiLocalPoint = topo.localPosition(stripF);
554  digiLocalError = topo.localError(stripF, 1. / sqrt(12.));
555 }
const StripTopology & specificTopology() const
float y() const
T sqrt(T t)
Definition: SSEVec.h:19
ME0DetId id() const
float x() const
int roll() const
Definition: ME0DetId.h:48
std::vector< std::vector< double > > tofs
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
Definition: ME0DetId.h:44
float stripLength() const override
det heigth (strip length in the middle)
void ME0ReDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 354 of file ME0ReDigiProducer.cc.

References buildDigis(), edm::Event::getByToken(), edm::RandomNumberGenerator::getEngine(), eostools::move(), edm::Handle< T >::product(), edm::Event::put(), edm::Event::streamID(), and token.

354  {
356  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
357 
359  e.getByToken(token, input_digis);
360 
361  std::unique_ptr<ME0DigiPreRecoCollection> output_digis(new ME0DigiPreRecoCollection());
362  std::unique_ptr<ME0DigiPreRecoMap> output_digimap(new ME0DigiPreRecoMap());
363 
364  // build the digis
365  buildDigis(*(input_digis.product()), *output_digis, *output_digimap, engine);
366 
367  // store them in the event
368  e.put(std::move(output_digis));
369  e.put(std::move(output_digimap));
370 }
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
edm::EDGetTokenT< ME0DigiPreRecoCollection > token
void buildDigis(const ME0DigiPreRecoCollection &, ME0DigiPreRecoCollection &, ME0DigiPreRecoMap &, CLHEP::HepRandomEngine *engine)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
def move
Definition: eostools.py:511
T const * product() const
Definition: Handle.h:70
MuonDigiCollection< ME0DetId, int > ME0DigiPreRecoMap
StreamID streamID() const
Definition: Event.h:98

Member Data Documentation

const float ME0ReDigiProducer::bxWidth
private

Definition at line 108 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

edm::ESGetToken<ME0Geometry, MuonGeometryRecord> ME0ReDigiProducer::geom_token_
private

Definition at line 120 of file ME0ReDigiProducer.cc.

Referenced by beginRun().

const ME0Geometry* ME0ReDigiProducer::geometry
private

Definition at line 123 of file ME0ReDigiProducer.cc.

Referenced by beginRun(), buildDigis(), fillCentralTOFs(), and ME0ReDigiProducer().

std::vector<int> ME0ReDigiProducer::layerReadout
private

Definition at line 117 of file ME0ReDigiProducer.cc.

Referenced by beginRun(), and buildDigis().

int ME0ReDigiProducer::maxBXReadout
private

Definition at line 116 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

bool ME0ReDigiProducer::mergeDigis
private

Definition at line 118 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

int ME0ReDigiProducer::minBXReadout
private

Definition at line 115 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

double ME0ReDigiProducer::neutronAcceptance
private

Definition at line 113 of file ME0ReDigiProducer.cc.

Referenced by buildDigis(), and ME0ReDigiProducer().

unsigned int ME0ReDigiProducer::numberOfPartitions
private
unsigned int ME0ReDigiProducer::numberOfStrips
private
TemporaryGeometry* ME0ReDigiProducer::tempGeo
private
double ME0ReDigiProducer::timeResolution
private

Definition at line 114 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

std::vector<std::vector<double> > ME0ReDigiProducer::tofs
private

Definition at line 125 of file ME0ReDigiProducer.cc.

Referenced by fillCentralTOFs(), and getStripProperties().

edm::EDGetTokenT<ME0DigiPreRecoCollection> ME0ReDigiProducer::token
private

Definition at line 119 of file ME0ReDigiProducer.cc.

Referenced by produce().

bool ME0ReDigiProducer::useBuiltinGeo
private

Definition at line 122 of file ME0ReDigiProducer.cc.

Referenced by beginRun(), buildDigis(), and ME0ReDigiProducer().

bool ME0ReDigiProducer::useCusGeoFor1PartGeo
private

Definition at line 109 of file ME0ReDigiProducer.cc.

Referenced by beginRun(), and ME0ReDigiProducer().

bool ME0ReDigiProducer::usePads
private

Definition at line 110 of file ME0ReDigiProducer.cc.

Referenced by getStripProperties(), and ME0ReDigiProducer().