1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Artur Szostak <artursz@iafrica.com> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
20 /// @file AliHLTMUONProcessor.cxx
21 /// @author Artur Szostak <artursz@iafrica.com>
23 /// @brief Implementation of the abstract base dHLT processor component.
25 /// This component is the abstract base class of dHLT specific components.
26 /// It implements some common methods used by all the dHLT components.
29 #include "AliHLTMUONProcessor.h"
30 #include "AliHLTMUONConstants.h"
31 #include "AliMUONRecoParam.h"
32 #include "AliCDBManager.h"
33 #include "AliCDBStorage.h"
34 #include "AliCDBEntry.h"
35 #include "AliGRPManager.h"
36 #include "AliGRPObject.h"
39 #include "AliMpDDLStore.h"
40 #include "AliMpDEStore.h"
41 #include "TGeoGlobalMagField.h"
43 #include "TObjString.h"
50 ClassImp(AliHLTMUONProcessor)
53 AliHLTMUONProcessor::AliHLTMUONProcessor() :
55 fWarnForUnexpecedBlock(false),
57 fDumpDataOnError(false),
60 /// Default constructor.
64 int AliHLTMUONProcessor::DoInit(int argc, const char** argv)
66 /// Parses common dHLT component arguments.
68 // Set the default values for various arguments comming from the command line.
70 fDumpDataOnError = false;
72 const char* cdbPath = NULL;
75 for (int i = 0; i < argc; i++)
77 // Ignore the argument if the child class indicates to do so.
78 if (IgnoreArgument(argv[i])) continue;
80 if (strcmp(argv[i], "-cdbpath") == 0)
84 HLTWarning("CDB path was already specified. Will"
85 " replace previous value given by -cdbpath."
90 HLTError("The CDB path was not specified." );
98 if (strcmp(argv[i], "-run") == 0)
102 HLTWarning("Run number was already specified. Will"
103 " replace previous value given by -run."
108 HLTError("The run number was not specified.");
113 run = Int_t( strtol(argv[i+1], &cpErr, 0) );
114 if (cpErr == NULL or *cpErr != '\0' or run < 0)
116 HLTError("Cannot convert '%s' to a valid run number."
117 " Expected a positive integer value.", argv[i+1]
126 if (strcmp(argv[i], "-delaysetup") == 0)
132 if (strcmp(argv[i], "-dumponerror") == 0)
134 fDumpDataOnError = true;
138 if (strcmp(argv[i], "-dumppath") == 0)
140 if (fDumpPath != NULL)
142 HLTWarning("The dump path was already specified. Will"
143 " replace previous value given by -dumppath."
148 HLTError("The dump path was not specified.");
151 fDumpPath = argv[i+1];
157 if (cdbPath != NULL or run != -1)
159 int result = SetCDBPathAndRunNo(cdbPath, run);
162 // Error messages already generated in SetCDBPathAndRunNo.
171 bool AliHLTMUONProcessor::ArgumentAlreadyHandled(int& i, const char* argi) const
173 /// This method can be used by the derivind child class to check if a particular
174 /// argument in argv was already processed.
176 if (strcmp(argi, "-cdbpath") == 0)
178 if (IgnoreArgument(argi)) return false;
179 i++; // argument takes one parameter
183 if (strcmp(argi, "-run") == 0)
185 if (IgnoreArgument(argi)) return false;
186 i++; // argument takes one parameter
190 if (strcmp(argi, "-delaysetup") == 0)
192 if (IgnoreArgument(argi)) return false;
196 if (strcmp(argi, "-dumponerror") == 0)
198 if (IgnoreArgument(argi)) return false;
202 if (strcmp(argi, "-dumppath") == 0)
204 if (IgnoreArgument(argi)) return false;
205 i++; // argument takes one parameter
213 int AliHLTMUONProcessor::SetCDBPathAndRunNo(
214 const char* cdbPath, Int_t run, bool useDefault
217 /// Sets the CDB path and run number to read from.
218 /// \param cdbPath The CDB path to use. If set to NULL and the path has
219 /// not been set in the CDB manager then the default path
220 /// "local://$ALICE_ROOT/OCDB" is used if the 'useDefault' flag is also true.
221 /// \param run The run number to use. If set to -1 and the run number has
222 /// not been set in the CDB manager then a value of zero is used if
223 /// the 'useDefault' flag is also true.
224 /// \param useDefault If set to true then a default CDB path and/or run number
225 /// is used if they have not been set and 'cdbPath' == NULL or
227 /// \return Zero if the object could be loaded. Otherwise an error code,
228 /// compatible with the HLT framework, is returned.
230 const char* defaultPath = "local://$ALICE_ROOT/OCDB";
231 Int_t defaultRun = 0;
233 AliCDBManager* cdbManager = AliCDBManager::Instance();
234 if (cdbManager == NULL)
236 HLTError("CDB manager instance does not exist.");
240 // Setup the CDB path.
243 cdbManager->SetDefaultStorage(cdbPath);
245 else if (not cdbManager->IsDefaultStorageSet() and useDefault)
247 cdbManager->SetDefaultStorage(defaultPath);
250 // Now setup the run number.
253 cdbManager->SetRun(run);
257 if (useDefault) cdbManager->SetRun(defaultRun);
264 int AliHLTMUONProcessor::FetchMappingStores() const
266 /// Fetches the DDL and detector element store objects for MUON mapping.
267 /// \return Zero if the objects could be loaded. Otherwise an error code,
268 /// which is compatible with the HLT framework, is returned.
269 /// \note AliMpDDLStore::Instance() and AliMpDEStore::Instance() must be used
270 /// to fetch the objects after this method returns a code equal to zero.
272 Bool_t warn = kFALSE;
274 // Check if the objects are already loaded. If they are then exit early,
275 // otherwise we need to try load the objects.
276 if (AliMpDDLStore::Instance(warn) != NULL and AliMpDEStore::Instance(warn) != NULL)
279 AliCDBManager* cdbManager = AliCDBManager::Instance();
280 if (cdbManager == NULL)
282 HLTError("CDB manager instance does not exist.");
286 const char* cdbPathUsed = "unknown (not set)";
287 AliCDBStorage* store = cdbManager->GetDefaultStorage();
288 if (store != NULL) cdbPathUsed = store->GetURI().Data();
290 Int_t runUsed = cdbManager->GetRun();
292 // Now we can try load the DDL and DE store objects.
293 if (cdbManager->GetId("MUON/Calib/MappingData", runUsed) == NULL)
295 HLTError("Could not find entry in CDB path '%s/MUON/Calib/MappingData' and run no. %d.",
300 if (cdbManager->GetId("MUON/Calib/Gains", runUsed) == NULL)
302 HLTError("Could not find entry in CDB path '%s/MUON/Calib/Gains' and run no. %d.",
307 if (cdbManager->GetId("MUON/Calib/Pedestals", runUsed) == NULL)
309 HLTError("Could not find entry in CDB path '%s/MUON/Calib/Pedestals' and run no. %d.",
314 if (not AliMpCDB::LoadDDLStore(warn))
316 HLTError("Failed to load DDL or detector element store specified"
317 " for CDB path '%s' and run no. %d.",
323 if (AliMpDDLStore::Instance(warn) == NULL or AliMpDEStore::Instance(warn) == NULL)
325 HLTError("Could not find or load the DDL or detector element store instance.");
333 int AliHLTMUONProcessor::FetchTMapFromCDB(const char* pathToEntry, TMap*& map) const
335 /// Fetches a TMap object from the CDB.
336 /// [in] \param pathToEntry The relative path to the entry in the CDB to fetch.
337 /// [out] \param map This will be filled with the TMap object found if
338 /// a successful status code is returned. Otherwise it will be unchanged.
339 /// \return Zero if the object could be found. Otherwise an error code,
340 /// which is compatible with the HLT framework, is returned.
342 assert(AliCDBManager::Instance() != NULL);
344 AliCDBStorage* store = AliCDBManager::Instance()->GetDefaultStorage();
347 HLTError("Could not get the the default storage for the CDB.");
351 Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo());
352 Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version);
353 AliCDBId* entryId = AliCDBManager::Instance()->GetId(pathToEntry, GetRunNo(), version, subVersion);
356 HLTError("Could not find the CDB entry for \"%s\".", pathToEntry);
359 AliCDBEntry* entry = AliCDBManager::Instance()->Get(*entryId);
362 HLTError("Could not fetch the CDB entry for \"%s\".", pathToEntry);
366 TObject* obj = entry->GetObject();
369 HLTError("Configuration object for \"%s\" is missing.", pathToEntry);
373 if (obj->IsA() != TMap::Class())
375 HLTError("Wrong type for configuration object in \"%s\". Found a %s but we need a TMap.",
376 pathToEntry, obj->ClassName()
380 map = dynamic_cast<TMap*>(obj);
386 int AliHLTMUONProcessor::GetValueFromTMap(
387 TMap* map, const char* paramName, TString& value,
388 const char* pathToEntry, const char* prettyName
391 /// Tries to find the string value associated with a certain parameter in a TMap.
392 /// [in] \param map The TMap object to search in.
393 /// [in] \param paramName The name of the parameter to search for.
394 /// [out] \param value Will be filled with the object found.
395 /// [in] \param pathToEntry The relative path to the entry in the CDB.
396 /// Used when printing error messages. If set to NULL then a string of
397 /// "(unknown)" is used. (default is NULL).
398 /// [in] \param prettyName Should be the name of the parameter which will
399 /// be used when printing error messages. If this is set to NULL then
400 /// the paramName will be used instead (default is NULL).
401 /// \return Zero if the object could be found. Otherwise an error code,
402 /// which is compatible with the HLT framework, is returned.
404 if (pathToEntry == NULL) pathToEntry = "(unknown)";
405 if (prettyName == NULL) prettyName = paramName;
407 TPair* pair = static_cast<TPair*>(map->FindObject(paramName));
410 HLTError("Configuration object for \"%s\" does not contain the %s value.",
411 pathToEntry, prettyName
415 TObject* valueObj = pair->Value();
416 if (valueObj->IsA() != TObjString::Class())
418 HLTError("The %s parameter found in configuration object \"%s\""
419 " is not a TObjString. Found an object of type %s instead.",
420 prettyName, pathToEntry, valueObj->ClassName()
424 value = dynamic_cast<TObjString*>(valueObj)->GetString();
430 int AliHLTMUONProcessor::GetIntFromTMap(
431 TMap* map, const char* paramName, Int_t& value,
432 const char* pathToEntry, const char* prettyName
435 /// Tries to find a certain parameter in the TMap object and convert it to
436 /// an integer value.
437 /// [in] \param map The TMap object to search in.
438 /// [in] \param paramName The name of the parameter to search for.
439 /// [out] \param value Will be filled with the integer value for the parameter,
440 /// if it was found and it was an integer value.
441 /// [in] \param pathToEntry The relative path to the entry in the CDB.
442 /// Used when printing error messages. If set to NULL then a string of
443 /// "(unknown)" is used. (default is NULL).
444 /// [in] \param prettyName Should be the name of the parameter which will
445 /// be used when printing error messages. If this is set to NULL then
446 /// the paramName will be used instead (default is NULL).
447 /// \return Zero if the object could be found and is valid. Otherwise an
448 /// error code, which is compatible with the HLT framework, is returned.
450 if (pathToEntry == NULL) pathToEntry = "(unknown)";
451 if (prettyName == NULL) prettyName = paramName;
454 int result = GetValueFromTMap(map, paramName, valueStr, pathToEntry, prettyName);
455 if (result != 0) return result;
457 if (not valueStr.IsDigit())
459 HLTError("The %s parameter found in configuration object \"%s\""
460 "is not a valid integer number string; found \"%s\".",
461 prettyName, pathToEntry, valueStr.Data()
465 value = valueStr.Atoi();
471 int AliHLTMUONProcessor::GetPositiveIntFromTMap(
472 TMap* map, const char* paramName, Int_t& value,
473 const char* pathToEntry, const char* prettyName
476 /// Tries to find a certain parameter in the TMap object and convert it to
477 /// a positive integer value.
478 /// [in] \param map The TMap object to search in.
479 /// [in] \param paramName The name of the parameter to search for.
480 /// [out] \param value Will be filled with the integer value for the parameter,
481 /// if it was found and it was a positive integer value.
482 /// [in] \param pathToEntry The relative path to the entry in the CDB.
483 /// Used when printing error messages. If set to NULL then a string of
484 /// "(unknown)" is used. (default is NULL).
485 /// [in] \param prettyName Should be the name of the parameter which will
486 /// be used when printing error messages. If this is set to NULL then
487 /// the paramName will be used instead (default is NULL).
488 /// \return Zero if the object could be found and is valid. Otherwise an
489 /// error code, which is compatible with the HLT framework, is returned.
491 if (pathToEntry == NULL) pathToEntry = "(unknown)";
492 if (prettyName == NULL) prettyName = paramName;
495 int result = GetValueFromTMap(map, paramName, valueStr, pathToEntry, prettyName);
496 if (result != 0) return result;
498 if (not valueStr.IsDigit())
500 HLTError("The %s parameter found in configuration object \"%s\""
501 "is not a valid integer number string; found \"%s\".",
502 prettyName, pathToEntry, valueStr.Data()
506 Int_t val = valueStr.Atoi();
509 HLTError("The %s parameter found in configuration object \"%s\""
510 "is not a positive integer number; found \"%d\".",
511 prettyName, pathToEntry, val
521 int AliHLTMUONProcessor::GetFloatFromTMap(
522 TMap* map, const char* paramName, Double_t& value,
523 const char* pathToEntry, const char* prettyName
526 /// Tries to find a certain parameter in the TMap object and convert it to
527 /// an floating point value.
528 /// [in] \param map The TMap object to search in.
529 /// [in] \param paramName The name of the parameter to search for.
530 /// [out] \param value Will be filled with the floating point value for the
531 /// parameter, if it was found and it was a floating point value.
532 /// [in] \param pathToEntry The relative path to the entry in the CDB.
533 /// Used when printing error messages. If set to NULL then a string of
534 /// "(unknown)" is used. (default is NULL).
535 /// [in] \param prettyName Should be the name of the parameter which will
536 /// be used when printing error messages. If this is set to NULL then
537 /// the paramName will be used instead (default is NULL).
538 /// \return Zero if the object could be found and is valid. Otherwise an
539 /// error code, which is compatible with the HLT framework, is returned.
541 if (pathToEntry == NULL) pathToEntry = "(unknown)";
542 if (prettyName == NULL) prettyName = paramName;
545 int result = GetValueFromTMap(map, paramName, valueStr, pathToEntry, prettyName);
546 if (result != 0) return result;
548 if (not valueStr.IsFloat())
550 HLTError("The %s parameter found in configuration object \"%s\""
551 "is not a valid floating point number string; found \"%s\".",
552 prettyName, pathToEntry, valueStr.Data()
556 value = valueStr.Atof();
562 int AliHLTMUONProcessor::GetPositiveFloatFromTMap(
563 TMap* map, const char* paramName, Double_t& value,
564 const char* pathToEntry, const char* prettyName
567 /// Tries to find a certain parameter in the TMap object and convert it to
568 /// an positive floating point value.
569 /// [in] \param map The TMap object to search in.
570 /// [in] \param paramName The name of the parameter to search for.
571 /// [out] \param value Will be filled with the floating point value for the
572 /// parameter, if it was found and it was a positive floating point value.
573 /// [in] \param pathToEntry The relative path to the entry in the CDB.
574 /// Used when printing error messages. If set to NULL then a string of
575 /// "(unknown)" is used. (default is NULL).
576 /// [in] \param prettyName Should be the name of the parameter which will
577 /// be used when printing error messages. If this is set to NULL then
578 /// the paramName will be used instead (default is NULL).
579 /// \return Zero if the object could be found and is valid. Otherwise an
580 /// error code, which is compatible with the HLT framework, is returned.
582 if (pathToEntry == NULL) pathToEntry = "(unknown)";
583 if (prettyName == NULL) prettyName = paramName;
586 int result = GetValueFromTMap(map, paramName, valueStr, pathToEntry, prettyName);
587 if (result != 0) return result;
589 if (not valueStr.IsFloat())
591 HLTError("The %s parameter found in configuration object \"%s\""
592 "is not a valid floating point number string; found \"%s\".",
593 prettyName, pathToEntry, valueStr.Data()
597 Double_t val = valueStr.Atof();
600 HLTError("The %s parameter found in configuration object \"%s\""
601 "is not a positive floating point number; found \"%d\".",
602 prettyName, pathToEntry, val
612 int AliHLTMUONProcessor::FetchFieldIntegral(Double_t& bfieldintegral) const
614 // Fetches the correct dipole magnetic field integral to use.
616 Float_t currentL3 = 0;
617 Float_t currentDip = 0;
619 if (TGeoGlobalMagField::Instance() == NULL or
620 (TGeoGlobalMagField::Instance() != NULL and TGeoGlobalMagField::Instance()->GetField() == NULL)
623 HLTWarning("The magnetic field has not been set in TGeoGlobalMagField."
624 " Will try and load the GRP entry directly."
627 AliGRPManager grpman;
628 if (not grpman.ReadGRPEntry() or grpman.GetGRPData() == NULL)
630 HLTError("GRP entry could not be loaded.");
634 const AliGRPObject* grp = grpman.GetGRPData();
635 Char_t polarityL3 = grp->GetL3Polarity();
636 Char_t polarityDip = grp->GetDipolePolarity();
637 currentL3 = grp->GetL3Current(AliGRPObject::kMean);
638 currentDip = grp->GetDipoleCurrent(AliGRPObject::kMean);
639 if (polarityL3 == AliGRPObject::GetInvalidChar())
641 HLTError("L3 polarity in GRP is invalid.");
644 if (polarityDip == AliGRPObject::GetInvalidChar())
646 HLTError("Dipole polarity in GRP is invalid.");
649 if (currentL3 == AliGRPObject::GetInvalidFloat())
651 HLTError("L3 current in GRP is invalid.");
654 if (currentDip == AliGRPObject::GetInvalidFloat())
656 HLTError("Dipole current in GRP is invalid.");
659 if (grp->IsPolarityConventionLHC())
661 currentL3 *= (polarityL3 ? -1:1);
662 currentDip *= (polarityDip ? -1:1);
666 currentL3 *= (polarityL3 ? -1:1);
667 currentDip *= (polarityDip ? 1:-1);
672 TVirtualMagField* vfield = TGeoGlobalMagField::Instance()->GetField();
673 AliMagF* field = dynamic_cast<AliMagF*>(vfield);
674 if (vfield->IsA() != AliMagF::Class() and field != NULL)
677 "The magnetic field is not of type AliMagF."
678 " Do not know how to handle class of type '%s'.",
683 currentL3 = field->GetCurrentSol();
684 currentDip = field->GetCurrentDip();
687 const char* path = AliHLTMUONConstants::FieldIntegralsCDBPath();
689 int result = FetchTMapFromCDB(path, map);
690 if (result != 0) return result;
691 const char* paramName = Form("L3_current=%0.2e;Dipole_current=%0.2e", currentL3, currentDip);
693 result = GetFloatFromTMap(map, paramName, value, path);
694 if (result != 0) return result;
695 bfieldintegral = value;
700 int AliHLTMUONProcessor::LoadRecoParamsFromCDB(AliMUONRecoParam*& params) const
702 /// Fetches the reconstruction parameters object from the CDB for MUON.
703 /// [out] \param params This will be filled with the reconstruction
704 /// parameters object found if a successful status code is returned.
705 /// Otherwise it will be unchanged.
706 /// \return Zero if the object could be found. Otherwise an error code,
707 /// which is compatible with the HLT framework, is returned.
709 assert(AliCDBManager::Instance() != NULL);
711 AliCDBStorage* store = AliCDBManager::Instance()->GetDefaultStorage();
714 HLTError("Could not get the the default storage for the CDB.");
718 const char* pathToEntry = "MUON/Calib/RecoParam";
719 Int_t version = store->GetLatestVersion(pathToEntry, GetRunNo());
720 Int_t subVersion = store->GetLatestSubVersion(pathToEntry, GetRunNo(), version);
721 AliCDBId* entryId = AliCDBManager::Instance()->GetId(pathToEntry, GetRunNo(), version, subVersion);
724 HLTError("Could not find the CDB entry for \"%s\".", pathToEntry);
727 AliCDBEntry* entry = AliCDBManager::Instance()->Get(*entryId);
730 HLTError("Could not fetch the CDB entry for \"%s\".", pathToEntry);
734 TObject* obj = entry->GetObject();
737 HLTError("Reconstruction parameters object for \"%s\" is missing.", pathToEntry);
741 TObjArray* objarr = dynamic_cast<TObjArray*>(obj);
744 obj = objarr->Last();
747 AliMUONRecoParam* par = dynamic_cast<AliMUONRecoParam*>(obj);
750 HLTError("No AliMUONRecoParam class found for entry \"%s\". Found a %s class instead.",
751 pathToEntry, obj->ClassName()
761 void AliHLTMUONProcessor::DumpBuffer(
762 const void* buffer, AliHLTUInt32_t size, const char* filename
765 /// Dumps the data contained in a buffer to file as is.
769 fstream file(filename, fstream::out | fstream::trunc | fstream::binary);
772 file.write(reinterpret_cast<const char*>(buffer), size);
775 HLTError("Could not write data block to file %s during"
776 " dumping operation!",
783 HLTError("Could not open file %s for dumping data block!", filename);
788 void AliHLTMUONProcessor::DumpBlock(
789 const AliHLTComponentBlockData* block, const char* fileNamePrefix
792 /// Dumps the data block and meta information to file.
794 std::string filename = fDumpPath;
795 filename += fileNamePrefix;
796 filename += "-blockmeta.bin";
797 DumpBuffer(block, sizeof(AliHLTComponentBlockData), filename.c_str());
798 filename = fDumpPath;
799 filename += fileNamePrefix;
800 filename += "-data.bin";
801 DumpBuffer(block->fPtr, block->fSize, filename.c_str());
805 void AliHLTMUONProcessor::DumpEvent(
806 const AliHLTComponentEventData& evtData,
807 const AliHLTComponentBlockData* blocks,
808 AliHLTComponentTriggerData& trigData,
809 AliHLTUInt8_t* outputPtr,
810 AliHLTUInt32_t& size,
811 AliHLTComponentBlockDataList& outputBlocks
814 /// Dumps the event information to files in the dump path given by the
815 /// method DumpPath, which can be set by the command line argument -dumppath.
820 std::string filename = fDumpPath;
821 sprintf(strbuf, "dump_event-0x%16.16llX.log", evtData.fEventID);
823 fstream logfile(filename.c_str(), fstream::out | fstream::trunc);
826 HLTError("Could not open log file '%s' for dump information.", filename.c_str());
830 filename = fDumpPath;
831 sprintf(strbuf, "dump_event-0x%16.16llX-eventdata.bin", evtData.fEventID);
833 logfile << "Dumping event data structure to file: " << filename << std::endl;
834 DumpBuffer(&evtData, sizeof(AliHLTComponentEventData), filename.c_str());
836 filename = fDumpPath;
837 sprintf(strbuf, "dump_event-0x%16.16llX-triggerdata.bin", evtData.fEventID);
839 logfile << "Dumping trigger data structure to file: " << filename << std::endl;
840 DumpBuffer(&trigData, sizeof(AliHLTComponentTriggerData), filename.c_str());
842 for (unsigned int n = 0; n < evtData.fBlockCnt; n++)
844 sprintf(strbuf, "dump_event-0x%16.16llX-block-0x%8.8X", evtData.fEventID, n);
846 sprintf(strbuf, "0x%8.8X", blocks[n].fSpecification);
847 logfile << "Found block with data type = " << DataType2Text(blocks[n].fDataType)
848 << ", specification = " << strbuf << ". Dumping to file: "
849 << filename << "-data.bin" << std::endl;
850 DumpBlock(&blocks[n], filename.c_str());
853 filename = fDumpPath;
854 sprintf(strbuf, "dump_event-0x%16.16llX-output-buffer.bin", evtData.fEventID);
856 logfile << "Dumping output buffer to file: " << filename << std::endl;
857 DumpBuffer(outputPtr, size, filename.c_str());
859 for (size_t i = 0; i < outputBlocks.size(); i++)
861 sprintf(strbuf, "dump_event-0x%16.16llX-output-block-0x%8.8X", evtData.fEventID, int(i));
863 sprintf(strbuf, "0x%8.8X", outputBlocks[i].fSpecification);
864 logfile << "Generated output data block with type = "
865 << DataType2Text(outputBlocks[i].fDataType)
866 << ", specification = " << strbuf << ". Dumping to file: "
867 << filename << "-data.bin" << std::endl;
868 DumpBlock(&outputBlocks[i], filename.c_str());
873 void AliHLTMUONProcessor::DumpEvent(
874 const AliHLTComponentEventData& evtData,
875 AliHLTComponentTriggerData& trigData
878 /// Dumps the event information to files in the dump path given by the
879 /// method DumpPath, which can be set by the command line argument -dumppath.
884 std::string filename = fDumpPath;
885 sprintf(strbuf, "dump_event-0x%16.16llX.log", evtData.fEventID);
887 fstream logfile(filename.c_str(), fstream::out | fstream::trunc);
890 HLTError("Could not open log file '%s' for dump information.", filename.c_str());
894 filename = fDumpPath;
895 sprintf(strbuf, "dump_event-0x%16.16llX-eventdata.bin", evtData.fEventID);
897 logfile << "Dumping event data structure to file: " << filename << std::endl;
898 DumpBuffer(&evtData, sizeof(AliHLTComponentEventData), filename.c_str());
900 filename = fDumpPath;
901 sprintf(strbuf, "dump_event-0x%16.16llX-triggerdata.bin", evtData.fEventID);
903 logfile << "Dumping trigger data structure to file: " << filename << std::endl;
904 DumpBuffer(&trigData, sizeof(AliHLTComponentTriggerData), filename.c_str());
906 for (int i = 0; i < GetNumberOfInputBlocks(); i++)
908 const AliHLTComponentBlockData* block = GetInputBlock(i);
909 sprintf(strbuf, "dump_event-0x%16.16llX-block-0x%8.8X", evtData.fEventID, i);
911 sprintf(strbuf, "0x%8.8X", block->fSpecification);
912 logfile << "Found block with data type = " << DataType2Text(block->fDataType)
913 << ", specification = " << strbuf << ". Dumping to file: "
914 << filename << "-data.bin" << std::endl;
915 DumpBlock(block, filename.c_str());