clas12root
Loading...
Searching...
No Matches
clas12::clas12reader Class Reference

#include <clas12reader.h>

Detailed Description

Clas12root HIPO file reader.

Accessors
See also
clas12root::HipoChain to read a set of HIPO files

Public Member Functions

 clas12reader ()=default
 clas12reader (const clas12reader &other, std::string filename="", std::vector< long > tags=std::vector< long >())
 clas12reader (std::string filename, std::vector< long > tags=std::vector< long >())
virtual ~clas12reader ()=default
void addARegionBAND ()
void addARegionCDet ()
void addARegionFDet ()
void addARegionFT ()
void addAtLeastPid (short pid, short n)
uint addBank (const std::string &name)
void addExactPid (short pid, short n)
void addZeroOfRestPid ()
void applyQA (const string &pass)
ccdb_readerccdb () const
bool checkTriggerBit (uint k)
bool checkVTPTriggerBit (uint k)
void clearEvent ()
 read the data
void connectDataBases (clas12databases *db)
 Enable QA skimming.
clas12databasesdb ()
event_ptr event () const
 get a pointer to the REC::Event bank
ftbevent_ptr ftbevent () const
 get a pointer to the REC::FTEvent bank
std::vector< hipo::bank * > getAllBanksPtrs ()
hipo::bank * getBank (uint index) const
int getBankOrder (int ibank, std::string itemname) const
const std::vector< hipo::bank * > getBanksPtrs (std::vector< std::string > names) const
std::vector< region_part_ptrgetByCharge (int ch, bool const &applyBankFilter=false) const
 Get the list of region_particles, filtered by charge.
std::vector< region_part_ptrgetByID (int id, bool const &applyBankFilter=false) const
 Get the list of region_particles, filtered by PDG.
std::vector< region_part_ptrgetByRegion (int ir, bool const &applyBankFilter=false) const
 Get the list of region_particles, filtered by region.
double getCurrApproxCharge ()
std::vector< region_part_ptr > & getDetParticles ()
 Get the full list of region_particles.
std::vector< region_part_ptrgetDetParticles (bool const &applyBankFilter) const
 Get the list of region_particles.
std::vector< region_part_ptr > * getDetParticlesPtr ()
 Get the full list of region_particles.
hipo::dictionary & getDictionary ()
std::string getFilename ()
class helflipgetHELflip () const
 get the HEL::flip bank
class helonlinegetHELonline () const
 get the HEL::online bank
class mceventgetMCEvent () const
 get the MC::Event bank
class mcparticlegetMCLund () const
 get the MC::Lund bank
int getNParticles () const noexcept
 Get the number of region_particles.
short getNPid (short pid) const noexcept
hipo::bank & getParticleBank () const
 get the particle bank, depending on your configuration
const std::vector< short > & getPids () const noexcept
class vtpgetRAWvtp () const
 get the RAW::vtp bank
hipo::reader & getReader ()
class calorimetergetRECCalorimeter () const
 get the REC::Calorimeter bank
class cherenkovgetRECCherenkov () const
 get the REC::Cherenkov bank
class covmatrixgetRECCovMat () const
 get the REC::CovMat bank
class eventgetRECEvent () const
 get the REC::Event bank
class forwardtaggergetRECForwardTagger () const
 get the REC::ForwardTagger bank
class ftbeventgetRECFTEvent () const
 get the REC::FTEvent bank
class ftbparticlegetRECFTParticle () const
 get the REC::FTParticle bank
class particlegetRECParticle () const
 get the REC::Particle bank
class scintillatorgetRECScintillator () const
 get the REC::Scintillator bank
class trackergetRECTrack () const
 get the REC::Track bank
class trajgetRECTraj () const
 get the REC::Traj bank
class utrackergetRECUTrack () const
 get the REC::UTrack bank
class vertdocagetRECVertDoca () const
 get the REC::VertDoca bank
class richgetRICHParticle () const
 get the RICH::Particle bank
double getRunBeamCharge ()
class runconfiggetRUNconfig () const
 get the RUN::config bank
int getRunNumber () const
std::set< int > getRunNumbers () const
void getStructure (hipo::bank *bank)
bool grabEvent (Long64_t Nev)
helflip_ptr helflip () const
 get a pointer to the HEL::flip bank
helonline_ptr helonline () const
 get a pointer to the HEL::online bank
void ignoreBank (const string &bnk)
bool isOpen ()
mcevt_ptr mcevent () const
 get a pointer to the MC::Event bank
mcpar_ptr mcparts () const
 get a pointer to the MC::Lund bank
bool next ()
 initialise next event from the reader
bool nextInRecord ()
 initialise next event from the reader
bool passPidSelect ()
const std::vector< short > & preCheckPids ()
const std::vector< short > & preCheckPidsOrCharge ()
qadb_readerqadb () const
rcdb_readerrcdb () const
bool readEvent ()
runconfig_ptr runconfig () const
 get a pointer to the RUN::config bank
scalerreader_ptr scalerReader ()
void setEntries (long n)
void SetReadAction (std::function< bool(clas12reader *)> readEventUserAction)
 Set a "read action", a custom lambda function that is executed for every event within readEvent().
void SetRecParticleOnly ()
void setVerbose (short level=1)
void sort ()
void summary ()
void useFTBased ()
 use FT-based PID, rather than the default
bool const usingFTBased () const
vertdoca_ptr vertdoca () const
 get a pointer to the REC::VertDoca bank
vtp_ptr vtp () const
 get a pointer to the RAW::vtp bank

Static Public Member Functions

static int readQuickRunConfig (const std::string &filename)
static int tryTaggRunConfig (const std::string &filename, int tag)

Protected Member Functions

void initReader ()

Constructor & Destructor Documentation

◆ clas12reader() [1/3]

clas12::clas12reader::clas12reader ( )
default

◆ clas12reader() [2/3]

clas12::clas12reader::clas12reader ( std::string filename,
std::vector< long > tags = std::vector<long>() )

◆ clas12reader() [3/3]

clas12::clas12reader::clas12reader ( const clas12reader & other,
std::string filename = "",
std::vector< long > tags = std::vector<long>() )

copy constructor opens a new reader Can give alternative filename

◆ ~clas12reader()

virtual clas12::clas12reader::~clas12reader ( )
virtualdefault

Member Function Documentation

◆ addARegionBAND()

void clas12::clas12reader::addARegionBAND ( )
inline

◆ addARegionCDet()

void clas12::clas12reader::addARegionCDet ( )
inline

◆ addARegionFDet()

void clas12::clas12reader::addARegionFDet ( )
inline

◆ addARegionFT()

void clas12::clas12reader::addARegionFT ( )
inline

◆ addAtLeastPid()

void clas12::clas12reader::addAtLeastPid ( short pid,
short n )
inline

◆ addBank()

uint clas12::clas12reader::addBank ( const std::string & name)
inline

◆ addExactPid()

void clas12::clas12reader::addExactPid ( short pid,
short n )
inline

◆ addZeroOfRestPid()

void clas12::clas12reader::addZeroOfRestPid ( )
inline

◆ applyQA()

void clas12::clas12reader::applyQA ( const string & pass)
inline

◆ ccdb()

ccdb_reader * clas12::clas12reader::ccdb ( ) const
inline

◆ checkTriggerBit()

bool clas12::clas12reader::checkTriggerBit ( uint k)
inline

◆ checkVTPTriggerBit()

bool clas12::clas12reader::checkVTPTriggerBit ( uint k)
inline

◆ clearEvent()

void clas12::clas12reader::clearEvent ( )

read the data

Function to query RCDB and record most relevant run conditions. This is only called once to avoid overloading the database.

◆ connectDataBases()

void clas12::clas12reader::connectDataBases ( clas12databases * db)

Enable QA skimming.

Returns qadb_reader once declared connect to the data bases

◆ db()

clas12databases * clas12::clas12reader::db ( )
inline

◆ event()

event_ptr clas12::clas12reader::event ( ) const
inline

get a pointer to the REC::Event bank

Returns
a pointer to the REC::Event bank
See also
Bank reference accessor getRECEvent

◆ ftbevent()

ftbevent_ptr clas12::clas12reader::ftbevent ( ) const
inline

get a pointer to the REC::FTEvent bank

Returns
a pointer to the REC::FTEvent bank
See also
Bank reference accessor getRECFTEvent

◆ getAllBanksPtrs()

std::vector< hipo::bank * > clas12::clas12reader::getAllBanksPtrs ( )
inline

◆ getBank()

hipo::bank * clas12::clas12reader::getBank ( uint index) const
inline

◆ getBankOrder()

int clas12::clas12reader::getBankOrder ( int ibank,
std::string itemname ) const
inline

◆ getBanksPtrs()

const std::vector< hipo::bank * > clas12::clas12reader::getBanksPtrs ( std::vector< std::string > names) const
inline

◆ getByCharge()

std::vector< region_part_ptr > clas12::clas12reader::getByCharge ( int ch,
bool const & applyBankFilter = false ) const

Get the list of region_particles, filtered by charge.

Returns
A copy of the list of corresponding region_particles
Parameters
chThe charge
applyBankFilterIf true, apply any hipo::bank filters (e.g., from iguana)
See also
Additional methods:

◆ getByID()

std::vector< region_part_ptr > clas12::clas12reader::getByID ( int id,
bool const & applyBankFilter = false ) const

Get the list of region_particles, filtered by PDG.

Returns
A copy of the list of corresponding region_particles
Parameters
idThe PDG
applyBankFilterIf true, apply any hipo::bank filters (e.g., from iguana)
See also
Additional methods:

◆ getByRegion()

std::vector< region_part_ptr > clas12::clas12reader::getByRegion ( int ir,
bool const & applyBankFilter = false ) const

Get the list of region_particles, filtered by region.

Returns
A copy of the list of corresponding region_particles
Parameters
irThe region
applyBankFilterIf true, apply any hipo::bank filters (e.g., from iguana)
See also
Additional methods:

◆ getCurrApproxCharge()

double clas12::clas12reader::getCurrApproxCharge ( )
inline

◆ getDetParticles() [1/2]

std::vector< region_part_ptr > & clas12::clas12reader::getDetParticles ( )
inline

Get the full list of region_particles.

Note
This method does not take into account any hipo::bank filters (e.g., from iguana)
Returns
A reference to the full list of region_particles
See also
Use getDetParticles(bool) if you need a hipo::bank filter applied

◆ getDetParticles() [2/2]

std::vector< region_part_ptr > clas12::clas12reader::getDetParticles ( bool const & applyBankFilter) const

Get the list of region_particles.

Parameters
applyBankFilterIf true, apply any hipo::bank filters (e.g., from iguana)
Returns
A copy of the list of region_particles, with or without applying a hipo::bank filter
See also
Use getDetParticles() or getDetParticlesPtr() if you don't need the filter, and you want to avoid copying
Additional methods:

◆ getDetParticlesPtr()

std::vector< region_part_ptr > * clas12::clas12reader::getDetParticlesPtr ( )
inline

Get the full list of region_particles.

Note
This method does not take into account any hipo::bank filters (e.g., from iguana)
Returns
A pointer to the full list of region_particles
See also
Use getDetParticles(bool) if you need a hipo::bank filter applied

◆ getDictionary()

hipo::dictionary & clas12::clas12reader::getDictionary ( )
inline

◆ getFilename()

std::string clas12::clas12reader::getFilename ( )
inline

◆ getHELflip()

class helflip & clas12::clas12reader::getHELflip ( ) const
inline

get the HEL::flip bank

Click here for the full list of bank accessors
HEL::flip
Returns
a reference to the HEL::flip bank

◆ getHELonline()

class helonline & clas12::clas12reader::getHELonline ( ) const
inline

get the HEL::online bank

Click here for the full list of bank accessors
HEL::online
Returns
a reference to the HEL::online bank

◆ getMCEvent()

class mcevent & clas12::clas12reader::getMCEvent ( ) const
inline

get the MC::Event bank

Click here for the full list of bank accessors
MC::Event
Returns
a reference to the MC::Event bank

◆ getMCLund()

class mcparticle & clas12::clas12reader::getMCLund ( ) const
inline

get the MC::Lund bank

Click here for the full list of bank accessors
MC::Lund
Returns
a reference to the MC::Lund bank

◆ getNParticles()

int clas12::clas12reader::getNParticles ( ) const
inlinenoexcept

Get the number of region_particles.

Note
This method does not take into account any hipo::bank filters (e.g., from iguana)
Returns
The number of region_particles

◆ getNPid()

short clas12::clas12reader::getNPid ( short pid) const
inlinenoexcept

◆ getParticleBank()

hipo::bank & clas12::clas12reader::getParticleBank ( ) const
inline

get the particle bank, depending on your configuration

Returns
a reference to REC::Particle by default, or a reference to RECFT::Particle if you are using FT-based PID (you have called useFTBased) and the RECFT::Particle bank is not empty (the empty check ignores hipo::bank::rowlist filtering, e.g., applied by an Iguana filter algorithm)
Note
this method returns a base-class reference, hipo::bank&, while many other bank reference accessors return derived-class references, such as getRECParticle
See also
specific particle-bank accessors:

◆ getPids()

const std::vector< short > & clas12::clas12reader::getPids ( ) const
inlinenoexcept

◆ getRAWvtp()

class vtp & clas12::clas12reader::getRAWvtp ( ) const
inline

get the RAW::vtp bank

Click here for the full list of bank accessors
RAW::vtp
Returns
a reference to the RAW::vtp bank

◆ getReader()

hipo::reader & clas12::clas12reader::getReader ( )
inline

◆ getRECCalorimeter()

class calorimeter & clas12::clas12reader::getRECCalorimeter ( ) const
inline

get the REC::Calorimeter bank

Click here for the full list of bank accessors
REC::Calorimeter
Returns
a reference to the REC::Calorimeter bank

◆ getRECCherenkov()

class cherenkov & clas12::clas12reader::getRECCherenkov ( ) const
inline

get the REC::Cherenkov bank

Click here for the full list of bank accessors
REC::Cherenkov
Returns
a reference to the REC::Cherenkov bank

◆ getRECCovMat()

class covmatrix & clas12::clas12reader::getRECCovMat ( ) const
inline

get the REC::CovMat bank

Click here for the full list of bank accessors
REC::CovMat
Returns
a reference to the REC::CovMat bank

◆ getRECEvent()

class event & clas12::clas12reader::getRECEvent ( ) const
inline

get the REC::Event bank

Click here for the full list of bank accessors
REC::Event
Returns
a reference to the REC::Event bank

◆ getRECForwardTagger()

class forwardtagger & clas12::clas12reader::getRECForwardTagger ( ) const
inline

get the REC::ForwardTagger bank

Click here for the full list of bank accessors
REC::ForwardTagger
Returns
a reference to the REC::ForwardTagger bank

◆ getRECFTEvent()

class ftbevent & clas12::clas12reader::getRECFTEvent ( ) const
inline

get the REC::FTEvent bank

Click here for the full list of bank accessors
REC::FTEvent
Returns
a reference to the REC::FTEvent bank

◆ getRECFTParticle()

class ftbparticle & clas12::clas12reader::getRECFTParticle ( ) const
inline

get the REC::FTParticle bank

Click here for the full list of bank accessors
REC::FTParticle
Returns
a reference to the REC::FTParticle bank
See also
getParticleBank

◆ getRECParticle()

class particle & clas12::clas12reader::getRECParticle ( ) const
inline

get the REC::Particle bank

Click here for the full list of bank accessors
REC::Particle
Returns
a reference to the REC::Particle bank
See also
getParticleBank

◆ getRECScintillator()

class scintillator & clas12::clas12reader::getRECScintillator ( ) const
inline

get the REC::Scintillator bank

Click here for the full list of bank accessors
REC::Scintillator
Returns
a reference to the REC::Scintillator bank

◆ getRECTrack()

class tracker & clas12::clas12reader::getRECTrack ( ) const
inline

get the REC::Track bank

Click here for the full list of bank accessors
REC::Track
Returns
a reference to the REC::Track bank

◆ getRECTraj()

class traj & clas12::clas12reader::getRECTraj ( ) const
inline

get the REC::Traj bank

Click here for the full list of bank accessors
REC::Traj
Returns
a reference to the REC::Traj bank

◆ getRECUTrack()

class utracker & clas12::clas12reader::getRECUTrack ( ) const
inline

get the REC::UTrack bank

Click here for the full list of bank accessors
REC::UTrack
Returns
a reference to the REC::UTrack bank

◆ getRECVertDoca()

class vertdoca & clas12::clas12reader::getRECVertDoca ( ) const
inline

get the REC::VertDoca bank

Click here for the full list of bank accessors
REC::VertDoca
Returns
a reference to the REC::VertDoca bank

◆ getRICHParticle()

class rich & clas12::clas12reader::getRICHParticle ( ) const
inline

get the RICH::Particle bank

Click here for the full list of bank accessors
RICH::Particle
Returns
a reference to the RICH::Particle bank

◆ getRunBeamCharge()

double clas12::clas12reader::getRunBeamCharge ( )
inline

◆ getRUNconfig()

class runconfig & clas12::clas12reader::getRUNconfig ( ) const
inline

get the RUN::config bank

Click here for the full list of bank accessors
RUN::config
Returns
a reference to the RUN::config bank

◆ getRunNumber()

int clas12::clas12reader::getRunNumber ( ) const
inline

◆ getRunNumbers()

std::set< int > clas12::clas12reader::getRunNumbers ( ) const
inline

◆ getStructure()

void clas12::clas12reader::getStructure ( hipo::bank * bank)
inline

◆ grabEvent()

bool clas12::clas12reader::grabEvent ( Long64_t Nev)

◆ helflip()

helflip_ptr clas12::clas12reader::helflip ( ) const
inline

get a pointer to the HEL::flip bank

Returns
a pointer to the HEL::flip bank
See also
Bank reference accessor getHELflip

◆ helonline()

helonline_ptr clas12::clas12reader::helonline ( ) const
inline

get a pointer to the HEL::online bank

Returns
a pointer to the HEL::online bank
See also
Bank reference accessor getHELonline

◆ ignoreBank()

void clas12::clas12reader::ignoreBank ( const string & bnk)
inline

◆ initReader()

void clas12::clas12reader::initReader ( )
protected

◆ isOpen()

bool clas12::clas12reader::isOpen ( )
inline

◆ mcevent()

mcevt_ptr clas12::clas12reader::mcevent ( ) const
inline

get a pointer to the MC::Event bank

Returns
a pointer to the MC::Event bank
See also
Bank reference accessor getMCEvent

◆ mcparts()

mcpar_ptr clas12::clas12reader::mcparts ( ) const
inline

get a pointer to the MC::Lund bank

Returns
a pointer to the MC::Lund bank
See also
Bank reference accessor getMCLund

◆ next()

bool clas12::clas12reader::next ( )

initialise next event from the reader

◆ nextInRecord()

bool clas12::clas12reader::nextInRecord ( )

initialise next event from the reader

◆ passPidSelect()

bool clas12::clas12reader::passPidSelect ( )

◆ preCheckPids()

const std::vector< short > & clas12::clas12reader::preCheckPids ( )

This function may be called before readEvent to allow checking of Pids by external routines

◆ preCheckPidsOrCharge()

const std::vector< short > & clas12::clas12reader::preCheckPidsOrCharge ( )

◆ qadb()

qadb_reader * clas12::clas12reader::qadb ( ) const
inline

◆ rcdb()

rcdb_reader * clas12::clas12reader::rcdb ( ) const
inline

◆ readEvent()

bool clas12::clas12reader::readEvent ( )

◆ readQuickRunConfig()

int clas12::clas12reader::readQuickRunConfig ( const std::string & filename)
static

Basically get the run number! will open and close a hipo file

◆ runconfig()

runconfig_ptr clas12::clas12reader::runconfig ( ) const
inline

get a pointer to the RUN::config bank

Returns
a pointer to the RUN::config bank
See also
Bank reference accessor getRUNconfig

◆ scalerReader()

scalerreader_ptr clas12::clas12reader::scalerReader ( )
inline

◆ setEntries()

void clas12::clas12reader::setEntries ( long n)
inline

◆ SetReadAction()

void clas12::clas12reader::SetReadAction ( std::function< bool(clas12reader *)> readEventUserAction)
inline

Set a "read action", a custom lambda function that is executed for every event within readEvent().

readEvent() is called by methods like clas12reader::next() and clas12root::HipoChain::Next()

Parameters
readEventUserActionlambda function, where its argument is a pointer to an instance of this clas12reader class, and its bool return value controls whether to proceed with the event or not

◆ SetRecParticleOnly()

void clas12::clas12reader::SetRecParticleOnly ( )
inline

◆ setVerbose()

void clas12::clas12reader::setVerbose ( short level = 1)
inline

◆ sort()

void clas12::clas12reader::sort ( )

Loop over particles and find their region Add appropriate region_partcle to event particle vector

◆ summary()

void clas12::clas12reader::summary ( )
inline

◆ tryTaggRunConfig()

int clas12::clas12reader::tryTaggRunConfig ( const std::string & filename,
int tag )
static

◆ useFTBased()

void clas12::clas12reader::useFTBased ( )
inline

use FT-based PID, rather than the default

See also
usingFTBased

◆ usingFTBased()

bool const clas12::clas12reader::usingFTBased ( ) const
inline
Returns
whether or not FT-based PID is used
See also
useFTBased

◆ vertdoca()

vertdoca_ptr clas12::clas12reader::vertdoca ( ) const
inline

get a pointer to the REC::VertDoca bank

Returns
a pointer to the REC::VertDoca bank
See also
Bank reference accessor getRECVertDoca

◆ vtp()

vtp_ptr clas12::clas12reader::vtp ( ) const
inline

get a pointer to the RAW::vtp bank

Returns
a pointer to the RAW::vtp bank
See also
Bank reference accessor getRAWvtp

The documentation for this class was generated from the following files: