]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALDigitizer.cxx
New version of the EMCAL code: bug fixes, new digitisation classes (B.Nilsen)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigitizer.cxx
CommitLineData
61e0abb5 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//_________________________________________________________________________
19//*-- Author : Dmitri Peressounko (SUBATECH & Kurchatov Institute)
20//////////////////////////////////////////////////////////////////////////////
21// Class performs digitization of Summable digits (in the EMCAL case this is just
22// sum of contributions of all primary particles into given cell).
23// In addition it performs mixing of summable digits from different events.
24//
25// For each event two branches are created in TreeD:
26// "EMCAL" - list of digits
27// "AliEMCALDigitizer" - AliEMCALDigitizer with all parameters used in digitization
28//
29// Note, that one cset title for new digits branch, and repeat digitization with
30// another set of parameters.
31//
32// Examples of use:
33// root[0] AliEMCALDigitizer * d = new AliEMCALDigitizer() ;
34// root[1] d->ExecuteTask()
35// Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
36// //Digitizes SDigitis in all events found in file galice.root
37//
38// root[2] AliEMCALDigitizer * d1 = new AliEMCALDigitizer("galice1.root") ;
39// // Will read sdigits from galice1.root
40// root[3] d1->MixWith("galice2.root")
41// Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
42// // Reads another portion of sdigits from galice2.root
43// root[3] d1->MixWith("galice3.root")
44// // Reads another portion of sdigits from galice3.root
45// root[4] d->ExecuteTask("deb timing")
46// // Reads SDigits from files galice1.root, galice2.root ....
47// // mixes them and stores produced Digits in file galice1.root
48// // deb - prints number of produced digits
49// // deb all - prints list of produced digits
50// // timing - prints time used for digitization
51//
52
53// --- ROOT system ---
54#include "TFile.h"
55#include "TTree.h"
56#include "TSystem.h"
57#include "TROOT.h"
58#include "TFolder.h"
59#include "TObjString.h"
60#include "TBenchmark.h"
61// --- Standard library ---
62#include <iomanip.h>
63
64// --- AliRoot header files ---
65
66#include "AliRun.h"
67#include "AliEMCALDigit.h"
68#include "AliEMCALHit.h"
69#include "AliEMCALv1.h"
70#include "AliEMCALDigitizer.h"
71#include "AliEMCALSDigitizer.h"
72#include "AliEMCALGeometry.h"
73
74ClassImp(AliEMCALDigitizer)
75
76
77//____________________________________________________________________________
78 AliEMCALDigitizer::AliEMCALDigitizer():TTask("AliEMCALDigitizer","")
79{
80 // ctor
81
82 fSDigitizer = 0 ;
83 fNinputs = 1 ;
84 fPinNoise = 0.01 ;
85 fEMCDigitThreshold = 0.01 ;
86 fInitialized = kFALSE ;
87
88 fHeaderFiles = 0;
89 fSDigitsTitles = 0;
90 fSDigits = 0 ;
91 fDigits = 0;
92
93}
94//____________________________________________________________________________
95void AliEMCALDigitizer::Init(){
96// Makes all memory allocations
97
98 if(!fInitialized){
99
100 fHeaderFiles = new TClonesArray("TObjString",1) ;
101 new((*fHeaderFiles)[0]) TObjString("galice.root") ;
102
103 //Test, if this file already open
104
105 TFile *file = (TFile*) gROOT->GetFile(((TObjString *) fHeaderFiles->At(0))->GetString() ) ;
106
107 if(file == 0){
108 file = new TFile(((TObjString *) fHeaderFiles->At(0))->GetString(),"update") ;
109 gAlice = (AliRun *) file->Get("gAlice") ;
110 }
111 else
112 file = new TFile(((TObjString *) fHeaderFiles->At(0))->GetString()) ;
113
114 file->cd() ;
115
116 fSDigitsTitles = new TClonesArray("TObjString",1);
117 new((*fSDigitsTitles)[0]) TObjString("") ;
118
119 fSDigits = new TClonesArray("TClonesArray",1) ;
120 new((*fSDigits)[0]) TClonesArray("AliEMCALDigit",1000) ;
121
122 fSDigitizer = 0 ;
123
124 fDigitsTitle = "" ;
125
126 fDigits = new TClonesArray("AliEMCALDigit",200000) ;
127
128 fIevent = new TArrayI(1) ;
129 fIevent->AddAt(-1,0 ) ;
130 fIeventMax = new TArrayI(1) ;
131
132 fIeventMax->AddAt((Int_t) gAlice->TreeE()->GetEntries(), 0 );
133
134 // add Task to //root/Tasks folder
135 TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
136 roottasks->Add(this) ;
137
138 fInitialized = kTRUE ;
139 }
140
141}
142
143//____________________________________________________________________________
144AliEMCALDigitizer::AliEMCALDigitizer(const char *headerFile,const char *sDigitsTitle):
145 TTask("AliEMCALDigitizer","")
146{
147 // ctor
148 fHeaderFiles = new TClonesArray("TObjString",1) ;
149 new((*fHeaderFiles)[0]) TObjString(headerFile) ;
150
151 // Header file, where result will be stored
152 TFile * file = (TFile*) gROOT->GetFile(((TObjString *) fHeaderFiles->At(0))->GetString() ) ;
153 if(file==0){
154 if(((TObjString *) fHeaderFiles->At(0))->GetString().Contains("rfio"))
155 file = TFile::Open(((TObjString *) fHeaderFiles->At(0))->GetString(),"update") ;
156 else
157 file = new TFile(((TObjString *) fHeaderFiles->At(0))->GetString(),"update") ;
158 gAlice = (AliRun *) file->Get("gAlice") ; //If not read yet
159 }
160
161 file->cd() ;
162
163 fSDigitsTitles = new TClonesArray("TObjString",1); // Title name of the SDigits branch
164 new((*fSDigitsTitles)[0]) TObjString(sDigitsTitle) ;
165
166 fSDigits = new TClonesArray("TClonesArray",1) ; // here list of SDigits wil be stored
167 new((*fSDigits)[0]) TClonesArray("AliEMCALDigit",1000) ;
168
169 fDigits = new TClonesArray("AliEMCALDigit",200000) ;
170
171 fDigitsTitle = "" ;
172
173
174 fSDigitizer = 0 ;
175
176 fIevent = new TArrayI(1) ;
177 fIevent->AddAt(-1,0 ) ;
178 fIeventMax = new TArrayI(1) ;
179
180 // Get number of events to process
181 fIeventMax->AddAt((Int_t) gAlice->TreeE()->GetEntries(), 0 );
182
183 fNinputs = 1 ;
184
185 fPinNoise = 0.01 ;
186 fEMCDigitThreshold = 0.01 ;
187
188 // add Task to //root/Tasks folder
189 TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
190 roottasks->Add(this) ;
191 fInitialized = kTRUE ;
192
193}
194
195//____________________________________________________________________________
196 AliEMCALDigitizer::~AliEMCALDigitizer()
197{
198 // dtor
199
200 if(fHeaderFiles) delete fHeaderFiles ;
201 if(fSDigitsTitles) delete fSDigitsTitles ;
202 if(fSDigits) delete fSDigits ;
203 if(fDigits) delete fDigits ;
204}
205//____________________________________________________________________________
206void AliEMCALDigitizer::Reset() {
207 //sets current event number to the first simulated event
208
209 if(!fInitialized)
210 Init() ;
211
212 Int_t inputs ;
213 for(inputs = 0; inputs < fNinputs ;inputs++)
214 fIevent->AddAt(-1, inputs ) ;
215
216}
217//____________________________________________________________________________
218Bool_t AliEMCALDigitizer::Combinator() {
219
220 //Makes all desirable combinations Signal+Background,
221 // returns kFALSE when all combinations are made
222 // May be useful to introduce some options like "One-to-One", "All-to-One" and "All-to-All" ?
223
224 //realizing "One-to-One" option...
225
226 if(!fInitialized)
227 Init() ;
228
229 Int_t inputs ;
230 Bool_t endNotReached = kTRUE ;
231
232 for(inputs = 0; (inputs < fNinputs) && endNotReached ;inputs++){
233 if(fIevent->At(inputs)+1 < fIeventMax->At(inputs))
234 fIevent->AddAt(fIevent->At(inputs)+1, inputs ) ;
235 else
236 if(inputs == 0)
237 endNotReached = kFALSE ;
238 else //for inputs other than base one start from the beginning
239 fIevent->AddAt(0, inputs ) ;
240
241 }
242 return endNotReached ;
243
244}
245
246//____________________________________________________________________________
247void AliEMCALDigitizer::Digitize(Option_t *option) {
248
249 // Makes the digitization of the collected summable digits
250 // for this it first creates the array of all EMCAL modules
251 // filled with noise (different for EMC, CPV and PPSD) and
252 // after that adds contributions from SDigits. This design
253 // helps to avoid scanning over the list of digits to add
254 // contribution of any new SDigit.
255
256 if(!fInitialized)
257 Init() ;
258
259 fDigits->Clear() ;
260
261 AliEMCAL * EMCAL = (AliEMCAL *) gAlice->GetDetector("EMCAL") ;
262 AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance( EMCAL->GetGeometry()->GetName(), EMCAL->GetGeometry()->GetTitle() );
263
264 //Making digits with noise, first EMC
265 Int_t nEMC = geom->GetNPhi()*geom->GetNZ();
266 Int_t absID ;
267 TString name = geom->GetName() ;
268
269 for(absID = 1; absID <= nEMC; absID++){
270 Float_t noise = gRandom->Gaus(0., fPinNoise) ;
271 new((*fDigits)[absID-1]) AliEMCALDigit( -1,-1, absID,fSDigitizer->Digitize(noise) ) ;
272 }
273
274
275 // Now look throught (unsorted) list of SDigits and add corresponding digits
276 AliEMCALDigit *curSDigit ;
277 AliEMCALDigit *digit ;
278
279 Int_t inputs;
280 for(inputs = 0; inputs< fNinputs ; inputs++){ //loop over (possible) merge sources
281
282 TClonesArray * sdigits= (TClonesArray *)fSDigits->At(inputs) ;
283 Int_t isdigit ;
284
285 Int_t nSDigits = sdigits->GetEntries() ;
286 for(isdigit=0;isdigit< nSDigits; isdigit++){
287 curSDigit = (AliEMCALDigit *)sdigits->At(isdigit) ;
288 if(inputs) //Shift primaries for non-background sdigits
289 curSDigit->ShiftPrimary(inputs) ;
290 digit = (AliEMCALDigit *)fDigits->At(curSDigit->GetId() - 1);
291 *digit = *digit + *curSDigit ;
292 }
293 }
294
295
296 //remove digits below thresholds
297 for(absID = 0; absID < nEMC ; absID++)
298 if(fSDigitizer->Calibrate(((AliEMCALDigit*)fDigits->At(absID))->GetAmp()) < fEMCDigitThreshold)
299 fDigits->RemoveAt(absID) ;
300
301 fDigits->Compress() ;
302
303 Int_t ndigits = fDigits->GetEntriesFast() ;
304
305 fDigits->Expand(ndigits) ;
306
307
308 //Set indexes in list of digits
309 Int_t i ;
310 for (i = 0 ; i < ndigits ; i++) {
311 AliEMCALDigit * digit = (AliEMCALDigit *) fDigits->At(i) ;
312 digit->SetIndexInList(i) ;
313 }
314}
315//____________________________________________________________________________
316void AliEMCALDigitizer::WriteDigits(){
317
318 // Made TreeD in the output file. Check if branch already exists: if yes, exits
319 // without writing: ROOT TTree does not suppert overwriting/updating of the
320 // already existing branches. Creates branch with Digits, named "EMCAL", title "...",
321 // and branch "AliEMCALDigitizer", with the same title to keep all the parameters
322 // and names of files, from which digits are made.
323
324 gAlice->GetEvent(fIevent->At(0)) ; // Suitable only for One-To-One mixing
325 gAlice->SetEvent(fIevent->At(0)) ; // for all-to-all will produce a lot of branches in TreeD
326
327 if(gAlice->TreeD()==0)
328 gAlice->MakeTree("D") ;
329
330 //Check, if this branch already exits?
331 TBranch * digitsBranch = 0;
332 TBranch * digitizerBranch = 0;
333
334 TObjArray * branches = gAlice->TreeD()->GetListOfBranches() ;
335 Int_t ibranch;
336 Bool_t emcalNotFound = kTRUE ;
337 Bool_t digitizerNotFound = kTRUE ;
338
339 for(ibranch = 0;ibranch <branches->GetEntries();ibranch++){
340
341 if(emcalNotFound){
342 digitsBranch=(TBranch *) branches->At(ibranch) ;
343 if( (strcmp("EMCAL",digitsBranch->GetName())==0 ) &&
344 (fDigitsTitle.CompareTo(digitsBranch->GetTitle()) == 0) )
345 emcalNotFound = kFALSE ;
346 }
347 if(digitizerNotFound){
348 digitizerBranch = (TBranch *) branches->At(ibranch) ;
349 if( (strcmp(digitizerBranch->GetName(),"AliEMCALDigitizer") == 0) &&
350 (fDigitsTitle.CompareTo(digitizerBranch->GetTitle()) == 0))
351 digitizerNotFound = kFALSE ;
352 }
353 }
354
355
356 if(!(digitizerNotFound && emcalNotFound)){
357 cout << "AliEMCALDigitizer error: " << endl ;
358 cout << " can not update/overwrite existing branches "<< endl ;
359 cout << " do not write " << endl ;
360 return ;
361 }
362
363 // create new branches
364
365 //First generate file name
366 char * file =0;
367 if(gSystem->Getenv("CONFIG_SPLIT_FILE")){ //generating file name
368 file = new char[strlen(gAlice->GetBaseFile())+20] ;
369 sprintf(file,"%s/EMCAL.Digits.root",gAlice->GetBaseFile()) ;
370 }
371
372 TDirectory *cwd = gDirectory;
373
374 //First create list of sdigits
375 Int_t bufferSize = 32000 ;
376 digitsBranch = gAlice->TreeD()->Branch("EMCAL",&fDigits,bufferSize);
377 digitsBranch->SetTitle(fDigitsTitle.Data());
378 if (file) {
379 digitsBranch->SetFile(file);
380 TIter next( digitsBranch->GetListOfBranches());
381 TBranch * sbr ;
382 while ((sbr=(TBranch*)next())) {
383 sbr->SetFile(file);
384 }
385 cwd->cd();
386 }
387
388 //second - create Digitizer
389 Int_t splitlevel = 0 ;
390 AliEMCALDigitizer * d = this ;
391 digitizerBranch = gAlice->TreeD()->Branch("AliEMCALDigitizer","AliEMCALDigitizer",
392 &d,bufferSize,splitlevel);
393 digitizerBranch->SetTitle(fDigitsTitle.Data());
394 if (file) {
395 digitizerBranch->SetFile(file);
396 TIter next( digitizerBranch->GetListOfBranches());
397 TBranch * sbr;
398 while ((sbr=(TBranch*)next())) {
399 sbr->SetFile(file);
400 }
401 cwd->cd();
402 }
403
404 digitsBranch->Fill() ;
405 digitizerBranch->Fill() ;
406
407 gAlice->TreeD()->Write(0,kOverwrite) ;
408
409 //remove fSDigitizer before new event.
410 if(fSDigitizer){
411 delete fSDigitizer ;
412 fSDigitizer = 0 ;
413 }
414
415
416}
417
418//____________________________________________________________________________
419void AliEMCALDigitizer::Exec(Option_t *option) {
420 // Managing method
421
422 if(!fInitialized) Init() ;
423
424 if(strstr(option,"tim"))
425 gBenchmark->Start("EMCALDigitizer");
426
427 //reset events numbers to start from the beginnig
428 Reset() ;
429
430 while(Combinator()){
431
432 if(!ReadSDigits()) //read sdigits event(s) evaluated by Combinator() from file(s)
433 return ;
434
435 Digitize(option) ; //Add prepared SDigits to digits and add the noise
436 WriteDigits() ;
437
438 if(strstr(option,"deb"))
439 PrintDigits(option);
440
441 }
442
443 if(strstr(option,"tim")){
444 gBenchmark->Stop("EMCALDigitizer");
445 cout << "AliEMCALDigitizer:" << endl ;
446 cout << " took " << gBenchmark->GetCpuTime("EMCALDigitizer") << " seconds for SDigitizing "
447 << gBenchmark->GetCpuTime("EMCALDigitizer")/(fIeventMax->At(0)) << " seconds per event " << endl ;
448 cout << endl ;
449 }
450
451}
452
453//__________________________________________________________________
454Bool_t AliEMCALDigitizer::ReadSDigits(){
455// Reads summable digits from the opened files for the particular set of events given by fIevent
456
457 if(!fInitialized) Init() ;
458
459
460 Int_t inputs ;
461 for(inputs = fNinputs-1; inputs >= 0; inputs --){
462
463 Int_t event = fIevent->At(inputs) ;
464
465 TFile * file = (TFile*) gROOT->GetFile(((TObjString *) fHeaderFiles->At(inputs))->GetString() ) ;
466 file->cd() ;
467
468 // Get SDigits Tree header from file
469 char treeName[20];
470 sprintf(treeName,"TreeS%d",event);
471 TTree * treeS = (TTree*)file->Get(treeName);
472
473 if(treeS==0){
474 cout << "Error at AliEMCALDigitizer: no "<<treeName << " in file " << file->GetName() << endl ;
475 cout << "Do nothing " << endl ;
476 return kFALSE ;
477 }
478
479 TBranch * sdigitsBranch = 0;
480 TBranch * sdigitizerBranch = 0;
481
482 TObjArray * branches = treeS->GetListOfBranches() ;
483 Int_t ibranch;
484 Bool_t emcalNotFound = kTRUE ;
485 Bool_t sdigitizerNotFound = kTRUE ;
486
487 for(ibranch = 0;ibranch <branches->GetEntries();ibranch++){
488
489 if(emcalNotFound){
490 sdigitsBranch=(TBranch *) branches->At(ibranch) ;
491 if(( strcmp("EMCAL",sdigitsBranch->GetName())==0 ) &&
492 ((TObjString*) fSDigitsTitles->At(inputs))->GetString().CompareTo(sdigitsBranch->GetTitle())== 0 )
493 emcalNotFound = kFALSE ;
494
495 }
496
497 if(sdigitizerNotFound){
498 sdigitizerBranch = (TBranch *) branches->At(ibranch) ;
499 if(( strcmp(sdigitizerBranch->GetName(),"AliEMCALSDigitizer") == 0) &&
500 ((TObjString*) fSDigitsTitles->At(inputs))->GetString().CompareTo(sdigitizerBranch->GetTitle())== 0 )
501 sdigitizerNotFound = kFALSE ;
502
503 }
504 }
505
506 if(sdigitizerNotFound || emcalNotFound){
507 cout << "Can't find Branch with sdigits or SDigitizer in the file " ;
508 if( ((TObjString*)fSDigitsTitles->At(inputs))->GetString().IsNull() )
509 cout << file->GetName() << endl ;
510 else
511 cout << ((TObjString*)fSDigitsTitles->At(inputs))->GetString().Data() << endl ;
512 cout << "Do nothing" <<endl ;
513 return kFALSE ;
514 }
515
516 TClonesArray * sdigits = (TClonesArray*) fSDigits->At(inputs) ;
517 sdigitsBranch->SetAddress(&sdigits) ;
518
519 AliEMCALSDigitizer *sDigitizer = new AliEMCALSDigitizer();
520 sdigitizerBranch->SetAddress(&sDigitizer) ;
521
522 sdigitsBranch->GetEntry(0) ;
523 sdigitizerBranch->GetEntry(0) ;
524
525 if(fSDigitizer == 0)
526 fSDigitizer = sDigitizer ;
527 else
528 if(!((*fSDigitizer)==(*sDigitizer)) ){
529 cout << "AliEMCALDigitizer ERROR:" << endl ;
530 cout << " you are using sdigits made with different SDigitizers" << endl ;
531 cout << "fSD " << fSDigitizer << " SD" << sDigitizer << endl ;
532 fSDigitizer->Print("") ;
533 sDigitizer->Print("") ;
534 cout << "Do Nothing " << endl ;
535 return kFALSE ;
536 }
537
538 }
539 fPedestal = fSDigitizer->GetPedestalParameter() ;
540 fSlope = fSDigitizer->GetCalibrationParameter() ;
541
542 return kTRUE ;
543
544}
545//__________________________________________________________________
546void AliEMCALDigitizer::MixWith(char* HeaderFile, char* sDigitsTitle){
547 // Alows produce digits by superimposing background and signal event.
548 // It is assumed, that headers file with SIGNAL events is opened in
549 // constructor, and now we set the BACKGROUND event, with which we
550 // will mix. Thus we avoid writing (changing) huge and expencive
551 // backgound files: all output will be writen into SIGNAL, i.e.
552 // opened in constructor file.
553 //
554 // One can open as many files to mix with as one wants.
555
556
557 if(!fInitialized)
558 Init() ;
559
560
561 if(HeaderFile == 0){
562 cout << "Specify at least header file to merge"<< endl ;
563 return ;
564 }
565
566 Int_t inputs ;
567 for(inputs = 0; inputs < fNinputs ; inputs++){
568 if(strcmp(((TObjString *)fHeaderFiles->At(inputs))->GetString(),HeaderFile) == 0 ){
569 if(sDigitsTitle == 0){
570 if(((TObjString*)fSDigitsTitles->At(inputs))->GetString().CompareTo("") == 0){
571 cout << "Entry already exists, do not add" << endl ;
572 return ;
573 }
574 }
575 else
576 if(((TObjString*)fSDigitsTitles->At(inputs))->GetString().CompareTo(sDigitsTitle)){
577 cout << "Entry already exists, do not add" << endl ;
578 return;
579 }
580 }
581 }
582
583 fHeaderFiles->Expand(fNinputs+1) ;
584 new((*fHeaderFiles)[fNinputs]) TObjString(HeaderFile) ;
585
586
587 TFile * file = new TFile(((TObjString *) fHeaderFiles->At(fNinputs))->GetString()) ;
588
589 file->cd() ;
590
591 fSDigitsTitles->Expand(fNinputs+1) ;
592 new((*fSDigitsTitles)[fNinputs]) TObjString(sDigitsTitle) ;
593
594 fSDigits->Expand(fNinputs+1) ;
595 new((*fSDigits)[fNinputs]) TClonesArray("AliEMCALDigit",1000) ;
596
597 fIevent->Set(fNinputs+1) ;
598 fIevent->AddAt(-1, fNinputs) ;
599
600 fIeventMax->Set(fNinputs+1) ;
601
602 TTree * te = (TTree *) file->Get("TE") ;
603 fIeventMax->AddAt((Int_t) te->GetEntries(), fNinputs );
604
605 fNinputs++ ;
606
607}
608//__________________________________________________________________
609void AliEMCALDigitizer::Print(Option_t* option)const {
610
611 if(fInitialized){
612
613 cout << "------------------- "<< GetName() << " -------------" << endl ;
614 cout << "Digitizing sDigits from file(s): " <<endl ;
615 Int_t input ;
616 for(input = 0; input < fNinputs ; input++) {
617 cout << " " << ((TObjString *) fHeaderFiles->At(input))->GetString() <<
618 " Branch title:" << ((TObjString *) fSDigitsTitles->At(input))->GetString() << endl ;
619 }
620 cout << endl ;
621 cout << "Writing digits to " << ((TObjString *) fHeaderFiles->At(0))->GetString() << endl ;
622
623 cout << endl ;
624 cout << "With following parameters: " << endl ;
625 cout << " Electronics noise in EMC (fPinNoise) = " << fPinNoise << endl ;
626 cout << " Threshold in EMC (fEMCDigitThreshold) = " << fEMCDigitThreshold << endl ; ;
627 cout << "---------------------------------------------------" << endl ;
628 }
629 else
630 cout << "AliEMCALDigitizer not initialized " << endl ;
631
632}
633//__________________________________________________________________
634void AliEMCALDigitizer::PrintDigits(Option_t * option){
635
636 cout << "AliEMCALDigitiser:"<< endl ;
637 cout << " Number of entries in Digits list " << fDigits->GetEntriesFast() << endl ;
638 cout << endl ;
639 if(strstr(option,"all")){
640
641 //loop over digits
642 AliEMCALDigit * digit;
643 cout << "Digit Id " << " Amplitude " << " Index " << " Nprim " << " Primaries list " << endl;
644 Int_t index ;
645 for (index = 0 ; index < fDigits->GetEntries() ; index++) {
646 digit = (AliEMCALDigit * ) fDigits->At(index) ;
647 cout << setw(8) << digit->GetId() << " " << setw(3) << digit->GetAmp() << " "
648 << setw(6) << digit->GetIndexInList() << " "
649 << setw(5) << digit->GetNprimary() <<" ";
650
651 Int_t iprimary;
652 for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
653 cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
654 cout << endl;
655 }
656
657 }
658}
659//__________________________________________________________________
660void AliEMCALDigitizer::SetSDigitsBranch(const char* title){
661 // we set title (comment) of the SDigits branch in the first! header file
662 if(!fInitialized) Init() ;
663
664 ((TObjString*) fSDigitsTitles->At(0) )->SetString((char*)title) ;
665
666}
667//__________________________________________________________________
668void AliEMCALDigitizer::SetDigitsBranch(const char* title){
669 //Sets the title (comment) of the branch to which Digits branch
670 if(!fInitialized) Init() ;
671
672 fDigitsTitle = title ;
673
674}