LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::TrackAna Class Reference
Inheritance diagram for trkf::TrackAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Classes

struct  MCHists
 
struct  RecoHists
 

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 TrackAna (fhicl::ParameterSet const &pset)
 
virtual ~TrackAna ()
 
void analyze (const art::Event &evt)
 
void anaStitch (const art::Event &evt)
 
void endJob ()
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

template<typename T >
std::vector< size_t > fsort_indexes (const std::vector< T > &v)
 

Private Attributes

std::string fTrackModuleLabel
 
std::string fMCTrackModuleLabel
 
std::string fSpacepointModuleLabel
 
std::string fStitchModuleLabel
 
std::string fTrkSpptAssocModuleLabel
 
std::string fHitSpptAssocModuleLabel
 
std::string fHitModuleLabel
 
int fDump
 
double fMinMCKE
 
double fMinMCLen
 
double fMatchColinearity
 
double fMatchDisp
 
double fWMatchDisp
 
double fMatchLength
 
bool fIgnoreSign
 
bool fStitchedAnalysis
 
std::string fOrigin
 
bool fCheckOrigin
 
simb::Origin_t fOriginValue
 
int fPrintLevel
 
std::map< int, MCHistsfMCHistMap
 
std::map< int, RecoHistsfRecoHistMap
 
int fNumEvent
 

Detailed Description

Definition at line 270 of file TrackAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

trkf::TrackAna::TrackAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 769 of file TrackAna_module.cc.

References fCheckOrigin, fDump, fHitModuleLabel, fHitSpptAssocModuleLabel, fMCTrackModuleLabel, fMinMCKE, fMinMCLen, fOrigin, fOriginValue, fStitchModuleLabel, fTrackModuleLabel, fTrkSpptAssocModuleLabel, simb::kBeamNeutrino, simb::kCosmicRay, simb::kSingleParticle, simb::kSuperNovaNeutrino, and simb::kUnknown.

775  : EDAnalyzer(pset)
776  , fTrackModuleLabel(pset.get<std::string>("TrackModuleLabel"))
777  , fMCTrackModuleLabel(pset.get<std::string>("MCTrackModuleLabel"))
778  , fSpacepointModuleLabel(pset.get<std::string>("SpacepointModuleLabel"))
779  , fStitchModuleLabel(pset.get<std::string>("StitchModuleLabel"))
780  , fTrkSpptAssocModuleLabel(pset.get<std::string>("TrkSpptAssocModuleLabel"))
781  , fHitSpptAssocModuleLabel(pset.get<std::string>("HitSpptAssocModuleLabel"))
782  , fHitModuleLabel(pset.get<std::string>("HitModuleLabel"))
783  , fDump(pset.get<int>("Dump"))
784  , fMinMCKE(pset.get<double>("MinMCKE"))
785  , fMinMCLen(pset.get<double>("MinMCLen"))
786  , fMatchColinearity(pset.get<double>("MatchColinearity"))
787  , fMatchDisp(pset.get<double>("MatchDisp"))
788  , fWMatchDisp(pset.get<double>("WMatchDisp"))
789  , fMatchLength(pset.get<double>("MatchLength"))
790  , fIgnoreSign(pset.get<bool>("IgnoreSign"))
791  , fStitchedAnalysis(pset.get<bool>("StitchedAnalysis",false))
792  , fOrigin(pset.get<std::string>("MCTrackOrigin", "Any"))
793  , fPrintLevel(pset.get<int>("PrintLevel",0))
794  , fNumEvent(0)
795  {
796 
797  // Decide whether to check MCTrack origin
798  fCheckOrigin = false;
800  if(fOrigin.find("Beam") != std::string::npos) {
801  fCheckOrigin = true;
803  } else if(fOrigin.find("Cosmic") != std::string::npos) {
804  fCheckOrigin = true;
806  } else if(fOrigin.find("Super") != std::string::npos) {
807  fCheckOrigin = true;
809  } else if(fOrigin.find("Single") != std::string::npos) {
810  fCheckOrigin = true;
812  }
813 
814  // Report.
815 
816  mf::LogInfo("TrackAna")
817  << "TrackAna configured with the following parameters:\n"
818  << " TrackModuleLabel = " << fTrackModuleLabel << "\n"
819  << " MCTrackModuleLabel = " << fMCTrackModuleLabel << "\n"
820  << " StitchModuleLabel = " << fStitchModuleLabel << "\n"
821  << " TrkSpptAssocModuleLabel = " << fTrkSpptAssocModuleLabel << "\n"
822  << " HitSpptAssocModuleLabel = " << fHitSpptAssocModuleLabel << "\n"
823  << " HitModuleLabel = " << fHitModuleLabel << "\n"
824  << " Dump = " << fDump << "\n"
825  << " MinMCKE = " << fMinMCKE << "\n"
826  << " MinMCLen = " << fMinMCLen
827  << " Origin = " << fOrigin<<" Origin value "<<fOriginValue;
828  }
std::string fHitSpptAssocModuleLabel
std::string fTrkSpptAssocModuleLabel
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::string fSpacepointModuleLabel
std::string fStitchModuleLabel
single particles thrown at the detector
Definition: MCTruth.h:24
std::string fMCTrackModuleLabel
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
simb::Origin_t fOriginValue
std::string fOrigin
Supernova neutrinos.
Definition: MCTruth.h:23
std::string fTrackModuleLabel
std::string fHitModuleLabel
Cosmic rays.
Definition: MCTruth.h:22
Beam neutrinos.
Definition: MCTruth.h:21
trkf::TrackAna::~TrackAna ( )
virtual

Definition at line 830 of file TrackAna_module.cc.

834  {}

Member Function Documentation

void trkf::TrackAna::analyze ( const art::Event evt)

Definition at line 836 of file TrackAna_module.cc.

