Belle II Software  release-08-01-10
EclData Class Reference

This class contains data for ECLSimHit's and provides several relevant conversion functions for better event display. More...

#include <EclData.h>

Collaboration diagram for EclData:

Public Types

enum  EclSubsystem {
  ALL ,
  BARR ,
  FORW ,
  BACKW
}
 Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap only.
 

Public Member Functions

 EclData ()
 Default constructor.
 
 EclData (const EclData &data)
 Copy constructor. More...
 
EclDataoperator= (const EclData &other)
 Assignment operator: utilizes copy constructor.
 
TTree * getTree ()
 Returns data contained in EclDisplay.
 
int * getEventCounts ()
 Returns array of event counts per crystal[getCrystalsCount()].
 
int * getEventCountsPerCrystal ()
 Alias for GetEventCounts()
 
int getEventCountsMax ()
 
float * getEnergySums ()
 Get array of total energy for each channel in the specified time and event range.
 
float * getEnergySumPerCrystal ()
 Alias for GetEnergySums()
 
float getEnergySumsMax ()
 
float getEnergyTotal ()
 
bool isCrystalInSubsystem (int crystal, EclSubsystem subsys)
 
int getTimeRangeMin ()
 Return min time in time range.
 
int getTimeRangeMax ()
 Return max time in time range.
 
void setTimeRange (int time_min, int time_max, bool do_update=true)
 Display only events in the specified time range. More...
 
int getEventRangeMin ()
 Return min event number to display.
 
int getEventRangeMax ()
 Return max event number to display.
 
void setEventRange (int ev_min, int ev_max, bool do_update=true)
 Sets event range to (ev_min, ev_max) More...
 
void setEnergyThreshold (int en_min, int en_max, bool do_update=true)
 Sets energy range to (en_min, en_max). More...
 
int getTimeMin ()
 
int getTimeMax ()
 
int getLastEventId ()
 
int getChannel (int phi_id, int theta_id)
 Converts (phi_id, theta_id) pair to ECL CellId.
 
int getPhiId (int ch)
 ECL CellId -> phi_id.
 
int getThetaId (int ch)
 ECL CellId -> theta_id.
 
void excludeChannel (int ch, bool do_update=false)
 Excludes specific channel from the count of events and energy.
 
void includeChannel (int ch, bool do_update=false)
 Includes specific channel in the count of events and energy.
 
void loadRootFile (const char *path)
 Load root file containing ECLCalDigit data from the specified path.
 
void update (bool reset_event_ranges=false)
 Update time_min, time_max, event_counts and energy_sums.
 
int addEvent (ECLCalDigit *event, int evtn)
 Add ECLDigit event to inner TTree (m_tree). More...
 
void fillEnergyHistogram (TH1F *hist, int energy_min, int energy_max, EclSubsystem subsys)
 Fill energy per channel histogram for the specified EclSubsystem (Barrel, forward endcap, backward endcap, all of them).
 
void fillEnergySumHistogram (TH1F *hist, int energy_min, int energy_max, EclSubsystem subsys)
 Fill energy per event histogram for the specified EclSubsystem (Barrel, forward endcap, backward endcap, all of them).
 
void fillTimeHistogram (TH1F *hist, int time_min, int time_max, EclSubsystem subsys)
 Fill time histogram for the specified EclSubsystem (Barrel, forward endcap, backward endcap, all of them).
 

Static Public Member Functions

static int getCrystalCount ()
 Get number of crystals in ECL.
 

Private Member Functions

void cloneFrom (const EclData &other)
 Clone attributes from other EclData.
 
void initVariables ()
 Initialization of arrays.
 
void initEventRanges ()
 Set initial values for time and event range.
 

Private Attributes

TTree * m_tree
 Tree with loaded events.
 
int m_branch_ch
 Tree channel field.
 
double m_branch_energy
 Tree energy branch.
 
double m_branch_time
 Tree time branch.
 
int m_branch_evtn
 Tree event number branch.
 
int * m_event_counts
 Number of events for each crystal.
 
int m_event_count_max
 Max value in event_counts array.
 
float * m_energy_sums
 Sum of energies of every event captured by crystal (MeV).
 
float m_energy_sums_max
 Max value in m_energy_sums array.
 
float m_energy_total
 Total energy for last displayed range of events.
 
int m_last_event_id
 Id of the event with max recorded event number (evtn).
 
int m_time_max
 Maximum possible time.
 
int m_time_range_min
 Time range (min) for display. More...
 
int m_time_range_max
 Time range (max) for display. More...
 
int m_ev_range_min
 Events from ev_range_min will be counted in energy_sums and event_counts. More...
 
int m_ev_range_max
 Events up to ev_range_max will be counted in energy_sums and event_counts. More...
 
int m_en_range_min
 Lower boundary of energy threshold.
 
int m_en_range_max
 Upper boundary of energy threshold.
 
std::set< int > m_excluded_ch
 Channels which are filtered out from the count of events and energy.
 
std::vector< int > m_event_entry
 This vector holds the position of each entry which starts an event.
 

Static Private Attributes

static const int ring_start_id [70]
 First crystal id in the beginning of i-th ECL ring. More...
 

Detailed Description

This class contains data for ECLSimHit's and provides several relevant conversion functions for better event display.

Definition at line 31 of file EclData.h.

Constructor & Destructor Documentation

◆ EclData()

EclData ( const EclData data)

Copy constructor.

Resets m_excluded_ch upon copy.

Definition at line 53 of file EclData.cc.

54 {
55  initVariables();
57 
58  cloneFrom(data);
59 }
void initVariables()
Initialization of arrays.
Definition: EclData.cc:117
void cloneFrom(const EclData &other)
Clone attributes from other EclData.
Definition: EclData.cc:79
void initEventRanges()
Set initial values for time and event range.
Definition: EclData.cc:136

Member Function Documentation

◆ addEvent()

int addEvent ( ECLCalDigit event,
int  evtn 
)

Add ECLDigit event to inner TTree (m_tree).

Parameters
eventECLDigit event
evtnNumber of event.
Returns
If ECLDigit contains incorrect data, negative values are returned. Otherwise, return value is 0.

Definition at line 428 of file EclData.cc.

◆ getEnergySumsMax()

float getEnergySumsMax ( )
Returns
Maximum value in array of energy sums.

Definition at line 183 of file EclData.cc.

◆ getEnergyTotal()

float getEnergyTotal ( )
Returns
Get total energy in currently set range of time and/or events.

Definition at line 188 of file EclData.cc.

◆ getEventCountsMax()

int getEventCountsMax ( )
Returns
Maximum value in array of event counts.

Definition at line 168 of file EclData.cc.

◆ getLastEventId()

int getLastEventId ( )
Returns
Id of the last event.

Definition at line 268 of file EclData.cc.

◆ getTimeMax()

int getTimeMax ( )
Returns
Time of the last event in TTrees.

Definition at line 263 of file EclData.cc.

◆ getTimeMin()

int getTimeMin ( )
Returns
Time of the first event in TTree.

Definition at line 259 of file EclData.cc.

◆ isCrystalInSubsystem()

bool isCrystalInSubsystem ( int  crystal,
EclData::EclSubsystem  subsys 
)
Parameters
crystalcrystal number
subsysID of the ECL subsystem.
Returns
Whether crystal is in barrel or forward/backward endcap.

Definition at line 193 of file EclData.cc.

◆ setEnergyThreshold()

void setEnergyThreshold ( int  en_min,
int  en_max,
bool  do_update = true 
)

Sets energy range to (en_min, en_max).

Parameters
en_minminimal energy
en_maxmaximal energy
do_updateImmediately update sums of energy and event count for each channel.

Definition at line 248 of file EclData.cc.

◆ setEventRange()

void setEventRange ( int  ev_min,
int  ev_max,
bool  do_update = true 
)

Sets event range to (ev_min, ev_max)

Parameters
ev_minminimal event number
ev_maxmaximal event number
do_updateImmediately update sums of energy and event count for each channel.

Definition at line 237 of file EclData.cc.

◆ setTimeRange()

void setTimeRange ( int  time_min,
int  time_max,
bool  do_update = true 
)

Display only events in the specified time range.

This method currently can't be called from the GUI.

Definition at line 218 of file EclData.cc.

Member Data Documentation

◆ m_ev_range_max

int m_ev_range_max
private

Events up to ev_range_max will be counted in energy_sums and event_counts.

Setting time ranges means EclData will filter out excluded events in most of the data acquisition methods.

Definition at line 74 of file EclData.h.

◆ m_ev_range_min

int m_ev_range_min
private

Events from ev_range_min will be counted in energy_sums and event_counts.

Setting time ranges means EclData will filter out excluded events in most of the data acquisition methods.

Definition at line 70 of file EclData.h.

◆ m_time_range_max

int m_time_range_max
private

Time range (max) for display.

Setting time ranges means EclData will filter out excluded events in most of the data acquisition methods.

Definition at line 65 of file EclData.h.

◆ m_time_range_min

int m_time_range_min
private

Time range (min) for display.

Setting time ranges means EclData will filter out excluded events in most of the data acquisition methods.

Definition at line 62 of file EclData.h.

◆ ring_start_id

const int ring_start_id
staticprivate
Initial value:
= {
1, 49, 97, 161, 225, 289, 385, 481, 577, 673,
769, 865, 1009,
1153, 1297, 1441, 1585, 1729, 1873, 2017, 2161, 2305, 2449,
2593, 2737, 2881, 3025, 3169, 3313, 3457, 3601, 3745, 3889,
4033, 4177, 4321, 4465, 4609, 4753, 4897, 5041, 5185, 5329,
5473, 5617, 5761, 5905, 6049, 6193, 6337, 6481, 6625, 6769,
6913, 7057, 7201, 7345, 7489, 7633,
7777, 7921, 8065, 8161, 8257, 8353, 8449, 8545, 8609, 8673,
}
static int getCrystalCount()
Get number of crystals in ECL.
Definition: EclData.cc:148

First crystal id in the beginning of i-th ECL ring.

Taken from basf2/ecl/data/ecl_channels_map (two last columns)

Definition at line 89 of file EclData.h.


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