8 #ifndef GAR_READOUTSIMULATION_SIPMREADOUT 9 #define GAR_READOUTSIMULATION_SIPMREADOUT 25 #include "cetlib_except/exception.h" 30 #include "nurandom/RandomUtils/NuRandomService.h" 33 #include "Utilities/AssociationUtil.h" 39 #include "CoreUtils/ServiceUtil.h" 101 fGeo = gar::providerFrom<geo::GeometryGAr>();
106 consumes< std::vector<sdp::CaloDeposit> >(tag);
130 if(ROAlgName.compare(
"Standard_ECAL") == 0) {
131 fROSimAlg = std::make_unique<gar::rosim::ECALReadoutSimStandardAlg>(
fEngine, ROAlgPars);
133 else if(ROAlgName.compare(
"Standard_MuID") == 0) {
134 fROSimAlg = std::make_unique<gar::rosim::MuIDReadoutSimStandardAlg>(
fEngine, ROAlgPars);
138 <<
"Unable to determine which readout simulation algorithm to use, bail";
150 std::vector< art::Ptr<sdp::CaloDeposit> > artHits;
154 std::map<raw::CellID_t, std::vector< art::Ptr<sdp::CaloDeposit> > > m_cIDMapArtPtrVec = this->
MakeCellIDMapArtPtr(artHits);
163 std::vector< raw::CaloRawDigit* > digiVec =
fROSimAlg->GetDigitizedHits();
166 std::unique_ptr< std::vector<raw::CaloRawDigit> > digitCol (
new std::vector<raw::CaloRawDigit>);
171 for(
auto const &it : digiVec)
173 digitCol->emplace_back(*it);
176 std::vector< art::Ptr<sdp::CaloDeposit> > simPtrVec = m_cIDMapArtPtrVec[it->CellID()];
177 for(
auto hitpointer : simPtrVec)
178 DigiSimHitsAssns->addSingle(digiPtr, hitpointer);
191 auto theHits = evt.
getHandle< std::vector<sdp::CaloDeposit> >(itag);
195 for (
unsigned int i = 0; i < theHits->size(); ++i)
198 hitVector.push_back(hit);
205 std::map<raw::CellID_t, std::vector< art::Ptr<sdp::CaloDeposit> > > cIDMapArtPtrVec;
212 if( cIDMapArtPtrVec.count(hit->
CellID()) == 0 )
214 std::vector< art::Ptr<sdp::CaloDeposit> > vecArtPtr;
215 vecArtPtr.push_back(hitPtr);
216 cIDMapArtPtrVec.insert( std::make_pair(hit->
CellID(), vecArtPtr) );
220 cIDMapArtPtrVec[hit->
CellID()].push_back(hitPtr);
224 return cIDMapArtPtrVec;
236 #endif // GAR_READOUTSIMULATION_SIPMREADOUT base_engine_t & createEngine(seed_t seed)
std::string fG4Label
label of G4 module
Handle< PROD > getHandle(SelectorBase const &) const
Runs simulation including smearing of energy and SiPM saturation for the ECAL readout.
EDProducer(fhicl::ParameterSet const &pset)
CLHEP::HepRandomEngine & fEngine
random engine
SiPMReadout(fhicl::ParameterSet const &pset)
Standard constructor and destructor for an FMWK module.
std::map< raw::CellID_t, std::vector< art::Ptr< sdp::CaloDeposit > > > MakeCellIDMapArtPtr(std::vector< art::Ptr< sdp::CaloDeposit > > &hitVector)
const std::string instance
Description of geometry of one entire detector.
const gar::geo::GeometryCore * fGeo
geometry information
void CollectHits(const art::Event &evt, const std::string &label, const std::string &instance, std::vector< art::Ptr< sdp::CaloDeposit > > &hitVector)
#define DEFINE_ART_MODULE(klass)
void produce(::art::Event &evt) override
T get(std::string const &key) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition of basic calo raw digits.
raw::CellID_t const & CellID() const
std::string fInstanceLabelName
product instance name
Detector simulation of raw signals on wires.
General GArSoft Utilities.
std::unique_ptr< SiPMReadoutSimAlg > fROSimAlg
algorithm to simulate the electronics
art framework interface to geometry description
SiPMReadout & operator=(SiPMReadout const &)=delete
void reconfigure(fhicl::ParameterSet const &pset)
cet::coded_exception< error, detail::translate > exception