References anaStitch(), detinfo::DetectorProperties::ConvertXToTicks(), dir, detinfo::DetectorProperties::DriftVelocity(), e, sim::MCStep::E(), simb::MCParticle::E(), recob::Track::End(), recob::Track::EndCovariance(), recob::Track::EndDirection(), recob::Track::EndMomentum(), art::Event::event(), fCheckOrigin, fDump, trkf::TrackAna::MCHists::fHcosth, trkf::TrackAna::MCHists::fHdl, trkf::TrackAna::MCHists::fHdp, trkf::TrackAna::MCHists::fHdpc, trkf::TrackAna::MCHists::fHdudwpull, trkf::TrackAna::MCHists::fHduvcosth, trkf::TrackAna::MCHists::fHdvdwpull, trkf::TrackAna::RecoHists::fHendd, trkf::TrackAna::MCHists::fHenddx, trkf::TrackAna::MCHists::fHenddy, trkf::TrackAna::MCHists::fHenddz, trkf::TrackAna::RecoHists::fHendx, trkf::TrackAna::RecoHists::fHendy, trkf::TrackAna::RecoHists::fHendz, trkf::TrackAna::MCHists::fHgendx, trkf::TrackAna::MCHists::fHgendy, trkf::TrackAna::MCHists::fHgendz, trkf::TrackAna::MCHists::fHgke, trkf::TrackAna::MCHists::fHgkel, trkf::TrackAna::MCHists::fHglen, trkf::TrackAna::MCHists::fHglens, trkf::TrackAna::MCHists::fHgmom, trkf::TrackAna::MCHists::fHgmoml, trkf::TrackAna::MCHists::fHgphi, trkf::TrackAna::MCHists::fHgstartx, trkf::TrackAna::MCHists::fHgstarty, trkf::TrackAna::MCHists::fHgstartz, trkf::TrackAna::MCHists::fHgtheta, trkf::TrackAna::MCHists::fHgtheta_xz, trkf::TrackAna::MCHists::fHgtheta_yz, trkf::TrackAna::MCHists::fHHitEff, trkf::TrackAna::MCHists::fHHitPurity, fHitModuleLabel, trkf::TrackAna::RecoHists::fHlen, trkf::TrackAna::RecoHists::fHlens, trkf::TrackAna::MCHists::fHlvsl, trkf::TrackAna::MCHists::fHmcdudw, trkf::TrackAna::MCHists::fHmcdvdw, trkf::TrackAna::MCHists::fHmcu, trkf::TrackAna::MCHists::fHmcv, trkf::TrackAna::MCHists::fHmcw, trkf::TrackAna::RecoHists::fHmom, trkf::TrackAna::RecoHists::fHmoml, trkf::TrackAna::RecoHists::fHphi, trkf::TrackAna::MCHists::fHppull, trkf::TrackAna::MCHists::fHppullc, trkf::TrackAna::MCHists::fHpvsp, trkf::TrackAna::MCHists::fHpvspc, trkf::TrackAna::RecoHists::fHstartd, trkf::TrackAna::MCHists::fHstartdx, trkf::TrackAna::MCHists::fHstartdy, trkf::TrackAna::MCHists::fHstartdz, trkf::TrackAna::RecoHists::fHstartx, trkf::TrackAna::RecoHists::fHstarty, trkf::TrackAna::RecoHists::fHstartz, trkf::TrackAna::RecoHists::fHtheta, trkf::TrackAna::RecoHists::fHtheta_xz, trkf::TrackAna::RecoHists::fHtheta_yz, trkf::TrackAna::MCHists::fHupull, trkf::TrackAna::MCHists::fHvpull, fIgnoreSign, fMatchColinearity, fMatchDisp, fMatchLength, fMCHistMap, fMCTrackModuleLabel, fMinMCKE, fMinMCLen, fNumEvent, fOriginValue, fPrintLevel, fRecoHistMap, fStitchedAnalysis, fStitchModuleLabel, fTrackModuleLabel, fWMatchDisp, art::FindManyP< ProdB, Data >::get(), art::DataViewImpl::getByLabel(), recob::Track::GlobalToLocalRotationAtPoint(), recob::Track::HasMomentum(), recob::Track::ID(), art::Event::isRealData(), art::Handle< T >::isValid(), geo::k3D, simb::kCosmicRay, simb::MCParticle::Mass(), sim::MCStep::Momentum(), geo::GeometryCore::NearestWire(), geo::GeometryCore::Nplanes(), recob::Track::NumberTrajectoryPoints(), sim::MCTrack::Origin(), sim::MCTrack::PdgCode(), art::Event::run(), sim::MCTrack::Start(), sim::MCStep::T(), sim::MCTrack::TrackID(), cheat::ParticleInventoryService::TrackIdToParticle_P(), recob::Track::Vertex(), recob::Track::VertexCovariance(), recob::Track::VertexDirection(), recob::Track::VertexMomentum(), and w.

842  {
843  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
847 
848 
849  ++fNumEvent;
850 
851  // Optional dump stream.
852 
853  std::unique_ptr<mf::LogInfo> pdump;
854  if(fDump > 0) {
855  --fDump;
856  pdump = std::unique_ptr<mf::LogInfo>(new mf::LogInfo("TrackAna"));
857  }
858 
859  // Make sure histograms are booked.
860 
861  bool mc = !evt.isRealData();
862 
863  // Get MCTracks.
864 
866  evt.getByLabel(fMCTrackModuleLabel, mctrackh);
867  // pair of MCTrack and index of matched reco track
868  std::vector<std::pair<const sim::MCTrack*, int>> selected_mctracks;
869 
870  if(mc && mctrackh.isValid()) {
871 
872  selected_mctracks.reserve(mctrackh->size());
873 
874  // Dump MCTracks.
875 
876  if(pdump) {
877  *pdump << "MC Tracks\n"
878  << " Id pdg x y z dx dy dz p\n"
879  << "-------------------------------------------------------------------------------------------\n";
880  }
881 
882  // Loop over mc tracks, and fill histograms that depend only
883  // on mc information. Also, fill a secondary list of mc tracks
884  // that pass various selection criteria.
885 
886  for(std::vector<sim::MCTrack>::const_iterator imctrk = mctrackh->begin();
887  imctrk != mctrackh->end(); ++imctrk) {
888  const sim::MCTrack& mctrk = *imctrk;
889  int pdg = mctrk.PdgCode();
890  if(fIgnoreSign)
891  pdg = std::abs(pdg);
892 
893  // Ignore everything except stable charged nonshowering particles.
894 
895  int apdg = std::abs(pdg);
896  if(apdg == 13 || // Muon
897  apdg == 211 || // Charged pion
898  apdg == 321 || // Charged kaon
899  apdg == 2212) { // (Anti)proton
900 
901  // check MC track origin?
902  if(fCheckOrigin && mctrk.Origin() != fOriginValue) continue;
903 
904  // Apply minimum energy cut.
905 
906  if(mctrk.Start().E() >= mctrk.Start().Momentum().Mag() + 1000.*fMinMCKE) {
907 
908  // Calculate the x offset due to nonzero mc particle time.
909 
910  double mctime = mctrk.Start().T(); // nsec
911  double mcdx = mctime * 1.e-3 * detprop->DriftVelocity(); // cm
912 
913  // Calculate the length of this mc particle inside the fiducial volume.
914 
915  TVector3 mcstart;
916  TVector3 mcend;
917  TVector3 mcstartmom;
918  TVector3 mcendmom;
919  double plen = length(mctrk, mcdx, mcstart, mcend, mcstartmom, mcendmom);
920 
921  // Apply minimum fiducial length cut. Always reject particles that have
922  // zero length in the tpc regardless of the configured cut.
923 
924  if(plen > 0. && plen > fMinMCLen) {
925 
926  // This is a good mc particle (capable of making a track).
927 
928  selected_mctracks.push_back(std::make_pair(&mctrk, -1));
929 
930  // Dump MC particle information here.
931 
932  if(pdump) {
933  double pstart = mcstartmom.Mag();
934  double pend = mcendmom.Mag();
935  *pdump << "\nOffset"
936  << std::setw(3) << mctrk.TrackID()
937  << std::setw(6) << mctrk.PdgCode()
938  << " "
939  << std::fixed << std::setprecision(2)
940  << std::setw(10) << mcdx
941  << "\nStart "
942  << std::setw(3) << mctrk.TrackID()
943  << std::setw(6) << mctrk.PdgCode()
944  << " "
945  << std::fixed << std::setprecision(2)
946  << std::setw(10) << mcstart[0]
947  << std::setw(10) << mcstart[1]
948  << std::setw(10) << mcstart[2];
949  if(pstart > 0.) {
950  *pdump << " "
951  << std::fixed << std::setprecision(3)
952  << std::setw(10) << mcstartmom[0]/pstart
953  << std::setw(10) << mcstartmom[1]/pstart
954  << std::setw(10) << mcstartmom[2]/pstart;
955  }
956  else
957  *pdump << std::setw(32) << " ";
958  *pdump << std::setw(12) << std::fixed << std::setprecision(3) << pstart;
959  *pdump << "\nEnd "
960  << std::setw(3) << mctrk.TrackID()
961  << std::setw(6) << mctrk.PdgCode()
962  << " "
963  << std::fixed << std::setprecision(2)
964  << std::setw(10) << mcend[0]
965  << std::setw(10) << mcend[1]
966  << std::setw(10) << mcend[2];
967  if(pend > 0.01) {
968  *pdump << " "
969  << std::fixed << std::setprecision(3)
970  << std::setw(10) << mcendmom[0]/pend
971  << std::setw(10) << mcendmom[1]/pend
972  << std::setw(10) << mcendmom[2]/pend;
973  }
974  else
975  *pdump << std::setw(32)<< " ";
976  *pdump << std::setw(12) << std::fixed << std::setprecision(3) << pend
977  << "\nLength: " << plen << "\n";
978  }
979 
980  // Fill histograms.
981 
982  if(fMCHistMap.count(pdg) == 0) {
983  std::ostringstream ostr;
984  ostr << "MC" << (fIgnoreSign ? "All" : (pdg > 0 ? "Pos" : "Neg")) << std::abs(pdg);
985  fMCHistMap[pdg] = MCHists(ostr.str());
986  }
987  const MCHists& mchists = fMCHistMap[pdg];
988 
989  double mctheta_xz = std::atan2(mcstartmom.X(), mcstartmom.Z());
990  double mctheta_yz = std::atan2(mcstartmom.Y(), mcstartmom.Z());
991  double mcmom = mcstartmom.Mag();
992  double mcmass = 0.001 * mctrk.Start().Momentum().Mag();
993  double mcke = mcmom*mcmom / (std::sqrt(mcmom*mcmom + mcmass*mcmass) + mcmass);
994 
995  mchists.fHmcstartx->Fill(mcstart.X());
996  mchists.fHmcstarty->Fill(mcstart.Y());
997  mchists.fHmcstartz->Fill(mcstart.Z());
998  mchists.fHmcendx->Fill(mcend.X());
999  mchists.fHmcendy->Fill(mcend.Y());
1000  mchists.fHmcendz->Fill(mcend.Z());
1001  mchists.fHmctheta->Fill(mcstartmom.Theta());
1002  mchists.fHmcphi->Fill(mcstartmom.Phi());
1003  mchists.fHmctheta_xz->Fill(mctheta_xz);
1004  mchists.fHmctheta_yz->Fill(mctheta_yz);
1005  mchists.fHmcmom->Fill(mcmom);
1006  mchists.fHmcmoml->Fill(mcmom);
1007  mchists.fHmcke->Fill(mcke);
1008  mchists.fHmckel->Fill(mcke);
1009  mchists.fHmclen->Fill(plen);
1010  mchists.fHmclens->Fill(plen);
1011  }
1012  }
1013  }
1014  }
1015  } //mc
1016 
1017 
1018  // Get tracks and spacepoints and hits
1022 
1023  evt.getByLabel(fTrackModuleLabel, trackh);
1024  evt.getByLabel(fStitchModuleLabel,trackvh);
1025  evt.getByLabel(fHitModuleLabel, hith);
1026 
1027  // Extract all hits into a vector of art::Ptrs (the format used by back tracker).
1028 
1029  std::vector<art::Ptr<recob::Hit> > allhits;
1030  if(hith.isValid()) {
1031  allhits.reserve(hith->size());
1032  for(unsigned int i=0; i<hith->size(); ++i) {
1033  allhits.emplace_back(hith, i);
1034  }
1035  }
1036 
1037  // Construct FindManyP object to be used for finding track-hit associations.
1038 
1039  art::FindManyP<recob::Hit> tkhit_find(trackh, evt, fTrackModuleLabel);
1040 
1041  // This new top part of TrackAna between two long lines of ************s
1042  // is particular to analyzing Stitched Tracks.
1043  // *******************************************************************//
1044 
1045  if (trackvh.isValid() && fStitchedAnalysis)
1046  {
1047  mf::LogDebug("TrackAna")
1048  << "TrackAna read " << trackvh->size()
1049  << " vectors of Stitched PtrVectorsof tracks.";
1050  anaStitch(evt);
1051  }
1052 
1053  if(trackh.isValid()) {
1054 
1055  if(pdump) {
1056  *pdump << "\nReconstructed Tracks\n"
1057  << " Id MCid x y z dx dy dz p\n"
1058  << "-------------------------------------------------------------------------------------------\n";
1059  }
1060 
1061  // Loop over tracks.
1062 
1063  int ntrack = trackh->size();
1064  for(int i = 0; i < ntrack; ++i) {
1065  art::Ptr<recob::Track> ptrack(trackh, i);
1066  const recob::Track& track = *ptrack;
1067 
1068  // Extract hits associated with this track.
1069 
1070  std::vector<art::Ptr<recob::Hit> > trackhits;
1071  tkhit_find.get(i, trackhits);
1072 
1073  // Calculate the x offset due to nonzero reconstructed time.
1074 
1075  //double recotime = track.Time() * detprop->SamplingRate(); // nsec
1076 // double recotime = 0.;
1077 // double trackdx = recotime * 1.e-3 * detprop->DriftVelocity(); // cm
1078  double trackdx = 0;
1079 
1080  // Fill histograms involving reco tracks only.
1081 
1082  int ntraj = track.NumberTrajectoryPoints();
1083  if(ntraj > 0) {
1084  TVector3 pos = track.Vertex<TVector3>();
1085  TVector3 dir = track.VertexDirection<TVector3>();
1086  TVector3 end = track.End<TVector3>();
1087  pos[0] += trackdx;
1088  end[0] += trackdx;
1089 
1090  double dpos = bdist(pos);
1091  double dend = bdist(end);
1092  double tlen = length(track);
1093  double theta_xz = std::atan2(dir.X(), dir.Z());
1094  double theta_yz = std::atan2(dir.Y(), dir.Z());
1095 
1096  if(fRecoHistMap.count(0) == 0)
1097  fRecoHistMap[0] = RecoHists("Reco");
1098  const RecoHists& rhists = fRecoHistMap[0];
1099 
1100  rhists.fHstartx->Fill(pos.X());
1101  rhists.fHstarty->Fill(pos.Y());
1102  rhists.fHstartz->Fill(pos.Z());
1103  rhists.fHstartd->Fill(dpos);
1104  rhists.fHendx->Fill(end.X());
1105  rhists.fHendy->Fill(end.Y());
1106  rhists.fHendz->Fill(end.Z());
1107  rhists.fHendd->Fill(dend);
1108  rhists.fHtheta->Fill(dir.Theta());
1109  rhists.fHphi->Fill(dir.Phi());
1110  rhists.fHtheta_xz->Fill(theta_xz);
1111  rhists.fHtheta_yz->Fill(theta_yz);
1112 
1113  double mom = 0.;
1114  if(track.HasMomentum())
1115  mom = track.VertexMomentum();
1116  rhists.fHmom->Fill(mom);
1117  rhists.fHmoml->Fill(mom);
1118  rhists.fHlen->Fill(tlen);
1119  rhists.fHlens->Fill(tlen);
1120 
1121  // Id of matching mc particle.
1122 
1123  int mcid = -1;
1124 
1125  // Loop over direction.
1126 
1127  for(int swap=0; swap<2; ++swap) {
1128 
1129  // Analyze reversed tracks only if start momentum = end momentum.
1130 
1131  if(swap != 0 && track.HasMomentum() &&
1132  std::abs(track.VertexMomentum() - track.EndMomentum()) > 1.e-3)
1133  continue;
1134 
1135  // Calculate the global-to-local rotation matrix.
1136 
1137  int start_point = (swap == 0 ? 0 : ntraj-1);
1138  TMatrixD rot = track.GlobalToLocalRotationAtPoint<TMatrixD>(start_point);
1139 
1140  // Update track data for reversed case.
1141 
1142  if(swap != 0) {
1143  rot(1, 0) = -rot(1, 0);
1144  rot(2, 0) = -rot(2, 0);
1145  rot(1, 1) = -rot(1, 1);
1146  rot(2, 1) = -rot(2, 1);
1147  rot(1, 2) = -rot(1, 2);
1148  rot(2, 2) = -rot(2, 2);
1149 
1150  pos = track.End<TVector3>();
1151  dir = -track.EndDirection<TVector3>();
1152  end = track.Vertex<TVector3>();
1153  pos[0] += trackdx;
1154  end[0] += trackdx;
1155 
1156  dpos = bdist(pos);
1157  dend = bdist(end);
1158  theta_xz = std::atan2(dir.X(), dir.Z());
1159  theta_yz = std::atan2(dir.Y(), dir.Z());
1160 
1161  if(track.HasMomentum()) mom = track.EndMomentum();
1162  }
1163 
1164  // Get covariance matrix.
1165 
1166  const auto& cov = (swap == 0 ? track.VertexCovariance() : track.EndCovariance());
1167 
1168  // Loop over track-like mc particles.
1169 
1170  for(unsigned int imc = 0; imc < selected_mctracks.size(); ++imc) {
1171  const sim::MCTrack& mctrk = *selected_mctracks[imc].first;
1172  int pdg = mctrk.PdgCode();
1173  if(fIgnoreSign) pdg = std::abs(pdg);
1174  auto iMCHistMap = fMCHistMap.find(pdg);
1175  if (iMCHistMap == fMCHistMap.end())
1176  throw cet::exception("TrackAna") << "no particle with ID=" << pdg << "\n";
1177  const MCHists& mchists = iMCHistMap->second;
1178 
1179  // Calculate the x offset due to nonzero mc particle time.
1180 
1181  double mctime = mctrk.Start().T(); // nsec
1182  double mcdx = mctime * 1.e-3 * detprop->DriftVelocity(); // cm
1183 
1184  // Calculate the points where this mc particle enters and leaves the
1185  // fiducial volume, and the length in the fiducial volume.
1186 
1187  TVector3 mcstart;
1188  TVector3 mcend;
1189  TVector3 mcstartmom;
1190  TVector3 mcendmom;
1191  double plen = length(mctrk, mcdx, mcstart, mcend, mcstartmom, mcendmom);
1192 
1193  // Get the displacement of this mc particle in the global coordinate system.
1194 
1195  TVector3 mcpos = mcstart - pos;
1196 
1197  // Rotate the momentum and position to the
1198  // track-local coordinate system.
1199 
1200  TVector3 mcmoml = rot * mcstartmom;
1201  TVector3 mcposl = rot * mcpos;
1202 
1203  double colinearity = mcmoml.Z() / mcmoml.Mag();
1204 
1205  double u = mcposl.X();
1206  double v = mcposl.Y();
1207  double w = mcposl.Z();
1208 
1209  double pu = mcmoml.X();
1210  double pv = mcmoml.Y();
1211  double pw = mcmoml.Z();
1212 
1213  double dudw = pu / pw;
1214  double dvdw = pv / pw;
1215 
1216  double u0 = u - w * dudw;
1217  double v0 = v - w * dvdw;
1218  double uv0 = std::sqrt(u0*u0 + v0*v0);
1219 
1220  mchists.fHduvcosth->Fill(colinearity, uv0);
1221 
1222  if(std::abs(uv0) < fMatchDisp) {
1223 
1224  // Fill slope matching histograms.
1225 
1226  mchists.fHmcdudw->Fill(dudw);
1227  mchists.fHmcdvdw->Fill(dvdw);
1228  mchists.fHdudwpull->Fill(dudw / std::sqrt(cov(2,2)));
1229  mchists.fHdvdwpull->Fill(dvdw / std::sqrt(cov(3,3)));
1230  }
1231  mchists.fHcosth->Fill(colinearity);
1232  if(colinearity > fMatchColinearity) {
1233 
1234  // Fill displacement matching histograms.
1235 
1236  mchists.fHmcu->Fill(u0);
1237  mchists.fHmcv->Fill(v0);
1238  mchists.fHmcw->Fill(w);
1239  mchists.fHupull->Fill(u0 / std::sqrt(cov(0,0)));
1240  mchists.fHvpull->Fill(v0 / std::sqrt(cov(1,1)));
1241 
1242  if(std::abs(uv0) < fMatchDisp) {
1243 
1244  // Fill matching histograms.
1245 
1246  double mctheta_xz = std::atan2(mcstartmom.X(), mcstartmom.Z());
1247  double mctheta_yz = std::atan2(mcstartmom.Y(), mcstartmom.Z());
1248  double mcmom = mcstartmom.Mag();
1249  double mcmass = 0.001 * mctrk.Start().Momentum().Mag();
1250  double mcke = mcmom*mcmom / (std::sqrt(mcmom*mcmom + mcmass*mcmass) + mcmass);
1251 
1252  mchists.fHstartdx->Fill(pos.X() - mcstart.X());
1253  mchists.fHstartdy->Fill(pos.Y() - mcstart.Y());
1254  mchists.fHstartdz->Fill(pos.Z() - mcstart.Z());
1255  mchists.fHenddx->Fill(end.X() - mcend.X());
1256  mchists.fHenddy->Fill(end.Y() - mcend.Y());
1257  mchists.fHenddz->Fill(end.Z() - mcend.Z());
1258  mchists.fHlvsl->Fill(plen, tlen);
1259  mchists.fHdl->Fill(tlen - plen);
1260  mchists.fHpvsp->Fill(mcmom, mom);
1261  double dp = mom - mcmom;
1262  mchists.fHdp->Fill(dp);
1263  mchists.fHppull->Fill(dp / std::sqrt(cov(4,4)));
1264  if(std::abs(dpos) >= 5. && std::abs(dend) >= 5.) {
1265  mchists.fHpvspc->Fill(mcmom, mom);
1266  mchists.fHdpc->Fill(dp);
1267  mchists.fHppullc->Fill(dp / std::sqrt(cov(4,4)));
1268  }
1269 
1270  // Count this track as well-reconstructed if it is matched to an
1271  // mc particle (which it is if get here), and if in addition the
1272  // starting position (w) matches and the reconstructed track length
1273  // is more than 0.5 of the mc particle trajectory length.
1274 
1275  bool good = std::abs(w) <= fWMatchDisp &&
1276  tlen > fMatchLength * plen;
1277  if(good) {
1278  mcid = mctrk.TrackID();
1279 
1280  // Calculate and fill hit efficiency and purity.
1281 
1282  std::set<int> tkidset;
1283  tkidset.insert(mcid);
1284  double hiteff =
1285  bt_serv->HitCollectionEfficiency(tkidset, trackhits, allhits, geo::k3D);
1286  double hitpurity = bt_serv->HitCollectionPurity(tkidset, trackhits);
1287  mchists.fHHitEff->Fill(hiteff);
1288  mchists.fHHitPurity->Fill(hitpurity);
1289 
1290  // Fill efficiency numerator histograms.
1291 
1292  mchists.fHgstartx->Fill(mcstart.X());
1293  mchists.fHgstarty->Fill(mcstart.Y());
1294  mchists.fHgstartz->Fill(mcstart.Z());
1295  mchists.fHgendx->Fill(mcend.X());
1296  mchists.fHgendy->Fill(mcend.Y());
1297  mchists.fHgendz->Fill(mcend.Z());
1298  mchists.fHgtheta->Fill(mcstartmom.Theta());
1299  mchists.fHgphi->Fill(mcstartmom.Phi());
1300  mchists.fHgtheta_xz->Fill(mctheta_xz);
1301  mchists.fHgtheta_yz->Fill(mctheta_yz);
1302  mchists.fHgmom->Fill(mcmom);
1303  mchists.fHgmoml->Fill(mcmom);
1304  mchists.fHgke->Fill(mcke);
1305  mchists.fHgkel->Fill(mcke);
1306  mchists.fHglen->Fill(plen);
1307  mchists.fHglens->Fill(plen);
1308 
1309  // set the match flag
1310  selected_mctracks[imc].second = i;
1311 
1312  if(fPrintLevel > 0) {
1313  const simb::MCParticle* ptkl = pi_serv->TrackIdToParticle_P(mcid);
1314  float KE = ptkl->E() - ptkl->Mass();
1315  std::string KEUnits = " GeV";
1316  if(mctrk.Origin() != simb::kCosmicRay) {
1317  // MeV for low energy particles
1318  KE *= 1000;
1319  KEUnits = " MeV";
1320  }
1321  mf::LogVerbatim("TrackAna")
1322  <<evt.run()<<"."<<evt.event()
1323  <<" Match MCTkID "<<std::setw(6)<<mctrk.TrackID()
1324  <<" Origin "<<mctrk.Origin()
1325  <<" PDG"<<std::setw(5)<<mctrk.PdgCode()
1326  <<" KE"<<std::setw(4)<<(int)KE<<KEUnits
1327  <<" RecoTrkID "<<track.ID()
1328  <<" hitEff "<<std::setprecision(2)<<hiteff<<" hitPur "<<hitpurity;
1329  int sWire, sTick, eWire, eTick;
1330  // this won't work for DUNE
1331  for(unsigned short ipl = 0; ipl < geom->Nplanes(); ++ipl) {
1332  sWire = geom->NearestWire(mcstart, ipl, 0, 0);
1333  sTick = detprop->ConvertXToTicks(mcstart[0], ipl, 0, 0);
1334  eWire = geom->NearestWire(mcend, ipl, 0, 0);
1335  eTick = detprop->ConvertXToTicks(mcend[0], ipl, 0, 0);
1336  mf::LogVerbatim("TrackAna")<<" Wire:Tick in Pln "<<ipl<<" W:T "<<sWire<<":"<<sTick<<" - "<<eWire<<":"<<eTick;
1337  } // ipl
1338  } // fPrintLevel == 2
1339  } // good
1340  }
1341  }
1342  }
1343  }
1344 
1345  // Dump track information here.
1346 
1347  if(pdump) {
1348  TVector3 pos = track.Vertex<TVector3>();
1349  TVector3 dir = track.VertexDirection<TVector3>();
1350  TVector3 end = track.End<TVector3>();
1351  pos[0] += trackdx;
1352  end[0] += trackdx;
1353  TVector3 enddir = track.EndDirection<TVector3>();
1354  double pstart = track.VertexMomentum();
1355  double pend = track.EndMomentum();
1356  *pdump << "\nOffset"
1357  << std::setw(3) << track.ID()
1358  << std::setw(6) << mcid
1359  << " "
1360  << std::fixed << std::setprecision(2)
1361  << std::setw(10) << trackdx
1362  << "\nStart "
1363  << std::setw(3) << track.ID()
1364  << std::setw(6) << mcid
1365  << " "
1366  << std::fixed << std::setprecision(2)
1367  << std::setw(10) << pos[0]
1368  << std::setw(10) << pos[1]
1369  << std::setw(10) << pos[2];
1370  if(pstart > 0.) {
1371  *pdump << " "
1372  << std::fixed << std::setprecision(3)
1373  << std::setw(10) << dir[0]
1374  << std::setw(10) << dir[1]
1375  << std::setw(10) << dir[2];
1376  }
1377  else
1378  *pdump << std::setw(32) << " ";
1379  *pdump << std::setw(12) << std::fixed << std::setprecision(3) << pstart;
1380  *pdump << "\nEnd "
1381  << std::setw(3) << track.ID()
1382  << std::setw(6) << mcid
1383  << " "
1384  << std::fixed << std::setprecision(2)
1385  << std::setw(10) << end[0]
1386  << std::setw(10) << end[1]
1387  << std::setw(10) << end[2];
1388  if(pend > 0.01) {
1389  *pdump << " "
1390  << std::fixed << std::setprecision(3)
1391  << std::setw(10) << enddir[0]
1392  << std::setw(10) << enddir[1]
1393  << std::setw(10) << enddir[2];
1394  }
1395  else
1396  *pdump << std::setw(32)<< " ";
1397  *pdump << std::setw(12) << std::fixed << std::setprecision(3) << pend
1398  << "\nLength: " << tlen << "\n";
1399  }
1400  }
1401  }
1402  } // i
1403 
1404  // print out un-matched MC tracks
1405  if(fPrintLevel > 0) {
1406  for(unsigned int imc = 0; imc < selected_mctracks.size(); ++imc) {
1407  if(selected_mctracks[imc].second >= 0) continue;
1408  const sim::MCTrack& mctrk = *selected_mctracks[imc].first;
1409  const simb::MCParticle* ptkl = pi_serv->TrackIdToParticle_P(mctrk.TrackID());
1410  float KE = ptkl->E() - ptkl->Mass();
1411  std::string KEUnits = " GeV";
1412  if(mctrk.Origin() != simb::kCosmicRay) {
1413  // MeV for low energy particles
1414  KE *= 1000;
1415  KEUnits = " MeV";
1416  }
1417  // find the start/end wire:time in each plane
1418  TVector3 mcstart, mcend, mcstartmom, mcendmom;
1419  double mcdx = mctrk.Start().T() * 1.e-3 * detprop->DriftVelocity(); // cm
1420  double plen = length(mctrk, mcdx, mcstart, mcend, mcstartmom, mcendmom);
1421  mf::LogVerbatim("TrackAna")<<evt.run()<<"."<<evt.event()
1422  <<" NoMat MCTkID "<<std::setw(6)<<mctrk.TrackID()
1423  <<" Origin "<<mctrk.Origin()
1424  <<" PDG"<<std::setw(5)<<mctrk.PdgCode()
1425  <<" KE"<<std::setw(4)<<(int)KE<<KEUnits
1426  <<" Length "<<std::fixed<<std::setprecision(1)<<plen<<" cm";
1427  if(fPrintLevel > 1) {
1428  int sWire, sTick, eWire, eTick;
1429  // this won't work for DUNE
1430  for(unsigned short ipl = 0; ipl < geom->Nplanes(); ++ipl) {
1431  sWire = geom->NearestWire(mcstart, ipl, 0, 0);
1432  sTick = detprop->ConvertXToTicks(mcstart[0], ipl, 0, 0);
1433  eWire = geom->NearestWire(mcend, ipl, 0, 0);
1434  eTick = detprop->ConvertXToTicks(mcend[0], ipl, 0, 0);
1435  mf::LogVerbatim("TrackAna")<<" Wire:Tick in Pln "<<ipl
1436  <<" W:T "<<sWire<<":"<<sTick<<" - "<<eWire<<":"<<eTick;
1437  } // ipl
1438  } // fPrintLevel > 1
1439  } // imc
1440  } // fPrintLevel > 0
1441 
1442  }
double E(const int i=0) const
Definition: MCParticle.h:237
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
const simb::MCParticle * TrackIdToParticle_P(int const &id)
simb::Origin_t Origin() const
Definition: MCTrack.h:40
double EndMomentum() const
Definition: Track.h:147
double VertexMomentum() const
Definition: Track.h:145
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double Mass() const
Definition: MCParticle.h:243
bool HasMomentum() const
Definition: Track.h:143
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:105
Vector_t VertexDirection() const
Access to track direction at different points.
Definition: Track.h:135
const SMatrixSym55 & VertexCovariance() const
Access to covariance matrices.
Definition: Track.h:157
std::string fStitchModuleLabel
double T() const
Definition: MCStep.h:45
bool isRealData() const
Definition: Event.h:83
void anaStitch(const art::Event &evt)
std::map< int, MCHists > fMCHistMap
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
3-dimensional objects, potentially hits, clusters, prongs, etc.
Definition: geo_types.h:82
Rotation_t GlobalToLocalRotationAtPoint(size_t p) const
Definition: Track.h:193
bool isValid() const
Definition: Handle.h:190
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
intermediate_table::const_iterator const_iterator
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
Point_t const & Vertex() const
Access to track position at different points.
Definition: Track.h:127
const SMatrixSym55 & EndCovariance() const
Access to covariance matrices.
Definition: Track.h:158
std::string fMCTrackModuleLabel
EventNumber_t event() const
Definition: Event.h:67
int PdgCode() const
Definition: MCTrack.h:41
const TLorentzVector & Momentum() const
Definition: MCStep.h:38
simb::Origin_t fOriginValue
int ID() const
Definition: Track.h:201
TDirectory * dir
Definition: macro.C:5
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
Vector_t EndDirection() const
Access to track direction at different points.
Definition: Track.h:136
std::map< int, RecoHists > fRecoHistMap
double E() const
Definition: MCStep.h:49
void swap(lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &a, lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &b)
Point_t const & End() const
Access to track position at different points.
Definition: Track.h:128
const MCStep & Start() const
Definition: MCTrack.h:44
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::string fTrackModuleLabel
unsigned int TrackID() const
Definition: MCTrack.h:42
Float_t e
Definition: plot.C:34
RunNumber_t run() const
Definition: Event.h:77
Float_t track
Definition: plot.C:34
Float_t w
Definition: plot.C:23
std::string fHitModuleLabel
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:52
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Cosmic rays.
Definition: MCTruth.h:22
void trkf::TrackAna::anaStitch ( const art::Event evt)

art::FindManyP<recob::Hit> fh(sppth, evt, fHitSpptAssocModuleLabel);

Definition at line 1444 of file TrackAna_module.cc.

References detinfo::DetectorProperties::DriftVelocity(), simb::MCParticle::E(), trkf::TrackAna::RecoHists::fHHitChg, trkf::TrackAna::RecoHists::fHHitPdg, trkf::TrackAna::RecoHists::fHHitTrkId, trkf::TrackAna::RecoHists::fHHitWidth, fHitSpptAssocModuleLabel, trkf::TrackAna::RecoHists::fModeFrac, trkf::TrackAna::RecoHists::fNTrkIdTrks, trkf::TrackAna::RecoHists::fNTrkIdTrks2, trkf::TrackAna::RecoHists::fNTrkIdTrks3, fRecoHistMap, fsort_indexes(), fSpacepointModuleLabel, fStitchModuleLabel, fTrackModuleLabel, fTrkSpptAssocModuleLabel, art::DataViewImpl::getByLabel(), cheat::BackTrackerService::HitToTrackIDEs(), art::Event::isRealData(), art::Handle< T >::isValid(), geo::kCollection, simb::MCParticle::Mass(), max, n, sim::NoParticleId, simb::MCParticle::PdgCode(), art::PtrVector< T >::size(), simb::MCParticle::T(), cheat::ParticleInventoryService::TrackIdToParticle_P(), and x.

Referenced by analyze().

1445  {
1446 
1450  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
1451 
1452  std::map<int, std::map<int, art::PtrVector<recob::Hit>> > hitmap; // trkID, otrk, hitvec
1453  std::map<int, int > KEmap; // length traveled in det [cm]?, trkID want to sort by KE
1454  bool mc = !evt.isRealData();
1458 
1459  evt.getByLabel(fTrackModuleLabel, trackh);
1460  evt.getByLabel(fSpacepointModuleLabel, sppth);
1461  evt.getByLabel(fStitchModuleLabel,trackvh);
1462  int ntv(trackvh->size());
1463 
1464  std::vector < art::PtrVector<recob::Track> >::const_iterator cti = trackvh->begin();
1466 
1467  if(trackh.isValid()) {
1469  int nsppts_assnwhole = fswhole.size();
1470  std::cout << "TrackAna: Number of clumps of Spacepoints from Assn for all Tracks: " << nsppts_assnwhole << std::endl;
1471  }
1472 
1473  if(fRecoHistMap.count(0) == 0)
1474  {
1475  fRecoHistMap[0] = RecoHists("Reco");
1476  std::cout << "\n" << "\t\t TrkAna: Fresh fRecoHistMap[0] ******* \n" << std::endl;
1477  }
1478  const RecoHists& rhistsStitched = fRecoHistMap[0];
1479 
1480  std::vector < std::vector <unsigned int> > NtrkIdsAll;
1481  std::vector < double > ntvsorted;
1482  hitmap.clear();
1483  KEmap.clear();
1484 
1485  // Look at the components of the stitched tracks. Grab their sppts/hits from Assns.
1486  for (int o = 0; o < ntv; ++o) // o for outer
1487  {
1488 
1489  const art::PtrVector<recob::Track> pvtrack(*(cti++));
1490  // auto it = pvtrack.begin();
1491  int ntrack = pvtrack.size();
1492  // if (ntrack>1) std::cout << "\t\t TrkAna: New Stitched Track ******* " << std::endl;
1493  std::vector< std::vector <unsigned int> > NtrkId_Hit; // hit IDs in inner tracks
1494  std::vector<unsigned int> vecMode;
1496 
1497  for(int i = 0; i < ntrack; ++i) {
1498 
1499  //const art::Ptr<recob::Track> ptrack(*(it++));
1500  // const recob::Track& track = *ptrack;
1501  // auto pcoll { ptrack };
1502  // art::FindManyP<recob::SpacePoint> fs( ptrack, evt, fTrkSpptAssocModuleLabel);
1503  // From gdb> ptype fs, the vector of Ptr<SpacePoint>s it appears is grabbed after fs.at(0)
1504  bool assns(true);
1505  try {
1506  // Got Spacepoints from this Track; now get Hits from those Spacepoints.
1507  // int nsppts = ptrack->NumberTrajectoryPoints();
1508 
1509  int nsppts_assn = fs.at(i).size();
1510  // if (ntrack>1) std::cout << "\t\tTrackAna: Number of Spacepoints from Track.NumTrajPts(): " << nsppts << std::endl;
1511  // if (ntrack>1) std::cout << "\t\tTrackAna: Number of Spacepoints from Assns for this Track: " << nsppts_assn << std::endl;
1512 
1513  const auto& sppt = fs.at(i);//.at(0);
1514  // since we're in a try and worried about failure, we won't pull the following
1515  // FindManyP out of the loop.
1517 
1518  // Importantly, loop on all sppts, though they don't all contribute to the track.
1519  // As opposed to looping on the trajectory pts, which is a lower number.
1520  // Also, important, in job in whch this runs I set TrackKal3DSPS parameter MaxPass=1,
1521  // cuz I don't want merely the sparse set of sppts as follows from the uncontained
1522  // MS-measurement in 2nd pass.
1523  std::vector <unsigned int> vecNtrkIds;
1524  for(int is = 0; is < nsppts_assn; ++is) {
1525  int nhits = fh.at(is).size(); // should be 2 or 3: number of planes.
1526  for(int ih = 0; ih < nhits; ++ih) {
1527  const auto& hit = fh.at(is).at(ih); // Our vector is after the .at(is) this time.
1528  if (hit->SignalType()!=geo::kCollection) continue;
1529  rhistsStitched.fHHitChg->Fill(hit->Integral());
1530  rhistsStitched.fHHitWidth->Fill(2. * hit->RMS());
1531  if (mc)
1532  {
1533  std::vector<sim::TrackIDE> tids = bt_serv->HitToTrackIDEs(hit);
1534  // more here.
1535  // Loop over track ids.
1536  bool justOne(true); // Only take first trk that contributed to this hit
1537  // std::cout << "\t\t TrkAna: TrkId tids.size() ******* " << tids.size() <<std::endl;
1538  for(std::vector<sim::TrackIDE>::const_iterator itid = tids.begin();itid != tids.end(); ++itid) {
1539  int trackID = std::abs(itid->trackID);
1540  hitmap[trackID][o].push_back(hit);
1541 
1542  if (justOne) { vecNtrkIds.push_back(trackID); justOne=false; }
1543  // Add hit to PtrVector corresponding to this track id.
1544  rhistsStitched.fHHitTrkId->Fill(trackID);
1545  const simb::MCParticle* part = pi_serv->TrackIdToParticle_P(trackID);
1546  if (!part) break;
1547 
1548  rhistsStitched.fHHitPdg->Fill(part->PdgCode());
1549  // This really needs to be indexed as KE deposited in volTPC, not just KE. EC, 24-July-2014.
1550 
1551  TVector3 mcstart;
1552  TVector3 mcend;
1553  TVector3 mcstartmom;
1554  TVector3 mcendmom;
1555  double mctime = part->T(); // nsec
1556  double mcdx = mctime * 1.e-3 * detprop->DriftVelocity(); // cm
1557 
1558  double plen = length(*part, mcdx, mcstart, mcend, mcstartmom, mcendmom);
1559 
1560  KEmap[(int)(1e6*plen)] = trackID; // multiple assignment but always the same, so fine.
1561  // std::cout << "\t\t TrkAna: TrkId trackID, KE [MeV] ******* " << trackID << ", " << (int)(1e3*(part->E()-part->Mass())) <<std::endl;
1562  }
1563 
1564  } // mc
1565  } // hits
1566 
1567  } // spacepoints
1568 
1569  if (mc)
1570  {
1571  NtrkId_Hit.push_back(vecNtrkIds);
1572  // Find the trkID mode for this i^th track
1573  unsigned int ii(1);
1574  int max(-12), n(1), ind(0);
1575  std::sort(vecNtrkIds.begin(),vecNtrkIds.end());
1576  std::vector<unsigned int> strkIds(vecNtrkIds);
1577  while ( ii < vecNtrkIds.size() )
1578  {
1579  if (strkIds.at(ii) != strkIds.at(ii-1))
1580  {
1581  n=1;
1582  }
1583  else
1584  {
1585  n++;
1586  }
1587  if (n>max) { max = n; ind = ii;}
1588  ii++;
1589  }
1590  // std::cout << "\t\t TrkAna: TrkId ind for this track is ******* " << ind <<std::endl;
1591  unsigned int mode(sim::NoParticleId);
1592  if (strkIds.begin()!=strkIds.end())
1593  mode = strkIds.at(ind);
1594  vecMode.push_back(mode);
1595 
1596  // if (ntrack>1) std::cout << "\t\t TrkAna: TrkId mode for this component track is ******* " << mode <<std::endl;
1597  if (strkIds.size()!=0)
1598  rhistsStitched.fModeFrac->Fill((double)max/(double)strkIds.size());
1599  else
1600  rhistsStitched.fModeFrac->Fill(-1.0);
1601  } // mc
1602 
1603  } // end try
1604  catch (cet::exception& x) {
1605  assns = false;
1606  }
1607  if (!assns) throw cet::exception("TrackAna") << "Bad Associations. \n";
1608 
1609  } // i
1610 
1611  if (mc)
1612  {
1613  // one vector per o trk, for all modes of stitched i trks
1614  NtrkIdsAll.push_back(vecMode);
1615 
1616  std::unique(NtrkIdsAll.back().begin(),NtrkIdsAll.back().end());
1617  double sum(0.0);
1618  for (auto const val : NtrkIdsAll.back())
1619  {
1620  // rhistsStitched.fNTrkIdTrks3->Fill(o,val%100,hitmap[val][o].size());
1621  sum += hitmap[val][o].size();
1622  }
1623  ntvsorted.push_back(sum);
1624 
1625  }
1626 
1627  //
1628  } // o
1629 
1630  int vtmp(0);
1631  // get KEmap indices by most energetic first, least last.
1632  for (auto it = KEmap.rbegin(); it!=KEmap.rend(); ++it)
1633  {
1634  // int tval = it->second; // grab trkIDs in order, since they're sorted by KE
1635  // int ke = it->first; // grab trkIDs in order, since they're sorted by KE
1636  // const simb::MCParticle* part = bt_serv->TrackIDToParticle(tval);
1637 
1638  // std::cout << "TrackAnaStitch: KEmap cntr vtmp, Length ke, tval, pdg : " << vtmp << ", " << ke <<", " << tval <<", " << part->PdgCode() << ", " << std::endl;
1639 
1640  vtmp++;
1641  }
1642 
1643  // get o trk indices by their hits. Most populous track first, least last.
1644  for (auto const o : fsort_indexes(ntvsorted))
1645  {
1646  int v(0);
1647  // get KEmap indices by longest trajectory first, least last.
1648  for (auto it = KEmap.rbegin(); it!=KEmap.rend(); ++it)
1649  {
1650  int val = it->second; // grab trkIDs in order, since they're sorted by KE
1651  // const simb::MCParticle* part = pi_serv->TrackIDToParticle(val);
1652  // std::cout << "TrackAnaStitch: trk o, KEmap cntr v, KE val, pdg hitmap[val][o].size(): " << o <<", " << v << ", " << val <<", " << part->PdgCode() << ", " << hitmap[val][o].size() << std::endl;
1653  rhistsStitched.fNTrkIdTrks3->Fill(o,v,hitmap[val][o].size());
1654  v++;
1655  }
1656 
1657  }
1658 
1659  // In how many o tracks did each trkId appear? Histo it. Would like it to be precisely 1.
1660  // Histo it vs. particle KE.
1661  flattener flat(NtrkIdsAll);
1662  std::vector <unsigned int> &v = flat;
1663  // auto const it ( std::unique(v.begin(),v.end()) ); // never use this it, perhaps.
1664  for (auto const val : v)
1665  {
1666  if (val != (unsigned int)sim::NoParticleId)
1667  {
1668  const simb::MCParticle* part = pi_serv->TrackIdToParticle_P( val );
1669  double T(part->E() - 0.001*part->Mass());
1670  rhistsStitched.fNTrkIdTrks->Fill(std::count(v.begin(),v.end(),val));
1671  rhistsStitched.fNTrkIdTrks2->Fill(std::count(v.begin(),v.end(),val),T);
1672  }
1673  else
1674  {
1675  rhistsStitched.fNTrkIdTrks2->Fill(-1.0,0.0);
1676  }
1677  }
1678 
1679  }
Float_t x
Definition: compare.C:6
double E(const int i=0) const
Definition: MCParticle.h:237
const simb::MCParticle * TrackIdToParticle_P(int const &id)
int PdgCode() const
Definition: MCParticle.h:216
std::vector< size_t > fsort_indexes(const std::vector< T > &v)
std::string fHitSpptAssocModuleLabel
std::string fTrkSpptAssocModuleLabel
const std::vector< sim::TrackIDE > HitToTrackIDEs(recob::Hit const &hit)
std::string fSpacepointModuleLabel
double Mass() const
Definition: MCParticle.h:243
std::string fStitchModuleLabel
bool isRealData() const
Definition: Event.h:83
bool isValid() const
Definition: Handle.h:190
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
static const int NoParticleId
Definition: sim.h:28
TString part[npart]
Definition: Style.C:32
double T(const int i=0) const
Definition: MCParticle.h:228
Detector simulation of raw signals on wires.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
std::map< int, RecoHists > fRecoHistMap
Char_t n[5]
std::string fTrackModuleLabel
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Signal from collection planes.
Definition: geo_types.h:93
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

