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. *
6 /** @file AliEveHOMERManager.cxx
9 @brief Manger for HOMER in offline
16 #include "AliEveHOMERManager.h"
20 #define ROWHOUGHPARAMS
21 #define use_reconstruction
23 #define ROOTVERSION "unchecked"
24 #define ALIROOTVERSION "unchecked"
29 #include "AliHLTHOMERLibManager.h"
31 #include "AliHLTHOMERSourceDesc.h"
32 #include "AliHLTHOMERBlockDesc.h"
34 #include "AliEveHOMERSource.h"
39 #include <TApplication.h>
40 #include "Riostream.h"
42 #include "TCollection.h"
44 #include "TObjString.h"
45 #include "TObjArray.h"
48 #include "AliTPCCalibPedestal.h"
49 #include "AliTPCCalibPulser.h"
50 #include "AliTPCCalibCE.h"
51 #include "AliTPCPreprocessorOnline.h"
52 #include "AliTPCCalROC.h"
54 //______________________________________________________________________________
56 // Manage connections to HLT data-sources.
58 ClassImp(AliEveHOMERManager)
61 * ---------------------------------------------------------------------------------
62 * Constructor / Destructor
63 * ---------------------------------------------------------------------------------
66 //##################################################################################
67 AliEveHOMERManager::AliEveHOMERManager( TString xmlFile ) :
68 TEveElementList("AliEveHOMERManager"),
70 fLibManager(new AliHLTHOMERLibManager),
81 fStateHasChanged(kTRUE),
83 // see header file for class documentation
85 // refer to README to build package
87 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
90 //##################################################################################
91 AliEveHOMERManager::~AliEveHOMERManager() {
92 // see header file for class documentation
96 fLibManager->DeleteReader(fReader);
106 if ( fSourceList != NULL )
110 if ( fBlockList != NULL )
114 if ( fTPCPre != NULL )
120 * ---------------------------------------------------------------------------------
122 * ---------------------------------------------------------------------------------
125 //##################################################################################
126 Int_t AliEveHOMERManager::CreateHOMERSourcesList() {
127 // see header file for class documentation
129 // -- Initialize XML parser
130 if ( fXMLParser != NULL )
134 fXMLParser = new TDOMParser();
135 fXMLParser->SetValidate( kFALSE );
137 Int_t iResult = fXMLParser->ParseFile( fXMLFile );
140 AliError( Form("Parsing file with error: %s", fXMLParser->GetParseCodeMessage( fXMLParser->GetParseCode() )) );
144 // -- Initialize sources list
146 if ( fSourceList != NULL )
150 fSourceList = new TList();
151 fSourceList->SetOwner( kTRUE );
154 fRootNode = fXMLParser->GetXMLDocument()->GetRootNode();
156 TXMLNode * node = NULL;
157 TXMLNode * prevNode = fRootNode->GetChildren();
159 // -- Loop over all nodes
160 while ( ( node = prevNode->GetNextNode() ) ) {
163 // -- Find only "Process" nodes, otherwise continue to next node
164 if ( strcmp( node->GetNodeName(), "Proc" ) != 0 )
167 // -- Get Attributes of current node
168 TList *attrList = node->GetAttributes();
170 TIter next(attrList);
172 while ( ( attr = (TXMLAttr*)next() ) ) {
174 // -- Find "ID" attribute, otherwise continue to next attribute
175 if ( strcmp( attr->GetName(), "ID" ) != 0 )
178 TString nodeId( attr->GetValue() );
180 // -- Find only TDS processes
181 TObjArray * nodeIdTok = nodeId.Tokenize("_");
183 for ( Int_t ii=0 ; ii < nodeIdTok->GetEntries() ; ii++ ) {
184 if ( ! ( (TObjString*) nodeIdTok->At(ii) )->GetString().CompareTo("TDS") ) {
185 iResult = GetTDSAttributes( node->GetChildren() );
187 AliError( Form("Error processing TDS process : %s", nodeId.Data()) );
191 } // while ( ( attr = (TXMLAttr*)next() ) ) {
193 } // while ( ( node = prevNode->GetNextNode() ) ) {
195 // -- New SourceList has been created --> All Sources are new --> State has changed
196 fStateHasChanged = kTRUE;
199 TIter next(fSourceList);
200 AliHLTHOMERSourceDesc* src = 0;
201 while ((src = (AliHLTHOMERSourceDesc*) next())) {
202 AliEveHOMERSource* re = new AliEveHOMERSource
204 Form("%s-%s-%s %s", src->GetDetector().Data(), src->GetSubDetector().Data(),
205 src->GetSubSubDetector().Data(), src->GetDataType().Data()),
212 AliWarning( Form("There have been errors, while creating the sources list.") );
215 AliInfo( Form("New sources list created.") );
221 //##################################################################################
222 void AliEveHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
223 // see header file for class documentation
225 if ( source->IsSelected() != state ) {
226 source->SetState( state );
227 fStateHasChanged = kTRUE;
233 //##################################################################################
234 Int_t AliEveHOMERManager::GetTDSAttributes( TXMLNode * xmlNode ) {
235 // see header file for class documentation
239 TXMLNode * attrNode = NULL;
240 TXMLNode * prevNode = xmlNode;
242 TString xmlHostname = 0;
245 TString hostname = 0;
248 // -- Get hostname and port from TDS node out of XML
249 while ( ( attrNode = prevNode->GetNextNode() ) ) {
252 // -- Get port out of the commandline
253 if ( strcmp( attrNode->GetNodeName(), "Cmd" ) == 0 ) {
254 TString cmd( attrNode->GetText() );
256 TObjArray * cmdTok = cmd.Tokenize(" ");
257 xmlPort = ((TObjString*) cmdTok->At(2))->GetString();
260 else if ( strcmp( attrNode->GetNodeName(), "Node" ) == 0 )
261 xmlHostname = attrNode->GetText();
263 } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
265 // -- Resolve hostname and port information
266 iResult = ResolveHostPortInformation ( xmlHostname, xmlPort, hostname, port );
267 if ( iResult == 1 ) {
268 AliError( Form("Error resolving hostname : %s", xmlHostname.Data()) );
271 else if ( iResult == 2 ) {AliInfo( Form("Connection established") );
272 AliError( Form("Error resolving port : %s", xmlPort.Data()) );
276 // -- Reset loop to TDS node
279 // -- Get Sources out of XML, resolve sources, add to sources ListxmlHostname.Data()
280 while ( ( attrNode = prevNode->GetNextNode() ) ) {
283 // Find only "Parent" tags, otherwise continue to next tag
284 if ( strcmp( attrNode->GetNodeName(), "Parent" ) != 0 )
287 TString xmlParent = attrNode->GetText();
289 AliHLTHOMERSourceDesc * source = new AliHLTHOMERSourceDesc( hostname, port );
291 if ( ResolveSourceInformation( xmlParent, source ) ) {
293 AliError( Form("Error resolving source : %s", xmlParent.Data()) );
298 fSourceList->Add( source );
299 AliInfo( Form("New Source added : %s", xmlParent.Data()) );
302 } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
307 //##################################################################################
308 Int_t AliEveHOMERManager::ResolveHostPortInformation ( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port ) {
309 // see header file for class documentation
313 // *** Resolve hostname
315 TXMLNode * node = NULL;
316 TXMLNode * prevNode = fRootNode->GetChildren();
317 TString nodeName = 0;
318 while ( ( node = prevNode->GetNextNode() ) && iResult == 1 ) {
321 // -- Find only "Node" nodes, otherwise continue
322 if ( strcmp( node->GetNodeName(), "Node" ) != 0 )
325 // -- Get Attributes of current node
326 TList *attrList = node->GetAttributes();
328 TIter next(attrList);
331 // TString nodeName = 0;
333 // Get "nodeID" and "nodeName" of this "Node" node
334 while ( ( attr = (TXMLAttr*)next() ) ) {
335 if ( strcmp( attr->GetName(), "ID" ) == 0 )
336 nodeId = attr->GetValue();
337 else if ( strcmp( attr->GetName(), "hostname" ) == 0 )
338 nodeName = attr->GetValue();
341 // -- if this is not the correct nodeID continue
342 if ( nodeId != xmlHostname )
348 // hostname = nodeName;
349 hostname = "alihlt-dcs0";
355 } // while ( ( node = prevNode->GetNextNode() ) ) {
358 AliError( Form("Error resolving hostname : %s", xmlHostname.Data()) );
364 if ( xmlPort.IsDigit() ) {
366 if ( nodeName.CompareTo("feptriggerdet") ==0 ){
367 if ( xmlPort.CompareTo("49152") == 0 ){
369 } else if ( xmlPort.CompareTo("49153") == 0 ){
372 } else if ( nodeName.CompareTo("fepfmdaccorde") == 0 ){
373 if ( xmlPort.CompareTo("49152") == 0 ){
375 } else if ( xmlPort.CompareTo("49153") == 0 ){
378 } else if ( nodeName.CompareTo("feptpcao15") == 0 ){
379 if ( xmlPort.CompareTo("49152") == 0 ){
381 } else if ( xmlPort.CompareTo("49153") == 0 ){
384 } else if ( nodeName.CompareTo("alihlt-dcs0") == 0 ){
385 port = xmlPort.Atoi();
389 AliError ( Form("Error resolving port : %s", xmlPort.Data()) );
396 AliInfo( Form("%s:%i resolved out of %s:%s", hostname.Data(), port, xmlHostname.Data(), xmlPort.Data()) );
402 //##################################################################################
403 Int_t AliEveHOMERManager::ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc *source ) {
404 // see header file for class documentation
408 if ( ! xmlParent.Contains( "_" ) ) {
409 AliError( Form("Source %s could not be resolved", xmlParent.Data() ) );
415 TObjArray * parentTokens = xmlParent.Tokenize("_");
417 Int_t nEntries = parentTokens->GetEntries();
419 TString detector = ((TObjString*) parentTokens->At(0) )->GetString();
420 TString subDetector = "";
421 TString subSubDetector = "";
422 TString dataType = "";
423 ULong_t specification = 0;
425 TString name = ((TObjString*) parentTokens->At(1) )->GetString();
426 TString objName = "";
429 subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
430 else if ( nEntries == 4 ) {
431 subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
432 subSubDetector = ((TObjString*) parentTokens->At(3) )->GetString();
435 // -- Corecct TPC subdetector, because in we have somtimes "A","C"
436 if ( ! detector.CompareTo("TPC") ) {
437 if ( subDetector.BeginsWith('A') ) {
438 subDetector.Remove( TString::kLeading, 'A' );
440 else if ( subDetector.BeginsWith('C') ) {
441 subDetector.Remove( TString::kLeading, 'C' );
442 Int_t tmp = subDetector.Atoi() + 18;
448 // -- Remove Leading '0' in sub detector and subsubdetector
449 subDetector.Remove( TString::kLeading, '0' );
450 subSubDetector.Remove( TString::kLeading, '0' );
452 // -- Set Object Names
455 if ( name == "RP" || name == "FP" || name == "Relay" ) {
457 dataType = "DDL_RAW";
462 else if ( detector == "TPC" ) {
464 if ( name == "CalibPedestal" ) {
465 objName = "AliTPCCalibPedestal";
466 dataType = "HIS_CAL";
469 else if ( name == "CalibPulser" ) {
470 objName = "AliTPCCalibPulser";
471 dataType = "HIS_CAL";
474 else if ( name == "CF" || name == "RelayCF" ) {
475 objName = "AliHLTTPCClusterDataFormat";
476 dataType = "CLUSTERS";
479 else if ( name == "ESDConv" ) {
480 objName = "AliESDEvent";
481 dataType = "ESD_TREE";
485 } // if ( detector == "TPC" ) {
488 else if ( detector == "TRD" ) {
490 if ( name == "foo" ) {
492 dataType = "FOO_BAR";
495 } // else if ( detector == "TRD" ) {
498 else if ( detector == "PHOS" ) {
500 } // else if ( detector == "PHOS" ) {
503 else if ( detector == "MUON" ) {
505 } // else if ( detector == "MUON" ) {
508 source->SetSourceName( name, objName );
509 source->SetSourceType( specification, dataType );
510 source->SetDetectors( detector, subDetector, subSubDetector );
513 AliInfo( Form("Set Source %s , Type %s, ClassName %s .", name.Data(), dataType.Data(), objName.Data()) );
514 AliInfo( Form(" Detector %s , SubDetector : %s, SubSubDetector %s .",
515 detector.Data(), subDetector.Data(), subSubDetector.Data()) );
521 * ---------------------------------------------------------------------------------
522 * Connection Handling
523 * ---------------------------------------------------------------------------------
526 //##################################################################################
527 Int_t AliEveHOMERManager::ConnectHOMER(){
528 // see header file for class documentation
532 // -- Check if already connected and state has not changed
533 if ( fStateHasChanged == kFALSE && IsConnected() ) {
534 AliInfo( Form("No need for reconnection.") );
538 // -- If already connected, disconnect before connect
542 // *** Create the Readoutlist
544 UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
545 const char ** sourceHostnames = new const char* [fSourceList->GetEntries()];
546 UInt_t sourceCount = 0;
548 CreateReadoutList( sourceHostnames, sourcePorts, sourceCount );
550 if ( sourceCount == 0 ) {
551 AliError(Form("No sources selected, aborting.") );
555 // *** Connect to data sources
559 fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
562 iResult = fReader->GetConnectionStatus();
565 // -- Connection failed
567 UInt_t ndx = fReader->GetErrorConnectionNdx();
569 if ( ndx < sourceCount ) {
570 AliError( Form("Error : Error establishing connection to TCP source %s:%hu: %s (%d)",
571 sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult) );
574 AliError( Form("Error : Error establishing connection to unknown source with index %d: %s (%d)",
575 ndx, strerror(iResult), iResult) );
579 fLibManager->DeleteReader( fReader );
584 // -- Connection ok - set reader
587 AliInfo( Form("Connection established") );
590 delete[] sourceHostnames;
591 delete[] sourcePorts;
601 //##################################################################################
602 void AliEveHOMERManager::DisconnectHOMER(){
603 // see header file for class documentation
605 if ( ! IsConnected() )
609 fLibManager->DeleteReader( fReader );
612 fStateHasChanged = kTRUE;
615 AliInfo( Form("Connection closed") );
620 //##################################################################################
621 Int_t AliEveHOMERManager::ReconnectHOMER(){
622 // see header file for class documentation
629 iResult = ConnectHOMER();
631 AliError( Form("Error connecting.") );
638 //##################################################################################
639 void AliEveHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts, UInt_t &sourceCount ){
640 // see header file for class documentation
642 AliHLTHOMERSourceDesc * source= NULL;
644 // -- Read all sources and check if they should be read out
645 TIter next( fSourceList );
646 while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
648 if ( ! source->IsSelected() )
651 Bool_t exists = kFALSE;
653 // -- Loop over existing entries and check if entry is already in readout list
654 for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
655 if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() ) && sourcePorts[ii] == source->GetPort() ) {
661 // -- Add new entires to readout list
663 sourcePorts[sourceCount] = source->GetPort();
664 sourceHostnames[sourceCount] = source->GetHostname().Data();
668 } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
670 fStateHasChanged = kFALSE;
676 * ---------------------------------------------------------------------------------
678 * ---------------------------------------------------------------------------------
681 //##################################################################################
682 Int_t AliEveHOMERManager::NextEvent(){
683 // see header file for class documentation
687 if ( !fReader || ! IsConnected() ) {
688 AliWarning( Form( "Not connected yet." ) );
692 // -- Read next event data and error handling for HOMER (error codes and empty blocks)
694 iResult = fReader->ReadNextEvent( 20000000 /*timeout in us*/);
696 if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
697 Int_t ndx = fReader->GetErrorConnectionNdx();
698 AliError( Form("Error, No Connection to source %d: %s (%d)", ndx, strerror(iResult), iResult) );
702 else if ( iResult == 110 ) {
703 Int_t ndx = fReader->GetErrorConnectionNdx();
704 AliError( Form("Timout occured, reading event from source %d: %s (%d)", ndx, strerror(iResult), iResult) );
707 else if ( iResult == 56) {
708 Int_t ndx = fReader->GetErrorConnectionNdx();
709 AliError( Form("Error reading event from source %d: %s (%d) -- IRESULTRY", ndx, strerror(iResult), iResult) );
712 else if ( iResult ) {
713 Int_t ndx = fReader->GetErrorConnectionNdx();
714 AliError( Form("General Error reading event from source %d: %s (%d)", ndx, strerror(iResult), iResult) );
726 // -- Get blockCnt and eventID
727 fNBlks = (ULong_t) fReader->GetBlockCnt();
728 fEventID = (ULong64_t) fReader->GetEventID();
731 AliInfo( Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks) );
735 // Loop for Debug only
736 for ( ULong_t i = 0; i < fNBlks; i++ ) {
737 Char_t tmp1[9], tmp2[5];
738 memset( tmp1, 0, 9 );
739 memset( tmp2, 0, 5 );
741 ULong64_t* tmp12 = (ULong64_t*)tmp11;
742 *tmp12 = fReader->GetBlockDataType( i );
744 ULong_t* tmp22 = (ULong_t*)tmp21;
745 *tmp22 = fReader->GetBlockDataOrigin( i );
746 AliInfo( Form("Block %lu length: %lu - type: %s - origin: %s",i, fReader->GetBlockDataLength( i ), tmp1, tmp2) );
747 } // end for ( ULong_t i = 0; i < fNBlks; i++ ) {
751 // -- Create BlockList
757 //##################################################################################
758 Int_t AliEveHOMERManager::CreateBlockList() {
759 // see header file for class documentation
763 // -- Initialize block list
764 if ( fBlockList != NULL )
768 fBlockList = new TList();
769 fBlockList->SetOwner( kTRUE );
771 void* iter = GetFirstBlk();
773 // -- Fill block list
774 while ( iter != NULL ){
776 // -- Create new block
777 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc( GetBlk(), GetBlkSize(), GetBlkOrigin(),
778 GetBlkType(), GetBlkSpecification() );
780 // -- Check sources list if block is requested
781 if ( CheckIfRequested( block ) )
782 fBlockList->Add( block );
788 } // while ( iter != NULL ){
794 * ---------------------------------------------------------------------------------
796 * ---------------------------------------------------------------------------------
799 //##################################################################################
800 void* AliEveHOMERManager::GetBlk( Int_t ndx ) {
801 // see header file for class documentation
805 if ( !fReader || ! IsConnected() ) {
806 AliError( Form("Not connected yet.") );
809 if ( ( ndx ) < (Int_t) fNBlks )
810 data = (void*) fReader->GetBlockData( ndx );
816 //##################################################################################
817 ULong_t AliEveHOMERManager::GetBlkSize( Int_t ndx ) {
818 // see header file for class documentation
822 if ( !fReader || ! IsConnected() ) {
823 AliError( Form("Not connected yet.") );
826 if ( ( ndx ) < (Int_t) fNBlks )
827 length = (ULong_t) fReader->GetBlockDataLength( ndx );
833 //##################################################################################
834 TString AliEveHOMERManager::GetBlkOrigin( Int_t ndx ) {
835 // see header file for class documentation
839 // -- Check for Connection
840 if ( !fReader || ! IsConnected() ) {
841 AliError( Form("Not connected yet.") );
845 // -- Check block index
846 if ( ( ndx ) >= (Int_t) fNBlks ) {
847 AliError( Form("Block index %d out of range.", ndx ) );
857 reverseOrigin.data = (UInt_t) fReader->GetBlockDataOrigin( ndx );
859 // -- Reverse the order
860 for (Int_t ii = 3; ii >= 0; ii-- )
861 if ( reverseOrigin.array[ii] != ' ')
862 origin.Append( reverseOrigin.array[ii] );
867 //##################################################################################
868 TString AliEveHOMERManager:: GetBlkType( Int_t ndx ) {
869 // see header file for class documentation
873 // -- Check for Connection
874 if ( !fReader || ! IsConnected() ) {
875 AliError( Form("Not connected yet.") );
879 // -- Check blockk index
880 if ( ( ndx ) >= (Int_t) fNBlks ) {
881 AliError( Form("Block index %d out of range.", ndx ) );
891 reverseType.data = (ULong64_t) fReader->GetBlockDataType( ndx );
893 // -- Reverse the order
894 for (Int_t ii = 7; ii >= 0; ii-- )
895 if ( reverseType.array[ii] != ' ')
896 type.Append( reverseType.array[ii] );
902 //##################################################################################
903 ULong_t AliEveHOMERManager:: GetBlkSpecification( Int_t ndx ) {
904 // see header file for class documentation
909 // -- Check for Connection
910 if ( !fReader || ! IsConnected() ) {
911 AliError( Form("Not connected yet.") );
915 // -- Check blockk index
916 if ( ( ndx ) >= (Int_t) fNBlks ) {
917 AliError( Form("Block index %d out of range.", ndx ) );
921 spec = (ULong_t) fReader->GetBlockDataSpec( ndx );
926 //##################################################################################
927 Bool_t AliEveHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
928 // see header file for class documentation
930 Bool_t requested = kFALSE;
932 AliHLTHOMERSourceDesc * source= NULL;
934 // -- Read all sources and check if they should be read out
935 TIter next( fSourceList );
936 while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
938 if ( ! source->IsSelected() )
941 if ( source->GetDetector().CompareTo( block->GetDetector() ) )
944 if ( source->GetDataType().CompareTo( block->GetDataType() ) )
947 if ( ! block->HasSubDetectorRange() ) {
949 if ( source->GetSubDetector().Atoi() != block->GetSubDetector().Atoi() )
952 if ( ! block->HasSubSubDetectorRange() ) {
954 // if ( source->GetSubSubDetector().Atoi() != block->GetSubSubDetector().Atoi() )
957 } // if ( ! block->HasSubSubDetectorRange ) {
958 } // if ( ! block->HasSubDetectorRange ) {
962 } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
965 AliInfo( Form("Block requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
966 block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
969 AliInfo( Form("Block NOT requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(), block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
974 //##################################################################################
975 void AliEveHOMERManager::TestSelect() {
976 // see header file for class documentation
978 for (Int_t ii =0; ii < fSourceList->GetEntries() ; ii++ ) {
980 ((AliHLTHOMERSourceDesc*) fSourceList->At(ii))->Select();
984 //##################################################################################
985 void AliEveHOMERManager::TestSelectClass( TString objectName ) {
986 // see header file for class documentation
988 TList* srcList = GetSourceList();
990 AliHLTHOMERSourceDesc *desc = 0;
994 while ( ( desc = (AliHLTHOMERSourceDesc*)next() ) ) {
995 if ( ! desc->GetClassName().CompareTo( objectName ) )
1000 //##################################################################################
1001 void AliEveHOMERManager::SelectRawTPC() {
1002 // see header file for class documentation
1004 TList* srcList = GetSourceList();
1006 AliHLTHOMERSourceDesc *desc = 0;
1008 TIter next(srcList);
1010 while ( ( desc = (AliHLTHOMERSourceDesc*)next() ) ) {
1011 if ( ! desc->GetDataType().CompareTo( "DDL_RAW" ) ) {
1017 //##################################################################################
1018 void AliEveHOMERManager::SelectClusterTPC() {
1019 // see header file for class documentation
1021 TList* srcList = GetSourceList();
1023 AliHLTHOMERSourceDesc *desc = 0;
1025 TIter next(srcList);
1027 while ( ( desc = (AliHLTHOMERSourceDesc*)next() ) ) {
1028 if ( ! desc->GetDataType().CompareTo( "CLUSTERS" ) ) {
1034 //##################################################################################
1035 void AliEveHOMERManager::SelectESDTPC() {
1036 // see header file for class documentation
1038 TList* srcList = GetSourceList();
1040 AliHLTHOMERSourceDesc *desc = 0;
1042 TIter next(srcList);
1044 while ( ( desc = (AliHLTHOMERSourceDesc*)next() ) ) {
1045 if ( ! desc->GetDataType().CompareTo( "ESD_TREE" ) ) {
1050 //##################################################################################
1051 void AliEveHOMERManager::DumpTPCCalib(TString objectName, Bool_t dumpToFile) {
1052 // see header file for class documentation
1054 if ( fTPCPre != NULL )
1057 fTPCPre = new AliTPCPreprocessorOnline();
1059 TList* blockList = GetBlockList();
1061 AliHLTHOMERBlockDesc *desc = 0;
1063 TIter next(blockList);
1065 while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
1066 if ( ! desc->IsTObject() )
1069 Int_t sectorTPC = 0;
1071 if ( desc->GetSubSubDetector().Atoi() <= 1 ) {
1072 sectorTPC = desc->GetSubDetector().Atoi();
1075 sectorTPC = 36 + desc->GetSubDetector().Atoi();
1078 if ( ! objectName.CompareTo( desc->GetClassName() ) ){
1081 // AliTPCCalibPedestal
1084 if ( ! objectName.CompareTo( "AliTPCCalibPedestal" ) ) {
1085 AliTPCCalROC* calROC = NULL;
1087 AliTPCCalibPedestal * cal = (AliTPCCalibPedestal*) desc->GetTObject();
1088 if ( cal == NULL ) {
1089 cout << "error 1" << endl;
1095 calROC = cal->GetCalRocRMS(sectorTPC);
1096 if ( calROC == NULL ) {
1097 cout << "error 2" << endl;
1101 calROC->SetName(Form("RMS_ROC%d", sectorTPC));
1102 fTPCPre->AddComponent((TObject*) calROC );
1104 calROC = cal->GetCalRocPedestal(sectorTPC);
1105 if ( calROC == NULL ) {
1106 cout << "error 3" << endl;
1111 calROC->SetName(Form("Pedestal_ROC%d", sectorTPC));
1112 cout << "added" << endl;
1113 fTPCPre->AddComponent((TObject*) calROC );
1117 // AliTPCCalibPulser
1120 else if ( ! objectName.CompareTo( "AliTPCCalibPulser" ) ) {
1121 AliTPCCalROC* calROC = NULL;
1123 AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
1127 calROC = cal->GetCalRocT0(sectorTPC);
1128 calROC->SetName(Form("T0_ROC%d", sectorTPC));
1129 fTPCPre->AddComponent((TObject*) calROC );
1131 calROC = cal->GetCalRocQ(sectorTPC);
1132 calROC->SetName(Form("Q_ROC%d", sectorTPC));
1133 fTPCPre->AddComponent((TObject*) calROC );
1135 calROC = cal->GetCalRocRMS(sectorTPC);
1136 calROC->SetName(Form("RMS_ROC%d", sectorTPC));
1137 fTPCPre->AddComponent((TObject*) calROC );
1139 calROC = cal->GetCalRocOutliers(sectorTPC);
1140 calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
1141 fTPCPre->AddComponent((TObject*) calROC );
1149 else if ( ! objectName.CompareTo( "AliTPCCalibCE" ) ) {
1150 AliTPCCalROC* calROC = NULL;
1152 AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
1156 calROC = cal->GetCalRocT0(sectorTPC);
1157 calROC->SetName(Form("T0_ROC%d", sectorTPC));
1158 fTPCPre->AddComponent((TObject*) calROC );
1160 calROC = cal->GetCalRocQ(sectorTPC);
1161 calROC->SetName(Form("Q_ROC%d", sectorTPC));
1162 fTPCPre->AddComponent((TObject*) calROC );
1164 calROC = cal->GetCalRocRMS(sectorTPC);
1165 calROC->SetName(Form("RMS_ROC%d", sectorTPC));
1166 fTPCPre->AddComponent((TObject*) calROC );
1168 calROC = cal->GetCalRocOutliers(sectorTPC);
1169 calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
1170 fTPCPre->AddComponent((TObject*) calROC );
1173 } // if ( ! objectName.CompareTo( desc->GetClassName() ) ) {
1175 } // while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
1179 fTPCPre->DumpToFile("pedestals.root");
1180 cout << "DUMP" << endl;