1131 const sim::ParticleList& plist = pi_serv->
ParticleList();
1141 taulife = detProp.ElectronLifetime();
1145 std::vector<art::Ptr<raw::RawDigit> > rawlist;
1151 std::vector<art::Ptr<recob::Wire>> wirelist;
1157 std::vector<art::Ptr<recob::Hit> > hitlist;
1163 std::vector<art::Ptr<recob::Track> > tracklist;
1165 if (trackListHandle)
1169 std::vector<art::Ptr<recob::Vertex> > vtxlist;
1175 std::vector<art::Ptr<recob::Shower>> shwlist;
1181 std::vector<art::Ptr<recob::OpFlash> > flashlist;
1183 if (flashListHandle)
1188 art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trackListHandle,
evt,
fTrackModuleLabel);
1206 for (
size_t i = 0; i<wirelist.size(); ++i){
1209 for(
const auto& range : signalROI.
get_ranges()){
1210 const std::vector<float>& signal = range.data();
1212 for (
size_t j = 0; j<signal.size(); ++j){
1220 nhits = hitlist.size();
1224 hit_plane[i] = hitlist[i]->WireID().Plane;
1225 hit_wire[i] = hitlist[i]->WireID().Wire;
1226 hit_tpc[i] = hitlist[i]->WireID().TPC;
1230 hit_startT[i] = hitlist[i]->PeakTimeMinusRMS();
1231 hit_endT[i] = hitlist[i]->PeakTimePlusRMS();
1242 std::tie(trackStart, trackEnd) = tracklist[i]->Extent();
1243 larStart = tracklist[i]->VertexDirection();
1244 larEnd = tracklist[i]->EndDirection();
1246 trkid[i] = tracklist[i]->ID();
1259 trklen[i] = tracklist[i]->Length();
1260 if (fmthm.isValid()){
1261 auto vhit = fmthm.at(i);
1262 auto vmeta = fmthm.data(i);
1263 for (
size_t h = 0;
h < vhit.size(); ++
h){
1266 if (vmeta[
h]->Dx()){
1274 else if (fmth.isValid()){
1275 std::vector< art::Ptr<recob::Hit> > vhit = fmth.at(i);
1276 for (
size_t h = 0; h < vhit.size(); ++
h){
1282 if (fmcal.isValid()){
1283 unsigned maxnumhits = 0;
1284 std::vector<const anab::Calorimetry*> calos = fmcal.at(i);
1285 for (
auto const&
calo : calos){
1286 if (
calo->PlaneID().isValid){
1288 if (
calo->dEdx().size()>maxnumhits){
1289 maxnumhits =
calo->dEdx().size();
1293 int used_trkres = 0;
1294 for (
size_t ip = 0; ip<
calo->dEdx().size(); ++ip){
1295 if (
calo->ResidualRange()[ip]<30){
1296 pida +=
calo->dEdx()[ip]*
pow(
calo->ResidualRange()[ip],0.42);
1300 if (used_trkres) pida/=used_trkres;
1305 if (!
isdata&&fmth.isValid()){
1308 std::vector< art::Ptr<recob::Hit> > allHits = fmth.at(i);
1310 std::map<int,double> trkide;
1311 for(
size_t h = 0; h < allHits.size(); ++
h){
1314 for(
size_t e = 0;
e < TrackIDs.size(); ++
e){
1315 trkide[TrackIDs[
e].trackID] += TrackIDs[
e].energy;
1323 if ((ii->second)>maxe){
1325 TrackID = ii->first;
1336 float sum_energy = 0;
1342 double mindis = 1e10;
1344 for(
size_t h = 0; h < allHits.size(); ++
h){
1347 std::vector<art::Ptr<recob::SpacePoint> > spts = fmhs.at(hit.
key());
1354 x = spts[0]->XYZ()[0];
1355 y = spts[0]->XYZ()[1];
1356 z = spts[0]->XYZ()[2];
1361 for(
size_t h = 0; h < allHits.size(); ++
h){
1364 std::vector<art::Ptr<recob::SpacePoint> > spts = fmhs.at(hit.
key());
1366 if (sqrt(
pow(spts[0]->XYZ()[0]-x,2)+
1367 pow(spts[0]->XYZ()[1]-y,2)+
1368 pow(spts[0]->XYZ()[2]-z,2))<3){
1369 std::vector<sim::TrackIDE> TrackIDs = bt_serv->
HitToTrackIDEs(clockData, hit);
1371 for(
size_t e = 0;
e < TrackIDs.size(); ++
e){
1373 toten+=TrackIDs[
e].energy;
1376 sum_energy += toten;
1407 if ( pitch && numhits ) {
1418 nvtx = vtxlist.size();
1420 Double_t xyz[3] = {};
1421 vtxlist[i]->XYZ(xyz);
1422 for (
size_t j = 0; j<3; ++j)
vtx[i][j] = xyz[j];
1426 if (shwListHandle.isValid()){
1429 nshws = shwlist.size();
1432 shwid[i] = shwlist[i]->ID();
1433 shwdcosx[i] = shwlist[i]->Direction().X();
1434 shwdcosy[i] = shwlist[i]->Direction().Y();
1435 shwdcosz[i] = shwlist[i]->Direction().Z();
1436 shwstartx[i] = shwlist[i]->ShowerStart().X();
1437 shwstarty[i] = shwlist[i]->ShowerStart().Y();
1438 shwstartz[i] = shwlist[i]->ShowerStart().Z();
1439 for (
size_t j = 0; j<(shwlist[i]->Energy()).
size(); ++j){
1440 shwenergy[i][j] = shwlist[i]->Energy()[j];
1442 for (
size_t j = 0; j<(shwlist[i]->dEdx()).
size(); ++j){
1443 shwdedx[i][j] = shwlist[i]->dEdx()[j];
1446 if (fmsh.isValid()){
1447 auto vhit = fmsh.at(i);
1448 for (
size_t h = 0; h < vhit.size(); ++
h){
1454 if (!
isdata&&fmsh.isValid()){
1457 std::vector< art::Ptr<recob::Hit> > allHits = fmsh.at(i);
1458 std::map<int,double> trkide;
1459 for(
size_t h = 0; h < allHits.size(); ++
h){
1461 std::vector<sim::TrackIDE> TrackIDs = bt_serv->
HitToTrackIDEs(clockData, hit);
1462 for(
size_t e = 0;
e < TrackIDs.size(); ++
e){
1463 trkide[TrackIDs[
e].trackID] += TrackIDs[
e].energy;
1471 if ((ii->second)>maxe){
1473 TrackID = ii->first;
1501 std::vector<art::Ptr<simb::MCTruth> > mclist;
1503 if (mctruthListHandle)
1506 std::vector<art::Ptr<simb::MCFlux> > fluxlist;
1508 if (mcfluxListHandle)
1547 float mindist2 = 9999;
1554 for(
size_t i = 0; i < vtxlist.size(); ++i){
1555 Double_t xyz[3] = {};
1556 vtxlist[i]->XYZ(xyz);
1557 TVector3 vtxreco(xyz);
1559 if (dist2 < mindist2)
1570 for (
size_t i = 0; i < tracklist.size(); ++i){
1572 if (dist2 < mindist2)
1582 if (dist2 < mindist2)
1596 if (fluxlist.size()){
1608 std::vector<const simb::MCParticle* > geant_part;
1611 for(
size_t p = 0;
p < plist.size(); ++
p)
1614 geant_part.push_back(plist.Particle(
p));
1623 int geant_particle=0;
1628 for(
unsigned int i = 0; i < geant_part.size(); ++i ){
1631 if(geant_part[i]->Process()==pri)
1642 for(
unsigned int i = 0; i < geant_part.size(); ++i ){
1645 if(geant_part[i]->Process()==pri)
1652 Mother[i]=geant_part[i]->Mother();
1654 TrackId[i]=geant_part[i]->TrackId();
1656 pdg[i]=geant_part[i]->PdgCode();
1658 Eng[i]=geant_part[i]->E();
1661 Px[i]=geant_part[i]->Px();
1662 Py[i]=geant_part[i]->Py();
1663 Pz[i]=geant_part[i]->Pz();
1669 EndPointx[i]=geant_part[i]->EndPosition()[0];
1670 EndPointy[i]=geant_part[i]->EndPosition()[1];
1671 EndPointz[i]=geant_part[i]->EndPosition()[2];
1675 G4Process.push_back( geant_part[i]->Process() );
1683 Startdcosx[i] = geant_part[i]->Momentum(0).Px() / geant_part[i]->Momentum(0).P();
1684 Startdcosy[i] = geant_part[i]->Momentum(0).Py() / geant_part[i]->Momentum(0).P();
1685 Startdcosz[i] = geant_part[i]->Momentum(0).Pz() / geant_part[i]->Momentum(0).P();
double E(const int i=0) const
Float_t shwdcosy[kMaxShower]
constexpr std::uint32_t timeLow() const
Float_t flash_YWidth[kMaxFlash]
float trkg4startx[kMaxTrack]
Float_t hit_startT[kMaxHits]
const simb::MCNeutrino & GetNeutrino() const
double Py(const int i=0) const
std::string fWireModuleLabel
Int_t hit_channel[kMaxHits]
float trkstartz[kMaxTrack]
Float_t EndPointz[kMaxPrimaries]
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
double Dist2(const TVector2 &v1, const TVector2 &v2)
Float_t EndPointx[kMaxPrimaries]
std::vector< TrackID > TrackIDs
const simb::MCParticle * TrackIdToParticle_P(int id) const
geo::WireID WireID() const
float trkstartx[kMaxTrack]
Float_t flash_abstime[kMaxFlash]
Float_t hit_dQds[kMaxHits]
Float_t shwstartx[kMaxShower]
int shwbestplane[kMaxShower]
const simb::MCParticle & Nu() const
Float_t Startdcosz[kMaxPrimaries]
constexpr std::uint32_t timeHigh() const
simb::Origin_t Origin() const
Float_t Py[kMaxPrimaries]
double Px(const int i=0) const
Float_t StartPointx[kMaxPrimaries]
int TrackId[kMaxPrimaries]
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
std::vector< std::string > G4Process
Planes which measure Z direction.
Float_t hit_summedADC[kMaxHits]
float trkg4starty[kMaxTrack]
Float_t flash_YCenter[kMaxFlash]
Float_t shwdcosz[kMaxShower]
float trkenddcosz[kMaxTrack]
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Float_t flash_TotalPE[kMaxFlash]
float trkke[kMaxTrack][3]
Float_t hit_peakT[kMaxHits]
float trkg4initdedx[kMaxTrack]
std::string fVertexModuleLabel
int TDCtick_t
Type representing a TDC tick.
Float_t Pz[kMaxPrimaries]
tracking::Vector_t Vector_t
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
float trkstartdcosy[kMaxTrack]
float trkenddcosx[kMaxTrack]
Float_t shwstartz[kMaxShower]
std::string fRawDigitModuleLabel
Float_t flash_ZCenter[kMaxFlash]
std::string fCalorimetryModuleLabel
const simb::MCParticle & Lepton() const
Float_t flash_time[kMaxFlash]
float trkstartdcosx[kMaxTrack]
Short_t hit_wire[kMaxHits]
calo::CalorimetryAlg fCalorimetryAlg
Float_t shwstarty[kMaxShower]
std::string fHitsModuleLabel
Float_t hit_dEds[kMaxHits]
Float_t EndPointy[kMaxPrimaries]
double P(const int i=0) const
key_type key() const noexcept
std::vector< std::string > G4FinalProcess
double T(const int i=0) const
Float_t hit_endT[kMaxHits]
Float_t StartPointy[kMaxPrimaries]
Int_t hit_shwkey[kMaxHits]
PlaneID_t Plane
Index of the plane within its TPC.
Short_t hit_plane[kMaxHits]
int process_primary[kMaxPrimaries]
Float_t flash_width[kMaxFlash]
Float_t hit_charge[kMaxHits]
art::ServiceHandle< geo::Geometry > fGeom
Detector simulation of raw signals on wires.
float trkstarty[kMaxTrack]
const sim::ParticleList & ParticleList() const
const simb::MCParticle & GetParticle(int i) const
std::string fShowerModuleLabel
constexpr int kMaxVertices
double Vx(const int i=0) const
int trkbestplane[kMaxTrack]
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Float_t shwdcosx[kMaxShower]
bool insideFidVol(const double posX, const double posY, const double posZ)
std::string fFlashModuleLabel
Float_t StartPointz[kMaxPrimaries]
tracking::Point_t Point_t
double TrackPitchInView(recob::Track const &track, geo::View_t view, size_t trajectory_point=0U)
Returns the projected length of track on a wire pitch step [cm].
Float_t vtx[kMaxVertices][3]
double Pz(const int i=0) const
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double Vz(const int i=0) const
int Mother[kMaxPrimaries]
Short_t hit_tpc[kMaxHits]
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
std::string fTrackModuleLabel
float trkg4startz[kMaxTrack]
Float_t shwdedx[kMaxShower][3]
Float_t Startdcosx[kMaxPrimaries]
Int_t hit_trkkey[kMaxHits]
std::string fGenieGenModuleLabel
Float_t shwenergy[kMaxShower][3]
Float_t hit_resrange[kMaxHits]
Float_t Startdcosy[kMaxPrimaries]
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
float trkenddcosy[kMaxTrack]
int NumberDaughters[kMaxPrimaries]
float trkpida[kMaxTrack][3]
Float_t Px[kMaxPrimaries]
double Vy(const int i=0) const
Float_t flash_ZWidth[kMaxFlash]
float trkstartdcosz[kMaxTrack]
Signal from collection planes.
Float_t Eng[kMaxPrimaries]