Referenced by art::EDAnalyzer::doEvent(), and art::OutputModule::doWriteEvent().

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
void trkf::TrackAna::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 1681 of file TrackAna_module.cc.

References trkf::TrackAna::MCHists::fHeendx, trkf::TrackAna::MCHists::fHeendy, trkf::TrackAna::MCHists::fHeendz, trkf::TrackAna::MCHists::fHeke, trkf::TrackAna::MCHists::fHekel, trkf::TrackAna::MCHists::fHelen, trkf::TrackAna::MCHists::fHelens, trkf::TrackAna::MCHists::fHemom, trkf::TrackAna::MCHists::fHemoml, trkf::TrackAna::MCHists::fHephi, trkf::TrackAna::MCHists::fHestartx, trkf::TrackAna::MCHists::fHestarty, trkf::TrackAna::MCHists::fHestartz, trkf::TrackAna::MCHists::fHetheta, trkf::TrackAna::MCHists::fHetheta_xz, trkf::TrackAna::MCHists::fHetheta_yz, trkf::TrackAna::MCHists::fHgendx, trkf::TrackAna::MCHists::fHgendy, trkf::TrackAna::MCHists::fHgendz, trkf::TrackAna::MCHists::fHgke, trkf::TrackAna::MCHists::fHgkel, trkf::TrackAna::MCHists::fHglen, trkf::TrackAna::MCHists::fHglens, trkf::TrackAna::MCHists::fHgmom, trkf::TrackAna::MCHists::fHgmoml, trkf::TrackAna::MCHists::fHgphi, trkf::TrackAna::MCHists::fHgstartx, trkf::TrackAna::MCHists::fHgstarty, trkf::TrackAna::MCHists::fHgstartz, trkf::TrackAna::MCHists::fHgtheta, trkf::TrackAna::MCHists::fHgtheta_xz, trkf::TrackAna::MCHists::fHgtheta_yz, trkf::TrackAna::MCHists::fHmcendx, trkf::TrackAna::MCHists::fHmcendy, trkf::TrackAna::MCHists::fHmcendz, trkf::TrackAna::MCHists::fHmcke, trkf::TrackAna::MCHists::fHmckel, trkf::TrackAna::MCHists::fHmclen, trkf::TrackAna::MCHists::fHmclens, trkf::TrackAna::MCHists::fHmcmom, trkf::TrackAna::MCHists::fHmcmoml, trkf::TrackAna::MCHists::fHmcphi, trkf::TrackAna::MCHists::fHmcstartx, trkf::TrackAna::MCHists::fHmcstarty, trkf::TrackAna::MCHists::fHmcstartz, trkf::TrackAna::MCHists::fHmctheta, trkf::TrackAna::MCHists::fHmctheta_xz, trkf::TrackAna::MCHists::fHmctheta_yz, fMCHistMap, and fNumEvent.

