Skip to content
Snippets Groups Projects

Centrality tuple tool

Merged Felipe Andres Garcia Rosales requested to merge CentralityTupleTool into run2-patches

This is a tuple tool specifically for PbP at 5.02 TeV collisions that works as a look up table to assign to each PbPb event geometric quantities related to the centrality of the collision. The procedure to determine these quantities is described in detail in the internal note LHCb-INT-2020-013 that can be found at https://cds.cern.ch/record/2721537. The tuple tool is written such that the user can set the desired number of centrality classes (N), with the restriction that 100/N is integer. This is to ensure that every class will span an integer number of percentiles. To set the desired number of classes the user must set the attribute NClasses of the added tuple tool, likewise, the user can set the Verbose attribute to either True or False. If it is set to True the tuple tool will in addition save the energy deposited by the events to the tuple, under the name EcalDigitEnergySum.

Example syntax to add it in a DaVinci options file:

from Configurables import TupleToolCentrality

evt = EventTuple('events')
cent = evt.addTool(TupleToolCentrality)
cent.Verbose = True
cent.NClasses = 20
evt.ToolList +=['TupleToolCentrality']
Edited by Felipe Andres Garcia Rosales

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 28 //-----------------------------------------------------------------------------
    29 // Implementation file for class : TupleToolCentrality
    30 //
    31 // Based on TupleToolCaloDigits by 2015-08-05 Albert Bursche
    32 //-----------------------------------------------------------------------------
    33
    34 // Declaration of the Tool Factory
    35 DECLARE_COMPONENT( TupleToolCentrality )
    36
    37 //=============================================================================
    38 // Standard constructor, initializes variables
    39 //=============================================================================
    40 TupleToolCentrality::TupleToolCentrality( const std::string& type, const std::string& name, const IInterface* parent )
    41 : TupleToolBase( type, name, parent ) {
    42 declareInterface<IEventTupleTool>( this );
    43 declareProperty( "MaxDigits", m_maxSize );
  • 68 m_row.push_back( cellID.row() );
    69 m_column.push_back( cellID.col() );
    70
    71 m_es.push_back( digit->e() );
    72 if ( msgLevel( MSG::DEBUG ) ) debug() << cellID.toString() << " has an energy of " << m_es.back() << " \n";
    73 }
    74 if ( msgLevel( MSG::DEBUG ) )
    75 debug() << " saved " << m_index.size() << " digits to n tuple " + m_CaloName + "Digit." << endmsg;
    76 if ( m_verbose ) {
    77 tuple->column( m_extraName + m_CaloName + "DigitEnergySum",
    78 std::accumulate( std::begin( m_es ), std::end( m_es ), 0.0 ) );
    79 }
    80
    81 m_TES = std::accumulate( std::begin( m_es ), std::end( m_es ), 0.0 ); // Total Energy Sum
    82
    83 m_ecalcuts = {
  • 189 } else if ( m_nclasses == 10 ) {
    190 m_npart_stat = {0.004, 0.009, 0.015, 0.022, 0.032, 0.042, 0.053, 0.068, 0.086, 0.102};
    191 m_ncoll_stat = {0.004, 0.010, 0.022, 0.047, 0.088, 0.148, 0.226, 0.333, 0.480, 0.749};
    192 m_b_stat = {0.003, 0.003, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.004};
    193 } else if ( m_nclasses == 5 ) {
    194 m_npart_stat = {0.007, 0.022, 0.045, 0.077, 0.126};
    195 m_ncoll_stat = {0.007, 0.038, 0.136, 0.343, 0.803};
    196 m_b_stat = {0.002, 0.002, 0.002, 0.002, 0.004};
    197 } else if ( m_nclasses == 4 ) {
    198 m_npart_stat = {0.009, 0.033, 0.070, 0.132};
    199 m_ncoll_stat = {0.010, 0.071, 0.275, 0.805};
    200 m_b_stat = {0.002, 0.002, 0.002, 0.004};
    201 } else if ( m_nclasses == 2 ) {
    202 m_npart_stat = {0.028, 0.139};
    203 m_ncoll_stat = {0.052, 0.727};
    204 m_b_stat = {0.002, 0.004};
  • 123 4.82, 4.55, 4.27, 3.98, 3.65, 3.29, 2.89, 2.42, 1.90, 1.35};
    124
    125 ////// Systematic uncertainties //////////
    126
    127 // These are computed for 5% intervals, hence there are 20 values.
    128
    129 m_npart_sys = {0.491, 0.591, 0.782, 0.793, 0.568, 0.697, 0.509, 0.812, 1.14, 1.113,
    130 1.204, 0.776, 1.332, 0.938, 1.571, 1.399, 1.85, 1.801, 0.448, 2.356};
    131 m_ncoll_sys = {0.291, 0.392, 0.594, 0.676, 0.553, 0.81, 0.673, 1.144, 1.895, 2.134,
    132 2.603, 2.25, 3.91, 3.851, 6.222, 6.981, 9.463, 11.19, 11.834, 18.519};
    133 m_b_sys = {3.02, 2.91, 2.18, 1.32, 0.59, 0.44, 0.25, 0.3, 0.26, 0.21,
    134 0.181, 0.081, 0.1, 0.062, 0.071, 0.051, 0.051, 0.04, 0.01, 0.024};
    135
    136 ////// Width of classes distributions ////
    137
    138 if ( m_nclasses == 100 ) {
  • 270 m_calo.clear();
    271 m_area.clear();
    272 m_row.clear();
    273 m_column.clear();
    274 m_es.clear();
    275 m_npart_temp.clear();
    276 m_ncoll_temp.clear();
    277 m_b_temp.clear();
    278 m_ecalcuts.clear();
    279 m_npart.clear();
    280 m_npart_sys.clear();
    281 m_npart_stat.clear();
    282 m_ncoll.clear();
    283 m_ncoll_sys.clear();
    284 m_ncoll_stat.clear();
    285 m_b.clear();
  • 36
    37 //=============================================================================
    38 // Standard constructor, initializes variables
    39 //=============================================================================
    40 TupleToolCentrality::TupleToolCentrality( const std::string& type, const std::string& name, const IInterface* parent )
    41 : TupleToolBase( type, name, parent ) {
    42 declareInterface<IEventTupleTool>( this );
    43 declareProperty( "MaxDigits", m_maxSize );
    44 declareProperty( "NClasses", m_nclasses );
    45 declareProperty( "Debugging", m_debug );
    46 }
    47 //=============================================================================
    48
    49 StatusCode TupleToolCentrality::initialize() {
    50 if ( 100 % m_nclasses == 0 ) {
    51 m_CaloLocation = DeCalorimeterLocation::Ecal;
  • Mark Smith
  • Edited by Software for LHCb
  • removed all-slots label

  • added 1 commit

    • 402075df - moved things to header and initialize()

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • I applied the discussed changes and made a few local tests to check that the end result is as I was expecting.

  • Mark Smith
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading