53 #include "Utilities/AssociationUtil.h" 63 #include <TTreeReader.h> 64 #include <TTreeReaderValue.h> 65 #include <TTreeReaderArray.h> 84 float_t
bltof(float_t tof_us, float_t tof_ds,
int presenttofus,
int presenttofds) ;
217 TTreeReaderValue<unsigned int>
fPresenttofus(reader,
"present_tof_us");
218 TTreeReaderValue<unsigned int>
fPresenttofds(reader,
"present_tof_ds");
248 TTreeReaderValue<float>
fttof_us(reader,
"t_tof_us");
249 TTreeReaderValue<float>
fttof_ds(reader,
"t_tof_ds");
250 TTreeReaderValue<float>
ftcherenkov(reader,
"t_cerenkov");
257 while (reader.Next())
316 produces<std::vector<brb::ToF> >();
317 produces<std::vector<brb::Cherenkov> >();
318 produces<std::vector<rawdata::RawBeamlineWC> >();
332 std::vector<art::Ptr<simb::MCTruth> > mcTruths;
333 if (evt.
getByLabel(
"generator", mcTruthHandle))
340 for (std::vector<
art::Ptr<simb::MCTruth> >::const_iterator mcTruthIt = mcTruths.begin(); mcTruthIt != mcTruths.end(); ++mcTruthIt)
342 std::cout <<
" There are " << (*mcTruthIt)->NParticles() <<
" particles in this MCTruth." <<
std::endl;
346 std::unique_ptr<std::vector<brb::ToF> > TOFptr(
new std::vector<brb::ToF>);
347 std::unique_ptr<std::vector<brb::Cherenkov> > CHKVptr(
new std::vector<brb::Cherenkov>);
348 std::unique_ptr<std::vector<rawdata::RawBeamlineWC> > WCptr(
new std::vector<rawdata::RawBeamlineWC>);
350 if(evt.
event()!=6964)
363 std::pair <float,float> tofpair;
376 TOFptr->push_back(tofobject);
394 CHKVptr->push_back(cherenkov_object);
406 std::vector<rawdata::RawBeamlineWC> WCobject;
408 std::vector<double> fchannelx;
409 std::vector<double> fchannely;
410 std::vector<uint64_t> fWCtime;
411 std::vector<unsigned int> fWCpresent;
412 std::vector<double> xWC;
413 std::vector<double> yWC;
416 fchannelx.push_back(
round((-(-910.57-
vXWire_Chamber2[final_index])+64)/(TMath::Cos(16*TMath::Pi()/180))));
463 for(
unsigned int k=0;k<4;k++)
474 if (fWCpresent[k]==1) {
476 std::cout<<
"the x wire number for WC "<< k+1 <<
" added to the event is "<< fchannelx[k]<<
" and the x wire coordinate is "<<xWC[k] <<
std::endl;
477 std::cout<<
"the y wire number for WC "<< k+1 <<
" added to the event is "<< fchannely[k] <<
" and the y wire coordinate is "<<yWC[k] <<
std::endl;
478 WCptr->push_back(WCobject);
481 std::cout<<
"-------------------- No WC "<<k+1<<
" objects added ---------------------------"<<
std::endl;
502 evt.
put(std::move(TOFptr));
503 evt.
put(std::move(CHKVptr));
504 evt.
put(std::move(WCptr));
void SetTimestamps(std::pair< float, float > timestamps)
DEFINE_ART_MODULE(TestTMapFile)
fvar< T > round(const fvar< T > &x)
ProductID put(std::unique_ptr< PROD > &&product)
Encapsulation of reconstructed digitizer 'hits'. Used for ToF PMTs and SiPMs, and Cherenkov and Muon ...
Encapsulation of reconstructed Time-of-Flight (ToF) information. Part of beamline reconstruction for ...
Encapsulation of reconstructed Wire Chamber track. Part of beamline reconstruction for NOvA test beam...
EventNumber_t event() const
void AddXPulse(WCPulse pulse)
void AddYPulse(WCPulse pulse)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Raw data definitions for beamline data used in NOvA test beam experiment.
Encapsulation of 'reconstructed' Cherenkov information. Part of beamline reconstruction for NOvA test...
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Encapsulation of reconstructed PID information from detectors in the beamline (ToF, WCs, Cherenkov). Part of beamline reconstruction for NOvA test beam.
Encapsulation of reconstructed track in the muon stack downstream of test beam detector. Part of beamline reconstruction for NOvA test beam.