175 std::cout <<
"IonAndScint Module Producer" <<
std::endl;
177 std::vector<art::Handle<SimEnergyDepositCollection>> edepHandle =
inputCollections(event);
179 if (
empty(edepHandle)) {
180 std::cout <<
"IonAndScint Module Cannot Retrive SimEnergyDeposit" <<
std::endl;
184 auto sce = lar::providerFrom<spacecharge::SpaceChargeService>();
188 auto simedep = std::make_unique<std::vector<sim::SimEnergyDeposit>>();
189 auto simedep1 = std::make_unique<std::vector<sim::SimEnergyDeposit>>();
190 for (
auto edeps : edepHandle) {
192 if (!edeps.isValid()) {
193 std::cout <<
"!edeps.isValid()" <<
std::endl;
197 auto index = std::find(
200 std::cout <<
"Skip SimEnergyDeposit in: " << edeps.provenance()->productInstanceName()
205 std::cout <<
"SimEnergyDeposit input module: " << edeps.provenance()->moduleLabel()
206 <<
", instance name: " << edeps.provenance()->productInstanceName() <<
std::endl;
209 auto const isCalcData =
fISAlg->CalcIonAndScint(detProp, edepi);
211 int ph_num = round(isCalcData.numPhotons);
212 int ion_num = round(isCalcData.numElectrons);
213 float scintyield = isCalcData.scintillationYieldRatio;
214 float edep_tmp = edepi.Energy();
217 double startTime_tmp = edepi.StartT();
218 double endTime_tmp = edepi.EndT();
219 int trackID_tmp = edepi.TrackID();
220 int pdgCode_tmp = edepi.PdgCode();
222 if (
sce->EnableSimSpatialSCE()) {
223 auto posOffsetsStart =
224 sce->GetPosOffsets({edepi.StartX(), edepi.StartY(), edepi.StartZ()});
225 auto posOffsetsEnd =
sce->GetPosOffsets({edepi.EndX(), edepi.EndY(), edepi.EndZ()});
228 (
float)(edepi.StartY() + posOffsetsStart.Y()),
229 (
float)(edepi.StartZ() + posOffsetsStart.Z())};
232 (
float)(edepi.EndY() + posOffsetsEnd.Y()),
233 (
float)(edepi.EndZ() + posOffsetsEnd.Z())};
236 simedep->emplace_back(ph_num,
248 simedep1->emplace_back(ph_num,
std::vector< string > instanceNames
std::vector< art::Handle< SimEnergyDepositCollection > > inputCollections(art::Event const &) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Energy deposition in the active material.
std::unique_ptr< ISCalc > fISAlg
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
QTextStream & endl(QTextStream &s)