11 #include "art_root_io/TFileService.h" 12 #include "art_root_io/TFileDirectory.h" 13 #include "canvas/Persistency/Common/FindMany.h" 78 #include "TTimeStamp.h" 100 template <
typename T>
117 template <
typename Array_t>
128 { std::memcpy((
char*) &(
data()), (
char*) &(from.
data()),
sizeof(Array_t)); }
136 Data_t*
begin() {
return reinterpret_cast<Data_t*
>(&
array); }
137 const Data_t*
begin()
const {
return reinterpret_cast<const Data_t*
>(&
array); }
144 auto operator[] (
size_t index) -> decltype(*array) {
return array[
index]; }
145 auto operator[] (
size_t index)
const -> decltype(*array) {
return array[
index]; }
153 operator decltype(&array[0]) () {
return &array[0]; }
154 operator decltype(&array[0]) ()
const {
return &array[0]; }
172 template <
typename T>
174 template <
typename T>
176 template <
typename T>
178 template <
typename T>
199 Float_t trkdedx2[10000];
200 Float_t trkdqdx2[10000];
201 Float_t trktpc2[10000];
202 Float_t trkx2[10000];
203 Float_t trky2[10000];
204 Float_t trkz2[10000];
207 Float_t hittrkx[10000];
208 Float_t hittrky[10000];
209 Float_t hittrkz[10000];
211 Float_t hittrklocaltrackdirectionx[10000];
212 Float_t hittrklocaltrackdirectiony[10000];
213 Float_t hittrklocaltrackdirectionz[10000];
214 Float_t hittrklocaltrackdirectiontheta[10000];
215 Float_t hittrklocaltrackdirectionphi[10000];
217 Float_t hittrkpitchC[10000];
219 Float_t hittrkds[10000];
221 Short_t hittrkchannel[10000];
222 Short_t hittrktpc[10000];
223 Short_t hittrkview[10000];
224 Short_t hittrkwire[10000];
225 Float_t hittrkpeakT[10000];
226 Float_t hittrkchargeintegral[10000];
227 Float_t hittrkph[10000];
228 Float_t hittrkchargesum[10000];
229 Float_t hittrkstarT[10000];
230 Float_t hittrkendT[10000];
231 Float_t hittrkrms[10000];
232 Float_t hittrkgoddnessofFit[10000];
233 Short_t hittrkmultiplicity[10000];
234 Int_t hittrktrueID[10000];
235 Float_t hittrktrueEnergyMax[10000];
236 Float_t hittrktrueEnergyFraction[10000];
314 { MaxTracks = maxTracks; Resize(MaxTracks); }
315 void Resize(
size_t nTracks);
316 void SetAddresses(TTree* pTree,
std::string tracker,
bool isCosmics);
329 template <
typename T>
347 { MaxVertices = maxVertices; Resize(MaxVertices); }
348 void Resize(
size_t nVertices);
349 void SetAddresses(TTree* pTree,
std::string tracker,
bool isCosmics);
368 template <
typename T>
370 template <
typename T>
372 template <
typename T>
374 template <
typename T>
410 name(new_name), MaxShowers(maxShowers) { Clear(); }
417 void MarkMissing(TTree* pTree);
420 { MaxShowers = maxShowers; Resize(MaxShowers); }
421 void Resize(
size_t nShowers);
422 void SetAddresses(TTree* pTree);
442 template <
typename T>
444 template <
typename T>
446 template <
typename T>
479 MaxPFParticles(maxPFParticles) { Clear(); }
483 { MaxPFParticles = maxPFParticles; Resize(MaxPFParticles); }
484 void Resize(
size_t numPFParticles);
485 void SetAddresses(TTree* pTree);
503 tdGeantTrajectory = 0x80,
504 tdSimEnergyDepositTPCActive = 0x100,
513 tdRawDigit = 0x20000,
514 tdRecobWire = 0x40000,
515 tdPandoraNuVertex = 0x80000,
516 tdPFParticle = 0x100000,
534 potbnbETOR860 = -999.;
535 potbnbETOR875 = -999.;
536 potnumiETORTGT = -999.;
619 size_t MaxPhotons = 0;
750 size_t MaxGeniePrimaries = 0;
798 size_t MaxGeneratorparticles = 0;
801 size_t MaxGEANTparticles = 0;
811 std::vector<Float_t>
Px;
812 std::vector<Float_t>
Py;
813 std::vector<Float_t>
Pz;
814 std::vector<Float_t>
P;
828 size_t MaxGEANTInAVparticles = 0;
885 size_t MaxGEANTtrajectorypoints = 0;
907 size_t MaxSimEnergyDepositsTPCActive = 0;
908 size_t MaxParticlesWithSimEnergyDepositsTPCActive = 0;
1036 template <
typename T>
1126 void SetBits(
unsigned int setbits,
bool unset =
false)
1127 {
if (unset) bits &= ~setbits;
else bits |= setbits; }
1131 std::vector<std::string>
const& ShowerAlgos = {}):
1133 { SetTrackers(nTrackers); SetVertexAlgos(nVertexAlgos); SetShowerAlgos(ShowerAlgos); Clear(); }
1136 {
return TrackData.at(iTracker); }
1138 {
return TrackData.at(iTracker); }
1141 {
return ShowerData.at(iShower); }
1143 {
return ShowerData.at(iShower); }
1146 {
return VertexData.at(iVertex); }
1148 {
return VertexData.at(iVertex); }
1151 {
return PFParticleData; }
1153 {
return PFParticleData; }
1156 void ClearLocalData();
1169 void SetShowerAlgos(std::vector<std::string>
const& ShowerAlgos);
1172 void ResizePhotons(
int nPhotons);
1175 void ResizeGenerator(
int nParticles);
1178 void ResizeGEANT(
int nParticles);
1181 void ResizeGEANTInAV(
int nParticlesInAV);
1184 void ResizeGEANTTrajectory(
int nTrajectoryPoints);
1187 void ResizeSimEnergyDepositsTPCActive(
int nSimEnergyDepositsTPCActive,
int nParticlesWithSimEnergyDepositsTPCActive);
1190 void ResizeGenie(
int nPrimaries);
1193 void ResizeCry(
int nPrimaries);
1196 void ResizeProto(
int nPrimaries);
1199 void ResizeMCShower(
int nMCShowers);
1202 void ResizeMCTrack(
int nMCTracks);
1207 std::vector<std::string>
const& trackers,
1208 std::vector<std::string>
const& vertexalgos,
1209 std::vector<std::string>
const& showeralgos,
1276 TBranch* pBranch = pTree->GetBranch(name.c_str());
1279 pTree->Branch(name.c_str(), address, leaflist.c_str() );
1282 <<
"Creating branch '" << name <<
" with leaf '" << leaflist <<
"'";
1285 else if (pBranch->GetAddress() != address) {
1286 pBranch->SetAddress(address);
1288 <<
"Reassigning address to branch '" << name <<
"'";
1292 <<
"Branch '" << name <<
"' is fine";
1297 {
return this->operator() (name, address, leaflist.str() ); }
1298 template <
typename T>
1301 {
return this->operator() (name, (
void*) data.data(), leaflist ); }
1303 template <
typename T>
1312 TBranch* pBranch = pTree->GetBranch(name.c_str());
1314 pTree->Branch(name.c_str(), &
data);
1318 <<
"Creating object branch '" << name
1319 <<
" with " << TClass::GetClass(
typeid(
T))->ClassName();
1322 (*(
reinterpret_cast<std::vector<T>**
>(pBranch->GetAddress())) != &
data)
1329 pBranch->SetObject(&data);
1331 <<
"Reassigning object to branch '" << name <<
"'";
1335 <<
"Branch '" << name <<
"' is fine";
1347 template<>
struct ROOTTreeCode<Short_t> {
static constexpr
char code =
'S'; };
1348 template<>
struct ROOTTreeCode<Int_t> {
static constexpr
char code =
'I'; };
1349 template<>
struct ROOTTreeCode<Double_t> {
static constexpr
char code =
'D'; };
1355 template <
typename A>
1359 template <
typename T>
1361 {
using type =
typename std::vector<T>::value_type; };
1392 const simb::MCParticle& part, TLorentzVector& start, TLorentzVector&
end,
unsigned int &starti,
unsigned int &endi);
1394 const sim::MCTrack& mctrack, TLorentzVector& tpcstart, TLorentzVector& tpcend, TLorentzVector& tpcmom);
1395 double length(
const simb::MCParticle& part, TLorentzVector& start, TLorentzVector& end,
unsigned int &starti,
unsigned int &endi);
1396 double bdist(
const TVector3&
pos);
1397 int CountHits(
const art::Event& evt,
const art::InputTag& which,
unsigned int cryostat,
unsigned int tpc,
unsigned int plane);
1404 std::unique_ptr<AnaRootParserDataStruct>
fData;
1479 double ActiveBounds[6];
1491 {
return { fShowerModuleLabel.begin(), fShowerModuleLabel.end() }; }
1499 fData->SetBits(AnaRootParserDataStruct::tdCry, !fSaveCryInfo);
1500 fData->SetBits(AnaRootParserDataStruct::tdGenie, !fSaveGenieInfo);
1501 fData->SetBits(AnaRootParserDataStruct::tdProto, !fSaveProtoInfo);
1502 fData->SetBits(AnaRootParserDataStruct::tdPhotons, !fSavePhotonInfo);
1503 fData->SetBits(AnaRootParserDataStruct::tdGenerator, !fSaveGeneratorInfo);
1504 fData->SetBits(AnaRootParserDataStruct::tdGeant, !fSaveGeantInfo);
1505 fData->SetBits(AnaRootParserDataStruct::tdGeantInAV, !fSaveGeantInAVInfo);
1506 fData->SetBits(AnaRootParserDataStruct::tdGeantTrajectory, !fSaveGeantTrajectoryInfo);
1507 fData->SetBits(AnaRootParserDataStruct::tdSimEnergyDepositTPCActive, !fSaveSimEnergyDepositTPCActiveInfo);
1508 fData->SetBits(AnaRootParserDataStruct::tdMCshwr, !fSaveMCShowerInfo);
1509 fData->SetBits(AnaRootParserDataStruct::tdMCtrk, !fSaveMCTrackInfo);
1510 fData->SetBits(AnaRootParserDataStruct::tdHit, !fSaveHitInfo);
1511 fData->SetBits(AnaRootParserDataStruct::tdRawDigit, !fSaveRawDigitInfo);
1512 fData->SetBits(AnaRootParserDataStruct::tdRecobWire, !fSaveRecobWireInfo);
1513 fData->SetBits(AnaRootParserDataStruct::tdFlash, !fSaveFlashInfo);
1514 fData->SetBits(AnaRootParserDataStruct::tdCount, !fSaveExternCounterInfo);
1515 fData->SetBits(AnaRootParserDataStruct::tdShower, !fSaveShowerInfo);
1516 fData->SetBits(AnaRootParserDataStruct::tdCluster,!fSaveClusterInfo);
1517 fData->SetBits(AnaRootParserDataStruct::tdPandoraNuVertex,!fSavePandoraNuVertexInfo);
1518 fData->SetBits(AnaRootParserDataStruct::tdTrack, !fSaveTrackInfo);
1519 fData->SetBits(AnaRootParserDataStruct::tdVertex, !fSaveVertexInfo);
1520 fData->SetBits(AnaRootParserDataStruct::tdAuxDet, !fSaveAuxDetInfo);
1521 fData->SetBits(AnaRootParserDataStruct::tdPFParticle, !fSavePFParticleInfo);
1524 fData->SetTrackers(GetNTrackers());
1525 fData->SetVertexAlgos(GetNVertexAlgos());
1526 fData->SetShowerAlgos(GetShowerAlgos());
1527 if (bClearData) fData->Clear();
1534 CheckData(__func__); CheckTree(__func__);
1536 (fTree, fTrackModuleLabel, fVertexModuleLabel, fShowerModuleLabel, isCosmics);
1543 CheckData(__func__); CheckTree(__func__);
1544 if (iTracker >= fData->GetNTrackers()) {
1546 <<
"AnaRootParser::SetTrackerAddresses(): no tracker #" << iTracker
1547 <<
" (" << fData->GetNTrackers() <<
" available)";
1549 fData->GetTrackerData(iTracker)
1550 .SetAddresses(fTree, fTrackModuleLabel[iTracker], isCosmics);
1556 CheckData(__func__); CheckTree(__func__);
1557 if (iVertexAlg >= fData->GetNVertexAlgos()) {
1559 <<
"AnaRootParser::SetVertexAddresses(): no vertex alg #" << iVertexAlg
1560 <<
" (" << fData->GetNVertexAlgos() <<
" available)";
1562 fData->GetVertexData(iVertexAlg)
1563 .SetAddresses(fTree, fVertexModuleLabel[iVertexAlg], isCosmics);
1570 CheckData(__func__); CheckTree(__func__);
1571 if (iShower >= fData->GetNShowerAlgos()) {
1573 <<
"AnaRootParser::SetShowerAddresses(): no shower algo #" << iShower
1574 <<
" (" << fData->GetNShowerAlgos() <<
" available)";
1576 fData->GetShowerData(iShower).SetAddresses(fTree);
1583 CheckData(__func__); CheckTree(__func__);
1584 fData->GetPFParticleData().SetAddresses(fTree);
1588 void CreateTree(
bool bClearData =
false);
1598 <<
"AnaRootParser::" << caller <<
": no data";
1605 <<
"AnaRootParser::" << caller <<
": no tree";
1612 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
1618 std::vector<recob::Shower>
const& showers,
const bool fSavePFParticleInfo,
1619 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
1628 class AutoResettingStringSteam:
public std::ostringstream {
1630 AutoResettingStringSteam& operator() () {
str(
"");
return *
this; }
1634 template <
typename ITER,
typename TYPE>
1635 inline void FillWith(ITER from, ITER to, TYPE
value)
1639 template <
typename ITER,
typename TYPE>
1640 inline void FillWith(ITER from,
size_t n, TYPE value)
1644 template <
typename CONT,
typename V>
1645 inline void FillWith(CONT&
data,
const V& value)
1657 MaxTracks = nTracks;
1659 trkId.resize(MaxTracks);
1660 NHitsPerTrack.resize(MaxTracks);
1661 trkncosmictags_tagger.resize(MaxTracks);
1662 trkcosmicscore_tagger.resize(MaxTracks);
1663 trkcosmictype_tagger.resize(MaxTracks);
1664 trkncosmictags_containmenttagger.resize(MaxTracks);
1665 trkcosmicscore_containmenttagger.resize(MaxTracks);
1666 trkcosmictype_containmenttagger.resize(MaxTracks);
1667 trkncosmictags_flashmatch.resize(MaxTracks);
1668 trkcosmicscore_flashmatch.resize(MaxTracks);
1669 trkcosmictype_flashmatch.resize(MaxTracks);
1670 trkstartx.resize(MaxTracks);
1671 trkstarty.resize(MaxTracks);
1672 trkstartz.resize(MaxTracks);
1673 trkstartd.resize(MaxTracks);
1674 trkendx.resize(MaxTracks);
1675 trkendy.resize(MaxTracks);
1676 trkendz.resize(MaxTracks);
1677 trkendd.resize(MaxTracks);
1678 trkflashT0.resize(MaxTracks);
1679 trktrueT0.resize(MaxTracks);
1680 trkstarttheta.resize(MaxTracks);
1681 trkstartphi.resize(MaxTracks);
1682 trkendtheta.resize(MaxTracks);
1683 trkendphi.resize(MaxTracks);
1684 trkstartdirectionx.resize(MaxTracks);
1685 trkstartdirectiony.resize(MaxTracks);
1686 trkstartdirectionz.resize(MaxTracks);
1687 trkenddirectionx.resize(MaxTracks);
1688 trkenddirectiony.resize(MaxTracks);
1689 trkenddirectionz.resize(MaxTracks);
1690 trkthetaxz.resize(MaxTracks);
1691 trkthetayz.resize(MaxTracks);
1692 trkmom.resize(MaxTracks);
1693 trkmomrange.resize(MaxTracks);
1694 trkmommschi2.resize(MaxTracks);
1695 trkmommsllhd.resize(MaxTracks);
1696 trkmommscmic.resize(MaxTracks);
1697 trkmommscfwd.resize(MaxTracks);
1698 trkmommscbwd.resize(MaxTracks);
1699 trkmommscllfwd.resize(MaxTracks);
1700 trkmommscllbwd.resize(MaxTracks);
1701 trkchi2PerNDF.resize(MaxTracks);
1702 trkNDF.resize(MaxTracks);
1703 trklen.resize(MaxTracks);
1704 trklenstraightline.resize(MaxTracks);
1705 trksvtxid.resize(MaxTracks);
1706 trkevtxid.resize(MaxTracks);
1708 trkpidpdg.resize(MaxTracks);
1709 trkpidchi.resize(MaxTracks);
1710 trkpidchipr.resize(MaxTracks);
1711 trkpidchika.resize(MaxTracks);
1712 trkpidchipi.resize(MaxTracks);
1713 trkpidchimu.resize(MaxTracks);
1714 trkpidpida.resize(MaxTracks);
1715 trkpidbestplane.resize(MaxTracks);
1716 trkpidmvamu.resize(MaxTracks);
1717 trkpidmvae.resize(MaxTracks);
1718 trkpidmvapich.resize(MaxTracks);
1719 trkpidmvaphoton.resize(MaxTracks);
1720 trkpidmvapr.resize(MaxTracks);
1722 trkke.resize(MaxTracks);
1723 trkrange.resize(MaxTracks);
1724 trkidtruth.resize(MaxTracks);
1725 trkorigin.resize(MaxTracks);
1726 trkpdgtruth.resize(MaxTracks);
1727 trkefftruth.resize(MaxTracks);
1728 trkpurtruth.resize(MaxTracks);
1729 trkpurity.resize(MaxTracks);
1730 trkcompleteness.resize(MaxTracks);
1731 trkg4id.resize(MaxTracks);
1732 trkorig.resize(MaxTracks);
1733 trkpitchc.resize(MaxTracks);
1734 ntrkhitsperview.resize(MaxTracks);
1736 trkdedx.resize(MaxTracks);
1737 trkdqdx.resize(MaxTracks);
1738 trkresrg.resize(MaxTracks);
1739 trktpc.resize(MaxTracks);
1740 trkxyz.resize(MaxTracks);
1742 trkhasPFParticle.resize(MaxTracks);
1743 trkPFParticleID.resize(MaxTracks);
1751 std::fill(trkdedx2, trkdedx2 +
sizeof(trkdedx2)/
sizeof(trkdedx2[0]), -999.);
1752 std::fill(trkdqdx2, trkdqdx2 +
sizeof(trkdqdx2)/
sizeof(trkdqdx2[0]), -999.);
1753 std::fill(trktpc2, trktpc2 +
sizeof(trktpc2)/
sizeof(trktpc2[0]), -999.);
1754 std::fill(trkx2, trkx2 +
sizeof(trkx2)/
sizeof(trkx2[0]), -999.);
1755 std::fill(trky2, trky2 +
sizeof(trky2)/
sizeof(trky2[0]), -999.);
1756 std::fill(trkz2, trkz2 +
sizeof(trkz2)/
sizeof(trkz2[0]), -999.);
1758 std::fill(hittrkx, hittrkx +
sizeof(hittrkx)/
sizeof(hittrkx[0]), -999.);
1759 std::fill(hittrky, hittrky +
sizeof(hittrky)/
sizeof(hittrky[0]), -999.);
1760 std::fill(hittrkz, hittrkz +
sizeof(hittrkz)/
sizeof(hittrkz[0]), -999.);
1762 std::fill(hittrklocaltrackdirectionx, hittrklocaltrackdirectionx +
sizeof(hittrklocaltrackdirectionx)/
sizeof(hittrklocaltrackdirectionx[0]), -999.);
1763 std::fill(hittrklocaltrackdirectiony, hittrklocaltrackdirectiony +
sizeof(hittrklocaltrackdirectiony)/
sizeof(hittrklocaltrackdirectiony[0]), -999.);
1764 std::fill(hittrklocaltrackdirectionz, hittrklocaltrackdirectionz +
sizeof(hittrklocaltrackdirectionz)/
sizeof(hittrklocaltrackdirectionz[0]), -999.);
1765 std::fill(hittrklocaltrackdirectiontheta, hittrklocaltrackdirectiontheta +
sizeof(hittrklocaltrackdirectiontheta)/
sizeof(hittrklocaltrackdirectiontheta[0]), -999.);
1766 std::fill(hittrklocaltrackdirectionphi, hittrklocaltrackdirectionphi +
sizeof(hittrklocaltrackdirectionphi)/
sizeof(hittrklocaltrackdirectionphi[0]), -999.);
1769 std::fill(hittrkpitchC, hittrkpitchC +
sizeof(hittrkpitchC)/
sizeof(hittrkpitchC[0]), -999.);
1771 std::fill(hittrkds, hittrkds +
sizeof(hittrkds)/
sizeof(hittrkds[0]), -999.);
1773 std::fill(hittrkchannel, hittrkchannel +
sizeof(hittrkchannel)/
sizeof(hittrkchannel[0]), -999);
1774 std::fill(hittrktpc, hittrktpc +
sizeof(hittrktpc)/
sizeof(hittrktpc[0]), -999);
1775 std::fill(hittrkview, hittrkview +
sizeof(hittrkview)/
sizeof(hittrkview[0]), -999);
1776 std::fill(hittrkwire, hittrkwire +
sizeof(hittrkwire)/
sizeof(hittrkwire[0]), -999);
1777 std::fill(hittrkpeakT, hittrkpeakT +
sizeof(hittrkpeakT)/
sizeof(hittrkpeakT[0]), -999.);
1778 std::fill(hittrkchargeintegral, hittrkchargeintegral +
sizeof(hittrkchargeintegral)/
sizeof(hittrkchargeintegral[0]), -999.);
1779 std::fill(hittrkph, hittrkph +
sizeof(hittrkph)/
sizeof(hittrkph[0]), -999.);
1780 std::fill(hittrkchargesum, hittrkchargesum +
sizeof(hittrkchargesum)/
sizeof(hittrkchargesum[0]), -999.);
1781 std::fill(hittrkstarT, hittrkstarT +
sizeof(hittrkstarT)/
sizeof(hittrkstarT[0]), -999.);
1782 std::fill(hittrkendT, hittrkendT +
sizeof(hittrkendT)/
sizeof(hittrkendT[0]), -999.);
1783 std::fill(hittrkrms, hittrkrms +
sizeof(hittrkrms)/
sizeof(hittrkrms[0]), -999.);
1784 std::fill(hittrkgoddnessofFit, hittrkgoddnessofFit +
sizeof(hittrkgoddnessofFit)/
sizeof(hittrkgoddnessofFit[0]), -999.);
1785 std::fill(hittrkmultiplicity, hittrkmultiplicity +
sizeof(hittrkmultiplicity)/
sizeof(hittrkmultiplicity[0]), -999);
1786 std::fill(hittrktrueID, hittrktrueID +
sizeof(hittrktrueID)/
sizeof(hittrktrueID[0]), -999);
1787 std::fill(hittrktrueEnergyMax, hittrktrueEnergyMax +
sizeof(hittrktrueEnergyMax)/
sizeof(hittrktrueEnergyMax[0]), -999);
1788 std::fill(hittrktrueEnergyFraction, hittrktrueEnergyFraction +
sizeof(hittrktrueEnergyFraction)/
sizeof(hittrktrueEnergyFraction[0]), -999);
1790 FillWith(trkId , -999 );
1791 FillWith(NHitsPerTrack , -999 );
1792 FillWith(trkncosmictags_tagger, -999 );
1793 FillWith(trkcosmicscore_tagger, -999.);
1794 FillWith(trkcosmictype_tagger, -999 );
1795 FillWith(trkncosmictags_containmenttagger, -999 );
1796 FillWith(trkcosmicscore_containmenttagger, -999.);
1797 FillWith(trkcosmictype_containmenttagger, -999 );
1798 FillWith(trkncosmictags_flashmatch, -999 );
1799 FillWith(trkcosmicscore_flashmatch, -999.);
1800 FillWith(trkcosmictype_flashmatch, -999 );
1801 FillWith(trkstartx , -999.);
1802 FillWith(trkstarty , -999.);
1803 FillWith(trkstartz , -999.);
1804 FillWith(trkstartd , -999.);
1805 FillWith(trkendx , -999.);
1806 FillWith(trkendy , -999.);
1807 FillWith(trkendz , -999.);
1808 FillWith(trkendd , -999.);
1809 FillWith(trkflashT0 , -999.);
1810 FillWith(trktrueT0 , -999.);
1811 FillWith(trkg4id , -9999 );
1812 FillWith(trkpurity , -999.);
1813 FillWith(trkcompleteness, -999.);
1814 FillWith(trkorig , -9999 );
1815 FillWith(trkstarttheta , -999.);
1816 FillWith(trkstartphi , -999.);
1817 FillWith(trkendtheta , -999.);
1818 FillWith(trkendphi , -999.);
1819 FillWith(trkstartdirectionx, -999.);
1820 FillWith(trkstartdirectiony, -999.);
1821 FillWith(trkstartdirectionz, -999.);
1822 FillWith(trkenddirectionx , -999.);
1823 FillWith(trkenddirectiony , -999.);
1824 FillWith(trkenddirectionz , -999.);
1825 FillWith(trkthetaxz , -999.);
1826 FillWith(trkthetayz , -999.);
1827 FillWith(trkmom , -999.);
1828 FillWith(trkmomrange , -999.);
1829 FillWith(trkmommschi2 , -999.);
1830 FillWith(trkmommsllhd , -999.);
1831 FillWith(trkmommscmic , -999.);
1832 FillWith(trkmommscfwd , -999.);
1833 FillWith(trkmommscbwd , -999.);
1834 FillWith(trkmommscllfwd , -999.);
1835 FillWith(trkmommscllbwd , -999.);
1836 FillWith(trkchi2PerNDF, -999.);
1837 FillWith(trkNDF, -999.);
1838 FillWith(trklen , -999.);
1839 FillWith(trklenstraightline, -999.);
1840 FillWith(trksvtxid , -1);
1841 FillWith(trkevtxid , -1);
1842 FillWith(trkpidbestplane, -1);
1843 FillWith(trkpidmvamu , -999.);
1844 FillWith(trkpidmvae , -999.);
1845 FillWith(trkpidmvapich, -999.);
1846 FillWith(trkpidmvaphoton , -999.);
1847 FillWith(trkpidmvapr , -999.);
1849 FillWith(trkhasPFParticle, -1);
1850 FillWith(trkPFParticleID , -1);
1852 for (
size_t iTrk = 0; iTrk < MaxTracks; ++iTrk){
1856 FillWith(trkke[iTrk] , -999.);
1857 FillWith(trkrange[iTrk] , -999.);
1858 FillWith(trkidtruth[iTrk] , -9999 );
1859 FillWith(trkorigin[iTrk] , -1 );
1860 FillWith(trkpdgtruth[iTrk], -9999 );
1861 FillWith(trkefftruth[iTrk], -999.);
1862 FillWith(trkpurtruth[iTrk], -999.);
1863 FillWith(trkpitchc[iTrk] , -999.);
1864 FillWith(ntrkhitsperview[iTrk] , -999 );
1866 FillWith(trkdedx[iTrk], 0.);
1867 FillWith(trkdqdx[iTrk], 0.);
1868 FillWith(trkresrg[iTrk], 0.);
1869 FillWith(trktpc[iTrk], -1);
1870 FillWith(trkxyz[iTrk], 0.);
1872 FillWith(trkpidpdg[iTrk] , -1);
1873 FillWith(trkpidchi[iTrk] , -999.);
1874 FillWith(trkpidchipr[iTrk] , -999.);
1875 FillWith(trkpidchika[iTrk] , -999.);
1876 FillWith(trkpidchipi[iTrk] , -999.);
1877 FillWith(trkpidchimu[iTrk] , -999.);
1878 FillWith(trkpidpida[iTrk] , -999.);
1887 if (MaxTracks == 0)
return;
1891 AutoResettingStringSteam sstr;
1893 std::string MaxTrackHitsIndexStr(
"[" + sstr.str() +
"]");
1898 BranchName =
"NumberOfTracks";
1899 CreateBranch(BranchName, &
ntracks, BranchName +
"/S");
1900 std::string NTracksIndexStr =
"[" + BranchName +
"]";
1902 BranchName =
"TrackID";
1903 CreateBranch(BranchName, trkId, BranchName + NTracksIndexStr +
"/S");
1905 BranchName =
"Track_NumberOfHits";
1906 CreateBranch(BranchName, NHitsPerTrack, BranchName + NTracksIndexStr +
"/S");
1908 BranchName =
"Track_Length_Trajectory";
1909 CreateBranch(BranchName, trklen, BranchName + NTracksIndexStr +
"/F");
1911 BranchName =
"Track_Length_StraightLine";
1912 CreateBranch(BranchName, trklenstraightline, BranchName + NTracksIndexStr +
"/F");
1914 BranchName =
"Track_Chi2PerNDF";
1915 CreateBranch(BranchName, trkchi2PerNDF, BranchName + NTracksIndexStr +
"/F");
1917 BranchName =
"Track_NDF";
1918 CreateBranch(BranchName, trkNDF, BranchName + NTracksIndexStr +
"/F");
1920 BranchName =
"Track_StartPoint_X";
1921 CreateBranch(BranchName, trkstartx, BranchName + NTracksIndexStr +
"/F");
1923 BranchName =
"Track_StartPoint_Y";
1924 CreateBranch(BranchName, trkstarty, BranchName + NTracksIndexStr +
"/F");
1926 BranchName =
"Track_StartPoint_Z";
1927 CreateBranch(BranchName, trkstartz, BranchName + NTracksIndexStr +
"/F");
1929 BranchName =
"Track_StartPoint_DistanceToBoundary";
1930 CreateBranch(BranchName, trkstartd, BranchName + NTracksIndexStr +
"/F");
1932 BranchName =
"Track_EndPoint_X";
1933 CreateBranch(BranchName, trkendx, BranchName + NTracksIndexStr +
"/F");
1935 BranchName =
"Track_EndPoint_Y";
1936 CreateBranch(BranchName, trkendy, BranchName + NTracksIndexStr +
"/F");
1938 BranchName =
"Track_EndPoint_Z";
1939 CreateBranch(BranchName, trkendz, BranchName + NTracksIndexStr +
"/F");
1941 BranchName =
"Track_EndPoint_DistanceToBoundary";
1942 CreateBranch(BranchName, trkendd, BranchName + NTracksIndexStr +
"/F");
1944 BranchName =
"Track_StartDirection_Theta";
1945 CreateBranch(BranchName, trkstarttheta, BranchName + NTracksIndexStr +
"/F");
1947 BranchName =
"Track_StartDirection_Phi";
1948 CreateBranch(BranchName, trkstartphi, BranchName + NTracksIndexStr +
"/F");
1950 BranchName =
"Track_StartDirection_X";
1951 CreateBranch(BranchName, trkstartdirectionx, BranchName + NTracksIndexStr +
"/F");
1953 BranchName =
"Track_StartDirection_Y";
1954 CreateBranch(BranchName, trkstartdirectiony, BranchName + NTracksIndexStr +
"/F");
1956 BranchName =
"Track_StartDirection_Z";
1957 CreateBranch(BranchName, trkstartdirectionz, BranchName + NTracksIndexStr +
"/F");
1959 BranchName =
"Track_EndDirection_Theta";
1960 CreateBranch(BranchName, trkendtheta, BranchName + NTracksIndexStr +
"/F");
1962 BranchName =
"Track_EndDirection_Phi";
1963 CreateBranch(BranchName, trkendphi, BranchName + NTracksIndexStr +
"/F");
1965 BranchName =
"Track_EndDirection_X";
1966 CreateBranch(BranchName, trkenddirectionx, BranchName + NTracksIndexStr +
"/F");
1968 BranchName =
"Track_EndDirection_Y";
1969 CreateBranch(BranchName, trkenddirectiony, BranchName + NTracksIndexStr +
"/F");
1971 BranchName =
"Track_EndDirection_Z";
1972 CreateBranch(BranchName, trkenddirectionz, BranchName + NTracksIndexStr +
"/F");
1977 BranchName =
"Track_Momentum";
1978 CreateBranch(BranchName, trkmom, BranchName + NTracksIndexStr +
"/F");
1980 BranchName =
"Track_Momentum_Range";
1981 CreateBranch(BranchName, trkmomrange, BranchName + NTracksIndexStr +
"/F");
1983 BranchName =
"Track_Momentum_mschi";
1984 CreateBranch(BranchName, trkmommschi2, BranchName + NTracksIndexStr +
"/F");
1986 BranchName =
"Track_Momentum_mscmic";
1987 CreateBranch(BranchName, trkmommscmic, BranchName + NTracksIndexStr +
"/F");
1989 BranchName =
"Track_Momentum_mscfwd";
1990 CreateBranch(BranchName, trkmommscfwd, BranchName + NTracksIndexStr +
"/F");
1992 BranchName =
"Track_Momentum_mscbwd";
1993 CreateBranch(BranchName, trkmommscbwd, BranchName + NTracksIndexStr +
"/F");
1995 BranchName =
"Track_Momentum_mscllfwd";
1996 CreateBranch(BranchName, trkmommscllfwd, BranchName + NTracksIndexStr +
"/F");
1998 BranchName =
"Track_Momentum_mscllbwd";
1999 CreateBranch(BranchName, trkmommscllbwd, BranchName + NTracksIndexStr +
"/F");
2053 BranchName =
"Track_PitchInViews";
2054 CreateBranch(BranchName, trkpitchc, BranchName + NTracksIndexStr +
"[2]/F");
2056 BranchName =
"Track_NumberOfHitsPerView";
2057 CreateBranch(BranchName, ntrkhitsperview, BranchName + NTracksIndexStr +
"[2]/S");
2085 BranchName =
"Track_Hit_X";
2086 CreateBranch(BranchName, hittrkx, BranchName +
"[no_hits]/F");
2088 BranchName =
"Track_Hit_Y";
2089 CreateBranch(BranchName, hittrky, BranchName +
"[no_hits]/F");
2091 BranchName =
"Track_Hit_Z";
2092 CreateBranch(BranchName, hittrkz, BranchName +
"[no_hits]/F");
2094 BranchName =
"Track_Hit_LocalTrackDirection_X";
2095 CreateBranch(BranchName, hittrklocaltrackdirectionx, BranchName +
"[no_hits]/F");
2097 BranchName =
"Track_Hit_LocalTrackDirection_Y";
2098 CreateBranch(BranchName, hittrklocaltrackdirectiony, BranchName +
"[no_hits]/F");
2100 BranchName =
"Track_Hit_LocalTrackDirection_Z";
2101 CreateBranch(BranchName, hittrklocaltrackdirectionz, BranchName +
"[no_hits]/F");
2103 BranchName =
"Track_Hit_LocalTrackDirection_Theta";
2104 CreateBranch(BranchName, hittrklocaltrackdirectiontheta, BranchName +
"[no_hits]/F");
2106 BranchName =
"Track_Hit_LocalTrackDirection_Phi";
2107 CreateBranch(BranchName, hittrklocaltrackdirectionphi, BranchName +
"[no_hits]/F");
2109 BranchName =
"Track_Hit_ds_LocalTrackDirection";
2110 CreateBranch(BranchName, hittrkpitchC, BranchName +
"[no_hits]/F");
2112 BranchName =
"Track_Hit_ds_3DPosition";
2113 CreateBranch(BranchName, hittrkds, BranchName +
"[no_hits]/F");
2115 BranchName =
"Track_Hit_TPC";
2116 CreateBranch(BranchName, hittrktpc, BranchName +
"[no_hits]/S");
2118 BranchName =
"Track_Hit_View";
2119 CreateBranch(BranchName, hittrkview, BranchName +
"[no_hits]/S");
2121 BranchName =
"Track_Hit_Channel";
2122 CreateBranch(BranchName, hittrkchannel, BranchName +
"[no_hits]/S");
2127 BranchName =
"Track_Hit_PeakTime";
2128 CreateBranch(BranchName, hittrkpeakT, BranchName +
"[no_hits]/F");
2130 BranchName =
"Track_Hit_ChargeSummedADC";
2131 CreateBranch(BranchName, hittrkchargesum, BranchName +
"[no_hits]/F");
2133 BranchName =
"Track_Hit_ChargeIntegral";
2134 CreateBranch(BranchName, hittrkchargeintegral, BranchName +
"[no_hits]/F");
2136 BranchName =
"Track_Hit_Amplitude";
2137 CreateBranch(BranchName, hittrkph, BranchName +
"[no_hits]/F");
2139 BranchName =
"Track_Hit_StartTime";
2140 CreateBranch(BranchName, hittrkstarT, BranchName +
"[no_hits]/F");
2142 BranchName =
"Track_Hit_EndTime";
2143 CreateBranch(BranchName, hittrkendT, BranchName +
"[no_hits]/F");
2145 BranchName =
"Track_Hit_Width";
2146 CreateBranch(BranchName, hittrkrms, BranchName +
"[no_hits]/F");
2148 BranchName =
"Track_Hit_GoodnessOfFit";
2149 CreateBranch(BranchName, hittrkgoddnessofFit, BranchName +
"[no_hits]/F");
2151 BranchName =
"Track_Hit_Multiplicity";
2152 CreateBranch(BranchName, hittrkmultiplicity, BranchName +
"[no_hits]/S");
2154 BranchName =
"Track_Hit_trueID";
2155 CreateBranch(BranchName, hittrktrueID, BranchName +
"[no_hits]/I");
2157 BranchName =
"Track_Hit_trueEnergyMax";
2158 CreateBranch(BranchName, hittrktrueEnergyMax, BranchName +
"[no_hits]/F");
2160 BranchName =
"Track_Hit_trueEnergyFraction";
2161 CreateBranch(BranchName, hittrktrueEnergyFraction, BranchName +
"[no_hits]/F");
2287 MaxVertices = nVertices;
2288 vtxId.resize(MaxVertices);
2289 vtxx.resize(MaxVertices);
2290 vtxy.resize(MaxVertices);
2291 vtxz.resize(MaxVertices);
2293 vtxhasPFParticle.resize(MaxVertices);
2294 vtxPFParticleID.resize(MaxVertices);
2298 Resize(MaxVertices);
2301 FillWith(vtxId , -999 );
2302 FillWith(vtxx , -999 );
2303 FillWith(vtxy , -999 );
2304 FillWith(vtxz , -999 );
2305 FillWith(vtxhasPFParticle, -1 );
2306 FillWith(vtxPFParticleID , -1 );
2312 if (MaxVertices == 0)
return;
2316 AutoResettingStringSteam sstr;
2351 MaxPFParticles = nPFParticles;
2353 pfp_selfID.resize(MaxPFParticles);
2354 pfp_isPrimary.resize(MaxPFParticles);
2355 pfp_numDaughters.resize(MaxPFParticles);
2356 pfp_daughterIDs.resize(MaxPFParticles);
2357 pfp_parentID.resize(MaxPFParticles);
2358 pfp_vertexID.resize(MaxPFParticles);
2359 pfp_isShower.resize(MaxPFParticles);
2360 pfp_isTrack.resize(MaxPFParticles);
2361 pfp_trackID.resize(MaxPFParticles);
2362 pfp_showerID.resize(MaxPFParticles);
2363 pfp_pdgCode.resize(MaxPFParticles);
2364 pfp_numClusters.resize(MaxPFParticles);
2365 pfp_clusterIDs.resize(MaxPFParticles);
2366 pfp_isNeutrino.resize(MaxPFParticles);
2370 Resize(MaxPFParticles);
2372 nPFParticles = -999;
2373 FillWith(pfp_selfID, -999);
2374 FillWith(pfp_isPrimary, -999);
2375 FillWith(pfp_numDaughters, -999);
2376 FillWith(pfp_parentID, -999);
2377 FillWith(pfp_vertexID, -999);
2378 FillWith(pfp_isShower, -999);
2379 FillWith(pfp_isTrack, -999);
2380 FillWith(pfp_trackID, -999);
2381 FillWith(pfp_showerID, -999);
2382 FillWith(pfp_pdgCode, -999);
2383 FillWith(pfp_isNeutrino, -999);
2384 pfp_numNeutrinos = -999;
2385 FillWith(pfp_neutrinoIDs, -999);
2387 for (
size_t iPFParticle = 0; iPFParticle < MaxPFParticles; ++iPFParticle){
2390 FillWith(pfp_daughterIDs[iPFParticle], -999);
2391 FillWith(pfp_clusterIDs[iPFParticle], -999);
2399 if (MaxPFParticles == 0) {
return; }
2403 AutoResettingStringSteam sstr;
2405 std::string MaxNDaughtersIndexStr(
"[" + sstr.str() +
"]");
2409 std::string MaxNClustersIndexStr(
"[" + sstr.str() +
"]");
2413 std::string MaxNNeutrinosIndexStr(
"[" + sstr.str() +
"]");
2417 BranchName =
"nPFParticles";
2418 CreateBranch(BranchName, &nPFParticles, BranchName +
"/S");
2419 std::string NPFParticleIndexStr =
"[" + BranchName +
"]";
2421 BranchName =
"pfp_selfID";
2422 CreateBranch(BranchName, pfp_selfID, BranchName + NPFParticleIndexStr +
"/S");
2424 BranchName =
"pfp_isPrimary";
2425 CreateBranch(BranchName, pfp_isPrimary, BranchName + NPFParticleIndexStr +
"/S");
2427 BranchName =
"pfp_numDaughters";
2428 CreateBranch(BranchName, pfp_numDaughters, BranchName + NPFParticleIndexStr +
"/S");
2430 BranchName =
"pfp_daughterIDs";
2431 CreateBranch(BranchName, pfp_daughterIDs, BranchName + NPFParticleIndexStr + MaxNDaughtersIndexStr +
"/S");
2433 BranchName =
"pfp_parentID";
2434 CreateBranch(BranchName, pfp_parentID, BranchName + NPFParticleIndexStr +
"/S");
2436 BranchName =
"pfp_vertexID";
2437 CreateBranch(BranchName, pfp_vertexID, BranchName + NPFParticleIndexStr +
"/S");
2439 BranchName =
"pfp_isShower";
2440 CreateBranch(BranchName, pfp_isShower, BranchName + NPFParticleIndexStr +
"/S");
2442 BranchName =
"pfp_isTrack";
2443 CreateBranch(BranchName, pfp_isTrack, BranchName + NPFParticleIndexStr +
"/S");
2445 BranchName =
"pfp_trackID";
2446 CreateBranch(BranchName, pfp_trackID, BranchName + NPFParticleIndexStr +
"/S");
2448 BranchName =
"pfp_showerID";
2449 CreateBranch(BranchName, pfp_showerID, BranchName + NPFParticleIndexStr +
"/S");
2451 BranchName =
"pfp_pdgCode";
2452 CreateBranch(BranchName, pfp_pdgCode, BranchName + NPFParticleIndexStr +
"/I");
2454 BranchName =
"pfp_numClusters";
2455 CreateBranch(BranchName, pfp_numClusters, BranchName + NPFParticleIndexStr +
"/S");
2457 BranchName =
"pfp_clusterIDs";
2458 CreateBranch(BranchName, pfp_clusterIDs, BranchName + NPFParticleIndexStr + MaxNClustersIndexStr +
"/S");
2460 BranchName =
"pfp_isNeutrino";
2461 CreateBranch(BranchName, pfp_isNeutrino, BranchName + NPFParticleIndexStr +
"/S");
2463 BranchName =
"pfp_numNeutrinos";
2464 CreateBranch(BranchName, &pfp_numNeutrinos, BranchName +
"/S");
2466 BranchName =
"pfp_neutrinoIDs";
2467 CreateBranch(BranchName, pfp_neutrinoIDs, BranchName + MaxNNeutrinosIndexStr +
"/S");
2477 MaxShowers = nShowers;
2479 showerID.resize(MaxShowers);
2480 shwr_bestplane.resize(MaxShowers);
2481 shwr_length.resize(MaxShowers);
2482 shwr_startdcosx.resize(MaxShowers);
2483 shwr_startdcosy.resize(MaxShowers);
2484 shwr_startdcosz.resize(MaxShowers);
2485 shwr_startx.resize(MaxShowers);
2486 shwr_starty.resize(MaxShowers);
2487 shwr_startz.resize(MaxShowers);
2488 shwr_totEng.resize(MaxShowers);
2489 shwr_dedx.resize(MaxShowers);
2490 shwr_mipEng.resize(MaxShowers);
2491 shwr_pidmvamu.resize(MaxShowers);
2492 shwr_pidmvae.resize(MaxShowers);
2493 shwr_pidmvapich.resize(MaxShowers);
2494 shwr_pidmvaphoton.resize(MaxShowers);
2495 shwr_pidmvapr.resize(MaxShowers);
2497 shwr_hasPFParticle.resize(MaxShowers);
2498 shwr_PFParticleID.resize(MaxShowers);
2506 FillWith(showerID, -999 );
2507 FillWith(shwr_bestplane, -999 );
2508 FillWith(shwr_length, -999.);
2509 FillWith(shwr_startdcosx, -999.);
2510 FillWith(shwr_startdcosy, -999.);
2511 FillWith(shwr_startdcosz, -999.);
2512 FillWith(shwr_startx, -999.);
2513 FillWith(shwr_starty, -999.);
2514 FillWith(shwr_startz, -999.);
2515 FillWith(shwr_pidmvamu, -999.);
2516 FillWith(shwr_pidmvae, -999.);
2517 FillWith(shwr_pidmvapich, -999.);
2518 FillWith(shwr_pidmvaphoton, -999.);
2519 FillWith(shwr_pidmvapr, -999.);
2521 FillWith(shwr_hasPFParticle, -1);
2522 FillWith(shwr_PFParticleID, -1);
2524 for (
size_t iShw = 0; iShw < MaxShowers; ++iShw){
2527 FillWith(shwr_totEng[iShw], -999.);
2528 FillWith(shwr_dedx[iShw], -999.);
2529 FillWith(shwr_mipEng[iShw], -999.);
2554 SetAddresses(pTree);
2565 if (MaxShowers == 0)
return;
2569 AutoResettingStringSteam sstr;
2571 std::string MaxShowerHitsIndexStr(
"[" + sstr.str() +
"]");
2576 BranchName =
"nshowers_" + ShowerLabel;
2577 CreateBranch(BranchName, &nshowers, BranchName +
"/S");
2578 std::string NShowerIndexStr =
"[" + BranchName +
"]";
2580 BranchName =
"showerID_" + ShowerLabel;
2581 CreateBranch(BranchName, showerID, BranchName + NShowerIndexStr +
"/S");
2583 BranchName =
"shwr_bestplane_" + ShowerLabel;
2584 CreateBranch(BranchName, shwr_bestplane, BranchName + NShowerIndexStr +
"/S");
2586 BranchName =
"shwr_length_" + ShowerLabel;
2587 CreateBranch(BranchName, shwr_length, BranchName + NShowerIndexStr +
"/F");
2589 BranchName =
"shwr_startdcosx_" + ShowerLabel;
2590 CreateBranch(BranchName, shwr_startdcosx, BranchName + NShowerIndexStr +
"/F");
2592 BranchName =
"shwr_startdcosy_" + ShowerLabel;
2593 CreateBranch(BranchName, shwr_startdcosy, BranchName + NShowerIndexStr +
"/F");
2595 BranchName =
"shwr_startdcosz_" + ShowerLabel;
2596 CreateBranch(BranchName, shwr_startdcosz, BranchName + NShowerIndexStr +
"/F");
2598 BranchName =
"shwr_startx_" + ShowerLabel;
2599 CreateBranch(BranchName, shwr_startx, BranchName + NShowerIndexStr +
"/F");
2601 BranchName =
"shwr_starty_" + ShowerLabel;
2602 CreateBranch(BranchName, shwr_starty, BranchName + NShowerIndexStr +
"/F");
2604 BranchName =
"shwr_startz_" + ShowerLabel;
2605 CreateBranch(BranchName, shwr_startz, BranchName + NShowerIndexStr +
"/F");
2607 BranchName =
"shwr_totEng_" + ShowerLabel;
2608 CreateBranch(BranchName, shwr_totEng, BranchName + NShowerIndexStr +
"[3]/F");
2610 BranchName =
"shwr_dedx_" + ShowerLabel;
2611 CreateBranch(BranchName, shwr_dedx, BranchName + NShowerIndexStr +
"[3]/F");
2613 BranchName =
"shwr_mipEng_" + ShowerLabel;
2614 CreateBranch(BranchName, shwr_mipEng, BranchName + NShowerIndexStr +
"[3]/F");
2616 BranchName =
"shwr_hasPFParticle_" + ShowerLabel;
2617 CreateBranch(BranchName, shwr_hasPFParticle, BranchName + NShowerIndexStr +
"/S");
2619 BranchName =
"shwr_PFParticleID_" + ShowerLabel;
2620 CreateBranch(BranchName, shwr_PFParticleID, BranchName + NShowerIndexStr +
"/S");
2622 BranchName =
"shwr_pidmvamu_" + ShowerLabel;
2623 CreateBranch(BranchName, shwr_pidmvamu, BranchName + NShowerIndexStr +
"/F");
2625 BranchName =
"shwr_pidmvae_" + ShowerLabel;
2626 CreateBranch(BranchName, shwr_pidmvae, BranchName + NShowerIndexStr +
"/F");
2628 BranchName =
"shwr_pidmvapich_" + ShowerLabel;
2629 CreateBranch(BranchName, shwr_pidmvapich, BranchName + NShowerIndexStr +
"/F");
2631 BranchName =
"shwr_pidmvaphoton_" + ShowerLabel;
2632 CreateBranch(BranchName, shwr_pidmvaphoton, BranchName + NShowerIndexStr +
"/F");
2634 BranchName =
"shwr_pidmvapr_" + ShowerLabel;
2635 CreateBranch(BranchName, shwr_pidmvapr, BranchName + NShowerIndexStr +
"/F");
2651 evttime_seconds = -9999;
2652 evttime_nanoseconds = -9999;
2657 triggertime = -9999;
2658 beamgatetime = -9999;
2666 NHitsInAllTracks = 0;
2668 std::fill(hit_tpc, hit_tpc +
sizeof(hit_tpc)/
sizeof(hit_tpc[0]), -999);
2669 std::fill(hit_view, hit_view +
sizeof(hit_view)/
sizeof(hit_view[0]), -999);
2670 std::fill(hit_wire, hit_wire +
sizeof(hit_wire)/
sizeof(hit_wire[0]), -999);
2671 std::fill(hit_channel, hit_channel +
sizeof(hit_channel)/
sizeof(hit_channel[0]), -999);
2672 std::fill(hit_peakT, hit_peakT +
sizeof(hit_peakT)/
sizeof(hit_peakT[0]), -999.);
2673 std::fill(hit_chargesum, hit_chargesum +
sizeof(hit_chargesum)/
sizeof(hit_chargesum[0]), -999.);
2674 std::fill(hit_chargeintegral, hit_chargeintegral +
sizeof(hit_chargeintegral)/
sizeof(hit_chargeintegral[0]), -999.);
2675 std::fill(hit_ph, hit_ph +
sizeof(hit_ph)/
sizeof(hit_ph[0]), -999.);
2676 std::fill(hit_startT, hit_startT +
sizeof(hit_startT)/
sizeof(hit_startT[0]), -999.);
2677 std::fill(hit_endT, hit_endT +
sizeof(hit_endT)/
sizeof(hit_endT[0]), -999.);
2678 std::fill(hit_rms, hit_rms +
sizeof(hit_rms)/
sizeof(hit_rms[0]), -999.);
2680 std::fill(hit_goodnessOfFit, hit_goodnessOfFit +
sizeof(hit_goodnessOfFit)/
sizeof(hit_goodnessOfFit[0]), -999.);
2681 std::fill(hit_fitparamampl, hit_fitparamampl +
sizeof(hit_fitparamampl)/
sizeof(hit_fitparamampl[0]), -999.);
2682 std::fill(hit_fitparamt0, hit_fitparamt0 +
sizeof(hit_fitparamt0)/
sizeof(hit_fitparamt0[0]), -999.);
2683 std::fill(hit_fitparamtau1, hit_fitparamtau1 +
sizeof(hit_fitparamtau1)/
sizeof(hit_fitparamtau1[0]), -999.);
2684 std::fill(hit_fitparamtau2, hit_fitparamtau2 +
sizeof(hit_fitparamtau2)/
sizeof(hit_fitparamtau2[0]), -999.);
2685 std::fill(hit_multiplicity, hit_multiplicity +
sizeof(hit_multiplicity)/
sizeof(hit_multiplicity[0]), -999.);
2686 std::fill(hit_trueID, hit_trueID +
sizeof(hit_trueID)/
sizeof(hit_trueID[0]), -999.);
2687 std::fill(hit_trueEnergyMax, hit_trueEnergyMax +
sizeof(hit_trueEnergyMax)/
sizeof(hit_trueEnergyMax[0]), -999.);
2688 std::fill(hit_trueEnergyFraction, hit_trueEnergyFraction +
sizeof(hit_trueEnergyFraction)/
sizeof(hit_trueEnergyFraction[0]), -999.);
2689 std::fill(hit_trkid, hit_trkid +
sizeof(hit_trkid)/
sizeof(hit_trkid[0]), -999);
2691 std::fill(hit_clusterid, hit_clusterid +
sizeof(hit_clusterid)/
sizeof(hit_clusterid[0]), -9999);
2705 no_ticksinallchannels = 0;
2706 std::fill(rawD_ADC, rawD_ADC +
sizeof(rawD_ADC)/
sizeof(rawD_ADC[0]), -999);
2707 std::fill(rawD_Channel, rawD_Channel +
sizeof(rawD_Channel)/
sizeof(rawD_Channel[0]), -999);
2710 std::fill(recoW_Channel, recoW_Channel +
sizeof(recoW_Channel)/
sizeof(recoW_Channel[0]), -999);
2711 std::fill(recoW_NTicks, recoW_NTicks +
sizeof(recoW_NTicks)/
sizeof(recoW_NTicks[0]), -999);
2713 no_recoticksinallchannels=0;
2714 std::fill(recoW_Tick, recoW_Tick +
sizeof(recoW_Tick)/
sizeof(recoW_Tick[0]), -999);
2715 std::fill(recoW_ADC, recoW_ADC +
sizeof(recoW_ADC)/
sizeof(recoW_ADC[0]), -999);
2718 FillWith(photons_time,-999);
2719 FillWith(photons_channel,-999);
2722 std::fill(flash_time, flash_time +
sizeof(flash_time)/
sizeof(flash_time[0]), -999);
2723 std::fill(flash_pe, flash_pe +
sizeof(flash_pe)/
sizeof(flash_pe[0]), -999);
2724 std::fill(flash_ycenter, flash_ycenter +
sizeof(flash_ycenter)/
sizeof(flash_ycenter[0]), -999);
2725 std::fill(flash_zcenter, flash_zcenter +
sizeof(flash_zcenter)/
sizeof(flash_zcenter[0]), -999);
2726 std::fill(flash_ywidth, flash_ywidth +
sizeof(flash_ywidth)/
sizeof(flash_ywidth[0]), -999);
2727 std::fill(flash_zwidth, flash_zwidth +
sizeof(flash_zwidth)/
sizeof(flash_zwidth[0]), -999);
2728 std::fill(flash_timewidth, flash_timewidth +
sizeof(flash_timewidth)/
sizeof(flash_timewidth[0]), -999);
2730 no_ExternCounts = 0;
2731 std::fill(externcounts_time, externcounts_time +
sizeof(externcounts_time)/
sizeof(externcounts_time[0]), -999);
2732 std::fill(externcounts_id, externcounts_id +
sizeof(externcounts_id)/
sizeof(externcounts_id[0]), -999);
2735 std::fill(clusterId, clusterId +
sizeof(clusterId)/
sizeof(clusterId[0]), -999);
2736 std::fill(clusterView, clusterView +
sizeof(clusterView)/
sizeof(clusterView[0]), -999);
2737 std::fill(cluster_isValid, cluster_isValid +
sizeof(cluster_isValid)/
sizeof(cluster_isValid[0]), -1);
2738 std::fill(cluster_StartCharge, cluster_StartCharge +
sizeof(cluster_StartCharge)/
sizeof(cluster_StartCharge[0]), -999.);
2739 std::fill(cluster_StartAngle, cluster_StartAngle +
sizeof(cluster_StartAngle)/
sizeof(cluster_StartAngle[0]), -999.);
2740 std::fill(cluster_EndCharge, cluster_EndCharge +
sizeof(cluster_EndCharge)/
sizeof(cluster_EndCharge[0]), -999.);
2741 std::fill(cluster_EndAngle , cluster_EndAngle +
sizeof(cluster_EndAngle)/
sizeof(cluster_EndAngle[0]), -999.);
2742 std::fill(cluster_Integral , cluster_Integral +
sizeof(cluster_Integral)/
sizeof(cluster_Integral[0]), -999.);
2743 std::fill(cluster_IntegralAverage, cluster_IntegralAverage +
sizeof(cluster_IntegralAverage)/
sizeof(cluster_IntegralAverage[0]), -999.);
2744 std::fill(cluster_SummedADC, cluster_SummedADC +
sizeof(cluster_SummedADC)/
sizeof(cluster_SummedADC[0]), -999.);
2745 std::fill(cluster_SummedADCaverage, cluster_SummedADCaverage +
sizeof(cluster_SummedADCaverage)/
sizeof(cluster_SummedADCaverage[0]), -999.);
2746 std::fill(cluster_MultipleHitDensity, cluster_MultipleHitDensity +
sizeof(cluster_MultipleHitDensity)/
sizeof(cluster_MultipleHitDensity[0]), -999.);
2747 std::fill(cluster_Width, cluster_Width +
sizeof(cluster_Width)/
sizeof(cluster_Width[0]), -999.);
2748 std::fill(cluster_NHits, cluster_NHits +
sizeof(cluster_NHits)/
sizeof(cluster_NHits[0]), -999);
2749 std::fill(cluster_StartWire, cluster_StartWire +
sizeof(cluster_StartWire)/
sizeof(cluster_StartWire[0]), -999);
2750 std::fill(cluster_StartTick, cluster_StartTick +
sizeof(cluster_StartTick)/
sizeof(cluster_StartTick[0]), -999);
2751 std::fill(cluster_EndWire, cluster_EndWire +
sizeof(cluster_EndWire)/
sizeof(cluster_EndWire[0]), -999);
2752 std::fill(cluster_EndTick, cluster_EndTick +
sizeof(cluster_EndTick)/
sizeof(cluster_EndTick[0]), -999);
2758 std::fill(nuvtxx, nuvtxx +
sizeof(nuvtxx)/
sizeof(nuvtxx[0]), -999.);
2759 std::fill(nuvtxy, nuvtxy +
sizeof(nuvtxy)/
sizeof(nuvtxy[0]), -999.);
2760 std::fill(nuvtxz, nuvtxz +
sizeof(nuvtxz)/
sizeof(nuvtxz[0]), -999.);
2761 std::fill(nuvtxpdg, nuvtxpdg +
sizeof(nuvtxpdg)/
sizeof(nuvtxpdg[0]), -9999);
2763 mcevts_truth = -9999;
2764 mcevts_truthcry = -9999;
2765 std::fill(nuPDG_truth, nuPDG_truth +
sizeof(nuPDG_truth)/
sizeof(nuPDG_truth[0]), -999.);
2766 std::fill(ccnc_truth, ccnc_truth +
sizeof(ccnc_truth)/
sizeof(ccnc_truth[0]), -999.);
2767 std::fill(mode_truth, mode_truth +
sizeof(mode_truth)/
sizeof(mode_truth[0]), -999.);
2768 std::fill(enu_truth, enu_truth +
sizeof(enu_truth)/
sizeof(enu_truth[0]), -999.);
2769 std::fill(Q2_truth, Q2_truth +
sizeof(Q2_truth)/
sizeof(Q2_truth[0]), -999.);
2770 std::fill(W_truth, W_truth +
sizeof(W_truth)/
sizeof(W_truth[0]), -999.);
2771 std::fill(X_truth, X_truth +
sizeof(X_truth)/
sizeof(X_truth[0]), -999.);
2772 std::fill(Y_truth, Y_truth +
sizeof(Y_truth)/
sizeof(Y_truth[0]), -999.);
2773 std::fill(hitnuc_truth, hitnuc_truth +
sizeof(hitnuc_truth)/
sizeof(hitnuc_truth[0]), -999.);
2774 std::fill(nuvtxx_truth, nuvtxx_truth +
sizeof(nuvtxx_truth)/
sizeof(nuvtxx_truth[0]), -999.);
2775 std::fill(nuvtxy_truth, nuvtxy_truth +
sizeof(nuvtxy_truth)/
sizeof(nuvtxy_truth[0]), -999.);
2776 std::fill(nuvtxz_truth, nuvtxz_truth +
sizeof(nuvtxz_truth)/
sizeof(nuvtxz_truth[0]), -999.);
2777 std::fill(nu_dcosx_truth, nu_dcosx_truth +
sizeof(nu_dcosx_truth)/
sizeof(nu_dcosx_truth[0]), -999.);
2778 std::fill(nu_dcosy_truth, nu_dcosy_truth +
sizeof(nu_dcosy_truth)/
sizeof(nu_dcosy_truth[0]), -999.);
2779 std::fill(nu_dcosz_truth, nu_dcosz_truth +
sizeof(nu_dcosz_truth)/
sizeof(nu_dcosz_truth[0]), -999.);
2780 std::fill(lep_mom_truth, lep_mom_truth +
sizeof(lep_mom_truth)/
sizeof(lep_mom_truth[0]), -999.);
2781 std::fill(lep_dcosx_truth, lep_dcosx_truth +
sizeof(lep_dcosx_truth)/
sizeof(lep_dcosx_truth[0]), -999.);
2782 std::fill(lep_dcosy_truth, lep_dcosy_truth +
sizeof(lep_dcosy_truth)/
sizeof(lep_dcosy_truth[0]), -999.);
2783 std::fill(lep_dcosz_truth, lep_dcosz_truth +
sizeof(lep_dcosz_truth)/
sizeof(lep_dcosz_truth[0]), -999.);
2786 std::fill(vx_flux, vx_flux +
sizeof(vx_flux)/
sizeof(vx_flux[0]), -999.);
2787 std::fill(vy_flux, vy_flux +
sizeof(vy_flux)/
sizeof(vy_flux[0]), -999.);
2788 std::fill(vz_flux, vz_flux +
sizeof(vz_flux)/
sizeof(vz_flux[0]), -999.);
2789 std::fill(pdpx_flux, pdpx_flux +
sizeof(pdpx_flux)/
sizeof(pdpx_flux[0]), -999.);
2790 std::fill(pdpy_flux, pdpy_flux +
sizeof(pdpy_flux)/
sizeof(pdpy_flux[0]), -999.);
2791 std::fill(pdpz_flux, pdpz_flux +
sizeof(pdpz_flux)/
sizeof(pdpz_flux[0]), -999.);
2792 std::fill(ppdxdz_flux, ppdxdz_flux +
sizeof(ppdxdz_flux)/
sizeof(ppdxdz_flux[0]), -999.);
2793 std::fill(ppdydz_flux, ppdydz_flux +
sizeof(ppdydz_flux)/
sizeof(ppdydz_flux[0]), -999.);
2794 std::fill(pppz_flux, pppz_flux +
sizeof(pppz_flux)/
sizeof(pppz_flux[0]), -999.);
2795 std::fill(ptype_flux, ptype_flux +
sizeof(ptype_flux)/
sizeof(ptype_flux[0]), -999);
2796 std::fill(ppvx_flux, ppvx_flux +
sizeof(ppvx_flux)/
sizeof(ppvx_flux[0]), -999.);
2797 std::fill(ppvy_flux, ppvy_flux +
sizeof(ppvy_flux)/
sizeof(ppvy_flux[0]), -999.);
2798 std::fill(ppvz_flux, ppvz_flux +
sizeof(ppvz_flux)/
sizeof(ppvz_flux[0]), -999.);
2799 std::fill(muparpx_flux, muparpx_flux +
sizeof(muparpx_flux)/
sizeof(muparpx_flux[0]), -999.);
2800 std::fill(muparpy_flux, muparpy_flux +
sizeof(muparpy_flux)/
sizeof(muparpy_flux[0]), -999.);
2801 std::fill(muparpz_flux, muparpz_flux +
sizeof(muparpz_flux)/
sizeof(muparpz_flux[0]), -999.);
2802 std::fill(mupare_flux, mupare_flux +
sizeof(mupare_flux)/
sizeof(mupare_flux[0]), -999.);
2803 std::fill(tgen_flux, tgen_flux +
sizeof(tgen_flux)/
sizeof(tgen_flux[0]), -999);
2804 std::fill(tgptype_flux, tgptype_flux +
sizeof(tgptype_flux)/
sizeof(tgptype_flux[0]), -999);
2805 std::fill(tgppx_flux, tgppx_flux +
sizeof(tgppx_flux)/
sizeof(tgppx_flux[0]), -999.);
2806 std::fill(tgppy_flux, tgppy_flux +
sizeof(tgppy_flux)/
sizeof(tgppy_flux[0]), -999.);
2807 std::fill(tgppz_flux, tgppz_flux +
sizeof(tgppz_flux)/
sizeof(tgppz_flux[0]), -999.);
2808 std::fill(tprivx_flux, tprivx_flux +
sizeof(tprivx_flux)/
sizeof(tprivx_flux[0]), -999.);
2809 std::fill(tprivy_flux, tprivy_flux +
sizeof(tprivy_flux)/
sizeof(tprivy_flux[0]), -999.);
2810 std::fill(tprivz_flux, tprivz_flux +
sizeof(tprivz_flux)/
sizeof(tprivz_flux[0]), -999.);
2811 std::fill(dk2gen_flux, dk2gen_flux +
sizeof(dk2gen_flux)/
sizeof(dk2gen_flux[0]), -999.);
2812 std::fill(gen2vtx_flux, gen2vtx_flux +
sizeof(gen2vtx_flux)/
sizeof(gen2vtx_flux[0]), -999.);
2813 std::fill(tpx_flux, tpx_flux +
sizeof(tpx_flux)/
sizeof(tpx_flux[0]), -999.);
2814 std::fill(tpy_flux, tpy_flux +
sizeof(tpy_flux)/
sizeof(tpy_flux[0]), -999.);
2815 std::fill(tpz_flux, tpz_flux +
sizeof(tpz_flux)/
sizeof(tpz_flux[0]), -999.);
2816 std::fill(tptype_flux, tptype_flux +
sizeof(tptype_flux)/
sizeof(tptype_flux[0]), -999.);
2818 genie_no_primaries = 0;
2819 cry_no_primaries = 0;
2820 proto_no_primaries = 0;
2821 generator_list_size = 0;
2824 geant_list_size_in_tpcAV = 0;
2828 FillWith(
pdg, -9999);
2830 FillWith(
Mass, -999.);
2831 FillWith(Eng, -999.);
2832 FillWith(EndE, -999.);
2833 FillWith(Px, -999.);
2834 FillWith(Py, -999.);
2835 FillWith(Pz, -999.);
2837 FillWith(StartPointx, -999.);
2838 FillWith(StartPointy, -999.);
2839 FillWith(StartPointz, -999.);
2840 FillWith(StartT, -99e7);
2841 FillWith(EndT, -999.);
2842 FillWith(EndPointx, -999.);
2843 FillWith(EndPointy, -999.);
2844 FillWith(EndPointz, -999.);
2845 FillWith(EndT, -99e7);
2846 FillWith(
theta, -999.);
2847 FillWith(phi, -999.);
2848 FillWith(theta_xz, -999.);
2849 FillWith(theta_yz, -999.);
2851 FillWith(pathlen_tpcAV, -999.);
2852 FillWith(inTPCActive, -9999);
2853 FillWith(TrackId_tpcAV, -9999);
2854 FillWith(PDGCode_tpcAV, -9999);
2855 FillWith(StartPointx_tpcAV, -999.);
2856 FillWith(StartPointy_tpcAV, -999.);
2857 FillWith(StartPointz_tpcAV, -999.);
2858 FillWith(StartT_tpcAV, -99e7);
2859 FillWith(StartE_tpcAV, -999.);
2860 FillWith(StartP_tpcAV, -999.);
2861 FillWith(StartPx_tpcAV, -999.);
2862 FillWith(StartPy_tpcAV, -999.);
2863 FillWith(StartPz_tpcAV, -999.);
2864 FillWith(thetastart_tpcAV, -999.);
2865 FillWith(phistart_tpcAV, -999.);
2866 FillWith(EndPointx_tpcAV, -999.);
2867 FillWith(EndPointy_tpcAV, -999.);
2868 FillWith(EndPointz_tpcAV, -999.);
2869 FillWith(EndT_tpcAV, -99e7);
2870 FillWith(EndE_tpcAV, -999.);
2871 FillWith(EndP_tpcAV, -999.);
2872 FillWith(EndPx_tpcAV, -999.);
2873 FillWith(EndPy_tpcAV, -999.);
2874 FillWith(EndPz_tpcAV, -999.);
2875 FillWith(thetaend_tpcAV, -999.);
2876 FillWith(phiend_tpcAV, -999.);
2878 FillWith(pathlen_drifted, -999.);
2879 FillWith(inTPCDrifted, -9999);
2880 FillWith(StartPointx_drifted, -999.);
2881 FillWith(StartPointy_drifted, -999.);
2882 FillWith(StartPointz_drifted, -999.);
2883 FillWith(StartT_drifted, -99e7);
2884 FillWith(StartE_drifted, -999.);
2885 FillWith(StartP_drifted, -999.);
2886 FillWith(StartPx_drifted, -999.);
2887 FillWith(StartPy_drifted, -999.);
2888 FillWith(StartPz_drifted, -999.);
2889 FillWith(EndPointx_drifted, -999.);
2890 FillWith(EndPointy_drifted, -999.);
2891 FillWith(EndPointz_drifted, -999.);
2892 FillWith(EndT_drifted, -99e7);
2893 FillWith(EndE_drifted, -999.);
2894 FillWith(EndP_drifted, -999.);
2895 FillWith(EndPx_drifted, -999.);
2896 FillWith(EndPy_drifted, -999.);
2897 FillWith(EndPz_drifted, -999.);
2898 FillWith(NumberDaughters, -9999);
2899 FillWith(Mother, -9999);
2900 FillWith(TrackId, -9999);
2901 FillWith(process_primary, -9999);
2902 FillWith(processname,
"noname");
2903 FillWith(MergedId, -9999);
2905 FillWith(MCTruthIndex, -9999);
2906 FillWith(genie_primaries_pdg, -9999);
2907 FillWith(genie_Eng, -999.);
2908 FillWith(genie_Px, -999.);
2909 FillWith(genie_Py, -999.);
2910 FillWith(genie_Pz, -999.);
2911 FillWith(genie_P, -999.);
2912 FillWith(genie_status_code, -9999);
2913 FillWith(genie_mass, -999.);
2914 FillWith(genie_trackID, -9999);
2915 FillWith(genie_ND, -9999);
2916 FillWith(genie_mother, -9999);
2917 FillWith(cry_primaries_pdg, -9999);
2918 FillWith(cry_Eng, -999.);
2919 FillWith(cry_Px, -999.);
2920 FillWith(cry_Py, -999.);
2921 FillWith(cry_Pz, -999.);
2922 FillWith(cry_P, -999.);
2923 FillWith(cry_StartPointx, -999.);
2924 FillWith(cry_StartPointy, -999.);
2925 FillWith(cry_StartPointz, -999.);
2926 FillWith(cry_StartPointt, -999.);
2927 FillWith(cry_status_code, -9999);
2928 FillWith(cry_mass, -999.);
2929 FillWith(cry_trackID, -9999);
2930 FillWith(cry_ND, -9999);
2931 FillWith(cry_mother, -9999);
2933 FillWith(proto_isGoodParticle,-9999);
2934 FillWith(proto_vx,-999.);
2935 FillWith(proto_vy,-999.);
2936 FillWith(proto_vz,-999.);
2937 FillWith(proto_t,-999.);
2938 FillWith(proto_px,-999.);
2939 FillWith(proto_py,-999.);
2940 FillWith(proto_pz,-999.);
2941 FillWith(proto_momentum,-999.);
2942 FillWith(proto_energy,-999.);
2943 FillWith(proto_pdg,-9999);
2945 FillWith(mcshwr_origin, -1);
2946 FillWith(mcshwr_pdg, -9999);
2947 FillWith(mcshwr_TrackId, -9999);
2948 FillWith(mcshwr_Process,
"noname");
2949 FillWith(mcshwr_startX, -999.);
2950 FillWith(mcshwr_startY, -999.);
2951 FillWith(mcshwr_startZ, -999.);
2952 FillWith(mcshwr_endX, -999.);
2953 FillWith(mcshwr_endY, -999.);
2954 FillWith(mcshwr_endZ, -999.);
2955 FillWith(mcshwr_CombEngX, -999.);
2956 FillWith(mcshwr_CombEngY, -999.);
2957 FillWith(mcshwr_CombEngZ, -999.);
2958 FillWith(mcshwr_CombEngPx, -999.);
2959 FillWith(mcshwr_CombEngPy, -999.);
2960 FillWith(mcshwr_CombEngPz, -999.);
2961 FillWith(mcshwr_CombEngE, -999.);
2962 FillWith(mcshwr_dEdx, -999.);
2963 FillWith(mcshwr_StartDirX, -999.);
2964 FillWith(mcshwr_StartDirY, -999.);
2965 FillWith(mcshwr_StartDirZ, -999.);
2966 FillWith(mcshwr_isEngDeposited, -999);
2967 FillWith(mcshwr_Motherpdg, -9999);
2968 FillWith(mcshwr_MotherTrkId, -9999);
2969 FillWith(mcshwr_MotherProcess,
"noname");
2970 FillWith(mcshwr_MotherstartX, -999.);
2971 FillWith(mcshwr_MotherstartY, -999.);
2972 FillWith(mcshwr_MotherstartZ, -999.);
2973 FillWith(mcshwr_MotherendX, -999.);
2974 FillWith(mcshwr_MotherendY, -999.);
2975 FillWith(mcshwr_MotherendZ, -999.);
2976 FillWith(mcshwr_Ancestorpdg, -9999);
2977 FillWith(mcshwr_AncestorTrkId, -9999);
2978 FillWith(mcshwr_AncestorProcess,
"noname");
2979 FillWith(mcshwr_AncestorstartX, -999.);
2980 FillWith(mcshwr_AncestorstartY, -999.);
2981 FillWith(mcshwr_AncestorstartZ, -999.);
2982 FillWith(mcshwr_AncestorendX, -999.);
2983 FillWith(mcshwr_AncestorendY, -999.);
2984 FillWith(mcshwr_AncestorendZ, -999.);
2987 geant_trajectory_size = 0;
2989 FillWith(NTrajectoryPointsPerParticle, -999);
2991 FillWith(TrajTrackId, -999);
2992 FillWith(TrajPDGCode, -999);
2993 FillWith(TrajX, -999.);
2994 FillWith(TrajY, -999.);
2995 FillWith(TrajZ, -999.);
2996 FillWith(TrajT, -999.);
2997 FillWith(TrajE, -999.);
2998 FillWith(TrajP, -999.);
2999 FillWith(TrajPx, -999.);
3000 FillWith(TrajPy, -999.);
3001 FillWith(TrajPz, -999.);
3002 FillWith(TrajTheta, -999.);
3003 FillWith(TrajPhi, -999.);
3006 simenergydeposit_size = 0;
3007 particleswithsimenergydeposit_size = 0;
3009 FillWith(NSimEnergyDepositsTPCActivePerParticle, -999);
3010 FillWith(ParticleIDSimEnergyDepositsTPCActivePerParticle, 0);
3012 FillWith(SEDTPCAVTrackID, 0);
3013 FillWith(SEDTPCAVPDGCode, 0);
3015 FillWith(SEDTPCAVEnergy, -999.);
3016 FillWith(SEDTPCAVNumPhotons, -999);
3017 FillWith(SEDTPCAVNumElectrons, -999);
3018 FillWith(SEDTPCAVLength, -999.);
3019 FillWith(SEDTPCAVStartTime, -999.);
3020 FillWith(SEDTPCAVStartX, -999.);
3021 FillWith(SEDTPCAVStartY, -999.);
3022 FillWith(SEDTPCAVStartZ, -999.);
3023 FillWith(SEDTPCAVMidTime, -999.);
3024 FillWith(SEDTPCAVMidX, -999.);
3025 FillWith(SEDTPCAVMidY, -999.);
3026 FillWith(SEDTPCAVMidZ, -999.);
3027 FillWith(SEDTPCAVEndTime, -999.);
3028 FillWith(SEDTPCAVEndX, -999.);
3029 FillWith(SEDTPCAVEndY, -999.);
3030 FillWith(SEDTPCAVEndZ, -999.);
3037 FillWith(NAuxDets, 0);
3040 for (
auto& partInfo: AuxDetID) FillWith(partInfo, -999);
3044 &entryX, &entryY, &entryZ, &entryT,
3045 &exitX , &exitY , &exitZ, &exitT, &exitPx, &exitPy, &exitPz,
3050 for (
auto& partInfo: *cont) FillWith(partInfo, -999.);
3059 (TrackData.begin(), TrackData.end(), std::mem_fn(&TrackDataStruct::Clear));
3061 (VertexData.begin(), VertexData.end(), std::mem_fn(&VertexDataStruct::Clear));
3063 (ShowerData.begin(), ShowerData.end(), std::mem_fn(&ShowerDataStruct::Clear));
3068 (std::vector<std::string>
const& ShowerAlgos)
3071 size_t const nShowerAlgos = ShowerAlgos.size();
3072 ShowerData.resize(nShowerAlgos);
3073 for (
size_t iAlgo = 0; iAlgo < nShowerAlgos; ++iAlgo)
3074 ShowerData[iAlgo].SetName(ShowerAlgos[iAlgo]);
3082 MaxPhotons = (size_t)
std::max(nPhotons, 1);
3084 photons_time.resize(MaxPhotons);
3085 photons_channel.resize(MaxPhotons);
3093 MaxGeneratorparticles = (size_t)
std::max(nParticles, 1);
3095 TrackId.resize(MaxGeneratorparticles);
3096 pdg.resize(MaxGeneratorparticles);
3097 status.resize(MaxGeneratorparticles);
3098 Mass.resize(MaxGeneratorparticles);
3099 Eng.resize(MaxGeneratorparticles);
3100 Px.resize(MaxGeneratorparticles);
3101 Py.resize(MaxGeneratorparticles);
3102 Pz.resize(MaxGeneratorparticles);
3103 P.resize(MaxGeneratorparticles);
3104 StartPointx.resize(MaxGeneratorparticles);
3105 StartPointy.resize(MaxGeneratorparticles);
3106 StartPointz.resize(MaxGeneratorparticles);
3107 StartT.resize(MaxGeneratorparticles);
3108 theta.resize(MaxGeneratorparticles);
3109 phi.resize(MaxGeneratorparticles);
3115 MaxGEANTparticles = (size_t)
std::max(nParticles, 1);
3117 pdg.resize(MaxGEANTparticles);
3118 status.resize(MaxGEANTparticles);
3119 inTPCActive.resize(MaxGEANTparticles);
3120 Mass.resize(MaxGEANTparticles);
3121 Eng.resize(MaxGEANTparticles);
3122 EndE.resize(MaxGEANTparticles);
3123 Px.resize(MaxGEANTparticles);
3124 Py.resize(MaxGEANTparticles);
3125 Pz.resize(MaxGEANTparticles);
3126 P.resize(MaxGEANTparticles);
3127 StartPointx.resize(MaxGEANTparticles);
3128 StartPointy.resize(MaxGEANTparticles);
3129 StartPointz.resize(MaxGEANTparticles);
3130 StartT.resize(MaxGEANTparticles);
3131 EndT.resize(MaxGEANTparticles);
3132 EndPointx.resize(MaxGEANTparticles);
3133 EndPointy.resize(MaxGEANTparticles);
3134 EndPointz.resize(MaxGEANTparticles);
3135 EndT.resize(MaxGEANTparticles);
3136 theta.resize(MaxGEANTparticles);
3137 phi.resize(MaxGEANTparticles);
3138 theta_xz.resize(MaxGEANTparticles);
3139 theta_yz.resize(MaxGEANTparticles);
3140 NumberDaughters.resize(MaxGEANTparticles);
3141 Mother.resize(MaxGEANTparticles);
3142 TrackId.resize(MaxGEANTparticles);
3143 process_primary.resize(MaxGEANTparticles);
3144 processname.resize(MaxGEANTparticles);
3145 MergedId.resize(MaxGEANTparticles);
3146 origin.resize(MaxGEANTparticles);
3147 MCTruthIndex.resize(MaxGEANTparticles);
3149 pathlen_drifted.resize(MaxGEANTparticles);
3150 inTPCDrifted.resize(MaxGEANTparticles);
3151 StartPointx_drifted.resize(MaxGEANTparticles);
3152 StartPointy_drifted.resize(MaxGEANTparticles);
3153 StartPointz_drifted.resize(MaxGEANTparticles);
3154 StartT_drifted.resize(MaxGEANTparticles);
3155 StartE_drifted.resize(MaxGEANTparticles);
3156 StartP_drifted.resize(MaxGEANTparticles);
3157 StartPx_drifted.resize(MaxGEANTparticles);
3158 StartPy_drifted.resize(MaxGEANTparticles);
3159 StartPz_drifted.resize(MaxGEANTparticles);
3160 EndPointx_drifted.resize(MaxGEANTparticles);
3161 EndPointy_drifted.resize(MaxGEANTparticles);
3162 EndPointz_drifted.resize(MaxGEANTparticles);
3163 EndT_drifted.resize(MaxGEANTparticles);
3164 EndE_drifted.resize(MaxGEANTparticles);
3165 EndP_drifted.resize(MaxGEANTparticles);
3166 EndPx_drifted.resize(MaxGEANTparticles);
3167 EndPy_drifted.resize(MaxGEANTparticles);
3168 EndPz_drifted.resize(MaxGEANTparticles);
3171 NAuxDets.resize(MaxGEANTparticles);
3172 AuxDetID.resize(MaxGEANTparticles);
3173 entryX.resize(MaxGEANTparticles);
3174 entryY.resize(MaxGEANTparticles);
3175 entryZ.resize(MaxGEANTparticles);
3176 entryT.resize(MaxGEANTparticles);
3177 exitX.resize(MaxGEANTparticles);
3178 exitY.resize(MaxGEANTparticles);
3179 exitZ.resize(MaxGEANTparticles);
3180 exitT.resize(MaxGEANTparticles);
3181 exitPx.resize(MaxGEANTparticles);
3182 exitPy.resize(MaxGEANTparticles);
3183 exitPz.resize(MaxGEANTparticles);
3184 CombinedEnergyDep.resize(MaxGEANTparticles);
3186 NTrajectoryPointsPerParticle.resize(MaxGEANTparticles);
3191 MaxGEANTInAVparticles = (size_t)
std::max(nParticlesInAV, 1);
3193 pathlen_tpcAV.resize(MaxGEANTInAVparticles);
3194 TrackId_tpcAV.resize(MaxGEANTInAVparticles);
3195 PDGCode_tpcAV.resize(MaxGEANTInAVparticles);
3196 StartPointx_tpcAV.resize(MaxGEANTInAVparticles);
3197 StartPointy_tpcAV.resize(MaxGEANTInAVparticles);
3198 StartPointz_tpcAV.resize(MaxGEANTInAVparticles);
3199 StartT_tpcAV.resize(MaxGEANTInAVparticles);
3200 StartE_tpcAV.resize(MaxGEANTInAVparticles);
3201 StartP_tpcAV.resize(MaxGEANTInAVparticles);
3202 StartPx_tpcAV.resize(MaxGEANTInAVparticles);
3203 StartPy_tpcAV.resize(MaxGEANTInAVparticles);
3204 StartPz_tpcAV.resize(MaxGEANTInAVparticles);
3205 thetastart_tpcAV.resize(MaxGEANTInAVparticles);
3206 phistart_tpcAV.resize(MaxGEANTInAVparticles);
3207 EndPointx_tpcAV.resize(MaxGEANTInAVparticles);
3208 EndPointy_tpcAV.resize(MaxGEANTInAVparticles);
3209 EndPointz_tpcAV.resize(MaxGEANTInAVparticles);
3210 EndT_tpcAV.resize(MaxGEANTInAVparticles);
3211 EndE_tpcAV.resize(MaxGEANTInAVparticles);
3212 EndP_tpcAV.resize(MaxGEANTInAVparticles);
3213 EndPx_tpcAV.resize(MaxGEANTInAVparticles);
3214 EndPy_tpcAV.resize(MaxGEANTInAVparticles);
3215 EndPz_tpcAV.resize(MaxGEANTInAVparticles);
3216 thetaend_tpcAV.resize(MaxGEANTInAVparticles);
3217 phiend_tpcAV.resize(MaxGEANTInAVparticles);
3223 MaxGEANTtrajectorypoints = (size_t)
std::max(nTrajectoryPoints, 1);
3225 TrajTrackId.resize(MaxGEANTtrajectorypoints);
3226 TrajPDGCode.resize(MaxGEANTtrajectorypoints);
3228 TrajX.resize(MaxGEANTtrajectorypoints);
3229 TrajY.resize(MaxGEANTtrajectorypoints);
3230 TrajZ.resize(MaxGEANTtrajectorypoints);
3231 TrajT.resize(MaxGEANTtrajectorypoints);
3232 TrajE.resize(MaxGEANTtrajectorypoints);
3233 TrajP.resize(MaxGEANTtrajectorypoints);
3234 TrajPx.resize(MaxGEANTtrajectorypoints);
3235 TrajPy.resize(MaxGEANTtrajectorypoints);
3236 TrajPz.resize(MaxGEANTtrajectorypoints);
3237 TrajTheta.resize(MaxGEANTtrajectorypoints);
3238 TrajPhi.resize(MaxGEANTtrajectorypoints);
3245 MaxSimEnergyDepositsTPCActive = (size_t)
std::max(nSimEnergyDepositsTPCActive, 1);
3246 MaxParticlesWithSimEnergyDepositsTPCActive = (size_t)
std::max(nParticlesWithSimEnergyDepositsTPCActive, 1);
3248 std::cout <<
"MaxSimEnergyDepositsTPCActive: " << MaxSimEnergyDepositsTPCActive <<
std::endl;
3249 std::cout <<
"MaxParticlesWithSimEnergyDepositsTPCActive: " << MaxParticlesWithSimEnergyDepositsTPCActive <<
std::endl;
3251 NSimEnergyDepositsTPCActivePerParticle.resize(MaxParticlesWithSimEnergyDepositsTPCActive);
3252 ParticleIDSimEnergyDepositsTPCActivePerParticle.resize(MaxParticlesWithSimEnergyDepositsTPCActive);
3254 SEDTPCAVTrackID.resize(MaxSimEnergyDepositsTPCActive);
3255 SEDTPCAVPDGCode.resize(MaxSimEnergyDepositsTPCActive);
3256 SEDTPCAVEnergy.resize(MaxSimEnergyDepositsTPCActive);
3257 SEDTPCAVNumPhotons.resize(MaxSimEnergyDepositsTPCActive);
3258 SEDTPCAVNumElectrons.resize(MaxSimEnergyDepositsTPCActive);
3259 SEDTPCAVLength.resize(MaxSimEnergyDepositsTPCActive);
3260 SEDTPCAVStartTime.resize(MaxSimEnergyDepositsTPCActive);
3261 SEDTPCAVStartX.resize(MaxSimEnergyDepositsTPCActive);
3262 SEDTPCAVStartY.resize(MaxSimEnergyDepositsTPCActive);
3263 SEDTPCAVStartZ.resize(MaxSimEnergyDepositsTPCActive);
3264 SEDTPCAVMidTime.resize(MaxSimEnergyDepositsTPCActive);
3265 SEDTPCAVMidX.resize(MaxSimEnergyDepositsTPCActive);
3266 SEDTPCAVMidY.resize(MaxSimEnergyDepositsTPCActive);
3267 SEDTPCAVMidZ.resize(MaxSimEnergyDepositsTPCActive);
3268 SEDTPCAVEndTime.resize(MaxSimEnergyDepositsTPCActive);
3269 SEDTPCAVEndX.resize(MaxSimEnergyDepositsTPCActive);
3270 SEDTPCAVEndY.resize(MaxSimEnergyDepositsTPCActive);
3271 SEDTPCAVEndZ.resize(MaxSimEnergyDepositsTPCActive);
3282 MaxGeniePrimaries = (size_t)
std::max(nPrimaries, 1);
3283 genie_primaries_pdg.resize(MaxGeniePrimaries);
3284 genie_Eng.resize(MaxGeniePrimaries);
3285 genie_Px.resize(MaxGeniePrimaries);
3286 genie_Py.resize(MaxGeniePrimaries);
3287 genie_Pz.resize(MaxGeniePrimaries);
3288 genie_P.resize(MaxGeniePrimaries);
3289 genie_status_code.resize(MaxGeniePrimaries);
3290 genie_mass.resize(MaxGeniePrimaries);
3291 genie_trackID.resize(MaxGeniePrimaries);
3292 genie_ND.resize(MaxGeniePrimaries);
3293 genie_mother.resize(MaxGeniePrimaries);
3298 cry_primaries_pdg.resize(nPrimaries);
3299 cry_Eng.resize(nPrimaries);
3300 cry_Px.resize(nPrimaries);
3301 cry_Py.resize(nPrimaries);
3302 cry_Pz.resize(nPrimaries);
3303 cry_P.resize(nPrimaries);
3304 cry_StartPointx.resize(nPrimaries);
3305 cry_StartPointy.resize(nPrimaries);
3306 cry_StartPointz.resize(nPrimaries);
3307 cry_StartPointt.resize(nPrimaries);
3308 cry_status_code.resize(nPrimaries);
3309 cry_mass.resize(nPrimaries);
3310 cry_trackID.resize(nPrimaries);
3311 cry_ND.resize(nPrimaries);
3312 cry_mother.resize(nPrimaries);
3318 proto_isGoodParticle.resize(nPrimaries);
3319 proto_vx.resize(nPrimaries);
3320 proto_vy.resize(nPrimaries);
3321 proto_vz.resize(nPrimaries);
3322 proto_t.resize(nPrimaries);
3323 proto_px.resize(nPrimaries);
3324 proto_py.resize(nPrimaries);
3325 proto_pz.resize(nPrimaries);
3326 proto_momentum.resize(nPrimaries);
3327 proto_energy.resize(nPrimaries);
3328 proto_pdg.resize(nPrimaries);
3333 mcshwr_origin.resize(nMCShowers);
3334 mcshwr_pdg.resize(nMCShowers);
3335 mcshwr_TrackId.resize(nMCShowers);
3336 mcshwr_Process.resize(nMCShowers);
3337 mcshwr_startX.resize(nMCShowers);
3338 mcshwr_startY.resize(nMCShowers);
3339 mcshwr_startZ.resize(nMCShowers);
3340 mcshwr_endX.resize(nMCShowers);
3341 mcshwr_endY.resize(nMCShowers);
3342 mcshwr_endZ.resize(nMCShowers);
3343 mcshwr_CombEngX.resize(nMCShowers);
3344 mcshwr_CombEngY.resize(nMCShowers);
3345 mcshwr_CombEngZ.resize(nMCShowers);
3346 mcshwr_CombEngPx.resize(nMCShowers);
3347 mcshwr_CombEngPy.resize(nMCShowers);
3348 mcshwr_CombEngPz.resize(nMCShowers);
3349 mcshwr_CombEngE.resize(nMCShowers);
3350 mcshwr_dEdx.resize(nMCShowers);
3351 mcshwr_StartDirX.resize(nMCShowers);
3352 mcshwr_StartDirY.resize(nMCShowers);
3353 mcshwr_StartDirZ.resize(nMCShowers);
3354 mcshwr_isEngDeposited.resize(nMCShowers);
3355 mcshwr_Motherpdg.resize(nMCShowers);
3356 mcshwr_MotherTrkId.resize(nMCShowers);
3357 mcshwr_MotherProcess.resize(nMCShowers);
3358 mcshwr_MotherstartX.resize(nMCShowers);
3359 mcshwr_MotherstartY.resize(nMCShowers);
3360 mcshwr_MotherstartZ.resize(nMCShowers);
3361 mcshwr_MotherendX.resize(nMCShowers);
3362 mcshwr_MotherendY.resize(nMCShowers);
3363 mcshwr_MotherendZ.resize(nMCShowers);
3364 mcshwr_Ancestorpdg.resize(nMCShowers);
3365 mcshwr_AncestorTrkId.resize(nMCShowers);
3366 mcshwr_AncestorProcess.resize(nMCShowers);
3367 mcshwr_AncestorstartX.resize(nMCShowers);
3368 mcshwr_AncestorstartY.resize(nMCShowers);
3369 mcshwr_AncestorstartZ.resize(nMCShowers);
3370 mcshwr_AncestorendX.resize(nMCShowers);
3371 mcshwr_AncestorendY.resize(nMCShowers);
3372 mcshwr_AncestorendZ.resize(nMCShowers);
3377 mctrk_origin.resize(nMCTracks);
3378 mctrk_pdg.resize(nMCTracks);
3379 mctrk_TrackId.resize(nMCTracks);
3380 mctrk_Process.resize(nMCTracks);
3381 mctrk_startX.resize(nMCTracks);
3382 mctrk_startY.resize(nMCTracks);
3383 mctrk_startZ.resize(nMCTracks);
3384 mctrk_endX.resize(nMCTracks);
3385 mctrk_endY.resize(nMCTracks);
3386 mctrk_endZ.resize(nMCTracks);
3387 mctrk_startX_drifted.resize(nMCTracks);
3388 mctrk_startY_drifted.resize(nMCTracks);
3389 mctrk_startZ_drifted.resize(nMCTracks);
3390 mctrk_endX_drifted.resize(nMCTracks);
3391 mctrk_endY_drifted.resize(nMCTracks);
3392 mctrk_endZ_drifted.resize(nMCTracks);
3393 mctrk_len_drifted.resize(nMCTracks);
3394 mctrk_p_drifted.resize(nMCTracks);
3395 mctrk_px_drifted.resize(nMCTracks);
3396 mctrk_py_drifted.resize(nMCTracks);
3397 mctrk_pz_drifted.resize(nMCTracks);
3398 mctrk_Motherpdg.resize(nMCTracks);
3399 mctrk_MotherTrkId.resize(nMCTracks);
3400 mctrk_MotherProcess.resize(nMCTracks);
3401 mctrk_MotherstartX.resize(nMCTracks);
3402 mctrk_MotherstartY.resize(nMCTracks);
3403 mctrk_MotherstartZ.resize(nMCTracks);
3404 mctrk_MotherendX.resize(nMCTracks);
3405 mctrk_MotherendY.resize(nMCTracks);
3406 mctrk_MotherendZ.resize(nMCTracks);
3407 mctrk_Ancestorpdg.resize(nMCTracks);
3408 mctrk_AncestorTrkId.resize(nMCTracks);
3409 mctrk_AncestorProcess.resize(nMCTracks);
3410 mctrk_AncestorstartX.resize(nMCTracks);
3411 mctrk_AncestorstartY.resize(nMCTracks);
3412 mctrk_AncestorstartZ.resize(nMCTracks);
3413 mctrk_AncestorendX.resize(nMCTracks);
3414 mctrk_AncestorendY.resize(nMCTracks);
3415 mctrk_AncestorendZ.resize(nMCTracks);
3423 const std::vector<std::string>& trackers,
3424 const std::vector<std::string>& vertexalgos,
3425 const std::vector<std::string>& showeralgos,
3430 CreateBranch(
"Run",&
run,
"run/I");
3431 CreateBranch(
"Subrun",&subrun,
"subrun/I");
3433 CreateBranch(
"EventNumberInRun",&
event,
"event/I");
3434 CreateBranch(
"EventTimeSeconds",&evttime_seconds,
"evttime_seconds/I");
3435 CreateBranch(
"EventTimeNanoseconds",&evttime_nanoseconds,
"evttime_nanoseconds/I");
3438 CreateBranch(
"IsData",&isdata,
"isdata/B");
3448 if (hasRawDigitInfo()){
3449 CreateBranch(
"RawWaveform_NumberOfChannels",&no_channels,
"no_channels/I");
3450 CreateBranch(
"RawWaveform_NumberOfTicks",&no_ticks,
"no_ticks/I");
3452 CreateBranch(
"RawWaveform_Channel",rawD_Channel,
"rawD_Channel[no_channels]/I");
3454 CreateBranch(
"RawWaveform_NumberOfTicksInAllChannels",&no_ticksinallchannels,
"no_ticksinallchannels/I");
3455 CreateBranch(
"RawWaveform_ADC",rawD_ADC,
"rawD_ADC[no_ticksinallchannels]/S");
3458 if (hasRecobWireInfo()){
3459 CreateBranch(
"RecoWaveforms_NumberOfChannels",&no_recochannels,
"no_recochannels/I");
3460 CreateBranch(
"RecoWaveform_Channel",recoW_Channel,
"recoW_Channel[no_recochannels]/I");
3461 CreateBranch(
"RecoWaveform_NTicks",recoW_NTicks,
"recoW_NTicks[no_recochannels]/I");
3463 CreateBranch(
"RecoWaveform_NumberOfTicksInAllChannels",&no_recoticksinallchannels,
"no_recoticksinallchannels/I");
3464 CreateBranch(
"RecoWaveform_Tick",recoW_Tick,
"recoW_Tick[no_recoticksinallchannels]/I");
3465 CreateBranch(
"RecoWaveform_ADC",recoW_ADC,
"recoW_ADC[no_recoticksinallchannels]/F");
3469 CreateBranch(
"NumberOfHits",&no_hits,
"no_hits/I");
3471 CreateBranch(
"Hit_TPC",hit_tpc,
"hit_tpc[no_hits]/S");
3472 CreateBranch(
"Hit_View",hit_view,
"hit_view[no_hits]/S");
3474 CreateBranch(
"Hit_Channel",hit_channel,
"hit_channel[no_hits]/S");
3475 CreateBranch(
"Hit_PeakTime",hit_peakT,
"hit_peakT[no_hits]/F");
3476 CreateBranch(
"Hit_ChargeSummedADC",hit_chargesum,
"hit_chargesum[no_hits]/F");
3477 CreateBranch(
"Hit_ChargeIntegral",hit_chargeintegral,
"hit_chargeintegral[no_hits]/F");
3478 CreateBranch(
"Hit_Amplitude",hit_ph,
"hit_ph[no_hits]/F");
3479 CreateBranch(
"Hit_StartTime",hit_startT,
"hit_startT[no_hits]/F");
3480 CreateBranch(
"Hit_EndTime",hit_endT,
"hit_endT[no_hits]/F");
3481 CreateBranch(
"Hit_Width",hit_rms,
"hit_rms[no_hits]/F");
3483 CreateBranch(
"Hit_GoodnessOfFit",hit_goodnessOfFit,
"hit_goodnessOfFit[no_hits]/F");
3485 CreateBranch(
"Hit_FitParameter_Amplitude", hit_fitparamampl,
"hit_fitparamamp[no_hits]/F");
3486 CreateBranch(
"Hit_FitParameter_Offset", hit_fitparamt0,
"hit_fitparamt0[no_hits]/F");
3487 CreateBranch(
"Hit_FitParameter_Tau1", hit_fitparamtau1,
"hit_fitparamtau1[no_hits]/F");
3488 CreateBranch(
"Hit_FitParameter_Tau2", hit_fitparamtau2,
"hit_fitparamtau2[no_hits]/F");
3490 CreateBranch(
"Hit_Multiplicity",hit_multiplicity,
"hit_multiplicity[no_hits]/S");
3491 CreateBranch(
"Hit_trueID", hit_trueID,
"Hit_trueID[no_hits]/I");
3492 CreateBranch(
"Hit_trueEnergyMax", hit_trueEnergyMax,
"hit_trueEnergyMax[no_hits]/F");
3493 CreateBranch(
"Hit_trueEnergyFraction", hit_trueEnergyFraction,
"hit_trueEnergyFraction[no_hits]/F");
3494 CreateBranch(
"Hit_TrackID",hit_trkid,
"hit_trkid[no_hits]/S");
3496 CreateBranch(
"Hit_ClusterID",hit_clusterid,
"hit_clusterid[no_hits]/S");
3519 if (hasClusterInfo()){
3520 CreateBranch(
"NumberOfClusters",&nclusters,
"nclusters/S");
3521 CreateBranch(
"ClusterID", clusterId,
"clusterId[nclusters]/S");
3522 CreateBranch(
"Cluster_NumberOfHits", cluster_NHits,
"cluster_NHits[nclusters]/S");
3523 CreateBranch(
"Cluster_View", clusterView,
"clusterView[nclusters]/S");
3524 CreateBranch(
"Cluster_ChargeIntegral", cluster_Integral,
"cluster_Integral[nclusters]/F");
3525 CreateBranch(
"Cluster_ChargeIntegralAveragePerHit", cluster_IntegralAverage,
"cluster_IntegralAverage[nclusters]/F");
3530 CreateBranch(
"Cluster_StartChannel", cluster_StartWire,
"cluster_StartWire[nclusters]/S");
3531 CreateBranch(
"Cluster_StartTick", cluster_StartTick,
"cluster_StartTick[nclusters]/S");
3532 CreateBranch(
"Cluster_EndChannel", cluster_EndWire,
"cluster_EndWire[nclusters]/S");
3533 CreateBranch(
"Cluster_EndTick", cluster_EndTick,
"cluster_EndTick[nclusters]/S");
3534 CreateBranch(
"Cluster_StartCharge", cluster_StartCharge,
"cluster_StartCharge[nclusters]/F");
3535 CreateBranch(
"Cluster_StartAngle", cluster_StartAngle,
"cluster_StartAngle[nclusters]/F");
3536 CreateBranch(
"Cluster_EndCharge", cluster_EndCharge,
"cluster_EndCharge[nclusters]/F");
3537 CreateBranch(
"Cluster_EndAngle", cluster_EndAngle,
"cluster_EndAngle[nclusters]/F");
3585 if (hasShowerInfo()){
3586 kNShowerAlgos = showeralgos.size();
3587 CreateBranch(
"kNShowerAlgos",&kNShowerAlgos,
"kNShowerAlgos/B");
3588 for(
int i=0; i<kNShowerAlgos; i++){
3591 ShowerData[i].SetAddresses(pTree);
3595 if (hasPFParticleInfo()){
3597 PFParticleData.SetAddresses(pTree);
3707 if (hasGeneratorInfo()){
3708 CreateBranch(
"MCTruth_Generator_NumberOfParticles",&generator_list_size,
"generator_list_size/I");
3709 CreateBranch(
"MCTruth_Generator_ParticleID",TrackId,
"TrackId[generator_list_size]/I");
3710 CreateBranch(
"MCTruth_Generator_PDGCode",
pdg,
"pdg[generator_list_size]/I");
3711 CreateBranch(
"MCTruth_Generator_Status",
status,
"status[generator_list_size]/I");
3712 CreateBranch(
"MCTruth_Generator_Mass",
Mass,
"Mass[generator_list_size]/F");
3713 CreateBranch(
"MCTruth_Generator_StartTime",StartT,
"StartT[generator_list_size]/F");
3714 CreateBranch(
"MCTruth_Generator_StartEnergy",Eng,
"Eng[generator_list_size]/F");
3715 CreateBranch(
"MCTruth_Generator_StartMomentum",
P,
"P[generator_list_size]/F");
3716 CreateBranch(
"MCTruth_Generator_StartPoint_X",StartPointx,
"StartPointx[generator_list_size]/F");
3717 CreateBranch(
"MCTruth_Generator_StartPoint_Y",StartPointy,
"StartPointy[generator_list_size]/F");
3718 CreateBranch(
"MCTruth_Generator_StartPoint_Z",StartPointz,
"StartPointz[generator_list_size]/F");
3719 CreateBranch(
"MCTruth_Generator_StartMomentum_X",Px,
"Px[generator_list_size]/F");
3720 CreateBranch(
"MCTruth_Generator_StartMomentum_Y",Py,
"Py[generator_list_size]/F");
3721 CreateBranch(
"MCTruth_Generator_StartMomentum_Z",Pz,
"Pz[generator_list_size]/F");
3722 CreateBranch(
"MCTruth_Generator_StartDirection_Theta",
theta,
"theta[generator_list_size]/F");
3723 CreateBranch(
"MCTruth_Generator_StartDirection_Phi",phi,
"phi[generator_list_size]/F");
3726 if (hasPhotonInfo()){
3727 CreateBranch(
"MCTruth_GEANT4_NumberOfDetectedPhotons",&numberofphotons,
"numberofphotons/I");
3728 CreateBranch(
"MCTruth_GEANT4_DetectedPhoton_Channel",photons_channel,
"photons_channel[numberofphotons]/F");
3729 CreateBranch(
"MCTruth_GEANT4_DetectedPhoton_Time",photons_time,
"photons_time[numberofphotons]/F");
3732 if (hasGeantInfo()){
3733 CreateBranch(
"MCTruth_GEANT4_NumberOfParticles",&geant_list_size,
"geant_list_size/I");
3734 CreateBranch(
"MCTruth_GEANT4_NumberOfPrimaries",&no_primaries,
"no_primaries/I");
3735 CreateBranch(
"MCTruth_GEANT4_ParticleID",TrackId,
"TrackId[geant_list_size]/I");
3736 CreateBranch(
"MCTruth_GEANT4_PDGCode",
pdg,
"pdg[geant_list_size]/I");
3738 CreateBranch(
"MCTruth_GEANT4_Status",
status,
"status[geant_list_size]/I");
3739 CreateBranch(
"MCTruth_GEANT4_IsInTPCAV",inTPCActive,
"inTPCActive[geant_list_size]/I");
3740 CreateBranch(
"MCTruth_GEANT4_NumberOfDaughterParticles",NumberDaughters,
"NumberDaughters[geant_list_size]/I");
3741 CreateBranch(
"MCTruth_GEANT4_MotherParticle",Mother,
"Mother[geant_list_size]/I");
3742 CreateBranch(
"MCTruth_GEANT4_Mass",
Mass,
"Mass[geant_list_size]/F");
3743 CreateBranch(
"MCTruth_GEANT4_StartPoint_X",StartPointx,
"StartPointx[geant_list_size]/F");
3744 CreateBranch(
"MCTruth_GEANT4_StartPoint_Y",StartPointy,
"StartPointy[geant_list_size]/F");
3745 CreateBranch(
"MCTruth_GEANT4_StartPoint_Z",StartPointz,
"StartPointz[geant_list_size]/F");
3746 CreateBranch(
"MCTruth_GEANT4_StartTime",StartT,
"StartT[geant_list_size]/F");
3747 CreateBranch(
"MCTruth_GEANT4_StartEnergy",Eng,
"Eng[geant_list_size]/F");
3748 CreateBranch(
"MCTruth_GEANT4_StartMomentum",
P,
"P[geant_list_size]/F");
3749 CreateBranch(
"MCTruth_GEANT4_StartMomentum_X",Px,
"Px[geant_list_size]/F");
3750 CreateBranch(
"MCTruth_GEANT4_StartMomentum_Y",Py,
"Py[geant_list_size]/F");
3751 CreateBranch(
"MCTruth_GEANT4_StartMomentum_Z",Pz,
"Pz[geant_list_size]/F");
3752 CreateBranch(
"MCTruth_GEANT4_StartDirection_Theta",
theta,
"theta[geant_list_size]/F");
3753 CreateBranch(
"MCTruth_GEANT4_StartDirection_Phi",phi,
"phi[geant_list_size]/F");
3754 CreateBranch(
"MCTruth_GEANT4_InTPCAV_NumberOfParticles",&geant_list_size_in_tpcAV,
"geant_list_size_in_tpcAV/I");
3764 if (hasGeantInAVInfo()){
3765 CreateBranch(
"MCTruth_GEANT4_InTPCAV_ParticleID",TrackId_tpcAV,
"TrackId_tpcAV[geant_list_size_in_tpcAV]/I");
3766 CreateBranch(
"MCTruth_GEANT4_InTPCAV_PDGCode",PDGCode_tpcAV,
"PDGCode_tpcAV[geant_list_size_in_tpcAV]/I");
3768 CreateBranch(
"MCTruth_GEANT4_InTPCAV_Pathlength",pathlen_tpcAV,
"pathlen_tpcAV[geant_list_size_in_tpcAV]/F");
3769 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartPoint_X",StartPointx_tpcAV,
"StartPointx_tpcAV[geant_list_size_in_tpcAV]/F");
3770 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartPoint_Y",StartPointy_tpcAV,
"StartPointy_tpcAV[geant_list_size_in_tpcAV]/F");
3771 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartPoint_Z",StartPointz_tpcAV,
"StartPointz_tpcAV[geant_list_size_in_tpcAV]/F");
3772 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartTime",StartT_tpcAV,
"StartT_tpcAV[geant_list_size_in_tpcAV]/F");
3773 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartEnergy",StartE_tpcAV,
"StartE_tpcAV[geant_list_size_in_tpcAV]/F");
3774 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartMomentum",StartP_tpcAV,
"StartP_tpcAV[geant_list_size_in_tpcAV]/F");
3775 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartMomentum_X",StartPx_tpcAV,
"StartPx_tpcAV[geant_list_size_in_tpcAV]/F");
3776 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartMomentum_Y",StartPy_tpcAV,
"StartPy_tpcAV[geant_list_size_in_tpcAV]/F");
3777 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartMomentum_Z",StartPz_tpcAV,
"StartPz_tpcAV[geant_list_size_in_tpcAV]/F");
3778 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartDirection_Theta",thetastart_tpcAV,
"thetastart_tpcAV[geant_list_size_in_tpcAV]/F");
3779 CreateBranch(
"MCTruth_GEANT4_InTPCAV_StartDirection_Phi",phistart_tpcAV,
"phistart_tpcAV[geant_list_size_in_tpcAV]/F");
3780 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndPoint_X",EndPointx_tpcAV,
"EndPointx_tpcAV[geant_list_size_in_tpcAV]/F");
3781 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndPoint_Y",EndPointy_tpcAV,
"EndPointy_tpcAV[geant_list_size_in_tpcAV]/F");
3782 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndPoint_Z",EndPointz_tpcAV,
"EndPointz_tpcAV[geant_list_size_in_tpcAV]/F");
3783 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndTime",EndT_tpcAV,
"EndT_tpcAV[geant_list_size_in_tpcAV]/F");
3784 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndEnergy",EndE_tpcAV,
"EndE_tpcAV[geant_list_size_in_tpcAV]/F");
3785 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndMomentum",EndP_tpcAV,
"EndP_tpcAV[geant_list_size_in_tpcAV]/F");
3786 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndMomentum_X",EndPx_tpcAV,
"EndPx_tpcAV[geant_list_size_in_tpcAV]/F");
3787 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndMomentum_Y",EndPy_tpcAV,
"EndPy_tpcAV[geant_list_size_in_tpcAV]/F");
3788 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndMomentum_Z",EndPz_tpcAV,
"EndPz_tpcAV[geant_list_size_in_tpcAV]/F");
3789 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndDirection_Theta",thetaend_tpcAV,
"thetaend_tpcAV[geant_list_size_in_tpcAV]/F");
3790 CreateBranch(
"MCTruth_GEANT4_InTPCAV_EndDirection_Phi",phiend_tpcAV,
"phiend_tpcAV[geant_list_size_in_tpcAV]/F");
3827 if(hasGeantTrajectoryInfo()){
3828 CreateBranch(
"MCTruth_GEANT4_TotalNumberOfTrajectoryStepsForAllParticles",&geant_trajectory_size,
"geant_trajectory_size/I");
3829 CreateBranch(
"MCTruth_GEANT4_NumberOfTrajectoryStepsPerParticle",NTrajectoryPointsPerParticle,
"NTrajectoryPointsPerParticle[geant_list_size]/I");
3831 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_ParticleID",TrajTrackId,
"TrajTrackId[geant_trajectory_size]/I");
3832 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_PDGCode",TrajPDGCode,
"TrajPDGCode[geant_trajectory_size]/I");
3833 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Point_X",TrajX,
"TrajX[geant_trajectory_size]/F");
3834 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Point_Y",TrajY,
"TrajY[geant_trajectory_size]/F");
3835 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Point_Z",TrajZ,
"TrajZ[geant_trajectory_size]/F");
3836 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Time",TrajT,
"TrajT[geant_trajectory_size]/F");
3837 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Energy",TrajE,
"TrajE[geant_trajectory_size]/F");
3838 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Momentum",TrajP,
"TrajP[geant_trajectory_size]/F");
3839 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Momentum_X",TrajPx,
"TrajPx[geant_trajectory_size]/F");
3840 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Momentum_Y",TrajPy,
"TrajPy[geant_trajectory_size]/F");
3841 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Momentum_Z",TrajPz,
"TrajPz[geant_trajectory_size]/F");
3842 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Direction_Theta",TrajTheta,
"TrajTheta[geant_trajectory_size]/F");
3843 CreateBranch(
"MCTruth_GEANT4_TrajectoryStep_Direction_Phi",TrajPhi,
"TrajPhi[geant_trajectory_size]/F");
3846 if(hasSimEnergyDepositTPCActiveInfo()){
3847 CreateBranch(
"MCTruth_GEANT4_TotalNumberOfSEDInTPCAVForAllParticles",&simenergydeposit_size,
"simenergydeposit_size/I");
3848 CreateBranch(
"MCTruth_GEANT4_NumberOfParticlesWithSEDInTPCAV",&particleswithsimenergydeposit_size,
"particleswithsimenergydeposit_size/I");
3850 CreateBranch(
"MCTruth_GEANT4_ParticlesWithSEDInTPCAV_NumberOfSED",NSimEnergyDepositsTPCActivePerParticle,
"NSimEnergyDepositsTPCActivePerParticle[particleswithsimenergydeposit_size]/I");
3851 CreateBranch(
"MCTruth_GEANT4_ParticlesWithSEDInTPCAV_ParticleID",ParticleIDSimEnergyDepositsTPCActivePerParticle,
"ParticleIDSimEnergyDepositsTPCActivePerParticle[particleswithsimenergydeposit_size]/I");
3853 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_ParticleID",SEDTPCAVTrackID,
"SEDTPCAVTrackID[simenergydeposit_size]/I");
3854 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_PDGCode",SEDTPCAVPDGCode,
"SEDTPCAVPDGCode[simenergydeposit_size]/I");
3855 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_EnergyDeposition",SEDTPCAVEnergy,
"SEDTPCAVEnergy[simenergydeposit_size]/F");
3856 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_NumberOfPhotons",SEDTPCAVNumPhotons,
"SEDTPCAVNumPhotons[simenergydeposit_size]/I");
3857 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_NumberOfElectrons",SEDTPCAVNumElectrons,
"SEDTPCAVNumElectrons[simenergydeposit_size]/I");
3858 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_Length",SEDTPCAVLength,
"SEDTPCAVLength[simenergydeposit_size]/F");
3859 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_StartTime",SEDTPCAVStartTime,
"SEDTPCAVStartTime[simenergydeposit_size]/F");
3860 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_StartPoint_X",SEDTPCAVStartX,
"SEDTPCAVStartX[simenergydeposit_size]/F");
3861 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_StartPoint_Y",SEDTPCAVStartY,
"SEDTPCAVStartY[simenergydeposit_size]/F");
3862 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_StartPoint_Z",SEDTPCAVStartZ,
"SEDTPCAVStartZ[simenergydeposit_size]/F");
3863 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_MidTime",SEDTPCAVMidTime,
"SEDTPCAVMidTime[simenergydeposit_size]/F");
3864 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_MidPoint_X",SEDTPCAVMidX,
"SEDTPCAVMidX[simenergydeposit_size]/F");
3865 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_MidPoint_Y",SEDTPCAVMidY,
"SEDTPCAVMidY[simenergydeposit_size]/F");
3866 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_MidPoint_Z",SEDTPCAVMidZ,
"SEDTPCAVMidZ[simenergydeposit_size]/F");
3867 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_EndTime",SEDTPCAVEndTime,
"SEDTPCAVEndTime[simenergydeposit_size]/F");
3868 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_EndPoint_X",SEDTPCAVEndX,
"SEDTPCAVEndX[simenergydeposit_size]/F");
3869 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_EndPoint_Y",SEDTPCAVEndY,
"SEDTPCAVEndY[simenergydeposit_size]/F");
3870 CreateBranch(
"MCTruth_GEANT4_SEDInTPCAV_EndPoint_Z",SEDTPCAVEndZ,
"SEDTPCAVEndZ[simenergydeposit_size]/F");
4003 fLogLevel (pset.
get< short >(
"LogLevel") ),
4004 fEventsPerSubrun (pset.
get< short >(
"EventsPerSubrun") ),
4005 fRawDigitModuleLabel (pset.
get< std::
string >(
"RawDigitModuleLabel") ),
4006 fHitsModuleLabel (pset.
get< std::
string >(
"HitsModuleLabel") ),
4007 fPhotonPropS1ModuleLabel (pset.
get< std::
string >(
"PhotonPropS1ModuleLabel") ),
4008 fElecDriftModuleLabel (pset.
get< std::
string >(
"ElecDriftModuleLabel") ),
4009 fCalDataModuleLabel (pset.
get< std::
string >(
"CalDataModuleLabel") ),
4010 fGenieGenModuleLabel (pset.
get< std::
string >(
"GenieGenModuleLabel") ),
4011 fCryGenModuleLabel (pset.
get< std::
string >(
"CryGenModuleLabel") ),
4012 fProtoGenModuleLabel (pset.
get< std::
string >(
"ProtoGenModuleLabel") ),
4013 fG4ModuleLabel (pset.
get< std::
string >(
"G4ModuleLabel") ),
4014 fSimEnergyDepositTPCActiveLabel (pset.
get< std::
string >(
"SimEnergyDepositTPCActiveLabel") ),
4015 fClusterModuleLabel (pset.
get< std::
string >(
"ClusterModuleLabel") ),
4016 fPandoraNuVertexModuleLabel (pset.
get< std::
string >(
"PandoraNuVertexModuleLabel") ),
4017 fOpFlashModuleLabel (pset.
get< std::
string >(
"OpFlashModuleLabel") ),
4018 fExternalCounterModuleLabel (pset.
get< std::
string >(
"ExternalCounterModuleLabel") ),
4019 fMCShowerModuleLabel (pset.
get< std::
string >(
"MCShowerModuleLabel") ),
4020 fMCTrackModuleLabel (pset.
get< std::
string >(
"MCTrackModuleLabel") ),
4021 fTrackModuleLabel (pset.
get< std::
vector<std::
string> >(
"TrackModuleLabel")),
4022 fVertexModuleLabel (pset.
get< std::
vector<std::
string> >(
"VertexModuleLabel")),
4023 fShowerModuleLabel (pset.
get< std::
vector<std::
string> >(
"ShowerModuleLabel")),
4024 fCalorimetryModuleLabel (pset.
get< std::
vector<std::
string> >(
"CalorimetryModuleLabel")),
4025 fParticleIDModuleLabel (pset.
get< std::
vector<std::
string> >(
"ParticleIDModuleLabel") ),
4026 fMVAPIDShowerModuleLabel (pset.
get< std::
vector<std::
string> >(
"MVAPIDShowerModuleLabel") ),
4027 fMVAPIDTrackModuleLabel (pset.
get< std::
vector<std::
string> >(
"MVAPIDTrackModuleLabel") ),
4028 fFlashT0FinderLabel (pset.
get< std::
vector<std::
string> >(
"FlashT0FinderLabel") ),
4029 fMCT0FinderLabel (pset.
get< std::
vector<std::
string> >(
"MCT0FinderLabel") ),
4030 fPOTModuleLabel (pset.
get< std::
string >(
"POTModuleLabel")),
4031 fCosmicClusterTaggerAssocLabel (pset.
get< std::
string >(
"CosmicClusterTaggerAssocLabel")),
4032 fIsMC (pset.
get<
bool >(
"IsMC", false)),
4033 fUseBuffer (pset.
get<
bool >(
"UseBuffers", false)),
4034 fSaveAuxDetInfo (pset.
get<
bool >(
"SaveAuxDetInfo", false)),
4035 fSaveCryInfo (pset.
get<
bool >(
"SaveCryInfo", false)),
4036 fSaveGenieInfo (pset.
get<
bool >(
"SaveGenieInfo", false)),
4037 fSaveProtoInfo (pset.
get<
bool >(
"SaveProtoInfo", false)),
4038 fSavePhotonInfo (pset.
get<
bool >(
"SavePhotonInfo", false)),
4039 fSaveGeneratorInfo (pset.
get<
bool >(
"SaveGeneratorInfo", false)),
4040 fSaveGeantInfo (pset.
get<
bool >(
"SaveGeantInfo", false)),
4041 fSaveGeantInAVInfo (pset.
get<
bool >(
"SaveGeantInAVInfo", false)),
4042 fSaveGeantTrajectoryInfo (pset.
get<
bool >(
"SaveGeantTrajectoryInfo", false)),
4043 fSaveSimEnergyDepositTPCActiveInfo (pset.
get<
bool >(
"SaveSimEnergyDepositTPCActiveInfo", false)),
4044 fSaveMCShowerInfo (pset.
get<
bool >(
"SaveMCShowerInfo", false)),
4045 fSaveMCTrackInfo (pset.
get<
bool >(
"SaveMCTrackInfo", false)),
4046 fSaveHitInfo (pset.
get<
bool >(
"SaveHitInfo", false)),
4047 fSaveRawDigitInfo (pset.
get<
bool >(
"SaveRawDigitInfo", false)),
4048 fSaveRecobWireInfo (pset.
get<
bool >(
"SaveRecobWireInfo", false)),
4049 fSaveTrackInfo (pset.
get<
bool >(
"SaveTrackInfo", false)),
4050 fSaveVertexInfo (pset.
get<
bool >(
"SaveVertexInfo", false)),
4051 fSaveClusterInfo (pset.
get<
bool >(
"SaveClusterInfo", false)),
4052 fSavePandoraNuVertexInfo (pset.
get<
bool >(
"SavePandoraNuVertexInfo", false)),
4053 fSaveFlashInfo (pset.
get<
bool >(
"SaveFlashInfo", false)),
4054 fSaveExternCounterInfo (pset.
get<
bool >(
"SaveExternCounterInfo", false)),
4055 fSaveShowerInfo (pset.
get<
bool >(
"SaveShowerInfo", false)),
4056 fSavePFParticleInfo (pset.
get<
bool >(
"SavePFParticleInfo", false)),
4057 fCosmicTaggerAssocLabel (pset.
get<std::
vector< std::
string > >(
"CosmicTaggerAssocLabel") ),
4058 fContainmentTaggerAssocLabel (pset.
get<std::
vector< std::
string > >(
"ContainmentTaggerAssocLabel") ),
4059 fFlashMatchAssocLabel (pset.
get<std::
vector< std::
string > >(
"FlashMatchAssocLabel") ),
4060 bIgnoreMissingShowers (pset.
get<
bool >(
"IgnoreMissingShowers", false)),
4062 fSaveCaloCosmics (pset.
get<
bool >(
"SaveCaloCosmics",false)),
4063 fG4minE (pset.
get<
float>(
"G4minE",0.01)),
4064 fMCSFitter( pset.
get<
fhicl::ParameterSet>(
"TrajMCSFitter") )
4073 <<
"\n UseBuffers: " << std::boolalpha <<
fUseBuffer 4077 <<
"AnaRootParser currently supports only up to " <<
kMaxTrackers 4078 <<
" tracking algorithms, but " <<
GetNTrackers() <<
" are specified." 4079 <<
"\nYou can increase kMaxTrackers and recompile.";
4119 <<
" tracking algorithms, but " <<
GetNVertexAlgos() <<
" are specified." 4120 <<
"\nYou can increase kMaxVertexAlgos and recompile.";
4127 auto const* geom = lar::providerFrom<geo::Geometry>();
4132 TPC.LocalToWorld(origin, center);
4133 double tpcDim[3] = {
TPC.HalfWidth(),
TPC.HalfHeight(), 0.5*
TPC.Length() };
4142 std::cout <<
"Active Boundaries: " 4158 fTree = tfs->make<TTree>(
"anatree",
"analysis tree");
4231 std::vector<art::Ptr<raw::RawDigit> > rawdigitlist;
4233 if (rawdigitVecHandle)
4237 std::vector<art::Ptr<recob::Wire> > recobwirelist;
4239 if (recobwireVecHandle)
4253 std::vector<art::Ptr<recob::Hit> > hitlist;
4260 std::vector<art::Ptr<recob::Cluster> > clusterlist;
4263 if (clusterListHandle)
4268 std::vector<art::Ptr<recob::OpFlash> > flashlist;
4270 if (flashListHandle)
4274 std::vector<art::Ptr<raw::ExternalTrigger> > countlist;
4276 if (countListHandle)
4281 std::vector<art::Ptr<simb::MCTruth> > mclist;
4284 if (mctruthListHandle)
4289 int nSimEnergyDepositsTPCActive = 0;
4290 int nParticlesWithSimEnergyDepositsTPCActive = 0;
4291 int nLowestParticleIDSimEnergyDepositsTPCActive = 0;
4292 int nHighestParticleIDSimEnergyDepositsTPCActive = 0;
4294 std::vector<art::Ptr<sim::SimEnergyDeposit> > energyDepositTPCActivelist;
4298 if (energyDepositTPCActiveHandle)
4301 nSimEnergyDepositsTPCActive = energyDepositTPCActivelist.size();
4303 std::vector<int> tempparticleID;
4304 tempparticleID.resize(nSimEnergyDepositsTPCActive);
4305 FillWith(tempparticleID, 0);
4307 for(
int sedavit = 0; sedavit < nSimEnergyDepositsTPCActive; sedavit++)
4309 if( std::find(tempparticleID.begin(), tempparticleID.end(), energyDepositTPCActivelist[sedavit]->TrackID()) == tempparticleID.end() )
4311 tempparticleID[nParticlesWithSimEnergyDepositsTPCActive] = energyDepositTPCActivelist[sedavit]->TrackID();
4312 nParticlesWithSimEnergyDepositsTPCActive++;
4314 if(energyDepositTPCActivelist[sedavit]->
TrackID() < nLowestParticleIDSimEnergyDepositsTPCActive) nLowestParticleIDSimEnergyDepositsTPCActive=energyDepositTPCActivelist[sedavit]->TrackID();
4315 if(energyDepositTPCActivelist[sedavit]->
TrackID() > nHighestParticleIDSimEnergyDepositsTPCActive) nHighestParticleIDSimEnergyDepositsTPCActive=energyDepositTPCActivelist[sedavit]->TrackID();
4322 std::vector<art::Ptr<simb::MCTruth> > mclistcry;
4325 if (mctruthcryListHandle){
4331 mf::LogError(
"AnaRootParser") <<
"Requested CRY information but none exists, hence not saving CRY information.";
4336 std::vector<art::Ptr<simb::MCTruth> > mclistproto;
4339 if (mctruthprotoListHandle){
4345 mf::LogError(
"AnaRootParser") <<
"Requested protoDUNE beam generator information but none exists, hence not saving protoDUNE beam generator information.";
4356 nMCShowers = mcshowerh->size();
4365 nMCTracks = mctrackh->size();
4368 int nCryPrimaries = 0;
4371 mctruthcry = mclistcry[0];
4376 int nProtoPrimaries = 0;
4378 mctruthproto = mclistproto[0];
4379 nProtoPrimaries = mctruthproto->
NParticles();
4383 int nGeniePrimaries = 0, nGeneratorParticles = 0, nGEANTparticles = 0, nGEANTparticlesInAV = 0, nGEANTtrajectorysteps=0;
4391 auto const allmclists = evt.
getMany<std::vector<simb::MCTruth>>();
4392 for(
size_t mcl = 0; mcl < allmclists.size(); ++mcl){
4394 for(
size_t m = 0;
m < mclistHandle->size(); ++
m){
4402 if (!mclist.empty()){
4416 mctruth = mclist[0];
4421 const sim::ParticleList& plist = pi_serv->
ParticleList();
4422 nGEANTparticles = plist.size();
4428 for(
size_t iPart = 0; (iPart < plist.size()) && (itPart != pend); ++iPart)
4434 <<
"GEANT particle #" << iPart <<
" returned a null pointer";
4438 if(pPart->
Mother() == 0 && pPart->
Process() == pri) nGeneratorParticles++;
4440 TLorentzVector mcstart, mcend;
4441 unsigned int pstarti, pendi;
4442 double plen =
length(*pPart, mcstart, mcend, pstarti, pendi);
4443 if( plen != 0) nGEANTparticlesInAV += 1;
4450 for (
auto const& pmt : (*photonHandle) )
4452 std::map<int, int> PhotonsMap = pmt.DetectedPhotons;
4454 for(
auto itphoton = PhotonsMap.begin(); itphoton!= PhotonsMap.end(); itphoton++)
4456 for(
int i = 0; i < itphoton->second ; i++)
4465 << nGEANTparticles <<
" GEANT particles, " 4466 << nGeniePrimaries <<
" GENIE particles";
4484 std::cout <<
"nGeneratorParticles: " << nGeneratorParticles <<
std::endl;
4485 std::cout <<
"nGEANTparticles: " << nGEANTparticles <<
std::endl;
4486 std::cout <<
"nGEANTtrajectorysteps: " << nGEANTtrajectorysteps <<
std::endl;
4487 std::cout <<
"nGEANTparticlesInAV: " << nGEANTparticlesInAV <<
std::endl;
4488 std::cout <<
"nSimEnergyDepositsTPCActive: " << nSimEnergyDepositsTPCActive <<
std::endl;
4489 std::cout <<
"nParticlesWithSimEnergyDepositsTPCActive: " << nParticlesWithSimEnergyDepositsTPCActive <<
std::endl;
4490 std::cout <<
"nLowestParticleIDSimEnergyDepositsTPCActive: " << nLowestParticleIDSimEnergyDepositsTPCActive <<
std::endl;
4491 std::cout <<
"nHighestParticleIDSimEnergyDepositsTPCActive: " << nHighestParticleIDSimEnergyDepositsTPCActive <<
std::endl;
4492 std::cout <<
"nPhotons: " << nPhotons <<
std::endl;
4495 fData->ClearLocalData();
4499 const size_t NChannels = rawdigitlist.size();
4500 const size_t NRecoChannels = recobwirelist.size();
4501 const size_t NHits = hitlist.size();
4503 const size_t NClusters = clusterlist.size();
4504 const size_t NFlashes = flashlist.size();
4505 const size_t NExternCounts = countlist.size();
4516 std::vector<art::Ptr<raw::Trigger> > triggerlist;
4520 if (triggerlist.size()){
4521 fData->triggernumber = triggerlist[0]->TriggerNumber();
4522 fData->triggertime = triggerlist[0]->TriggerTime();
4523 fData->beamgatetime = triggerlist[0]->BeamGateTime();
4524 fData->triggerbits = triggerlist[0]->TriggerBits();
4528 std::vector< art::Handle< std::vector<recob::Vertex> > > vertexListHandle(NVertexAlgos);
4529 std::vector< std::vector<art::Ptr<recob::Vertex> > > vertexlist(NVertexAlgos);
4530 for (
unsigned int it = 0; it < NVertexAlgos; ++it){
4532 if (vertexListHandle[it])
4542 std::vector< art::Handle< std::vector<recob::Track> > > trackListHandle(NTrackers);
4543 std::vector< std::vector<art::Ptr<recob::Track> > > tracklist(NTrackers);
4544 for (
unsigned int it = 0; it < NTrackers; ++it){
4546 if (trackListHandle[it])
4555 std::vector<std::vector<recob::Shower>
const*> showerList;
4556 std::vector< art::Handle< std::vector<recob::Shower> > > showerListHandle;
4560 auto ShowerHandle = evt.
getHandle<std::vector<recob::Shower>>(ShowerInputTag);
4561 if (!ShowerHandle) {
4562 showerList.push_back(
nullptr);
4565 <<
"Showers with input tag '" << ShowerInputTag.encode()
4566 <<
"' were not found in the event." 4567 " If you really know what you are doing," 4568 " set AnaRootParser's configuration parameter IgnoreMissingShowers" 4569 " to \"true\"; the lack of any shower set will be tolerated," 4570 " and the shower list in the corresponding event will be set to" 4571 " a list of one shower, with an invalid ID.\n";
4576 <<
"No showers found for input tag '" << ShowerInputTag.encode()
4577 <<
"' ; FILLING WITH FAKE DATA AS FOR USER'S REQUEST";
4581 else showerList.push_back(ShowerHandle.product());
4583 showerListHandle.push_back(ShowerHandle);
4595 std::vector<const sim::AuxDetSimChannel*> fAuxDetSimChannels;
4600 std::vector<const sim::SimChannel*> fSimChannels;
4614 fData->beamtime = (double)
beam->get_t_ms();
4615 fData->beamtime/=1000.;
4616 std::map<std::string, std::vector<double>> datamap =
beam->GetDataMap();
4617 if (datamap[
"E:TOR860"].
size()){
4618 fData->potbnb = datamap[
"E:TOR860"][0];
4620 if (datamap[
"E:TORTGT"].
size()){
4621 fData->potnumitgt = datamap[
"E:TORTGT"][0];
4623 if (datamap[
"E:TOR101"].
size()){
4624 fData->potnumi101 = datamap[
"E:TOR101"][0];
4637 fData->no_channels = (
int) NChannels;
4640 fData->no_ticks = (
int) rawdigitlist[0]->Samples();
4645 fData->no_ticks = 0;
4646 fData->no_ticksinallchannels = 0;
4649 for (
int i = 0; i <
fData->no_channels ; i++)
4651 fData->rawD_Channel[i] = (
int) rawdigitlist[i]->Channel();
4656 fData->rawD_ADC[j] = rawdigitlist[i]->ADC(k);
4664 fData->no_recochannels = (
int) NRecoChannels;
4667 for(
int i = 0; i <
fData->no_recochannels; i++)
4669 fData->recoW_NTicks[i]=0;
4670 fData->recoW_Channel[i] = recobwirelist[i]->Channel();
4673 for(
const auto& range : signalROI.
get_ranges())
4675 const std::vector<float>& signal = range.data();
4676 int NTicksInThisROI = range.end_index() - range.begin_index();
4678 for(
int j = 0; j < NTicksInThisROI; j++)
4680 fData->recoW_Tick[RecoWTick] = j+range.begin_index();
4681 fData->recoW_ADC[RecoWTick] = signal.at(j);
4684 fData->recoW_NTicks[i] += NTicksInThisROI;
4687 fData->no_recoticksinallchannels = RecoWTick;
4695 float purity = -9999;
4698 fData->NHitsInAllTracks = (
int) NHits;
4699 fData->no_hits_stored = TMath::Min( (
int) NHits, (
int)
kMaxHits);
4700 if (NHits > kMaxHits) {
4703 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NHits
4704 <<
" hits, only kMaxHits=" << kMaxHits <<
" stored in tree";
4711 const auto & fitParams = hitResults->vectors();
4713 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
4714 fData->hit_channel[i] = hitlist[i]->Channel();
4715 fData->hit_tpc[i] = hitlist[i]->WireID().TPC;
4716 fData->hit_view[i] = hitlist[i]->WireID().Plane;
4717 fData->hit_wire[i] = hitlist[i]->WireID().Wire;
4718 fData->hit_peakT[i] = hitlist[i]->PeakTime();
4719 fData->hit_chargesum[i] = hitlist[i]->SummedADC();
4720 fData->hit_chargeintegral[i] = hitlist[i]->Integral();
4721 fData->hit_ph[i] = hitlist[i]->PeakAmplitude();
4722 fData->hit_startT[i] = hitlist[i]->StartTick();
4723 fData->hit_endT[i] = hitlist[i]->EndTick();
4724 fData->hit_rms[i] = hitlist[i]->RMS();
4725 fData->hit_goodnessOfFit[i] = hitlist[i]->GoodnessOfFit();
4727 fData->hit_fitparamt0[i] = fitParams[i][0];
4728 fData->hit_fitparamtau1[i] = fitParams[i][1];
4729 fData->hit_fitparamtau2[i] = fitParams[i][2];
4730 fData->hit_fitparamampl[i] = fitParams[i][3];
4732 fData->hit_multiplicity[i] = hitlist[i]->Multiplicity();
4737 HitsBackTrack(clockData, hitlist[i], trueID, maxe, purity );
4739 fData->hit_trueID[i] = trueID;
4740 fData->hit_trueEnergyMax[i] = maxe;
4741 fData->hit_trueEnergyFraction[i] = purity;
4863 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
4864 if (fmtk.isValid()){
4865 if (fmtk.at(i).size()!=0){
4866 fData->hit_trkid[i] = fmtk.at(i)[0]->ID();
4871 fData->hit_trkid[i] = -1;
4883 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
4884 if (fmcl.isValid()){
4885 if (fmcl.at(i).size()!=0){
4886 fData->hit_clusterid[i] = fmcl.at(i)[0]->ID();
4890 fData->hit_clusterid[i] = -1;
4904 for (
unsigned int n = 0;
n < particleVector.size(); ++
n) {
4912 mf::LogError(
"AnaRootParser:limits") <<
"event has " << nprim
4913 <<
" nu neutrino vertices, only kMaxVertices=" <<
kMaxVertices <<
" stored in tree";
4916 fData->nnuvtx = nprim;
4919 for (
unsigned int n = 0;
n < particleVector.size(); ++
n) {
4923 if (particlesToVertices.end() != vIter) {
4925 if (!vertexVector.empty()) {
4926 if (vertexVector.size() == 1) {
4928 double xyz[3] = {0.0, 0.0, 0.0} ;
4930 fData->nuvtxx[iv] = xyz[0];
4931 fData->nuvtxy[iv] = xyz[1];
4932 fData->nuvtxz[iv] = xyz[2];
4943 fData->nclusters = (
int) NClusters;
4947 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NClusters
4948 <<
" clusters, only kMaxClusters=" <<
kMaxClusters <<
" stored in tree";
4950 for(
unsigned int ic=0; ic<NClusters;++ic){
4953 fData->clusterId[ic] = cluster.
ID();
4954 fData->clusterView[ic] = cluster.
View();
4956 if(
fData->clusterView[ic] == 3) {
fData->clusterView[ic] = 0;}
4957 if(
fData->clusterView[ic] == 2) {
fData->clusterView[ic] = 1;}
4976 if(
fData->clusterView[ic] == 1){
fData->cluster_StartWire[ic]+=320;
fData->cluster_EndWire[ic] += 320;}
4993 fData->no_flashes = (
int) NFlashes;
4997 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NFlashes
4998 <<
" flashes, only kMaxFlashes=" <<
kMaxFlashes <<
" stored in tree";
5000 for (
size_t i = 0; i < NFlashes && i <
kMaxFlashes ; ++i){
5001 fData->flash_time[i] = flashlist[i]->Time();
5002 fData->flash_pe[i] = flashlist[i]->TotalPE();
5003 fData->flash_ycenter[i] = flashlist[i]->YCenter();
5004 fData->flash_zcenter[i] = flashlist[i]->ZCenter();
5005 fData->flash_ywidth[i] = flashlist[i]->YWidth();
5006 fData->flash_zwidth[i] = flashlist[i]->ZWidth();
5007 fData->flash_timewidth[i] = flashlist[i]->TimeWidth();
5012 fData->no_ExternCounts = (
int) NExternCounts;
5016 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NExternCounts
5017 <<
" External Counters, only kMaxExternCounts=" <<
kMaxExternCounts <<
" stored in tree";
5020 fData->externcounts_time[i] = countlist[i]->GetTrigTime();
5021 fData->externcounts_id[i] = countlist[i]->GetTrigID();
5027 std::map<Short_t, Short_t> trackIDtoPFParticleIDMap, vertexIDtoPFParticleIDMap, showerIDtoPFParticleIDMap;
5032 size_t NPFParticles = pfparticlelist.size();
5035 PFParticleData.
Clear();
5044 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NPFParticles
5045 <<
" PFParticles, only " 5058 std::cerr <<
"Warning: there were " << neutrinoPFParticles.size() <<
" reconstructed PFParticle neutrinos; only the first " <<
kMaxNPFPNeutrinos <<
" being stored in tree" <<
std::endl;
5075 for (
size_t i = 0; i < NPFParticles && i < PFParticleData.
GetMaxPFParticles() ; ++i){
5076 PFParticleData.
pfp_selfID[i] = pfparticlelist[i]->Self();
5077 PFParticleData.
pfp_isPrimary[i] = (Short_t)pfparticlelist[i]->IsPrimary();
5079 PFParticleData.
pfp_parentID[i] = pfparticlelist[i]->Parent();
5080 PFParticleData.
pfp_pdgCode[i] = pfparticlelist[i]->PdgCode();
5084 std::vector<size_t> daughterIDs = pfparticlelist[i]->Daughters();
5086 for (
size_t j = 0; j < daughterIDs.size(); ++j)
5090 auto vertexMapIter = pfParticleToVertexMap.find(pfparticlelist[i]);
5091 if (vertexMapIter != pfParticleToVertexMap.end()) {
5094 if (pfParticleVertices.size() > 1)
5095 std::cerr <<
"Warning: there was more than one vertex found for PFParticle with ID " << pfparticlelist[i]->Self() <<
", storing only one" <<
std::endl;
5097 if (pfParticleVertices.size() > 0) {
5098 PFParticleData.
pfp_vertexID[i] = pfParticleVertices.at(0)->ID();
5099 vertexIDtoPFParticleIDMap.insert(std::make_pair(pfParticleVertices.at(0)->ID(), pfparticlelist[i]->Self()));
5103 std::cerr <<
"Warning: there was no vertex found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
5109 auto trackMapIter = pfParticleToTrackMap.find(pfparticlelist[i]);
5110 if (trackMapIter != pfParticleToTrackMap.end()) {
5113 if (pfParticleTracks.size() > 1)
5114 std::cerr <<
"Warning: there was more than one track found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
5116 if (pfParticleTracks.size() > 0) {
5117 PFParticleData.
pfp_trackID[i] = pfParticleTracks.at(0)->ID();
5118 trackIDtoPFParticleIDMap.insert(std::make_pair(pfParticleTracks.at(0)->ID(), pfparticlelist[i]->Self()));
5122 std::cerr <<
"Warning: there was no track found for track-like PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
5130 auto showerMapIter = pfParticleToShowerMap.find(pfparticlelist[i]);
5131 if (showerMapIter != pfParticleToShowerMap.end()) {
5134 if (pfParticleShowers.size() > 1)
5135 std::cerr <<
"Warning: there was more than one shower found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
5137 if (pfParticleShowers.size() > 0) {
5138 PFParticleData.
pfp_showerID[i] = pfParticleShowers.at(0)->ID();
5139 showerIDtoPFParticleIDMap.insert(std::make_pair(pfParticleShowers.at(0)->ID(), pfparticlelist[i]->Self()));
5143 std::cerr <<
"Warning: there was no shower found for shower-like PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
5149 auto clusterMapIter = pfParticleToClusterMap.find(pfparticlelist[i]);
5150 if (clusterMapIter != pfParticleToClusterMap.end()) {
5154 for (
size_t j = 0; j < pfParticleClusters.size(); ++j)
5155 PFParticleData.
pfp_clusterIDs[i][j] = pfParticleClusters[j]->ID();
5165 for (
size_t iShowerAlgo = 0; iShowerAlgo < NShowerAlgos; ++iShowerAlgo) {
5167 =
fData->GetShowerData(iShowerAlgo);
5168 std::vector<recob::Shower>
const* pShowers = showerList[iShowerAlgo];
5176 if(fmvapid.isValid()){
5177 for(
unsigned int iShower=0;iShower<showerHandle->size();++iShower){
5199 for (
unsigned int iTracker=0; iTracker < NTrackers; ++iTracker){
5202 size_t NTracks = tracklist[iTracker].size();
5206 TrackerData.
Clear();
5235 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NTracks
5250 float maxe = -9999.;
5251 float purity = -9999.;
5253 for(
size_t iTrk=0; iTrk < NTracks; ++iTrk){
5256 art::FindManyP<anab::T0> fmt0(trackListHandle[iTracker],evt,
fFlashT0FinderLabel[iTracker]);
5257 if (fmt0.isValid()){
5258 if(fmt0.at(iTrk).size()>0){
5259 if(fmt0.at(iTrk).size()>1)
5260 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fFlashT0FinderLabel[iTracker];
5261 TrackerData.
trkflashT0[iTrk] = fmt0.at(iTrk).at(0)->Time();
5266 art::FindManyP<anab::T0> fmmct0(trackListHandle[iTracker],evt,
fMCT0FinderLabel[iTracker]);
5267 if (fmmct0.isValid()){
5268 if(fmmct0.at(iTrk).size()>0){
5269 if(fmmct0.at(iTrk).size()>1)
5270 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the cluster" <<
fMCT0FinderLabel[iTracker];
5271 TrackerData.
trktrueT0[iTrk] = fmmct0.at(iTrk).at(0)->Time();
5277 if (fmct.isValid()){
5279 if (fmct.at(iTrk).size()>0){
5280 if(fmct.at(iTrk).size()>1)
5281 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fCosmicTaggerAssocLabel[iTracker];
5289 if (fmcnt.isValid()){
5291 if (fmcnt.at(iTrk).size()>0){
5292 if(fmcnt.at(iTrk).size()>1)
5293 std::cerr <<
"\n Warning : more than one containment tag per track in module! assigning the first tag to the track" <<
fContainmentTaggerAssocLabel[iTracker];
5301 art::FindManyP<anab::CosmicTag> fmbfm(trackListHandle[iTracker],evt,
fFlashMatchAssocLabel[iTracker]);
5302 if (fmbfm.isValid()){
5304 if (fmbfm.at(iTrk).size()>0){
5305 if(fmbfm.at(iTrk).size()>1)
5306 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fFlashMatchAssocLabel[iTracker];
5316 TVector3
pos, dir_start, dir_end,
end;
5317 TVector3 dir_start_flipped, dir_end_flipped;
5318 double tlen = 0., mom = 0.;
5323 pos = track.
Vertex<TVector3>();
5326 end = track.
End<TVector3>();
5328 dir_start_flipped.SetXYZ(dir_start.Z(), dir_start.Y(), dir_start.X());
5329 dir_end_flipped.SetXYZ(dir_end.Z(), dir_end.Y(), dir_end.X());
5335 TrackID = track.
ID();
5337 double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
5338 double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
5339 double dpos =
bdist(pos);
5340 double dend =
bdist(end);
5347 TrackerData.
trkendx[iTrk] = end.X();
5348 TrackerData.
trkendy[iTrk] = end.Y();
5349 TrackerData.
trkendz[iTrk] = end.Z();
5350 TrackerData.
trkendd[iTrk] = dend;
5351 TrackerData.
trkstarttheta[iTrk] = (180.0/3.14159)*dir_start_flipped.Theta();
5352 TrackerData.
trkstartphi[iTrk] = (180.0/3.14159)*dir_start_flipped.Phi();
5360 std::cout <<
"start.X(): " << pos.X() <<
"\t" <<
"start.Y(): " << pos.Y() <<
"\t" <<
"start.Z(): " << pos.Z() <<
std::endl;
5361 std::cout <<
"end.X(): " << end.X() <<
"\t" <<
"end.Y(): " << end.Y() <<
"\t" <<
"end.Z(): " << end.Z() <<
std::endl;
5362 std::cout <<
"dir_start.X(): " << dir_start.X() <<
"\t" <<
"dir_start.Y(): " << dir_start.Y() <<
"\t" <<
"dir_start.Z(): " << dir_start.Z() <<
std::endl;
5363 std::cout <<
"dir_end.X(): " << dir_end.X() <<
"\t" <<
"dir_end.Y(): " << dir_end.Y() <<
"\t" <<
"dir_end.Z(): " << dir_end.Z() <<
std::endl;
5364 std::cout <<
"dir_start_flipped.Theta(): " << (180.0/3.14159)*dir_start_flipped.Theta() <<
"\t" <<
"dir_start_flipped.Phi(): " << (180.0/3.14159)*dir_start_flipped.Phi() <<
std::endl;
5365 std::cout <<
"dir_end_flipped.Theta(): " << (180.0/3.14159)*dir_end_flipped.Theta() <<
"\t" <<
"dir_end_flipped.Phi(): " << (180.0/3.14159)*dir_end_flipped.Phi() <<
std::endl;
5369 TrackerData.
trkendtheta[iTrk] = (180.0/3.14159)*dir_end_flipped.Theta();
5370 TrackerData.
trkendphi[iTrk] = (180.0/3.14159)*dir_end_flipped.Phi();
5377 TrackerData.
trkmom[iTrk] = mom;
5380 TrackerData.
trklen[iTrk] = tlen;
5382 TrackerData.
trkmomrange[iTrk] = trkm.GetTrackMomentum(tlen,13);
5383 TrackerData.
trkmommschi2[iTrk] = trkm.GetMomentumMultiScatterChi2(ptrack);
5384 TrackerData.
trkmommsllhd[iTrk] = trkm.GetMomentumMultiScatterLLHD(ptrack);
5396 auto mapIter = trackIDtoPFParticleIDMap.find(TrackID);
5397 if (mapIter != trackIDtoPFParticleIDMap.end()) {
5484 if(fmvapid.isValid()) {
5495 art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trackListHandle[iTracker], evt,
"pmtrack");
5498 auto vhit = fmthm.at(iTrk);
5499 auto vmeta = fmthm.data(iTrk);
5502 art::FindManyP<recob::SpacePoint> fmspts(vhit, evt,
"pmtrack");
5511 std::cout <<
"vhit.size(): " << vhit.size() <<
std::endl;
5512 std::cout <<
"vmeta.size(): " << vmeta.size() <<
std::endl;
5513 std::cout <<
"fmspts.size(): " << fmspts.size() <<
std::endl;
5516 for (
unsigned int h = 0;
h < vhit.size();
h++)
5520 const TVector3&
dir = tracklist[iTracker][iTrk]->DirectionAtPoint<TVector3>(
h);
5521 const TVector3&
loc = tracklist[iTracker][iTrk]->LocationAtPoint<TVector3>(
h);
5522 double cosgamma =
std::abs(std::sin(angleToVert)*dir.Y() + std::cos(angleToVert)*dir.Z());
5531 std::vector< art::Ptr<recob::SpacePoint> > sptv = fmspts.at(
h);
5532 TrackerData.
hittrkx[HitIterator2] = sptv[0]->XYZ()[0];
5533 TrackerData.
hittrky[HitIterator2] = sptv[0]->XYZ()[1];
5534 TrackerData.
hittrkz[HitIterator2] = sptv[0]->XYZ()[2];
5536 TVector3 dir_hit_flipped;
5537 dir_hit_flipped.SetXYZ(dir.Z(), dir.Y(), dir.X());
5546 TrackerData.
hittrkds[HitIterator2] = vmeta[
h]->Dx();
5550 std::cout <<
"pos.X(): " << sptv[0]->XYZ()[0] <<
"\t" <<
"pos.Y(): " << sptv[0]->XYZ()[1] <<
"\t" <<
"pos.Z(): " << sptv[0]->XYZ()[2] <<
std::endl;
5551 std::cout <<
"pos2.X(): " << loc.X() <<
"\t" <<
"pos2.Y(): " << loc.Y() <<
"\t" <<
"pos2.Z(): " << loc.Z() <<
std::endl;
5552 std::cout <<
"dir.X(): " << dir.X() <<
"\t" <<
"dir.Y(): " << dir.Y() <<
"\t" <<
"dir.Z(): " << dir.Z() <<
std::endl;
5553 std::cout <<
"dir_hit_flipped.Theta(): " << (180.0/3.14159)*dir_hit_flipped.Theta() <<
"\t" <<
"dir_hit_flipped.Phi(): " << (180.0/3.14159)*dir_hit_flipped.Phi() <<
std::endl;
5554 std::cout <<
"vmeta[h]->Dx(): " << vmeta[
h]->Dx() <<
std::endl;
5555 std::cout <<
"Dx corrected pitch old: " << geomhandle->
WirePitch()/cosgamma <<
std::endl;
5557 std::cout <<
"view: " << vhit[
h]->WireID().Plane <<
std::endl;
5562 TrackerData.
hittrktpc[HitIterator2] = vhit[
h]->WireID().TPC;
5563 TrackerData.
hittrkview[HitIterator2] = vhit[
h]->WireID().Plane;
5564 TrackerData.
hittrkwire[HitIterator2] = vhit[
h]->WireID().Wire;
5565 TrackerData.
hittrkpeakT[HitIterator2] = vhit[
h]->PeakTime();
5567 TrackerData.
hittrkph[HitIterator2] = vhit[
h]->PeakAmplitude();
5569 TrackerData.
hittrkstarT[HitIterator2] = vhit[
h]->StartTick();
5570 TrackerData.
hittrkendT[HitIterator2] = vhit[
h]->EndTick();
5571 TrackerData.
hittrkrms[HitIterator2] = vhit[
h]->RMS();
5627 if (fmcal.isValid()){
5628 std::vector<const anab::Calorimetry*> calos = fmcal.at(iTrk);
5634 <<
" has " << calos.size() <<
" planes for calorimetry , only " 5639 for (
size_t ical = calos.size() - 1; ical <= 1 ; --ical){
5640 if (!calos[ical])
continue;
5641 if (!calos[ical]->
PlaneID().isValid)
continue;
5642 int planenum = calos[ical]->PlaneID().Plane;
5643 if (planenum<0||planenum>1)
continue;
5644 TrackerData.
trkke[iTrk][planenum] = calos[ical]->KineticEnergy();
5645 TrackerData.
trkrange[iTrk][planenum] = calos[ical]->Range();
5647 TrackerData.
trkpitchc[iTrk][planenum]= calos[ical] -> TrkPitchC();
5648 const size_t NHits = calos[ical] ->
dEdx().size();
5654 <<
" has " << NHits <<
" hits on calorimetry plane #" << planenum
5659 for(
size_t iTrkHit = 0; iTrkHit < NHits && iTrkHit < TrackerData.
GetMaxHitsPerTrack(iTrk, planenum); ++iTrkHit) {
5660 TrackerData.
trkdedx[iTrk][planenum][iTrkHit] = (calos[ical] ->
dEdx())[iTrkHit];
5661 TrackerData.
trkdqdx[iTrk][planenum][iTrkHit] = (calos[ical] -> dQdx())[iTrkHit];
5662 TrackerData.
trkresrg[iTrk][planenum][iTrkHit] = (calos[ical] -> ResidualRange())[iTrkHit];
5663 TrackerData.
trktpc[iTrk][planenum][iTrkHit] = (calos[ical] ->
PlaneID()).
TPC;
5664 const auto& TrkPos = (calos[ical] -> XYZ())[iTrkHit];
5665 auto& TrkXYZ = TrackerData.
trkxyz[iTrk][planenum][iTrkHit];
5666 TrkXYZ[0] = TrkPos.X();
5667 TrkXYZ[1] = TrkPos.Y();
5668 TrkXYZ[2] = TrkPos.Z();
5670 TrackerData.
trkdedx2[HitIterator] = (calos[ical] ->
dEdx())[iTrkHit];
5671 TrackerData.
trkdqdx2[HitIterator] = (calos[ical] -> dQdx())[iTrkHit];
5673 TrackerData.
trkx2[HitIterator] = TrkPos.X();
5674 TrackerData.
trky2[HitIterator] = TrkPos.Y();
5675 TrackerData.
trkz2[HitIterator] = TrkPos.Z();
5766 for (
unsigned int iVertexAlg=0; iVertexAlg < NVertexAlgos; ++iVertexAlg){
5769 size_t NVertices = vertexlist[iVertexAlg].size();
5774 VertexData.
nvtx = (short) NVertices;
5782 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NVertices
5787 for (
size_t i = 0; i < NVertices && i <
kMaxVertices ; ++i){
5788 VertexData.
vtxId[i] = vertexlist[iVertexAlg][i]->ID();
5789 Double_t xyz[3] = {};
5790 vertexlist[iVertexAlg][i] -> XYZ(xyz);
5791 VertexData.
vtxx[i] = xyz[0];
5792 VertexData.
vtxy[i] = xyz[1];
5793 VertexData.
vtxz[i] = xyz[2];
5796 auto mapIter = vertexIDtoPFParticleIDMap.find(vertexlist[iVertexAlg][i]->
ID());
5797 if (mapIter != vertexIDtoPFParticleIDMap.end()) {
5807 art::FindMany<recob::PFParticle> fmPFParticle(vertexListHandle[iVertexAlg], evt,
fPFParticleModuleLabel);
5808 if(fmPFParticle.isValid()) {
5809 std::vector<const recob::PFParticle*> pfparticles = fmPFParticle.at(i);
5810 if(pfparticles.size() > 1)
5811 std::cerr <<
"Warning: more than one associated PFParticle found for a vertex. Only one stored in tree." <<
std::endl;
5812 if (pfparticles.size() == 0)
5832 fData->mcevts_truthcry = mclistcry.size();
5833 fData->cry_no_primaries = nCryPrimaries;
5835 for(Int_t iPartc = 0; iPartc < mctruthcry->NParticles(); ++iPartc){
5837 fData->cry_primaries_pdg[iPartc]=partc.PdgCode();
5838 fData->cry_Eng[iPartc]=partc.E();
5839 fData->cry_Px[iPartc]=partc.Px();
5840 fData->cry_Py[iPartc]=partc.Py();
5841 fData->cry_Pz[iPartc]=partc.Pz();
5842 fData->cry_P[iPartc]=partc.P();
5843 fData->cry_StartPointx[iPartc] = partc.Vx();
5844 fData->cry_StartPointy[iPartc] = partc.Vy();
5845 fData->cry_StartPointz[iPartc] = partc.Vz();
5846 fData->cry_StartPointt[iPartc] = partc.T();
5847 fData->cry_status_code[iPartc]=partc.StatusCode();
5848 fData->cry_mass[iPartc]=partc.Mass();
5849 fData->cry_trackID[iPartc]=partc.TrackId();
5850 fData->cry_ND[iPartc]=partc.NumberDaughters();
5851 fData->cry_mother[iPartc]=partc.Mother();
5857 fData->proto_no_primaries = nProtoPrimaries;
5858 for(Int_t iPartp = 0; iPartp < nProtoPrimaries; ++iPartp){
5861 fData->proto_isGoodParticle[iPartp] = (partp.Process() ==
"primary");
5862 fData->proto_vx[iPartp] = partp.Vx();
5863 fData->proto_vy[iPartp] = partp.Vy();
5864 fData->proto_vz[iPartp] = partp.Vz();
5865 fData->proto_t[iPartp] = partp.T();
5866 fData->proto_px[iPartp] = partp.Px();
5867 fData->proto_py[iPartp] = partp.Py();
5868 fData->proto_pz[iPartp] = partp.Pz();
5869 fData->proto_momentum[iPartp] = partp.P();
5870 fData->proto_energy[iPartp] = partp.E();
5871 fData->proto_pdg[iPartp] = partp.PdgCode();
5876 fData->mcevts_truth = mclist.size();
5877 if (
fData->mcevts_truth > 0)
5882 for(
unsigned int iList = 0; (iList < mclist.size()) && (neutrino_i <
kMaxTruth) ; ++iList){
5883 if (mclist[iList]->NeutrinoSet()){
5884 fData->nuPDG_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().PdgCode();
5885 fData->ccnc_truth[neutrino_i] = mclist[iList]->GetNeutrino().CCNC();
5886 fData->mode_truth[neutrino_i] = mclist[iList]->GetNeutrino().Mode();
5887 fData->Q2_truth[neutrino_i] = mclist[iList]->GetNeutrino().QSqr();
5888 fData->W_truth[neutrino_i] = mclist[iList]->GetNeutrino().W();
5889 fData->X_truth[neutrino_i] = mclist[iList]->GetNeutrino().X();
5890 fData->Y_truth[neutrino_i] = mclist[iList]->GetNeutrino().Y();
5891 fData->hitnuc_truth[neutrino_i] = mclist[iList]->GetNeutrino().HitNuc();
5892 fData->enu_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().E();
5893 fData->nuvtxx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vx();
5894 fData->nuvtxy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vy();
5895 fData->nuvtxz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vz();
5896 if (mclist[iList]->GetNeutrino().Nu().
P()){
5897 fData->nu_dcosx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Px()/mclist[iList]->GetNeutrino().Nu().P();
5898 fData->nu_dcosy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Py()/mclist[iList]->GetNeutrino().Nu().P();
5899 fData->nu_dcosz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Pz()/mclist[iList]->GetNeutrino().Nu().P();
5901 fData->lep_mom_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().P();
5902 if (mclist[iList]->GetNeutrino().Lepton().
P()){
5903 fData->lep_dcosx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Px()/mclist[iList]->GetNeutrino().Lepton().P();
5904 fData->lep_dcosy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Py()/mclist[iList]->GetNeutrino().Lepton().P();
5905 fData->lep_dcosz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Pz()/mclist[iList]->GetNeutrino().Lepton().P();
5960 if (mctruth->NeutrinoSet()){
5962 fData->genie_no_primaries = mctruth->NParticles();
5964 size_t StoreParticles =
std::min((
size_t)
fData->genie_no_primaries,
fData->GetMaxGeniePrimaries());
5965 if (
fData->genie_no_primaries > (
int) StoreParticles) {
5969 <<
fData->genie_no_primaries <<
" MC particles, only " 5970 << StoreParticles <<
" stored in tree";
5972 for(
size_t iPart = 0; iPart < StoreParticles; ++iPart){
5974 fData->genie_primaries_pdg[iPart]=part.PdgCode();
5975 fData->genie_Eng[iPart]=part.E();
5976 fData->genie_Px[iPart]=part.Px();
5977 fData->genie_Py[iPart]=part.Py();
5978 fData->genie_Pz[iPart]=part.Pz();
5979 fData->genie_P[iPart]=part.P();
5980 fData->genie_status_code[iPart]=part.StatusCode();
5981 fData->genie_mass[iPart]=part.Mass();
5982 fData->genie_trackID[iPart]=part.TrackId();
5983 fData->genie_ND[iPart]=part.NumberDaughters();
5984 fData->genie_mother[iPart]=part.Mother();
5993 fData->no_mcshowers = nMCShowers;
5996 imcshwr != mcshowerh->end(); ++imcshwr) {
6005 fData->mcshwr_endX[shwr] = mcshwr.
End().
X();
6006 fData->mcshwr_endY[shwr] = mcshwr.
End().
Y();
6007 fData->mcshwr_endZ[shwr] = mcshwr.
End().
Z();
6009 fData->mcshwr_isEngDeposited[shwr] = 1;
6017 fData->mcshwr_dEdx[shwr] = mcshwr.
dEdx();
6023 fData->mcshwr_isEngDeposited[shwr] = 0;
6044 fData->mcshwr_Process.resize(shwr);
6045 fData->mcshwr_MotherProcess.resize(shwr);
6046 fData->mcshwr_AncestorProcess.resize(shwr);
6052 fData->no_mctracks = nMCTracks;
6056 TLorentzVector tpcstart, tpcend, tpcmom;
6057 double plen =
driftedLength(detProp, mctrk, tpcstart, tpcend, tpcmom);
6065 fData->mctrk_endX[trk] = mctrk.
End().
X();
6066 fData->mctrk_endY[trk] = mctrk.
End().
Y();
6067 fData->mctrk_endZ[trk] = mctrk.
End().
Z();
6087 fData->mctrk_len_drifted[trk] = plen;
6090 fData->mctrk_startX_drifted[trk] = tpcstart.X();
6091 fData->mctrk_startY_drifted[trk] = tpcstart.Y();
6092 fData->mctrk_startZ_drifted[trk] = tpcstart.Z();
6093 fData->mctrk_endX_drifted[trk] = tpcend.X();
6094 fData->mctrk_endY_drifted[trk] = tpcend.Y();
6095 fData->mctrk_endZ_drifted[trk] = tpcend.Z();
6096 fData->mctrk_p_drifted[trk] = tpcmom.Vect().Mag();
6097 fData->mctrk_px_drifted[trk] = tpcmom.X();
6098 fData->mctrk_py_drifted[trk] = tpcmom.Y();
6099 fData->mctrk_pz_drifted[trk] = tpcmom.Z();
6104 fData->mctrk_Process.resize(trk);
6105 fData->mctrk_MotherProcess.resize(trk);
6106 fData->mctrk_AncestorProcess.resize(trk);
6113 int photoncounter=0;
6114 for (
auto const& pmt : (*photonHandle) )
6116 std::map<int, int> PhotonsMap = pmt.DetectedPhotons;
6118 for(
auto itphoton = PhotonsMap.begin(); itphoton!= PhotonsMap.end(); itphoton++)
6120 for(
int iphotonatthistime = 0; iphotonatthistime < itphoton->second ; iphotonatthistime++)
6122 fData->photons_time[photoncounter]=itphoton->first;
6123 fData->photons_channel[photoncounter]=pmt.OpChannel;
6128 fData->numberofphotons=photoncounter;
6134 const sim::ParticleList& plist = pi_serv->ParticleList();
6136 size_t generator_particle=0;
6140 for(
size_t iPart = 0; (iPart < plist.size()) && (itPart != pend); ++iPart){
6145 <<
"GEANT particle #" << iPart <<
" returned a null pointer";
6148 if (iPart < fData->GetMaxGeneratorparticles()) {
6156 fData->Eng[generator_particle]=pPart->
E();
6157 fData->Mass[generator_particle]=pPart->
Mass();
6158 fData->Px[generator_particle]=pPart->
Px();
6159 fData->Py[generator_particle]=pPart->
Py();
6160 fData->Pz[generator_particle]=pPart->
Pz();
6161 fData->P[generator_particle]=pPart->
Momentum().Vect().Mag();
6162 fData->StartPointx[generator_particle]=pPart->
Vx();
6163 fData->StartPointy[generator_particle]=pPart->
Vy();
6164 fData->StartPointz[generator_particle]=pPart->
Vz();
6165 fData->StartT[generator_particle] = pPart->
T();
6167 TVector3 momentum_start_flipped;
6168 momentum_start_flipped.SetXYZ(pPart->
Pz(), pPart->
Py(), pPart->
Px());
6170 fData->theta[generator_particle] = (180.0/3.14159)*momentum_start_flipped.Theta();
6171 fData->phi[generator_particle] = (180.0/3.14159)*momentum_start_flipped.Phi();
6173 ++generator_particle;
6175 else if (iPart ==
fData->GetMaxGeneratorparticles()) {
6179 << plist.size() <<
" MC particles, only " 6180 <<
fData->GetMaxGeneratorparticles() <<
" will be stored in tree";
6183 fData->generator_list_size = generator_particle;
6184 fData->processname.resize(generator_particle);
6187 <<
fData->generator_list_size <<
" Generator particles";
6197 const sim::ParticleList& plist = pi_serv->ParticleList();
6202 size_t geant_particle=0;
6207 std::map<int, size_t> TrackIDtoIndex;
6208 std::vector<int> gpdg;
6209 std::vector<int> gmother;
6210 for(
size_t iPart = 0; (iPart < plist.size()) && (itPart != pend); ++iPart){
6214 <<
"GEANT particle #" << iPart <<
" returned a null pointer";
6217 bool isPrimary = pPart->
Process() == pri;
6219 TrackIDtoIndex.emplace(TrackID, iPart);
6220 gpdg.push_back(pPart->
PdgCode());
6221 gmother.push_back(pPart->
Mother());
6222 if (iPart < fData->GetMaxGEANTparticles()) {
6224 if (isPrimary) ++primary;
6226 TLorentzVector mcstart, mcend;
6227 unsigned int pstarti, pendi;
6228 double plen =
length(*pPart, mcstart, mcend, pstarti, pendi);
6229 bool isActive = plen != 0;
6245 fData->process_primary[geant_particle] =
int(isPrimary);
6251 fData->Eng[geant_particle]=pPart->
E();
6252 fData->EndE[geant_particle]=pPart->
EndE();
6253 fData->Mass[geant_particle]=pPart->
Mass();
6254 fData->Px[geant_particle]=pPart->
Px();
6255 fData->Py[geant_particle]=pPart->
Py();
6256 fData->Pz[geant_particle]=pPart->
Pz();
6258 fData->StartPointx[geant_particle]=pPart->
Vx();
6259 fData->StartPointy[geant_particle]=pPart->
Vy();
6260 fData->StartPointz[geant_particle]=pPart->
Vz();
6261 fData->StartT[geant_particle] = pPart->
T();
6265 fData->EndT[geant_particle] = pPart->
EndT();
6272 TVector3 momentum_start_flipped;
6273 momentum_start_flipped.SetXYZ(pPart->
Pz(), pPart->
Py(), pPart->
Px());
6275 fData->theta[geant_particle] = (180.0/3.14159)*momentum_start_flipped.Theta();
6276 fData->phi[geant_particle] = (180.0/3.14159)*momentum_start_flipped.Phi();
6278 fData->theta_xz[geant_particle] = std::atan2(pPart->
Px(), pPart->
Pz());
6279 fData->theta_yz[geant_particle] = std::atan2(pPart->
Py(), pPart->
Pz());
6282 fData->inTPCActive[geant_particle] =
int(isActive);
6286 fData->origin[geant_particle] = mc_truth->
Origin();
6287 fData->MCTruthIndex[geant_particle] = mc_truth.
key();
6291 fData->pathlen_tpcAV[active] = plen;
6295 fData->StartPointx_tpcAV[active] = mcstart.X();
6296 fData->StartPointy_tpcAV[active] = mcstart.Y();
6297 fData->StartPointz_tpcAV[active] = mcstart.Z();
6298 fData->StartT_tpcAV[active] = mcstart.T();
6299 fData->StartE_tpcAV[active] = pPart->
E(pstarti);
6300 fData->StartP_tpcAV[active] = pPart->
P(pstarti);
6301 fData->StartPx_tpcAV[active] = pPart->
Px(pstarti);
6302 fData->StartPy_tpcAV[active] = pPart->
Py(pstarti);
6303 fData->StartPz_tpcAV[active] = pPart->
Pz(pstarti);
6304 fData->EndPointx_tpcAV[active] = mcend.X();
6305 fData->EndPointy_tpcAV[active] = mcend.Y();
6306 fData->EndPointz_tpcAV[active] = mcend.Z();
6307 fData->EndT_tpcAV[active] = mcend.T();
6308 fData->EndE_tpcAV[active] = pPart->
E(pendi);
6309 fData->EndP_tpcAV[active] = pPart->
P(pendi);
6310 fData->EndPx_tpcAV[active] = pPart->
Px(pendi);
6311 fData->EndPy_tpcAV[active] = pPart->
Py(pendi);
6312 fData->EndPz_tpcAV[active] = pPart->
Pz(pendi);
6315 TVector3 momentum_start_tpcAv_flipped;
6316 momentum_start_tpcAv_flipped.SetXYZ(pPart->
Pz(pstarti), pPart->
Py(pstarti), pPart->
Px(pstarti));
6317 TVector3 momentum_end_tpcAv_flipped;
6318 momentum_end_tpcAv_flipped.SetXYZ(pPart->
Pz(pendi), pPart->
Py(pendi), pPart->
Px(pendi));
6320 fData->thetastart_tpcAV[active] = (180.0/3.14159)*momentum_start_tpcAv_flipped.Theta();
6321 fData->phistart_tpcAV[active] = (180.0/3.14159)*momentum_start_tpcAv_flipped.Phi();
6323 fData->thetaend_tpcAV[active] = (180.0/3.14159)*momentum_end_tpcAv_flipped.Theta();
6324 fData->phiend_tpcAV[active] = (180.0/3.14159)*momentum_end_tpcAv_flipped.Phi();
6353 unsigned short nAD = 0;
6360 const std::vector<sim::AuxDetIDE>& setOfIDEs =
c->AuxDetIDEs();
6367 setOfIDEs.begin(), setOfIDEs.end(),
6370 if (iIDE == setOfIDEs.end())
continue;
6378 for(
const auto& adtracks: setOfIDEs) {
6379 if( fabs(adtracks.trackID) ==
TrackID )
6380 totalE += adtracks.energyDeposited;
6385 fData->AuxDetID[geant_particle][nAD] =
c->AuxDetID();
6386 fData->entryX[geant_particle][nAD] = iIDE->entryX;
6387 fData->entryY[geant_particle][nAD] = iIDE->entryY;
6388 fData->entryZ[geant_particle][nAD] = iIDE->entryZ;
6389 fData->entryT[geant_particle][nAD] = iIDE->entryT;
6390 fData->exitX[geant_particle][nAD] = iIDE->exitX;
6391 fData->exitY[geant_particle][nAD] = iIDE->exitY;
6392 fData->exitZ[geant_particle][nAD] = iIDE->exitZ;
6393 fData->exitT[geant_particle][nAD] = iIDE->exitT;
6394 fData->exitPx[geant_particle][nAD] = iIDE->exitMomentumX;
6395 fData->exitPy[geant_particle][nAD] = iIDE->exitMomentumY;
6396 fData->exitPz[geant_particle][nAD] = iIDE->exitMomentumZ;
6397 fData->CombinedEnergyDep[geant_particle][nAD] = totalE;
6401 fData->NAuxDets[geant_particle] = nAD;
6406 <<
"particle #" << iPart
6407 <<
" touches " << nAD <<
" auxiliary detector cells, only " 6408 <<
kMaxAuxDets <<
" of them are saved in the tree";
6414 else if (iPart ==
fData->GetMaxGEANTparticles()) {
6418 << plist.size() <<
" MC particles, only " 6419 <<
fData->GetMaxGEANTparticles() <<
" will be stored in tree";
6423 fData->geant_list_size_in_tpcAV = active;
6424 fData->no_primaries = primary;
6425 fData->geant_list_size = geant_particle;
6426 fData->processname.resize(geant_particle);
6429 <<
fData->geant_list_size <<
" GEANT particles (" 6430 <<
fData->geant_list_size_in_tpcAV <<
" in AV), " 6431 <<
fData->no_primaries <<
" primaries, " 6432 <<
fData->genie_no_primaries <<
" GENIE particles";
6434 FillWith(
fData->MergedId, 0);
6441 int currentMergedId = 1;
6442 for(
size_t iPart = 0; iPart < geant_particle; ++iPart){
6444 if (
fData->MergedId[iPart])
continue;
6446 fData->MergedId[iPart] = currentMergedId;
6447 int currentMotherTrackId =
fData->Mother[iPart];
6448 while (currentMotherTrackId > 0) {
6449 if (TrackIDtoIndex.find(currentMotherTrackId)==TrackIDtoIndex.end())
break;
6450 unsigned int gindex = TrackIDtoIndex[currentMotherTrackId];
6451 if (gindex>=plist.size())
break;
6454 if (gpdg[gindex]!=
fData->pdg[iPart])
break;
6455 if (TrackIDtoIndex.find(currentMotherTrackId)!=TrackIDtoIndex.end()){
6456 unsigned int igeantMother = TrackIDtoIndex[currentMotherTrackId];
6457 if (igeantMother<geant_particle){
6458 fData->MergedId[igeantMother] = currentMergedId;
6461 currentMotherTrackId = gmother[gindex];
6471 const sim::ParticleList& plist = pi_serv->ParticleList();
6474 int trajpointcounter = 0;
6476 for(
size_t iPart = 0; (iPart < plist.size()) && (itPart != pend); ++iPart)
6482 <<
"GEANT particle #" << iPart <<
" returned a null pointer";
6486 for(
unsigned int trajpoint=0; trajpoint < numberTrajectoryPoints; ++trajpoint)
6488 const TLorentzVector& trajpointPosition= pPart->
Position(trajpoint);
6491 fData->TrajTrackId[trajpointcounter] = pPart->
TrackId();
6492 fData->TrajPDGCode[trajpointcounter] = pPart->
PdgCode();
6494 fData->TrajX[trajpointcounter] = trajpointPosition.X();
6495 fData->TrajY[trajpointcounter] = trajpointPosition.Y();
6496 fData->TrajZ[trajpointcounter] = trajpointPosition.Z();
6497 fData->TrajT[trajpointcounter] = pPart->
T(trajpoint);
6498 fData->TrajE[trajpointcounter] = pPart->
E(trajpoint);
6499 fData->TrajP[trajpointcounter] = pPart->
P(trajpoint);
6500 fData->TrajPx[trajpointcounter] = pPart->
Px(trajpoint);
6501 fData->TrajPy[trajpointcounter] = pPart->
Py(trajpoint);
6502 fData->TrajPz[trajpointcounter] = pPart->
Pz(trajpoint);
6504 TVector3 trajpointMomentum_flipped;
6505 trajpointMomentum_flipped.SetXYZ(pPart->
Pz(trajpoint), pPart->
Py(trajpoint), pPart->
Px(trajpoint));
6507 fData->TrajTheta[trajpointcounter] = (180.0/3.14159)*trajpointMomentum_flipped.Theta();
6508 fData->TrajPhi[trajpointcounter] = (180.0/3.14159)*trajpointMomentum_flipped.Phi();
6513 std::cout <<
"trajpointcounter: " << trajpointcounter <<
std::endl;
6514 std::cout <<
"fData->TrajTrackId[trajpointcounter]: " <<
fData->TrajTrackId[trajpointcounter] <<
std::endl;
6515 std::cout <<
"fData->TrajPDGCode[trajpointcounter]: " <<
fData->TrajPDGCode[trajpointcounter] <<
std::endl;
6516 std::cout <<
"fData->TrajX[trajpointcounter]: " <<
fData->TrajX[trajpointcounter] <<
std::endl;
6517 std::cout <<
"fData->TrajY[trajpointcounter]: " <<
fData->TrajY[trajpointcounter] <<
std::endl;
6518 std::cout <<
"fData->TrajZ[trajpointcounter]: " <<
fData->TrajZ[trajpointcounter] <<
std::endl;
6519 std::cout <<
"fData->TrajT[trajpointcounter]: " <<
fData->TrajT[trajpointcounter] <<
std::endl;
6520 std::cout <<
"fData->TrajE[trajpointcounter]: " <<
fData->TrajE[trajpointcounter] <<
std::endl;
6521 std::cout <<
"fData->TrajP[trajpointcounter]: " <<
fData->TrajP[trajpointcounter] <<
std::endl;
6522 std::cout <<
"fData->TrajPx[trajpointcounter]: " <<
fData->TrajPx[trajpointcounter] <<
std::endl;
6523 std::cout <<
"fData->TrajPy[trajpointcounter]: " <<
fData->TrajPy[trajpointcounter] <<
std::endl;
6524 std::cout <<
"fData->TrajPz[trajpointcounter]: " <<
fData->TrajPz[trajpointcounter] <<
std::endl;
6525 std::cout <<
"fData->TrajTheta[trajpointcounter]: " <<
fData->TrajTheta[trajpointcounter] <<
std::endl;
6526 std::cout <<
"fData->TrajPhi[trajpointcounter]: " <<
fData->TrajPhi[trajpointcounter] <<
std::endl;
6533 fData->geant_trajectory_size = trajpointcounter;
6539 fData->simenergydeposit_size = nSimEnergyDepositsTPCActive;
6540 fData->particleswithsimenergydeposit_size = nParticlesWithSimEnergyDepositsTPCActive;
6543 int particlewithsedit=0;
6544 for(
int sedavit = 0; sedavit < nSimEnergyDepositsTPCActive; sedavit++)
6546 if (std::find(
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle.begin(),
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle.end(), energyDepositTPCActivelist[sedavit]->TrackID()) ==
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle.end() )
6548 fData->ParticleIDSimEnergyDepositsTPCActivePerParticle[particlewithsedit] = energyDepositTPCActivelist[sedavit]->TrackID();
6550 particlewithsedit++;
6555 std::sort(
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle.begin(),
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle.end());
6559 std::vector<int> it_sortedbyparticleID;
6562 for(
int psedavit = 0; psedavit < nParticlesWithSimEnergyDepositsTPCActive; psedavit++)
6564 int NSEDForThisParticle = 0;
6565 for(
int sedavit = 0; sedavit < nSimEnergyDepositsTPCActive; sedavit++)
6567 if(energyDepositTPCActivelist[sedavit]->
TrackID() ==
fData->ParticleIDSimEnergyDepositsTPCActivePerParticle[psedavit])
6569 NSEDForThisParticle++;
6570 it_sortedbyparticleID.push_back(sedavit);
6574 fData->NSimEnergyDepositsTPCActivePerParticle[psedavit] = NSEDForThisParticle;
6575 totalsed += NSEDForThisParticle;
6669 for(
int sedavit = 0; sedavit < nSimEnergyDepositsTPCActive; sedavit++)
6671 fData->SEDTPCAVTrackID[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->TrackID();
6672 fData->SEDTPCAVPDGCode[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->PdgCode();
6673 fData->SEDTPCAVEnergy[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->Energy();
6674 fData->SEDTPCAVNumPhotons[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->NumPhotons();
6675 fData->SEDTPCAVNumElectrons[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->NumElectrons();
6676 fData->SEDTPCAVLength[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->StepLength();
6678 fData->SEDTPCAVStartTime[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->StartT();
6679 fData->SEDTPCAVStartX[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->StartX();
6680 fData->SEDTPCAVStartY[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->StartY();
6681 fData->SEDTPCAVStartZ[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->StartZ();
6683 fData->SEDTPCAVMidTime[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->Time();
6684 fData->SEDTPCAVMidX[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->MidPointX();
6685 fData->SEDTPCAVMidY[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->MidPointY();
6686 fData->SEDTPCAVMidZ[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->MidPointZ();
6688 fData->SEDTPCAVEndTime[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->EndT();
6689 fData->SEDTPCAVEndX[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->EndX();
6690 fData->SEDTPCAVEndY[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->EndY();
6691 fData->SEDTPCAVEndZ[sedavit] = energyDepositTPCActivelist[it_sortedbyparticleID[sedavit]]->EndZ();
6697 std::cout <<
"sedavit: " << sedavit <<
std::endl;
6698 std::cout <<
"fData->SEDTPCAVTrackID[" << sedavit <<
"]: " <<
fData->SEDTPCAVTrackID[sedavit] <<
std::endl;
6699 std::cout <<
"fData->SEDTPCAVPDGCode[" << sedavit <<
"]: " <<
fData->SEDTPCAVPDGCode[sedavit] <<
std::endl;
6700 std::cout <<
"fData->SEDTPCAVEnergy[" << sedavit <<
"]: " <<
fData->SEDTPCAVEnergy[sedavit] <<
std::endl;
6701 std::cout <<
"fData->SEDTPCAVNumPhotons[" << sedavit <<
"]: " <<
fData->SEDTPCAVNumPhotons[sedavit] <<
std::endl;
6702 std::cout <<
"fData->SEDTPCAVNumElectrons[" << sedavit <<
"]: " <<
fData->SEDTPCAVNumElectrons[sedavit] <<
std::endl;
6704 std::cout <<
"fData->SEDTPCAVLength[" << sedavit <<
"]: " <<
fData->SEDTPCAVLength[sedavit] <<
std::endl;
6705 std::cout <<
"fData->SEDTPCAVStartTime[" << sedavit <<
"]: " <<
fData->SEDTPCAVStartTime[sedavit] <<
std::endl;
6706 std::cout <<
"fData->SEDTPCAVStartX[" << sedavit <<
"]: " <<
fData->SEDTPCAVStartX[sedavit] <<
std::endl;
6707 std::cout <<
"fData->SEDTPCAVStartY[" << sedavit <<
"]: " <<
fData->SEDTPCAVStartY[sedavit] <<
std::endl;
6708 std::cout <<
"fData->SEDTPCAVStartZ[" << sedavit <<
"]: " <<
fData->SEDTPCAVStartZ[sedavit] <<
std::endl;
6709 std::cout <<
"fData->SEDTPCAVMidTime[" << sedavit <<
"]: " <<
fData->SEDTPCAVMidTime[sedavit] <<
std::endl;
6710 std::cout <<
"fData->SEDTPCAVMidX[" << sedavit <<
"]: " <<
fData->SEDTPCAVMidX[sedavit] <<
std::endl;
6711 std::cout <<
"fData->SEDTPCAVMidY[" << sedavit <<
"]: " <<
fData->SEDTPCAVMidY[sedavit] <<
std::endl;
6712 std::cout <<
"fData->SEDTPCAVMidZ[" << sedavit <<
"]: " <<
fData->SEDTPCAVMidZ[sedavit] <<
std::endl;
6713 std::cout <<
"fData->SEDTPCAVEndTime[" << sedavit <<
"]: " <<
fData->SEDTPCAVEndTime[sedavit] <<
std::endl;
6714 std::cout <<
"fData->SEDTPCAVEndX[" << sedavit <<
"]: " <<
fData->SEDTPCAVEndX[sedavit] <<
std::endl;
6715 std::cout <<
"fData->SEDTPCAVEndY[" << sedavit <<
"]: " <<
fData->SEDTPCAVEndY[sedavit] <<
std::endl;
6716 std::cout <<
"fData->SEDTPCAVEndZ[" << sedavit <<
"]: " <<
fData->SEDTPCAVEndZ[sedavit] <<
std::endl;
6723 fData->taulife = detProp.ElectronLifetime();
6732 <<
"Tree data structure contains:" 6733 <<
"\n - " <<
fData->no_hits <<
" hits (" <<
fData->GetMaxHits() <<
")" 6734 <<
"\n - " <<
fData->NHitsInAllTracks <<
" hits (" <<
fData->GetMaxHits() <<
")" 6735 <<
"\n - " <<
fData->genie_no_primaries <<
" genie primaries (" <<
fData->GetMaxGeniePrimaries() <<
")" 6736 <<
"\n - " <<
fData->geant_list_size <<
" GEANT particles (" <<
fData->GetMaxGEANTparticles() <<
"), " 6737 <<
fData->no_primaries <<
" primaries" 6738 <<
"\n - " <<
fData->geant_list_size_in_tpcAV <<
" GEANT particles in AV " 6739 <<
"\n - " << ((
int)
fData->kNTracker) <<
" trackers:" 6742 size_t iTracker = 0;
6743 for (
auto tracker =
fData->TrackData.cbegin();
6744 tracker !=
fData->TrackData.cend(); ++tracker, ++iTracker
6748 <<
" tracks (" << tracker->GetMaxTracks() <<
")" 6750 for (
int iTrk = 0; iTrk < tracker->ntracks; ++iTrk) {
6751 logStream <<
"\n [" << iTrk <<
"] "<< tracker->ntrkhitsperview[iTrk][0];
6752 for (
size_t ipl = 1; ipl < tracker->GetMaxPlanesPerTrack(iTrk); ++ipl)
6753 logStream <<
" + " << tracker->ntrkhitsperview[iTrk][ipl];
6754 logStream <<
" hits (" << tracker->GetMaxHitsPerTrack(iTrk, 0);
6755 for (
size_t ipl = 1; ipl < tracker->GetMaxPlanesPerTrack(iTrk); ++ipl)
6756 logStream <<
" + " << tracker->GetMaxHitsPerTrack(iTrk, ipl);
6766 MF_LOG_DEBUG(
"AnaRootParserStructure") <<
"Freeing the tree data structure";
6774 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
6781 TVector3
const& dir_start = shower.
Direction();
6791 if (fSavePFParticleInfo) {
6792 auto mapIter = showerIDtoPFParticleIDMap.find(shower.
ID());
6793 if (mapIter != showerIDtoPFParticleIDMap.end()) {
6817 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
6820 const size_t NShowers = showers.size();
6837 mf::LogError(
"AnaRootParser:limits") <<
"event has " << NShowers
6838 <<
" " << showerData.
Name() <<
" showers, only " 6847 showerData.
nshowers = (Short_t) NShowers;
6850 for (
size_t i = 0; i < NShowers; ++i)
FillShower(showerData, i, showers[i], fSavePFParticleInfo, showerIDtoPFParticleIDMap);
6863 std::map<int,double> trkide;
6864 std::vector<sim::IDE> ides;
6869 for(
size_t e = 0;
e < eveIDs.size(); ++
e){
6871 trkide[eveIDs[
e].trackID] += eveIDs[
e].energy;
6878 if ((ii->second)>maxe){
6880 trackid = ii->first;
6904 if (result<-1) result = -1;
6926 const sim::MCTrack& mctrack, TLorentzVector& tpcstart, TLorentzVector& tpcend, TLorentzVector& tpcmom){
6927 auto const* geom = lar::providerFrom<geo::Geometry>();
6931 double xrange[2] = {DBL_MAX, -DBL_MAX };
6932 for (
unsigned int c=0;
c<geom->Ncryostats(); ++
c) {
6933 for (
unsigned int t=0;
t<geom->NTPC(
c); ++
t) {
6945 for(
auto step: mctrack) {
6955 double newX =
step.X()+(
step.T()*vDrift);
6956 if (newX < xrange[0] || newX > xrange[1])
continue;
6961 tpcmom =
step.Momentum();
6966 result += disp.Mag();
6977 const simb::MCParticle&
p, TLorentzVector& start, TLorentzVector&
end,
unsigned int &starti,
unsigned int &endi)
6979 auto const* geom = lar::providerFrom<geo::Geometry>();
6983 double xrange[2] = {DBL_MAX, -DBL_MAX };
6984 for (
unsigned int c=0;
c<geom->Ncryostats(); ++
c) {
6985 for (
unsigned int t=0;
t<geom->NTPC(
c); ++
t) {
7007 double newX = p.
Vx(i)+(p.
T(i)*vDrift);
7008 if (newX < xrange[0] || newX > xrange[1])
continue;
7009 TLorentzVector
pos(newX,p.
Vy(i),p.
Vz(i),p.
T());
7017 result += disp.Mag();
7043 result += disp.Mag();
7056 unsigned int cryostat,
7060 std::vector<const recob::Hit*>
temp;
7061 int NumberOfHitsBeforeThisPlane=0;
7063 for(
size_t t = 0;
t < temp.size(); ++
t){
7064 if( temp[
t]->
WireID().Cryostat == cryostat&& temp[
t]->WireID().TPC == tpc && temp[
t]->WireID().Plane == plane )
break;
7065 NumberOfHitsBeforeThisPlane++;
7067 return NumberOfHitsBeforeThisPlane;
std::vector< std::string > mctrk_Process
def analyze(root, level, gtrees, gbranches, doprint)
double E(const int i=0) const
std::vector< Float_t > Eng
Int_t geant_trajectory_size
! how many trajectory points for all geant particles there is currently room for
std::vector< Float_t > mcshwr_CombEngE
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
TrackData_t< Float_t > trkendphi
std::string fElecDriftModuleLabel
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
std::vector< Int_t > TrajPDGCode
void ResizeGEANTInAV(int nParticlesInAV)
Resize the data strutcure for GEANT particles in active volume.
std::vector< Float_t > EndPx_tpcAV
Short_t hittrkmultiplicity[10000]
AuxDetMCData_t< Float_t > exitPx
Exit x momentum of particle out of AuxDet.
std::vector< Float_t > mcshwr_endZ
Int_t evttime_nanoseconds
std::vector< Int_t > mctrk_TrackId
std::vector< Float_t > EndPointz_drifted
TrackData_t< Float_t > trklen
unsigned int NumberTrajectoryPoints() const
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
TrackData_t< Short_t > trkncosmictags_containmenttagger
void Resize(size_t numPFParticles)
const TVector3 & ShowerStart() const
std::vector< Float_t > Py
const TLorentzVector & Position(const int i=0) const
std::vector< Float_t > StartT_drifted
TrackData_t< Float_t > trkmommscllbwd
simb::Origin_t Origin() const
ShowerPlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
std::vector< Float_t > cry_StartPointz
std::vector< Int_t > inTPCDrifted
std::vector< std::string > fCalorimetryModuleLabel
size_t GetMaxHitsPerTrack(int=0, int=0) const
constexpr std::uint32_t timeLow() const
ShowerPlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
std::vector< Float_t > StartPointz_tpcAV
TrackData_t< Float_t > trkstartz
std::vector< T > ShowerData_t
bool fSaveHitInfo
whether to extract and save MC Track information
VertexData_t< Short_t > vtxId
void DestroyData()
Destroy the local buffers (existing branches will point to invalid address!)
TrackData_t< Short_t > trkcosmictype_tagger
VertexData_t< Short_t > vtxhasPFParticle
double VertexMomentum() const
std::vector< Float_t > EndPointy_drifted
std::vector< Int_t > mcshwr_isEngDeposited
std::vector< Float_t > EndE_tpcAV
std::vector< Float_t > theta_yz
size_t GetMaxPlanesPerShower(int=0) const
Little helper functor class to create or reset branches in a tree.
std::vector< Float_t > mcshwr_CombEngX
std::vector< Float_t > cry_Py
const MCStep & End() const
Creates a simple ROOT tree with tracking and calorimetry information.
std::vector< Float_t > mcshwr_startY
double Py(const int i=0) const
TrackDataStruct()
Creates an empty tracker data structure.
ShowerData_t< Short_t > shwr_PFParticleID
std::string fClusterModuleLabel
float SummedADCaverage() const
Returns the average signal ADC counts of the cluster hits.
float IntegralAverage() const
Returns the average charge of the cluster hits.
TrackData_t< Short_t > trkcosmictype_flashmatch
std::vector< float > SEDTPCAVEndX
size_t GetMaxParticlesWithSimEnergyDepositsTPCActive() const
Returns the number of particles with SimEnergyDepositsTPCActive for which memory is allocated...
constexpr int kMaxClusters
TrackData_t< Float_t > trkpidmvapr
std::vector< Float_t > TrajP
PFParticleData_t< Short_t > pfp_selfID
the PFParticles' own IDs
void SetAddresses()
Sets the addresses of all the tree branches, creating the missing ones.
std::vector< std::string > fMCT0FinderLabel
std::vector< Float_t > thetastart_tpcAV
static constexpr size_t size()
begin/end interface
float bwdLogLikelihood() const
minimum negative log likelihood value from fit assuming a backward track direction ...
void Resize(size_t nVertices)
const TLorentzVector & EndPosition() const
std::string fRawDigitModuleLabel
std::vector< Int_t > mcshwr_TrackId
size_t GetMaxGEANTtrajectorypoints() const
Returns the number of GEANT trajectory steps for which memory is allocated.
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
bool hasGeantInAVInfo() const
Returns whether we have Geant data.
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
bool fSaveGeantTrajectoryInfo
whether to extract and save Geant information
std::vector< Float_t > cry_P
void SetMaxVertices(size_t maxVertices)
const Data_t * end() const
TrackData_t< Float_t > trkstarty
void endSubRun(const art::SubRun &sr)
std::vector< Float_t > StartPx_tpcAV
TrackData_t< Float_t > trkstartdirectionx
Int_t generator_list_size
! how many particles there is currently room for
std::vector< Float_t > TrajX
Short_t nPFParticles
the total number of PFParticles
bool fSaveGeantInfo
whether to extract and save Geant information
ShowerDataStruct(std::string new_name="", size_t maxShowers=0)
Creates a shower data structure allowing up to maxShowers showers.
std::vector< Float_t > genie_Eng
bool fSaveSimEnergyDepositTPCActiveInfo
whether to extract and save Geant information
std::vector< Float_t > mcshwr_AncestorendZ
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
std::string fPFParticleModuleLabel
TrackPlaneData_t< Short_t > ntrkhitsperview
AuxDetMCData_t< Float_t > exitT
Exit T position of particle out of AuxDet.
std::vector< Float_t > mcshwr_MotherendY
AdcChannelData::View View
AnaRootParserDataStruct(size_t nTrackers=0, size_t nVertexAlgos=0, std::vector< std::string > const &ShowerAlgos={})
Constructor; clears all fields.
unsigned int TrackID() const
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
constexpr int kMaxNPFPNeutrinos
TrackPlaneData_t< Float_t > trkpurtruth
void HitsBackTrack(detinfo::DetectorClocksData const &clockData, art::Ptr< recob::Hit > const &hit, int &trackid, float &maxe, float &purity)
std::vector< T > VertexData_t
Handle< PROD > getHandle(SelectorBase const &) const
std::vector< Float_t > mctrk_AncestorendZ
std::vector< Int_t > Mother
std::vector< Float_t > StartP_tpcAV
bool fIsMC
whether to use a permanent buffer (faster, huge memory)
Float_t hittrkstarT[10000]
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
ShowerData_t< Float_t > shwr_pidmvapr
constexpr int kMaxVertices
TrackPlaneData_t< Float_t > trkke
std::vector< float > SEDTPCAVMidZ
const std::string & AncestorProcess() const
std::vector< Float_t > proto_py
float bwdMomentum() const
momentum value from fit assuming a backward track direction
std::string fPhotonPropS1ModuleLabel
std::vector< Float_t > StartE_drifted
PFParticleDataStruct PFParticleData
TrackDataStruct & GetTrackerData(size_t iTracker)
std::vector< Float_t > StartT
size_t GetNVertexAlgos() const
std::vector< BoxedArray< T[kMaxNDaughtersPerPFP]>> DaughterData_t
std::vector< Int_t > mctrk_pdg
double ActiveBounds[6]
objet holding the configuration of the uBoone MCS fitting alg
TrackData_t< Short_t > trkncosmictags_tagger
Int_t simenergydeposit_size
! how many particles with sim energy deposits in TPC AV there is currently room for ...
size_t MaxVertices
maximum number of storable vertices
Int_t no_recoticksinallchannels
TrackHitData_t< Int_t > trktpc
std::string fSimEnergyDepositTPCActiveLabel
std::vector< float > SEDTPCAVLength
TrackData_t< Float_t > trkstartphi
constexpr std::uint32_t timeHigh() const
simb::Origin_t Origin() const
std::string fHitsModuleLabel
unsigned int bits
complementary information
Geometry information for a single TPC.
TrackData_t< Float_t > trkendx
const std::vector< double > & Energy() const
std::vector< Float_t > mcshwr_CombEngZ
bool fSaveGenieInfo
whether to extract and save CRY particle data
std::vector< Float_t > mcshwr_CombEngY
double Px(const int i=0) const
std::vector< Float_t > StartPy_drifted
std::vector< Float_t > EndPointy
std::vector< T > TrackData_t
TrackData_t< Float_t > trkmommscmic
std::vector< Float_t > mctrk_endX
ShowerData_t< Float_t > shwr_startx
startx of shower
std::vector< std::string > mcshwr_AncestorProcess
VertexData_t< Float_t > vtxz
ChannelGroupService::Name Name
std::vector< Int_t > proto_pdg
TrackData_t< Short_t > trkpidbestplane
const MCStep & MotherEnd() const
unsigned int AncestorTrackID() const
std::vector< Float_t > mcshwr_CombEngPy
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
size_t GetNTrackers() const
Returns the number of trackers configured.
void CheckTree(std::string caller) const
Helper function: throws if no tree is available.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::vector< Float_t > mctrk_endZ
ShowerPlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
float StartWire() const
Returns the wire coordinate of the start of the cluster.
Vector_t VertexDirection() const
std::vector< Float_t > StartPointz_drifted
std::vector< std::string > mctrk_AncestorProcess
constexpr int kMaxShowerHits
static bool IsShower(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as shower-like.
unsigned int triggernumber
std::vector< Float_t > phi
std::vector< Int_t > mcshwr_pdg
ShowerData_t< Float_t > shwr_pidmvae
std::vector< Float_t > pathlen_drifted
void SetMaxPFParticles(size_t maxPFParticles)
std::vector< Float_t > mctrk_MotherendX
std::vector< Float_t > mcshwr_CombEngPx
std::vector< Float_t > EndP_drifted
TrackPlaneData_t< Float_t > trkrange
std::vector< Int_t > NTrajectoryPointsPerParticle
double Mass(Resonance_t res)
resonance mass (GeV)
std::vector< Int_t > process_primary
std::vector< float > SEDTPCAVStartTime
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
std::vector< Float_t > mctrk_MotherstartY
std::vector< Float_t > mctrk_len_drifted
std::pair< float, std::string > P
void ResizePhotons(int nPhotons)
Resize the data strutcure for Generator particles.
std::vector< Int_t > TrackId
int PdgCode() const
Return the type of particle as a PDG ID.
std::vector< Int_t > cry_trackID
size_t GetMaxShowers() const
bool isCosmics
if it contains cosmics
Set of hits with a 2D structure.
std::vector< art::Ptr< recob::Shower > > ShowerVector
std::vector< Float_t > TrajY
float fG4minE
Energy threshold to save g4 particle info.
std::vector< Float_t > proto_momentum
Float_t hittrklocaltrackdirectiony[10000]
float EndTick() const
Returns the tick coordinate of the end of the cluster.
std::vector< Float_t > mcshwr_dEdx
std::vector< Float_t > proto_pz
void MarkMissing(TTree *pTree)
Applies a special prescription to mark shower information as missing.
AuxDetMCData_t< Float_t > entryZ
Entry Z position of particle into AuxDet.
std::string fPandoraNuVertexModuleLabel
std::vector< Float_t > cry_Px
size_t GetMaxTrackers() const
Returns the number of trackers for which memory is allocated.
float MultipleHitDensity() const
Density of wires in the cluster with more than one hit.
std::vector< Float_t > cry_StartPointx
TrackData_t< Float_t > trkflashT0
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Int_t particleswithsimenergydeposit_size
Cluster finding and building.
std::vector< Float_t > mcshwr_AncestorstartY
TTree * pTree
the tree to be worked on
Float_t hittrktrueEnergyMax[10000]
std::vector< Float_t > proto_vz
std::string fCalDataModuleLabel
bool hasFlashInfo() const
Returns whether we have Flash data.
void FillShower(AnaRootParserDataStruct::ShowerDataStruct &showerData, size_t iShower, recob::Shower const &showers, const bool fSavePFParticleInfo, const std::map< Short_t, Short_t > &showerIDtoPFParticleIDMap) const
Stores the information of shower in slot iShower of showerData.
std::string Process() const
std::vector< std::string > fMVAPIDTrackModuleLabel
ShowerDataStruct & GetShowerData(size_t iShower)
bool fSaveGeantInAVInfo
whether to extract and save Geant information
int AncestorPdgCode() const
Float_t hittrklocaltrackdirectiontheta[10000]
TrackData_t< Float_t > trkpidmvapich
std::vector< Float_t > mctrk_AncestorendX
void SetTrackers(size_t nTrackers)
Allocates data structures for the given number of trackers (no Clear())
std::vector< Int_t > proto_isGoodParticle
std::string fExternalCounterModuleLabel
bool isValid() const
Returns if the cluster is valid (that is, if its ID is not invalid)
TrackData_t< Float_t > trkenddirectionx
const MCStep & End() const
float StartAngle() const
Returns the starting angle of the cluster.
std::vector< Int_t > MergedId
bool fUseBuffer
whether to use a permanent buffer (faster, huge memory)
void SetBits(unsigned int setbits, bool unset=false)
Sets the specified bits.
std::vector< Float_t > Mass
Short_t nshowers
number of showers
AuxDetMCData_t< Float_t > exitX
Exit X position of particle out of AuxDet.
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
void CreateTree(bool bClearData=false)
Create the output tree and the data structures, if needed.
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
std::vector< std::string > GetShowerAlgos() const
Returns the name of configured shower algorithms (converted to string)
std::vector< Float_t > mctrk_startZ
int NumberDaughters() const
std::vector< Float_t > EndPz_drifted
Class def header for mcstep data container.
bool hasGeneratorInfo() const
Returns whether we have Generator data.
unsigned int MotherTrackID() const
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
Short_t pfp_neutrinoIDs[kMaxNPFPNeutrinos]
Int_t no_primaries
! how many particles there is currently room for
std::vector< Float_t > proto_vx
bool hasMCTrackInfo() const
Returns whether we have MCTrack data.
std::vector< Float_t > mcshwr_StartDirY
object containing MC flux information
TrackData_t< Float_t > trkcosmicscore_containmenttagger
art framework interface to geometry description
std::vector< float > SEDTPCAVStartZ
BranchCreator(TTree *tree)
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
bool hasVertexInfo() const
Returns whether we have Vertex data.
size_t GetMaxPhotons() const
Returns the number of GEANT particles for which memory is allocated.
std::vector< Float_t > mcshwr_AncestorendX
ShowerData_t< Float_t > shwr_pidmvapich
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj) const
AuxDetMCData_t< Float_t > exitPy
Exit y momentum of particle out of AuxDet.
total_extent<T>::value has the total number of elements of an array
std::vector< Int_t > MCTruthIndex
std::vector< Float_t > photons_time
TrackData_t< Short_t > trkevtxid
std::vector< Float_t > EndPointz
size_t GetMaxTracks() const
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
bool fSaveGeneratorInfo
whether to extract and save collected photons
std::vector< BoxedArray< T[kNplanes][kMaxShowerHits]>> ShowerHitData_t
std::vector< Float_t > mctrk_startX
std::vector< std::string > mcshwr_Process
QuadExpr operator-(double v, const QuadExpr &e)
static constexpr value_type value
bool isValid() const noexcept
std::vector< Float_t > mcshwr_CombEngPz
void Resize(size_t nShowers)
std::string fPOTModuleLabel
std::vector< BoxedArray< T[kMaxNClustersPerPFP]>> ClusterData_t
std::vector< Float_t > mcshwr_MotherendX
std::vector< Float_t > mctrk_MotherstartZ
int CountHits(const art::Event &evt, const art::InputTag &which, unsigned int cryostat, unsigned int tpc, unsigned int plane)
std::vector< Float_t > mcshwr_AncestorstartX
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
const TVector3 & StartDir() const
Collection of particles crossing one auxiliary detector cell.
std::vector< Int_t > SEDTPCAVPDGCode
bool hasProtoInfo() const
Returns whether we have protoDUNE beam primaries.
std::vector< std::string > fShowerModuleLabel
AuxDetMCData_t< Float_t > entryX
Entry X position of particle into AuxDet.
bool fSavePFParticleInfo
whether to extract and save Shower information
std::vector< Float_t > theta_xz
void ResizeSimEnergyDepositsTPCActive(int nSimEnergyDepositsTPCActive, int nParticlesWithSimEnergyDepositsTPCActive)
Resize the data strutcure for SimEnergyDepositTPCActive info.
bool hasHitInfo() const
Returns whether we have Hit data.
std::vector< VertexDataStruct > VertexData
Float_t hittrkpeakT[10000]
TrackData_t< Float_t > trkNDF
TrackData_t< Short_t > trksvtxid
float EndCharge() const
Returns the charge on the last wire of the cluster.
TrackData_t< Float_t > trkendz
Simulation objects for optical detectors.
std::vector< Int_t > SEDTPCAVTrackID
size_t GetMaxVertices() const
TrackPlaneData_t< Short_t > trkorigin
double dEdx(float dqdx, float Efield)
ShowerData_t< Short_t > showerID
Shower ID.
std::string fCryGenModuleLabel
float SummedADC() const
Returns the total charge of the cluster from signal ADC counts.
TrackData_t< Float_t > trkcosmicscore_flashmatch
double bdist(const TVector3 &pos)
bool hasCryInfo() const
Returns whether we have Cry data.
float bestMomentum() const
momentum for best direction fit
std::vector< float > SEDTPCAVMidX
std::vector< Float_t > EndPointx_drifted
void SetMaxShowers(size_t maxShowers)
const Data_t * begin() const
bool hasRecobWireInfo() const
Returns whether we have RecobWire data.
TrackData_t< Short_t > trkPFParticleID
simb::Origin_t Origin() const
std::vector< BoxedArray< T[kNplanes][kMaxTrackHits][3]>> TrackHitCoordData_t
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
size_t GetMaxGEANTparticles() const
Returns the number of GEANT particles for which memory is allocated.
double Length(size_t p=0) const
Access to various track properties.
std::vector< std::string > fCosmicTaggerAssocLabel
whether to extract and save PFParticle information
TrackData_t< Float_t > trkchi2PerNDF
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
constexpr int kMaxTrackers
A wrapper to a C array (needed to embed an array into a vector)
std::vector< Float_t > mctrk_px_drifted
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleDataStruct & GetPFParticleData()
std::vector< Float_t > EndT_tpcAV
const std::vector< double > & dEdx() const
bool fSaveExternCounterInfo
whether to extract and save Flash information
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::vector< Float_t > mcshwr_MotherstartY
void ResizeGenerator(int nParticles)
Resize the data strutcure for Generator particles.
const std::vector< double > & MIPEnergy() const
int MotherPdgCode() const
std::vector< Float_t > mcshwr_StartDirZ
std::vector< Int_t > NumberDaughters
const std::string & AncestorProcess() const
std::vector< Int_t > mcshwr_MotherTrkId
std::vector< Float_t > mctrk_endX_drifted
TrackData_t< Float_t > trkstartdirectionz
TrackDataStruct(size_t maxTracks)
Creates a tracker data structure allowing up to maxTracks tracks.
SubRunData_t SubRunData
subrun data collected at begin of subrun
size_t GetMaxDaughtersPerPFParticle(int=0) const
std::vector< Float_t > StartPz_drifted
std::vector< Float_t > theta
TrackData_t< Float_t > trkpidmvae
constexpr int kMaxVertexAlgos
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
void ResizeGenie(int nPrimaries)
Resize the data strutcure for Genie primaries.
TrackHitCoordData_t< Float_t > trkxyz
void SetAddresses(TTree *pTree)
void Resize(size_t nTracks)
void SetVertexAlgos(size_t nVertexAlgos)
Allocates data structures for the given number of vertex algos (no Clear())
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
TrackData_t< Float_t > trkendy
trkf::TrajectoryMCSFitter fMCSFitter
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
TrackPlaneData_t< Float_t > trkpidpida
float Chi2PerNdof() const
std::vector< Int_t > cry_mother
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
void SetAddresses(TTree *pTree, std::string tracker, bool isCosmics)
size_t GetNShowerAlgos() const
Returns the number of trackers for which data structures are allocated.
TrackHitData_t< Float_t > trkdqdx
double P(const int i=0) const
key_type key() const noexcept
T get(std::string const &key) const
std::vector< Float_t > StartP_drifted
void CreateData(bool bClearData=false)
Creates the structure for the tree data; optionally initializes it.
std::vector< Float_t > StartPointx_drifted
bool fSavePhotonInfo
whether to extract and save ProtDUNE beam simulation information
float Width() const
A measure of the cluster width, in homogenized units.
constexpr int kMaxFlashes
std::vector< std::string > fFlashT0FinderLabel
Point_t const & Vertex() const
std::vector< std::string > fContainmentTaggerAssocLabel
size_t GetMaxGeneratorparticles() const
Returns the number of GEANT particles for which memory is allocated.
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
VertexData_t< Short_t > vtxPFParticleID
std::vector< Float_t > StartPx_drifted
std::vector< Int_t > mcshwr_AncestorTrkId
void SetVertexAddresses(size_t iVertexAlg)
std::vector< Float_t > EndE
const Array_t & data() const
double T(const int i=0) const
double length(const recob::Track &track)
std::vector< ShowerDataStruct > ShowerData
TrackData_t< Float_t > trkpidmvamu
bool hasShowerInfo() const
Returns whether we have Shower data.
void SetAddresses(TTree *pTree)
std::vector< Float_t > mctrk_endY_drifted
TrackData_t< Float_t > trkmommscllfwd
bool fSaveShowerInfo
whether to extract and save External Counter information
std::vector< Int_t > PDGCode_tpcAV
size_t GetNTrackers() const
Returns the number of trackers for which data structures are allocated.
TrackData_t< Short_t > trkhasPFParticle
std::string fMCTrackModuleLabel
std::vector< Float_t > mctrk_AncestorstartX
bool hasGeantTrajectoryInfo() const
Returns whether we have Geant trajectory data.
std::vector< Int_t > genie_status_code
VertexDataStruct & GetVertexData(size_t iVertex)
unsigned int NumberTimeSamples() const
bool hasClusterInfo() const
Returns whether we have Cluster data.
TrackPlaneData_t< Int_t > trkpdgtruth
std::unique_ptr< AnaRootParserDataStruct > fData
AuxDetMCData_t< Float_t > exitY
Exit Y position of particle out of AuxDet.
std::vector< Float_t > genie_Py
SubRunNumber_t subRun() const
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
bool fSaveProtoInfo
whether to extract and save Genie information
std::vector< BoxedArray< T[kMaxAuxDets]>> AuxDetMCData_t
std::vector< Float_t > StartPointy_drifted
Int_t hittrktrueID[10000]
bool IsPrimary() const
Returns whether the particle is the root of the flow.
TrackData_t< Short_t > trkcosmictype_containmenttagger
size_t GetNShowerAlgos() const
Returns the number of shower algorithms configured.
std::vector< Float_t > cry_Pz
std::vector< Float_t > proto_energy
const TVector3 & Direction() const
CodeOutputInterface * code
std::vector< Float_t > mctrk_endY
std::vector< Float_t > mctrk_startZ_drifted
std::vector< Float_t > mctrk_AncestorstartY
std::vector< Float_t > StartPointx
bool fSaveCaloCosmics
save calorimetry information for cosmics
ShowerData_t< Float_t > shwr_length
Shower length.
Float_t hittrklocaltrackdirectionx[10000]
std::vector< art::Ptr< recob::Track > > TrackVector
const MCStep & AncestorStart() const
std::vector< Float_t > EndPointx
TrackData_t< Float_t > trkstartx
std::vector< Float_t > genie_Pz
std::vector< Float_t > Px
static int max(int a, int b)
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
constexpr unsigned short kMaxAuxDets
max number of auxiliary detector cells per MC particle
void SetShowerAlgos(std::vector< std::string > const &ShowerAlgos)
Allocates data structures for the given number of trackers (no Clear())
void FillShowers(AnaRootParserDataStruct::ShowerDataStruct &showerData, std::vector< recob::Shower > const &showers, const bool fSavePFParticleInfo, const std::map< Short_t, Short_t > &showerIDtoPFParticleIDMap) const
Stores the information of all showers into showerData.
Float_t hittrkgoddnessofFit[10000]
ShowerData_t< Float_t > shwr_starty
starty of shower
Int_t no_ticksinallchannels
const VertexDataStruct & GetVertexData(size_t iVertex) const
TrackData_t< Float_t > trkenddirectionz
std::vector< Float_t > EndPointy_tpcAV
Class def header for mctrack data container.
std::vector< Float_t > EndPointx_tpcAV
const MCStep & AncestorStart() const
std::vector< std::string > fParticleIDModuleLabel
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
std::vector< Float_t > StartPy_tpcAV
const std::string & MotherProcess() const
std::vector< Float_t > EndPointz_tpcAV
Definition of data types for geometry description.
std::string fOpFlashModuleLabel
double driftedLength(detinfo::DetectorPropertiesData const &detProp, const simb::MCParticle &part, TLorentzVector &start, TLorentzVector &end, unsigned int &starti, unsigned int &endi)
TrackData_t< int > trkorig
TrackData_t< Float_t > trkpidmvaphoton
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
std::vector< BoxedArray< T[kNplanes][kMaxTrackHits]>> TrackHitData_t
size_t GetMaxGeniePrimaries() const
Returns the number of GENIE primaries for which memory is allocated.
TrackData_t< Float_t > trkmomrange
std::vector< Float_t > mcshwr_MotherendZ
std::vector< float > SEDTPCAVEndZ
std::vector< BoxedArray< T[kNplanes][kMaxShowerHits][3]>> ShowerHitCoordData_t
Float_t hittrkpitchC[10000]
TrackData_t< Float_t > trktrueT0
TrackData_t< Float_t > trkenddirectiony
unsigned int AncestorTrackID() const
TrackHitData_t< Float_t > trkdedx
std::vector< Int_t > origin
bool fSaveRecobWireInfo
whether to extract and save raw digit information
std::string fGenieGenModuleLabel
size_t GetMaxHits() const
Returns the number of hits for which memory is allocated.
bool bIgnoreMissingShowers
whether to ignore missing shower information
std::vector< Float_t > mctrk_py_drifted
const MCStep & AncestorEnd() const
const MCStep & DetProfile() const
TrackData_t< Float_t > trkendtheta
Detector simulation of raw signals on wires.
Float_t hittrklocaltrackdirectionphi[10000]
std::vector< std::string > fVertexModuleLabel
std::vector< Float_t > StartPointz
std::vector< Float_t > mctrk_pz_drifted
Float_t hittrklocaltrackdirectionz[10000]
const sim::ParticleList & ParticleList() const
std::string name
name of the shower algorithm (for branch names)
std::vector< Int_t > mctrk_Ancestorpdg
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
bool fSavePandoraNuVertexInfo
whether to extract and save Cluster information
TrackData_t< Short_t > trkId
double ConvertTicksToX(double ticks, int p, int t, int c) const
std::vector< float > SEDTPCAVMidY
std::remove_all_extents< Array_t >::type Data_t
bool hasGenieInfo() const
Returns whether we have Genie data.
static void SelectNeutrinoPFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select reconstructed neutrino particles from a list of all reconstructed particles.
TrackData_t< Float_t > trkmommsllhd
size_t GetMaxVertexAlgos() const
Returns the number of trackers for which memory is allocated.
bool fSaveRawDigitInfo
whether to extract and save Hit information
size_t GetMaxShowers() const
Returns the number of trackers for which memory is allocated.
bool fSaveMCShowerInfo
whether to extract and save Cluster information
bool fSaveClusterInfo
whether to extract and save Vertex information
const MCStep & Start() const
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
TrackData_t< Float_t > trkmommscbwd
std::vector< Float_t > pathlen_tpcAV
void ResizeGEANTTrajectory(int nTrajectoryPoints)
Resize the data strutcure for GEANT trajectory info.
std::vector< Float_t > mcshwr_startZ
TrackPlaneData_t< Float_t > trkpidchipi
Short_t hittrkwire[10000]
size_t GetNVertexAlgos() const
Returns the number of Vertex algos for which data structures are allocated.
bool hasGeantInfo() const
Returns whether we have Geant data.
ShowerData_t< Float_t > shwr_startz
startz of shower
bool hasRawDigitInfo() const
Returns whether we have RawDigit data.
TrackPlaneData_t< Float_t > trkefftruth
std::vector< Int_t > mctrk_Motherpdg
double Vx(const int i=0) const
std::string fG4ModuleLabel
Class whose "type" contains the base data type of the container.
std::vector< Int_t > cry_primaries_pdg
std::vector< BoxedArray< T[kNplanes]>> ShowerPlaneData_t
geo::View_t View() const
Returns the view for this cluster.
constexpr int kMaxExternCounts
TrackData_t< Float_t > trkcompleteness
auto array(Array const &a)
Returns a manipulator which will print the specified array.
Float_t hittrkendT[10000]
Declaration of signal hit object.
TrackPlaneData_t< Int_t > trkidtruth
const MCStep & MotherStart() const
size_t GetMaxPlanesPerTrack(int=0) const
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
std::vector< Float_t > photons_channel
std::vector< Float_t > phiend_tpcAV
size_t MaxShowers
maximum number of storable showers
std::vector< Int_t > mcshwr_Ancestorpdg
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
bool hasTrackInfo() const
Returns whether we have Track data.
TrackData_t< Float_t > trkstarttheta
void SetTrackerAddresses(size_t iTracker)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
std::vector< Float_t > TrajZ
TrackPlaneData_t< Float_t > trkpidchipr
DoubleProduct operator+(DoubleProduct const &left, DoubleProduct const right)
int MotherPdgCode() const
const MCStep & MotherEnd() const
std::vector< Float_t > TrajE
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
std::vector< Float_t > mcshwr_MotherstartZ
std::vector< Float_t > EndPy_drifted
std::vector< Int_t > mcshwr_Motherpdg
std::vector< Float_t > StartPointx_tpcAV
std::vector< Float_t > mcshwr_AncestorendY
std::vector< Float_t > mctrk_MotherendY
TrackPlaneData_t< Float_t > trkpitchc
Contains all timing reference information for the detector.
std::vector< T > PFParticleData_t
float StartCharge() const
Returns the charge on the first wire of the cluster.
void ResizeProto(int nPrimaries)
Resize the data structure for ProtoDUNE primaries.
std::vector< Int_t > cry_ND
information from the subrun
VertexDataStruct(size_t maxVertices)
TrackData_t< Float_t > trkpurity
std::vector< Float_t > EndPy_tpcAV
std::vector< Float_t > EndT_drifted
bool fSaveFlashInfo
whether to extract and save nu vertex information from Pandora
std::vector< Int_t > TrackId_tpcAV
std::vector< Float_t > mctrk_AncestorstartZ
ID_t ID() const
Identifier of this cluster.
std::vector< Float_t > mctrk_startY_drifted
AuxDetMCData_t< Float_t > exitPz
Exit z momentum of particle out of AuxDet.
bool fSaveAuxDetInfo
whether to extract and save auxiliary detector data
std::vector< float > SEDTPCAVMidTime
std::vector< Float_t > mctrk_startY
bool hasExternCountInfo() const
Returns whether we have External Counter data.
std::vector< Float_t > proto_vy
std::vector< std::string > fMVAPIDShowerModuleLabel
std::vector< Float_t > mcshwr_startX
bool fSaveTrackInfo
whether to extract and save recob wire information
PFParticleDataStruct(size_t maxPFParticles=0)
Creates a PFParticle data structure allowing up to maxPFParticles PFParticles.
Vector_t EndDirection() const
std::vector< Float_t > proto_px
std::vector< Float_t > mctrk_p_drifted
std::vector< Float_t > StartT_tpcAV
AuxDetMCData_t< Short_t > AuxDetID
Which AuxDet this particle went through.
contains information for a single step in the detector simulation
MC truth information to make RawDigits and do back tracking.
std::vector< Int_t > mctrk_AncestorTrkId
void ResizeGEANT(int nParticles)
Resize the data strutcure for GEANT particles.
std::vector< Float_t > mctrk_MotherendZ
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle's immediate parent
void SetAddresses(TTree *pTree, std::vector< std::string > const &trackers, std::vector< std::string > const &vertexalgos, std::vector< std::string > const &showeralgos, bool isCosmics)
Connect this object with a tree.
std::vector< Float_t > TrajPy
TrackData_t< Float_t > trkcosmicscore_tagger
std::vector< sim::TrackIDE > HitToEveTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::vector< TrackDataStruct > TrackData
std::vector< Float_t > mctrk_endZ_drifted
const TLorentzVector & Momentum(const int i=0) const
const PFParticleDataStruct & GetPFParticleData() const
const std::string & Process() const
const std::string & MotherProcess() const
std::vector< std::string > fFlashMatchAssocLabel
std::vector< Float_t > mctrk_startX_drifted
bool hasSimEnergyDepositTPCActiveInfo() const
Returns whether we have Geant trajectory data.
TrackData_t< Float_t > trkendd
static bool IsTrack(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as track-like.
bool hasAuxDetector() const
Returns whether we have auxiliary detector data.
std::vector< Int_t > NSimEnergyDepositsTPCActivePerParticle
double Pz(const int i=0) const
Provides recob::Track data product.
bool hasPandoraNuVertexInfo() const
Returns whether we have Pandora Nu Vertex data.
std::vector< Float_t > mcshwr_MotherstartX
std::vector< Float_t > TrajTheta
std::vector< Float_t > StartE_tpcAV
void SetShowerAddresses(size_t iShower)
bool hasPhotonInfo() const
Returns whether we have photon data.
void SetMaxTracks(size_t maxTracks)
size_t GetMaxPFParticles() const
std::vector< Float_t > proto_t
std::vector< Float_t > TrajPx
float fwdLogLikelihood() const
minimum negative log likelihood value from fit assuming a forward track direction ...
std::vector< Float_t > mcshwr_StartDirX
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
TrackPlaneData_t< Float_t > trkpidchimu
Class def header for MCShower data container.
std::vector< Int_t > status
std::vector< Float_t > mcshwr_endX
unsigned int MotherTrackID() const
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Trac...
double Vz(const int i=0) const
std::vector< Float_t > mctrk_MotherstartX
const std::string & Process() const
constexpr int kMaxNDaughtersPerPFP
TrackData_t< Short_t > trkncosmictags_flashmatch
VertexData_t< Float_t > vtxy
std::vector< Float_t > EndPz_tpcAV
Short_t hittrkview[10000]
std::vector< Float_t > EndP_tpcAV
std::vector< art::Ptr< recob::Vertex > > VertexVector
std::vector< Float_t > thetaend_tpcAV
TrackData_t< Float_t > trkstartdirectiony
std::vector< float > SEDTPCAVEndTime
std::vector< float > SEDTPCAVStartX
TrackPlaneData_t< Float_t > trkpidchika
EventNumber_t event() const
Point_t const & End() const
void CheckData(std::string caller) const
Helper function: throws if no data structure is available.
std::vector< Float_t > genie_P
const MCStep & MotherStart() const
Access the description of detector geometry.
std::vector< Float_t > TrajPhi
Declaration of basic channel signal object.
std::vector< Float_t > StartPointy
detail::Node< FrameID, bool > PlaneID
std::vector< Int_t > mcshwr_origin
constexpr int kMaxChannels
ShowerData_t< Float_t > shwr_pidmvamu
const MCStep & Start() const
bool fSaveMCTrackInfo
whether to extract and save MC Shower information
TrackPlaneData_t< Int_t > trkpidpdg
bool hasPFParticleInfo() const
Returns whether we have PFParticle data.
std::vector< Float_t > mctrk_AncestorendY
std::vector< std::string > mcshwr_MotherProcess
size_t GetMaxHitsPerShower(int=0, int=0) const
BoxedArray(const This_t &from)
TrackData_t< Float_t > trklenstraightline
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
std::vector< float > SEDTPCAVEnergy
void ResizeMCTrack(int nMCTracks)
Resize the data strutcure for MC Tracks.
ShowerData_t< Float_t > shwr_pidmvaphoton
ShowerData_t< Short_t > shwr_hasPFParticle
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
constexpr int kMaxTrackHits
TrackData_t< Float_t > trkthetayz
TrackData_t< Float_t > trkmommscfwd
std::vector< Float_t > mcshwr_AncestorstartZ
std::vector< Int_t > mctrk_origin
Int_t geant_list_size_in_tpcAV
size_t MaxPFParticles
maximum number of storable PFParticles
std::vector< float > SEDTPCAVEndY
std::vector< std::string > processname
std::vector< art::Ptr< recob::Cluster > > ClusterVector
unsigned int NHits() const
Number of hits in the cluster.
TrackData_t< int > trkg4id
unsigned int TrackID() const
std::vector< Float_t > EndT
AnaRootParserDataStruct::SubRunData_t SubRunData
std::vector< Float_t > Pz
std::vector< Float_t > EndE_drifted
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
int AncestorPdgCode() const
float fwdMomentum() const
momentum value from fit assuming a forward track direction
Contains ROOTTreeCode<>::code, ROOT tree character for branch of type T.
VertexData_t< Float_t > vtxx
TrackData_t< Float_t > trkthetaxz
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::vector< Int_t > genie_trackID
const TrackDataStruct & GetTrackerData(size_t iTracker) const
std::map< std::string, double > mvaOutput
std::vector< Float_t > TrajPz
void ResizeMCShower(int nMCShowers)
Resize the data strutcure for MC Showers.
AnaRootParser(fhicl::ParameterSet const &pset)
TrackPlaneData_t< Float_t > trkpidchi
TrackData_t< Float_t > trkstartd
void SetPFParticleAddress()
float EndAngle() const
Returns the ending angle of the cluster.
std::string fMCShowerModuleLabel
AuxDetMCData_t< Float_t > CombinedEnergyDep
Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.
void ResizeCry(int nPrimaries)
Resize the data strutcure for Cry primaries.
std::vector< Float_t > StartPointy_tpcAV
size_t GetMaxClustersPerPFParticle(int=0) const
std::vector< Float_t > mcshwr_endY
std::vector< Int_t > SEDTPCAVNumPhotons
second_as<> second
Type of time stored in seconds, in double precision.
std::vector< UShort_t > NAuxDets
Number of AuxDets crossed by this particle.
std::vector< Float_t > StartPz_tpcAV
std::vector< Int_t > inTPCActive
void Clear()
Clear all fields.
AuxDetMCData_t< Float_t > entryY
Entry Y position of particle into AuxDet.
recob::tracking::Plane Plane
static constexpr double sr
std::vector< Float_t > genie_mass
QuadExpr operator*(double v, const QuadExpr &e)
void SetAddresses(TTree *pTree, std::string tracker, bool isCosmics)
void analyze(const art::Event &evt)
read access to event
constexpr int kMaxReadoutTicksInAllChannels
TrackData_t< Short_t > NHitsPerTrack
ShowerDataStruct const & GetShowerData(size_t iShower) const
helper function for LArPandoraInterface producer module
AuxDetMCData_t< Float_t > entryT
Entry T position of particle into AuxDet.
float StartTick() const
Returns the tick coordinate of the start of the cluster.
std::string fCosmicClusterTaggerAssocLabel
std::vector< Int_t > genie_primaries_pdg
std::vector< std::string > fTrackModuleLabel
std::vector< std::string > mctrk_MotherProcess
std::vector< Int_t > TrajTrackId
bool hasMCShowerInfo() const
Returns whether we have MCShower data.
AuxDetMCData_t< Float_t > exitZ
Exit Z position of particle out of AuxDet.
std::vector< BoxedArray< T[kNplanes]>> TrackPlaneData_t
void SetName(std::string new_name)
std::vector< Float_t > TrajT
std::string fProtoGenModuleLabel
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
std::vector< Float_t > EndPx_drifted
Short_t hittrkchannel[10000]
std::vector< Float_t > genie_Px
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
double Vy(const int i=0) const
const MCStep & AncestorEnd() const
TrackData_t< Float_t > trkmommschi2
std::vector< Int_t > cry_status_code
std::vector< Int_t > genie_ND
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
bool fSaveVertexInfo
whether to extract and save Track information
constexpr Point origin()
Returns a origin position with a point of the specified type.
TrackHitData_t< Float_t > trkresrg
std::vector< Float_t > cry_StartPointy
size_t GetMaxSimEnergyDepositsTPCActive() const
Returns the number of SimEnergyDepositsTPCActive for which memory is allocated.
std::vector< Float_t > cry_StartPointt
QTextStream & endl(QTextStream &s)
std::vector< Int_t > mctrk_MotherTrkId
std::vector< Int_t > ParticleIDSimEnergyDepositsTPCActivePerParticle
size_t MaxTracks
maximum number of storable tracks
Event finding and building.
Float_t hittrkchargesum[10000]
Float_t hittrktrueEnergyFraction[10000]
void beginSubRun(const art::SubRun &sr)
std::vector< Float_t > cry_Eng
TrackData_t< Float_t > trkmom
std::vector< float > SEDTPCAVStartY
std::vector< Int_t > SEDTPCAVNumElectrons
float Integral() const
Returns the total charge of the cluster from hit shape.
float EndWire() const
Returns the wire coordinate of the end of the cluster.
std::vector< Float_t > phistart_tpcAV
constexpr int kMaxNClustersPerPFP
Float_t hittrkchargeintegral[10000]
std::vector< Int_t > genie_mother
void ClearLocalData()
Clear all fields if this object (not the tracker algorithm data)
std::vector< Float_t > cry_mass
size_t GetMaxGEANTInAVparticles() const
Returns the number of GEANT particles in AV for which memory is allocated.