Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RPCDigitizer_RPCSim_h
0002 #define RPCDigitizer_RPCSim_h
0003 
0004 /** \class RPCSim
0005  *   Base Class for the RPC strip response simulation
0006  *  
0007  *  \author Marcello Maggi -- INFN Bari
0008  */
0009 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0010 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 
0014 #include <map>
0015 #include <set>
0016 
0017 #include "DataFormats/Common/interface/DetSet.h"
0018 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
0019 #include "SimDataFormats/RPCDigiSimLink/interface/RPCDigiSimLink.h"
0020 
0021 class RPCRoll;
0022 class RPCGeometry;
0023 class RPCSimSetUp;
0024 class PSimHit;
0025 
0026 namespace CLHEP {
0027   class HepRandomEngine;
0028 }
0029 
0030 class RPCSim {
0031 public:
0032   typedef edm::DetSet<StripDigiSimLink> DigiSimLinks;
0033   typedef edm::DetSet<RPCDigiSimLink> RPCDigiSimLinks;
0034 
0035   virtual ~RPCSim(){};
0036 
0037   virtual void simulate(const RPCRoll* roll, const edm::PSimHitContainer& rpcHits, CLHEP::HepRandomEngine*) = 0;
0038 
0039   virtual void simulateNoise(const RPCRoll* roll, CLHEP::HepRandomEngine*) = 0;
0040 
0041   virtual void fillDigis(int rollDetId, RPCDigiCollection& digis);
0042 
0043   void setRPCSimSetUp(RPCSimSetUp* setup) { theSimSetUp = setup; }
0044 
0045   RPCSimSetUp* getRPCSimSetUp() { return theSimSetUp; }
0046 
0047   const DigiSimLinks& digiSimLinks() const { return theDigiSimLinks; }
0048   const RPCDigiSimLinks& rpcDigiSimLinks() const { return theRpcDigiSimLinks; }
0049 
0050 protected:
0051   RPCSim(const edm::ParameterSet& config);
0052   virtual void init() = 0;
0053 
0054 protected:
0055   std::set<std::pair<int, int> > strips;
0056   std::set<RPCDigi> irpc_digis;
0057 
0058   //--------NEW---------------------
0059 
0060   /// creates links from Digi to SimTrack
0061   /// disabled for now
0062   virtual void addLinks(unsigned int strip, int bx);
0063 
0064   // keeps track of which hits contribute to which channels
0065   typedef std::multimap<std::pair<unsigned int, int>, const PSimHit*, std::less<std::pair<unsigned int, int> > >
0066       DetectorHitMap;
0067 
0068   DetectorHitMap theDetectorHitMap;
0069   DigiSimLinks theDigiSimLinks;
0070   RPCDigiSimLinks theRpcDigiSimLinks;
0071   //--------------------------------
0072 
0073 protected:
0074   RPCSimSetUp* theSimSetUp;
0075 };
0076 #endif