318 auto const*
geo = lar::providerFrom<geo::Geometry>();
323 auto SignTrue =
evt.getHandle< std::vector<simb::MCTruth> >(
fSIGNLabel);
325 art::FindManyP<simb::MCParticle> SignAssn(SignTrue,
evt,
fGEANTLabel);
333 auto Ar39True =
evt.getHandle< std::vector<simb::MCTruth> >(
fAr39Label);
335 art::FindManyP<simb::MCParticle> Ar39Assn(Ar39True,
evt,
fGEANTLabel);
341 auto NeutTrue =
evt.getHandle< std::vector<simb::MCTruth> >(
fNeutLabel);
343 art::FindManyP<simb::MCParticle> NeutAssn(NeutTrue,
evt,
fGEANTLabel);
349 auto KrypTrue =
evt.getHandle< std::vector<simb::MCTruth> >(
fKrypLabel);
351 art::FindManyP<simb::MCParticle> KrypAssn(KrypTrue,
evt,
fGEANTLabel);
357 auto RdonTrue =
evt.getHandle< std::vector<simb::MCTruth> >(
fRdonLabel);
359 art::FindManyP<simb::MCParticle> RdonAssn(RdonTrue,
evt,
fGEANTLabel);
365 auto Ar42True =
evt.getHandle< std::vector<simb::MCTruth> >(
fAr42Label);
367 art::FindManyP<simb::MCParticle> Ar42Assn(Ar42True,
evt,
fGEANTLabel);
373 std::vector<simb::MCParticle> allTruthParts;
375 allTruthParts.push_back(it.second);
377 allTruthParts.push_back(it.second);
379 allTruthParts.push_back(it.second);
381 allTruthParts.push_back(it.second);
383 allTruthParts.push_back(it.second);
385 allTruthParts.push_back(it.second);
387 std::map<PType, std::map< int, simb::MCParticle >&> PTypeToMap{
396 std::map<PType,std::set<int>> PTypeToTrackID;
398 for(
auto const& it : PTypeToMap){
400 auto const&
m=it.second;
401 for(
auto const& it2 :
m){
403 PTypeToTrackID[
p].insert(it2.first);
411 std::vector<art::Ptr<recob::OpHit> > ophitlist;
412 std::map<PType, std::vector<art::Ptr<recob::OpHit> > > map_of_ophit;
418 std::cout <<
"There are " << ophitlist.size() <<
" optical hits in the event." <<
std::endl;
420 for(
size_t i = 0; i < ophitlist.size(); ++i)
428 std::sort(vec_tracksdp.begin(), vec_tracksdp.end(),
431 for (
size_t iSDP=0; iSDP<vec_tracksdp.size(); ++iSDP) {
438 if (vec_tracksdp.size()>0){
454 map_of_ophit[
gen].push_back(ophitlist.at(i));
456 double xyz_optdet[3]={0,0,0};
457 double xyz_world [3]={0,0,0};
459 geo->OpDetGeoFromOpChannel(ophitlist[i]->
OpChannel()).LocalToWorld(xyz_optdet,xyz_world);
474 std::cerr <<
" - Othe : " << map_of_ophit[
kUnknown].size() <<
" opt hits" <<
std::endl;
483 mf::LogWarning(
"DualPhaseOpHitDumperModule") <<
"Requested to save optical hits, but cannot load any ophits";
Index OpChannel(Index detNum, Index channel)
std::map< int, simb::MCParticle > RdonParts
art::ServiceHandle< cheat::ParticleInventoryService > pi_serv
std::vector< double > PDS_OpHit_Width
std::vector< int > PDS_OpHit_OpChannel
std::vector< int > True_Bck_Mode
std::vector< double > PDS_OpHit_Z
std::vector< int > PDS_OpHit_True_GenType
std::vector< double > PDS_OpHit_PeakTime
void FillTruth(const art::FindManyP< simb::MCParticle > Assn, const art::Handle< std::vector< simb::MCTruth >> &Hand, const PType type)
std::vector< unsigned short > PDS_OpHit_Frame
std::vector< double > PDS_OpHit_True_Energy
double Width(Resonance_t res)
resonance width (GeV)
std::map< int, simb::MCParticle > Ar42Parts
std::vector< double > PDS_OpHit_Amplitude
std::vector< double > PDS_OpHit_Area
std::map< int, simb::MCParticle > NeutParts
art::ServiceHandle< cheat::PhotonBackTrackerService > pbt_serv
std::vector< int > PDS_OpHit_True_IndexAll
simb::MCParticle TrackIdToParticle(int const id) const
std::map< int, simb::MCParticle > SignParts
std::vector< int > PDS_OpHit_True_TrackIDAll
std::vector< double > PDS_OpHit_FastToTotal
float energyFrac
fraction of OpHit energy from the particle with this trackID
std::vector< sim::TrackSDP > OpHitToTrackSDPs(art::Ptr< recob::OpHit > const &opHit_P)
std::vector< double > PDS_OpHit_True_EnergyAll
Ionization photons from a Geant4 track.
std::vector< int > PDS_OpHit_True_TrackID
std::string fOpHitModuleLabel
std::vector< double > PDS_OpHit_PeakTimeAbs
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void FillMyMaps(std::map< int, simb::MCParticle > &MyMap, art::FindManyP< simb::MCParticle > Assn, art::Handle< std::vector< simb::MCTruth > > Hand, std::map< int, int > *indexMap=nullptr)
PType WhichParType(int TrID)
std::vector< double > PDS_OpHit_PE
std::vector< double > PDS_OpHit_X
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
LArSoft geometry interface.
std::map< int, simb::MCParticle > KrypParts
std::map< int, simb::MCParticle > Ar39Parts
std::vector< int > PDS_OpHit_True_GenTypeAll
QTextStream & endl(QTextStream &s)
std::map< int, PType > trkIDToPType
std::vector< double > PDS_OpHit_Y