Sebastian Richter

1d / 28b

phone: 1502




Disclaimer: This guide is not intended to be an introduction to Marlin and lcio et. al. Take a look at

The most important inheritance structure you maybe need to know is the following:


You can find this structure in the doxygen docu as well.


The following picture shows the database inputs of the SiPmPropertiesProcessor.


The IntegratedHcalProcessor has even more.


A couple of processors take care of the reconstruction, see the following diagram.


The digitization looks like this.


See that the output of the IntegratedHcalDigitizationProcessor matches the input of the IntegratedHcalCalibrationProcessor.

things I could be asked for

calibrations (Draft)

At the moment the calibrations (MIP, Gain, IC) are stored half-module-wise. This results in 38*2*3 = 228 lines in the ConditionsProcessor. We want do divide this number by 38*2...

An appropriate way to do so is to save not half-module-wise but just the whole calorimeter in one collection. The "class" saved could be the SimpleValue (userlib) which offers: (cell)id, value, error, status. The (cell)id can be the HcalTileIndex (userlib) encoding module, chip, channel, (SiPM-ID).

To get the calibration value for a specific cell one can fill a ConditionsMap (lccd). The ConditionsMap is a template class. For us it would map HcalTileIndices to SimpleValues. CM is a ConditionsMap holding MIP constants for example, col is an !LCCollection* pointing to the plain collection saved in the database.

lccd::ConditionsMap<int, &HcalTileIndex::getIndex()> CM;


float mip = CM.find(HcalTileIndex(module,chip,channel).getIndex()).getValue();

Temperatures slopes ware stored in the same way.

modules overview

Short note about coarse/fine modules and chip/channel assignment:

future software changes

rebase on new repositories

git clone /group/hcal/calice_soft/git_repo/calice_userlib calice_userlib_new

git remote add myself ../calice_userlib

git fetch myself

git checkout -b devel myself/new_pro

git rebase -i origin/devel

in editor:

pick e4edbd1 New html docu
pick 3b73601 New latex docu
pick f8a4179 New html docu
pick 364e44d Revision pulled onto this branch
pick 0025bdc Revision pulled onto this branch
pick e75d4ce HcalTileIndex: << overloaded
pick 8ce3ee6 EncodingStringHelper: make use of the stl bitset
pick 637a629 FastCaliceHit: << operator added

remove lines with commits you don't want or which are misidentified as yours

Getting answers easily

Attention - holy war approaching!

The AHCAL has the IntegratedHcalProcessor which is inherited from the SiPmPropertiesProcessors. At the moment the IntegratedHcalCalibrationProcessor and the IntegratedHcalDigitizationProcessor are inherited from the IntegratedHcalProcessor to have, for example, easy access to calibration constants.

I see two main draw backs. The IntegratedHcalProcessor needs a lot of steering parameters, which could be cooked down, but it so some extent unavoidable. This itself is not the problem. "Constructors" are allowed to take a lot of arguments, too. However, since the Calibration and DigitizationProcessor hold "copies" of the "master" processor all the steering parameters are present two times. Furthermore all the work of the IntegratedHcalProcessor is done twice.

A possible solution to this problem is not to inherited from this processor but to have an instance of it. Every processor which wants to use functions of the master processor can get a pointer to it via:

    marlin::ProcessorMgr* pmgr = marlin::ProcessorMgr::instance();

    IntegratedHcalProcessor* IHP = dynamic_cast<IntegratedHcalProcessor*>(pmgr->getActiveProcessor("NameOfIntegratedHcalProcessorInstance")); 

Now it's very easy to get answers to your itching questions.

   float mip = IHP->getMIP(module,chip,channel); // wouldn't it be nice?

The vantages of this scheme are:

and most important

One would have to provide steerings for master processors for all detectors, but this should not be such a problem.




Set the enconding:

LCCollectionVec* col = new LCCollectionVec( LCIO::SIMCALORIMETERHIT );

std::string cellIDEncoding("I:16:8,J:8:8,K:0:8");

CellIDEncoder<SimCalorimeterHitImpl> myCellIDEncoder(cellIDEncoding, col ) ;

SimCalorimeterHitImpl* newHit = new SimCalorimeterHitImpl;

myCellIDEncoder["I"] = i;
myCellIDEncoder["J"] = j;
myCellIDEncoder["K"] = k;

No more bit shifting!

CellIDDecoder<SimCalorimeterHit> myCellIDDecoder(col);
i = myCellIDDecoder(Hit)["I"]

Explanation of the encoding string:

 ^  ^ ^
 |  | |_ width
 |  |_ start bit
 |_ name


get a decent recent LaTeX

If you want to use a more recent LaTeX try:

$ ini texlive
$ which latex

This includes for example subfig and not only the old subfigure package.

How to save paper

pdf2ps bigdoc.pdf
or pdftops
psnup -2

pdf2ps and pdftops are different programs. I encountered problems with pdf2ps; it produced a monstrous file...

c++filt - Demangle C++ and Java symbols

/afs/ symbol lookup error: /afs/ undefined symbol: _ZlsRSoRKN6CALICE13HcalTileIndexE

Who's missing?

$ c++filt _ZlsRSoRKN6CALICE13HcalTileIndexE
operator<<(std::basic_ostream<char, std::char_traits<char> >&, CALICE::HcalTileIndex const&)

Ah, the << is missing.

extract images from a pdf file

pdfimages -j foo.pdf  bar

Search for bit shifting

Like "<< or >> $number:

grep "\(<<\|>>\)\([[:space:]]\|=\|\)[0-9]" *

RootTreeWriter wishlisht


remove commented lines

If the comment symbol is #:

M-x query-replace-regexp or M-C-%
Query replace regexp: ^#.*C-q C-j
with: "nothing"

C-q C-j is the shortcut for newline.

remove empty lines

M-x query-replace-regexp or M-C-%
Query replace regexp: ^[[:space:]]*C-q C-j
with: "nothing"


useful introduction

cope with large labels


Draw graph with errors without errors


or try:


Ganga (Scratch)

ini ganga508
ganga -g
$EDITOR ~/.gangarc
#  sets the name of the grid virtual organisation
VirtualOrganisation = calice

$ ganga

*** Welcome to Ganga ***
Version: Ganga-5-0-8
Documentation and support:
Type help() or help('index') for online help. -- works

Although the path says LHCb it's the Reference Manual for Ganga Public Interface (GPI):;filename=Ganga_EGEE_Tutorial_EGEE_UF.ppt

Books I can recommend

* Object-Oriented Analysis and Design -

* Thinking in C/C++/Java ... - - Free electronic versions, but they are worth buying them.

* (In german language) zsh -

SebastianRichter (last edited 2010-04-15 12:14:00 by BenjaminLutz)