416 auto const*
geo = lar::providerFrom<geo::Geometry>();
419 auto reco_hits =
evt.getValidHandle<std::vector<recob::Hit> >(
fHitLabel);
422 auto MarlTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fMARLLabel);
423 art::FindManyP<simb::MCParticle> MarlAssn(MarlTrue,
evt,
fGEANTLabel);
428 art::FindManyP<sim::SupernovaTruth> SNTruth(MarlTrue,
evt,
fMARLLabel);
430 double Px_(0), Py_(0), Pz_(0), Pnorm(1);
431 for(
unsigned int i = 0; i < MarlTrue->size(); i++)
433 Nu_Type = MarlTrue->at(i).GetNeutrino().Nu().PdgCode();
434 ENu = MarlTrue->at(i).GetNeutrino().Nu().E();
435 Mode = MarlTrue->at(i).GetNeutrino().Mode();
436 CCNC = MarlTrue->at(i).GetNeutrino().CCNC();
437 Target = MarlTrue->at(i).GetNeutrino().Target();
438 HitNucleon = MarlTrue->at(i).GetNeutrino().HitNuc();
439 Nu_Lep_Type = MarlTrue->at(i).GetNeutrino().Lepton().PdgCode();
440 VertX = MarlTrue->at(i).GetNeutrino().Lepton().Vx();
441 VertY = MarlTrue->at(i).GetNeutrino().Lepton().Vy();
442 VertZ = MarlTrue->at(i).GetNeutrino().Lepton().Vz();
443 Px_ = MarlTrue->at(i).GetNeutrino().Lepton().Px();
444 Py_ = MarlTrue->at(i).GetNeutrino().Lepton().Py();
445 Pz_ = MarlTrue->at(i).GetNeutrino().Lepton().Pz();
446 ENu_Lep = MarlTrue->at(i).GetNeutrino().Lepton().E();
447 for (
unsigned int j = 0; j < SNTruth.at(i).size(); j++)
455 Pnorm = std::sqrt(Px_*Px_+Py_*Py_+Pz_*Pz_);
465 WireID =
geo->NearestWireID(Vertex,
Plane);
480 double drift_velocity = detProp.DriftVelocity(detProp.Efield(),detProp.Temperature());
482 drift_velocity = drift_velocity*0.5;
485 auto APATrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAPALabel);
486 art::FindManyP<simb::MCParticle> APAAssn(APATrue,
evt,
fGEANTLabel);
490 auto CPATrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fCPALabel);
491 art::FindManyP<simb::MCParticle> CPAAssn(CPATrue,
evt,
fGEANTLabel);
495 auto Ar39True =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAr39Label);
496 art::FindManyP<simb::MCParticle> Ar39Assn(Ar39True,
evt,
fGEANTLabel);
500 auto NeutTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fNeutLabel);
501 art::FindManyP<simb::MCParticle> NeutAssn(NeutTrue,
evt,
fGEANTLabel);
505 auto KrypTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fKrypLabel);
506 art::FindManyP<simb::MCParticle> KrypAssn(KrypTrue,
evt,
fGEANTLabel);
510 auto PlonTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fPlonLabel);
511 art::FindManyP<simb::MCParticle> PlonAssn(PlonTrue,
evt,
fGEANTLabel);
515 auto RdonTrue =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fRdonLabel);
516 art::FindManyP<simb::MCParticle> RdonAssn(RdonTrue,
evt,
fGEANTLabel);
520 auto Ar42True =
evt.getValidHandle<std::vector<simb::MCTruth> >(
fAr42Label);
521 art::FindManyP<simb::MCParticle> Ar42Assn(Ar42True,
evt,
fGEANTLabel);
525 std::map<PType, std::map< int, simb::MCParticle >&> PTypeToMap{
537 for(
auto const& it : PTypeToMap){
539 auto const&
m=it.second;
540 for(
auto const& it2 :
m){
547 std::vector< recob::Hit > ColHits_Marl;
548 std::vector< recob::Hit > ColHits_CPA;
549 std::vector< recob::Hit > ColHits_APA;
550 std::vector< recob::Hit > ColHits_Ar39;
551 std::vector< recob::Hit > ColHits_Neut;
552 std::vector< recob::Hit > ColHits_Kryp;
553 std::vector< recob::Hit > ColHits_Plon;
554 std::vector< recob::Hit > ColHits_Rdon;
555 std::vector< recob::Hit > ColHits_Oth;
556 std::vector< recob::Hit > ColHits_Ar42;
578 if (ThisHit.
View() == 2) {
579 std::vector< sim::TrackIDE > ThisHitIDE;
581 std::vector<const sim::IDE*> ThisSimIDE;
624 if(ThisHitIDE.size()==0)
629 double TopEFrac = -DBL_MAX;
630 for (
size_t ideL=0; ideL < ThisHitIDE.size(); ++ideL)
632 if ( ThisHitIDE[ideL].energyFrac > TopEFrac )
634 TopEFrac = ThisHitIDE[ideL].energyFrac;
635 MainTrID = ThisHitIDE[ideL].trackID;
640 GenType[colHitCount] = ThisPType;
644 Hit_X[colHitCount] = -1;
645 Hit_Y[colHitCount] = -1;
646 Hit_Z[colHitCount] = -1;
652 for(
unsigned int i = 0; i < ThisSimIDE.size(); i++)
654 if(ThisSimIDE.at(i)->trackID==MainTrID)
656 Hit_X[colHitCount] = ThisSimIDE.at(i)->x;
657 Hit_Y[colHitCount] = ThisSimIDE.at(i)->y;
658 Hit_Z[colHitCount] = ThisSimIDE.at(i)->z;
659 Hit_Energy[colHitCount] = ThisSimIDE.at(i)->energy;
666 case kUnknown: { ColHits_Oth .push_back( ThisHit );
break; }
667 case kMarl: { ColHits_Marl.push_back( ThisHit );
break; }
668 case kAPA: { ColHits_APA .push_back( ThisHit );
break; }
669 case kCPA: { ColHits_CPA .push_back( ThisHit );
break; }
670 case kAr39: { ColHits_Ar39.push_back( ThisHit );
break; }
671 case kNeut: { ColHits_Neut.push_back( ThisHit );
break; }
672 case kKryp: { ColHits_Kryp.push_back( ThisHit );
break; }
673 case kPlon: { ColHits_Plon.push_back( ThisHit );
break; }
674 case kRdon: { ColHits_Rdon.push_back( ThisHit );
break; }
675 case kAr42: { ColHits_Ar42.push_back( ThisHit );
break; }
683 std::vector<int> vec_ClusterCount(
NConfigs);
691 std::vector<recoHit> vec_Hits;
696 vec_Hits.push_back(
hit);
699 for(
unsigned int j = 0; j < 1; j++)
701 std::vector<ClusterHitsInTime> vec_ChannelCluster;
702 std::vector<cluster> vec_Clusters;
703 TStopwatch *timeElapsed =
new TStopwatch();
706 for(
unsigned int k = 0;
k < vec_ChannelCluster.size();
k++)
708 std::vector<cluster> vec_Temp = vec_ChannelCluster.at(
k).getClusterVector();
710 for(
unsigned int l = 0;
l < vec_Temp.size();
l++)
711 vec_Clusters.push_back(vec_Temp.at(
l));
721 for(
unsigned int k = 0;
k < vec_Clusters.size();
k++)
723 if(vec_Clusters.at(
k).getTriggerFlag()==1)
741 for(
unsigned int l = 0;
l < vec_Clusters.at(
k).getHits().size();
l++)
743 out_HitView.push_back(vec_Clusters.at(
k).getHits().at(
l).getHitView());
744 out_GenType.push_back(vec_Clusters.at(
k).getHits().at(
l).getGenType());
745 out_HitChan.push_back(vec_Clusters.at(
k).getHits().at(
l).getHitChan());
746 out_HitTime.push_back(vec_Clusters.at(
k).getHits().at(
l).getHitTime());
747 out_HitSADC.push_back(vec_Clusters.at(
k).getHits().at(
l).getHitSADC());
748 out_HitRMS .push_back(vec_Clusters.at(
k).getHits().at(
l).getHitRMS ());
754 vec_ClusterCount.at(j)++;
757 vec_ChannelCluster.clear();
758 vec_Clusters.clear();
std::vector< int > MarlSample
std::map< int, simb::MCParticle > NeutParts
std::map< int, PType > trkIDToPType
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
void FillMyMaps(std::map< int, simb::MCParticle > &MyMap, art::FindManyP< simb::MCParticle > Assn, art::ValidHandle< std::vector< simb::MCTruth > > Hand)
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
The data type to uniquely identify a Plane.
std::vector< double > MarlTime
Planes which measure Z direction.
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::vector< double > out_HitTime
std::map< int, std::vector< double > > map_EventToMC
SupernovaSamplingMode_t SamplingMode
Method used to sample the supernova neutrino's energy and arrival time.
std::vector< double > MarlWeight
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
std::map< int, simb::MCParticle > CPAParts
std::map< int, simb::MCParticle > Ar42Parts
double Weight
Statistical weight for this neutrino vertex.
std::vector< double > out_HitRMS
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::map< int, simb::MCParticle > MarlParts
float Hit_Energy[nMaxHits]
std::map< int, simb::MCParticle > APAParts
void clusterChannels(std::vector< recoHit > &vec_Hits, std::vector< ClusterHitsInTime > &vec_ChannelCluster, unsigned int const &config)
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
void clusterCut(std::vector< cluster > &vec_Clusters, unsigned int const &config)
PType WhichParType(int TrID)
Detector simulation of raw signals on wires.
TTree * t_Output_clusteredhits
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
int NCorrespondingIDEs[nMaxHits]
float PeakTime() const
Time of the signal peak, in tick units.
double SupernovaTime
Arrival time of the supernova neutrino (seconds)
std::vector< int > out_HitView
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
void trigger(std::vector< cluster > &vec_Clusters, unsigned int const &config)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
std::map< int, simb::MCParticle > PlonParts
std::vector< const sim::IDE * > HitToSimIDEs_Ps(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
art::ServiceHandle< cheat::BackTrackerService > bt_serv
2D representation of charge deposited in the TDC/wire plane
float Hit_NumElectrons[nMaxHits]
std::map< int, simb::MCParticle > Ar39Parts
TPCID_t TPC
Index of the TPC within its cryostat.
std::map< int, simb::MCParticle > RdonParts
std::vector< double > out_HitSADC
recob::tracking::Plane Plane
LArSoft geometry interface.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
std::vector< int > out_GenType
std::map< int, simb::MCParticle > KrypParts
std::vector< int > out_HitChan