Sebastian Richter

1d / 28b

phone: 1502

email: sebastian.richter@desy.de

HCAL

CALICE Hcal Guide (DRAFT)

Disclaimer: This guide is not intended to be an introduction to Marlin and lcio et. al. Take a look at http://ilcsoft.desy.de/portal.

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

calibration_and_digitization_inheritance.png

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

file:///data/richters/calice-devel/calice_reco/build/doc/RAW2CALOHIT/html/classCALICE_1_1IntegratedHcalCalibrationProcessor.html

The following picture shows the database inputs of the SiPmPropertiesProcessor.

SiPmPropertiesProcessor_inputs.png

The IntegratedHcalProcessor has even more.

IntegratedHcalProcessor_inputs.png

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

Reconstruction_scheme.png

The digitization looks like this.

Digitization_scheme.png

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;

CM.conditionsChanged(col);

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 1.1.2.1 pulled onto this branch
pick 0025bdc Revision 1.1.2.1 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.

ilcsoft

lcio

CellID(En/De)coding

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;
myCellIDEncoder.setCellID(newHit);

No more bit shifting!

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

Explanation of the encoding string:

"I:16:8,J:8:8,K:0:8"
 ^  ^ ^
 |  | |_ width
 |  |_ start bit
 |_ name

misc

get a decent recent LaTeX

If you want to use a more recent LaTeX try:

$ ini texlive
$ which latex
/afs/desy.de/products/texlive/2008/bin/i386-linux/latex

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

How to save paper

pdf2ps bigdoc.pdf
or pdftops
psnup -2 bigdoc.ps bigdoc-2perSheet.ps

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

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

/afs/desy.de/user/r/richters/calice-devel/marlin-install/bin/Marlin: symbol lookup error: /afs/desy.de/user/r/richters/calice-devel/calice-install/lib/libPrivate.so: 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

http://telin.ugent.be/~slippens/drupal/extract-images-from-pdf-documents

Search for bit shifting

Like "<< or >> $number:

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

RootTreeWriter wishlisht

emacs

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"

ROOT

useful introduction

http://hepunx.rl.ac.uk/BFROOT/www/doc/workbook/root1/root1.html

cope with large labels

  gPad->SetLeftMargin(0.15);
  gPad->SetBottomMargin(0.15);

Draw graph with errors without errors

http://root.cern.ch/root/html/TGraphPainter.html#TGraphPainter:PaintGraphErrors

  t->Draw("[]APz")

or try:

  t->Draw("px")

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: http://cern.ch/ganga
Type help() or help('index') for online help.

https://twiki.cern.ch/twiki/bin/view/Atlas/GangaTutorial5#2_2_Getting_started_with_a_Simpl -- works

Although the path says LHCb it's the Reference Manual for Ganga Public Interface (GPI):

http://ganga.web.cern.ch/ganga/release/5.0.10/reports/html/Manuals/GangaLHCbManual.html

https://twiki.cern.ch/twiki/bin/view/ArdaGrid/EGEETutorialPackage

https://twiki.cern.ch/twiki/bin/viewfile/ArdaGrid/EGEETutorialPackage?rev=1;filename=Ganga_EGEE_Tutorial_EGEE_UF.ppt

Books I can recommend

* Object-Oriented Analysis and Design - http://www.johndeacon.net/OOAandD/

* Thinking in C/C++/Java ... - http://www.mindview.net/Books - Free electronic versions, but they are worth buying them.

* (In german language) zsh - http://www.zshbuch.org


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