CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ME0ReDigiProducer Class Reference

#include <ME0ReDigiProducer.h>

Inheritance diagram for ME0ReDigiProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  TemporaryGeometry
 

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void buildDigis (const ME0DigiPreRecoCollection &, ME0DigiPreRecoCollection &, ME0DigiPreRecoMap &, CLHEP::HepRandomEngine *engine)
 
 ME0ReDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~ME0ReDigiProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
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< ME0DigiPreRecoCollectiontoken
 
bool useBuiltinGeo
 
bool useCusGeoFor1PartGeo
 

Additional Inherited Members

- 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 Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 29 of file ME0ReDigiProducer.h.

Member Typedef Documentation

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

Definition at line 77 of file ME0ReDigiProducer.h.

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

Definition at line 76 of file ME0ReDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 136 of file ME0ReDigiProducer.cc.

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

136  :
137  bxWidth (25.0),
138  useCusGeoFor1PartGeo(ps.getParameter<bool>("useCusGeoFor1PartGeo")),
139  numberOfStrips (ps.getParameter<unsigned int>("numberOfStrips")),
140  numberOfPartitions (ps.getParameter<unsigned int>("numberOfPartitions")),
141  neutronAcceptance (ps.getParameter<double>("neutronAcceptance")),
142  timeResolution (ps.getParameter<double>("timeResolution")),
143  minBXReadout (ps.getParameter<int>("minBXReadout")),
144  maxBXReadout (ps.getParameter<int>("maxBXReadout")),
145  layerReadout (ps.getParameter<std::vector<int>>("layerReadout")),
146  mergeDigis (ps.getParameter<bool>("mergeDigis")),
147  token(consumes<ME0DigiPreRecoCollection>(edm::InputTag(ps.getParameter<std::string>("inputCollection"))))
148 {
149  produces<ME0DigiPreRecoCollection>();
150  produces<ME0DigiPreRecoMap>();
151 
153  if (!rng.isAvailable()){
154  throw cms::Exception("Configuration")
155  << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
156  << "Add the service in the configuration file or remove the modules that require it.";
157  }
158  geometry = 0;
159  tempGeo = 0;
160  useBuiltinGeo = true;
161 
163  if(numberOfStrips == 0)
164  throw cms::Exception("Setup") << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - Must have at least one strip if using custom geometry.";
165  if(numberOfPartitions == 0)
166  throw cms::Exception("Setup") << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - Must have at least one partition if using custom geometry.";
167  }
168 
169  if(neutronAcceptance < 0 )
170  throw cms::Exception("Setup") << "ME0ReDigiProducer::ME0PreRecoDigiProducer() - neutronAcceptance must be >= 0.";
171 }
T getParameter(std::string const &) const
edm::EDGetTokenT< ME0DigiPreRecoCollection > token
std::vector< int > layerReadout
TemporaryGeometry * tempGeo
unsigned int numberOfPartitions
unsigned int numberOfStrips
ME0ReDigiProducer::~ME0ReDigiProducer ( )
virtual

Definition at line 174 of file ME0ReDigiProducer.cc.

References tempGeo.

175 {
176  if(tempGeo) delete tempGeo;
177 }
TemporaryGeometry * tempGeo

Member Function Documentation

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

Definition at line 180 of file ME0ReDigiProducer.cc.

References chambers, Exception, fillCentralTOFs(), edm::EventSetup::get(), layerReadout, LogDebug, MuonTCMETValueMapProducer_cff::nLayers, numberOfPartitions, numberOfStrips, ME0ReDigiProducer::TemporaryGeometry::numLayers(), tempGeo, useBuiltinGeo, and useCusGeoFor1PartGeo.

181 {
182  // set geometry
184  eventSetup.get<MuonGeometryRecord>().get(hGeom);
185  geometry= &*hGeom;
186 
187  const auto& chambers = geometry->chambers();
188  if(chambers.empty())
189  throw cms::Exception("Setup") << "ME0ReDigiProducer::beginRun() - No ME0Chambers in geometry.";
190 
191  const unsigned int nLayers = chambers.front()->nLayers();
192  if(!nLayers) throw cms::Exception("Setup") << "ME0ReDigiProducer::beginRun() - No layers in ME0 geometry.";
193 
194  const unsigned int nPartitions = chambers.front()->layers()[0]->nEtaPartitions();
195 
196  if(useCusGeoFor1PartGeo && nPartitions == 1){
197  useBuiltinGeo = false;
198  }
199 
200  if(useBuiltinGeo){
201  if(nLayers != layerReadout.size() )
202  throw cms::Exception("Configuration") << "ME0ReDigiProducer::beginRun() - The geometry has "<<nLayers
203  << " layers, but the readout of "<<layerReadout.size() << " were specified with the layerReadout parameter." ;
204  fillCentralTOFs();
205  } else {
206  LogDebug("ME0ReDigiProducer")
207  << "Building temporary geometry:" << std::endl;
208  tempGeo = new TemporaryGeometry(geometry,numberOfStrips,numberOfPartitions);
209  LogDebug("ME0ReDigiProducer")
210  << "Done building temporary geometry!" << std::endl;
211 
212  if(tempGeo->numLayers() != layerReadout.size() )
213  throw cms::Exception("Configuration") << "ME0ReDigiProducer::beginRun() - The geometry has "<<tempGeo->numLayers()
214  << " layers, but the readout of "<<layerReadout.size() << " were specified with the layerReadout parameter." ;
215  }
216 }
#define LogDebug(id)
std::vector< int > layerReadout
TemporaryGeometry * tempGeo
unsigned int numberOfPartitions
const T & get() const
Definition: EventSetup.h:56
unsigned int numberOfStrips
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
void ME0ReDigiProducer::buildDigis ( const ME0DigiPreRecoCollection input_digis,
ME0DigiPreRecoCollection output_digis,
ME0DigiPreRecoMap output_digimap,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 242 of file ME0ReDigiProducer.cc.

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

Referenced by produce().

246 {
247 
248  /*
249  Starting form the incoming pseudo-digi, which has perfect time and position resolution:
250  1A. Smear time using sigma_t by some value
251  1B. Correct the smeared time with the central arrival time for partition
252  1C. Apply discretization: if the smeared time is outside the BX window (-12.5ns;+12.5ns),
253  the hit should be assigned to the next (or previous) BX
254 
255  2A. Find strip that the digi belongs to
256  2B. Get the center of this strip and the error on the position assuming the geometry
257 
258  3A. Filter event if a digi at this partition/strip/BX already exists
259  3B. Add to collection
260  */
261 
262  LogDebug("ME0ReDigiProducer::buildDigis") << "Begin building digis."<<std::endl;
264  for (me0dgIt = input_digis.begin(); me0dgIt != input_digis.end();
265  ++me0dgIt){
266 
267  const auto& me0Id = (*me0dgIt).first;
268  LogTrace("ME0ReDigiProducer::buildDigis") << "Starting with roll: "<< me0Id<<std::endl;
269 
270  //setup map for this chamber/eta partition
271  ChamberDigiMap chDigiMap;
272 
273  int newDigiIdx = 0;
274  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
275  for (ME0DigiPreRecoCollection::const_iterator digi = range.first;
276  digi != range.second;digi++) {
277  LogTrace("ME0ReDigiProducer::buildDigis") << std::endl<< "(" <<digi->x() <<","<< digi->y()<<","<<digi->tof()<<","<<digi->pdgid()<<","<<digi->prompt()<<")-> ";
278 
279  //If we don't readout this layer skip
280  if(!layerReadout[me0Id.layer() -1 ]) {
281  output_digimap.insertDigi(me0Id, -1);
282  continue;
283  }
284 
285  //if neutron and we are filtering skip
286  if(!digi->prompt() && neutronAcceptance < 1.0 )
287  if (CLHEP::RandFlat::shoot(engine) > neutronAcceptance){
288  output_digimap.insertDigi(me0Id, -1);
289  continue;
290  }
291 
292  //smear TOF if necessary
293  float tof = digi->tof() + (timeResolution < 0 ? 0.0 : CLHEP::RandGaussQ::shoot(engine, 0, timeResolution));
294 
295  //Values used to fill objet
296  int mapPartIDX = me0Id.roll() -1;
297  int strip = 0;
298  LocalPoint digiLocalPoint;
299  LocalError digiLocalError;
300  if(useBuiltinGeo){
301  getStripProperties(geometry->etaPartition(me0Id),&*digi,tof,strip,digiLocalPoint,digiLocalError);
302  } else {
303  mapPartIDX = getCustomStripProperties(me0Id,&*digi,tof,strip,digiLocalPoint,digiLocalError);
304 
305  }
306 
307  //filter if outside of readout window
308  const int bxIdx = std::round(tof/bxWidth);
309  LogTrace("ME0ReDigiProducer::buildDigis") << tof <<"("<<bxIdx<<") ";
310  if(bxIdx < minBXReadout) {output_digimap.insertDigi(me0Id, -1); continue; }
311  if(bxIdx > maxBXReadout) {output_digimap.insertDigi(me0Id, -1); continue; }
312  tof = bxIdx*bxWidth;
313 
314 
315  //If we are merging check to see if it already exists
316  LogTrace("ME0ReDigiProducer::buildDigis") << "("<<bxIdx<<","<<mapPartIDX<<","<<strip<<") ";
317  if(mergeDigis){
318  int matchIDX = fillDigiMap(chDigiMap, bxIdx,mapPartIDX,strip,newDigiIdx);
319  if(matchIDX >= 0){
320  output_digimap.insertDigi(me0Id, matchIDX);
321  continue;
322  }
323  }
324 
325  //Digis store sigmaX,sigmaY, correlationCoef
326  const float sigmaX = std::sqrt(digiLocalError.xx());
327  const float sigmaY = std::sqrt(digiLocalError.yy());
328  const float corrCoef = digiLocalError.xy() /(sigmaX*sigmaY);
329 
330  //Fill in the new collection
331  ME0DigiPreReco out_digi(digiLocalPoint.x(), digiLocalPoint.y(),
332  sigmaX, sigmaY, corrCoef, tof, digi->pdgid(), digi->prompt());
333  output_digis.insertDigi(me0Id, out_digi);
334 
335  // store index of previous detid and digi
336  output_digimap.insertDigi(me0Id, newDigiIdx);
337  newDigiIdx++;
338 
339  LogTrace("ME0ReDigiProducer::buildDigis") << "("<<digiLocalPoint.x()<<","<<digiLocalPoint.y()<<","<<sigmaX<<","<<sigmaY<<","<< tof<<") ";
340  }
341 
342  chDigiMap.clear();
343 
344 
345  }
346 
347 }
#define LogDebug(id)
float xx() const
Definition: LocalError.h:24
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:63
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
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
std::map< DigiIndicies, unsigned int > ChamberDigiMap
#define LogTrace(id)
std::vector< ME0DigiPreReco >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
T x() const
Definition: PV3DBase.h:62
void getStripProperties(const ME0EtaPartition *etaPart, const ME0DigiPreReco *inDigi, float &tof, int &strip, LocalPoint &digiLocalPoint, LocalError &digiLocalError) const
void ME0ReDigiProducer::fillCentralTOFs ( )
private

Definition at line 349 of file ME0ReDigiProducer.cc.

References Exception, LogDebug, MuonTCMETValueMapProducer_cff::nLayers, and tofs.

Referenced by beginRun().

349  {
350  const auto* mainChamber = geometry->chambers().front();
351  const unsigned int nLayers = mainChamber->nLayers();
352  //Get TOF at center of each partition
353  tofs.clear();
354  tofs.resize(nLayers);
355  LogDebug("ME0ReDigiProducer::fillCentralTOFs()") << "TOF numbers [layer][partition]: " ;
356  for(unsigned int iL = 0; iL < nLayers; ++iL){
357  const auto* layer = mainChamber->layers()[iL];
358  const unsigned int mapLayIDX = layer->id().layer() -1;
359  const unsigned int nPartitions = layer->nEtaPartitions();
360  if(!nPartitions)
361  throw cms::Exception("Setup") << "ME0ReDigiProducer::fillCentralTOFs() - ME0Layer has no partitions.";
362  tofs[mapLayIDX].resize(nPartitions);
363  for(unsigned int iP = 0; iP < nPartitions; ++iP){
364  const unsigned int mapPartIDX = layer->etaPartitions()[iP]->id().roll() -1;
365  const GlobalPoint centralGP(layer->etaPartitions()[iP]->position());
366  tofs[mapLayIDX][mapPartIDX] = (centralGP.mag() / (CLHEP::c_light/CLHEP::cm)); //speed of light [cm/ns]
367  LogDebug("ME0ReDigiProducer::fillCentralTOFs()") << "["<<mapLayIDX<<"]["<<mapPartIDX<<"]="<< tofs[mapLayIDX][mapPartIDX] <<" "<<std::endl;
368  }
369  }
370 }
#define LogDebug(id)
std::vector< std::vector< double > > tofs
unsigned int ME0ReDigiProducer::fillDigiMap ( ChamberDigiMap chDigiMap,
unsigned int  bx,
unsigned int  part,
unsigned int  strip,
unsigned int  currentIDX 
) const
private

Definition at line 410 of file ME0ReDigiProducer.cc.

Referenced by buildDigis().

410  {
411  DigiIndicies newIDX(bx,part,strip);
412  auto it1 = chDigiMap.find(newIDX);
413  if (it1 == chDigiMap.end()){
414  chDigiMap[newIDX] = currentIDX;
415  return -1;
416  }
417  return it1->second;
418 }
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 371 of file ME0ReDigiProducer.cc.

References ME0ReDigiProducer::TemporaryGeometry::findEtaPartition(), objects.autophobj::float, 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().

371  {
372  const unsigned int partIdx = tempGeo->findEtaPartition(inDigi->y());
373  LogTrace("ME0ReDigiProducer::buildDigis") << partIdx <<" ";
374  const float partMeanTof = tempGeo->getCentralTOF(detId,partIdx);
375 
376  //convert to relative to partition
377  tof -= partMeanTof;
378 
379  //get coordinates and errors
380  const float partCenter = tempGeo->getPartCenter(partIdx);
381  const auto* topo = tempGeo->getTopo(partIdx);
382 
383  //find channel
384  const LocalPoint partLocalPoint(inDigi->x(), inDigi->y() - partCenter ,0.);
385  strip = topo->channel(partLocalPoint);
386  const float stripF = float(strip)+0.5;
387 
388  //get digitized location
389  LocalPoint digiPartLocalPoint = topo->localPosition(stripF);
390  digiLocalError = topo->localError(stripF, 1./sqrt(12.)); //std dev. flat distribution with length L is L/sqrt(12). The strip topology expects the error in units of strips.
391  digiLocalPoint = LocalPoint(digiPartLocalPoint.x(),digiPartLocalPoint.y() + partCenter,0.0);
392  return partIdx;
393 
394 
395 }
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
float y() const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
float getCentralTOF(const ME0DetId &me0Id, unsigned int partIdx) const
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
#define LogTrace(id)
unsigned int findEtaPartition(float locY) const
float getPartCenter(const unsigned int partIdx) const
TemporaryGeometry * tempGeo
float x() const
T x() const
Definition: PV3DBase.h:62
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 396 of file ME0ReDigiProducer.cc.

References Topology::channel(), objects.autophobj::float, ME0EtaPartition::id(), ME0DetId::layer(), StripTopology::localError(), StripTopology::localPosition(), ME0DetId::roll(), ME0EtaPartition::specificTopology(), mathSSE::sqrt(), tofs, ME0DigiPreReco::x(), and ME0DigiPreReco::y().

Referenced by buildDigis().

396  {
397  //convert to relative to partition
398  tof -= tofs[etaPart->id().layer()-1][etaPart->id().roll() -1];
399 
400  //find channel
401  const LocalPoint partLocalPoint(inDigi->x(), inDigi->y(),0.);
402  strip = etaPart->specificTopology().channel(partLocalPoint);
403  const float stripF = float(strip)+0.5;
404 
405  //get digitized location
406  digiLocalPoint = etaPart->specificTopology().localPosition(stripF);
407  digiLocalError = etaPart->specificTopology().localError(stripF, 1./sqrt(12.));
408 }
const StripTopology & specificTopology() const
float y() const
virtual LocalError localError(float strip, float stripErr2) const =0
virtual LocalPoint localPosition(float strip) const =0
T sqrt(T t)
Definition: SSEVec.h:18
ME0DetId id() const
virtual int channel(const LocalPoint &p) const =0
float x() const
int roll() const
Definition: ME0DetId.h:62
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:56
void ME0ReDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 219 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.

220 {
222  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
223 
225  e.getByToken(token, input_digis);
226 
227  std::unique_ptr<ME0DigiPreRecoCollection> output_digis(new ME0DigiPreRecoCollection());
228  std::unique_ptr<ME0DigiPreRecoMap> output_digimap(new ME0DigiPreRecoMap());
229 
230  // build the digis
231  buildDigis(*(input_digis.product()),
232  *output_digis,
233  *output_digimap,
234  engine);
235 
236  // store them in the event
237  e.put(std::move(output_digis));
238  e.put(std::move(output_digimap));
239 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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, int > ME0DigiPreRecoMap
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
T const * product() const
Definition: Handle.h:81
StreamID streamID() const
Definition: Event.h:81
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const float ME0ReDigiProducer::bxWidth
private

Definition at line 82 of file ME0ReDigiProducer.h.

Referenced by buildDigis().

const ME0Geometry* ME0ReDigiProducer::geometry
private
std::vector<int> ME0ReDigiProducer::layerReadout
private

Definition at line 90 of file ME0ReDigiProducer.h.

Referenced by beginRun(), and buildDigis().

int ME0ReDigiProducer::maxBXReadout
private

Definition at line 89 of file ME0ReDigiProducer.h.

Referenced by buildDigis().

bool ME0ReDigiProducer::mergeDigis
private

Definition at line 91 of file ME0ReDigiProducer.h.

Referenced by buildDigis().

int ME0ReDigiProducer::minBXReadout
private

Definition at line 88 of file ME0ReDigiProducer.h.

Referenced by buildDigis().

double ME0ReDigiProducer::neutronAcceptance
private

Definition at line 86 of file ME0ReDigiProducer.h.

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 87 of file ME0ReDigiProducer.h.

Referenced by buildDigis().

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

Definition at line 97 of file ME0ReDigiProducer.h.

Referenced by fillCentralTOFs(), and getStripProperties().

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

Definition at line 92 of file ME0ReDigiProducer.h.

Referenced by produce().

bool ME0ReDigiProducer::useBuiltinGeo
private

Definition at line 94 of file ME0ReDigiProducer.h.

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

bool ME0ReDigiProducer::useCusGeoFor1PartGeo
private

Definition at line 83 of file ME0ReDigiProducer.h.

Referenced by beginRun(), and ME0ReDigiProducer().