CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EcalSimpleSource Class Reference

#include <EcalSimpleSource.h>

Inheritance diagram for EcalSimpleSource:
edm::GeneratedInputSource edm::ConfigurableInputSource edm::InputSource edm::ProductRegistryHelper

List of all members.

Public Member Functions

void beginJob ()
 EcalSimpleSource (const edm::ParameterSet &pset, const edm::InputSourceDescription &sdesc)
virtual bool produce (edm::Event &evt)
virtual ~EcalSimpleSource ()

Private Member Functions

int cIndex2iEta (int iEta0) const
int cIndex2iPhi (int iPhi0) const
int cIndex2iTtEta (int iEta0) const
int cIndex2iTtPhi (int iPhi0) const
void replaceAll (std::string &s, const std::string &from, const std::string &to) const

Private Attributes

std::auto_ptr< TFormula > formula_
std::auto_ptr< TFormula > simHitFormula_
std::auto_ptr< TFormula > tpFormula_
bool verbose_

Detailed Description

This edm source module generates Ecal Digis (data frames and TPGs) according to a given pattern. The pattern is defined as function of event id, crystal/TT, and time sample. Only barrel is currently supported for the crystal channel data.

Module parameters (in addition to standard source parameters):

The crystal ADC formula is parametrized with the following variables:

The trigger primitive formula is parametrized with the following variables:

In both formulae 'itt0' shortcut can be used for the trigger tower index within the SM starting at 0 from lowest relative eta and lowest phi and increasing first with phi then with eta. The syntax for the formula is the syntax defined in ROOT TFormula

Definition at line 42 of file EcalSimpleSource.h.


Constructor & Destructor Documentation

EcalSimpleSource::EcalSimpleSource ( const edm::ParameterSet pset,
const edm::InputSourceDescription sdesc 
)

Constructs an EcalSimpleSource

Parameters:
psetCMSSW configuration
sdescdescription of this input source
virtual EcalSimpleSource::~EcalSimpleSource ( ) [inline, virtual]

Destructor

Definition at line 55 of file EcalSimpleSource.h.

{};

Member Function Documentation

void EcalSimpleSource::beginJob ( void  ) [inline, virtual]

Called at start of job.

Parameters:
esthe event setup

Reimplemented from edm::InputSource.

Definition at line 60 of file EcalSimpleSource.h.

{};
int EcalSimpleSource::cIndex2iEta ( int  iEta0) const [inline, private]

Converts c-array index (contiguous integer starting from 0) to std CMSSW ECAL crystal eta index.

Parameters:
iEta0c-array index. '0' postfix reminds the index starts from 0
Returns:
std CMSSW ECAL crystal index.

Definition at line 84 of file EcalSimpleSource.h.

                                  {
    return (iEta0<85)?iEta0-85:iEta0-84;
  }
int EcalSimpleSource::cIndex2iPhi ( int  iPhi0) const [inline, private]

Converts c-array index (contiguous integer starting from 0) to std CMSSW ECAL crystal phi index.

Parameters:
iPhi0c-array index. '0' postfix reminds the index starts from 0
Returns:
std CMSSW ECAL crystal index.

Definition at line 93 of file EcalSimpleSource.h.

                                  {
    return (iPhi0+10)%360+1;
  }
int EcalSimpleSource::cIndex2iTtEta ( int  iEta0) const [inline, private]

Converts c-array index (contiguous integer starting from 0) to std CMSSW ECAL trigger tower eta index.

Parameters:
iEta0c-array index. '0' postfix reminds the index starts from 0
Returns:
std CMSSW ECAL trigger tower index.

Definition at line 102 of file EcalSimpleSource.h.

                                    {
    return (iEta0<28)?iEta0-28:iEta0-27;
  }
int EcalSimpleSource::cIndex2iTtPhi ( int  iPhi0) const [inline, private]

Converts c-array index (contiguous integer starting from 0) to std CMSSW ECAL trigger tower phi index.

Parameters:
iPhi0c-array index. '0' postfix reminds the index starts from 0
Returns:
std CMSSW ECAL trigger tower index.

Definition at line 111 of file EcalSimpleSource.h.

                                    {
    return iPhi0+1;
  }
virtual bool EcalSimpleSource::produce ( edm::Event evt) [virtual]

The main method. It produces the event.

Parameters:
evt[out] produced event.

Implements edm::ConfigurableInputSource.

void EcalSimpleSource::replaceAll ( std::string &  s,
const std::string &  from,
const std::string &  to 
) const [private]

Help function to replace a pattern within a string. Every occurance of the pattern is replaced. An exact match is performed: no wild card.

Parameters:
sstring to operate on
patternto replace.
stringto substitute to the pattern

Member Data Documentation

std::auto_ptr<TFormula> EcalSimpleSource::formula_ [private]

Formula defining the data frame samples

Definition at line 120 of file EcalSimpleSource.h.

std::auto_ptr<TFormula> EcalSimpleSource::simHitFormula_ [private]

Formula defining the sim hits

Definition at line 128 of file EcalSimpleSource.h.

std::auto_ptr<TFormula> EcalSimpleSource::tpFormula_ [private]

Formula defining the trigger primitives

Definition at line 124 of file EcalSimpleSource.h.

Verbosity switch

Definition at line 132 of file EcalSimpleSource.h.