404 auto reco_hits =
evt.getValidHandle<std::vector<recob::Hit> >(
fHitLabel);
407 auto MarlTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fMARLLabel);
408 std::cout <<
"MarlTrue.size()=" << MarlTrue->size() <<
std::endl;
409 art::FindManyP<simb::MCParticle> MarlAssn(MarlTrue,
evt,
fGEANTLabel);
415 auto APATrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAPALabel);
416 art::FindManyP<simb::MCParticle> APAAssn(APATrue,
evt,
fGEANTLabel);
422 auto CPATrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fCPALabel);
423 art::FindManyP<simb::MCParticle> CPAAssn(CPATrue,
evt,
fGEANTLabel);
429 auto Ar39True =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAr39Label);
430 art::FindManyP<simb::MCParticle> Ar39Assn(Ar39True,
evt,
fGEANTLabel);
436 auto Ar42True =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAr42Label);
437 art::FindManyP<simb::MCParticle> Ar42Assn(Ar42True,
evt,
fGEANTLabel);
443 auto NeutTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fNeutLabel);
444 art::FindManyP<simb::MCParticle> NeutAssn(NeutTrue,
evt,
fGEANTLabel);
450 auto KrypTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fKrypLabel);
451 art::FindManyP<simb::MCParticle> KrypAssn(KrypTrue,
evt,
fGEANTLabel);
457 auto PlonTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fPlonLabel);
458 art::FindManyP<simb::MCParticle> PlonAssn(PlonTrue,
evt,
fGEANTLabel);
464 auto RdonTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fRdonLabel);
465 art::FindManyP<simb::MCParticle> RdonAssn(RdonTrue,
evt,
fGEANTLabel);
470 std::map<PType, std::map< int, simb::MCParticle >&> PTypeToMap{
482 for(
auto const& it : PTypeToMap){
487 auto const&
m=it.second;
488 for(
auto const& it2 : m){
495 mf::LogDebug(
"DAQSimAna") <<
"There are a total of " << PartList.size() <<
" MCParticles in the event ";
500 std::vector< recob::Hit > ColHits_Marl;
501 std::vector< recob::Hit > ColHits_CPA;
502 std::vector< recob::Hit > ColHits_APA;
503 std::vector< recob::Hit > ColHits_Ar39;
504 std::vector< recob::Hit > ColHits_Ar42;
505 std::vector< recob::Hit > ColHits_Neut;
506 std::vector< recob::Hit > ColHits_Kryp;
507 std::vector< recob::Hit > ColHits_Plon;
508 std::vector< recob::Hit > ColHits_Rdon;
509 std::vector< recob::Hit > ColHits_Oth;
523 double TopEFrac = -DBL_MAX;
529 const double start = ThisHit.
PeakTime()-20;
534 for (
size_t ideL=0; ideL < ThisHitIDE.size(); ++ideL) {
535 if ( ThisHitIDE[ideL].energyFrac > TopEFrac ) {
536 TopEFrac = ThisHitIDE[ideL].energyFrac;
537 MainTrID = ThisHitIDE[ideL].trackID;
542 int thisMarleyIndex=-1;
543 if(ThisPType==
kMarl){
546 std::cout <<
"Track ID " << MainTrID <<
" is not in Marley index map" <<
std::endl;
549 thisMarleyIndex=it->second;
579 if (ThisHit.
View() == 2) {
580 if (ThisPType ==
kUnknown) ColHits_Oth .push_back( ThisHit );
581 else if (ThisPType ==
kMarl) ColHits_Marl.push_back( ThisHit );
582 else if (ThisPType ==
kAPA) ColHits_APA .push_back( ThisHit );
583 else if (ThisPType ==
kCPA) ColHits_CPA .push_back( ThisHit );
584 else if (ThisPType ==
kAr39) ColHits_Ar39.push_back( ThisHit );
585 else if (ThisPType ==
kAr42) ColHits_Ar42.push_back( ThisHit );
586 else if (ThisPType ==
kNeutron) ColHits_Neut.push_back( ThisHit );
587 else if (ThisPType ==
kKryp) ColHits_Kryp.push_back( ThisHit );
588 else if (ThisPType ==
kPlon) ColHits_Plon.push_back( ThisHit );
589 else if (ThisPType ==
kRdon) ColHits_Rdon.push_back( ThisHit );
594 mf::LogDebug(
"DAQSimAna") <<
"\n\nAfter all of that I have a total of " << ColHits_Marl.size() <<
" MARLEY col plane hits.";
595 for (
size_t hh=0; hh<ColHits_Marl.size(); ++hh) {
596 mf::LogDebug(
"DAQSimAna") <<
"\tHit " << hh <<
" was on chan " << ColHits_Marl[hh].Channel() <<
" at " << ColHits_Marl[hh].PeakTime();
601 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for APA hits...";
603 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for CPA hits...";
605 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Ar39 hits...";
607 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Ar42 hits...";
609 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Neuton hits...";
611 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Krypton hits...";
613 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Polonium hits...";
615 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Radon hits...";
617 mf::LogDebug(
"DAQSimAna") <<
"\nAnd now for Other hits...";
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::vector< int > GenType
The generator which generated the particle responsible for the hit.
art::ServiceHandle< cheat::BackTrackerService > bt_serv
void CalcAdjHits(std::vector< recob::Hit > MyVec, TH1I *MyHist, bool HeavDebug="false")
std::vector< int > HitChan
The channel which the hit occurs on.
std::map< int, int > trkIDToMarleyIndex
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
std::map< int, PType > trkIDToPType
std::map< int, simb::MCParticle > PlonParts
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
geo::View_t View() const
View for the plane of the hit.
std::map< int, simb::MCParticle > CPAParts
void FillMyMaps(std::map< int, simb::MCParticle > &MyMap, art::FindManyP< simb::MCParticle > Assn, art::ValidHandle< std::vector< simb::MCTruth > > Hand, std::map< int, int > *indexMap=nullptr)
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
std::vector< int > HitSize
Time width (ticks) Start - End time.
std::map< int, simb::MCParticle > NeutParts
std::map< int, simb::MCParticle > KrypParts
std::map< int, simb::MCParticle > Ar42Parts
std::map< int, simb::MCParticle > APAParts
std::vector< int > MarleyIndex
Which SN in the list of Marley interactions this hit is from (-1 if not from SN)
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Detector simulation of raw signals on wires.
const sim::ParticleList & ParticleList() const
void SaveIDEs(art::Event const &evt)
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
std::map< int, simb::MCParticle > MarlParts
std::map< int, simb::MCParticle > Ar39Parts
std::vector< float > HitPeak
The peak ADC value of the hit.
float PeakTime() const
Time of the signal peak, in tick units.
std::vector< float > HitTime
The time of the hit (ticks)
art::ServiceHandle< cheat::ParticleInventoryService > pi_serv
std::vector< float > HitInt
The ADC integral of the hit.
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
std::map< int, simb::MCParticle > RdonParts
std::vector< float > HitRMS
The RMS of the hit.
2D representation of charge deposited in the TDC/wire plane
std::vector< float > HitSADC
The summed ADC of the hit.
TPCID_t TPC
Index of the TPC within its cryostat.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
PType WhichParType(int TrID)
std::vector< int > HitTPC
The TPC which the hit occurs in.
std::vector< sim::TrackIDE > ChannelToTrackIDEs(detinfo::DetectorClocksData const &clockData, raw::ChannelID_t channel, const double hit_start_time, const double hit_end_time) const
std::vector< int > HitView
View i.e Coll, U, V.
QTextStream & endl(QTextStream &s)