1685  {
1686  // Print summary.
1687 
1688  mf::LogInfo("TrackAna")
1689  << "TrackAna statistics:\n"
1690  << " Number of events = " << fNumEvent;
1691 
1692  // Fill efficiency histograms.
1693 
1695  i != fMCHistMap.end(); ++i) {
1696  const MCHists& mchists = i->second;
1697  effcalc(mchists.fHgstartx, mchists.fHmcstartx, mchists.fHestartx);
1698  effcalc(mchists.fHgstarty, mchists.fHmcstarty, mchists.fHestarty);
1699  effcalc(mchists.fHgstartz, mchists.fHmcstartz, mchists.fHestartz);
1700  effcalc(mchists.fHgendx, mchists.fHmcendx, mchists.fHeendx);
1701  effcalc(mchists.fHgendy, mchists.fHmcendy, mchists.fHeendy);
1702  effcalc(mchists.fHgendz, mchists.fHmcendz, mchists.fHeendz);
1703  effcalc(mchists.fHgtheta, mchists.fHmctheta, mchists.fHetheta);
1704  effcalc(mchists.fHgphi, mchists.fHmcphi, mchists.fHephi);
1705  effcalc(mchists.fHgtheta_xz, mchists.fHmctheta_xz, mchists.fHetheta_xz);
1706  effcalc(mchists.fHgtheta_yz, mchists.fHmctheta_yz, mchists.fHetheta_yz);
1707  effcalc(mchists.fHgmom, mchists.fHmcmom, mchists.fHemom);
1708  effcalc(mchists.fHgmoml, mchists.fHmcmoml, mchists.fHemoml);
1709  effcalc(mchists.fHgke, mchists.fHmcke, mchists.fHeke);
1710  effcalc(mchists.fHgkel, mchists.fHmckel, mchists.fHekel);
1711  effcalc(mchists.fHglen, mchists.fHmclen, mchists.fHelen);
1712  effcalc(mchists.fHglens, mchists.fHmclens, mchists.fHelens);
1713  }
1714  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::map< int, MCHists > fMCHistMap
intermediate_table::const_iterator const_iterator
template<typename T >
std::vector< size_t > trkf::TrackAna::fsort_indexes ( const std::vector< T > &  v)
private

