Belle II Software  release-05-01-25
ECLBhabhaTCollectorModule Class Reference

This module generates time vs crystal 2D histograms to later (in eclBhabhaTAlgorithm) find time crystal/crate offsets from bhabha events. More...

#include <ECLBhabhaTCollectorModule.h>

Inheritance diagram for ECLBhabhaTCollectorModule:
Collaboration diagram for ECLBhabhaTCollectorModule:

Public Types

enum  EModulePropFlags {
  c_Input = 1,
  c_Output = 2,
  c_ParallelProcessingCertified = 4,
  c_HistogramManager = 8,
  c_InternalSerializer = 16,
  c_TerminateInAllProcesses = 32,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 ECLBhabhaTCollectorModule ()
 Module constructor.
 
virtual ~ECLBhabhaTCollectorModule ()
 Module destructor.
 
void inDefineHisto ()
 Replacement for defineHisto() in CalibrationCollector modules.
 
void prepare ()
 Define histograms and read payloads from DB.
 
void collect ()
 Select events and crystals and accumulate histograms. More...
 
void initialize () final
 Set up a default RunRange object in datastore and call prepare()
 
void event () final
 Check current experiment and run and update if needed, fill into RunRange and collect()
 
void beginRun () final
 Reset the m_runCollectOnRun flag, if necessary, to begin collection again. More...
 
void endRun () final
 Write the current collector objects to a file and clear their memory.
 
void terminate () final
 Write the final objects to the file.
 
void defineHisto () final
 Runs due to HistoManager, allows us to discover the correct file.
 
template<class T >
void registerObject (std::string name, T *obj)
 Register object with a name, takes ownership, do not access the pointer beyond prepare()
 
template<class T >
T * getObjectPtr (std::string name)
 Calls the CalibObjManager to get the requested stored collector data.
 
virtual std::vector< std::string > getFileNames (__attribute__((unused)) bool outputFiles)
 Return a list of output filenames for this modules. More...
 
const std::string & getName () const
 Returns the name of the module. More...
 
const std::string & getType () const
 Returns the type of the module (i.e. More...
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module. More...
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties. More...
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level. More...
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module. More...
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module. More...
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module. More...
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true. More...
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer). More...
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished. More...
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module. More...
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter. More...
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module. More...
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module. More...
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters. More...
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void startRun ()
 Replacement for beginRun(). Do anything you would normally do in beginRun here.
 
virtual void closeRun ()
 Replacement for endRun(). Do anything you would normally do in endRun here.
 
virtual void finish ()
 Replacement for terminate(). Do anything you would normally do in terminate here.
 
virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python. More...
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side. More...
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module. More...
 
void setType (const std::string &type)
 Set the module type. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module. More...
 
void setReturnValue (int value)
 Sets the return value for this module as integer. More...
 
void setReturnValue (bool value)
 Sets the return value for this module as bool. More...
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Protected Attributes

TDirectory * m_dir
 The top TDirectory that collector objects for this collector will be stored beneath.
 
CalibObjManager m_manager
 Controls the creation, collection and access to calibration objects.
 
RunRangem_runRange
 Overall list of runs processed.
 
Calibration::ExpRun m_expRun
 Current ExpRun for object retrieval (becomes -1,-1 for granularity=all)
 
StoreObjPtr< EventMetaDatam_emd
 Current EventMetaData.
 

Private Member Functions

bool getPreScaleChoice ()
 I'm a little worried about floating point precision when comparing to 0.0 and 1.0 as special values. More...
 
std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects. More...
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary. More...
 

Private Attributes

bool m_saveTree
 If true, save TTree with more detailed event info.
 
StoreArray< Tracktracks
 StoreArray for tracks.
 
StoreObjPtr< EventT0m_eventT0
 StoreObjPtr for T0. More...
 
DBObjPtr< ECLCrystalCalibm_ElectronicsDB
 electronics amplitude calibration from database Scale amplitudefor each crystal and for dead pre-amps More...
 
std::vector< float > m_Electronics
 vector obtained from DB object
 
DBObjPtr< ECLCrystalCalibm_ElectronicsTimeDB
 Time offset from electronics calibration from database. More...
 
std::vector< float > m_ElectronicsTime
 vector obtained from DB object
 
DBObjPtr< ECLCrystalCalibm_FlightTimeDB
 Time offset from flight time b/w IP and crystal from database. More...
 
std::vector< float > m_FlightTime
 vector obtained from DB object
 
DBObjPtr< ECLCrystalCalibm_PreviousCrystalTimeDB
 Time offset from previous crystal time calibration (this calibration) from database. More...
 
std::vector< float > m_PreviousCrystalTime
 vector obtained from DB object
 
std::vector< float > m_PreviousCrystalTimeUnc
 vector obtained from DB object
 
DBObjPtr< ECLCrystalCalibm_CrateTimeDB
 Time offset from crate time calibration (also this calibration) from database. More...
 
std::vector< float > m_CrateTime
 vector obtained from DB object
 
std::vector< float > m_CrateTimeUnc
 uncertainty vector obtained from DB object
 
TTree * m_dbgTree_electrons
 Output tree with detailed event data.
 
TTree * m_dbgTree_tracks
 
TTree * m_dbgTree_crystals
 
TTree * m_dbgTree_event
 
TTree * m_dbgTree_allCuts
 
TTree * m_dbgTree_evt_allCuts
 
TTree * m_dbgTree_crys_allCuts
 
int m_tree_evtNum
 Event number for debug TTree output.
 
int m_tree_cid
 ECL Cell ID (1..8736) for debug TTree output.
 
double m_tree_phi
 phi position for debug TTree output
 
double m_tree_theta
 theta position for debug TTree output
 
int m_tree_amp
 Fitting amplitude from ECL for debug TTree output.
 
double m_tree_en
 Energy of crystal with maximum energy within ECL cluster, GeV for debug TTree output.
 
double m_tree_E1Etot
 Energy of crystal with maximum energy within ECL cluster divided by total cluster energy, unitless for debug TTree output.
 
double m_tree_E1E2
 Energy of crystal with maximum energy within ECL cluster divided by second most energetic crystal in the cluster, unitless for debug TTree output.
 
double m_tree_E1p
 Energy of crystal with maximum energy within ECL cluster divided by total cluster energy divided by the track momentum, unitless for debug TTree output.
 
int m_tree_quality
 ECL fit quality for debug TTree output.
 
double m_tree_timeF
 ECL fitting time for debug TTree output.
 
double m_tree_time
 Time for Ts distribution for debug TTree output.
 
double m_tree_timetsPreviousTimeCalibs
 Time for Ts distribution after application of previous time calibrations for debug TTree output.
 
double m_tree_t0
 EventT0 (not from ECL) for debug TTree output.
 
double m_tree_t0_unc
 EventT0 uncertainty for debug TTree output.
 
double m_tree_t0_ECLclosestCDC
 EventT0 (from ECL) closest to CDC for debug TTree output.
 
double m_tree_t0_ECL_minChi2
 EventT0 (from ECL) min chi2 for debug TTree output.
 
double m_tree_d0
 
double m_tree_z0
 Track d0 for debug TTree output.
 
double m_tree_p
 Track z0 for debug TTree output.
 
double m_tree_nCDChits
 Track momentum for debug TTree output.
 
double m_tree_clustCrysE_DIV_maxEcrys
 Number of CDC hits along the track for debug TTree output.
 
double m_tree_clustCrysE
 ratio of crystal energy to energy of the crystal that has the maximum energy, only for the crystals that meet all the selection criteria for debug TTree output
 
double m_tree_enPlus
 crystal energy, only for the crystals that meet all the selection criteria for debug TTree output More...
 
double m_tree_enNeg
 Energy of cluster associated to negatively charged track, GeV for debug TTree output.
 
double m_tree_tClustPos
 Cluster time of cluster associated to positively charged track, ns for debug TTree output.
 
double m_tree_tClustNeg
 Cluster time of cluster associated to negatively charged track, ns for debug TTree output.
 
double m_tree_maxEcrystPosClust
 Time of the highest energy crystal in the cluster associated to positively charged track, ns for debug TTree output.
 
double m_tree_maxEcrystNegClust
 Time of the highest energy crystal in the cluster associated to negatively charged track, ns for debug TTree output.
 
double m_tree_tClust
 Cluster time of a cluster, ns for debug TTree output.
 
double m_tree_ECLCalDigitTime
 Time of an ECLCalDigit within a cluster, ns for debug TTree output.
 
double m_tree_ECLCalDigitE
 Energy of an ECLCalDigit within a cluster, GeV for debug TTree output.
 
double m_tree_ECLDigitAmplitude
 Amplitude (used to calculate energy) of an ECLDigit within a cluster, for debug TTree output.
 
int m_charge
 particle charge, for debug TTree output
 
double m_E_DIV_p
 Energy divided by momentum, for debug TTree output.
 
double m_massInvTracks
 invariant mass of the two tracks, for debug TTree output
 
StoreArray< ECLDigitm_eclDigitArray
 Required input array of ECLDigits.
 
StoreArray< ECLCalDigitm_eclCalDigitArray
 Required input array of ECLCalDigits.
 
StoreArray< ECLClusterm_eclClusterArray
 Required input array of ECLClusters.
 
std::vector< float > m_EperCrys
 ECL digit energy for each crystal.
 
std::vector< int > m_eclCalDigitID
 ECL cal digit id sorter.
 
std::vector< int > m_eclDigitID
 ECL digit id sorter.
 
short m_timeAbsMax
 Events with abs(time) > m_timeAbsMax are excluded, mostly for histogram x-range purposes.
 
int m_minCrystal
 First CellId to handle.
 
int m_maxCrystal
 Last CellId to handle.
 
double m_looseTrkZ0
 
double m_tightTrkZ0
 
double m_looseTrkD0
 
double m_tightTrkD0
 
int m_crystalCrate
 Crate id for the crystal.
 
int m_runNum
 run number
 
bool m_storeCalib = true
 Boolean for whether or not to store the previous calibration calibration constants.
 
std::unique_ptr< Belle2::ECL::ECLTimingUtilitiesm_ECLTimeUtil
 ECL timing tools. More...
 
double m_energyDependenceTimeOffsetFitParam_p1 = 0
 p1 in "energy dependence equation"
 
double m_energyDependenceTimeOffsetFitParam_p2 = 88449.
 p2 in "energy dependence equation"
 
double m_energyDependenceTimeOffsetFitParam_p3 = 0.20867E+06
 p3 in "energy dependence equation"
 
double m_energyDependenceTimeOffsetFitParam_p4 = 3.1482
 p4 in "energy dependence equation"
 
double m_energyDependenceTimeOffsetFitParam_p5 = 7.4747
 p5 in "energy dependence equation"
 
double m_energyDependenceTimeOffsetFitParam_p6 = 1279.3
 p6 in "energy dependence equation"
 
std::string m_granularity
 Granularity of data collection = run|all(= no granularity, exp,run=-1,-1)
 
int m_maxEventsPerRun
 Maximum number of events to be collected at the start of each run (-1 = no maximum)
 
float m_preScale
 Prescale module parameter, this fraction of events will have collect() run on them [0.0 -> 1.0].
 
StoreObjPtr< EventMetaDatam_evtMetaData
 Required input for EventMetaData.
 
bool m_runCollectOnRun = true
 Whether or not we will run the collect() at all this run, basically skips the event() function if false.
 
std::map< Calibration::ExpRun, int > m_expRunEvents
 How many events processed for each ExpRun so far, stops counting up once max is hit Only used/incremented if m_maxEventsPerRun > -1.
 
int * m_eventsCollectedInRun
 Will point at correct value in m_expRunEvents.
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

This module generates time vs crystal 2D histograms to later (in eclBhabhaTAlgorithm) find time crystal/crate offsets from bhabha events.

Definition at line 45 of file ECLBhabhaTCollectorModule.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 79 of file Module.h.

Member Function Documentation

◆ beginRun()

void beginRun ( )
finalvirtualinherited

Reset the m_runCollectOnRun flag, if necessary, to begin collection again.

It seems that the beginRun() function is called in each basf2 subprocess when the run changes in each process. This is nice because it allows us to write the new (exp,run) object creation in the beginRun function as though the other processes don't exist.

Reimplemented from HistoModule.

Definition at line 70 of file CalibrationCollectorModule.cc.

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 181 of file Module.cc.

◆ collect()

void collect ( )
virtual

Select events and crystals and accumulate histograms.

< vector derived from DB object

Record the input database constants for the first call

< number of loose tracks

< number of tight tracks

Reimplemented from CalibrationCollectorModule.

Definition at line 324 of file ECLBhabhaTCollectorModule.cc.

325 {
326  int cutIndexPassed = 0;
327  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
328  B2DEBUG(10, "Cutflow: no cuts: index = " << cutIndexPassed);
329 
330 
331  /* Use ECLChannelMapper to get other detector indices for the crystals */
332  /* For conversion from CellID to crate, shaper, and channel ids. */
333 
334  // Use smart pointer to avoid memory leak when the ECLChannelMapper object needs destroying at the end of the event.
335  shared_ptr< ECL::ECLChannelMapper > crystalMapper(new ECL::ECLChannelMapper());
336  crystalMapper->initFromDB();
337 
338  //== Get expected energies and calibration constants from DB. Need to call
339  // hasChanged() for later comparison
340  if (m_ElectronicsDB.hasChanged()) {
341  m_Electronics = m_ElectronicsDB->getCalibVector();
342  }
343  if (m_ElectronicsTimeDB.hasChanged()) {
344  m_ElectronicsTime = m_ElectronicsTimeDB->getCalibVector();
345  }
346  if (m_FlightTimeDB.hasChanged()) {
347  m_FlightTime = m_FlightTimeDB->getCalibVector();
348  }
349 
350  // Get the previous crystal time offset (the same thing that this calibration is meant to calculate).
351  // This can be used for testing purposes, and for the crate time offset.
352  if (m_PreviousCrystalTimeDB.hasChanged()) {
354  m_PreviousCrystalTimeUnc = m_PreviousCrystalTimeDB->getCalibUncVector();
355  }
356 
357  B2DEBUG(35, "Finished checking if previous crystal time payload has changed");
358  if (m_CrateTimeDB.hasChanged()) {
359  m_CrateTime = m_CrateTimeDB->getCalibVector();
360  m_CrateTimeUnc = m_CrateTimeDB->getCalibUncVector();
361  }
362  B2DEBUG(35, "Finished checking if previous crate time payload has changed");
363  B2DEBUG(35, "m_CrateTime size = " << m_CrateTime.size());
364  B2DEBUG(29, "Crate time +- uncertainty [0]= " << m_CrateTime[0] << " +- " << m_CrateTimeUnc[0]);
365  B2DEBUG(29, "Crate time +- uncertainty [8735]= " << m_CrateTime[8735] << " +- " << m_CrateTimeUnc[8735]);
366 
367 
368  // Conversion coefficient from ADC ticks to nanoseconds
369  // TICKS_TO_NS ~ 0.4931 ns/clock tick
370  // 1/(4fRF) = 0.4913 ns/clock tick, where fRF is the accelerator RF frequency, fRF=508.889 MHz.
371  const double TICKS_TO_NS = 1.0 / (4.0 * EclConfiguration::m_rf) * 1e3;
372 
373 
374  vector<float> Crate_time_ns(52, 0.0);
376  // Make a crate time offset vector with an entry per crate (instead of per crystal) and convert from ADC counts to ns.
377  for (int crysID = 1; crysID <= 8736; crysID++) {
378  int crateID_temp = crystalMapper->getCrateID(crysID);
379  Crate_time_ns[crateID_temp - 1] = m_CrateTime[crysID] * TICKS_TO_NS;
380  }
381 
382 
384  if (m_storeCalib) {
385  for (int crysID = 0; crysID < 8736; crysID++) {
386  getObjectPtr<TH1F>("TsDatabase")->Fill(crysID + 0.001, m_PreviousCrystalTime[crysID]);
387  getObjectPtr<TH1F>("TsDatabaseUnc")->Fill(crysID + 0.001, m_PreviousCrystalTimeUnc[crysID]);
388  getObjectPtr<TH1F>("TcrateDatabase")->Fill(crysID + 0.001, m_CrateTime[crysID]);
389  getObjectPtr<TH1F>("TcrateUncDatabase")->Fill(crysID + 0.001, m_CrateTimeUnc[crysID]);
390 
391  B2INFO("cid = " << crysID + 1 << ", Ts previous = " << m_PreviousCrystalTime[crysID]);
392  }
393 
394  for (int crateID_temp = 1; crateID_temp <= 52; crateID_temp++) {
395  getObjectPtr<TH1F>("tcrateDatabase_ns")->Fill(crateID_temp + 0.001, Crate_time_ns[crateID_temp - 1]);
396  }
397 
398  // Use a histogram with only one bin as a counter to know the number of times the database histograms were filled.
399  // This is mostly useful for the talg when running over multiple runs and trying to read ts values.
400  getObjectPtr<TH1F>("databaseCounter")->Fill(1.001, 1);
401 
402  m_storeCalib = false;
403  }
404 
405 
406  /* Getting the event t0 using the full event t0 rather than from the CDC specifically */
407  double evt_t0 = -1;
408  double evt_t0_unc = -1;
409  double evt_t0_ECL_closestCDC = -1;
410  double evt_t0_ECL_minChi2 = -1;
411 
412  // Determine if there is an event t0 to use and then extract the information about it
413  if (!m_eventT0.isValid()) {
414  //cout << "event t0 not valid\n";
415  return;
416  } else if (!m_eventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
417  //cout << "no event t0\n";
418  return;
419  } else {
420  // Event has a t0 from CDC
421  cutIndexPassed++;
422  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
423  B2DEBUG(10, "Cutflow: Event t0 exists: index = " << cutIndexPassed);
424 
425 
426  // Get event t0 from CDC. We don't want event t0 from ECL as we are calibrating the ECL wrt the more accurately measured time measurements of the time. Start with the CDC since it has an event t0 but in the future we may switch to the TOP detector.
427  // Based on the information from Thomas Hauth <Thomas.Hauth@kit.edu> (leaving physics) we should take the last event t0 in the list of event t0's from the CDC as the later event t0 measurements are calculated in slower but more accurate ways.
428  vector<EventT0::EventT0Component> evt_t0_list = m_eventT0->getTemporaryEventT0s(Const::EDetector::CDC);
429  evt_t0 = evt_t0_list.back().eventT0; // time value
430  evt_t0_unc = evt_t0_list.back().eventT0Uncertainty; // uncertainty on event t0
431 
432 
433  // Get the ECL event t0 for comparison - validations
434  if (m_eventT0->hasTemporaryEventT0(Const::EDetector::ECL)) {
435  vector<EventT0::EventT0Component> evt_t0_list_ECL = m_eventT0->getTemporaryEventT0s(Const::EDetector::ECL);
436 
437 
438  double smallest_CDC_ECL_t0_diff = fabs(evt_t0_list_ECL[0].eventT0 - evt_t0);
439  int smallest_CDC_ECL_t0_diff_idx = 0;
440  for (long unsigned int ECLi = 0; ECLi < evt_t0_list_ECL.size(); ECLi++) {
441  double tempt_ECL_t0 = evt_t0_list_ECL[ECLi].eventT0;
442  if (fabs(tempt_ECL_t0 - evt_t0) < smallest_CDC_ECL_t0_diff) {
443  smallest_CDC_ECL_t0_diff = fabs(tempt_ECL_t0 - evt_t0);
444  smallest_CDC_ECL_t0_diff_idx = ECLi;
445  }
446  }
447 
448  evt_t0_ECL_closestCDC = evt_t0_list_ECL[smallest_CDC_ECL_t0_diff_idx].eventT0; // time value
449  B2DEBUG(30, "evt_t0_ECL_closestCDC = " << evt_t0_ECL_closestCDC);
450 
451 
452 
453  double smallest_ECL_t0_minChi2 = evt_t0_list_ECL[0].quality;
454  int smallest_ECL_t0_minChi2_idx = 0;
455 
456  B2DEBUG(30, "evt_t0_list_ECL[0].quality = " << evt_t0_list_ECL[0].quality
457  << ", with ECL event t0 = " << evt_t0_list_ECL[0].eventT0);
458 
459  for (long unsigned int ECLi = 0; ECLi < evt_t0_list_ECL.size(); ECLi++) {
460  B2DEBUG(30, "evt_t0_list_ECL[" << ECLi << "].quality = " << evt_t0_list_ECL[ECLi].quality
461  << ", with ECL event t0 = " <<
462  evt_t0_list_ECL[ECLi].eventT0);
463  if (evt_t0_list_ECL[ECLi].quality < smallest_ECL_t0_minChi2) {
464  smallest_ECL_t0_minChi2 = evt_t0_list_ECL[ECLi].quality;
465  smallest_ECL_t0_minChi2_idx = ECLi;
466  }
467  }
468 
469  evt_t0_ECL_minChi2 = evt_t0_list_ECL[smallest_ECL_t0_minChi2_idx].eventT0; // time value
470 
471  B2DEBUG(30, "evt_t0_ECL_minChi2 = " << evt_t0_ECL_minChi2);
472  B2DEBUG(30, "smallest_ECL_t0_minChi2_idx = " << smallest_ECL_t0_minChi2_idx);
473  }
474  }
475 
476 
477 
478  /* Determine the energies for each of the crystals since this isn't naturally connected to the cluster.
479  Also determine the indexing of the ecl cal digits and the ecl digits
480  Taken from Chris's ec/modules/eclGammaGammaECollector */
481 
482  // Resize vectors
483  m_EperCrys.resize(8736);
484  m_eclCalDigitID.resize(8736);
485  m_eclDigitID.resize(8736);
486 
487 
488  int idx = 0;
489  for (auto& eclCalDigit : m_eclCalDigitArray) {
490  int tempCrysID = eclCalDigit.getCellId() - 1;
491  m_EperCrys[tempCrysID] = eclCalDigit.getEnergy();
492  m_eclCalDigitID[tempCrysID] = idx;
493  idx++;
494  }
495 
496  idx = 0;
497  for (auto& eclDigit : m_eclDigitArray) {
498  int tempCrysID = eclDigit.getCellId() - 1;
499  m_eclDigitID[tempCrysID] = idx;
500  idx++;
501  }
502 
503 
504 
505 
506  //---------------------------------------------------------------------
507  //..Some utilities
508  ClusterUtils cUtil;
509  const TVector3 clustervertex = cUtil.GetIPPosition();
510  PCmsLabTransform boostrotate;
511 
512  //---------------------------------------------------------------------
513  //..Track properties, including 2 maxp tracks. Use pion (211) mass hypothesis,
514  // which is the only particle hypothesis currently available???
515  double maxp[2] = {0., 0.};
516  int maxiTrk[2] = { -1, -1};
517  int nTrkAll = tracks.getEntries();
518 
519  int nTrkLoose = 0;
520  int nTrkTight = 0;
522  /* Loop over all the tracks to define the tight and loose selection tracks.
523  We will select events with only 2 tight tracks and no additional loose tracks.
524  Tight tracks are a subset of looses tracks. */
525  for (int iTrk = 0; iTrk < nTrkAll; iTrk++) {
526  // Get track and assume it is a pion for now ... because it is the only particle we can assume?
527  const TrackFitResult* tempTrackFit = tracks[iTrk]->getTrackFitResult(Const::ChargedStable(211));
528  if (not tempTrackFit) {continue;}
529 
530  // Collect track info to be used for categorizing
531  short charge = tempTrackFit->getChargeSign();
532  double z0 = tempTrackFit->getZ0();
533  double d0 = tempTrackFit->getD0();
534  int nCDChits = tempTrackFit->getHitPatternCDC().getNHits();
535  double p = tempTrackFit->getMomentum().Mag();
536 
537  // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
538  //== Save debug TTree with detailed information if necessary.
539  m_tree_d0 = d0;
540  m_tree_z0 = z0;
541  m_tree_p = p;
542  m_charge = charge;
543  m_tree_nCDChits = nCDChits;
544 
545  if (m_saveTree) {
546  m_dbgTree_tracks->Fill();
547  }
548  //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
549 
550 
551  /* Test if loose track */
552 
553  // d0 and z0 cuts
554  if (abs(d0) > m_looseTrkD0) {
555  continue;
556  }
557  if (abs(z0) > m_looseTrkZ0) {
558  continue;
559  }
560  // Number of hits in the CDC
561  if (nCDChits < 1) {
562  continue;
563  }
564  nTrkLoose++;
565 
566 
567 
568  /* Test if the loose track is also a tight track */
569 
570  // Number of hits in the CDC
571  if (nCDChits < 20) {
572  continue;
573  }
574 
575 
576  // d0 and z0 cuts
577  if (abs(d0) > m_tightTrkD0) {
578  continue;
579  }
580  if (abs(z0) > m_tightTrkZ0) {
581  continue;
582  }
583  nTrkTight++;
584 
585  // Sorting of tight tracks. Not really required as we only want two tight tracks (at the moment) but okay.
586  //..Find the maximum p negative [0] and positive [1] tracks
587  int icharge = 0;
588  if (charge > 0) {icharge = 1;}
589  if (p > maxp[icharge]) {
590  maxp[icharge] = p;
591  maxiTrk[icharge] = iTrk;
592  }
593 
594  }
595  /* After that last section the numbers of loose and tight tracks are known as well as the
596  index of the loose tracks that have the highest p negatively charged and highest p positively
597  charged tracks as measured in the centre of mass frame */
598 
599 
600  if (nTrkTight != 2) {
601  return;
602  }
603  // There are exactly two tight tracks
604  cutIndexPassed++;
605  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
606  B2DEBUG(10, "Cutflow: Two tight tracks: index = " << cutIndexPassed);
607 
608 
609  if (nTrkLoose != 2) {
610  return;
611  }
612  // There are exactly two loose tracks as well, i.e. no additional loose tracks
613  cutIndexPassed++;
614  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
615  B2DEBUG(10, "Cutflow: No additional loose tracks: index = " << cutIndexPassed);
616 
617  /* Determine if the two tracks have the opposite electric charge.
618  We know this because the track indices stores the max pt track in [0] for negatively charged track
619  and [1] fo the positively charged track. If both are filled then both a negatively charged
620  and positively charged track were found. */
621  bool oppositelyChargedTracksPassed = maxiTrk[0] != -1 && maxiTrk[1] != -1;
622  if (!oppositelyChargedTracksPassed) {
623  return;
624  }
625  // The two tracks have the opposite electric charges.
626  cutIndexPassed++;
627  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
628  B2DEBUG(10, "Cutflow: Oppositely charged tracks: index = " << cutIndexPassed);
629 
630 
631 
632 
633  //---------------------------------------------------------------------
634  /* Determine associated energy clusters to each of the two tracks. Sum the energies of the
635  multiple clusters to each track and find the crystal with the maximum energy within all
636  the sets of clusters associated to the tracks*/
637  double trkEClustLab[2] = {0., 0.};
638  double trkEClustCOM[2] = {0., 0.};
639  double trkpLab[2];
640  double trkpCOM[2];
641  //double trkThetaLab[2];
642  TLorentzVector trkp4Lab[2];
643  TLorentzVector trkp4COM[2];
644 
645  // Index of the cluster and the crystal that has the highest energy crystal for the two tracks
646  int crysIDMax[2] = { -1, -1 };
647  double crysEMax[2] = { -1, -1 };
648  double crysE2Max[2] = { -1, -1 };
649  int numClustersPerTrack[2] = { 0, 0 };
650 
651  double clusterTime[2] = {0, 0};
652 
653  double E_DIV_p[2];
654 
655  vector<double> time_ECLCaldigits_bothClusters;
656  vector<int> cid_ECLCaldigits_bothClusters;
657  vector<double> E_ECLCaldigits_bothClusters;
658  vector<double> amp_ECLDigits_bothClusters;
659  vector<int> chargeID_ECLCaldigits_bothClusters;
660 
661  for (int icharge = 0; icharge < 2; icharge++) {
662  if (maxiTrk[icharge] > -1) {
663  B2DEBUG(10, "looping over the 2 max pt tracks");
664 
665  const TrackFitResult* tempTrackFit = tracks[maxiTrk[icharge]]->getTrackFitResult(Const::ChargedStable(211));
666  trkp4Lab[icharge] = tempTrackFit->get4Momentum();
667  trkp4COM[icharge] = boostrotate.rotateLabToCms() * trkp4Lab[icharge];
668  trkpLab[icharge] = trkp4Lab[icharge].Rho();
669  trkpCOM[icharge] = trkp4COM[icharge].Rho();
670 
671 
672  /* For each cluster associated to the current track, sum up the energies to get the total
673  energy of all clusters associated to the track and find which crystal has the highest
674  energy from all those clusters*/
675  auto eclClusterRelationsFromTracks = tracks[maxiTrk[icharge]]->getRelationsTo<ECLCluster>();
676  for (unsigned int clusterIdx = 0; clusterIdx < eclClusterRelationsFromTracks.size(); clusterIdx++) {
677 
678  B2DEBUG(10, "Looking at clusters. index = " << clusterIdx);
679  auto cluster = eclClusterRelationsFromTracks[clusterIdx];
680  bool goodClusterType = false;
681 
682  if (cluster->hasHypothesis(Belle2::ECLCluster::EHypothesisBit::c_nPhotons)) {
683  trkEClustLab[icharge] += cluster->getEnergy(Belle2::ECLCluster::EHypothesisBit::c_nPhotons);
684  goodClusterType = true;
685  numClustersPerTrack[icharge]++;
686  }
687 
688  if (goodClusterType) {
689 
690  clusterTime[icharge] = cluster->getTime();
691 
692  auto eclClusterRelations = cluster->getRelationsTo<ECLCalDigit>("ECLCalDigits");
693 
694  // Find the crystal that has the largest energy
695  for (unsigned int ir = 0; ir < eclClusterRelations.size(); ir++) {
696  const auto calDigit = eclClusterRelations.object(ir);
697  int tempCrysID = calDigit->getCellId() - 1;
698  double tempE = m_EperCrys[tempCrysID];
699 
700  int eclDigitIndex = m_eclDigitID[tempCrysID];
701  ECLDigit* ecl_dig = m_eclDigitArray[eclDigitIndex];
702 
703  // for the max E crystal
704  if (tempE > crysEMax[icharge]) {
705  // Set 2nd highest E crystal to the info from the highest E crystal
706  crysE2Max[icharge] = crysEMax[icharge];
707  // Set the highest E crystal to the current crystal
708  crysEMax[icharge] = tempE;
709  crysIDMax[icharge] = tempCrysID;
710  }
711  // for the 2nd highest E crystal
712  if (tempE > crysE2Max[icharge] && tempCrysID != crysIDMax[icharge]) {
713  crysE2Max[icharge] = tempE;
714  }
715 
716 
717  B2DEBUG(30, "calDigit(ir" << ir << ") time = " << calDigit->getTime() << "ns , with E = " << tempE << " GeV");
718  time_ECLCaldigits_bothClusters.push_back(calDigit->getTime());
719  cid_ECLCaldigits_bothClusters.push_back(tempCrysID);
720  E_ECLCaldigits_bothClusters.push_back(tempE);
721  amp_ECLDigits_bothClusters.push_back(ecl_dig->getAmp());
722  chargeID_ECLCaldigits_bothClusters.push_back(icharge);
723 
724  }
725  }
726  }
727  trkEClustCOM[icharge] = trkEClustLab[icharge] * trkpCOM[icharge] / trkpLab[icharge];
728 
729  // Send to the histogram the number of photon clusters associated to the track
730  getObjectPtr<TH1F>("numPhotonClustersPerTrack")->Fill(numClustersPerTrack[icharge]);
731 
732 
733  // Check both electrons to see if their cluster energy / track momentum is good.
734  // The Belle II physics book shows that this is the main way of separating electrons from other particles
735  // Done in the centre of mass reference frame although I believe E/p is invariant under a boost.
736  E_DIV_p[icharge] = trkEClustCOM[icharge] / trkpCOM[icharge];
737 
738  }
739  }
740  /* At the end of this section the 3-momenta magnitudes and the cluster energies are known
741  for the two saved track indices for both the lab and COM frames.
742  The crystal with the maximum energy, one associated to each track, is recorded*/
743 
744 
745 
746  //=== Check each crystal in the processed event and fill histogram.
747 
748  int cid;
749  double time;
750  int numCrystalsPassingCuts = 0;
751 
752  int crystalIDs[2] = { -1, -1};
753  int crateIDs[2] = { -1, -1};
754  double ts_prevCalib[2] = { -1, -1};
755  double tcrate_prevCalib[2] = { -1, -1};
756  double times_noPreviousCalibrations[2] = { -1, -1};
757  bool crystalCutsPassed[2] = {false, false};
758  double crystalEnergies[2] = { -1, -1};
759  double crystalEnergies2[2] = { -1, -1};
760 
761  for (int iCharge = 0; iCharge < 2; iCharge++) {
762  int crystal_idx = crysIDMax[iCharge];
763  int eclCalDigitIndex = m_eclCalDigitID[crystal_idx];
764  int eclDigitIndex = m_eclDigitID[crystal_idx];
765 
766  ECLDigit* ecl_dig = m_eclDigitArray[eclDigitIndex];
767  ECLCalDigit* ecl_cal = m_eclCalDigitArray[eclCalDigitIndex];
768 
769  //== Check whether specific ECLDigits should be excluded.
770 
771  auto en = ecl_cal->getEnergy();
772  auto amplitude = ecl_dig->getAmp();
773  crystalEnergies[iCharge] = en;
774 
775  cid = ecl_dig->getCellId();
776  time = ecl_dig->getTimeFit() * TICKS_TO_NS - evt_t0;
777 
778  // Offset time by electronics calibration and flight time calibration.
779  time -= m_ElectronicsTime[cid - 1] * TICKS_TO_NS;
780  time -= m_FlightTime[cid - 1];
781 
782 
783  // Apply the time walk correction: time shift as a function of the amplitude corrected by the electronics calibration.
784  // The electronics calibration also accounts for crystals that have a dead pre-amp and thus half the normal amplitude.
785  double energyTimeShift = m_ECLTimeUtil->energyDependentTimeOffsetElectronic(amplitude * m_Electronics[cid - 1]) * TICKS_TO_NS;
786 
787  B2DEBUG(35, "cellid = " << cid << ", amplitude = " << amplitude << ", time before t(E) shift = " << time <<
788  ", t(E) shift = " << energyTimeShift << " ns");
789  time -= energyTimeShift;
790 
791 
792  // Cell ID should be within specified range.
793  if (cid < m_minCrystal || cid > m_maxCrystal) continue;
794 
795  // Absolute time should be in specified range condition.
796  if (fabs(time) > m_timeAbsMax) continue;
797 
798  // Fit quality flag -- choose only events with best fit quality
799  if (ecl_dig->getQuality() != 0) continue;
800 
801  //== Save time and crystal information. Fill plot after both electrons are tested
802  crystalIDs[iCharge] = cid;
803  crateIDs[iCharge] = crystalMapper->getCrateID(ecl_cal->getCellId());
804 
805 
806  ts_prevCalib[iCharge] = m_PreviousCrystalTime[cid - 1] * TICKS_TO_NS;
807  tcrate_prevCalib[iCharge] = m_CrateTime[cid - 1] * TICKS_TO_NS;
808  times_noPreviousCalibrations[iCharge] = time;
809 
810 
811  B2DEBUG(30, "iCharge = " << iCharge);
812  B2DEBUG(30, "crateIDs[iCharge] = " << crateIDs[iCharge]);
813  B2DEBUG(30, "times_noPreviousCalibrations[iCharge] = " << times_noPreviousCalibrations[iCharge]);
814  B2DEBUG(30, "tcrate_prevCalib[iCharge] = " << tcrate_prevCalib[iCharge]);
815  B2DEBUG(30, "ts_prevCalib[iCharge] = " << ts_prevCalib[iCharge]);
816 
817 
818  crystalCutsPassed[iCharge] = true;
819 
820 
821  // For second most energetic energy crystal
822  crystalEnergies2[iCharge] = crysE2Max[iCharge];
823 
824 
825 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Tree saving
826  //== Save debug TTree with detailed information if necessary.
827  StoreObjPtr<EventMetaData> evtMetaData;
828 
829  m_tree_cid = ecl_dig->getCellId();
830  m_tree_amp = ecl_dig->getAmp();
831  m_tree_en = en;
832  m_tree_E1Etot = en / trkEClustLab[iCharge];
833  m_tree_E1E2 = en / crystalEnergies2[iCharge];
834  m_tree_E1p = en / trkpLab[iCharge];
835  m_tree_timetsPreviousTimeCalibs = time - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge];
836  m_tree_timeF = ecl_dig->getTimeFit() * TICKS_TO_NS;
837  m_tree_time = time;
838  m_tree_quality = ecl_dig->getQuality();
839  m_tree_t0 = evt_t0;
840  m_tree_t0_unc = evt_t0_unc;
841  m_E_DIV_p = E_DIV_p[iCharge];
842  m_tree_evtNum = evtMetaData->getEvent();
843  m_crystalCrate = crystalMapper->getCrateID(ecl_cal->getCellId());
844  m_runNum = evtMetaData->getRun();
845 
846  if (m_saveTree) {
847  m_dbgTree_electrons->Fill();
848  }
849 // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Tree saving
850 
851  // Fill histogram with information about maximum energy crystal energy fraction
852  getObjectPtr<TH1F>("maxEcrsytalEnergyFraction")->Fill(en / trkEClustLab[iCharge]);
853 
854 
855  }
856 
857 
858 
859  // Check both electrons to see if their cluster energy / track momentum is good.
860  // The Belle II physics book shows that this is the main way of separating electrons from other particles
861  // Done in the centre of mass reference frame although I believe E/p is invariant under a boost.
862  bool E_DIV_p_instance_passed[2] = {false, false};
863  double E_DIV_p_CUT = 0.7;
864  for (int icharge = 0; icharge < 2; icharge++) {
865  E_DIV_p_instance_passed[icharge] = E_DIV_p[icharge] > E_DIV_p_CUT;
866  }
867  if (!E_DIV_p_instance_passed[0] || !E_DIV_p_instance_passed[1]) {
868  return;
869  }
870  // E/p sufficiently large
871  cutIndexPassed++;
872  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
873  B2DEBUG(10, "Cutflow: E_i/p_i > " << E_DIV_p_CUT << ": index = " << cutIndexPassed);
874 
875 
876 
877 
878 
879 
880  // Now find energy clusters independently of the tracks
881  //------------------------------------------------------------------------
882 
883  vector<double> goodClusters_E;
884 
885 
886 
887 
888  double clusterE_minCut = 0.06; // GeV
889  int nclust = m_eclClusterArray.getEntries();
890  int nGoodClusts = 0;
891  vector<int> goodPhotonClusterIdxs;
892  vector<int> goodECLClusterIds;
893  for (int ic = 0; ic < nclust; ic++) {
896  if (eClust > clusterE_minCut) {
897  goodPhotonClusterIdxs.push_back(ic);
898  goodECLClusterIds.push_back(m_eclClusterArray[ic]->getClusterId());
899  nGoodClusts++;
900  }
901  }
902  }
903 
904  int numTrackless = 0;
905  for (int clustId = 0; clustId < 2; clustId++) {
906  B2DEBUG(30, "m_eclClusterArray[goodPhotonClusterIdxs[clustId]]->isTrack() = " <<
907  m_eclClusterArray[goodPhotonClusterIdxs[clustId]]->isTrack());
908  if (!m_eclClusterArray[goodPhotonClusterIdxs[clustId]]->isTrack()) {
909  numTrackless++;
910  }
911  }
912  if (numTrackless != 0) {
913  B2DEBUG(20, "Number of trackless ECL clusters != 0");
914  }
915 
916  // There are exactly three energy clusters
917  cutIndexPassed++;
918  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
919  B2DEBUG(10, "Cutflow: ECL cluster associated to photon does not have a track associated to it: index = " << cutIndexPassed);
920  B2DEBUG(10, "Cutflow: NEW CUT TO BHABHA CODE FROM eegamma code");
921 
922 
923 
924 
925 
926  // Start of cuts on both the combined system of tracks and energy clusters
927 
928  double invMassTrk = (trkp4Lab[0] + trkp4Lab[1]).M();
929  double invMass_CUT = 0.9;
930  m_massInvTracks = invMassTrk; // invariant mass of the two tracks
931 
932 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Tree saving
933  if (m_saveTree) {
934  m_dbgTree_event->Fill();
935  }
936 // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Tree saving
937 
938  bool invMassCutsPassed = invMassTrk > (invMass_CUT * boostrotate.getCMSEnergy());
939  if (!invMassCutsPassed) {
940  return;
941  }
942  // Invariable mass of the two tracks are above the minimum
943  cutIndexPassed++;
944  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
945  B2DEBUG(10, "Cutflow: m(track 1+2) > " << invMass_CUT << "*E_COM = " << invMass_CUT << " * " << boostrotate.getCMSEnergy() <<
946  " : index = " << cutIndexPassed);
947 
948 
949 
950  //== Fill output histogram.
951  for (int iCharge = 0; iCharge < 2; iCharge++) {
952  if (crystalCutsPassed[iCharge]) {
953  getObjectPtr<TH2F>("TimevsCrysPrevCrateCalibPrevCrystCalib")->Fill((crystalIDs[iCharge] - 1) + 0.001,
954  times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge] , 1);
955  getObjectPtr<TH2F>("TimevsCratePrevCrateCalibPrevCrystCalib")->Fill((crateIDs[iCharge]) + 0.001,
956  times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge], 1);
957  getObjectPtr<TH2F>("TimevsCrysNoCalibrations")->Fill((crystalIDs[iCharge] - 1) + 0.001, times_noPreviousCalibrations[iCharge], 1);
958  getObjectPtr<TH2F>("TimevsCrateNoCalibrations")->Fill((crateIDs[iCharge]) + 0.001, times_noPreviousCalibrations[iCharge], 1);
959  getObjectPtr<TH2F>("TimevsCrysPrevCrateCalibNoCrystCalib")->Fill((crystalIDs[iCharge] - 1) + 0.001,
960  times_noPreviousCalibrations[iCharge] - tcrate_prevCalib[iCharge], 1);
961  getObjectPtr<TH2F>("TimevsCrateNoCrateCalibPrevCrystCalib")->Fill((crateIDs[iCharge]) + 0.001,
962  times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] , 1);
963 
964  getObjectPtr<TH1F>("numEntriesPerCrystal")->Fill((crystalIDs[iCharge] - 1) + 0.001);
965 
966  // Record number of crystals used from the event. Should be exactly two.
967  numCrystalsPassingCuts++;
968 
969 
970  /* Store information about one random specific crystal and one random specific crate for
971  studies of how they vary over time.*/
972  if (crystalIDs[iCharge] == 1338) {
973  getObjectPtr<TH2F>("TimevsRunPrevCrateCalibPrevCrystCalibCID1338")->Fill(m_runNum + 0.001,
974  times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge] , 1);
975  }
976  if (crateIDs[iCharge] == 8) {
977  getObjectPtr<TH2F>("TimevsRunPrevCrateCalibPrevCrystCalibCrate8")->Fill(m_runNum + 0.001,
978  times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge] , 1);
979  }
980 
981  }
982  }
983 
984 
985  // Change cutflow method for this bit ... don't call return because we used to call the hadron cluster stuff afterwards
986  //
987  if (crystalCutsPassed[0] || crystalCutsPassed[1]) {
988  // At least one ECL crystal time and quality cuts passed
989  cutIndexPassed++;
990  getObjectPtr<TH1F>("cutflow")->Fill(cutIndexPassed);
991  B2DEBUG(10, "Cutflow: At least one crystal time and quality cuts passed: index = " << cutIndexPassed);
992 
993  getObjectPtr<TH1F>("numCrystalEntriesPerEvent")->Fill(numCrystalsPassingCuts);
994  }
995 
996 
997  // Save final information to the tree after all cuts are applied
998  for (int iCharge = 0; iCharge < 2; iCharge++) {
999  if (crystalCutsPassed[iCharge]) {
1000  // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Tree saving
1001  StoreObjPtr<EventMetaData> evtMetaData;
1002  m_tree_evtNum = evtMetaData->getEvent();
1003  m_tree_cid = crystalIDs[iCharge];
1004  //m_tree_time = times[iCharge];
1005  m_tree_time = times_noPreviousCalibrations[iCharge];
1006  m_crystalCrate = crateIDs[iCharge];
1007  m_runNum = evtMetaData->getRun();
1008  m_tree_en = crystalEnergies[iCharge]; // for studies of ts as a function of energy
1009  m_tree_E1Etot = crystalEnergies[iCharge] / trkEClustLab[iCharge];
1010  m_tree_E1E2 = crystalEnergies[iCharge] / crystalEnergies2[iCharge];
1011  m_tree_E1p = crystalEnergies[iCharge] / trkpLab[iCharge];
1012  m_tree_timetsPreviousTimeCalibs = times_noPreviousCalibrations[iCharge] - ts_prevCalib[iCharge] - tcrate_prevCalib[iCharge];
1013  m_tree_t0 = evt_t0;
1014  m_tree_t0_ECLclosestCDC = evt_t0_ECL_closestCDC;
1015  m_tree_t0_ECL_minChi2 = evt_t0_ECL_minChi2;
1016  m_tree_tClust = clusterTime[iCharge];
1017 
1018  m_massInvTracks = invMassTrk; // This is probably already set but I'll set it again anyways just so that it is clear
1019 
1020  if (m_saveTree) {
1021  m_dbgTree_allCuts->Fill();
1022  }
1023  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Tree saving
1024  }
1025  }
1026 
1027 
1028 
1029 
1030  if (crystalCutsPassed[0] && crystalCutsPassed[1] &&
1031  numClustersPerTrack[0] == 1 && numClustersPerTrack[1] == 1) {
1032  m_tree_enNeg = trkEClustLab[0];
1033  m_tree_enPlus = trkEClustLab[1];
1034  m_tree_tClustNeg = clusterTime[0];
1035  m_tree_tClustPos = clusterTime[1];
1036  m_tree_maxEcrystPosClust = times_noPreviousCalibrations[0] - ts_prevCalib[0] - tcrate_prevCalib[0];
1037  m_tree_maxEcrystNegClust = times_noPreviousCalibrations[1] - ts_prevCalib[1] - tcrate_prevCalib[1];
1038  m_tree_t0 = evt_t0;
1039  m_tree_t0_ECLclosestCDC = evt_t0_ECL_closestCDC;
1040  m_tree_t0_ECL_minChi2 = evt_t0_ECL_minChi2;
1041 
1042  // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Tree saving
1043  if (m_saveTree) {
1044  m_dbgTree_evt_allCuts->Fill();
1045  }
1046  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Tree saving
1047  }
1048 
1049 
1050  B2DEBUG(30, "m_tree_maxEcrystPosClust + evt_t0 = " << m_tree_maxEcrystPosClust + evt_t0);
1051  B2DEBUG(30, "m_tree_maxEcrystNegClust + evt_t0 = " << m_tree_maxEcrystNegClust + evt_t0);
1052  B2DEBUG(30, "CDC evt_t0 = " << evt_t0);
1053  B2DEBUG(30, "ECL min chi2 even t0, m_tree_t0_ECL_minChi2 = " << m_tree_t0_ECL_minChi2);
1054 
1055 
1056 
1057  for (long unsigned int digit_i = 0; digit_i < time_ECLCaldigits_bothClusters.size(); digit_i++) {
1058  StoreObjPtr<EventMetaData> evtMetaData;
1059  m_runNum = evtMetaData->getRun();
1060  m_tree_evtNum = evtMetaData->getEvent();
1061  m_tree_ECLCalDigitTime = time_ECLCaldigits_bothClusters[digit_i];
1062  m_tree_ECLCalDigitE = E_ECLCaldigits_bothClusters[digit_i];
1063  m_tree_ECLDigitAmplitude = amp_ECLDigits_bothClusters[digit_i];
1064  m_tree_t0 = evt_t0;
1065  m_tree_t0_ECLclosestCDC = evt_t0_ECL_closestCDC;
1066  m_tree_t0_ECL_minChi2 = evt_t0_ECL_minChi2;
1067  m_tree_timetsPreviousTimeCalibs = times_noPreviousCalibrations[chargeID_ECLCaldigits_bothClusters[digit_i]] -
1068  ts_prevCalib[chargeID_ECLCaldigits_bothClusters[digit_i]] -
1069  tcrate_prevCalib[chargeID_ECLCaldigits_bothClusters[digit_i]];
1070  m_tree_cid = cid_ECLCaldigits_bothClusters[digit_i];
1071 
1072  // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Tree saving
1073  if (m_saveTree) {
1074  m_dbgTree_crys_allCuts->Fill();
1075  }
1076  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Tree saving
1077 
1078  }
1079 
1080 
1081  B2DEBUG(30, "This was for event number = " << m_tree_evtNum);
1082 
1083 }

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 441 of file Module.h.

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 422 of file Module.h.

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 98 of file Module.cc.

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 135 of file Module.cc.

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).


