13 #include "TTimeStamp.h" 37 #include "NovaTimingUtilities/TimingUtilities.h" 266 unsigned long int unixTimeSec = unixTime.tv_sec;
267 unsigned long int unixTimeNanoSec = unixTime.tv_nsec;
268 evtTime = unixTimeSec + (1
e-9)*unixTimeNanoSec;
276 std::vector<art::Ptr<brb::ToF>> tofs;
280 for (
auto tof : tofs) {
281 double t = tof->Time();
288 std::vector<art::Ptr<brb::WCTrack>> wcs;
293 for (
auto wc : wcs) {
294 wcmom = wc->Momentum();
306 std::vector<art::Ptr<brb::BeamlineDigit>> cherenkovs;
310 for (
auto ckov : cherenkovs) {
320 nhit = cellhits->size();
322 for (
unsigned int hitIdx=0; hitIdx<cellhits->size(); ++hitIdx){
342 for (
unsigned int i=0;
i<sliceHandle->size(); ++
i )
347 for (
unsigned int sliceIdx = 0; sliceIdx<slices.
size(); ++sliceIdx ){
351 slice.push_back(sliceIdx);
356 if (islice->
NCell() > 0) {
373 if ( cosTrkAssn.isValid() ) {
374 std::vector< art::Ptr< rb::Track > > tracks = cosTrkAssn.at(sliceIdx);
375 for (
unsigned int trackIdx = 0; trackIdx<tracks.size(); ++trackIdx ){
377 cosTrkStrt = cosTrk->
Start();
378 cosTrkStop = cosTrk->
Stop();
379 cosTrkDir = cosTrk->
Dir();
381 if ( cosTrkStop.Z() < cosTrkStrt.Z() ) {
382 cosTrkStrt = cosTrk->
Stop();
383 cosTrkStop = cosTrk->
Start();
384 cosTrkDir = -(cosTrk->
Dir());
402 if ( winTrkAssn.isValid() ) {
403 std::vector< art::Ptr< rb::Track > > tracks = winTrkAssn.at(sliceIdx);
404 for (
unsigned int trackIdx = 0; trackIdx<tracks.size(); ++trackIdx ){
406 winTrkStrt = winTrk->
Start();
407 winTrkStop = winTrk->
Stop();
408 winTrkDir = winTrk->
Dir();
410 if ( winTrkStop.Z() < winTrkStrt.Z() ) {
411 winTrkStrt = winTrk->
Stop();
412 winTrkStop = winTrk->
Start();
413 winTrkDir = -(winTrk->
Dir());
438 std::vector<art::Ptr<rb::Prong>> prongs3D;
441 if ( !fmProng3D.isValid() )
continue;
442 else prongs3D = fmProng3D.at(sliceIdx);
443 if (prongs3D.size() == 0 )
continue;
448 std::vector<art::Ptr<rb::Vertex>> cosVtx;
449 if (cosVtxAssn.isValid())
450 cosVtx = cosVtxAssn.at(sliceIdx);
451 if (cosVtx.size() == 1){
452 cosVtxX.push_back(cosVtx.at(0)->GetX());
453 cosVtxY.push_back(cosVtx.at(0)->GetY());
454 cosVtxZ.push_back(cosVtx.at(0)->GetZ());
459 for (
unsigned int prongIdx=0; prongIdx<prongs3D.size(); ++prongIdx){
461 int nhitprong = iprong->
NCell();
473 for (
unsigned int hitIdx = 0; hitIdx<iprong->
NCell(); ++hitIdx){
494 std::vector<art::Ptr<rb::Track>> bpftracks;
495 if(fmTrackBPF.isValid()) bpftracks = fmTrackBPF.at(prongIdx);
499 for (
unsigned int trackIdx = 0; trackIdx < bpftracks.size(); ++trackIdx){
501 std::vector<art::Ptr<rb::FitSum>> fitsums;
502 if(fmFitsum.isValid()) fitsums = fmFitsum.at(trackIdx);
503 if(fitsums.size()==0)
continue;
506 if(fitsums[0]->PDG() == 13) {
508 int nhitbpf = bpfTrk->
NCell();
522 double trkTime = bpfhit->
TNS();
std::vector< double > winTrkADCTot
std::vector< double > bpfDirZ
std::string fRecoToFLabel
SubRunNumber_t subRun() const
back track the reconstruction to the simulation
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
std::vector< double > cosTrkStopX
std::vector< double > prongStrtZ
std::string fRawDataLabel
unsigned short Plane() const
std::vector< double > winTrkStopX
std::vector< double > bpfTrkMeanTime
std::string fRecoCherenkovLabel
std::vector< double > cosTrkStopY
std::vector< double > prongMeanTime
void analyze(const art::Event &evt)
std::vector< double > winTrkStopZ
std::vector< double > bpfTrkMinTime
std::vector< double > hitTime
Definition of the beamline offline geometry. Also implementation of a service to obtain this informat...
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
bool convertNovaTimeToUnixTime(uint64_t const &inputNovaTime, struct timespec &outputUnixTime)
std::vector< double > bpfDirY
std::vector< double > cosTrkStrtY
std::vector< double > prongDirX
std::vector< double > prongE
std::vector< double > cosTrkStopZ
std::vector< double > cosTrkDirY
std::vector< double > winTrkMinTime
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
std::vector< int > winTrkNhit
std::vector< int > cosTrkNhit
unsigned short Cell() const
std::vector< double > prongHitTime
double TotalADC() const
Sum of the ADC of all the contained hits.
std::vector< double > bpfStrtY
std::vector< double > winTrkStopY
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
std::vector< double > winTrkDirX
std::vector< double > winTrkStrtX
Encapsulation of reconstructed digitizer 'hits'. Used for ToF PMTs and SiPMs, and Cherenkov and Muon ...
std::vector< double > winTrkMaxPlane
void push_back(Ptr< U > const &p)
std::vector< int > hitCell
std::vector< double > cosTrkMinTime
T get(std::string const &key) const
Encapsulation of reconstructed Time-of-Flight (ToF) information. Part of beamline reconstruction for ...
virtual TVector3 Dir() const
Unit vector describing prong direction.
rb::RecoHit RecoHit(const art::Ptr< rb::CellHit > &chit) const
Return calibrated hit based on assumed W coordinate.
std::vector< double > cosVtxZ
std::vector< double > sliceMaxPlane
std::vector< double > prongStrtY
Encapsulation of reconstructed Wire Chamber track. Part of beamline reconstruction for NOvA test beam...
std::vector< double > winTrkDirY
std::vector< double > winTrkStrtY
EventNumber_t event() const
reference at(size_type n)
EDAnalyzer(Table< Config > const &config)
std::vector< int > sliceNhit
Vertex location in position and time.
std::vector< double > bpfDirX
std::vector< double > sliceCalE
std::string fProngModLabel
std::vector< int > prongNhit
std::vector< double > prongDirZ
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
std::string fClusterLabel
T * make(ARGS...args) const
std::vector< double > cosVtxY
std::vector< double > winTrkStrtZ
TBRecoAna(fhicl::ParameterSet const &pset)
std::vector< double > winTrkCalE
std::vector< double > sliceTime
std::vector< double > winTrkDirZ
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
unsigned long long fTriggerTimingMarker_TimeStart
std::vector< int > hitPlane
std::string fProng3DLabel
std::vector< double > cosTrkMeanTime
std::vector< double > winTrkMeanTime
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
std::vector< double > cosTrkStrtX
std::vector< int > bpfNhit
double TotalGeV(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple sum of the estimated GeV of all the hits.
std::vector< double > cosVtxX
std::vector< double > prongCalE
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
std::vector< double > bpfStrtZ
std::string fProng2DLabel
std::vector< double > prongStrtX
TVector3 Stop() const
Position of the final trajectory point.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::vector< double > cosTrkDirZ
std::vector< double > prongDirY
std::vector< double > sliceADCTot
void reconfigure(const fhicl::ParameterSet &pset)
std::vector< double > bpfStrtX
std::vector< double > cosTrkDirX
std::vector< double > bpfTrkHitTime
std::vector< double > prongMinTime
std::vector< double > cosTrkStrtZ
std::vector< double > chitHitTime
std::vector< double > prongADCTot