Definition at line 1718 of file TrackAna_module.cc.

Referenced by anaStitch().

1718  {
1719  // initialize original index locations
1720  std::vector<size_t> idx(v.size());
1721  for (size_t i = 0; i != idx.size(); ++i) idx[i] = i;
1722  // sort indexes based on comparing values in v
1723  std::sort(idx.begin(), idx.end(),
1724  [&v](size_t i1, size_t i2) {return v[i1] > v[i2];}); // Want most occupied trks first. was <, EC, 21-July.
1725  return idx;
1726  }
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

bool trkf::TrackAna::fCheckOrigin
private

Definition at line 454 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

int trkf::TrackAna::fDump
private

Definition at line 443 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

std::string trkf::TrackAna::fHitModuleLabel
private

Definition at line 441 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

std::string trkf::TrackAna::fHitSpptAssocModuleLabel
private

Definition at line 440 of file TrackAna_module.cc.

Referenced by anaStitch(), and TrackAna().

bool trkf::TrackAna::fIgnoreSign
private

Definition at line 450 of file TrackAna_module.cc.

Referenced by analyze().

double trkf::TrackAna::fMatchColinearity
private

Definition at line 446 of file TrackAna_module.cc.

Referenced by analyze().

double trkf::TrackAna::fMatchDisp
private

Definition at line 447 of file TrackAna_module.cc.

Referenced by analyze().

double trkf::TrackAna::fMatchLength
private

Definition at line 449 of file TrackAna_module.cc.

Referenced by analyze().

std::map<int, MCHists> trkf::TrackAna::fMCHistMap
private

Definition at line 460 of file TrackAna_module.cc.

Referenced by analyze(), and endJob().

std::string trkf::TrackAna::fMCTrackModuleLabel
private

Definition at line 436 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

double trkf::TrackAna::fMinMCKE
private

Definition at line 444 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

double trkf::TrackAna::fMinMCLen
private

Definition at line 445 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

int trkf::TrackAna::fNumEvent
private

Definition at line 465 of file TrackAna_module.cc.

Referenced by analyze(), and endJob().

std::string trkf::TrackAna::fOrigin
private

Definition at line 453 of file TrackAna_module.cc.

Referenced by TrackAna().

simb::Origin_t trkf::TrackAna::fOriginValue
private

Definition at line 455 of file TrackAna_module.cc.

Referenced by analyze(), and TrackAna().

int trkf::TrackAna::fPrintLevel
private

Definition at line 456 of file TrackAna_module.cc.

Referenced by analyze().

std::map<int, RecoHists> trkf::TrackAna::fRecoHistMap
private

Definition at line 461 of file TrackAna_module.cc.

Referenced by analyze(), and anaStitch().

std::string trkf::TrackAna::fSpacepointModuleLabel
private

Definition at line 437 of file TrackAna_module.cc.

Referenced by anaStitch().

bool trkf::TrackAna::fStitchedAnalysis
private

Definition at line 451 of file TrackAna_module.cc.

Referenced by analyze().

std::string trkf::TrackAna::fStitchModuleLabel
private

Definition at line 438 of file TrackAna_module.cc.

Referenced by analyze(), anaStitch(), and TrackAna().

std::string trkf::TrackAna::fTrackModuleLabel
private

Definition at line 435 of file TrackAna_module.cc.

Referenced by analyze(), anaStitch(), and TrackAna().

std::string trkf::TrackAna::fTrkSpptAssocModuleLabel
private

Definition at line 439 of file TrackAna_module.cc.

Referenced by anaStitch(), and TrackAna().

double trkf::TrackAna::fWMatchDisp
private

Definition at line 448 of file TrackAna_module.cc.

Referenced by analyze().


The documentation for this class was generated from the following file: