CMS 3D CMS Logo

ME0ReDigiProducer.h
Go to the documentation of this file.
1 #ifndef SimMuon_GEMDigitizer_ME0ReDigiProducer_h
2 #define SimMuon_GEMDigitizer_ME0ReDigiProducer_h
3 
4 /*
5  * This module smears and discretizes the timing and position of the
6  * ME0 pseudo digis.
7  */
8 
15 #include <string>
16 
17 class ME0Geometry;
18 class ME0EtaPartition;
20 class LocalError;
21 class LocalTag;
22 template<typename t1, typename t2> class Point3DBase;
24 
25 namespace CLHEP {
26  class HepRandomEngine;
27 }
28 
30 {
31 private:
32  //Class used to define custom geometry, if required
33  //assume that all ME0 chambers have the same dimension
34  //and for the same layer have the same radial and Z position
35  //Good for now, can build in support for more varied geos later
36  //if necessary
38  public:
39  TemporaryGeometry(const ME0Geometry* geometry, const unsigned int numberOfStrips, const unsigned int numberOfPartitions);
41  unsigned int findEtaPartition(float locY) const;
42  const TrapezoidalStripTopology * getTopo(const unsigned int partIdx) const {return stripTopos[partIdx];}
43  float getPartCenter(const unsigned int partIdx) const; //position of part. in chamber
44  float getCentralTOF(const ME0DetId& me0Id, unsigned int partIdx) const {return tofs[me0Id.layer() -1 ][partIdx];} //in detId layer numbers stat at 1
45  unsigned int numLayers() const {return tofs.size();}
46  private:
47  TrapezoidalStripTopology * buildTopo(const std::vector<float>& _p) const;
48  private:
49  float middleDistanceFromBeam; // radiusOfMainPartitionInCenter;
50  std::vector<TrapezoidalStripTopology * > stripTopos; // vector of Topos, one for each part
51  std::vector<std::vector<double> > tofs ; //TOF to center of the partition: [layer][part]
52  std::vector<float> partitionTops; //Top of each partition in the chamber's local coords
53 
54  };
55 public:
56 
57  explicit ME0ReDigiProducer(const edm::ParameterSet& ps);
58 
59  virtual ~ME0ReDigiProducer();
60 
61  virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
62 
63  virtual void produce(edm::Event&, const edm::EventSetup&) override;
64 
65 
66  void buildDigis(const ME0DigiPreRecoCollection &,
69  CLHEP::HepRandomEngine* engine);
70 
71 private:
72  void fillCentralTOFs();
73  void getStripProperties(const ME0EtaPartition* etaPart, const ME0DigiPreReco* inDigi, float& tof,int& strip, LocalPoint& digiLocalPoint, LocalError& digiLocalError) const;
74  int getCustomStripProperties(const ME0DetId& detId, const ME0DigiPreReco* inDigi, float& tof,int& strip, LocalPoint& digiLocalPoint, LocalError& digiLocalError) const;
75 
76  typedef std::tuple<unsigned int, unsigned int, unsigned int> DigiIndicies;
77  typedef std::map<DigiIndicies,unsigned int> ChamberDigiMap;
78  //fills map...returns -1 if digi is not already in the map
79  unsigned int fillDigiMap(ChamberDigiMap& chDigiMap, unsigned int bx, unsigned int part, unsigned int strip, unsigned int currentIDX) const;
80 
81  //paramters
82  const float bxWidth; // ns
83  bool useCusGeoFor1PartGeo ; //Use custom strips and partitions for digitization for single partition geometry
84  bool usePads ; //sets strip granularity to x2 coarser
85  unsigned int numberOfStrips ; // Custom number of strips per partition
86  unsigned int numberOfPartitions; // Custom number of partitions per chamber
87  double neutronAcceptance ; // fraction of neutron events to keep in event (>= 1 means no filtering)
88  double timeResolution ; // smear time by gaussian with this sigma (in ns)....negative for no smearing
89  int minBXReadout ; // Minimum BX to readout
90  int maxBXReadout ; // Maximum BX to readout
91  std::vector<int> layerReadout ; // Don't readout layer if entry is 0 (Layer number 1 in the numbering scheme is idx 0)
92  bool mergeDigis ; // Keep only one digi at the same chamber, strip, partition, and BX
94 
98  std::vector<std::vector<double> > tofs ; //used for built in geo
99 
100 
101 };
102 
103 #endif
std::vector< std::vector< double > > tofs
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
const ME0Geometry * geometry
float getCentralTOF(const ME0DetId &me0Id, unsigned int partIdx) const
edm::EDGetTokenT< ME0DigiPreRecoCollection > token
std::vector< int > layerReadout
std::tuple< unsigned int, unsigned int, unsigned int > DigiIndicies
std::vector< TrapezoidalStripTopology * > stripTopos
std::map< DigiIndicies, unsigned int > ChamberDigiMap
TemporaryGeometry * tempGeo
part
Definition: HCALResponse.h:20
unsigned int numberOfPartitions
unsigned int numberOfStrips
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
const TrapezoidalStripTopology * getTopo(const unsigned int partIdx) const
Definition: Run.h:42