#include <ProtoDUNEBeamCuts.h>
Definition at line 22 of file ProtoDUNEBeamCuts.h.
protoana::ProtoDUNEBeamCuts::ProtoDUNEBeamCuts |
( |
| ) |
|
|
inline |
Definition at line 5 of file ProtoDUNEBeamCuts.cxx.
8 std::vector< fhicl::ParameterSet > DataCuts_sets = pset.
get< std::vector< fhicl::ParameterSet > >
10 std::vector< fhicl::ParameterSet > MCCuts_sets = pset.
get< std::vector< fhicl::ParameterSet > >
14 for(
size_t i = 0; i < DataCuts_sets.size(); ++i ){
22 std::cerr <<
"Error: Attempting to duplicate a cut parameter set" <<
std::endl;
32 for(
size_t i = 0; i < MCCuts_sets.size(); ++i ){
41 std::cerr <<
"Error: Attempting to duplicate a cut parameter set" <<
std::endl;
std::vector< std::string > valid_momenta
T get(std::string const &key) const
std::map< std::string, fhicl::ParameterSet > DataCuts
std::map< std::string, fhicl::ParameterSet > MCCuts
def momentum(x1, x2, x3, scale=1.)
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Definition at line 206 of file ProtoDUNEBeamCuts.cxx.
207 std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
208 auto beamHandle = evt.
getValidHandle< std::vector< beam::ProtoDUNEBeamEvent > >(
"beamevent");
211 result.Valid =
false;
213 if( beamHandle.isValid()){
219 const std::vector< recob::Track > & beamTracks = beamEvent.
GetBeamTracks();
220 if( beamTracks.size() == 0 ){
221 std::cout <<
"Warning: no tracks associated to beam data" <<
std::endl;
224 else if( beamTracks.size() > 1 ){
225 std::cout <<
"Warning: mutiple tracks associated to beam data" <<
std::endl;
230 result.X = beamTracks.at(0).Trajectory().End().X();
231 result.Y = beamTracks.at(0).Trajectory().End().Y();
233 result.DirX = beamTracks.at(0).EndDirection().X();
234 result.DirY = beamTracks.at(0).EndDirection().Y();
235 result.DirZ = beamTracks.at(0).EndDirection().Z();
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
const std::vector< recob::Track > & GetBeamTracks() const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
QTextStream & endl(QTextStream &s)
Definition at line 181 of file ProtoDUNEBeamCuts.cxx.
184 auto mcTruths = evt.
getValidHandle< std::vector< simb::MCTruth > >(
"generator");
188 result.Valid =
false;
190 if( !true_beam_particle ){
191 std::cout <<
"No true beam particle" <<
std::endl;
196 result.DirX = true_beam_particle->Px() / true_beam_particle->P();
197 result.DirY = true_beam_particle->Py() / true_beam_particle->P();
198 result.DirZ = true_beam_particle->Pz() / true_beam_particle->P();
201 result.X = true_beam_particle->Position(0).X() + (-1.*true_beam_particle->Position(0).Z())*(result.DirX / result.DirZ);
202 result.Y = true_beam_particle->Position(0).Y() + (-1.*true_beam_particle->Position(0).Z())*(result.DirY / result.DirZ);
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
QTextStream & endl(QTextStream &s)
Initial value:= {
".3", ".5", "1", "2", "3", "6", "7"
}
Definition at line 38 of file ProtoDUNEBeamCuts.h.
The documentation for this class was generated from the following files: