4 #include "CLHEP/Random/RandFlat.h"
5 #include "CLHEP/Random/RandPoissonQ.h"
14 : theHitReader(nullptr),
15 theLuminosity(pset.getParameter<double>(
"luminosity")),
16 theStartTime(pset.getParameter<double>(
"startTime")),
17 theEndTime(pset.getParameter<double>(
"endTime")),
18 theEventOccupancy(pset.getParameter<
vector<double> >(
"eventOccupancy"))
26 if (reader ==
"ASCII") {
28 }
else if (reader ==
"ROOT") {
38 CLHEP::HepRandomEngine* engine) {
42 CLHEP::RandPoissonQ randPoissonQ(*engine, meanNumberOfEvents);
43 int nEventsToAdd = randPoissonQ.fire();
49 for (
int i = 0;
i < nEventsToAdd; ++
i) {
52 vector<PSimHit> neutronHits;
55 for (vector<PSimHit>::const_iterator neutronHitItr = neutronHits.begin(); neutronHitItr != neutronHits.end();
57 const PSimHit& rawHit = *neutronHitItr;
63 rawHit.
tof() + timeOffset,
72 result.push_back(
hit);
std::vector< double > theEventOccupancy
float tof() const
deprecated name for timeOfFlight()
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static std::string const input
SubsystemNeutronReader(const edm::ParameterSet &pset)
std::vector< int > theChambersDone
just makes sure chambers aren't done twice
Local3DPoint exitPoint() const
Exit point in the local Det frame.
NeutronReader * theHitReader
virtual ~SubsystemNeutronReader()
void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer &result, CLHEP::HepRandomEngine *)
virtual int detId(int chamberIndex, int localDetId)=0
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
float theEventsInWindow
how many collsions happened between theStartTime and theEndTime
T getParameter(std::string const &) const
unsigned short processType() const
virtual void readNextEvent(int chamberType, edm::PSimHitContainer &result)=0
float energyLoss() const
The energy deposit in the PSimHit, in ???.
unsigned int trackId() const
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
std::vector< PSimHit > PSimHitContainer
Local3DPoint entryPoint() const
Entry point in the local Det frame.
float theLuminosity
in units of 10**34, set by Muon:NeutronLuminosity
unsigned int detUnitId() const