]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveHLT/AliEveHOMERManager.cxx
Set svn:keywords prop.
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManager.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 // Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
4 //         for The ALICE HLT Project.                                    *
5
6 //-*- Mode: C++ -*-
7
8 /** @file   AliEveHOMERManager.cxx
9     @author Jochen Thaeder
10     @date
11     @brief  Manger for HOMER in offline
12 */
13
14 #if __GNUC__>= 3
15    using namespace std;
16 #endif
17
18 #include "AliEveHOMERManager.h"
19
20 #define use_aliroot
21 #define use_root
22 #define ROWHOUGHPARAMS
23 #define use_reconstruction
24 #define use_newio
25 #define ROOTVERSION    "unchecked"
26 #define ALIROOTVERSION "unchecked"
27 #define __ROOT__
28 #define USE_ALILOG
29 #define LINUX
30
31 #define EVE_DEBUG 1
32 // -- -- -- -- -- -- -- 
33 #include "AliHLTHOMERLibManager.h"
34 #include "AliHLTHOMERSourceDesc.h"
35 #include "AliHLTHOMERBlockDesc.h"
36 // -- -- -- -- -- -- -- 
37 #include "AliEveHOMERSource.h"
38 // -- -- -- -- -- -- -- 
39 #include "TString.h"
40 #include <TApplication.h>
41 #include "Riostream.h"
42 #include "TXMLAttr.h"
43 #include "TCollection.h"
44 #include "TList.h"
45 #include "TObjString.h"
46 #include "TObjArray.h"
47 // -- -- -- -- -- -- -- 
48 #include "AliLog.h"
49 #include "AliTPCCalibPedestal.h"
50 #include "AliTPCCalibPulser.h"
51 #include "AliTPCCalibCE.h"
52 #include "AliTPCPreprocessorOnline.h"
53 #include "AliTPCCalROC.h"
54
55 //______________________________________________________________________________
56 //
57 // Manage connections to HLT data-sources.
58
59 ClassImp(AliEveHOMERManager)
60
61 /*
62  * ---------------------------------------------------------------------------------
63  *                            Constructor / Destructor
64  * ---------------------------------------------------------------------------------
65  */
66
67 //##################################################################################
68 AliEveHOMERManager::AliEveHOMERManager( TString xmlFile ) :
69   TEveElementList("AliEveHOMERManager"),
70   fLibManager(new AliHLTHOMERLibManager),
71   fXMLHandler( new AliEveHOMERXMLHandler( xmlFile ) ),
72   fSourceList(NULL),
73   fReader(NULL),
74   fBlockList(NULL),
75   fNBlks(0),
76   fEventID(0),
77   fCurrentBlk(0),
78   fConnected(kFALSE),
79   fStateHasChanged(kTRUE),
80   fSrcList(NULL),
81   fTPCPre(NULL) {
82   // This Class should handle the communication
83   // from the HLT to AliEVE. The HLT sends data via 
84   // the HOMER interface on several TCP ports of nodes 
85   // in the CERN GPN and DCS network.
86   // All this communication is hidden from the user.
87   // 
88   // Right now, a xml file ( SCC1 ) is used to get the
89   // configuration, this will/ has to change to a proxy
90   // running on dedicated nodes.
91
92 }
93
94 //##################################################################################
95 AliEveHOMERManager::~AliEveHOMERManager() {
96   // The destructor
97
98   if ( fLibManager ) {
99     if ( fReader )
100       fLibManager->DeleteReader(fReader);
101     delete fLibManager;
102     fLibManager = NULL;
103     fReader = NULL;
104   }
105
106   if ( fXMLHandler != NULL )
107     delete fXMLHandler;
108   fXMLHandler = NULL;
109
110   if ( fSourceList != NULL )
111     delete fSourceList;
112   fSourceList = NULL;
113
114   if ( fBlockList != NULL )
115     delete fBlockList;
116   fBlockList = NULL;
117
118  if ( fSrcList != NULL )
119     delete fSrcList;
120   fSrcList = NULL;
121   
122   if ( fTPCPre != NULL )
123     delete fTPCPre;
124   fTPCPre = NULL;
125
126 }
127
128 /*
129  * ---------------------------------------------------------------------------------
130  *                                 Source Handling
131  * ---------------------------------------------------------------------------------
132  */
133
134 //##################################################################################
135 Int_t AliEveHOMERManager::CreateHOMERSourcesList() {
136   // Create Sources List from HOMER-Proxy
137
138   Int_t iResult = 0;
139
140   // -- Initialize sources list
141   DestroyElements();
142   if ( fSourceList != NULL )
143     delete fSourceList;
144   fSourceList = NULL;
145
146   fSourceList = new TList();
147   fSourceList->SetOwner( kTRUE );
148
149   iResult = fXMLHandler->FillSourceList( fSourceList );
150
151   if ( iResult ) {
152     AliWarning( Form("There have been errors, while creating the sources list.") );
153   }
154   else {
155     AliInfo( Form("New sources list created.") );
156
157     // -- New SourceList has been created --> All Sources are new --> State has changed
158     fStateHasChanged = kTRUE;
159  
160     if ( fSrcList ) 
161       delete fSrcList;
162
163     // -- Create new AliEVE sources list 
164     fSrcList = new AliEveHOMERSourceList("HLT Sources");
165     fSrcList->SetManager(this);
166     
167     AddElement(fSrcList);
168     fSrcList->CreateByType();
169   }
170
171   return iResult;
172 }
173
174 //##################################################################################
175 void AliEveHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
176   // Set state of a source
177   // * param source      Pointer to AliHLTHOMERSourceDesc object.
178   // * param state       New (selected/not selected) state.
179   
180   if ( source->IsSelected() != state ) {
181     source->SetState( state );
182     fStateHasChanged = kTRUE;
183   }
184
185   return;
186 }
187
188 /*
189  * ---------------------------------------------------------------------------------
190  *                            Connection Handling
191  * ---------------------------------------------------------------------------------
192  */
193
194 //##################################################################################
195 Int_t AliEveHOMERManager::ConnectHOMER(){
196   // Connect to HOMER sources, out of Readout List, which gets created when state has changed
197   // * return            0 on sucess, "HOMER" errors on error
198
199   Int_t iResult = 0;
200
201   fStateHasChanged = fSrcList->GetSelectedSources();
202
203   // -- Check if already connected and state has not changed
204   if ( fStateHasChanged == kFALSE && IsConnected() ) {
205     AliInfo( Form("No need for reconnection.") );
206     return iResult;
207   }
208
209   // -- If already connected, disconnect before connect
210   if ( IsConnected() )
211     DisconnectHOMER();
212
213   // *** Create the Readoutlist
214
215   UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
216   const char ** sourceHostnames = new const char* [fSourceList->GetEntries()];
217   UInt_t sourceCount = 0;
218
219   CreateReadoutList( sourceHostnames, sourcePorts, sourceCount );
220
221   if ( sourceCount == 0 ) {
222     AliError(Form("No sources selected, aborting.") );
223     return iResult;
224   }
225
226   // *** Connect to data sources
227
228   if ( !fReader ) {
229     if ( fLibManager )
230       fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
231   }
232
233   iResult = fReader->GetConnectionStatus();
234
235   if ( iResult ) {
236     // -- Connection failed
237
238     UInt_t ndx = fReader->GetErrorConnectionNdx();
239
240     if ( ndx < sourceCount ) {
241       AliError( Form("Error : Error establishing connection to TCP source %s:%hu: %s (%d)",
242                      sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult) );
243     }
244     else {
245       AliError( Form("Error : Error establishing connection to unknown source with index %d: %s (%d)",
246                      ndx, strerror(iResult), iResult) );
247     }
248
249     if ( fReader )
250       fLibManager->DeleteReader( fReader );
251     fReader = NULL;
252
253   }
254   else {
255     // -- Connection ok - set reader
256     fConnected = kTRUE;
257
258     AliInfo( Form("Connection established") );
259   }
260
261   delete[] sourceHostnames;
262   delete[] sourcePorts;
263
264   return iResult;
265 }
266
267 //##################################################################################
268 void AliEveHOMERManager::DisconnectHOMER(){
269   // Disconnect from HOMER sources
270
271   if ( ! IsConnected() )
272     return;
273
274   if ( fReader )
275     fLibManager->DeleteReader( fReader );
276   fReader = NULL;
277
278   fStateHasChanged = kTRUE;
279   fConnected = kFALSE;
280
281   AliInfo( Form("Connection closed") );
282
283   return;
284 }
285
286 //##################################################################################
287 Int_t AliEveHOMERManager::ReconnectHOMER(){
288   // Reconnect from HOMER sources
289   // * return            0 on sucess, "ConnectHOMER()" errors on error
290
291   Int_t iResult = 0;
292
293   if ( IsConnected() )
294     DisconnectHOMER();
295
296   iResult = ConnectHOMER();
297   if ( iResult ) {
298     AliError( Form("Error connecting.") );
299   }
300
301   return iResult;
302 }
303
304 //##################################################################################
305 void AliEveHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts, UInt_t &sourceCount ){
306   //  Create a readout list for Hostname and ports
307   // * param socurceHostnames   Array of selected hostnames
308   // * param socurcePorts       Array of selected ports
309   // * param socurceCount       Number of selected hostname:port
310
311   AliHLTHOMERSourceDesc * source= NULL;
312
313   // -- Read all sources and check if they should be read out
314   TIter next( fSourceList );
315   while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
316
317     if ( ! source->IsSelected() )
318       continue;
319
320     Bool_t exists = kFALSE;
321
322     // -- Loop over existing entries and check if entry is already in readout list
323     for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
324       if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() ) &&  sourcePorts[ii] == source->GetPort() ) {
325         exists = kTRUE;
326         break;
327       }
328     }
329
330     // -- Add new entires to readout list
331     if ( ! exists ) {
332       sourcePorts[sourceCount] = source->GetPort();
333       sourceHostnames[sourceCount] = source->GetHostname().Data();
334       sourceCount++;
335     }
336
337   } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
338
339   fStateHasChanged = kFALSE;
340
341   return;
342 }
343
344 /*
345  * ---------------------------------------------------------------------------------
346  *                            Event Handling
347  * ---------------------------------------------------------------------------------
348  */
349
350 //##################################################################################
351 Int_t AliEveHOMERManager::NextEvent(){
352   // Loads the next Event, after being connected
353   // * return            0 on sucess, "HOMER" errors on error
354
355   Int_t iResult = 0;
356   Int_t iRetryCount = 0;
357
358   if ( !fReader || ! IsConnected() ) {
359     AliWarning( Form( "Not connected yet." ) );
360     return 1;
361   }
362
363   //  fReader->SetEventRequestAdvanceTime( 20000000 /*timeout in us*/ );
364
365   // -- Read next event data and error handling for HOMER (error codes and empty blocks)
366   while( 1 ) {
367
368     iResult = fReader->ReadNextEvent( 40000000 /*timeout in us*/);
369
370     if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
371       Int_t ndx = fReader->GetErrorConnectionNdx();
372       AliError( Form("Error, No Connection to source %d: %s (%d)", 
373                      ndx, strerror(iResult), iResult) );
374       return 2;
375     }
376     else if ( iResult == 110 ) {
377       Int_t ndx = fReader->GetErrorConnectionNdx();
378       AliError( Form("Timout occured, reading event from source %d: %s (%d)", 
379                      ndx, strerror(iResult), iResult) );
380       return 3;
381     }
382     else if ( iResult == 56) {
383       Int_t ndx = fReader->GetErrorConnectionNdx();
384
385       ++iRetryCount;
386
387       if ( iRetryCount >= 20 ) {
388         AliError( Form("Retry Failed: Error reading event from source %d: %s (%d)", 
389                        ndx, strerror(iResult), iResult) );
390         return 4;
391       }
392       else {
393         AliError( Form("Retry: Error reading event from source %d: %s (%d)", 
394                        ndx, strerror(iResult), iResult) );
395         continue;
396       }
397     }
398     else if ( iResult ) {
399       Int_t ndx = fReader->GetErrorConnectionNdx();
400       AliError( Form("General Error reading event from source %d: %s (%d)", 
401                      ndx, strerror(iResult), iResult) );
402       fConnected = kFALSE;
403       return 2;
404     }
405     else {
406       break;
407     }
408   } // while( 1 ) {
409
410   if ( iResult )
411     return iResult;
412   
413   // -- Get blockCnt and eventID
414   fNBlks = (ULong_t) fReader->GetBlockCnt();
415   fEventID = (ULong64_t) fReader->GetEventID();
416   fCurrentBlk = 0;
417
418   AliInfo( Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks) );
419
420 #if EVE_DEBUG
421   // Loop for Debug only
422   for ( ULong_t i = 0; i < fNBlks; i++ ) {
423     Char_t tmp1[9], tmp2[5];
424     memset( tmp1, 0, 9 );
425     memset( tmp2, 0, 5 );
426     void *tmp11 = tmp1;
427     ULong64_t* tmp12 = (ULong64_t*)tmp11;
428     *tmp12 = fReader->GetBlockDataType( i );
429     void *tmp21 = tmp2;
430     ULong_t* tmp22 = (ULong_t*)tmp21;
431     *tmp22 = fReader->GetBlockDataOrigin( i );
432     AliInfo( Form("Block %lu length: %lu - type: %s - origin: %s",
433                   i, fReader->GetBlockDataLength( i ), tmp1, tmp2) );
434   } // end for ( ULong_t i = 0; i < fNBlks; i++ ) {
435 #endif
436
437   // -- Create BlockList
438   AliInfo( Form("Create Block List") );
439   iResult = CreateBlockList();
440
441   return iResult;
442 }
443
444 //##################################################################################
445 Int_t AliEveHOMERManager::CreateBlockList() {
446   // Create a TList of blocks, which have been readout
447
448   Int_t iResult = 0;
449
450   // -- Initialize block list
451   if ( fBlockList != NULL )
452     delete fBlockList;
453   fBlockList = NULL;
454
455   fBlockList = new TList();
456   fBlockList->SetOwner( kTRUE );
457
458   void* iter = GetFirstBlk();
459
460   // -- Fill block list
461   while ( iter != NULL ){
462
463     // -- Create new block
464     AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc( GetBlk(), GetBlkSize(), GetBlkOrigin(),
465                                                              GetBlkType(), GetBlkSpecification() );
466
467     // -- Check sources list if block is requested
468     if ( CheckIfRequested( block ) )
469       fBlockList->Add( block );
470     else {
471       //The Following 2 line commented out and the previous is added.
472       //       delete block;
473       //       block = NULL;
474       fBlockList->Add( block );
475     }
476     iter = GetNextBlk();
477
478   } // while ( iter != NULL ){
479
480   return iResult;
481 }
482
483 /*
484  * ---------------------------------------------------------------------------------
485  *                            BlockHandling
486  * ---------------------------------------------------------------------------------
487  */
488
489 //##################################################################################
490 void* AliEveHOMERManager::GetBlk( Int_t ndx ) {
491   // Get pointer to current block in current event
492   // * param ndx        Block index
493   // * return           returns pointer to blk, NULL if no block present
494    
495   void* data = NULL;
496
497   if ( !fReader || ! IsConnected() ) {
498     AliError( Form("Not connected yet.") );
499   }
500   else {
501     if ( ( ndx ) < (Int_t) fNBlks )
502       data = (void*) fReader->GetBlockData( ndx );
503   }
504
505   return data;
506 }
507
508 //##################################################################################
509 ULong_t AliEveHOMERManager::GetBlkSize( Int_t ndx ) {
510   // Get size of block ndx
511   // * param ndx        Block index
512   // * return           returns pointer to blk, 0 if no block present
513    
514   ULong_t length = 0;
515
516   if ( !fReader || ! IsConnected() ) {
517     AliError( Form("Not connected yet.") );
518   }
519   else {
520     if ( ( ndx ) < (Int_t) fNBlks )
521       length = (ULong_t) fReader->GetBlockDataLength( ndx );
522   }
523
524   return length;
525 }
526
527 //##################################################################################
528 TString AliEveHOMERManager::GetBlkOrigin( Int_t ndx ) {
529   // Get origin of block ndx
530   // * param ndx        Block index
531   // * return           origin of block
532
533   TString origin = "";
534
535   // -- Check for Connection
536   if ( !fReader || ! IsConnected() ) {
537     AliError( Form("Not connected yet.") );
538     return origin;
539   }
540
541   // -- Check block index
542   if ( ( ndx ) >= (Int_t) fNBlks ) {
543     AliError( Form("Block index %d out of range.", ndx ) );
544     return origin;
545   }
546
547   // -- Get origin
548   union{
549     UInt_t data;
550     Char_t array[4];
551   } reverseOrigin;
552
553   reverseOrigin.data = (UInt_t) fReader->GetBlockDataOrigin( ndx );
554
555   // -- Reverse the order
556   for (Int_t ii = 3; ii >= 0; ii-- )
557     if ( reverseOrigin.array[ii] != ' ')
558       origin.Append( reverseOrigin.array[ii] );
559
560   return origin;
561 }
562
563 //##################################################################################
564 TString AliEveHOMERManager::GetBlkType( Int_t ndx ) {
565   // Get type of block ndx
566   // * param ndx        Block index
567   // * return           type of block
568
569   TString type = "";
570
571   // -- Check for Connection
572   if ( !fReader || ! IsConnected() ) {
573     AliError( Form("Not connected yet.") );
574     return type;
575   }
576
577   // -- Check blockk index
578   if ( ( ndx ) >= (Int_t) fNBlks ) {
579     AliError( Form("Block index %d out of range.", ndx ) );
580     return type;
581   }
582
583   // -- Get type
584   union{
585     ULong64_t data;
586     Char_t array[8];
587   } reverseType;
588
589   reverseType.data = (ULong64_t) fReader->GetBlockDataType( ndx );
590
591   // -- Reverse the order
592   for (Int_t ii = 7; ii >= 0; ii-- )
593     if ( reverseType.array[ii] != ' ')
594       type.Append( reverseType.array[ii] );
595
596   return type;
597 }
598
599 //##################################################################################
600 ULong_t AliEveHOMERManager::GetBlkSpecification( Int_t ndx ) {
601   // Get specification of block ndx
602   // * param ndx        Block index
603   // * return           specification of block
604
605   ULong_t spec = 0;
606
607   // -- Check for Connection
608   if ( !fReader || ! IsConnected() ) {
609     AliError( Form("Not connected yet.") );
610     return spec;
611   }
612
613   // -- Check blockk index
614   if ( ( ndx ) >= (Int_t) fNBlks ) {
615     AliError( Form("Block index %d out of range.", ndx ) );
616     return spec;
617   }
618
619   spec = (ULong_t) fReader->GetBlockDataSpec( ndx );
620
621   return spec;
622 }
623
624 //##################################################################################
625 Bool_t AliEveHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
626   // Checks if current Block should was requested
627   // * return           returns kTRUE, if block should was requested
628
629   Bool_t requested = kFALSE;
630
631   AliHLTHOMERSourceDesc * source= NULL;
632
633   // -- Read all sources and check if they should be read out
634   TIter next( fSourceList );
635   while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
636     
637     if ( ! source->IsSelected() )
638       continue;
639
640     if ( !( block->GetDetector().CompareTo( "*** " ) && block->GetDetector().CompareTo( "***" ) ) ) {
641       // if not any detector
642       if ( source->GetDetector().CompareTo( block->GetDetector() ) )
643         continue;
644     }
645
646     if ( ! ( block->GetDataType().CompareTo( "******* " ) && block->GetDataType().CompareTo( "******* " ) ) ) {
647       if ( source->GetDataType().CompareTo( block->GetDataType() ) )
648         continue;
649     }
650
651     if ( ! block->HasSubDetectorRange() ) {
652       if ( source->GetSubDetector().Atoi() != block->GetSubDetector().Atoi() )
653         continue;
654
655       if ( ! block->HasSubSubDetectorRange() ) {
656
657         if ( source->GetSubSubDetector().Atoi() != block->GetSubSubDetector().Atoi() )
658           continue;
659
660       } // if ( ! block->HasSubSubDetectorRange ) {
661     } //  if ( ! block->HasSubDetectorRange ) {
662
663     requested = kTRUE;
664     break;
665
666   } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
667   
668 #if EVE_DEBUG
669
670   if ( block->GetDataType().CompareTo("CLUSTERS") ) {
671   if ( requested ) {
672     AliError( Form("Block requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
673                    block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
674   }
675   else {
676     AliError( Form("Block NOT requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
677                    block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
678   }
679
680   }
681 #endif
682
683   return requested;
684 }
685
686 /*
687  * ---------------------------------------------------------------------------------
688  *                            Test Realm ....
689  * ---------------------------------------------------------------------------------
690  */
691
692 //##################################################################################
693 void AliEveHOMERManager::DumpTPCCalib(TString objectName, Bool_t dumpToFile) {
694   // Still under testing ...
695
696   if ( fTPCPre != NULL )
697     delete fTPCPre;
698
699   fTPCPre = new AliTPCPreprocessorOnline();
700
701   TList* blockList = GetBlockList();
702
703   AliHLTHOMERBlockDesc *desc = 0;
704
705   TIter next(blockList);
706
707   while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
708     if ( ! desc->IsTObject() )
709       continue;
710
711     Int_t sectorTPC = 0;
712
713     if ( desc->GetSubSubDetector().Atoi() <= 1 ) {
714       sectorTPC = desc->GetSubDetector().Atoi();
715     }
716     else {
717       sectorTPC = 36 + desc->GetSubDetector().Atoi();
718     }
719
720     if ( ! objectName.CompareTo( desc->GetClassName() ) ){
721
722       //
723       // AliTPCCalibPedestal
724       //
725
726       if ( ! objectName.CompareTo( "AliTPCCalibPedestal" ) ) {
727         AliTPCCalROC* calROC = NULL;
728
729         AliTPCCalibPedestal * cal = (AliTPCCalibPedestal*) desc->GetTObject();
730         if ( cal == NULL ) {
731           cout << "error 1" << endl;
732           continue;
733         }
734
735         cal->Analyse();
736
737         calROC = cal->GetCalRocRMS(sectorTPC);
738         if ( calROC == NULL ) {
739           cout << "error 2" << endl;
740           continue;
741         }
742
743         calROC->SetName(Form("RMS_ROC%d", sectorTPC));
744         fTPCPre->AddComponent((TObject*) calROC );
745
746         calROC = cal->GetCalRocPedestal(sectorTPC);
747         if ( calROC == NULL ) {
748           cout << "error 3" << endl;
749           continue;
750         }
751
752
753         calROC->SetName(Form("Pedestal_ROC%d", sectorTPC));
754         cout << "added" << endl;
755         fTPCPre->AddComponent((TObject*) calROC );
756       }
757
758       //
759       // AliTPCCalibPulser
760       //
761       /*
762       else if ( ! objectName.CompareTo( "AliTPCCalibPulser" ) ) {
763         AliTPCCalROC* calROC = NULL;
764
765         AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
766
767         cal->Analyse();
768
769         calROC = cal->GetCalRocT0(sectorTPC);
770         calROC->SetName(Form("T0_ROC%d", sectorTPC));
771         fTPCPre->AddComponent((TObject*) calROC );
772
773         calROC = cal->GetCalRocQ(sectorTPC);
774         calROC->SetName(Form("Q_ROC%d", sectorTPC));
775         fTPCPre->AddComponent((TObject*) calROC );
776
777         calROC = cal->GetCalRocRMS(sectorTPC);
778         calROC->SetName(Form("RMS_ROC%d", sectorTPC));
779         fTPCPre->AddComponent((TObject*) calROC );
780
781         calROC = cal->GetCalRocOutliers(sectorTPC);
782         calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
783         fTPCPre->AddComponent((TObject*) calROC );
784       }
785
786 */
787       //
788       // AliTPCCalibCE
789       //
790       /*
791       else if ( ! objectName.CompareTo( "AliTPCCalibCE" ) ) {
792         AliTPCCalROC* calROC = NULL;
793
794         AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
795
796         cal->Analyse();
797
798         calROC = cal->GetCalRocT0(sectorTPC);
799         calROC->SetName(Form("T0_ROC%d", sectorTPC));
800         fTPCPre->AddComponent((TObject*) calROC );
801
802         calROC = cal->GetCalRocQ(sectorTPC);
803         calROC->SetName(Form("Q_ROC%d", sectorTPC));
804         fTPCPre->AddComponent((TObject*) calROC );
805
806         calROC = cal->GetCalRocRMS(sectorTPC);
807         calROC->SetName(Form("RMS_ROC%d", sectorTPC));
808         fTPCPre->AddComponent((TObject*) calROC );
809
810         calROC = cal->GetCalRocOutliers(sectorTPC);
811         calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
812         fTPCPre->AddComponent((TObject*) calROC );
813       }
814       */
815     } // if ( ! objectName.CompareTo( desc->GetClassName() ) ) {
816
817   } // while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
818
819   if ( dumpToFile ) {
820
821     fTPCPre->DumpToFile("pedestals.root");
822     cout << "DUMP" << endl;
823   }
824
825
826 }