Definition at line 115 of file Module.cc.

◆ getFileNames()

virtual std::vector<std::string> getFileNames ( __attribute__((unused)) bool  outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Definition at line 136 of file Module.h.

◆ getName()

const std::string& getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 189 of file Module.h.

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 281 of file Module.cc.

◆ getPreScaleChoice()

bool getPreScaleChoice ( )
inlineprivateinherited

I'm a little worried about floating point precision when comparing to 0.0 and 1.0 as special values.

But since a user will have set them (or left them as default) as exactly equal to 0.0 or 1.0 rather than calculating them in almost every case, I think we can assume that the equalities hold.

Definition at line 134 of file CalibrationCollectorModule.h.

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 383 of file Module.h.

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 43 of file Module.cc.

◆ hasProperties()

bool hasProperties ( unsigned int  propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 162 of file Module.cc.

◆ if_false()

void if_false ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 87 of file Module.cc.

◆ if_true()

void if_true ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 92 of file Module.cc.

◆ if_value()

void if_value ( const std::string &  expression,
const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://confluence.desy.de/display/BI/Software+ModCondTut or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 81 of file Module.cc.

◆ setDescription()

void setDescription ( const std::string &  description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 216 of file Module.cc.

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 75 of file Module.cc.

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 216 of file Module.h.

◆ setParamPython()

void setParamPython ( const std::string &  name,
const boost::python::object &  pyObj 
)
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 236 of file Module.cc.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict &  dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 251 of file Module.cc.

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 210 of file Module.cc.

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 229 of file Module.cc.

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 222 of file Module.cc.

◆ setType()

void setType ( const std::string &  type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 50 of file Module.cc.

Member Data Documentation

◆ m_CrateTimeDB

DBObjPtr<ECLCrystalCalib> m_CrateTimeDB
private

Time offset from crate time calibration (also this calibration) from database.

database object

Definition at line 99 of file ECLBhabhaTCollectorModule.h.

◆ m_ECLTimeUtil

std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil
private
Initial value:
=
std::make_unique<Belle2::ECL::ECLTimingUtilities>()

ECL timing tools.

Definition at line 209 of file ECLBhabhaTCollectorModule.h.

◆ m_ElectronicsDB

DBObjPtr<ECLCrystalCalib> m_ElectronicsDB
private

electronics amplitude calibration from database Scale amplitudefor each crystal and for dead pre-amps

database object

Definition at line 82 of file ECLBhabhaTCollectorModule.h.

◆ m_ElectronicsTimeDB

DBObjPtr<ECLCrystalCalib> m_ElectronicsTimeDB
private

Time offset from electronics calibration from database.

database object

Definition at line 86 of file ECLBhabhaTCollectorModule.h.

◆ m_eventT0

StoreObjPtr<EventT0> m_eventT0
private

StoreObjPtr for T0.

The event t0 class has an overall event t0

Definition at line 78 of file ECLBhabhaTCollectorModule.h.

◆ m_FlightTimeDB

DBObjPtr<ECLCrystalCalib> m_FlightTimeDB
private

Time offset from flight time b/w IP and crystal from database.

database object

Definition at line 90 of file ECLBhabhaTCollectorModule.h.

◆ m_PreviousCrystalTimeDB

DBObjPtr<ECLCrystalCalib> m_PreviousCrystalTimeDB
private

Time offset from previous crystal time calibration (this calibration) from database.

database object

Definition at line 94 of file ECLBhabhaTCollectorModule.h.

◆ m_tree_enPlus

double m_tree_enPlus
private

crystal energy, only for the crystals that meet all the selection criteria for debug TTree output

Energy of cluster associated to positively charged track, GeV for debug TTree output

Definition at line 152 of file ECLBhabhaTCollectorModule.h.


The documentation for this class was generated from the following files:
Belle2::ECLBhabhaTCollectorModule::m_timeAbsMax
short m_timeAbsMax
Events with abs(time) > m_timeAbsMax are excluded, mostly for histogram x-range purposes.
Definition: ECLBhabhaTCollectorModule.h:189
Belle2::EvtPDLUtil::charge
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:46
Belle2::ECLCalDigit::getEnergy
double getEnergy() const
Get Calibrated Energy.
Definition: ECLCalDigit.h:134
Belle2::ECLBhabhaTCollectorModule::m_eventT0
StoreObjPtr< EventT0 > m_eventT0
StoreObjPtr for T0.
Definition: ECLBhabhaTCollectorModule.h:78
Belle2::TrackFitResult::get4Momentum
TLorentzVector get4Momentum() const
Getter for the 4Momentum at the closest approach of the track in the r/phi projection.
Definition: TrackFitResult.h:125
Belle2::ECLBhabhaTCollectorModule::m_tree_amp
int m_tree_amp
Fitting amplitude from ECL for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:120
Belle2::ECLBhabhaTCollectorModule::m_eclClusterArray
StoreArray< ECLCluster > m_eclClusterArray
Required input array of ECLClusters.
Definition: ECLBhabhaTCollectorModule.h:179
Belle2::ECLCalDigit
Class to store calibrated ECLDigits: ECLCalDigits.
Definition: ECLCalDigit.h:38
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitTime
double m_tree_ECLCalDigitTime
Time of an ECLCalDigit within a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:163
Belle2::ECLDigit::getQuality
int getQuality() const
Get Fitting Quality.
Definition: ECLDigit.h:90
Belle2::ECLBhabhaTCollectorModule::m_tree_E1p
double m_tree_E1p
Energy of crystal with maximum energy within ECL cluster divided by total cluster energy divided by t...
Definition: ECLBhabhaTCollectorModule.h:128
Belle2::ECLBhabhaTCollectorModule::m_runNum
int m_runNum
run number
Definition: ECLBhabhaTCollectorModule.h:201
Belle2::ECLBhabhaTCollectorModule::m_tree_maxEcrystPosClust
double m_tree_maxEcrystPosClust
Time of the highest energy crystal in the cluster associated to positively charged track,...
Definition: ECLBhabhaTCollectorModule.h:156
Belle2::ECLBhabhaTCollectorModule::m_maxCrystal
int m_maxCrystal
Last CellId to handle.
Definition: ECLBhabhaTCollectorModule.h:192
Belle2::ECLCluster
ECL cluster data.
Definition: ECLCluster.h:39
Belle2::ECLCalDigit::getCellId
int getCellId() const
Get Cell ID.
Definition: ECLCalDigit.h:129
Belle2::ECLBhabhaTCollectorModule::m_tree_maxEcrystNegClust
double m_tree_maxEcrystNegClust
Time of the highest energy crystal in the cluster associated to negatively charged track,...
Definition: ECLBhabhaTCollectorModule.h:158
Belle2::ECLBhabhaTCollectorModule::m_tree_z0
double m_tree_z0
Track d0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:142
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeUnc
std::vector< float > m_CrateTimeUnc
uncertainty vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:101
Belle2::PCmsLabTransform::getCMSEnergy
double getCMSEnergy() const
Returns CMS energy of e+e- (aka.
Definition: PCmsLabTransform.h:57
Belle2::ECLBhabhaTCollectorModule::m_tree_E1E2
double m_tree_E1E2
Energy of crystal with maximum energy within ECL cluster divided by second most energetic crystal in ...
Definition: ECLBhabhaTCollectorModule.h:125
Belle2::ECLBhabhaTCollectorModule::m_massInvTracks
double m_massInvTracks
invariant mass of the two tracks, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:171
Belle2::ECLBhabhaTCollectorModule::m_tree_quality
int m_tree_quality
ECL fit quality for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:131
Belle2::ECLCluster::EHypothesisBit::c_nPhotons
@ c_nPhotons
CR is split into n photons (N1)
Belle2::ECLBhabhaTCollectorModule::m_tree_tClustPos
double m_tree_tClustPos
Cluster time of cluster associated to positively charged track, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:154
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeDB
DBObjPtr< ECLCrystalCalib > m_PreviousCrystalTimeDB
Time offset from previous crystal time calibration (this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:94
Belle2::ECLBhabhaTCollectorModule::m_FlightTimeDB
DBObjPtr< ECLCrystalCalib > m_FlightTimeDB
Time offset from flight time b/w IP and crystal from database.
Definition: ECLBhabhaTCollectorModule.h:90
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsDB
DBObjPtr< ECLCrystalCalib > m_ElectronicsDB
electronics amplitude calibration from database Scale amplitudefor each crystal and for dead pre-amps
Definition: ECLBhabhaTCollectorModule.h:82
Belle2::ECLBhabhaTCollectorModule::m_eclDigitID
std::vector< int > m_eclDigitID
ECL digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:183
Belle2::TrackFitResult
Values of the result of a track fit with a given particle hypothesis.
Definition: TrackFitResult.h:59
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitID
std::vector< int > m_eclCalDigitID
ECL cal digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:182
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTimeDB
DBObjPtr< ECLCrystalCalib > m_ElectronicsTimeDB
Time offset from electronics calibration from database.
Definition: ECLBhabhaTCollectorModule.h:86
Belle2::ClusterUtils::GetIPPosition
const TVector3 GetIPPosition()
Returns default IP position from beam parameters.
Definition: ClusterUtils.cc:182
Belle2::ECLBhabhaTCollectorModule::m_storeCalib
bool m_storeCalib
Boolean for whether or not to store the previous calibration calibration constants.
Definition: ECLBhabhaTCollectorModule.h:203
Belle2::ECLBhabhaTCollectorModule::m_tree_time
double m_tree_time
Time for Ts distribution for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:133
Belle2::ECLBhabhaTCollectorModule::m_tree_timetsPreviousTimeCalibs
double m_tree_timetsPreviousTimeCalibs
Time for Ts distribution after application of previous time calibrations for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:134
Belle2::ECLBhabhaTCollectorModule::m_tree_nCDChits
double m_tree_nCDChits
Track momentum for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:144
Belle2::ECLBhabhaTCollectorModule::m_tree_tClust
double m_tree_tClust
Cluster time of a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:161
Belle2::ECL::ECLChannelMapper
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
Definition: ECLChannelMapper.h:36
Belle2::ECLBhabhaTCollectorModule::tracks
StoreArray< Track > tracks
StoreArray for tracks.
Definition: ECLBhabhaTCollectorModule.h:74
Belle2::ECLBhabhaTCollectorModule::m_charge
int m_charge
particle charge, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:169
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitE
double m_tree_ECLCalDigitE
Energy of an ECLCalDigit within a cluster, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:164
Belle2::ClusterUtils
Class to provide momentum-related information from ECLClusters.
Definition: ClusterUtils.h:44
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::ECLBhabhaTCollectorModule::m_tree_cid
int m_tree_cid
ECL Cell ID (1..8736) for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:117
Belle2::ECLBhabhaTCollectorModule::m_E_DIV_p
double m_E_DIV_p
Energy divided by momentum, for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:170
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeDB
DBObjPtr< ECLCrystalCalib > m_CrateTimeDB
Time offset from crate time calibration (also this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:99
Belle2::ECLDigit::getCellId
int getCellId() const
Get Cell ID.
Definition: ECLDigit.h:74
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitArray
StoreArray< ECLCalDigit > m_eclCalDigitArray
Required input array of ECLCalDigits.
Definition: ECLBhabhaTCollectorModule.h:178
Belle2::ECLBhabhaTCollectorModule::m_tree_E1Etot
double m_tree_E1Etot
Energy of crystal with maximum energy within ECL cluster divided by total cluster energy,...
Definition: ECLBhabhaTCollectorModule.h:122
Belle2::ECLBhabhaTCollectorModule::m_tree_p
double m_tree_p
Track z0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:143
Belle2::ECLBhabhaTCollectorModule::m_Electronics
std::vector< float > m_Electronics
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:83
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_electrons
TTree * m_dbgTree_electrons
Output tree with detailed event data.
Definition: ECLBhabhaTCollectorModule.h:106
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_ECLclosestCDC
double m_tree_t0_ECLclosestCDC
EventT0 (from ECL) closest to CDC for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:139
Belle2::ECL::EclConfiguration::m_rf
static constexpr double m_rf
accelerating RF, http://ptep.oxfordjournals.org/content/2013/3/03A006.full.pdf
Definition: EclConfiguration.h:45
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeUnc
std::vector< float > m_PreviousCrystalTimeUnc
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:96
Belle2::ECLDigit
Class to store ECL digitized hits (output of ECLDigi) relation to ECLHit filled in ecl/modules/eclDig...
Definition: ECLDigit.h:34
Belle2::ECLBhabhaTCollectorModule::m_tree_enPlus
double m_tree_enPlus
crystal energy, only for the crystals that meet all the selection criteria for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:152
Belle2::ECLBhabhaTCollectorModule::m_FlightTime
std::vector< float > m_FlightTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:91
Belle2::ECLDigit::getTimeFit
int getTimeFit() const
Get Fitting Time.
Definition: ECLDigit.h:85
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTime
std::vector< float > m_PreviousCrystalTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:95
Belle2::ECLBhabhaTCollectorModule::m_tree_tClustNeg
double m_tree_tClustNeg
Cluster time of cluster associated to negatively charged track, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:155
Belle2::PCmsLabTransform
Class to hold Lorentz transformations from/to CMS and boost vector.
Definition: PCmsLabTransform.h:37
Belle2::ECLBhabhaTCollectorModule::m_tree_t0
double m_tree_t0
EventT0 (not from ECL) for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:137
Belle2::PCmsLabTransform::rotateLabToCms
const TLorentzRotation rotateLabToCms() const
Returns Lorentz transformation from Lab to CMS.
Definition: PCmsLabTransform.h:74
Belle2::ECLBhabhaTCollectorModule::m_saveTree
bool m_saveTree
If true, save TTree with more detailed event info.
Definition: ECLBhabhaTCollectorModule.h:69
Belle2::ECLBhabhaTCollectorModule::m_tree_timeF
double m_tree_timeF
ECL fitting time for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:132
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::ECLDigit::getAmp
int getAmp() const
Get Fitting Amplitude.
Definition: ECLDigit.h:80
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLDigitAmplitude
double m_tree_ECLDigitAmplitude
Amplitude (used to calculate energy) of an ECLDigit within a cluster, for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:165
Belle2::ECLBhabhaTCollectorModule::m_CrateTime
std::vector< float > m_CrateTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:100
Belle2::ECLBhabhaTCollectorModule::m_tree_evtNum
int m_tree_evtNum
Event number for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:116
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_unc
double m_tree_t0_unc
EventT0 uncertainty for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:138
Belle2::ECLBhabhaTCollectorModule::m_crystalCrate
int m_crystalCrate
Crate id for the crystal.
Definition: ECLBhabhaTCollectorModule.h:200
Belle2::ECLBhabhaTCollectorModule::m_tree_enNeg
double m_tree_enNeg
Energy of cluster associated to negatively charged track, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:153
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTime
std::vector< float > m_ElectronicsTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:87
Belle2::ECLBhabhaTCollectorModule::m_ECLTimeUtil
std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil
ECL timing tools.
Definition: ECLBhabhaTCollectorModule.h:209
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_ECL_minChi2
double m_tree_t0_ECL_minChi2
EventT0 (from ECL) min chi2 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:140
Belle2::ECLBhabhaTCollectorModule::m_tree_en
double m_tree_en
Energy of crystal with maximum energy within ECL cluster, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:121
Belle2::ECLBhabhaTCollectorModule::m_eclDigitArray
StoreArray< ECLDigit > m_eclDigitArray
Required input array of ECLDigits.
Definition: ECLBhabhaTCollectorModule.h:177
Belle2::ECLBhabhaTCollectorModule::m_EperCrys
std::vector< float > m_EperCrys
ECL digit energy for each crystal.
Definition: ECLBhabhaTCollectorModule.h:181