CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/SimMuon/Neutron/interface/SubsystemNeutronWriter.h

Go to the documentation of this file.
00001 #ifndef SubsystemNeutronWriter_h
00002 #define SubsystemNeutronWriter_h
00003 
00015 #include <vector>
00016 #include <map>
00017 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00018 #include "FWCore/Framework/interface/EDProducer.h"
00019 #include "FWCore/Utilities/interface/InputTag.h"
00020 #include "CLHEP/Random/RandFlat.h"
00021 
00022 
00023 class NeutronWriter;
00024 
00026 class SubsystemNeutronWriter : public edm::EDProducer
00027 {
00028 public:
00029 
00030   explicit SubsystemNeutronWriter(edm::ParameterSet const& pset);
00031 
00033   virtual ~SubsystemNeutronWriter();
00034 
00035   void printStats();
00036 
00037   virtual void produce(edm::Event & e, edm::EventSetup const& c);
00038 
00039   virtual int localDetId(int globalDetId) const = 0;
00040 
00041   virtual int chamberType(int globalDetId) const = 0;
00042 
00043   virtual int chamberId(int globalDetId) const = 0;
00044 
00046   virtual bool accept(const edm::PSimHitContainer & cluster) const = 0;
00047 
00049   void initialize(int chamberType);
00050 
00051 protected:
00052 
00053 
00054   virtual void writeHits(int chamberType, edm::PSimHitContainer & chamberHits);
00055 
00056   void writeCluster(int chamberType, const edm::PSimHitContainer & cluster);
00057 
00059   void adjust(PSimHit & h, float timeOffset, float smearing);
00060 
00062   void updateCount(int chamberType);
00063 
00064 private:
00065   NeutronWriter * theHitWriter;
00066   CLHEP::RandFlat * theRandFlat;
00067   edm::InputTag theInputTag;
00068   double theNeutronTimeCut;
00069   double theTimeWindow;
00070   double theT0;
00071   int theNEvents;
00072   bool initialized;
00073   // true means to translate DetId into just layer number, e.g., 1-6 in CSC
00074   bool useLocalDetId_;
00075   std::map<int, int> theCountPerChamberType;
00076 };
00077 
00078 #endif
00079