194 std::cout <<
"Failed quality check" <<
std::endl;
198 std::cout <<
"Passed quality check!" << std::endl <<
std::endl;
204 std::cout <<
"Number of reconstructed momenta: " << the_momenta.size() <<
std::endl;
206 if( the_momenta.size() > 0 )
207 std::cout <<
"Measured Momentum: " << the_momenta[0] << std::endl;
209 if( the_momenta.size() == 1)
212 momenta.insert(
momenta.end(), the_momenta.begin(), the_momenta.end() );
225 const std::vector< double > & the_tofs = beamEvent.
GetTOFs();
226 const std::vector< int > & the_chans = beamEvent.
GetTOFChans();
228 std::cout <<
"Number of measured TOF: " << the_tofs.size() <<
std::endl;
232 std::cout <<
"All (TOF, Channels): " <<
std::endl;
233 for(
size_t i = 0; i < the_tofs.size(); ++i ){
234 std::cout <<
"\t(" << the_tofs[i] <<
", " << the_chans[i] <<
")" <<
std::endl;
238 if( the_tofs.size() > 0){
246 std::cout <<
"Cerenkov status, pressure:" <<
std::endl;
258 std::cout <<
"Possible particles" <<
std::endl;
260 for(
size_t i = 0; i < pids.size(); ++i ){
275 std::cout << candidates_string <<
std::endl;
285 for (
size_t i = 0; i < beamEvent.
GetBeamTracks().size(); ++i) {
298 unsigned long test = (
unsigned long)(beamEvent.
GetT0().first*1e6) + (
unsigned long)(beamEvent.
GetT0().second/1.e3);
302 GenTrigTS = (
unsigned long)(beamEvent.
GetT0().first*1e6) + (
unsigned long)(beamEvent.
GetT0().second/1.e3);
318 std::cout <<
"Doing glitches" <<
std::endl;
320 for(
size_t i = 0; i < 192; ++i ){
325 for(
size_t i = 0; i < 192; ++i ){
330 for(
size_t i = 0; i < 192; ++i ){
336 for(
size_t i = 0; i < 192; ++i ){
341 for(
size_t i = 0; i < 192; ++i ){
346 for(
size_t i = 0; i < 192; ++i ){
351 for(
size_t i = 0; i < 192; ++i ){
360 if (!
evt.isRealData()) {
361 auto mcTruths =
evt.getValidHandle<std::vector<simb::MCTruth>>(
"generator");
363 auto true_beam_particle = truthUtil.GetGeantGoodParticle((*mcTruths)[0],
evt);
364 if (!true_beam_particle) {
365 std::cout <<
"No true beam particle" <<
std::endl;
368 std::cout <<
"True PDG: " << true_beam_particle->PdgCode() <<
std::endl;
369 true_PDG = true_beam_particle->PdgCode();
370 true_P = true_beam_particle->P();
371 size_t nPoints = true_beam_particle->NumberTrajectoryPoints();
372 for (
size_t i = 0; i < nPoints; ++i) {
373 if (true_beam_particle->Position(i).Z() > 0. &&
374 true_beam_particle->Position(i).Z() < 1.) {
375 true_X = true_beam_particle->Position(i).X();
376 true_Y = true_beam_particle->Position(i).Y();
377 true_Z = true_beam_particle->Position(i).Z();
const FBM & GetFBM(std::string) const
PossibleParticleCands GetPIDCandidates(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
std::vector< short > fibers_p2
const int & GetTimingTrigger() const
const std::vector< double > & GetTOFs() const
std::vector< double > trackEndX
std::vector< int > glitches_p3
std::vector< int > glitches_h_downstream
std::vector< double > dirY
const double & GetCKov0Pressure() const
unsigned long long GenTrigTS
std::vector< double > dirX
const short & GetCKov1Status() const
bool HasPerfectBeamMomentum(art::Event const &evt) const
std::vector< double > trackEndZ
std::vector< short > fibers_p3
std::vector< int > glitches_v_upstream
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
std::vector< double > momenta
std::vector< short > fibers_h_downstream
const std::vector< short > & GetActiveFibers(std::string) const
const std::vector< double > & GetRecoBeamMomenta() const
const double & GetTOF() const
const double & GetFiberTime(std::string) const
std::vector< short > fibers_p1
bool IsGoodBeamlineTrigger(art::Event const &evt) const
std::vector< int > glitches_p2
std::vector< double > trackEndY
const std::pair< double, double > & GetT0() const
Q_EXPORT QTSManip setw(int w)
std::vector< short > fibers_v_upstream
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
std::vector< double > dirZ
std::vector< int > glitches_v_downstream
const std::vector< int > & GetTOFChans() const
std::vector< int > glitches_h_upstream
std::vector< short > fibers_h_upstream
std::array< short, 192 > glitch_mask
const std::vector< recob::Track > & GetBeamTracks() const
const short & GetCKov0Status() const
std::vector< int > glitches_p1
std::vector< short > fibers_v_downstream
const double & GetMagnetCurrent() const
std::vector< int > possible_pdg
const bool & CheckIsMatched() const
const int & GetTOFChan() const
const beam::ProtoDUNEBeamEvent GetBeamEvent(art::Event const &evt) const
QTextStream & endl(QTextStream &s)
const double & GetCKov1Pressure() const