10 #include "TParticle.h" 13 #include "TPolyMarker3D.h" 14 #include "TPolyMarker.h" 15 #include "TPolyLine.h" 16 #include "TPolyLine3D.h" 17 #include "TDatabasePDG.h" 49 void writeErrMsg(
const char* fcn,
53 <<
" failed with message:\n" 71 for(
size_t cryoIdx = 0; cryoIdx < geom->
Ncryostats(); cryoIdx++)
75 for (
size_t tpcIdx = 0; tpcIdx < cryoGeo.
NTPC(); tpcIdx++)
79 std::cout <<
"Cryo/TPC idx: " << cryoIdx <<
"/" << tpcIdx <<
", TPC center: " << tpc.
GetCenter()[0] <<
", " << tpc.
GetCenter()[1] <<
", " << tpc.
GetCenter()[2] << std::endl;
95 std::cout <<
" minx/maxx: " <<
minx <<
"/" <<
maxx <<
", miny/maxy: " <<
miny <<
"/" <<
maxy <<
", minz/miny: " <<
minz <<
"/" <<
maxz << std::endl;
118 std::vector<const simb::MCTruth*> mctruth;
121 for (
unsigned int i=0; i<mctruth.size(); ++i) {
124 bool firstout =
true;
126 std::string incoming;
127 std::string outgoing;
130 int jmax = TMath::Min(20,mctruth[i]->NParticles());
131 for (
int j=0; j<jmax; ++j) {
135 sprintf(buff,
"#color[%d]{%s #scale[0.75]{[%.1f GeV/c]}}",
141 sprintf(buff,
"#color[%d]{%s}",
146 if (firstin==
false) incoming +=
" + ";
151 if (firstout==
false) outgoing +=
" + ";
156 if (origin==
"" && incoming==
"") {
160 mctext = origin+incoming+
" #rightarrow "+outgoing;
162 TLatex& latex = view->
AddLatex(0.03, 0.2, mctext.c_str());
163 latex.SetTextSize(0.6);
179 std::vector<const simb::MCTruth*> mctruth;
181 std::cout<<
"\nMCTruth Ptcl trackID PDG P T Moth Process\n";
182 for (
unsigned int i=0; i<mctruth.size(); ++i) {
183 for (
int j=0; j<mctruth[i]->NParticles(); ++j) {
186 int KE = 1000 * (p.
E() - p.
Mass());
187 std::cout<<
std::right<<std::setw(7)<<i<<std::setw(5)<<j
190 <<std::setw(7)<<int(1000 * p.
P())
191 <<std::setw(7)<<KE<<std::setw(7)<<p.
Mother()
203 std::cout<<
"Note: Momentum, P, and kinetic energy, T, in MeV/c\n";
219 if (drawopt->fShowMCTruthVectors > 3) {
220 std::cout<<
"Unsupported ShowMCTruthVectors option (> 2)\n";
229 double xyz1[3] = {0.};
230 double xyz2[3] = {0.};
234 static bool first =
true;
236 std::cout<<
"******** Show MCTruth (Genie) particles when ShowMCTruthVectors = 1 or 3 ******** \n";
237 std::cout<<
" MCTruth vectors corrected for space charge? "<<sce->
EnableCorrSCE()<<
" and shifted by "<<xShift<<
" cm in X\n";
238 std::cout<<
" Neutrons and photons drawn with dotted lines. \n";
239 std::cout<<
" Red = e+/-, nue, nuebar. Blue = mu+/-, numu, numubar. Green = tau+/-, nutau, nutaubar.\n";
240 std::cout<<
" Yellow = photons. Magenta = pions, protons and nuetrons.\n";
241 std::cout<<
"******** Show MCParticle (Geant) decay photons (e.g. from pizeros) when ShowMCTruthVectors = 2 or 3 ******** \n";
242 std::cout<<
" Photons > 50 MeV are drawn as dotted lines corrected for space charge and are not shifted.\n";
243 std::cout<<
" Decay photon end points are drawn at 2 interaction lengths (44 cm) from the start position.\n";
244 std::cout<<
" Color: Green = (50 < E_photon < 100 MeV), Blue = (100 MeV < E_photon < 200 MeV), Red = (E_photon > 300 MeV).\n";
247 bool showTruth = (drawopt->fShowMCTruthVectors == 1 || drawopt->fShowMCTruthVectors == 3);
248 bool showPhotons = (drawopt->fShowMCTruthVectors > 1);
252 std::vector<const simb::MCTruth*> mctruth;
255 for (
size_t i = 0; i < mctruth.size(); ++i) {
257 for (
int j = 0; j < mctruth[i]->NParticles(); ++j) {
263 double r = p.
P()*10.0;
272 xyz1[0] = p.
Vx() - sceOffset.X();
273 xyz1[1] = p.
Vy() + sceOffset.Y();
274 xyz1[2] = p.
Vz() + sceOffset.Z();
275 xyz2[0] = xyz1[0] + r * p.
Px()/p.
P();
276 xyz2[1] = xyz1[1] + r * p.
Py()/p.
P();
277 xyz2[2] = xyz1[2] + r * p.
Pz()/p.
P();
279 double w1 = geo->WireCoordinate(xyz1[1], xyz1[2], (
int)plane, rawopt->
fTPC, rawopt->
fCryostat);
280 double w2 = geo->WireCoordinate(xyz2[1], xyz2[2], (
int)plane, rawopt->
fTPC, rawopt->
fCryostat);
286 TLine& l = view->
AddLine(w1, time, w2, time2);
290 TLine& l = view->
AddLine(time, w1, time2, w2);
303 if(plist.
empty())
return;
311 if(p->
PdgCode() != 22)
continue;
312 if(p->
Process() !=
"Decay")
continue;
313 int TMeV = 1000 * (p->
E() - p->
Mass());
314 if(TMeV < 30)
continue;
320 xyz1[0] = p->
Vx() - sceOffset.X();
321 xyz1[1] = p->
Vy() + sceOffset.Y();
322 xyz1[2] = p->
Vz() + sceOffset.Z();
323 xyz2[0] = xyz1[0] + r * p->
Px()/p->
P();
324 xyz2[1] = xyz1[1] + r * p->
Py()/p->
P();
325 xyz2[2] = xyz1[2] + r * p->
Pz()/p->
P();
326 double w1 = geo->WireCoordinate(xyz1[1], xyz1[2], (
int)plane, rawopt->
fTPC, rawopt->
fCryostat);
328 double w2 = geo->WireCoordinate(xyz2[1], xyz2[2], (
int)plane, rawopt->
fTPC, rawopt->
fCryostat);
330 TLine& l = view->
AddLine(w1, t1, w2, t2);
332 l.SetLineStyle(kDotted);
334 l.SetLineColor(kGreen);
335 }
else if(TMeV < 200) {
336 l.SetLineColor(kBlue);
338 l.SetLineColor(kRed);
372 std::vector<const simb::MCParticle*> plist;
382 std::cout <<
"# samples: " << theDetector->
NumberTimeSamples() <<
", min/max X: " << xMinFromTicks <<
"/" << xMaxFromTicks <<
", xMinimum/xMaximum: " << xMinimum <<
"/" << xMaximum << std::endl;
385 Color_t
const scintillationColor = kMagenta;
386 int neutralColor(12);
388 int neutrinoColor(38);
393 mf::LogDebug(
"SimulationDrawer") <<
"Starting loop over " << plist.size() <<
" McParticles, voxel list size is " << voxels.
size() << std::endl;
405 std::map<int, const simb::MCParticle*> trackToMcParticleMap;
408 constexpr
unsigned int MaxParticles = 100000000;
409 double minPartEnergy(0.01);
411 auto const* pDatabasePDG = TDatabasePDG::Instance();
413 unsigned int nDrawnParticles = 0U;
415 trackToMcParticleMap[mcPart->TrackId()] = mcPart;
422 if (mcTraj.
empty())
continue;
424 int const pdgCode(mcPart->PdgCode());
427 TParticlePDG
const* partPDG(pDatabasePDG->GetParticle(pdgCode));
428 double const partCharge = partPDG ? partPDG->Charge() : 0.;
429 double const partEnergy = mcPart->E();
433 bool const isScintillationLight = ((pdgCode == 22) || (pdgCode == 0)) && (partEnergy < 1
e-7);
435 if (isScintillationLight) {
437 if (!fDrawLight)
continue;
440 if (partEnergy < minPartEnergy)
continue;
443 if (nDrawnParticles++ >= MaxParticles) {
444 if (nDrawnParticles == MaxParticles) {
446 <<
"Only " << nDrawnParticles <<
"/" << plist.size()
447 <<
" MCParticle's will be displayed.";
477 double g4Ticks(detClocks->TPCG4Time2Tick(mcPart->T()));
480 bool xOffsetNotSet(
true);
482 int const numTrajPoints = mcTraj.
size();
484 std::vector<double> hitPositions;
485 hitPositions.reserve(3*numTrajPoints);
486 std::size_t hitCount = 0U;
489 for(
int hitIdx = 0; hitIdx < numTrajPoints; hitIdx++)
491 double xPos = mcTraj.
X(hitIdx);
492 double yPos = mcTraj.
Y(hitIdx);
493 double zPos = mcTraj.
Z(hitIdx);
496 if (xPos < minx || xPos >
maxx || yPos < miny || yPos >
maxy|| zPos < minz || zPos >
maxz)
continue;
503 auto const* pTPC = geom->PositionToTPCptr(
geo::Point_t(xPos, yPos, zPos));
510 if (xMaxFromTicks < xMinFromTicks) std::swap(xMinFromTicks,xMaxFromTicks);
512 xOffset = xMinFromTicks - theDetector->
ConvertTicksToX(g4Ticks, firstPlane);
513 xOffsetNotSet =
false;
516 catch(...) {
continue;}
523 if (xPos > xMinFromTicks && xPos < xMaxFromTicks)
534 hitPositions.push_back(xPos);
535 hitPositions.push_back(yPos);
536 hitPositions.push_back(zPos);
545 if (isScintillationLight) {
546 pl.SetLineColor(scintillationColor);
547 pl.SetLineStyle(kSolid);
550 else if (partCharge == 0.)
552 pl.SetLineColor(neutralColor);
553 pl.SetLineStyle(kDotted);
556 pl.SetPolyLine(hitCount, hitPositions.data(),
"");
561 std::map<const simb::MCParticle*, std::vector<std::vector<double> > > partToPosMap;
564 for(vxitr = voxels.
begin(); vxitr != voxels.
end(); vxitr++)
572 int trackId = vxd.
TrackID(partIdx);
577 partToPosMap[mcPart].push_back(std::vector<double>(3));
579 partToPosMap[mcPart].back()[0] = vxd.
VoxelID().
X();
580 partToPosMap[mcPart].back()[1] = vxd.
VoxelID().
Y();
581 partToPosMap[mcPart].back()[2] = vxd.
VoxelID().
Z();
588 std::map<const simb::MCParticle*, std::vector<std::vector<double> > >
::iterator partToPosMapItr;
590 for(partToPosMapItr = partToPosMap.begin(); partToPosMapItr != partToPosMap.end(); partToPosMapItr++)
596 if (!mcPart || partToPosMapItr->second.empty())
continue;
602 double g4Ticks(detClocks->TPCG4Time2Tick(mcPart->
T()));
605 bool xOffsetNotSet(
true);
608 int markerIdx(kFullDotSmall);
613 colorIdx = grayedColor;
618 std::unique_ptr<double[]> hitPositions(
new double[3*partToPosMapItr->second.size()]);
622 for(
size_t posIdx = 0; posIdx < partToPosMapItr->second.size(); posIdx++)
624 const std::vector<double>& posVec = partToPosMapItr->second[posIdx];
629 double hitLocation[] = {posVec[0],posVec[1],posVec[2]};
639 if (xMaxFromTicks < xMinFromTicks) std::swap(xMinFromTicks,xMaxFromTicks);
642 xOffsetNotSet =
false;
645 catch(...) {
continue;}
648 double xCoord = posVec[0] + xOffset;
650 if (xCoord > xMinFromTicks && xCoord < xMaxFromTicks)
652 hitPositions[3*hitCount ] = xCoord;
653 hitPositions[3*hitCount + 1] = posVec[1];
654 hitPositions[3*hitCount + 2] = posVec[2];
659 TPolyMarker3D& pm = view->
AddPolyMarker3D(1, colorIdx, markerIdx, markerSize);
660 pm.SetPolyMarker(hitCount, hitPositions.get(), markerIdx);
664 std::vector<const simb::MCTruth*> mctruth;
668 for (
unsigned int idx = 0; idx < mctruth.size(); idx++)
671 for (
int particleIdx = 0; particleIdx < mctruth[idx]->NParticles(); particleIdx++)
678 mf::LogDebug(
"SimulationDrawer") << mcPart << std::endl;
681 TVector3 particlePosition(mcPart.
Vx(),mcPart.
Vy(),mcPart.
Vz());
684 TVector3 oppPartDir(-mcPart.
Px(),-mcPart.
Py(),-mcPart.
Pz());
686 if (oppPartDir.Mag2() > 0.) oppPartDir.SetMag(1.);
688 double arcLenToDraw = -particlePosition.Z() / oppPartDir.CosTheta();
691 if (arcLenToDraw > 0.)
694 TPolyLine3D& pl(view->
AddPolyLine3D(2, neutrinoColor, 1, 2));
696 pl.SetPoint(0,particlePosition.X(),particlePosition.Y(),particlePosition.Z());
698 particlePosition +=
std::min(arcLenToDraw + 10.,1000.) * oppPartDir;
700 pl.SetPoint(1,particlePosition.X(),particlePosition.Y(),particlePosition.Z());
730 std::vector<const simb::MCParticle*> plist;
746 mf::LogDebug(
"SimulationDrawer") <<
"Starting loop over " << plist.size() <<
" McParticles, voxel list size is " << voxels.
size() << std::endl;
758 std::map<int, const simb::MCParticle*> trackToMcParticleMap;
761 bool displayMcTrajectories(
true);
762 double minPartEnergy(0.025);
764 double tpcminx = 1.0;
double tpcmaxx = -1.0;
765 double xOffset = 0.0;
double g4Ticks = 0.0;
766 double coeff = 0.0;
double readoutwindowsize = 0.0;
767 double vtx[3] = {0.0, 0.0, 0.0};
768 for(
size_t p = 0; p < plist.size(); ++p)
770 trackToMcParticleMap[plist[p]->TrackId()] = plist[p];
773 if (displayMcTrajectories)
779 int pdgCode(mcPart->
PdgCode());
780 TParticlePDG* partPDG(TDatabasePDG::Instance()->
GetParticle(pdgCode));
781 double partCharge = partPDG ? partPDG->Charge() : 0.;
782 double partEnergy = mcPart->
E();
784 if (!mcTraj.
empty() && partEnergy > minPartEnergy && mcPart->
TrackId() < 100000000)
787 int numTrajPoints = mcTraj.
size();
789 std::unique_ptr<double[]> hitPosX(
new double[numTrajPoints]);
790 std::unique_ptr<double[]> hitPosY(
new double[numTrajPoints]);
791 std::unique_ptr<double[]> hitPosZ(
new double[numTrajPoints]);
794 double xPos = mcTraj.
X(0);
795 double yPos = mcTraj.
Y(0);
796 double zPos = mcTraj.
Z(0);
798 tpcminx = 1.0; tpcmaxx = -1.0;
799 xOffset = 0.0; g4Ticks = 0.0;
800 vtx[0] = 0.0; vtx[1] = 0.0; vtx[2] = 0.0;
801 coeff = 0.0; readoutwindowsize = 0.0;
802 for(
int hitIdx = 0; hitIdx < numTrajPoints; hitIdx++)
804 xPos = mcTraj.
X(hitIdx);
805 yPos = mcTraj.
Y(hitIdx);
806 zPos = mcTraj.
Z(hitIdx);
809 if (xPos < minx || xPos >
maxx || yPos < miny || yPos >
maxy|| zPos < minz || zPos >
maxz)
continue;
811 if ((xPos < tpcminx) || (xPos > tpcmaxx))
813 vtx[0] = xPos; vtx[1] = yPos; vtx[2] = zPos;
819 unsigned int tpc = tpcid.
TPC;
821 tpcminx = tpcgeo.
MinX(); tpcmaxx = tpcgeo.
MaxX();
823 coeff = theDetector->GetXTicksCoefficient(tpc, cryo);
824 readoutwindowsize = theDetector->ConvertTicksToX(theDetector->ReadOutWindowSize(), 0, tpc, cryo);
828 g4Ticks = detClocks->TPCG4Time2Tick(mcPart->
T())
829 +theDetector->GetXTicksOffset(0, tpc, cryo)
830 -theDetector->TriggerOffset();
832 xOffset = theDetector->ConvertTicksToX(g4Ticks, 0, tpc, cryo);
834 else { xOffset = 0; tpcminx = 1.0; tpcmaxx = -1.0; coeff = 0.0; readoutwindowsize = 0.0;}
840 bool inreadoutwindow =
false;
843 if ((xPos > readoutwindowsize) && (xPos < tpcmaxx)) inreadoutwindow =
true;
847 if ((xPos > tpcminx) && (xPos < readoutwindowsize)) inreadoutwindow =
true;
850 if (!inreadoutwindow)
continue;
853 if (xPos > xMinimum && xPos < xMaximum)
855 hitPosX[hitCount] = xPos;
856 hitPosY[hitCount] = yPos;
857 hitPosZ[hitCount] = zPos;
866 if (partCharge == 0.)
874 pl.SetPolyLine(hitCount, hitPosX.get(), hitPosY.get(),
"");
876 pl.SetPolyLine(hitCount, hitPosZ.get(), hitPosX.get(),
"");
878 pl.SetPolyLine(hitCount, hitPosZ.get(), hitPosY.get(),
"");
884 std::map<const simb::MCParticle*, std::vector<std::vector<double> > > partToPosMap;
887 for(vxitr = voxels.
begin(); vxitr != voxels.
end(); vxitr++)
895 int trackId = vxd.
TrackID(partIdx);
900 partToPosMap[mcPart].push_back(std::vector<double>(3));
902 partToPosMap[mcPart].back()[0] = vxd.
VoxelID().
X();
903 partToPosMap[mcPart].back()[1] = vxd.
VoxelID().
Y();
904 partToPosMap[mcPart].back()[2] = vxd.
VoxelID().
Z();
911 std::map<const simb::MCParticle*, std::vector<std::vector<double> > >
::iterator partToPosMapItr;
913 for(partToPosMapItr = partToPosMap.begin(); partToPosMapItr != partToPosMap.end(); partToPosMapItr++)
919 if (!mcPart || partToPosMapItr->second.empty())
continue;
921 tpcminx = 1.0; tpcmaxx = -1.0;
922 xOffset = 0.0; g4Ticks = 0.0;
923 std::vector< std::array<double, 3> > posVecCorr;
924 posVecCorr.reserve(partToPosMapItr->second.size());
925 coeff = 0.0; readoutwindowsize = 0.0;
928 for(
size_t posIdx = 0; posIdx < partToPosMapItr->second.size(); posIdx++)
930 const std::vector<double>& posVec = partToPosMapItr->second[posIdx];
932 if ((posVec[0] < tpcminx) || (posVec[0] > tpcmaxx))
934 vtx[0] = posVec[0]; vtx[1] = posVec[1]; vtx[2] = posVec[2];
940 unsigned int tpc = tpcid.
TPC;
943 tpcminx = tpcgeo.
MinX(); tpcmaxx = tpcgeo.
MaxX();
945 coeff = theDetector->GetXTicksCoefficient(tpc, cryo);
946 readoutwindowsize = theDetector->ConvertTicksToX(theDetector->ReadOutWindowSize(), 0, tpc, cryo);
949 g4Ticks = detClocks->TPCG4Time2Tick(mcPart->
T())
950 +theDetector->GetXTicksOffset(0, tpc, cryo)
951 -theDetector->TriggerOffset();
953 xOffset = theDetector->ConvertTicksToX(g4Ticks, 0, tpc, cryo);
955 else { xOffset = 0; tpcminx = 1.0; tpcmaxx = -1.0; coeff = 0.0; readoutwindowsize = 0.0; }
958 double xCoord = posVec[0] + xOffset;
960 bool inreadoutwindow =
false;
963 if ((xCoord > readoutwindowsize) && (xCoord < tpcmaxx)) inreadoutwindow =
true;
967 if ((xCoord > tpcminx) && (xCoord < readoutwindowsize)) inreadoutwindow =
true;
970 if (inreadoutwindow && (xCoord > xMinimum && xCoord < xMaximum))
972 posVecCorr.push_back({{xCoord, posVec[1], posVec[2] }});
978 for (
size_t p = 0; p < posVecCorr.size(); ++p)
981 pm.SetPoint(p, posVecCorr[p][0], posVecCorr[p][1]);
983 pm.SetPoint(p, posVecCorr[p][2], posVecCorr[p][0]);
985 pm.SetPoint(p, posVecCorr[p][2], posVecCorr[p][1]);
994 std::vector<const simb::MCParticle*>& plist)
1002 std::vector<const simb::MCParticle*> temp;
1008 for(
unsigned int i = 0; i < plcol.
vals().size(); ++i){
1009 temp.push_back(plcol.
vals().at(i));
1014 writeErrMsg(
"GetRawDigits", e);
1017 return plist.size();
1024 std::vector<const simb::MCTruth*>& mcvec)
1030 std::vector<const simb::MCTruth*> temp;
1032 std::vector< art::Handle< std::vector<simb::MCTruth> > > mctcol;
1036 for(
size_t mctc = 0; mctc < mctcol.size(); ++mctc){
1039 for(
size_t i = 0; i < mclistHandle->size(); ++i){
1040 temp.push_back(&(mclistHandle->at(i)));
1046 writeErrMsg(
"GetMCTruth", e);
1049 return mcvec.size();
double E(const int i=0) const
double Z(const size_type i) const
double X(const size_type i) const
Point GetActiveVolumeCenter() const
Returns the center of the TPC active volume in world coordinates [cm].
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
double Py(const int i=0) const
Utilities related to art service access.
void MCTruthLongText(const art::Event &evt, evdb::View2D *view)
CryostatGeo const & GetElement(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
void HiLite(int trkId, bool hlt=true)
TPolyLine & AddPolyLine(int n, int c, int w, int s)
std::string fG4ModuleLabel
module label producing sim::SimChannel objects
Container of LAr voxel information.
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
const simb::MCTrajectory & Trajectory() const
TLine & AddLine(double x1, double y1, double x2, double y2)
list_type::const_iterator const_iterator
simb::Origin_t Origin() const
double MinX() const
Returns the world x coordinate of the start of the box.
The data type to uniquely identify a Plane.
bool isValid
Whether this ID points to a valid element.
Geometry information for a single TPC.
double Px(const int i=0) const
static sim::LArVoxelList GetLArVoxelList(const art::Event &evt, std::string moduleLabel)
CryostatID_t Cryostat
Index of cryostat.
int GetMCTruth(const art::Event &evt, std::vector< const simb::MCTruth * > &mctruth)
double MaxX() const
Returns the world x coordinate of the end of the box.
A collection of drawable 2-D objects.
static void FromPDG(TLine &line, int pdgcode)
Geometry information for a single cryostat.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::string Process() const
void MCTruth3D(const art::Event &evt, evdb::View3D *view)
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
double Length() const
Length is associated with z coordinate [cm].
list_type::const_iterator const_iterator
virtual bool EnableCorrSCE() const =0
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
virtual geo::Vector_t GetPosOffsets(geo::Point_t const &point) const =0
double Y(const size_type i) const
Encapsulates the information we want store for a voxel.
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
int GetParticle(const art::Event &evt, std::vector< const simb::MCParticle * > &plist)
double P(const int i=0) const
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
static int ColorFromPDG(int pdgcode)
double T(const int i=0) const
double fMinEnergyDeposition
bool fShowMCTruthTrajectories
void getManyByType(std::vector< Handle< PROD >> &results) const
unsigned int NTPC() const
Number of TPCs in this cryostat.
size_type NumberParticles() const
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
virtual unsigned int NumberTimeSamples() const =0
The data type to uniquely identify a TPC.
Description of geometry of one entire detector.
TLatex & AddLatex(double x, double y, const char *text)
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
bool fShowScintillationLight
Whether to draw low energy light (default: no).
void MCTruthShortText(const art::Event &evt, evdb::View2D *view)
Conversion of times between different formats and references.
double HalfHeight() const
Height is associated with y coordinate [cm].
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
geo::TPCID::TPCID_t FindTPCAtPosition(double const worldLoc[3], double const wiggle) const
Returns the index of the TPC at specified location.
double Vx(const int i=0) const
mapped_type Energy() const
Encapsulate the construction of a single detector plane.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
static const char * LatexName(int pdgcode)
Convert PDG code to a latex string (root-style)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
double Pz(const int i=0) const
Render the objects from the Simulation package.
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
double Vz(const int i=0) const
void MCTruthOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
const sim::ParticleList & ParticleList()
void MCTruthVectors2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
sim::LArVoxelID VoxelID() const
A collection of 3D drawable objects.
TPCID_t TPC
Index of the TPC within its cryostat.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Namespace collecting geometry-related classes utilities.
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
std::map< int, bool > fHighlite
double Vy(const int i=0) const
art framework interface to geometry description
double HalfWidth() const
Width is associated with x coordinate [cm].
constexpr Point origin()
Returns a origin position with a point of the specified type.
cet::coded_exception< error, detail::translate > exception
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int const &id)
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Encapsulate the construction of a single detector plane.
bool fShowMCTruthFullSize
const key_type & TrackID(const size_type) const
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].