Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:15

0001 #ifndef SimMuon_GEMDigitizer_ME0DigiModel_h
0002 #define SimMuon_GEMDigitizer_ME0DigiModel_h
0003 
0004 /** 
0005  *  \class ME0DigiModel
0006  *
0007  *  Base Class for the ME0 strip response simulation 
0008  *  
0009  *  \author Roumyana Hadjiiska
0010  */
0011 
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "DataFormats/GEMDigi/interface/ME0DigiCollection.h"
0015 #include "DataFormats/Common/interface/DetSet.h"
0016 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0017 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
0018 #include "SimDataFormats/GEMDigiSimLink/interface/ME0DigiSimLink.h"
0019 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
0020 
0021 #include <map>
0022 #include <set>
0023 
0024 namespace CLHEP {
0025   class HepRandomEngine;
0026 }
0027 
0028 class ME0EtaPartition;
0029 class ME0Geometry;
0030 class PSimHit;
0031 
0032 class ME0DigiModel {
0033 public:
0034   typedef edm::DetSet<StripDigiSimLink> StripDigiSimLinks;
0035   typedef edm::DetSet<ME0DigiSimLink> ME0DigiSimLinks;
0036 
0037   virtual ~ME0DigiModel() {}
0038 
0039   void setGeometry(const ME0Geometry* geom) { geometry_ = geom; }
0040 
0041   const ME0Geometry* getGeometry() { return geometry_; }
0042 
0043   virtual void simulateSignal(const ME0EtaPartition*, const edm::PSimHitContainer&, CLHEP::HepRandomEngine* engine) = 0;
0044 
0045   virtual void simulateNoise(const ME0EtaPartition*, CLHEP::HepRandomEngine* engine) = 0;
0046 
0047   virtual std::vector<std::pair<int, int> > simulateClustering(const ME0EtaPartition*,
0048                                                                const PSimHit*,
0049                                                                const int,
0050                                                                CLHEP::HepRandomEngine* engine) = 0;
0051 
0052   void fillDigis(int rollDetId, ME0DigiCollection&);
0053 
0054   virtual void setup() = 0;
0055 
0056   const StripDigiSimLinks& stripDigiSimLinks() const { return stripDigiSimLinks_; }
0057   const ME0DigiSimLinks& me0DigiSimLinks() const { return theME0DigiSimLinks_; }
0058 
0059 protected:
0060   ME0DigiModel(const edm::ParameterSet&) {}
0061 
0062   const ME0Geometry* geometry_;
0063 
0064   std::set<std::pair<int, int> > strips_;
0065 
0066   /// creates links from Digi to SimTrack
0067   void addLinks(unsigned int strip, int bx);
0068   void addLinksWithPartId(unsigned int strip, int bx);
0069 
0070   // keeps track of which hits contribute to which channels
0071   typedef std::multimap<std::pair<unsigned int, int>, const PSimHit*, std::less<std::pair<unsigned int, int> > >
0072       DetectorHitMap;
0073 
0074   DetectorHitMap detectorHitMap_;
0075   StripDigiSimLinks stripDigiSimLinks_;
0076   ME0DigiSimLinks theME0DigiSimLinks_;
0077 };
0078 #endif