16 #include "art_root_io/TFileService.h" 18 #include "canvas/Persistency/Common/FindManyP.h" 31 #include "dune/DuneObj/ProtoDUNEBeamEvent.h" 36 #include "TTimeStamp.h" 39 class SaveSpacePoints;
79 std::vector<double>
vx;
80 std::vector<double>
vy;
81 std::vector<double>
vz;
154 auto beamHandle = evt.
getValidHandle<std::vector<beam::ProtoDUNEBeamEvent>>(
"beamevent");
156 std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
157 if( beamHandle.isValid()){
165 std::cout <<
"Number of reconstructed momenta: " << the_momenta.size() <<
std::endl;
174 const std::vector< double > & the_tofs = beamEvent.
GetTOFs();
176 if( the_tofs.size() > 0){
187 if(timeStamps.
isValid() && timeStamps->size() == 1){
194 std::vector< art::Ptr<recob::SpacePoint> > sps;
198 std::vector< art::Ptr<recob::PointCharge> > pcs;
210 for (
size_t i = 0; i<sps.size(); ++i){
211 vx.push_back(sps[i]->XYZ()[0]);
212 vy.push_back(sps[i]->XYZ()[1]);
213 vz.push_back(sps[i]->XYZ()[2]);
214 vcharge.push_back(pcs[i]->charge());
216 auto const& hits = fmhsp.at(i);
219 std::map<int,double> trkide;
220 for (
auto const &
hit : hits){
222 for(
size_t e = 0;
e < TrackIDs.size(); ++
e){
223 trkide[TrackIDs[
e].trackID] += TrackIDs[
e].energy;
231 if ((ii->second)>maxe){
237 vg4id.push_back(TrackID);
254 for (
auto const &
hit : hits){
255 spTPC =
hit->WireID().TPC;
257 vtpc.push_back(spTPC);
260 std::vector< art::Ptr<recob::Track> > trks;
264 for (
size_t i = 0; i<trks.size(); ++i){
265 auto &
trk = trks[i];
266 for (
size_t j = 0; j<
trk->NPoints(); ++j){
267 if (
trk->HasValidPoint(j)){
268 vx.push_back(
trk->TrajectoryPoint(j).position.X());
269 vy.push_back(
trk->TrajectoryPoint(j).position.Y());
270 vz.push_back(
trk->TrajectoryPoint(j).position.Z());
287 fTree = tfs->make<TTree>(
"spt",
"space point tree");
309 fTree->Branch(
"tof", &
tof,
"tof/D");
std::vector< double > beamPosx
constexpr std::uint32_t timeLow() const
uint16_t GetFlags() const
const std::vector< double > & GetTOFs() const
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::vector< double > beamDirz
Handle< PROD > getHandle(SelectorBase const &) const
std::vector< double > vcharge
std::vector< TrackID > TrackIDs
const simb::MCParticle * TrackIdToParticle_P(int id) const
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
const art::InputTag fTrackModuleLabel
constexpr std::uint32_t timeHigh() const
simb::Origin_t Origin() const
SaveSpacePoints(fhicl::ParameterSet const &p)
const short & GetCKov1Status() const
const art::InputTag fSpacePointModuleLabel
Information about charge reconstructed in the active volume.
std::vector< double > beamMomentum
std::vector< double > beamDiry
EDAnalyzer(fhicl::ParameterSet const &pset)
const art::Ptr< simb::MCTruth > & ParticleToMCTruth_P(const simb::MCParticle *p) const
const art::InputTag fTimeDecoderModuleLabel
std::vector< double > beamDirx
const art::InputTag fBeamModuleLabel
#define DEFINE_ART_MODULE(klass)
SaveSpacePoints & operator=(SaveSpacePoints const &)=delete
std::vector< double > beamPosz
const std::vector< double > & GetRecoBeamMomenta() const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
SubRunNumber_t subRun() const
General LArSoft Utilities.
bool IsGoodBeamlineTrigger(art::Event const &evt) const
Detector simulation of raw signals on wires.
std::vector< int > vorigin
Declaration of signal hit object.
std::vector< double > beamPosy
Provides recob::Track data product.
EventNumber_t event() const
const short & GetCKov0Status() const
void analyze(art::Event const &e) override
std::vector< int > vtrackid
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
QTextStream & endl(QTextStream &s)
Event finding and building.