10#include <ecl/modules/eclDisplay/EclData.h>
13#include <ecl/dataobjects/ECLCalDigit.h>
14#include <ecl/dataobjects/ECLElementNumbers.h>
17#include <framework/logging/Logger.h>
27 1, 49, 97, 161, 225, 289, 385, 481, 577, 673,
30 1153, 1297, 1441, 1585, 1729, 1873, 2017, 2161, 2305, 2449,
31 2593, 2737, 2881, 3025, 3169, 3313, 3457, 3601, 3745, 3889,
32 4033, 4177, 4321, 4465, 4609, 4753, 4897, 5041, 5185, 5329,
33 5473, 5617, 5761, 5905, 6049, 6193, 6337, 6481, 6625, 6769,
34 6913, 7057, 7201, 7345, 7489, 7633,
36 7777, 7921, 8065, 8161, 8257, 8353, 8449, 8545, 8609, 8673,
43 m_tree =
new TTree(
"tree",
"tree");
83 m_tree =
new TTree(
"tree",
"tree");
103 for (
unsigned int i = 0; i < other.
m_event_entry.size(); i++) {
280 for (
int i = 0; i < 69; i++) {
290 for (
int i = 0; i < 69; i++) {
322 TFile* file =
new TFile(path,
"READ");
324 file->GetObject(
"tree", tree);
325 long nentries = tree->GetEntries();
327 tree->SetBranchAddress(
"ECLCalDigits.m_CellId", &
m_branch_ch);
329 tree->SetBranchAddress(
"ECLCalDigits.m_Time", &
m_branch_time);
335 leafCellId = tree->GetLeaf(
"ECLCalDigits.m_CellId");
336 leafEnergy = tree->GetLeaf(
"ECLCalDigits.m_Energy");
337 leafTimeFit = tree->GetLeaf(
"ECLCalDigits.m_Time");
339 for (
long i = 0; i < nentries; i++) {
342 const int len = leafCellId->GetLen();
351 for (
int j = 0; j < len; j++) {
358 B2DEBUG(10,
"Added event ECLCalDigits for crystal " <<
m_branch_ch);
383 end =
m_tree->GetEntries();
393 for (
int i = start; i < end; i++) {
405 if (m_branch_energy < m_en_range_min || m_branch_energy >
m_en_range_max)
425 B2DEBUG(250, end - start <<
" events handled.");
430 if (event->getEnergy() <= 0 || event->getCellId() <= 0) {
445 B2DEBUG(200,
"Added event #" << _evtn <<
", ch:" <<
m_branch_ch
466 end =
m_tree->GetEntries();
468 for (
int i = start; i < end; i++) {
490 end =
m_tree->GetEntries();
496 for (
int i = start; i < end; i++) {
502 if (energy_sum > 0) hist->Fill(energy_sum);
514 if (energy_sum > 0) hist->Fill(energy_sum);
530 end =
m_tree->GetEntries();
532 for (
int i = start; i < end; i++) {
536 if (m_branch_energy < m_en_range_min || m_branch_energy >
m_en_range_max)
Class to store calibrated ECLDigits: ECLCalDigits.
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
int addEvent(ECLCalDigit *event, int evtn)
Add ECLDigit event to inner TTree (m_tree).
int m_event_count_max
Max value in event_counts array.
TTree * m_tree
Tree with loaded events.
float m_energy_total
Total energy for last displayed range of events.
float * getEnergySumPerCrystal()
Alias for GetEnergySums()
float * getEnergySums()
Get array of total energy for each channel in the specified time and event range.
int m_time_range_min
Time range (min) for display.
int getThetaId(int ch)
ECL CellId -> theta_id.
int m_en_range_max
Upper boundary of energy threshold.
int m_branch_evtn
Tree event number branch.
int * getEventCounts()
Returns array of event counts per crystal[getCrystalsCount()].
int * getEventCountsPerCrystal()
Alias for GetEventCounts()
void initVariables()
Initialization of arrays.
int getPhiId(int ch)
ECL CellId -> phi_id.
int getChannel(int phi_id, int theta_id)
Converts (phi_id, theta_id) pair to ECL CellId.
void setEventRange(int ev_min, int ev_max, bool do_update=true)
Sets event range to (ev_min, ev_max)
void update(bool reset_event_ranges=false)
Update time_min, time_max, event_counts and energy_sums.
static const int ring_start_id[70]
First crystal id in the beginning of i-th ECL ring.
void cloneFrom(const EclData &other)
Clone attributes from other EclData.
void fillTimeHistogram(TH1F *hist, int time_min, int time_max, EclSubsystem subsys)
Fill time histogram for the specified EclSubsystem (Barrel, forward endcap, backward endcap,...
int * m_event_counts
Number of events for each crystal.
int m_ev_range_min
Events from ev_range_min will be counted in energy_sums and event_counts.
void initEventRanges()
Set initial values for time and event range.
void setTimeRange(int time_min, int time_max, bool do_update=true)
Display only events in the specified time range.
std::vector< int > m_event_entry
This vector holds the position of each entry which starts an event.
void includeChannel(int ch, bool do_update=false)
Includes specific channel in the count of events and energy.
int getTimeRangeMax()
Return max time in time range.
float * m_energy_sums
Sum of energies of every event captured by crystal (MeV).
int m_time_max
Maximum possible time.
void setEnergyThreshold(int en_min, int en_max, bool do_update=true)
Sets energy range to (en_min, en_max).
void fillEnergySumHistogram(TH1F *hist, int energy_min, int energy_max, EclSubsystem subsys)
Fill energy per event histogram for the specified EclSubsystem (Barrel, forward endcap,...
int m_last_event_id
Id of the event with max recorded event number (evtn).
double m_branch_energy
Tree energy branch.
void fillEnergyHistogram(TH1F *hist, int energy_min, int energy_max, EclSubsystem subsys)
Fill energy per channel histogram for the specified EclSubsystem (Barrel, forward endcap,...
static int getCrystalCount()
Get number of crystals in ECL.
int getTimeRangeMin()
Return min time in time range.
int m_branch_ch
Tree channel field.
int getEventRangeMax()
Return max event number to display.
std::set< int > m_excluded_ch
Channels which are filtered out from the count of events and energy.
double m_branch_time
Tree time branch.
bool isCrystalInSubsystem(int crystal, EclSubsystem subsys)
EclData & operator=(const EclData &other)
Assignment operator: utilizes copy constructor.
float m_energy_sums_max
Max value in m_energy_sums array.
int m_time_range_max
Time range (max) for display.
int getEventRangeMin()
Return min event number to display.
EclData()
Default constructor.
void excludeChannel(int ch, bool do_update=false)
Excludes specific channel from the count of events and energy.
void loadRootFile(const char *path)
Load root file containing ECLCalDigit data from the specified path.
int m_en_range_min
Lower boundary of energy threshold.
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
int m_ev_range_max
Events up to ev_range_max will be counted in energy_sums and event_counts.
TTree * getTree()
Returns data contained in EclDisplay.
bool isForward(int cellId)
Check whether the crystal is in forward ECL.
bool isBarrel(int cellId)
Check whether the crystal is in barrel ECL.
const int c_NCrystals
Number of crystals.
bool isBackward(int cellId)
Check whether the crystal is in backward ECL.
Abstract base class for different kinds of events.