Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port CRT data objects #26

Open
wants to merge 3 commits into
base: dlreco_tmw
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/Base/DataFormatConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ namespace larlite{
kSimChannel, ///< sim::SimChannel
kMCShower, ///< sim::MCShower
kRawDigit, ///< raw::RawDigit
kDAQHeaderTimeUBooNE,///< raw::DAQHeaderTimeUBooNE
kWire, ///< recob::Wire
kHit, ///< recob::Hit
kCRTHit, ///< crt::CRTHit
kCRTTrack, ///< crt::CRTTrack
kCosmicTag, ///< anab::CosmicTag
kOpHit, ///< opdet::OpHit
kOpFlash, ///< opdet::OpFlash
Expand Down Expand Up @@ -128,8 +131,11 @@ namespace larlite{
"simch",
"mcshower",
"rawdigit",
"daqheadertimeuboone",
"wire",
"hit",
"crthit",
"crttrack",
"cosmictag",
"ophit",
"opflash",
Expand Down
9 changes: 9 additions & 0 deletions core/DataFormat/DataFormat-TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,21 @@ namespace larlite{
class rawdigit;
class event_rawdigit;

class daqheadertimeuboone;
class event_daqheadertimeuboone;

class wire;
class event_wire;

class hit;
class event_hit;

class crthit;
class event_crthit;

class crttrack;
class event_crttrack;

class cosmictag;
class event_cosmictag;

Expand Down
12 changes: 12 additions & 0 deletions core/DataFormat/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
#pragma link C++ class std::vector<larlite::rawdigit>+;
#pragma link C++ class larlite::event_rawdigit+;

#pragma link C++ class larlite::daqheadertimeuboone+;
#pragma link C++ class std::vector<larlite::daqheadertimeuboone>+;
#pragma link C++ class larlite::event_daqheadertimeuboone+;

#pragma link C++ class larlite::wire+;
#pragma link C++ class std::vector<larlite::wire>+;
#pragma link C++ class larlite::event_wire+;
Expand All @@ -67,6 +71,14 @@
#pragma link C++ class std::vector<larlite::hit>+;
#pragma link C++ class larlite::event_hit+;

#pragma link C++ class larlite::crthit+;
#pragma link C++ class std::vector<larlite::crthit>+;
#pragma link C++ class larlite::event_crthit+;

#pragma link C++ class larlite::crttrack+;
#pragma link C++ class std::vector<larlite::crttrack>+;
#pragma link C++ class larlite::event_crttrack+;

#pragma link C++ class larlite::t0+;
#pragma link C++ class std::vector<larlite::t0>+;
#pragma link C++ class larlite::event_t0+;
Expand Down
48 changes: 48 additions & 0 deletions core/DataFormat/crthit.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef LARLITE_CRTHIT_CXX
#define LARLITE_CRTHIT_CXX

#include "crthit.h"

namespace larlite {

//#################################################
crthit::crthit() : data_base(data::kCRTHit)
//#################################################
{
feb_id.clear();
pesmap.clear();

peshit=0;

ts0_s=0;
ts0_s_corr=0;

ts0_ns=0;
ts0_ns_corr=0;

ts1_ns=0;

ts2_ns=0;

plane=-1;
x_pos=-1;
x_err=-1;
y_pos=-1;
y_err=-1;
z_pos=-1;
z_err=-1;


clear_data();
}

//##########################################################################
void crthit::clear_data()
//##########################################################################
{
data_base::clear_data();
}

}
#endif
//nothing to do here
99 changes: 99 additions & 0 deletions core/DataFormat/crthit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/**
* \class CRTHit
*
* \ingroup larlite
*
* \brief CRT Hit Info
*
* \author $Author: David Lorca $
*
*/


#ifndef LARLITE_CRTHIT_H
#define LARLITE_CRTHIT_H

#include "data_base.h"
#include <cstdint>
#include <vector>
#include <map>

namespace larlite {

class crthit : public data_base {
public:

/// Default constructor
crthit();

/// Default destructor
virtual ~crthit(){}

void clear_data();

//struct CRTHit{
std::vector<uint8_t> feb_id;
std::map< uint8_t, std::vector<std::pair<int,float> > > pesmap;
float peshit;

// CRT GPS clock in s
uint32_t ts0_s;
int8_t ts0_s_corr;

// CRT GPS clock in ns
uint32_t ts0_ns;
int32_t ts0_ns_corr;

// CRT time w.r.t. BNB trigger
int32_t ts1_ns;

// CRT hit time in TPC time frame
// can be directly compared to TPC and optical object timing
float ts2_ns;

int plane;
float x_pos;
float x_err;
float y_pos;
float y_err;
float z_pos;
float z_err;

//uint16_t event_flag;
//std::map< uint8_t, uint16_t > lostcpu_map;
//std::map< uint8_t, uint16_t > lostfpga_map;
//uint16_t pollms;

//CRTHit() {}

};
/**
\class event_crthit
A collection storage class of multiple hits.
*/
class event_crthit : public std::vector<larlite::crthit>,
public event_base {

public:

/// Default constructor
event_crthit(std::string name="noname") : event_base(data::kCRTHit,name) { clear_data(); }

/// Default copy constructor
event_crthit(const event_crthit& original) : std::vector<larlite::crthit>(original), event_base(original)
{}

/// Default destructor
~event_crthit(){}

/// Method to clear currently held data contents in the buffer
virtual void clear_data(){event_base::clear_data(); clear();}

private:

};


}

#endif
65 changes: 65 additions & 0 deletions core/DataFormat/crttrack.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef LARLITE_CRTTRACK_CXX
#define LARLITE_CRTTRACK_CXX

#include "crttrack.h"

namespace larlite {

//#################################################
crttrack::crttrack() : data_base(data::kCRTTrack)
//#################################################
{

feb_id.clear();
pesmap.clear();
peshit=0;

ts0_s=0;
ts0_s_err=0;

ts0_ns=0;
ts0_ns_err=0;

ts1_ns=0;
ts1_ns_err=0;

plane1=-1;
plane2=-1;
x1_pos=-1;
x1_err=-1;
y1_pos=-1;
y1_err=-1;
z1_pos=-1;
z1_err=-1;
x2_pos=-1;
x2_err=-1;
y2_pos=-1;
y2_err=-1;
z2_pos=-1;
z2_err=-1;
length=-1;
thetaxy=-1;
phiz=-1;

ts0_ns_h1=0;
ts0_ns_err_h1=0;

ts0_ns_h2=0;
ts0_ns_err_h2=0;

ts2_ns_h1=0;
ts2_ns_h2=0;

clear_data();
}

//##########################################################################
void crttrack::clear_data()
//##########################################################################
{
data_base::clear_data();
}

}
#endif
//nothing to do here
112 changes: 112 additions & 0 deletions core/DataFormat/crttrack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/**
* \class CRTTrack
*
* \ingroup larlite
*
* \brief CRT Track Info
*
*
*/


#ifndef LARLITE_CRTTRACK_H
#define LARLITE_CRTTRACK_H

#include "data_base.h"
#include <cstdint>
#include <vector>
#include <map>

namespace larlite {

class crttrack : public data_base {
public:

/// Default constructor
crttrack();

/// Default destructor
virtual ~crttrack(){}

void clear_data();

//struct CRTTrack{
std::vector<uint8_t> feb_id;
std::map< uint8_t, std::vector<std::pair<int,float> > > pesmap;
float peshit;

// CRT GPS clock in s
uint32_t ts0_s;
uint16_t ts0_s_err;
// CRT GPS clock in ns
uint32_t ts0_ns;
uint16_t ts0_ns_err;

// CRT hit time w.r.t. BNB trigger
int32_t ts1_ns;
uint16_t ts1_ns_err;

int plane1;
int plane2;

float x1_pos;
float x1_err;
float y1_pos;
float y1_err;
float z1_pos;
float z1_err;
float x2_pos;
float x2_err;
float y2_pos;
float y2_err;
float z2_pos;
float z2_err;

float length;
float thetaxy;
float phiz;

// CRT GPS time of 1st hit
uint32_t ts0_ns_h1;
uint16_t ts0_ns_err_h1;
// CRT GPS time of 1nd hit
uint32_t ts0_ns_h2;
uint16_t ts0_ns_err_h2;

// time of 1st hit in TPC time frame
float ts2_ns_h1;
// time of 2nd hit in TPC time frame
float ts2_ns_h2;


};
/**
\class event_crttrack
A collection storage class of multiple tracks.
*/
class event_crttrack : public std::vector<larlite::crttrack>,
public event_base {

public:

/// Default constructor
event_crttrack(std::string name="noname") : event_base(data::kCRTTrack,name) { clear_data(); }

/// Default copy constructor
event_crttrack(const event_crttrack& original) : std::vector<larlite::crttrack>(original), event_base(original)
{}

/// Default destructor
~event_crttrack(){}

/// Method to clear currently held data contents in the buffer
virtual void clear_data(){event_base::clear_data(); clear();}

private:

};


}

#endif
Loading