Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:48

0001 #ifndef SimMuon_Neutron_SubsystemNeutronReader_h
0002 #define SimMuon_Neutron_SubsystemNeutronReader_h
0003 /**
0004  \author Rick Wilkinson
0005   Reads neutron events from a database
0006  */
0007 
0008 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0011 
0012 #include <vector>
0013 
0014 class NeutronReader;
0015 
0016 namespace CLHEP {
0017   class HepRandomEngine;
0018 }
0019 
0020 class SubsystemNeutronReader {
0021 public:
0022   /// the hits will be distributed flat in time between startTime and endTime
0023   /// eventOccupancy is the expected chamber occupancy from a single
0024   /// min bias event for each chamber type
0025   SubsystemNeutronReader(const edm::ParameterSet& pset);
0026   virtual ~SubsystemNeutronReader();
0027 
0028   /// this class makes sure the same chamberIndex isn't called twice
0029   /// for an event
0030   void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer& result, CLHEP::HepRandomEngine*);
0031 
0032   void clear() { theChambersDone.clear(); }
0033 
0034 protected:
0035   /// detector-specific way to get the global detector
0036   /// ID, given the local one.
0037   virtual int detId(int chamberIndex, int localDetId) = 0;
0038 
0039 private:
0040   NeutronReader* theHitReader;
0041 
0042   /// just makes sure chambers aren't done twice
0043   std::vector<int> theChambersDone;
0044 
0045   /// in units of 10**34, set by Muon:NeutronLuminosity
0046   float theLuminosity;
0047   float theStartTime;
0048   float theEndTime;
0049   /// how many collsions happened between theStartTime and theEndTime
0050   float theEventsInWindow;
0051 
0052   std::vector<double> theEventOccupancy;  // Placed here so ctor init list order OK
0053 };
0054 
0055 #endif