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 **************************************************************************/
17 // $Id: AliHLTMUONDataCheckerComponent.cxx 26179 2008-05-29 22:27:27Z aszostak $
20 /// @file AliHLTMUONDataCheckerComponent.cxx
21 /// @author Artur Szostak <artursz@iafrica.com>
23 /// @brief Implementation of the dHLT data integrity checker component.
25 /// This component is used to check the data integrity of dHLT raw internal data
26 /// blocks. If there are any problems found then an appropriate error message is
30 #include "AliHLTMUONDataCheckerComponent.h"
31 #include "AliHLTMUONConstants.h"
32 #include "AliHLTLogging.h"
33 #include "AliHLTSystem.h"
34 #include "AliHLTDefinitions.h"
35 #include "AliRawDataHeader.h"
36 #include "AliHLTCDHWrapper.h"
37 #include "AliMUONConstants.h"
38 #include "AliMUONTrackerDDLDecoder.h"
39 #include "AliMUONTrackerDDLDecoderEventHandler.h"
40 #include "AliMUONTriggerDDLDecoder.h"
41 #include "AliMUONTriggerDDLDecoderEventHandler.h"
42 #include "AliMpDDLStore.h"
43 #include "AliMpDEStore.h"
44 #include "AliMpDEManager.h"
45 #include "AliMpBusPatch.h"
46 #include "AliMpDetElement.h"
47 #include "AliMpSegmentation.h"
48 #include "AliMpVSegmentation.h"
60 * Routine to check if at least one corresponding DDL has been marked
61 * for a particular chamber.
63 bool ChamberMarkedInDDLList(AliHLTInt32_t chamber, bool ddl[22])
65 if (chamber < 0 or chamber > 21) return false;
68 case 0: return ddl[0] or ddl[1];
69 case 1: return ddl[2] or ddl[3];
70 case 2: return ddl[4] or ddl[5];
71 case 3: return ddl[6] or ddl[7];
72 case 4: return ddl[8] or ddl[9] or ddl[10] or ddl[11];
73 case 5: return ddl[8] or ddl[9] or ddl[10] or ddl[11];
74 case 6: return ddl[12] or ddl[13];
75 case 7: return ddl[14] or ddl[15];
76 case 8: return ddl[16] or ddl[17];
77 case 9: return ddl[18] or ddl[19];
78 case 10: return ddl[20] or ddl[21];
79 case 11: return ddl[20] or ddl[21];
80 case 12: return ddl[20] or ddl[21];
81 case 13: return ddl[20] or ddl[21];
82 default: return false;
89 ClassImp(AliHLTMUONDataCheckerComponent)
92 AliHLTMUONDataCheckerComponent::AliHLTMUONDataCheckerComponent() :
93 AliHLTMUONProcessor(),
97 fFilterBadBlocks(false),
98 fNoGlobalChecks(false),
99 fWarnForUnexpecedBlock(false),
102 /// Default constructor.
106 AliHLTMUONDataCheckerComponent::~AliHLTMUONDataCheckerComponent()
108 /// Default destructor.
111 const char* AliHLTMUONDataCheckerComponent::GetComponentID()
113 /// Inherited from AliHLTComponent. Returns the component ID.
115 return AliHLTMUONConstants::DataCheckerComponentId();
119 void AliHLTMUONDataCheckerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
121 /// Inherited from AliHLTProcessor. Returns the list of expected input data types.
122 /// At the moment this list is "any data type" origin MUON since it is not known
123 /// before hand what kind of input blocks we will get.
125 assert( list.empty() );
126 list.push_back( kAliHLTAnyDataType | kAliHLTDataOriginMUON );
130 AliHLTComponentDataType AliHLTMUONDataCheckerComponent::GetOutputDataType()
132 /// Inherited from AliHLTComponent. Returns the output data type of
133 /// "any data type" with MUON origin.
135 return kAliHLTAnyDataType | kAliHLTDataOriginMUON;
139 void AliHLTMUONDataCheckerComponent::GetOutputDataSize(
140 unsigned long& constBase, double& inputMultiplier
143 /// Inherited from AliHLTComponent.
144 /// Returns an estimate of the expected output data size.
146 // Both of these are zero because we will only ever pass on input data blocks
147 // and never generate data in this component.
153 AliHLTComponent* AliHLTMUONDataCheckerComponent::Spawn()
155 /// Inherited from AliHLTComponent. Creates a new object instance.
157 return new AliHLTMUONDataCheckerComponent;
161 bool AliHLTMUONDataCheckerComponent::IgnoreArgument(const char* arg) const
163 /// Return true if the argument is -delaysetup
164 /// to prevent the parent class from parsing these arguments in DoInit.
166 if (strcmp(arg, "-delaysetup") == 0)
177 int AliHLTMUONDataCheckerComponent::DoInit(int argc, const char** argv)
179 /// Inherited from AliHLTComponent.
180 /// Parses the command line parameters and initialises the component.
182 HLTInfo("Initialising dHLT data checker component.");
184 // Inherit the parents functionality.
185 int result = AliHLTMUONProcessor::DoInit(argc, argv);
186 if (result != 0) return result;
188 // Initialise flags with default values.
191 fDontForward = false;
192 fFilterBadBlocks = false;
193 fNoGlobalChecks = false;
194 fWarnForUnexpecedBlock = false;
195 fReturnError = false;
197 for (int i = 0; i < argc; i++)
199 if (ArgumentAlreadyHandled(i, argv[i])) continue;
201 if (strcmp(argv[i], "-ignoretype") == 0)
204 HLTInfo("Ignoring data type of data blocks as given by framework.");
207 if (strcmp(argv[i], "-ignorespec") == 0)
210 HLTInfo("Ignoring data specification of data blocks as given by framework.");
213 if (strcmp(argv[i], "-dontforward") == 0)
216 HLTInfo("Not forwarding input data blocks.");
219 if (strcmp(argv[i], "-filter") == 0)
221 fFilterBadBlocks = true;
222 HLTInfo("Passing only bad blocks to output.");
225 if (strcmp(argv[i], "-no_global_check") == 0)
227 fNoGlobalChecks = true;
228 HLTInfo("Only per block data consistancy checks will be applied,"
229 " but no global checks will be made."
233 if (strcmp(argv[i], "-warn_on_unexpected_block") == 0)
235 fWarnForUnexpecedBlock = true;
238 if (strcmp(argv[i], "-return_error") == 0)
244 HLTError("Unknown option '%s'.", argv[i]);
252 int AliHLTMUONDataCheckerComponent::DoDeinit()
254 /// Inherited from AliHLTComponent. Performs a cleanup of the component.
256 HLTInfo("Deinitialising dHLT data checker component.");
261 int AliHLTMUONDataCheckerComponent::DoEvent(
262 const AliHLTComponentEventData& evtData,
263 const AliHLTComponentBlockData* blocks,
264 AliHLTComponentTriggerData& trigData,
265 AliHLTUInt8_t* /*outputPtr*/,
266 AliHLTUInt32_t& size,
267 AliHLTComponentBlockDataList& outputBlocks
270 /// Inherited from AliHLTProcessor. Processes the new event data.
271 /// Here we go through the list of input data blocks and apply extensive
272 /// data integrity checking on the data found.
274 if (not IsDataEvent()) return 0;
276 HLTDebug("Processing event %llu with %u input data blocks.",
277 evtData.fEventID, evtData.fBlockCnt
280 // Allocate an array of flags indicating if the data block is OK or not,
281 // also arrays to store specific.
282 bool dataProblems = false;
283 bool* blockOk = NULL;
284 typedef const AliHLTComponentBlockData* PAliHLTComponentBlockData;
285 PAliHLTComponentBlockData* trigRecBlocks = NULL;
286 PAliHLTComponentBlockData* trigRecDebugBlocks = NULL;
287 PAliHLTComponentBlockData* hitBlocks = NULL;
288 PAliHLTComponentBlockData* clusterBlocks = NULL;
289 PAliHLTComponentBlockData* channelBlocks = NULL;
290 PAliHLTComponentBlockData* mansoTrackBlocks = NULL;
291 PAliHLTComponentBlockData* mansoCandidateBlocks = NULL;
292 PAliHLTComponentBlockData* trackBlocks = NULL;
293 PAliHLTComponentBlockData* singleDecisionBlocks = NULL;
294 PAliHLTComponentBlockData* pairDecisionBlocks = NULL;
295 AliHLTUInt32_t trigRecBlocksCount = 0;
296 AliHLTUInt32_t trigRecDebugBlocksCount = 0;
297 AliHLTUInt32_t hitBlocksCount = 0;
298 AliHLTUInt32_t clusterBlocksCount = 0;
299 AliHLTUInt32_t channelBlocksCount = 0;
300 AliHLTUInt32_t mansoTrackBlocksCount = 0;
301 AliHLTUInt32_t mansoCandidateBlocksCount = 0;
302 AliHLTUInt32_t trackBlocksCount = 0;
303 AliHLTUInt32_t singleDecisionBlocksCount = 0;
304 AliHLTUInt32_t pairDecisionBlocksCount = 0;
307 blockOk = new bool[evtData.fBlockCnt];
308 trigRecBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
309 trigRecDebugBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
310 hitBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
311 clusterBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
312 channelBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
313 mansoTrackBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
314 mansoCandidateBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
315 trackBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
316 singleDecisionBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
317 pairDecisionBlocks = new PAliHLTComponentBlockData[evtData.fBlockCnt];
319 catch (const std::bad_alloc&)
321 HLTError("Could not allocate more memory for internal arrays.");
322 // Make sure to clean up if partially allocated memory.
323 if (blockOk != NULL) delete [] blockOk;
324 if (trigRecBlocks != NULL) delete [] trigRecBlocks;
325 if (trigRecDebugBlocks != NULL) delete [] trigRecDebugBlocks;
326 if (hitBlocks != NULL) delete [] hitBlocks;
327 if (clusterBlocks != NULL) delete [] clusterBlocks;
328 if (channelBlocks != NULL) delete [] channelBlocks;
329 if (mansoTrackBlocks != NULL) delete [] mansoTrackBlocks;
330 if (mansoCandidateBlocks != NULL) delete [] mansoCandidateBlocks;
331 if (trackBlocks != NULL) delete [] trackBlocks;
332 if (singleDecisionBlocks != NULL) delete [] singleDecisionBlocks;
333 if (pairDecisionBlocks != NULL) delete [] pairDecisionBlocks;
337 AliHLTComponentDataType anyPrivateType = AliHLTComponentDataTypeInitializer(
338 kAliHLTAnyDataType, kAliHLTDataOriginPrivate
343 // Clear all the flags indicating if the blocks are ok.
344 for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
349 for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
351 HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
352 n, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
355 AliHLTMUONDataBlockType blockType = kUnknownDataBlock;
359 // Decode the block type if we must ignore the block type
360 // as given by the HLT framework.
361 if (blocks[n].fSize >= sizeof(AliHLTMUONDataBlockHeader))
363 const AliHLTMUONDataBlockHeader* header =
364 reinterpret_cast<const AliHLTMUONDataBlockHeader*>(blocks[n].fPtr);
365 blockType = AliHLTMUONDataBlockType(header->fType);
370 if (blocks[n].fDataType == anyPrivateType)
372 // Completely ignore any private HLT internal block types.
376 else if (blocks[n].fDataType == AliHLTMUONConstants::DDLRawDataType())
378 blockOk[n] = CheckRawDataBlock(blocks[n], n);
381 else if (blocks[n].fDataType == AliHLTMUONConstants::TriggerRecordsBlockDataType())
383 blockType = kTriggerRecordsDataBlock;
385 else if (blocks[n].fDataType == AliHLTMUONConstants::TrigRecsDebugBlockDataType())
387 blockType = kTrigRecsDebugDataBlock;
389 else if (blocks[n].fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
391 blockType = kRecHitsDataBlock;
393 else if (blocks[n].fDataType == AliHLTMUONConstants::ClusterBlockDataType())
395 blockType = kClustersDataBlock;
397 else if (blocks[n].fDataType == AliHLTMUONConstants::ChannelBlockDataType())
399 blockType = kChannelsDataBlock;
401 else if (blocks[n].fDataType == AliHLTMUONConstants::MansoTracksBlockDataType())
403 blockType = kMansoTracksDataBlock;
405 else if (blocks[n].fDataType == AliHLTMUONConstants::MansoCandidatesBlockDataType())
407 blockType = kMansoCandidatesDataBlock;
409 else if (blocks[n].fDataType == AliHLTMUONConstants::TracksBlockDataType())
411 blockType = kTracksDataBlock;
413 else if (blocks[n].fDataType == AliHLTMUONConstants::SinglesDecisionBlockDataType())
415 blockType = kSinglesDecisionDataBlock;
417 else if (blocks[n].fDataType == AliHLTMUONConstants::PairsDecisionBlockDataType())
419 blockType = kPairsDecisionDataBlock;
423 // Log a message indicating that we got a data block that we
424 // do not know how to handle.
425 if (fWarnForUnexpecedBlock)
426 HLTWarning("Received a data block of a type we cannot"
427 " handle: '%s', spec: 0x%8.8X",
428 DataType2Text(blocks[n].fDataType).c_str(),
429 blocks[n].fSpecification
433 HLTDebug("Received a data block of a type we cannot"
434 " handle: '%s', spec: 0x%8.8X",
435 DataType2Text(blocks[n].fDataType).c_str(),
436 blocks[n].fSpecification
444 case kTriggerRecordsDataBlock:
445 blockOk[n] = CheckTriggerRecordsBlock(blocks[n], n);
446 trigRecBlocks[trigRecBlocksCount++] = &blocks[n];
448 case kTrigRecsDebugDataBlock:
449 blockOk[n] = CheckTrigRecsDebugBlock(blocks[n], n);
450 trigRecDebugBlocks[trigRecDebugBlocksCount++] = &blocks[n];
452 case kRecHitsDataBlock:
453 blockOk[n] = CheckRecHitsBlock(blocks[n], n);
454 hitBlocks[hitBlocksCount++] = &blocks[n];
456 case kClustersDataBlock:
457 blockOk[n] = CheckClustersBlock(blocks[n], n);
458 clusterBlocks[clusterBlocksCount++] = &blocks[n];
460 case kChannelsDataBlock:
461 blockOk[n] = CheckChannelsBlock(blocks[n], n);
462 channelBlocks[channelBlocksCount++] = &blocks[n];
464 case kMansoTracksDataBlock:
465 blockOk[n] = CheckMansoTracksBlock(blocks[n], n);
466 mansoTrackBlocks[mansoTrackBlocksCount++] = &blocks[n];
468 case kMansoCandidatesDataBlock:
469 blockOk[n] = CheckMansoCandidatesBlock(blocks[n], n);
470 mansoCandidateBlocks[mansoCandidateBlocksCount++] = &blocks[n];
472 case kTracksDataBlock:
473 blockOk[n] = CheckTracksBlock(blocks[n], n);
474 trackBlocks[trackBlocksCount++] = &blocks[n];
476 case kSinglesDecisionDataBlock:
477 blockOk[n] = CheckSinglesDecisionBlock(blocks[n], n);
478 singleDecisionBlocks[singleDecisionBlocksCount++] = &blocks[n];
480 case kPairsDecisionDataBlock:
481 blockOk[n] = CheckPairsDecisionBlock(blocks[n], n);
482 pairDecisionBlocks[pairDecisionBlocksCount++] = &blocks[n];
485 HLTDebug("Received a data block for which we could not decode the data type."
486 " fDataType = '%s', fSpecification = 0x%8.8X, fSize = %u bytes.",
487 DataType2Text(blocks[n].fDataType).c_str(),
488 blocks[n].fSpecification,
495 // Apply the global data consistancy checks if not suppressed by the user.
496 if (not fNoGlobalChecks)
499 blocks, blockOk, evtData.fBlockCnt,
500 trigRecBlocks, trigRecBlocksCount,
501 trigRecDebugBlocks, trigRecDebugBlocksCount,
502 hitBlocks, hitBlocksCount,
503 clusterBlocks, clusterBlocksCount,
504 channelBlocks, channelBlocksCount,
505 mansoTrackBlocks, mansoTrackBlocksCount,
506 mansoCandidateBlocks, mansoCandidateBlocksCount,
507 trackBlocks, trackBlocksCount,
508 singleDecisionBlocks, singleDecisionBlocksCount,
509 pairDecisionBlocks, pairDecisionBlocksCount
513 // Forward the input data blocks if we have not been asked to drop them.
514 // Also remember to filter for bad blocks if so specified.
515 if (not fDontForward)
517 for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
519 if (fFilterBadBlocks and blockOk[n]) continue;
520 outputBlocks.push_back(blocks[n]);
524 // Set dataProblems flag is there was at least one block with problems.
525 for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
527 if (not blockOk[n]) dataProblems = true;
532 // make sure to cleanup memory
534 delete [] trigRecBlocks;
535 delete [] trigRecDebugBlocks;
537 delete [] clusterBlocks;
538 delete [] channelBlocks;
539 delete [] mansoTrackBlocks;
540 delete [] mansoCandidateBlocks;
541 delete [] trackBlocks;
542 delete [] singleDecisionBlocks;
543 delete [] pairDecisionBlocks;
546 // Finally we set the total size of output memory we consumed, which is
547 // zero since we just copied the input descriptors to output if anything.
550 if (dataProblems and DumpDataOnError()) DumpEvent(evtData, trigData);
554 // If we were requested to return errors if there were integrity
555 // problems then check if any data blocks had problems and return
557 if (dataProblems) return -EFAULT;
563 bool AliHLTMUONDataCheckerComponent::IsSpecificationValid(
564 const AliHLTComponentBlockData& block,
565 AliHLTUInt32_t blockNumber,
569 /// Checks if the specification bits are valid.
570 /// \param block The block whose specification should be checked.
571 /// \param blockNumber The block index number being checked.
572 /// \param name The name of the type of block being checked.
573 /// \returns true if the specification is valid and false otherwise.
575 if (AliHLTMUONUtils::IsSpecValid(block.fSpecification))
578 HLTError("Problem found with data block %d, fDataType = '%s',"
579 " fPtr = %p and fSize = %u bytes."
580 " Assuming this is a %s data block."
581 " Problem: The specification does not contain a valid pattern,"
582 " received 0x%8.8X for the specification.",
584 DataType2Text(block.fDataType).c_str(),
594 bool AliHLTMUONDataCheckerComponent::IsFromTrackerOnly(
595 const AliHLTComponentBlockData& block,
596 AliHLTUInt32_t blockNumber,
600 /// Checks if the specification bits are valid and indicate the block
601 /// contains data or information only from the tracker DDLs.
602 /// \param block The block whose specification should be checked.
603 /// \param blockNumber The block index number being checked.
604 /// \param name The name of the type of block being checked.
605 /// \returns true if the specification indicates data is only from tracker.
607 bool result = IsSpecificationValid(block, blockNumber, name);
609 if (AliHLTMUONUtils::ContainsDataFromTracker(block.fSpecification) and
610 not AliHLTMUONUtils::ContainsDataFromTrigger(block.fSpecification)
616 HLTError("Problem found with data block %d, fDataType = '%s',"
617 " fPtr = %p and fSize = %u bytes."
618 " Assuming this is a %s data block."
619 " Problem: The data block does not contain data only from the"
620 " tracker DDLs as expected."
621 " Received 0x%8.8X for the specification.",
623 DataType2Text(block.fDataType).c_str(),
633 bool AliHLTMUONDataCheckerComponent::IsFromTriggerOnly(
634 const AliHLTComponentBlockData& block,
635 AliHLTUInt32_t blockNumber,
639 /// Checks if the specification bits are valid and indicate the block
640 /// contains data or information only from the trigger DDLs.
641 /// \param block The block whose specification should be checked.
642 /// \param blockNumber The block index number being checked.
643 /// \param name The name of the type of block being checked.
644 /// \returns true if the specification indicates data is only from trigger.
646 bool result = IsSpecificationValid(block, blockNumber, name);
648 if (AliHLTMUONUtils::ContainsDataFromTrigger(block.fSpecification) and
649 not AliHLTMUONUtils::ContainsDataFromTracker(block.fSpecification)
655 HLTError("Problem found with data block %d, fDataType = '%s',"
656 " fPtr = %p and fSize = %u bytes."
657 " Assuming this is a %s data block."
658 " Problem: The data block does not contain data only from the"
659 " trigger DDLs as expected."
660 " Received 0x%8.8X for the specification.",
662 DataType2Text(block.fDataType).c_str(),
672 bool AliHLTMUONDataCheckerComponent::IsMomentumVectorOk(
673 const AliHLTComponentBlockData& block,
674 AliHLTUInt32_t blockNumber,
676 AliHLTUInt32_t entryNumber,
682 /// Checks if the momentum vector is reasonable.
683 /// \param block The block from which the momentum vector data comes from.
684 /// \param blockNumber The block index number.
685 /// \param name The name of the type of block.
686 /// \param entryNumber The entry index number of the structure holding
687 /// the momentum vector data.
688 /// \param px The X coordinate of the momentum vector (GeV/c).
689 /// \param py The Y coordinate of the momentum vector (GeV/c).
690 /// \param pz The Z coordinate of the momentum vector (GeV/c).
691 /// \returns true if the momentum vector is valid and false otherwise.
693 // If the momentum vector is nil then ignore it.
694 if (px == 0 and py == 0 and pz == 0) return true;
698 // If the momentum vector is sane then we should not have a particle with
699 // more energy than 14 TeV and momentum should be in the negative direction.
700 double momentum = sqrt(px*px + py*py + pz*pz);
703 // Just warn since this is a data sanity problem rather
704 // than a data integrity problem.
705 HLTWarning("Problem found with data block %d, fDataType = '%s',"
706 " fPtr = %p and fSize = %u bytes."
707 " Assuming this is a %s data block."
708 " Problem with entry %d in block: The momentum vector"
709 " p = {%f, %f, %f}, |p| = %f looks too big.",
711 DataType2Text(block.fDataType).c_str(),
724 // Just warn since this is a data sanity problem rather
725 // than a data integrity problem.
726 HLTWarning("Problem found with data block %d, fDataType = '%s',"
727 " fPtr = %p and fSize = %u bytes."
728 " Assuming this is a %s data block."
729 " Problem with entry %d in block: The momentum vector"
730 " p = {%f, %f, %f} points away from the dimuon"
731 " spectrometer (p_z > 0).",
733 DataType2Text(block.fDataType).c_str(),
747 bool AliHLTMUONDataCheckerComponent::AreMomentumCalcParamsOk(
748 const AliHLTComponentBlockData& block,
749 AliHLTUInt32_t blockNumber,
751 AliHLTUInt32_t entryNumber,
752 AliHLTFloat32_t zmiddle,
756 /// Checks if the parameters for the momentum calculation are reasonable.
757 /// \param block The block from which the parameter data comes from.
758 /// \param blockNumber The block index number.
759 /// \param name The name of the type of block.
760 /// \param entryNumber The entry index number of the structure holding
761 /// the parameter data data.
762 /// \param zmiddle The z-coordinate of the middle of the magnetic field (cm).
763 /// \param bl The integrated magnetic field (T.m).
764 /// \returns true if the parameters are valid and false otherwise.
768 // Check that the value of the fZmiddle value is somewhere
769 // within the tracking / dipole magnetic field area.
770 if (zmiddle < AliMUONConstants::AbsZEnd() or
771 zmiddle < AliMUONConstants::MuonFilterZBeg()
774 // Just warn since this is a data sanity problem rather
775 // than a data integrity problem.
776 HLTWarning("Problem found with data block %d, fDataType = '%s',"
777 " fPtr = %p and fSize = %u bytes."
778 " Assuming this is a %s data block."
779 " Problem with entry %d in block: The Z coordinate %f cm"
780 " used as the middle of the magnetic field in the momentum"
781 " calculation is outside the dimuon spectrometers dipole"
782 " magnetic field volume.",
784 DataType2Text(block.fDataType).c_str(),
794 // Also check that the value of the 'bl' value is within a
795 // reasonable range: |bl| < Lmax * Bmax, where
796 // Lmax = max length from vertex to end of spectrometer, and
797 // Bmax = max magnetic field of dipole, taken as 1 tesla.
798 // Approximating Lmax * Bmax as 20 T.m
801 // Just warn since this is a data sanity problem rather
802 // than a data integrity problem.
803 HLTWarning("Problem found with data block %d, fDataType = '%s',"
804 " fPtr = %p and fSize = %u bytes."
805 " Assuming this is a %s data block."
806 " Problem with entry %d in block: The integrated magnetic"
807 " field value %f T.m used in the momentum calculation"
808 " has an unreasonably large absolute value.",
810 DataType2Text(block.fDataType).c_str(),
824 bool AliHLTMUONDataCheckerComponent::IsHitCoordinateOk(
825 const AliHLTComponentBlockData& block,
826 AliHLTUInt32_t blockNumber,
828 AliHLTUInt32_t entryNumber,
829 const AliHLTMUONRecHitStruct& hit,
830 AliHLTInt32_t minChamber,
831 AliHLTInt32_t maxChamber,
832 AliHLTInt32_t expectedChamber,
836 /// Checks if the hit coordinate is compatible with a the location of a
837 /// dimuon spectrometer chamber. Also, if expectedChamber is not -1, then
838 /// the hit coordinate is checked if to comes from that chamber.
839 /// We also check if the fFlags containing the chamber number and detector
840 /// element ID are correct.
841 /// \param block The block from which the hit data comes from.
842 /// \param blockNumber The block index number.
843 /// \param name The name of the type of block.
844 /// \param entryNumber The entry index number of the hit.
845 /// \param hit The hit data being checked.
846 /// \param minChamber The minimum valid chamber number to check for.
847 /// \param maxChamber The maximum valid chamber number to check for.
848 /// \param expectedChamber If not -1 then this is the chamber number to
850 /// \param ddl The array decoded by AliHLTMUONUtils::UnpackSpecBits.
851 /// \returns true if the hit is valid and false otherwise.
853 assert( 0 <= minChamber and minChamber < 14 );
854 assert( 0 <= maxChamber and maxChamber < 14 );
858 AliHLTUInt8_t chNum = 0xFF;
859 AliHLTUInt16_t detElemId = 0xFFFF;
860 AliHLTMUONUtils::UnpackRecHitFlags(hit.fFlags, chNum, detElemId);
862 Int_t chamber = AliMUONConstants::ChamberNumber(hit.fZ, false); // false = do not warn.
863 if (chamber < minChamber or maxChamber < chamber)
865 HLTError("Problem found with data block %d, fDataType = '%s',"
866 " fPtr = %p and fSize = %u bytes."
867 " Assuming this is a %s data block."
868 " Problem with entry %d in block: The hit {x = %f, y = %f,"
869 " z = %f} cm has a z-coordinate that does not correspond"
870 " to the nominal position of any chambers in the range"
873 DataType2Text(block.fDataType).c_str(),
878 hit.fX, hit.fY, hit.fZ,
885 if (chNum != chamber)
887 HLTError("Problem found with data block %d, fDataType = '%s',"
888 " fPtr = %p and fSize = %u bytes."
889 " Assuming this is a %s data block."
890 " Problem with entry %d in block: The hit {x = %f, y = %f,"
891 " z = %f} cm has a chamber number %d that does not correspond"
892 " to the expected chamber %d given by the z-coordinate.",
894 DataType2Text(block.fDataType).c_str(),
899 hit.fX, hit.fY, hit.fZ,
904 if (minChamber <= Int_t(chNum) and Int_t(chNum) <= maxChamber)
906 // Rather use the explicit value in the data if it
912 if (expectedChamber != -1 and chamber != expectedChamber)
914 HLTError("Problem found with data block %d, fDataType = '%s',"
915 " fPtr = %p and fSize = %u bytes."
916 " Assuming this is a %s data block."
917 " Problem with entry %d in block: The hit {x = %f, y = %f,"
918 " z = %f} cm has a position that corresponds to chamber %d,"
919 " but expected it to be on chamber %d.",
921 DataType2Text(block.fDataType).c_str(),
926 hit.fX, hit.fY, hit.fZ,
933 AliHLTFloat32_t rmin = AliMUONConstants::Rmin(chamber / 2);
934 AliHLTFloat32_t rmax = AliMUONConstants::Rmax(chamber / 2);
935 AliHLTFloat32_t radius = sqrt(hit.fX*hit.fX + hit.fY*hit.fY);
936 if (radius < rmin or rmax < radius)
938 HLTError("Problem found with data block %d, fDataType = '%s',"
939 " fPtr = %p and fSize = %u bytes."
940 " Assuming this is a %s data block."
941 " Problem with entry %d in block: The hit {x = %f, y = %f,"
942 " z = %f} cm has a position in the X-Y plane that does not"
943 " correspond to the nominal position of chamber %d.",
945 DataType2Text(block.fDataType).c_str(),
950 hit.fX, hit.fY, hit.fZ,
956 if (not fIgnoreSpec and not ChamberMarkedInDDLList(chamber, ddl))
958 HLTError("Problem found with data block %d, fDataType = '%s',"
959 " fPtr = %p and fSize = %u bytes."
960 " Assuming this is a %s data block."
961 " Problem with entry %d in block: The hit {x = %f, y = %f,"
962 " z = %f} cm has a position that corresponds to chamber %d"
963 " but the data block specification 0x%8.8X does have a"
964 " corresponding DDL bit set.",
966 DataType2Text(block.fDataType).c_str(),
971 hit.fX, hit.fY, hit.fZ,
978 // Check that the detector element ID is valid and it corresponds to
979 // the chamber number.
980 if (FetchMappingStores() == 0) // are stores loaded?
982 Bool_t warn = kFALSE;
983 AliMpDEStore* store = AliMpDEStore::Instance(warn);
984 AliMpDetElement* de = store->GetDetElement(Int_t(detElemId), warn);
987 HLTError("Problem found with data block %d, fDataType = '%s',"
988 " fPtr = %p and fSize = %u bytes."
989 " Assuming this is a %s data block."
990 " Problem with entry %d in block: The hit {x = %f, y = %f,"
991 " z = %f} cm has a detector element ID %d,"
992 " which is not valid.",
994 DataType2Text(block.fDataType).c_str(),
999 hit.fX, hit.fY, hit.fZ,
1005 // Check that the chamber number from the detector element number
1006 // has the expected value.
1007 Int_t ch = AliMpDEManager::GetChamberId(Int_t(detElemId), warn);
1010 HLTError("Problem found with data block %d, fDataType = '%s',"
1011 " fPtr = %p and fSize = %u bytes."
1012 " Assuming this is a %s data block."
1013 " Problem with entry %d in block: The hit {x = %f, y = %f,"
1014 " z = %f} cm has a detector element ID %d,"
1015 " which does not correspond to the chamber %d.",
1017 DataType2Text(block.fDataType).c_str(),
1022 hit.fX, hit.fY, hit.fZ,
1031 HLTWarning("Cannot check a hit's detector element ID information"
1032 " without being able to load the mapping from CDB."
1041 bool AliHLTMUONDataCheckerComponent::IsMansoTrackOk(
1042 const AliHLTComponentBlockData& block,
1043 AliHLTUInt32_t blockNumber,
1045 AliHLTUInt32_t entryNumber,
1046 const AliHLTMUONMansoTrackStruct& track,
1050 /// Checks if the Manso track structure is Ok.
1051 /// \param block The block from which the track data comes from.
1052 /// \param blockNumber The block index number.
1053 /// \param name The name of the type of block.
1054 /// \param entryNumber The entry index number of the structure in the
1055 /// block being checked.
1056 /// \param track The Manso track data being checked.
1057 /// \param ddl The array decoded by AliHLTMUONUtils::UnpackSpecBits.
1058 /// \returns true if the Manso track is valid and false otherwise.
1062 // Chi^2 should not be greater than the worst fit possible, estimated
1063 // as the diameter of largest chamber times the number of points
1064 // findable in a track. Max points is 10 tracker chambers times
1065 // 2 cathodes + 4 trigger chambers.
1066 if (track.fChi2 > AliMUONConstants::Dmax(6)*AliMUONConstants::Dmax(6)*(10*2+4))
1068 // Just a warning since this is not technically an
1069 // integrity problem.
1070 HLTWarning("Problem found with data block %d, fDataType = '%s',"
1071 " fPtr = %p and fSize = %u bytes."
1072 " Assuming this is a %s data block."
1073 " Problem with entry %d in block: The Manso track has"
1074 " the chi squared value of %f that is unreasonably big.",
1076 DataType2Text(block.fDataType).c_str(),
1086 // Check if the momentum vector is reasonable.
1087 bool momOk = IsMomentumVectorOk(
1088 block, blockNumber, name, entryNumber,
1089 track.fPx, track.fPy, track.fPz
1091 if (not momOk) result = false;
1093 AliHLTMUONParticleSign sign;
1095 AliHLTMUONUtils::UnpackMansoTrackFlags(track.fFlags, sign, hitset);
1097 // Min and max allowed chamber numbers for hits:
1099 Int_t maxCh = AliMUONConstants::NTrackingCh() - 1;
1101 // Check that this hit coordinates are OK.
1102 for (AliHLTUInt32_t i = 0; i < 4; i++)
1104 if (not hitset[i]) continue; // ignore hits that are not initialised.
1105 bool hitOk = IsHitCoordinateOk(
1106 block, blockNumber, name, entryNumber, track.fHit[i],
1107 minCh, maxCh, i+6, ddl
1109 if (not hitOk) result = false;
1116 bool AliHLTMUONDataCheckerComponent::IsTrackOk(
1117 const AliHLTComponentBlockData& block,
1118 AliHLTUInt32_t blockNumber,
1120 AliHLTUInt32_t entryNumber,
1121 const AliHLTMUONTrackStruct& track,
1125 /// Checks if the full track structure is Ok.
1126 /// \param block The block from which the track data comes from.
1127 /// \param blockNumber The block index number.
1128 /// \param name The name of the type of block.
1129 /// \param entryNumber The entry index number of the structure in the
1130 /// block being checked.
1131 /// \param track The track data being checked.
1132 /// \param ddl The array decoded by AliHLTMUONUtils::UnpackSpecBits.
1133 /// \returns true if the full track structure is valid and false otherwise.
1137 // Chi^2 should not be greater than the worst fit possible, estimated
1138 // as the diameter of largest chamber times the number of points
1139 // findable in a track. Max points is 10 tracker chambers times
1140 // 2 cathodes + 4 trigger chambers.
1141 if (track.fChi2 > AliMUONConstants::Dmax(6)*AliMUONConstants::Dmax(6)*(10*2+4))
1143 // Just a warning since this is not technically an
1144 // integrity problem.
1145 HLTWarning("Problem found with data block %d, fDataType = '%s',"
1146 " fPtr = %p and fSize = %u bytes."
1147 " Assuming this is a %s data block."
1148 " Problem with entry %d in block: The track has"
1149 " the chi squared value of %f that is unreasonably big.",
1151 DataType2Text(block.fDataType).c_str(),
1161 // Check if the momentum vector is reasonable.
1162 bool momOk = IsMomentumVectorOk(
1163 block, blockNumber, name, entryNumber,
1164 track.fPx, track.fPy, track.fPz
1166 if (not momOk) result = false;
1168 // Check that the momentum parameters correspond to the momentum vector.
1169 double momvalue = sqrt(track.fPy*track.fPy + track.fPz*track.fPz);
1170 double invMom = (momvalue != 0 ? 1. / momvalue : 0);
1171 if (TMath::Abs(invMom - TMath::Abs(track.fInverseBendingMomentum)) > 1e-12)
1173 HLTError("Problem found with data block %d, fDataType = '%s',"
1174 " fPtr = %p and fSize = %u bytes."
1175 " Assuming this is a %s data block."
1176 " Problem with entry %d in block: The track's inverse bending"
1177 " momentum %f does not correspond to the momentum vector.",
1179 DataType2Text(block.fDataType).c_str(),
1184 track.fInverseBendingMomentum
1188 if (track.fPz != 0 and TMath::Abs(track.fPx/track.fPz - track.fThetaX) > 1e-12)
1190 HLTError("Problem found with data block %d, fDataType = '%s',"
1191 " fPtr = %p and fSize = %u bytes."
1192 " Assuming this is a %s data block."
1193 " Problem with entry %d in block: The track's non-bending plane"
1194 " slope parameter %f does not correspond to the momentum vector.",
1196 DataType2Text(block.fDataType).c_str(),
1205 if (track.fPz != 0 and TMath::Abs(track.fPy/track.fPz - track.fThetaY) > 1e-12)
1207 HLTError("Problem found with data block %d, fDataType = '%s',"
1208 " fPtr = %p and fSize = %u bytes."
1209 " Assuming this is a %s data block."
1210 " Problem with entry %d in block: The track's bending plane"
1211 " slope parameter %f does not correspond to the momentum vector.",
1213 DataType2Text(block.fDataType).c_str(),
1223 // Check that the DCA vertex is reasonable. i.e. the vertex is within
1224 // a 1 meter cube of the origin.
1225 if (TMath::Abs(track.fX) > 100 or TMath::Abs(track.fY) > 100 or TMath::Abs(track.fZ) > 100)
1227 // Just a warning since this is not technically an integrity problem.
1228 HLTWarning("Problem found with data block %d, fDataType = '%s',"
1229 " fPtr = %p and fSize = %u bytes."
1230 " Assuming this is a %s data block."
1231 " Problem with entry %d in block: The track's distance of closest"
1232 " approach (DCA) vertex (x, y, z) = (%f, %f, %f) is not a reasonable value.",
1234 DataType2Text(block.fDataType).c_str(),
1239 track.fX, track.fY, track.fZ
1244 AliHLTMUONParticleSign sign;
1246 AliHLTMUONUtils::UnpackTrackFlags(track.fFlags, sign, hitset);
1248 // Min and max allowed chamber numbers for hits:
1250 Int_t maxCh = AliMUONConstants::NTrackingCh() - 1;
1252 // Check that this hit coordinates are OK.
1253 for (AliHLTUInt32_t i = 0; i < 16; i++)
1255 if (not hitset[i]) continue; // ignore hits that are not initialised.
1256 bool hitOk = IsHitCoordinateOk(
1257 block, blockNumber, name, entryNumber, track.fHit[i],
1258 minCh, maxCh, -1, ddl
1260 if (not hitOk) result = false;
1267 bool AliHLTMUONDataCheckerComponent::CheckDetElemIds(
1268 const AliHLTComponentBlockData& infoBlock,
1269 AliHLTUInt32_t infoBlockNumber,
1270 AliHLTUInt32_t infoEntryNumber,
1271 const AliHLTMUONTrigRecInfoStruct& info,
1272 const AliHLTComponentBlockData& trBlock,
1273 AliHLTUInt32_t trBlockNumber,
1274 AliHLTUInt32_t trEntryNumber,
1275 const AliHLTMUONTriggerRecordStruct& tr
1278 /// Checks if the detector element IDs are the same in the debug
1279 /// information structure and the trigger record structure.
1280 /// \param infoBlock The debug information block from which the 'info'
1281 /// data comes from.
1282 /// \param infoBlockNumber The debug information block index number.
1283 /// \param infoEntryNumber The entry index number of the 'info'
1284 /// structure in the debug information data block.
1285 /// \param info The debug information structure being checked.
1286 /// \param trBlock The trigger record block from which the 'tr' data
1288 /// \param trBlockNumber The trigger record block index number.
1289 /// \param trEntryNumber The entry index number of the 'tr' structure
1290 /// in the trigger record data block.
1291 /// \param tr The trigger record structure being checked.
1292 /// \returns true if the detector element IDs are the same and false
1297 for (int i = 0; i < 4; i++)
1299 AliHLTUInt8_t chamber = 0xFF;
1300 AliHLTUInt16_t detElemId = 0xFFFF;
1301 AliHLTMUONUtils::UnpackRecHitFlags(tr.fHit[i].fFlags, chamber, detElemId);
1302 if (info.fDetElemId[i] == detElemId) continue;
1304 HLTError("Problem found with trigger record debug information %d"
1305 " in data block %d (fDataType = '%s', fPtr = %p, fSize"
1306 " = %u bytes) and trigger record %d in data block %d"
1307 " (fDataType = '%s', fPtr = %p, fSize = %u bytes):"
1308 " The detection element ID %d for chamber %d in the debug"
1309 " information, is not the same as %d"
1310 " found in the trigger record.",
1313 DataType2Text(infoBlock.fDataType).c_str(),
1318 DataType2Text(trBlock.fDataType).c_str(),
1332 bool AliHLTMUONDataCheckerComponent::CheckDetElemIds(
1333 const AliHLTComponentBlockData& clusterBlock,
1334 AliHLTUInt32_t clusterBlockNumber,
1335 AliHLTUInt32_t clusterEntryNumber,
1336 const AliHLTMUONClusterStruct& cluster,
1337 const AliHLTComponentBlockData& hitBlock,
1338 AliHLTUInt32_t hitBlockNumber,
1339 AliHLTUInt32_t hitEntryNumber,
1340 const AliHLTMUONRecHitStruct& hit
1343 /// Checks if the detector element IDs are the same in the cluster
1344 /// structure and the reconstructed hit structure.
1345 /// \param clusterBlock The cluster block from which the 'cluster' data
1347 /// \param clusterBlockNumber The cluster block index number.
1348 /// \param clusterEntryNumber The entry index number of the 'cluster'
1349 /// structure in the cluster data block.
1350 /// \param cluster The cluster structure being checked.
1351 /// \param hitBlock The reconstructed hit block from which the 'hit'
1352 /// data comes from.
1353 /// \param hitBlockNumber The reconstructed hit block index number.
1354 /// \param hitEntryNumber The entry index number of the 'hit' structure
1355 /// in the reconstructed hit data block.
1356 /// \param hit The trigger record structure being checked.
1357 /// \returns true if the detector element IDs are the same and false
1362 AliHLTUInt8_t chamber = 0xFF;
1363 AliHLTUInt16_t detElemId = 0xFFFF;
1364 AliHLTMUONUtils::UnpackRecHitFlags(hit.fFlags, chamber, detElemId);
1365 if (cluster.fDetElemId != detElemId)
1367 HLTError("Problem found with cluster %d in data block %d"
1368 " (fDataType = '%s', fPtr = %p, fSize = %u bytes)"
1369 " and reconstructed hit %d in data block %d"
1370 " (fDataType = '%s', fPtr = %p, fSize = %u bytes):"
1371 " The detection element ID %d in the cluster, is not"
1372 " the same as %d found in the reconstructed hit.",
1375 DataType2Text(clusterBlock.fDataType).c_str(),
1380 DataType2Text(hitBlock.fDataType).c_str(),
1396 * Class for logging errors found in raw DDL data.
1398 class AliHLTMUONDecoderHandler : public AliHLTLogging
1402 /// Default constructor
1403 AliHLTMUONDecoderHandler() :
1411 /// Default destructor.
1412 virtual ~AliHLTMUONDecoderHandler() {}
1414 /// Sets the DDL raw data block descriptor.
1415 void SetDescriptor(const AliHLTComponentBlockData* b) { fDescriptor = b; }
1417 /// Sets the block number of the raw data block descriptor.
1418 void SetBlockNumber(AliHLTUInt32_t n) { fBlockNumber = n; }
1420 /// Logs an error message describing the problem with the DDL raw data.
1421 template <typename ErrorCode, class DecoderHandler>
1422 void LogError(ErrorCode code, const void* location, DecoderHandler& handler);
1425 // Do not allow copying of this class.
1427 AliHLTMUONDecoderHandler(const AliHLTMUONDecoderHandler& rhs); // copy constructor
1429 AliHLTMUONDecoderHandler& operator = (const AliHLTMUONDecoderHandler& rhs); // assignment operator
1431 const void* fBufferStart; ///< Pointer to the start of the current DDL payload buffer.
1432 const AliHLTComponentBlockData* fDescriptor; ///< Descriptor for the DDL raw data block corresponding to the buffer.
1433 AliHLTUInt32_t fBlockNumber; ///< The number / index of the block descriptor.
1437 template <typename ErrorCode, class DecoderHandler>
1438 void AliHLTMUONDecoderHandler::LogError(ErrorCode code, const void* location, DecoderHandler& handler)
1440 /// Logs a HLT error message describing the problem with the raw DDL data.
1441 /// \param code The error code describing the problem.
1442 /// \param location A pointer to the location in the raw data buffer
1443 /// where the problem was found.
1444 /// \param handler The decoder handler object.
1446 long bytepos = long(location) - long(fBufferStart);
1448 // create data type string.
1449 char dataType[kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2];
1450 memset( dataType, 0, kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2 );
1451 strncat( dataType, fDescriptor->fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
1452 strncat( dataType, ":", 1 );
1453 strncat( dataType, fDescriptor->fDataType.fID, kAliHLTComponentDataTypefIDsize );
1455 HLTError("Problem found with data block %d, fDataType = '%s',"
1456 " fPtr = %p and fSize = %u bytes."
1457 " Assuming this is a DDL raw data block."
1458 " Problem: %s (Error code: %d, at byte %d)",
1463 handler.ErrorCodeToMessage(code),
1471 * Class for logging decoding errors when checking tracker raw DDL data.
1472 * Used in the AliHLTMUONDataCheckerComponent::CheckRawDataBlock method.
1474 class AliHLTMUONTrackerDecoderHandler :
1475 public AliMUONTrackerDDLDecoderEventHandler, public AliHLTMUONDecoderHandler
1478 AliHLTMUONTrackerDecoderHandler() :
1479 AliMUONTrackerDDLDecoderEventHandler(),
1480 AliHLTMUONDecoderHandler(),
1484 fCurrentBusPatch(0),
1485 fDataProblems(false)
1488 virtual ~AliHLTMUONTrackerDecoderHandler()
1490 if (fDigits != NULL) delete [] fDigits;
1493 /// Structure to store raw data words found in the raw data.
1496 UInt_t fBusPatchId; ///< Bus patch ID for the data word.
1497 UInt_t fDataWord; ///< Raw data word found in the DDL payload.
1500 /// Returns the number of digits found.
1501 UInt_t DigitCount() const { return fDigitCount; }
1503 /// Returns the array of digits found.
1504 const AliDigit* Digits() const { return fDigits; }
1506 /// Returns true if there were problems with the data.
1507 bool DataProblems() const { return fDataProblems; }
1509 // Methods inherited from AliMUONTrackerDDLDecoderEventHandler:
1511 /// Called for each new buffer.
1512 void OnNewBuffer(const void* buffer, UInt_t bufferSize);
1514 /// Called for each new DSP header.
1515 void OnNewDSP(const AliMUONDSPHeaderStruct* header, const void* /*data*/);
1517 /// Called for each new bus patch. Just marks the current bus patch ID.
1518 void OnNewBusPatch(const AliMUONBusPatchHeaderStruct* header, const void* /*data*/)
1520 fCurrentBusPatch = header->fBusPatchId;
1523 /// Called for each new data word found.
1524 void OnData(UInt_t data, bool /*parityError*/);
1526 /// Logs an error message if there was a decoding problem with the DDL payload.
1527 void OnError(ErrorCode code, const void* location)
1529 fDataProblems = true;
1530 LogError(code, location, *this);
1535 // Do not allow copying of this object.
1536 /// Not implemented.
1537 AliHLTMUONTrackerDecoderHandler(const AliHLTMUONTrackerDecoderHandler& obj);
1538 /// Not implemented.
1539 AliHLTMUONTrackerDecoderHandler& operator = (const AliHLTMUONTrackerDecoderHandler& obj);
1541 UInt_t fMaxDigits; ///< Maximum number of digits that can be stored in fDigits.
1542 UInt_t fDigitCount; ///< The number of digits currently stored in fDigits.
1543 AliDigit* fDigits; ///< The array of digits found in the DDL data.
1544 UInt_t fCurrentBusPatch; ///< The current bus patch ID being processed.
1545 bool fDataProblems; ///< flag indicating there were problems with the data.
1549 void AliHLTMUONTrackerDecoderHandler::OnNewBuffer(const void* buffer, UInt_t bufferSize)
1551 /// Called for a new buffer. It will reset internal counters and
1552 /// resize the digits array if necessary.
1554 fDataProblems = false;
1556 fBufferStart = buffer;
1558 // Resize the fDigits array to be able to store
1559 // all the digits in the data buffer.
1560 UInt_t maxSize = bufferSize / sizeof(UInt_t) + 1;
1561 if (maxSize > fMaxDigits)
1563 if (fDigits != NULL)
1571 fDigits = new AliDigit[maxSize];
1572 fMaxDigits = maxSize;
1574 catch (const std::bad_alloc&)
1576 HLTError("Could not allocate enough buffer space for internal arrays.");
1583 void AliHLTMUONTrackerDecoderHandler::OnNewDSP(
1584 const AliMUONDSPHeaderStruct* header, const void* /*data*/
1587 if (header->fPaddingWord != 0 and header->fPaddingWord != 1)
1589 // create data type string.
1590 char dataType[kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2];
1591 memset( dataType, 0, kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2 );
1592 strncat( dataType, fDescriptor->fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
1593 strncat( dataType, ":", 1 );
1594 strncat( dataType, fDescriptor->fDataType.fID, kAliHLTComponentDataTypefIDsize );
1596 HLTError("Problem found with data block %d, fDataType = '%s',"
1597 " fPtr = %p and fSize = %u bytes."
1598 " Assuming this is a tracker DDL raw data block."
1599 " Problem: Found padding word marker 0x%8.8X in DSP"
1600 " header with DSP ID %d which has an invalid value.",
1605 header->fPaddingWord,
1608 fDataProblems = true;
1614 void AliHLTMUONTrackerDecoderHandler::OnData(UInt_t data, bool /*parityError*/)
1616 /// Called for each new data word found. This method will add
1617 /// these to the list of digits and check if they are not duplicated.
1619 assert( fDigits != NULL );
1621 if ((data & 0x60000000) != 0)
1623 // create data type string.
1624 char dataType[kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2];
1625 memset( dataType, 0, kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2 );
1626 strncat( dataType, fDescriptor->fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
1627 strncat( dataType, ":", 1 );
1628 strncat( dataType, fDescriptor->fDataType.fID, kAliHLTComponentDataTypefIDsize );
1630 HLTError("Problem found with data block %d, fDataType = '%s',"
1631 " fPtr = %p and fSize = %u bytes."
1632 " Assuming this is a tracker DDL raw data block."
1633 " Problem: Found a data word 0x%8.8X for bus patch %d"
1634 " whose bits 29 or 30 are not zero.",
1642 fDataProblems = true;
1646 // Check if the data word + bus patch have been duplicated.
1647 for (UInt_t i = 0; i < fDigitCount; i++)
1649 if (fDigits[i].fDataWord == data and fDigits[i].fBusPatchId == fCurrentBusPatch)
1651 // create data type string.
1652 char dataType[kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2];
1653 memset( dataType, 0, kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize+2 );
1654 strncat( dataType, fDescriptor->fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
1655 strncat( dataType, ":", 1 );
1656 strncat( dataType, fDescriptor->fDataType.fID, kAliHLTComponentDataTypefIDsize );
1658 HLTError("Problem found with data block %d, fDataType = '%s',"
1659 " fPtr = %p and fSize = %u bytes."
1660 " Assuming this is a tracker DDL raw data block."
1661 " Problem: Found a duplicate data word 0x%8.8X for bus patch %d.",
1669 fDataProblems = true;
1674 // Add the data word + bus patch to the list of decoded digits.
1675 if (fDigitCount < fMaxDigits)
1677 fDigits[fDigitCount].fBusPatchId = fCurrentBusPatch;
1678 fDigits[fDigitCount].fDataWord = data;
1684 * Class for logging decoding errors when checking trigger raw DDL data.
1685 * Used in the AliHLTMUONDataCheckerComponent::CheckRawDataBlock method.
1687 class AliHLTMUONTriggerDecoderHandler :
1688 public AliMUONTriggerDDLDecoderEventHandler, public AliHLTMUONDecoderHandler
1691 // Methods inherited from AliMUONTriggerDDLDecoderEventHandler:
1693 /// Called for each new buffer.
1694 void OnNewBuffer(const void* buffer, UInt_t /*bufferSize*/)
1696 fBufferStart = buffer;
1699 /// Logs an error message if there was a decoding problem with the DDL payload.
1700 void OnError(ErrorCode code, const void* location)
1702 LogError(code, location, *this);
1706 } // end of namespace
1709 bool AliHLTMUONDataCheckerComponent::CheckRawDataBlock(
1710 const AliHLTComponentBlockData& block,
1711 AliHLTUInt32_t blockNumber
1714 /// Checks the validity of a raw data block.
1720 HLTWarning("Not able to check DDL raw data if -ignorespec is specified.");
1725 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
1727 // Check that only one DDL was marked in the specification.
1729 for (int i = 0; i < 22; i++)
1731 if (not ddl[i]) continue;
1739 HLTError("Problem found with data block %d, fDataType = '%s',"
1740 " fPtr = %p and fSize = %u bytes."
1741 " Assuming this is a DDL raw data block."
1742 " Problem: The specification indicates multiple"
1743 " DDL sources, DDL %d and %d.",
1745 DataType2Text(block.fDataType).c_str(),
1754 // Check the DDL common data header.
1755 AliHLTUInt32_t totalDDLSize = block.fSize;
1756 AliHLTCDHWrapper header(block.fPtr);
1757 if (totalDDLSize < sizeof(AliRawDataHeader) &&
1758 totalDDLSize < header.GetHeaderSize()) // if cdh v3
1760 HLTError("Problem found with data block %d, fDataType = '%s',"
1761 " fPtr = %p and fSize = %u bytes."
1762 " Assuming this is a DDL raw data block."
1763 " Problem: The size of the data block is too short to contain"
1764 " a valid common DDL data header. Size of buffer is only %d"
1767 DataType2Text(block.fDataType).c_str(),
1775 if (header.GetVersion() < 2)
1777 HLTError("Problem found with data block %d, fDataType = '%s',"
1778 " fPtr = %p and fSize = %u bytes."
1779 " Assuming this is a DDL raw data block."
1780 " Problem: The common DDL data header indicates an"
1781 " incorrect version number. Expected 2 but got %d.",
1783 DataType2Text(block.fDataType).c_str(),
1786 int( header.GetVersion() )
1791 if (header.GetDataSize() != 0xFFFFFFFF and header.GetDataSize() != block.fSize)
1793 HLTError("Problem found with data block %d, fDataType = '%s',"
1794 " fPtr = %p and fSize = %u bytes."
1795 " Assuming this is a DDL raw data block."
1796 " Problem: The common DDL data header indicates an"
1797 " incorrect DDL buffer size. Expected %d bytes but"
1798 " size reported in header is %d bytes.",
1800 DataType2Text(block.fDataType).c_str(),
1804 header.GetDataSize()
1809 AliHLTUInt32_t payloadSize = block.fSize - header.GetHeaderSize();
1810 const AliHLTUInt8_t* payload =
1811 reinterpret_cast<const AliHLTUInt8_t*>(block.fPtr);
1812 payload += header.GetHeaderSize();
1814 if (AliHLTMUONUtils::IsTriggerDDL(block.fSpecification))
1816 bool scalarEvent = ((header.GetL1TriggerMessage() & 0x1) == 0x1);
1817 AliMUONTriggerDDLDecoder<AliHLTMUONTriggerDecoderHandler> decoder;
1818 decoder.ExitOnError(false);
1819 decoder.TryRecover(false);
1820 decoder.AutoDetectScalars(false);
1821 decoder.GetHandler().SetDescriptor(&block);
1822 decoder.GetHandler().SetBlockNumber(blockNumber);
1823 result = decoder.Decode(payload, payloadSize, scalarEvent);
1825 else if (AliHLTMUONUtils::IsTrackerDDL(block.fSpecification))
1827 AliMUONTrackerDDLDecoder<AliHLTMUONTrackerDecoderHandler> decoder;
1828 decoder.ExitOnError(false);
1829 decoder.TryRecover(false);
1830 decoder.SendDataOnParityError(true);
1831 decoder.AutoDetectTrailer(true);
1832 decoder.CheckForTrailer(true);
1833 decoder.GetHandler().SetDescriptor(&block);
1834 decoder.GetHandler().SetBlockNumber(blockNumber);
1835 result = decoder.Decode(payload, payloadSize);
1836 if (decoder.GetHandler().DataProblems()) result = false;
1838 if (FetchMappingStores() == 0) // are stores loaded?
1840 Bool_t warn = kFALSE;
1841 AliMpDDLStore* ddlStore = AliMpDDLStore::Instance(warn);
1843 // Check that the bus patch, manu ID and channel addresses are valid
1844 // for each raw data word.
1845 for (UInt_t i = 0; i < decoder.GetHandler().DigitCount(); i++)
1847 UInt_t busPatchId = decoder.GetHandler().Digits()[i].fBusPatchId;
1848 UInt_t dataWord = decoder.GetHandler().Digits()[i].fDataWord;
1850 UShort_t manuId; UChar_t channelId; UShort_t adc;
1851 AliMUONTrackerDDLDecoderEventHandler::UnpackADC(
1852 dataWord, manuId, channelId, adc
1855 // Check if the bus patch is valid.
1856 AliMpBusPatch* busPatch = ddlStore->GetBusPatch(busPatchId, warn);
1857 if (busPatch == NULL)
1859 HLTError("Problem found with data block %d, fDataType = '%s',"
1860 " fPtr = %p and fSize = %u bytes."
1861 " Assuming this is a tracker DDL raw data block."
1862 " Problem: Found a bus patch identifier %d that"
1865 DataType2Text(block.fDataType).c_str(),
1874 // We can check that the bus patch is for the DDL
1875 // which is also indicated by the specification bits.
1876 if (not fIgnoreSpec and busPatch->GetDdlId() != ddlIndex)
1878 HLTError("Problem found with data block %d, fDataType = '%s',"
1879 " fPtr = %p and fSize = %u bytes."
1880 " Assuming this is a tracker DDL raw data block."
1881 " Problem: Found a bus patch identifier %d for"
1882 " DDL %d, but the data block specification 0x%8.8X"
1883 " indicates a different DDL of %d.",
1885 DataType2Text(block.fDataType).c_str(),
1889 busPatch->GetDdlId(),
1890 block.fSpecification,
1897 // Check if the MANU ID is valid.
1898 if (not busPatch->HasManu(manuId))
1900 HLTError("Problem found with data block %d, fDataType = '%s',"
1901 " fPtr = %p and fSize = %u bytes."
1902 " Assuming this is a tracker DDL raw data block."
1903 " Problem: Found a MANU identifier %d on bus patch %d"
1904 " that is not valid.",
1906 DataType2Text(block.fDataType).c_str(),
1916 // Now try to fetch the detector element to check the MANU channel.
1917 AliMpDetElement* de = ddlStore->GetDetElement(busPatch->GetDEId(), warn);
1920 HLTError("Problem found with data block %d, fDataType = '%s',"
1921 " fPtr = %p and fSize = %u bytes."
1922 " Assuming this is a tracker DDL raw data block."
1923 " Problem: Found a bus patch identifier %d that"
1924 " does not correspond to a detector element.",
1926 DataType2Text(block.fDataType).c_str(),
1935 if (not de->IsConnectedChannel(manuId, channelId))
1937 // Just a warning because this is marked not
1938 // to be an error in the AliMUONDigitMaker.
1939 HLTWarning("Problem found with data block %d, fDataType = '%s',"
1940 " fPtr = %p and fSize = %u bytes."
1941 " Assuming this is a tracker DDL raw data block."
1942 " Problem: Found a channel with address %d on"
1943 " MANU ID %d and bus patch %d that is not connected.",
1945 DataType2Text(block.fDataType).c_str(),
1956 // Need to also load the correct segmentation to check the channel.
1957 const AliMpVSegmentation* seg =
1958 AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(
1959 busPatch->GetDEId(), manuId
1963 HLTError("Could not load segmentation for detector element %d"
1965 busPatch->GetDEId(), manuId
1971 #ifndef HAVE_NOT_MUON_ALIMPPAD_GETPOSITION
1972 AliMpPad pad = seg->PadByLocation(manuId, channelId, warn);
1973 #else // old AliMpPad functionality < r 31742
1974 AliMpPad pad = seg->PadByLocation(AliMpIntPair(manuId, channelId), warn);
1975 #endif //HAVE_NOT_MUON_ALIMPPAD_GETPOSITION
1976 if (not pad.IsValid())
1978 HLTError("Problem found with data block %d, fDataType = '%s',"
1979 " fPtr = %p and fSize = %u bytes."
1980 " Assuming this is a tracker DDL raw data block."
1981 " Problem: Found a channel with address %d on"
1982 " MANU ID %d and bus patch %d that is not valid.",
1984 DataType2Text(block.fDataType).c_str(),
1998 HLTWarning("Cannot check if the bus patch IDs, MANU ID and"
1999 " channel addresses for DDL raw data are valid without"
2000 " being able to load the mapping from CDB."
2007 HLTError("Problem found with data block %d, fDataType = '%s',"
2008 " fPtr = %p and fSize = %u bytes."
2009 " Assuming this is a DDL raw data block."
2010 " Problem: The specification does not contain a valid pattern,"
2011 " received 0x%8.8X for the specification.",
2013 DataType2Text(block.fDataType).c_str(),
2016 block.fSpecification
2025 bool AliHLTMUONDataCheckerComponent::CheckTriggerRecordsBlock(
2026 const AliHLTComponentBlockData& block,
2027 AliHLTUInt32_t blockNumber
2030 /// Checks the validity of a trigger records block.
2033 const char* name = "trigger records";
2035 if (not fIgnoreSpec)
2037 if (not IsFromTriggerOnly(block, blockNumber, name))
2041 AliHLTMUONTriggerRecordsBlockReader inblock(block.fPtr, block.fSize);
2042 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2046 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2048 // Min and max allowed chamber numbers for hits:
2049 Int_t minCh = AliMUONConstants::NCh() - AliMUONConstants::NTriggerCh();
2050 Int_t maxCh = AliMUONConstants::NCh() - 1;
2052 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2054 // Check that each hit in each trigger record has a reasonable coordinate.
2055 AliHLTMUONParticleSign sign;
2057 AliHLTMUONUtils::UnpackTriggerRecordFlags(inblock[i].fFlags, sign, hitset);
2059 for (Int_t j = 0; j < 4; j++) // loop over 4 trigger chamber hits.
2061 if (not hitset[i]) continue; // ignore hits that are not initialised.
2062 bool hitOk = IsHitCoordinateOk(
2063 block, blockNumber, name, i, inblock[i].fHit[j],
2064 minCh, maxCh, j+10, ddl
2066 if (not hitOk) result = false;
2069 // We can also check the momentum vector.
2070 bool momOk = IsMomentumVectorOk(
2071 block, blockNumber, name, i,
2072 inblock[i].fPx, inblock[i].fPy, inblock[i].fPz
2074 if (not momOk) result = false;
2077 // Need to check that no entries have duplicated data but with a different
2079 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2081 AliHLTMUONTriggerRecordStruct ti = inblock[i];
2083 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2085 AliHLTMUONTriggerRecordStruct tj = inblock[j];
2090 HLTError("Problem found with data block %d, fDataType = '%s',"
2091 " fPtr = %p and fSize = %u bytes."
2092 " Assuming this is a %s data block."
2093 " Problem: The trigger records %d and %d contain the"
2094 " same data. The data might have been duplicated.",
2096 DataType2Text(block.fDataType).c_str(),
2111 bool AliHLTMUONDataCheckerComponent::CheckTrigRecsDebugBlock(
2112 const AliHLTComponentBlockData& block,
2113 AliHLTUInt32_t blockNumber
2116 /// Checks the validity of a trigger records debug block.
2119 const char* name = "trigger records debug information";
2121 if (not fIgnoreSpec)
2123 if (not IsFromTriggerOnly(block, blockNumber, name))
2127 AliHLTMUONTrigRecsDebugBlockReader inblock(block.fPtr, block.fSize);
2128 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2132 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2134 // Check that each detector element ID is valid and the corresponding DDL
2135 // bit is set in the data block specification.
2136 if (FetchMappingStores() == 0) // are stores loaded?
2138 Bool_t warn = kFALSE;
2139 AliMpDEStore* store = AliMpDEStore::Instance(warn);
2140 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2141 for (AliHLTUInt32_t j = 0; j < 4; j++)
2143 const AliHLTMUONTrigRecInfoStruct& trig = inblock[i];
2144 AliMpDetElement* de = store->GetDetElement(trig.fDetElemId[j], warn);
2147 HLTError("Problem found with data block %d, fDataType = '%s',"
2148 " fPtr = %p and fSize = %u bytes."
2149 " Assuming this is a %s data block."
2150 " Problem: The detector element number %d on chamber"
2151 " %d for trigger record debug structure %d is not valid.",
2153 DataType2Text(block.fDataType).c_str(),
2165 // Check that the chamber number from the detector element number
2166 // has the expected value.
2167 Int_t chamber = AliMpDEManager::GetChamberId(trig.fDetElemId[j], warn);
2168 if (chamber != Int_t(j+10))
2170 HLTError("Problem found with data block %d, fDataType = '%s',"
2171 " fPtr = %p and fSize = %u bytes."
2172 " Assuming this is a %s data block."
2173 " Problem: The detector element number %d for trigger"
2174 " record debug structure %d, corresponds to chamber"
2175 " %d, but we expected a hit for chamber %d.",
2177 DataType2Text(block.fDataType).c_str(),
2189 if (fIgnoreSpec) continue;
2190 if (0 <= de->GetDdlId() and de->GetDdlId() < 22 and not ddl[de->GetDdlId()])
2192 HLTError("Problem found with data block %d, fDataType = '%s',"
2193 " fPtr = %p and fSize = %u bytes."
2194 " Assuming this is a %s data block."
2195 " Problem: The detector element number %d for trigger"
2196 " record %d corresponds to DDL number %d, but the"
2197 " data block specification 0x%8.8X does not have the"
2198 " corresponding bit set.",
2200 DataType2Text(block.fDataType).c_str(),
2207 block.fSpecification
2215 HLTWarning("Cannot check trigger record debug information without"
2216 " being able to load the mapping from CDB."
2221 // Need to check that no entries have duplicated data but with a different
2223 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2225 AliHLTMUONTrigRecInfoStruct ti = inblock[i];
2227 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2229 AliHLTMUONTrigRecInfoStruct tj = inblock[j];
2230 tj.fTrigRecId = ti.fTrigRecId;
2234 HLTError("Problem found with data block %d, fDataType = '%s',"
2235 " fPtr = %p and fSize = %u bytes."
2236 " Assuming this is a %s data block."
2237 " Problem: The trigger record debug information"
2238 " structures %d and %d contain the same data."
2239 " The data might have been duplicated.",
2241 DataType2Text(block.fDataType).c_str(),
2251 // Can also check that the value of the fZmiddle and fBl.
2252 bool paramsOk = AreMomentumCalcParamsOk(
2253 block, blockNumber, name, i, ti.fZmiddle, ti.fBl
2255 if (not paramsOk) result = false;
2262 bool AliHLTMUONDataCheckerComponent::CheckRecHitsBlock(
2263 const AliHLTComponentBlockData& block,
2264 AliHLTUInt32_t blockNumber
2267 /// Checks the validity of a reconstructed hits block.
2270 const char* name = "reconstructed hits";
2272 if (not fIgnoreSpec)
2274 if (not IsFromTrackerOnly(block, blockNumber, name))
2278 AliHLTMUONRecHitsBlockReader inblock(block.fPtr, block.fSize);
2279 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2283 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2285 // Check that each hit has a reasonable coordinate.
2287 Int_t maxCh = AliMUONConstants::NTrackingCh() - 1;
2288 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2290 bool hitOk = IsHitCoordinateOk(
2291 block, blockNumber, name, i, inblock[i],
2292 minCh, maxCh, -1, ddl
2294 if (not hitOk) result = false;
2301 bool AliHLTMUONDataCheckerComponent::CheckClustersBlock(
2302 const AliHLTComponentBlockData& block,
2303 AliHLTUInt32_t blockNumber
2306 /// Checks the validity of a clusters block.
2309 const char* name = "clusters";
2311 if (not fIgnoreSpec)
2313 if (not IsFromTrackerOnly(block, blockNumber, name))
2317 AliHLTMUONClustersBlockReader inblock(block.fPtr, block.fSize);
2318 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2322 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2324 if (FetchMappingStores() == 0) // are stores loaded?
2326 Bool_t warn = kFALSE;
2327 AliMpDEStore* store = AliMpDEStore::Instance(warn);
2328 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2330 const AliHLTMUONClusterStruct& cluster = inblock[i];
2332 // Check that the detector element ID is valid.
2333 AliMpDetElement* de = store->GetDetElement(cluster.fDetElemId, warn);
2336 HLTError("Problem found with data block %d, fDataType = '%s',"
2337 " fPtr = %p and fSize = %u bytes."
2338 " Assuming this is a %s data block."
2339 " Problem: The detector element number %d for cluster"
2340 " %d is not valid.",
2342 DataType2Text(block.fDataType).c_str(),
2353 // Check that the chamber number found from the hit coordinate and
2354 // that from the detector element number are the same.
2355 Int_t chamberFromHit = AliMUONConstants::ChamberNumber(cluster.fHit.fZ, warn);
2356 Int_t chamberFromDE = AliMpDEManager::GetChamberId(cluster.fDetElemId, warn);
2357 if (chamberFromHit != chamberFromDE)
2359 HLTError("Problem found with data block %d, fDataType = '%s',"
2360 " fPtr = %p and fSize = %u bytes."
2361 " Assuming this is a %s data block."
2362 " Problem: The detector element number %d for"
2363 " cluster %d, corresponds to chamber %d, but"
2364 " found a different chamber number %d for the"
2365 " corresponding hit coordinate {x = %f, y = %f,"
2368 DataType2Text(block.fDataType).c_str(),
2383 // Make sure the corresponding DDL bit is set in the data
2384 // block specification.
2385 if (fIgnoreSpec) continue;
2386 if (0 <= de->GetDdlId() and de->GetDdlId() < 22 and not ddl[de->GetDdlId()])
2388 HLTError("Problem found with data block %d, fDataType = '%s',"
2389 " fPtr = %p and fSize = %u bytes."
2390 " Assuming this is a %s data block."
2391 " Problem: The detector element number %d for cluster"
2392 " %d corresponds to DDL number %d, but the data"
2393 " block specification 0x%8.8X does not have the"
2394 " corresponding bit set.",
2396 DataType2Text(block.fDataType).c_str(),
2403 block.fSpecification
2408 // Check that the total cluster charge is a reasonable value.
2409 if ((cluster.fChargeB + cluster.fChargeNB)< 0 and 1e4 < (cluster.fChargeB + cluster.fChargeNB))
2411 HLTError("Problem found with data block %d, fDataType = '%s',"
2412 " fPtr = %p and fSize = %u bytes."
2413 " Assuming this is a %s data block."
2414 " Problem: The total charge %f for the cluster"
2415 " %d is not in a reasonable range [0..1e4].",
2417 DataType2Text(block.fDataType).c_str(),
2421 (cluster.fChargeB + cluster.fChargeNB),
2431 HLTWarning("Cannot check cluster information without being able"
2432 " to load the mapping from CDB."
2437 // Min and max chamber numbers allowed for the cluster hits.
2439 Int_t maxCh = AliMUONConstants::NTrackingCh() - 1;
2441 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2443 // Need to check that no cluster data has duplicated data but with
2444 // a different ID number.
2445 AliHLTMUONClusterStruct ci = inblock[i];
2447 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2449 AliHLTMUONClusterStruct cj = inblock[j];
2454 HLTError("Problem found with data block %d, fDataType = '%s',"
2455 " fPtr = %p and fSize = %u bytes."
2456 " Assuming this is a %s data block."
2457 " Problem: The cluster structures %d and %d contain"
2458 " the same data. The data might have been duplicated.",
2460 DataType2Text(block.fDataType).c_str(),
2470 // Check that the hit structure in the cluster corresponds
2471 // to a tracker chamber.
2472 bool hitOk = IsHitCoordinateOk(
2473 block, blockNumber, name, i, ci.fHit,
2474 minCh, maxCh, -1, ddl
2476 if (not hitOk) result = false;
2483 bool AliHLTMUONDataCheckerComponent::CheckChannelsBlock(
2484 const AliHLTComponentBlockData& block,
2485 AliHLTUInt32_t blockNumber
2488 /// Checks the validity of a channels block.
2491 const char* name = "channels";
2493 if (not fIgnoreSpec)
2495 if (not IsFromTrackerOnly(block, blockNumber, name))
2499 AliHLTMUONChannelsBlockReader inblock(block.fPtr, block.fSize);
2500 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2504 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2506 if (FetchMappingStores() == 0) // are stores loaded?
2508 Bool_t warn = kFALSE;
2509 AliMpDDLStore* store = AliMpDDLStore::Instance(warn);
2511 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2513 const AliHLTMUONChannelStruct& channel = inblock[i];
2515 // Check if the bus patch is valid.
2516 AliMpBusPatch* busPatch = store->GetBusPatch(channel.fBusPatch, warn);
2517 if (busPatch == NULL)
2519 HLTError("Problem found with data block %d, fDataType = '%s',"
2520 " fPtr = %p and fSize = %u bytes."
2521 " Assuming this is a %s data block."
2522 " Problem: Found a bus patch identifier %d that"
2525 DataType2Text(block.fDataType).c_str(),
2535 // We can check that the bus patch is for a DDL
2536 // which is also indicated by the specification bits.
2537 if (not fIgnoreSpec and (
2538 not (0 <= busPatch->GetDdlId() and busPatch->GetDdlId() < 20)
2539 or (0 <= busPatch->GetDdlId() and busPatch->GetDdlId() < 20
2540 and not ddl[busPatch->GetDdlId()])
2543 HLTError("Problem found with data block %d, fDataType = '%s',"
2544 " fPtr = %p and fSize = %u bytes."
2545 " Assuming this is a %s data block."
2546 " Problem: Found a bus patch identifier %d for"
2547 " DDL %d, but the data block specification 0x%8.8X"
2548 " does not have the corresponding bit set.",
2550 DataType2Text(block.fDataType).c_str(),
2555 busPatch->GetDdlId(),
2556 block.fSpecification
2562 // Check if the MANU ID is valid.
2563 if (not busPatch->HasManu(channel.fManu))
2565 HLTError("Problem found with data block %d, fDataType = '%s',"
2566 " fPtr = %p and fSize = %u bytes."
2567 " Assuming this is a %s data block."
2568 " Problem: Found a MANU identifier %d on bus patch %d"
2569 " that is not valid.",
2571 DataType2Text(block.fDataType).c_str(),
2582 // Now try to fetch the detector element to check the MANU channel.
2583 AliMpDetElement* de = store->GetDetElement(busPatch->GetDEId(), warn);
2586 HLTError("Problem found with data block %d, fDataType = '%s',"
2587 " fPtr = %p and fSize = %u bytes."
2588 " Assuming this is a %s data block."
2589 " Problem: Found a bus patch identifier %d that"
2590 " does not correspond to a detector element.",
2592 DataType2Text(block.fDataType).c_str(),
2602 if (not de->IsConnectedChannel(channel.fManu, channel.fChannelAddress))
2604 // Just a warning because this is marked not
2605 // to be an error in the AliMUONDigitMaker.
2606 HLTWarning("Problem found with data block %d, fDataType = '%s',"
2607 " fPtr = %p and fSize = %u bytes."
2608 " Assuming this is a %s data block."
2609 " Problem: Found a channel with address %d on"
2610 " MANU ID %d and bus patch %d that is not connected.",
2612 DataType2Text(block.fDataType).c_str(),
2616 channel.fChannelAddress,
2624 // Need to also load the correct segmentation to check the channel.
2625 const AliMpVSegmentation* seg =
2626 AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(
2627 busPatch->GetDEId(), channel.fManu
2631 HLTError("Could not load segmentation for detector element %d"
2633 busPatch->GetDEId(), channel.fManu
2639 AliMpPad pad = seg->PadByLocation(
2640 #ifndef HAVE_NOT_MUON_ALIMPPAD_GETPOSITION
2641 channel.fManu, channel.fChannelAddress,
2642 #else // old AliMpPad functionality < r 31742
2643 AliMpIntPair(channel.fManu, channel.fChannelAddress),
2644 #endif //HAVE_NOT_MUON_ALIMPPAD_GETPOSITION
2647 if (not pad.IsValid())
2649 HLTError("Problem found with data block %d, fDataType = '%s',"
2650 " fPtr = %p and fSize = %u bytes."
2651 " Assuming this is a %s data block."
2652 " Problem: Found a channel with address %d on"
2653 " MANU ID %d and bus patch %d that is not valid.",
2655 DataType2Text(block.fDataType).c_str(),
2659 channel.fChannelAddress,
2670 HLTWarning("Cannot check channel information without being able"
2671 " to load the mapping from CDB."
2676 // Need to check that no channel data has duplicated data but with
2677 // a different cluster ID number.
2678 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2680 AliHLTMUONChannelStruct ci = inblock[i];
2682 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2684 AliHLTMUONChannelStruct cj = inblock[j];
2685 cj.fClusterId = ci.fClusterId;
2689 HLTError("Problem found with data block %d, fDataType = '%s',"
2690 " fPtr = %p and fSize = %u bytes."
2691 " Assuming this is a %s data block."
2692 " Problem: The channel structures %d and %d contain"
2693 " the same data. The data might have been duplicated.",
2695 DataType2Text(block.fDataType).c_str(),
2710 bool AliHLTMUONDataCheckerComponent::CheckMansoTracksBlock(
2711 const AliHLTComponentBlockData& block,
2712 AliHLTUInt32_t blockNumber
2715 /// Checks the validity of a Manso tracks block.
2718 const char* name = "Manso tracks";
2720 if (not fIgnoreSpec)
2722 if (not IsSpecificationValid(block, blockNumber, name))
2726 AliHLTMUONMansoTracksBlockReader inblock(block.fPtr, block.fSize);
2727 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2731 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2733 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2735 // Need to check that no entries have duplicated data but with
2736 // a different track ID number.
2737 AliHLTMUONMansoTrackStruct ti = inblock[i];
2739 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2741 AliHLTMUONMansoTrackStruct tj = inblock[j];
2746 HLTError("Problem found with data block %d, fDataType = '%s',"
2747 " fPtr = %p and fSize = %u bytes."
2748 " Assuming this is a %s data block."
2749 " Problem: The Manso tracks %d and %d contain the"
2750 " same data. The data might have been duplicated.",
2752 DataType2Text(block.fDataType).c_str(),
2762 bool trackOk = IsMansoTrackOk(block, blockNumber, name, i, ti, ddl);
2763 if (not trackOk) result = false;
2770 bool AliHLTMUONDataCheckerComponent::CheckMansoCandidatesBlock(
2771 const AliHLTComponentBlockData& block,
2772 AliHLTUInt32_t blockNumber
2775 /// Checks the validity of a Manso candidates block.
2778 const char* name = "Manso track candidates";
2780 if (not fIgnoreSpec)
2782 if (not IsSpecificationValid(block, blockNumber, name))
2786 AliHLTMUONMansoCandidatesBlockReader inblock(block.fPtr, block.fSize);
2787 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2791 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2793 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2795 // Need to check that no entries have duplicated data but with a
2796 // different track ID number.
2797 AliHLTMUONMansoCandidateStruct ti = inblock[i];
2799 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2801 AliHLTMUONMansoCandidateStruct tj = inblock[j];
2802 tj.fTrack.fId = ti.fTrack.fId;
2806 HLTError("Problem found with data block %d, fDataType = '%s',"
2807 " fPtr = %p and fSize = %u bytes."
2808 " Assuming this is a %s data block."
2809 " Problem: The Manso track candidates %d and %d"
2810 " contain the same data."
2811 " The data might have been duplicated.",
2813 DataType2Text(block.fDataType).c_str(),
2823 bool trackOk = IsMansoTrackOk(block, blockNumber, name, i, ti.fTrack, ddl);
2824 if (not trackOk) result = false;
2826 // Check that each ROI has a centre point somewhere on the correct
2827 // corresponding chamber and that the Radius is not bigger thant
2828 // the diameter of the chamber which would be pointless.
2829 for (AliHLTInt32_t j = 0; j < 4; j++)
2831 if (ti.fRoI[j].fRadius == -1) continue; // Ignore invalid ROIs
2833 Int_t chamber = AliMUONConstants::ChamberNumber(
2834 ti.fRoI[j].fZ, false // false = do not warn.
2838 HLTError("Problem found with data block %d, fDataType = '%s',"
2839 " fPtr = %p and fSize = %u bytes."
2840 " Assuming this is a %s data block."
2841 " Problem: The region of interest on chamber %d for"
2842 " Manso track candidate %d has a z-coordinate of %f"
2843 " cm that does not correspond to that chamber.",
2845 DataType2Text(block.fDataType).c_str(),
2856 double x = ti.fRoI[j].fX;
2857 double y = ti.fRoI[j].fY;
2858 double r = sqrt(x*x + y*y);
2859 if (r > AliMUONConstants::Dmax((j+6)/2))
2861 // Just a warning since this is not a data integrity problem
2862 // but rather just a data sanity problem.
2863 HLTWarning("Problem found with data block %d, fDataType = '%s',"
2864 " fPtr = %p and fSize = %u bytes."
2865 " Assuming this is a %s data block."
2866 " Problem: The region of interest coordinate {x = %f,"
2867 " y = %f} cm on chamber %d for Manso track candidate %d"
2868 " does not correspond to that chamber.",
2870 DataType2Text(block.fDataType).c_str(),
2882 if (ti.fRoI[j].fRadius > AliMUONConstants::Dmax((j+6)/2))
2884 // Just a warning since this is not a data integrity problem
2885 // but rather just a data sanity problem.
2886 HLTWarning("Problem found with data block %d, fDataType = '%s',"
2887 " fPtr = %p and fSize = %u bytes."
2888 " Assuming this is a %s data block."
2889 " Problem: The region of interest radius of %f cm"
2890 " on chamber %d for Manso track candidate %d"
2891 " is bigger than the chamber diameter %f cm.",
2893 DataType2Text(block.fDataType).c_str(),
2900 AliMUONConstants::Dmax((j+6)/2)
2911 bool AliHLTMUONDataCheckerComponent::CheckTracksBlock(
2912 const AliHLTComponentBlockData& block,
2913 AliHLTUInt32_t blockNumber
2916 /// Checks the validity of a tracks block.
2919 const char* name = "tracks";
2921 if (not fIgnoreSpec)
2923 if (not IsSpecificationValid(block, blockNumber, name))
2927 AliHLTMUONTracksBlockReader inblock(block.fPtr, block.fSize);
2928 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2932 AliHLTMUONUtils::UnpackSpecBits(block.fSpecification, ddl);
2934 for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
2936 // Need to check that no entries have duplicated data but with
2937 // a different track ID number.
2938 AliHLTMUONTrackStruct ti = inblock[i];
2940 for (AliHLTUInt32_t j = i+1; j < inblock.Nentries(); j++)
2942 AliHLTMUONTrackStruct tj = inblock[j];
2947 HLTError("Problem found with data block %d, fDataType = '%s',"
2948 " fPtr = %p and fSize = %u bytes."
2949 " Assuming this is a %s data block."
2950 " Problem: The track structures %d and %d contain the"
2951 " same data. The data might have been duplicated.",
2953 DataType2Text(block.fDataType).c_str(),
2963 bool trackOk = IsTrackOk(block, blockNumber, name, i, ti, ddl);
2964 if (not trackOk) result = false;
2971 bool AliHLTMUONDataCheckerComponent::CheckSinglesDecisionBlock(
2972 const AliHLTComponentBlockData& block,
2973 AliHLTUInt32_t blockNumber
2976 /// Checks the validity of a single tracks trigger decision block.
2979 const char* name = "singles decision";
2981 if (not fIgnoreSpec)
2983 if (not IsSpecificationValid(block, blockNumber, name))
2987 AliHLTMUONSinglesDecisionBlockReader inblock(block.fPtr, block.fSize);
2988 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
2995 bool AliHLTMUONDataCheckerComponent::CheckPairsDecisionBlock(
2996 const AliHLTComponentBlockData& block,
2997 AliHLTUInt32_t blockNumber
3000 /// Checks the validity of a track pairs trigger decision block.
3003 const char* name = "pairs decision";
3005 if (not fIgnoreSpec)
3007 if (not IsSpecificationValid(block, blockNumber, name))
3011 AliHLTMUONPairsDecisionBlockReader inblock(block.fPtr, block.fSize);
3012 if (not CheckBlockIntegrity(block, blockNumber, inblock, name))
3019 bool AliHLTMUONDataCheckerComponent::AreMomentaCompatible(
3020 AliHLTFloat32_t px1,
3021 AliHLTFloat32_t py1,
3022 AliHLTFloat32_t pz1,
3023 AliHLTFloat32_t px2,
3024 AliHLTFloat32_t py2,
3028 /// Checks to see if the two momenta vectors are compatible or not.
3029 /// The vectors should not have an angle more than 10 degrees between
3030 /// them and their magnitudes should not be more different than 50%.
3032 double p1 = sqrt(double(px1)*double(px1) + double(py1)*double(py1) + double(pz1)*double(pz1));
3033 double p2 = sqrt(double(px2)*double(px2) + double(py2)*double(py2) + double(pz2)*double(pz2));
3034 if (p1 == 0 and p2 == 0) return true;
3035 if (fabs(p1 - p2) / ((p1 + p2)*0.5) > 0.5) return false;
3036 double denom = p1 * p2;
3037 if (denom == 0) return false;
3038 double ratio = (double(px1)*double(px2) + double(py1)*double(py2) + double(pz1)*double(pz2)) / denom;
3039 if (ratio < -1) return true;
3040 if (ratio > 1) return true;
3041 double angle = acos(ratio);
3042 if (angle > 3.14159265358979323846 * 10. / 180.) return false;
3047 bool AliHLTMUONDataCheckerComponent::IsScalarTooLarge(
3048 const AliHLTComponentBlockData* block,
3049 AliHLTUInt32_t blockNumber,
3050 const char* blockTypeName,
3051 const char* scalarName,
3052 AliHLTUInt32_t scalarValue,
3053 AliHLTUInt32_t totalTrackCount
3056 /// Checks if the scalar value is larger than the number of
3057 /// tracks in the event.
3059 if (scalarValue > totalTrackCount)
3061 HLTError("Problem found with %s trigger decision"
3062 " data block %d, fDataType = '%s', fPtr = %p and"
3063 " fSize = %u bytes."
3064 " Problem: The %s scalar with value %d is larger"
3065 " than the total number of tracks found for the"
3066 " event (%d tracks).",
3069 DataType2Text(block->fDataType).c_str(),
3085 bool AliHLTMUONDataCheckerComponent::IsScalarTooLargePairs(
3086 const AliHLTComponentBlockData* block,
3087 AliHLTUInt32_t blockNumber,
3088 const char* blockTypeName,
3089 const char* scalarName,
3090 AliHLTUInt32_t scalarValue,
3091 AliHLTUInt32_t trackPairsCount
3094 /// Checks if the scalar value is larger than the number of
3095 /// track pairs in the event.
3097 if (scalarValue > trackPairsCount)
3099 HLTError("Problem found with %s trigger decision"
3100 " data block %d, fDataType = '%s', fPtr = %p and"
3101 " fSize = %u bytes."
3102 " Problem: The %s scalar with value %d is larger"
3103 " than the total number of track pairs found for the"
3104 " event (%d track pairs).",
3107 DataType2Text(block->fDataType).c_str(),
3123 bool AliHLTMUONDataCheckerComponent::IsScalarALargerThanB(
3124 const AliHLTComponentBlockData* block,
3125 AliHLTUInt32_t blockNumber,
3126 const char* blockTypeName,
3127 const char* scalarAName,
3128 AliHLTUInt32_t scalarAValue,
3129 const char* scalarBName,
3130 AliHLTUInt32_t scalarBValue
3133 /// Checks if the scalar value is larger than the number of Manso
3134 /// tracks in the event.
3136 if (scalarAValue > scalarBValue)
3138 HLTError("Problem found with %s trigger decision"
3139 " data block %d, fDataType = '%s', fPtr = %p and"
3140 " fSize = %u bytes."
3141 " Problem: The %s scalar with value %d is larger"
3142 " than scalar %s with value %d, but is should not be.",
3145 DataType2Text(block->fDataType).c_str(),
3162 void AliHLTMUONDataCheckerComponent::MarkBlock(
3163 const AliHLTComponentBlockData* blocks,
3165 AliHLTUInt32_t blockCount,
3166 const AliHLTComponentBlockData* blockToMark
3169 /// Tries to find the 'blockToMark' in the list of blocks and sets the
3170 /// corresponding 'blockOk' flag to false.
3172 for (AliHLTUInt32_t i = 0; i < blockCount; i++)
3174 if (&blocks[i] == blockToMark)
3183 void AliHLTMUONDataCheckerComponent::MakeGlobalChecks(
3184 const AliHLTComponentBlockData* blocks,
3186 AliHLTUInt32_t blockCount,
3187 const AliHLTComponentBlockData** trigRecBlocks,
3188 AliHLTUInt32_t trigRecBlocksCount,
3189 const AliHLTComponentBlockData** trigRecDebugBlocks,
3190 AliHLTUInt32_t trigRecDebugBlocksCount,
3191 const AliHLTComponentBlockData** hitBlocks,
3192 AliHLTUInt32_t hitBlocksCount,
3193 const AliHLTComponentBlockData** clusterBlocks,
3194 AliHLTUInt32_t clusterBlocksCount,
3195 const AliHLTComponentBlockData** channelBlocks,
3196 AliHLTUInt32_t channelBlocksCount,
3197 const AliHLTComponentBlockData** mansoTrackBlocks,
3198 AliHLTUInt32_t mansoTrackBlocksCount,
3199 const AliHLTComponentBlockData** mansoCandidateBlocks,
3200 AliHLTUInt32_t mansoCandidateBlocksCount,
3201 const AliHLTComponentBlockData** trackBlocks,
3202 AliHLTUInt32_t trackBlocksCount,
3203 const AliHLTComponentBlockData** singleDecisionBlocks,
3204 AliHLTUInt32_t singleDecisionBlocksCount,
3205 const AliHLTComponentBlockData** pairDecisionBlocks,
3206 AliHLTUInt32_t pairDecisionBlocksCount
3209 /// The following set of global checks are performed:
3210 /// 1) Checks if all the ID numbers in all the blocks are unique.
3211 /// 2) Check if all the structures are unique up to their ID numbers,
3212 /// that it, make sure there are no structures with the same data but
3213 /// for a different ID number.
3214 /// 3) Check if the reference ID numbers are correct, i.e. are the
3215 /// trigger record ID numbers in the track structures found in any of
3216 /// the trigger record data blocks.
3217 /// 4) Do the number of channels claimed in the cluster correspond to
3218 /// the number of channel structures.
3219 /// 5) Check that the momentum vectors between the Manso and full tracks,
3220 /// and the corresponding trigger record are compatible.
3221 /// 6) Check that the trigger decision scalars are reasonable.
3222 /// 7) Check that the detector element IDs are the same between rec
3223 /// hits and clusters / trigger record debug blocks.
3225 // Check if all the trigger record identifiers and data are unique.
3226 for (AliHLTUInt32_t bi = 0; bi < trigRecBlocksCount; bi++)
3228 AliHLTMUONTriggerRecordsBlockReader inblocki(trigRecBlocks[bi]->fPtr, trigRecBlocks[bi]->fSize);
3229 if (not inblocki.BufferSizeOk()) continue;
3230 for (AliHLTUInt32_t bj = bi+1; bj < trigRecBlocksCount; bj++)
3232 AliHLTMUONTriggerRecordsBlockReader inblockj(trigRecBlocks[bj]->fPtr, trigRecBlocks[bj]->fSize);
3233 if (not inblockj.BufferSizeOk()) continue;
3235 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3236 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3238 if (inblocki[i].fId == inblockj[j].fId)
3240 HLTError("Problem found with trigger record data block %d,"
3241 " fDataType = '%s', fPtr = %p and fSize = %u bytes,"
3242 " and trigger record data block %d,"
3243 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3244 " Problem: Trigger record %d in block %d and entry"
3245 " %d in block %d have the same identfier, but they"
3246 " should be unique.",
3248 DataType2Text(trigRecBlocks[bi]->fDataType).c_str(),
3249 trigRecBlocks[bi]->fPtr,
3250 trigRecBlocks[bi]->fSize,
3252 DataType2Text(trigRecBlocks[bj]->fDataType).c_str(),
3253 trigRecBlocks[bj]->fPtr,
3254 trigRecBlocks[bj]->fSize,
3258 MarkBlock(blocks, blockOk, blockCount, trigRecBlocks[bi]);
3259 MarkBlock(blocks, blockOk, blockCount, trigRecBlocks[bj]);
3262 AliHLTMUONTriggerRecordStruct a = inblocki[i];
3263 AliHLTMUONTriggerRecordStruct b = inblockj[j];
3267 HLTError("Problem found with trigger record data block %d,"
3268 " fDataType = '%s', fPtr = %p and fSize = %u bytes,"
3269 " and trigger record data block %d,"
3270 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3271 " Problem: Trigger record %d in block %d and entry"
3272 " %d in block %d have the same data."
3273 " The data may have been duplicated.",
3275 DataType2Text(trigRecBlocks[bi]->fDataType).c_str(),
3276 trigRecBlocks[bi]->fPtr,
3277 trigRecBlocks[bi]->fSize,
3279 DataType2Text(trigRecBlocks[bj]->fDataType).c_str(),
3280 trigRecBlocks[bj]->fPtr,
3281 trigRecBlocks[bj]->fSize,
3285 MarkBlock(blocks, blockOk, blockCount, trigRecBlocks[bi]);
3286 MarkBlock(blocks, blockOk, blockCount, trigRecBlocks[bj]);
3292 for (AliHLTUInt32_t bi = 0; bi < trigRecDebugBlocksCount; bi++)
3294 AliHLTMUONTrigRecsDebugBlockReader inblocki(trigRecDebugBlocks[bi]->fPtr, trigRecDebugBlocks[bi]->fSize);
3295 if (not inblocki.BufferSizeOk()) continue;
3297 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3299 // Check if all the trigger record IDs in the debug information structures exist.
3302 for (AliHLTUInt32_t bj = 0; bj < trigRecBlocksCount and not found; bj++)
3304 AliHLTMUONTriggerRecordsBlockReader inblockj(trigRecBlocks[bj]->fPtr, trigRecBlocks[bj]->fSize);
3305 if (not inblockj.BufferSizeOk()) continue;
3307 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3309 if (inblocki[i].fTrigRecId == inblockj[j].fId)
3313 // Since we found the corresponding trigger record,
3314 // check if the detector element IDs are the same.
3315 bool deOk = CheckDetElemIds(
3316 *trigRecDebugBlocks[bi], bi, i, inblocki[i],
3317 *trigRecBlocks[bj], bj, j, inblockj[j]
3321 MarkBlock(blocks, blockOk, blockCount, trigRecDebugBlocks[bi]);
3322 MarkBlock(blocks, blockOk, blockCount, trigRecBlocks[bj]);
3332 HLTError("Problem found with trigger record debug information"
3333 " data block %d, fDataType = '%s', fPtr = %p and"
3334 " fSize = %u bytes."
3335 " Problem with entry %d in block: The trigger record"
3336 " identifier %d does not exist in any trigger record"
3339 DataType2Text(trigRecDebugBlocks[bi]->fDataType).c_str(),
3340 trigRecDebugBlocks[bi]->fPtr,
3341 trigRecDebugBlocks[bi]->fSize,
3342 i, inblocki[i].fTrigRecId
3344 MarkBlock(blocks, blockOk, blockCount, trigRecDebugBlocks[bi]);
3348 // Check if all the trigger record debug information structures are unique.
3349 for (AliHLTUInt32_t bj = bi+1; bj < trigRecDebugBlocksCount; bj++)
3351 AliHLTMUONTrigRecsDebugBlockReader inblockj(trigRecDebugBlocks[bj]->fPtr, trigRecDebugBlocks[bj]->fSize);
3352 if (not inblockj.BufferSizeOk()) continue;
3354 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3355 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3357 AliHLTMUONTrigRecInfoStruct a = inblocki[i];
3358 AliHLTMUONTrigRecInfoStruct b = inblockj[j];
3359 a.fTrigRecId = b.fTrigRecId = -1;
3362 HLTError("Problem found with trigger record debug information"
3363 " data block %d, fDataType = '%s', fPtr = %p and"
3364 " fSize = %u bytes, and trigger record debug"
3365 " information data block %d,"
3366 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3367 " Problem: The trigger record debug inforamtion"
3368 " structure %d in block %d and entry"
3369 " %d in block %d have the same data."
3370 " The data may have been duplicated.",
3372 DataType2Text(trigRecDebugBlocks[bi]->fDataType).c_str(),
3373 trigRecDebugBlocks[bi]->fPtr,
3374 trigRecDebugBlocks[bi]->fSize,
3376 DataType2Text(trigRecDebugBlocks[bj]->fDataType).c_str(),
3377 trigRecDebugBlocks[bj]->fPtr,
3378 trigRecDebugBlocks[bj]->fSize,
3382 MarkBlock(blocks, blockOk, blockCount, trigRecDebugBlocks[bi]);
3383 MarkBlock(blocks, blockOk, blockCount, trigRecDebugBlocks[bj]);
3389 // Check that all the reconstructed hits are unique.
3390 for (AliHLTUInt32_t bi = 0; bi < hitBlocksCount; bi++)
3392 AliHLTMUONRecHitsBlockReader inblocki(hitBlocks[bi]->fPtr, hitBlocks[bi]->fSize);
3393 if (not inblocki.BufferSizeOk()) continue;
3394 for (AliHLTUInt32_t bj = bi+1; bj < hitBlocksCount; bj++)
3396 AliHLTMUONRecHitsBlockReader inblockj(hitBlocks[bj]->fPtr, hitBlocks[bj]->fSize);
3397 if (not inblockj.BufferSizeOk()) continue;
3399 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3400 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3402 if (inblocki[i] == inblockj[j])
3404 HLTError("Problem found with reconstructed hit data block %d,"
3405 " fDataType = '%s', fPtr = %p and fSize = %u bytes,"
3406 " and reconstructed hit data block %d,"
3407 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3408 " Problem: Reconstructed hit %d in block %d and entry"
3409 " %d in block %d are the same, but all hits"
3410 " should be unique.",
3412 DataType2Text(hitBlocks[bi]->fDataType).c_str(),
3413 hitBlocks[bi]->fPtr,
3414 hitBlocks[bi]->fSize,
3416 DataType2Text(hitBlocks[bj]->fDataType).c_str(),
3417 hitBlocks[bj]->fPtr,
3418 hitBlocks[bj]->fSize,
3422 MarkBlock(blocks, blockOk, blockCount, hitBlocks[bi]);
3423 MarkBlock(blocks, blockOk, blockCount, hitBlocks[bj]);
3429 for (AliHLTUInt32_t bi = 0; bi < clusterBlocksCount; bi++)
3431 AliHLTMUONClustersBlockReader inblocki(clusterBlocks[bi]->fPtr, clusterBlocks[bi]->fSize);
3432 if (not inblocki.BufferSizeOk()) continue;
3434 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3436 // Check if all the reconstructed hit coordinates in the cluster structures exist.
3439 for (AliHLTUInt32_t bj = 0; bj < hitBlocksCount and not found; bj++)
3441 AliHLTMUONRecHitsBlockReader inblockj(hitBlocks[bj]->fPtr, hitBlocks[bj]->fSize);
3442 if (not inblockj.BufferSizeOk()) continue;
3444 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3446 if (inblocki[i].fHit == inblockj[j])
3450 // Since we found the corresponding cluster,
3451 // check if the detector element IDs are the same.
3452 bool deOk = CheckDetElemIds(
3453 *clusterBlocks[bi], bi, i, inblocki[i],
3454 *hitBlocks[bj], bj, j, inblockj[j]
3458 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3459 MarkBlock(blocks, blockOk, blockCount, hitBlocks[bj]);
3467 // If the hit was not found then it should be nil.
3468 if (not found and (inblocki[i].fHit != AliHLTMUONConstants::NilRecHitStruct()))
3470 HLTError("Problem found with cluster data block %d,"
3471 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3472 " Problem with entry %d in block: The cluster hit"
3473 " coordinate {x = %f, y = %f, z = %f} does not exist"
3474 " in any reconstructed hit data block.",
3476 DataType2Text(clusterBlocks[bi]->fDataType).c_str(),
3477 clusterBlocks[bi]->fPtr,
3478 clusterBlocks[bi]->fSize,
3480 inblocki[i].fHit.fX,
3481 inblocki[i].fHit.fY,
3484 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3487 // Check that the fNchannelsB value is correct.
3488 // First count the number of channels found in the channels block that
3489 // correspond to the cluster. Do this for the bending and non-bending planes.
3490 AliHLTUInt32_t countB = 0;
3491 AliHLTUInt32_t countNB = 0;
3492 for (AliHLTUInt32_t bj = 0; bj < channelBlocksCount and not found; bj++)
3494 AliHLTMUONChannelsBlockReader inblockj(channelBlocks[bj]->fPtr, channelBlocks[bj]->fSize);
3495 if (not inblockj.BufferSizeOk()) continue;
3497 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3499 if (inblocki[i].fId != inblockj[j].fClusterId) continue;
3500 if ((inblockj[j].fRawDataWord & (1 << 28)) == 0)
3507 if (inblocki[i].fNchannelsB != countB)
3509 HLTWarning("Problem found with cluster data block %d,"
3510 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3511 " Problem with entry %d in block: The number of bending plane"
3512 " channels in the cluster is reported as %d,"
3513 " but %d channel structures were found.",
3515 DataType2Text(clusterBlocks[bi]->fDataType).c_str(),
3516 clusterBlocks[bi]->fPtr,
3517 clusterBlocks[bi]->fSize,
3519 inblocki[i].fNchannelsB,
3522 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3525 if (inblocki[i].fNchannelsNB != countNB)
3527 HLTWarning("Problem found with cluster data block %d,"
3528 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3529 " Problem with entry %d in block: The number of"
3530 " channels in the cluster of non-bending plane is reported as %d,"
3531 " but %d channel structures were found.",
3533 DataType2Text(clusterBlocks[bi]->fDataType).c_str(),
3534 clusterBlocks[bi]->fPtr,
3535 clusterBlocks[bi]->fSize,
3537 inblocki[i].fNchannelsNB,
3540 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3544 // Check if all the cluster structures are unique up to the identifier
3545 // and have unique identifiers.
3546 for (AliHLTUInt32_t bj = bi+1; bj < clusterBlocksCount; bj++)
3548 AliHLTMUONClustersBlockReader inblockj(clusterBlocks[bj]->fPtr, clusterBlocks[bj]->fSize);
3549 if (not inblockj.BufferSizeOk()) continue;
3551 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3552 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3554 if (inblocki[i].fId == inblockj[j].fId)
3556 HLTError("Problem found with cluster"
3557 " data block %d, fDataType = '%s', fPtr = %p and"
3558 " fSize = %u bytes, and cluster data block %d,"
3559 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3560 " Problem: The cluster %d in block %d and entry"
3561 " %d in block %d have the same identifier, but they"
3562 " should be unique.",
3564 DataType2Text(clusterBlocks[bi]->fDataType).c_str(),
3565 clusterBlocks[bi]->fPtr,
3566 clusterBlocks[bi]->fSize,
3568 DataType2Text(clusterBlocks[bj]->fDataType).c_str(),
3569 clusterBlocks[bj]->fPtr,
3570 clusterBlocks[bj]->fSize,
3574 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3575 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bj]);
3578 AliHLTMUONClusterStruct a = inblocki[i];
3579 AliHLTMUONClusterStruct b = inblockj[j];
3583 HLTError("Problem found with cluster"
3584 " data block %d, fDataType = '%s', fPtr = %p and"
3585 " fSize = %u bytes, and cluster data block %d,"
3586 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3587 " Problem: The cluster %d in block %d and entry"
3588 " %d in block %d have the same data."
3589 " The data may have been duplicated.",
3591 DataType2Text(clusterBlocks[bi]->fDataType).c_str(),
3592 clusterBlocks[bi]->fPtr,
3593 clusterBlocks[bi]->fSize,
3595 DataType2Text(clusterBlocks[bj]->fDataType).c_str(),
3596 clusterBlocks[bj]->fPtr,
3597 clusterBlocks[bj]->fSize,
3601 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bi]);
3602 MarkBlock(blocks, blockOk, blockCount, clusterBlocks[bj]);
3608 for (AliHLTUInt32_t bi = 0; bi < channelBlocksCount; bi++)
3610 AliHLTMUONChannelsBlockReader inblocki(channelBlocks[bi]->fPtr, channelBlocks[bi]->fSize);
3611 if (not inblocki.BufferSizeOk()) continue;
3613 // Check if all the cluster IDs in the channel structures exist.
3614 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3618 for (AliHLTUInt32_t bj = 0; bj < clusterBlocksCount and not found; bj++)
3620 AliHLTMUONClustersBlockReader inblockj(clusterBlocks[bj]->fPtr, clusterBlocks[bj]->fSize);
3621 if (not inblockj.BufferSizeOk()) continue;
3623 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3625 if (inblocki[i].fClusterId == inblockj[j].fId)
3635 HLTError("Problem found with channel"
3636 " data block %d, fDataType = '%s', fPtr = %p and"
3637 " fSize = %u bytes."
3638 " Problem with entry %d in block: The cluster"
3639 " identifier %d does not exist in any cluster"
3642 DataType2Text(channelBlocks[bi]->fDataType).c_str(),
3643 channelBlocks[bi]->fPtr,
3644 channelBlocks[bi]->fSize,
3645 i, inblocki[i].fClusterId
3647 MarkBlock(blocks, blockOk, blockCount, channelBlocks[bi]);
3651 // Check if all the channel structures are unique up to the cluster ID.
3652 for (AliHLTUInt32_t bj = bi+1; bj < channelBlocksCount; bj++)
3654 AliHLTMUONChannelsBlockReader inblockj(channelBlocks[bj]->fPtr, channelBlocks[bj]->fSize);
3655 if (not inblockj.BufferSizeOk()) continue;
3657 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3658 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3660 AliHLTMUONChannelStruct a = inblocki[i];
3661 AliHLTMUONChannelStruct b = inblockj[j];
3662 a.fClusterId = b.fClusterId = -1;
3665 HLTError("Problem found with channel"
3666 " data block %d, fDataType = '%s', fPtr = %p and"
3667 " fSize = %u bytes, and channel data block %d,"
3668 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3669 " Problem: The channel %d in block %d and entry"
3670 " %d in block %d have the same data."
3671 " The data may have been duplicated.",
3673 DataType2Text(channelBlocks[bi]->fDataType).c_str(),
3674 channelBlocks[bi]->fPtr,
3675 channelBlocks[bi]->fSize,
3677 DataType2Text(channelBlocks[bj]->fDataType).c_str(),
3678 channelBlocks[bj]->fPtr,
3679 channelBlocks[bj]->fSize,
3683 MarkBlock(blocks, blockOk, blockCount, channelBlocks[bi]);
3684 MarkBlock(blocks, blockOk, blockCount, channelBlocks[bj]);
3690 // Will need the total number of tracks later for comparison to trigger scalars.
3691 AliHLTUInt32_t totalTrackCount = 0;
3693 for (AliHLTUInt32_t bi = 0; bi < mansoTrackBlocksCount; bi++)
3695 AliHLTMUONMansoTracksBlockReader inblocki(mansoTrackBlocks[bi]->fPtr, mansoTrackBlocks[bi]->fSize);
3696 if (not inblocki.BufferSizeOk()) continue;
3698 totalTrackCount += inblocki.Nentries();
3700 // Check if all the trigger record IDs in the Manso track structures exist.
3701 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3705 for (AliHLTUInt32_t bj = 0; bj < trigRecBlocksCount and not found; bj++)
3707 AliHLTMUONTriggerRecordsBlockReader inblockj(trigRecBlocks[bj]->fPtr, trigRecBlocks[bj]->fSize);
3708 if (not inblockj.BufferSizeOk()) continue;
3710 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3712 if (inblocki[i].fTrigRec == inblockj[j].fId)
3714 // At this point we can check if the momentum
3715 // is compatible with the trigger record.
3716 if (not AreMomentaCompatible(
3717 inblocki[i].fPx, inblocki[i].fPy, inblocki[i].fPz,
3718 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
3722 HLTWarning("Problem found with Manso track"
3723 " data block %d, fDataType = '%s', fPtr = %p and"
3724 " fSize = %u bytes."
3725 " Problem with Manso track %d in block: The momentum"
3726 " vector of the track p = {%f, %f, %f} GeV/c is not"
3727 " compatible with the momentum vector of the trigger"
3728 " record with p = {%f, %f, %f} GeV/c.",
3730 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3731 mansoTrackBlocks[bi]->fPtr,
3732 mansoTrackBlocks[bi]->fSize,
3733 i, inblocki[i].fPx, inblocki[i].fPy, inblocki[i].fPz,
3734 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
3736 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3747 HLTError("Problem found with Manso track"
3748 " data block %d, fDataType = '%s', fPtr = %p and"
3749 " fSize = %u bytes."
3750 " Problem with Manso track %d in block: The trigger"
3751 " record identifier %d does not exist in any trigger"
3752 " record data block.",
3754 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3755 mansoTrackBlocks[bi]->fPtr,
3756 mansoTrackBlocks[bi]->fSize,
3757 i, inblocki[i].fTrigRec
3759 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3763 // Check if all the hits in the Manso track structures exist.
3764 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3766 AliHLTMUONParticleSign sign;
3768 AliHLTMUONUtils::UnpackMansoTrackFlags(inblocki[i].fFlags, sign, hitset);
3770 for (AliHLTUInt32_t n = 0; n < 4; n++)
3772 if (not hitset[n]) continue;
3775 for (AliHLTUInt32_t bj = 0; bj < hitBlocksCount and not found; bj++)
3777 AliHLTMUONRecHitsBlockReader inblockj(hitBlocks[bj]->fPtr, hitBlocks[bj]->fSize);
3778 if (not inblockj.BufferSizeOk()) continue;
3780 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3782 if (inblocki[i].fHit[n] == inblockj[j])
3792 HLTError("Problem found with Manso track"
3793 " data block %d, fDataType = '%s', fPtr = %p and"
3794 " fSize = %u bytes."
3795 " Problem with Manso track %d in block: The hit"
3796 " for chamber %d does not exist in any"
3797 " reconstructed hits data block.",
3799 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3800 mansoTrackBlocks[bi]->fPtr,
3801 mansoTrackBlocks[bi]->fSize,
3804 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3809 // Check if all the Manso track structures are unique up to the ID and
3810 // have unique identifiers.
3811 for (AliHLTUInt32_t bj = bi+1; bj < mansoTrackBlocksCount; bj++)
3813 AliHLTMUONMansoTracksBlockReader inblockj(mansoTrackBlocks[bj]->fPtr, mansoTrackBlocks[bj]->fSize);
3814 if (not inblockj.BufferSizeOk()) continue;
3816 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3817 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3819 if (inblocki[i].fId == inblockj[j].fId)
3821 HLTError("Problem found with Manso track"
3822 " data block %d, fDataType = '%s', fPtr = %p and"
3823 " fSize = %u bytes, and Manso track data block %d,"
3824 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3825 " Problem: The Manso track %d in block %d and entry"
3826 " %d in block %d have the same identifier, but they"
3827 " should be unique.",
3829 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3830 mansoTrackBlocks[bi]->fPtr,
3831 mansoTrackBlocks[bi]->fSize,
3833 DataType2Text(mansoTrackBlocks[bj]->fDataType).c_str(),
3834 mansoTrackBlocks[bj]->fPtr,
3835 mansoTrackBlocks[bj]->fSize,
3839 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3840 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bj]);
3843 AliHLTMUONMansoTrackStruct a = inblocki[i];
3844 AliHLTMUONMansoTrackStruct b = inblockj[j];
3848 HLTError("Problem found with Manso track"
3849 " data block %d, fDataType = '%s', fPtr = %p and"
3850 " fSize = %u bytes, and Manso track data block %d,"
3851 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
3852 " Problem: The Manso track %d in block %d and entry"
3853 " %d in block %d have the same data."
3854 " The data may have been duplicated.",
3856 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3857 mansoTrackBlocks[bi]->fPtr,
3858 mansoTrackBlocks[bi]->fSize,
3860 DataType2Text(mansoTrackBlocks[bj]->fDataType).c_str(),
3861 mansoTrackBlocks[bj]->fPtr,
3862 mansoTrackBlocks[bj]->fSize,
3866 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3867 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bj]);
3873 for (AliHLTUInt32_t bi = 0; bi < mansoCandidateBlocksCount; bi++)
3875 AliHLTMUONMansoCandidatesBlockReader inblocki(mansoCandidateBlocks[bi]->fPtr, mansoCandidateBlocks[bi]->fSize);
3876 if (not inblocki.BufferSizeOk()) continue;
3878 // Check if all the trigger record IDs in the Manso track candidate structures exist.
3879 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3883 for (AliHLTUInt32_t bj = 0; bj < trigRecBlocksCount and not found; bj++)
3885 AliHLTMUONTriggerRecordsBlockReader inblockj(trigRecBlocks[bj]->fPtr, trigRecBlocks[bj]->fSize);
3886 if (not inblockj.BufferSizeOk()) continue;
3888 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3890 if (inblocki[i].fTrack.fTrigRec == inblockj[j].fId)
3892 // At this point we can check if the momentum
3893 // is compatible with the trigger record.
3894 if (not AreMomentaCompatible(
3895 inblocki[i].fTrack.fPx, inblocki[i].fTrack.fPy, inblocki[i].fTrack.fPz,
3896 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
3900 HLTWarning("Problem found with Manso track candidate"
3901 " data block %d, fDataType = '%s', fPtr = %p and"
3902 " fSize = %u bytes."
3903 " Problem with track candidate %d in block: The momentum"
3904 " vector of the candidate p = {%f, %f, %f} GeV/c is not"
3905 " compatible with the momentum vector of the trigger"
3906 " record with p = {%f, %f, %f} GeV/c.",
3908 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3909 mansoTrackBlocks[bi]->fPtr,
3910 mansoTrackBlocks[bi]->fSize,
3912 inblocki[i].fTrack.fPx, inblocki[i].fTrack.fPy, inblocki[i].fTrack.fPz,
3913 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
3915 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3926 HLTError("Problem found with Manso track candidate"
3927 " data block %d, fDataType = '%s', fPtr = %p and"
3928 " fSize = %u bytes."
3929 " Problem with track candidate %d in block: The trigger"
3930 " record identifier %d does not exist in any trigger"
3931 " record data block.",
3933 DataType2Text(mansoCandidateBlocks[bi]->fDataType).c_str(),
3934 mansoCandidateBlocks[bi]->fPtr,
3935 mansoCandidateBlocks[bi]->fSize,
3936 i, inblocki[i].fTrack.fTrigRec
3938 MarkBlock(blocks, blockOk, blockCount, mansoCandidateBlocks[bi]);
3942 // Check if all the hits in the Manso track candidate structures exist.
3943 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3945 AliHLTMUONParticleSign sign;
3947 AliHLTMUONUtils::UnpackMansoTrackFlags(inblocki[i].fTrack.fFlags, sign, hitset);
3949 for (AliHLTUInt32_t n = 0; n < 4; n++)
3951 if (not hitset[n]) continue;
3954 for (AliHLTUInt32_t bj = 0; bj < hitBlocksCount and not found; bj++)
3956 AliHLTMUONRecHitsBlockReader inblockj(hitBlocks[bj]->fPtr, hitBlocks[bj]->fSize);
3957 if (not inblockj.BufferSizeOk()) continue;
3959 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3961 if (inblocki[i].fTrack.fHit[n] == inblockj[j])
3971 HLTError("Problem found with Manso track candidate"
3972 " data block %d, fDataType = '%s', fPtr = %p and"
3973 " fSize = %u bytes."
3974 " Problem with track candidate %d in block: The hit"
3975 " for chamber %d does not exist in any"
3976 " reconstructed hits data block.",
3978 DataType2Text(mansoTrackBlocks[bi]->fDataType).c_str(),
3979 mansoTrackBlocks[bi]->fPtr,
3980 mansoTrackBlocks[bi]->fSize,
3983 MarkBlock(blocks, blockOk, blockCount, mansoTrackBlocks[bi]);
3988 // Check if all the Manso track candidate structures are unique up to the
3989 // track ID and have unique identifiers.
3990 for (AliHLTUInt32_t bj = bi+1; bj < mansoCandidateBlocksCount; bj++)
3992 AliHLTMUONMansoCandidatesBlockReader inblockj(mansoCandidateBlocks[bj]->fPtr, mansoCandidateBlocks[bj]->fSize);
3993 if (not inblockj.BufferSizeOk()) continue;
3995 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
3996 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
3998 if (inblocki[i].fTrack.fId == inblockj[j].fTrack.fId)
4000 HLTError("Problem found with Manso track candidate"
4001 " data block %d, fDataType = '%s', fPtr = %p and"
4002 " fSize = %u bytes, and Manso track candidate data block %d,"
4003 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4004 " Problem: The track candidate %d in block %d and entry"
4005 " %d in block %d have the same identifier, but they"
4006 " should be unique.",
4008 DataType2Text(mansoCandidateBlocks[bi]->fDataType).c_str(),
4009 mansoCandidateBlocks[bi]->fPtr,
4010 mansoCandidateBlocks[bi]->fSize,
4012 DataType2Text(mansoCandidateBlocks[bj]->fDataType).c_str(),
4013 mansoCandidateBlocks[bj]->fPtr,
4014 mansoCandidateBlocks[bj]->fSize,
4018 MarkBlock(blocks, blockOk, blockCount, mansoCandidateBlocks[bi]);
4019 MarkBlock(blocks, blockOk, blockCount, mansoCandidateBlocks[bj]);
4022 AliHLTMUONMansoCandidateStruct a = inblocki[i];
4023 AliHLTMUONMansoCandidateStruct b = inblockj[j];
4024 a.fTrack.fId = b.fTrack.fId = -1;
4027 HLTError("Problem found with Manso track candidate"
4028 " data block %d, fDataType = '%s', fPtr = %p and"
4029 " fSize = %u bytes, and Manso track candidate data block %d,"
4030 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4031 " Problem: The track candidate %d in block %d and entry"
4032 " %d in block %d have the same data."
4033 " The data may have been duplicated.",
4035 DataType2Text(mansoCandidateBlocks[bi]->fDataType).c_str(),
4036 mansoCandidateBlocks[bi]->fPtr,
4037 mansoCandidateBlocks[bi]->fSize,
4039 DataType2Text(mansoCandidateBlocks[bj]->fDataType).c_str(),
4040 mansoCandidateBlocks[bj]->fPtr,
4041 mansoCandidateBlocks[bj]->fSize,
4045 MarkBlock(blocks, blockOk, blockCount, mansoCandidateBlocks[bi]);
4046 MarkBlock(blocks, blockOk, blockCount, mansoCandidateBlocks[bj]);
4052 for (AliHLTUInt32_t bi = 0; bi < trackBlocksCount; bi++)
4054 AliHLTMUONTracksBlockReader inblocki(trackBlocks[bi]->fPtr, trackBlocks[bi]->fSize);
4055 if (not inblocki.BufferSizeOk()) continue;
4057 totalTrackCount += inblocki.Nentries();
4059 // Check if all the trigger record IDs in the track structures exist.
4060 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4064 for (AliHLTUInt32_t bj = 0; bj < trigRecBlocksCount and not found; bj++)
4066 AliHLTMUONTriggerRecordsBlockReader inblockj(trigRecBlocks[bj]->fPtr, trigRecBlocks[bj]->fSize);
4067 if (not inblockj.BufferSizeOk()) continue;
4069 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4071 if (inblocki[i].fTrigRec == inblockj[j].fId)
4073 // At this point we can check if the momentum
4074 // is compatible with the trigger record.
4075 if (not AreMomentaCompatible(
4076 inblocki[i].fPx, inblocki[i].fPy, inblocki[i].fPz,
4077 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
4081 HLTWarning("Problem found with track"
4082 " data block %d, fDataType = '%s', fPtr = %p and"
4083 " fSize = %u bytes."
4084 " Problem with track structure %d in block: The momentum"
4085 " vector of the track p = {%f, %f, %f} GeV/c is not"
4086 " compatible with the momentum vector of the trigger"
4087 " record with p = {%f, %f, %f} GeV/c.",
4089 DataType2Text(trackBlocks[bi]->fDataType).c_str(),
4090 trackBlocks[bi]->fPtr,
4091 trackBlocks[bi]->fSize,
4092 i, inblocki[i].fPx, inblocki[i].fPy, inblocki[i].fPz,
4093 inblockj[j].fPx, inblockj[j].fPy, inblockj[j].fPz
4095 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bi]);
4106 HLTError("Problem found with track"
4107 " data block %d, fDataType = '%s', fPtr = %p and"
4108 " fSize = %u bytes."
4109 " Problem with track structure %d in block: The trigger"
4110 " record identifier %d does not exist in any trigger"
4111 " record data block.",
4113 DataType2Text(trackBlocks[bi]->fDataType).c_str(),
4114 trackBlocks[bi]->fPtr,
4115 trackBlocks[bi]->fSize,
4116 i, inblocki[i].fTrigRec
4118 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bi]);
4122 // Check if all the hits in the track structures exist.
4123 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4125 AliHLTMUONParticleSign sign;
4127 AliHLTMUONUtils::UnpackTrackFlags(inblocki[i].fFlags, sign, hitset);
4129 for (AliHLTUInt32_t n = 0; n < 16; n++)
4131 if (not hitset[n]) continue;
4134 for (AliHLTUInt32_t bj = 0; bj < hitBlocksCount and not found; bj++)
4136 AliHLTMUONRecHitsBlockReader inblockj(hitBlocks[bj]->fPtr, hitBlocks[bj]->fSize);
4137 if (not inblockj.BufferSizeOk()) continue;
4139 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4141 if (inblocki[i].fHit[n] == inblockj[j])
4151 HLTError("Problem found with track"
4152 " data block %d, fDataType = '%s', fPtr = %p and"
4153 " fSize = %u bytes."
4154 " Problem with track structure %d in block: The hit"
4155 " for chamber %d does not exist in any"
4156 " reconstructed hits data block.",
4158 DataType2Text(trackBlocks[bi]->fDataType).c_str(),
4159 trackBlocks[bi]->fPtr,
4160 trackBlocks[bi]->fSize,
4163 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bi]);
4168 // Check if all the track structures are unique up to the ID and
4169 // have unique identifiers.
4170 for (AliHLTUInt32_t bj = bi+1; bj < trackBlocksCount; bj++)
4172 AliHLTMUONTracksBlockReader inblockj(trackBlocks[bj]->fPtr, trackBlocks[bj]->fSize);
4173 if (not inblockj.BufferSizeOk()) continue;
4175 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4176 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4178 if (inblocki[i].fId == inblockj[j].fId)
4180 HLTError("Problem found with track"
4181 " data block %d, fDataType = '%s', fPtr = %p and"
4182 " fSize = %u bytes, and track data block %d,"
4183 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4184 " Problem: The track structure %d in block %d and entry"
4185 " %d in block %d have the same identifier, but they"
4186 " should be unique.",
4188 DataType2Text(trackBlocks[bi]->fDataType).c_str(),
4189 trackBlocks[bi]->fPtr,
4190 trackBlocks[bi]->fSize,
4192 DataType2Text(trackBlocks[bj]->fDataType).c_str(),
4193 trackBlocks[bj]->fPtr,
4194 trackBlocks[bj]->fSize,
4198 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bi]);
4199 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bj]);
4202 AliHLTMUONTrackStruct a = inblocki[i];
4203 AliHLTMUONTrackStruct b = inblockj[j];
4207 HLTError("Problem found with track"
4208 " data block %d, fDataType = '%s', fPtr = %p and"
4209 " fSize = %u bytes, and track data block %d,"
4210 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4211 " Problem: The track structure %d in block %d and entry"
4212 " %d in block %d have the same data."
4213 " The data may have been duplicated.",
4215 DataType2Text(trackBlocks[bi]->fDataType).c_str(),
4216 trackBlocks[bi]->fPtr,
4217 trackBlocks[bi]->fSize,
4219 DataType2Text(trackBlocks[bj]->fDataType).c_str(),
4220 trackBlocks[bj]->fPtr,
4221 trackBlocks[bj]->fSize,
4225 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bi]);
4226 MarkBlock(blocks, blockOk, blockCount, trackBlocks[bj]);
4232 for (AliHLTUInt32_t bi = 0; bi < singleDecisionBlocksCount; bi++)
4234 AliHLTMUONSinglesDecisionBlockReader inblocki(singleDecisionBlocks[bi]->fPtr, singleDecisionBlocks[bi]->fSize);
4235 if (not inblocki.BufferSizeOk()) continue;
4237 // Check that the scalars are within reasonable limits.
4238 const AliHLTMUONSinglesDecisionBlockStruct& hdr = inblocki.BlockHeader();
4239 const AliHLTComponentBlockData* block = singleDecisionBlocks[bi];
4240 if (IsScalarTooLarge(block, bi, "single track", "fNlowPt", hdr.fNlowPt, totalTrackCount) or
4241 IsScalarTooLarge(block, bi, "single track", "fNhighPt", hdr.fNhighPt, totalTrackCount) or
4242 IsScalarALargerThanB(block, bi, "single track", "fNhighPt", hdr.fNhighPt, "fNlowPt", hdr.fNlowPt)
4245 MarkBlock(blocks, blockOk, blockCount, block);
4248 // Check if all the Manso track IDs in the trigger decision structures exist.
4249 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4253 for (AliHLTUInt32_t bj = 0; bj < mansoTrackBlocksCount and not found; bj++)
4255 AliHLTMUONMansoTracksBlockReader inblockj(mansoTrackBlocks[bj]->fPtr, mansoTrackBlocks[bj]->fSize);
4256 if (not inblockj.BufferSizeOk()) continue;
4258 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4260 if (inblocki[i].fTrackId == inblockj[j].fId)
4270 HLTError("Problem found with single track trigger decision"
4271 " data block %d, fDataType = '%s', fPtr = %p and"
4272 " fSize = %u bytes."
4273 " Problem with decision %d in block: The track"
4274 " identifier %d does not exist in any Manso tracks"
4277 DataType2Text(singleDecisionBlocks[bi]->fDataType).c_str(),
4278 singleDecisionBlocks[bi]->fPtr,
4279 singleDecisionBlocks[bi]->fSize,
4280 i, inblocki[i].fTrackId
4282 MarkBlock(blocks, blockOk, blockCount, singleDecisionBlocks[bi]);
4286 // Check if all the trigger decision structures are unique up to the ID and
4287 // have unique Manso track identifiers.
4288 for (AliHLTUInt32_t bj = bi+1; bj < singleDecisionBlocksCount; bj++)
4290 AliHLTMUONSinglesDecisionBlockReader inblockj(singleDecisionBlocks[bj]->fPtr, singleDecisionBlocks[bj]->fSize);
4291 if (not inblockj.BufferSizeOk()) continue;
4293 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4294 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4296 if (inblocki[i].fTrackId == inblockj[j].fTrackId)
4298 HLTError("Problem found with single track trigger decision"
4299 " data block %d, fDataType = '%s', fPtr = %p and"
4300 " fSize = %u bytes, and single track trigger decision"
4302 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4303 " Problem: The trigger decision %d in block %d and entry"
4304 " %d in block %d have the same Manso track identifier,"
4305 " but they should be unique.",
4307 DataType2Text(singleDecisionBlocks[bi]->fDataType).c_str(),
4308 singleDecisionBlocks[bi]->fPtr,
4309 singleDecisionBlocks[bi]->fSize,
4311 DataType2Text(singleDecisionBlocks[bj]->fDataType).c_str(),
4312 singleDecisionBlocks[bj]->fPtr,
4313 singleDecisionBlocks[bj]->fSize,
4317 MarkBlock(blocks, blockOk, blockCount, singleDecisionBlocks[bi]);
4318 MarkBlock(blocks, blockOk, blockCount, singleDecisionBlocks[bj]);
4321 AliHLTMUONTrackDecisionStruct a = inblocki[i];
4322 AliHLTMUONTrackDecisionStruct b = inblockj[j];
4323 a.fTrackId = b.fTrackId = -1;
4326 HLTError("Problem found with single track trigger decision"
4327 " data block %d, fDataType = '%s', fPtr = %p and"
4328 " fSize = %u bytes, and single track trigger decision"
4330 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4331 " Problem: The trigger decision %d in block %d and entry"
4332 " %d in block %d have the same data."
4333 " The data may have been duplicated.",
4335 DataType2Text(singleDecisionBlocks[bi]->fDataType).c_str(),
4336 singleDecisionBlocks[bi]->fPtr,
4337 singleDecisionBlocks[bi]->fSize,
4339 DataType2Text(singleDecisionBlocks[bj]->fDataType).c_str(),
4340 singleDecisionBlocks[bj]->fPtr,
4341 singleDecisionBlocks[bj]->fSize,
4345 MarkBlock(blocks, blockOk, blockCount, singleDecisionBlocks[bi]);
4346 MarkBlock(blocks, blockOk, blockCount, singleDecisionBlocks[bj]);
4352 for (AliHLTUInt32_t bi = 0; bi < pairDecisionBlocksCount; bi++)
4354 AliHLTMUONPairsDecisionBlockReader inblocki(pairDecisionBlocks[bi]->fPtr, pairDecisionBlocks[bi]->fSize);
4355 if (not inblocki.BufferSizeOk()) continue;
4357 AliHLTUInt32_t maxPairs = totalTrackCount * (totalTrackCount-1) / 2;
4358 const AliHLTMUONPairsDecisionBlockStruct& hdr = inblocki.BlockHeader();
4359 const AliHLTComponentBlockData* block = pairDecisionBlocks[bi];
4360 if (IsScalarTooLargePairs(block, bi, "track pair", "fNunlikeAnyPt", hdr.fNunlikeAnyPt, maxPairs) or
4361 IsScalarTooLargePairs(block, bi, "track pair", "fNunlikeLowPt", hdr.fNunlikeLowPt, maxPairs) or
4362 IsScalarTooLargePairs(block, bi, "track pair", "fNunlikeHighPt", hdr.fNunlikeHighPt, maxPairs) or
4363 IsScalarTooLargePairs(block, bi, "track pair", "fNlikeAnyPt", hdr.fNlikeAnyPt, maxPairs) or
4364 IsScalarTooLargePairs(block, bi, "track pair", "fNlikeLowPt", hdr.fNlikeLowPt, maxPairs) or
4365 IsScalarTooLargePairs(block, bi, "track pair", "fNlikeHighPt", hdr.fNlikeHighPt, maxPairs) or
4366 IsScalarTooLargePairs(block, bi, "track pair", "fNmassAny", hdr.fNmassAny, maxPairs) or
4367 IsScalarTooLargePairs(block, bi, "track pair", "fNmassLow", hdr.fNmassLow, maxPairs) or
4368 IsScalarTooLargePairs(block, bi, "track pair", "fNmassHigh", hdr.fNmassHigh, maxPairs) or
4369 IsScalarALargerThanB(block, bi, "track pair", "fNunlikeHighPt", hdr.fNunlikeHighPt, "fNunlikeLowPt", hdr.fNunlikeLowPt) or
4370 IsScalarALargerThanB(block, bi, "track pair", "fNunlikeLowPt", hdr.fNunlikeLowPt, "fNunlikeAnyPt", hdr.fNunlikeAnyPt) or
4371 IsScalarALargerThanB(block, bi, "track pair", "fNlikeHighPt", hdr.fNlikeHighPt, "fNlikeLowPt", hdr.fNlikeLowPt) or
4372 IsScalarALargerThanB(block, bi, "track pair", "fNlikeLowPt", hdr.fNlikeLowPt, "fNlikeAnyPt", hdr.fNlikeAnyPt) or
4373 IsScalarALargerThanB(block, bi, "track pair", "fNmassHigh", hdr.fNmassHigh, "fNmassLow", hdr.fNmassLow) or
4374 IsScalarALargerThanB(block, bi, "track pair", "fNmassLow", hdr.fNmassLow, "fNmassAny", hdr.fNmassAny)
4377 MarkBlock(blocks, blockOk, blockCount, block);
4380 // Check if all the Manso track IDs in the trigger decision structures exist.
4381 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4385 for (AliHLTUInt32_t bj = 0; bj < mansoTrackBlocksCount and not found; bj++)
4387 AliHLTMUONMansoTracksBlockReader inblockj(mansoTrackBlocks[bj]->fPtr, mansoTrackBlocks[bj]->fSize);
4388 if (not inblockj.BufferSizeOk()) continue;
4390 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4392 if (inblocki[i].fTrackAId == inblockj[j].fId)
4402 HLTError("Problem found with track pair trigger decision"
4403 " data block %d, fDataType = '%s', fPtr = %p and"
4404 " fSize = %u bytes."
4405 " Problem with decision %d in block: The track"
4406 " identifier %d does not exist in any Manso tracks"
4409 DataType2Text(pairDecisionBlocks[bi]->fDataType).c_str(),
4410 pairDecisionBlocks[bi]->fPtr,
4411 pairDecisionBlocks[bi]->fSize,
4412 i, inblocki[i].fTrackAId
4414 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bi]);
4419 for (AliHLTUInt32_t bj = 0; bj < mansoTrackBlocksCount and not found; bj++)
4421 AliHLTMUONMansoTracksBlockReader inblockj(mansoTrackBlocks[bj]->fPtr, mansoTrackBlocks[bj]->fSize);
4422 if (not inblockj.BufferSizeOk()) continue;
4424 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4426 if (inblocki[i].fTrackBId == inblockj[j].fId)
4436 HLTError("Problem found with track pair trigger decision"
4437 " data block %d, fDataType = '%s', fPtr = %p and"
4438 " fSize = %u bytes."
4439 " Problem with decision %d in block: The track"
4440 " identifier %d does not exist in any Manso tracks"
4443 DataType2Text(pairDecisionBlocks[bi]->fDataType).c_str(),
4444 pairDecisionBlocks[bi]->fPtr,
4445 pairDecisionBlocks[bi]->fSize,
4446 i, inblocki[i].fTrackBId
4448 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bi]);
4452 // Check if all the trigger decision structures are unique up to the ID and
4453 // have unique Manso track identifier pairs.
4454 for (AliHLTUInt32_t bj = bi+1; bj < pairDecisionBlocksCount; bj++)
4456 AliHLTMUONPairsDecisionBlockReader inblockj(pairDecisionBlocks[bj]->fPtr, pairDecisionBlocks[bj]->fSize);
4457 if (not inblockj.BufferSizeOk()) continue;
4459 for (AliHLTUInt32_t i = 0; i < inblocki.Nentries(); i++)
4460 for (AliHLTUInt32_t j = 0; j < inblockj.Nentries(); j++)
4462 if (inblocki[i].fTrackAId == inblockj[j].fTrackAId and
4463 inblocki[i].fTrackBId == inblockj[j].fTrackBId
4466 HLTError("Problem found with track pair trigger decision"
4467 " data block %d, fDataType = '%s', fPtr = %p and"
4468 " fSize = %u bytes, and track pair trigger decision"
4470 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4471 " Problem: The trigger decision %d in block %d and entry"
4472 " %d in block %d have the same Manso track identifier pair,"
4473 " but the pair should be unique.",
4475 DataType2Text(pairDecisionBlocks[bi]->fDataType).c_str(),
4476 pairDecisionBlocks[bi]->fPtr,
4477 pairDecisionBlocks[bi]->fSize,
4479 DataType2Text(pairDecisionBlocks[bj]->fDataType).c_str(),
4480 pairDecisionBlocks[bj]->fPtr,
4481 pairDecisionBlocks[bj]->fSize,
4485 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bi]);
4486 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bj]);
4489 AliHLTMUONPairDecisionStruct a = inblocki[i];
4490 AliHLTMUONPairDecisionStruct b = inblockj[j];
4491 a.fTrackAId = a.fTrackBId = b.fTrackAId = b.fTrackBId = -1;
4494 HLTError("Problem found with track pair trigger decision"
4495 " data block %d, fDataType = '%s', fPtr = %p and"
4496 " fSize = %u bytes, and track pair trigger decision"
4498 " fDataType = '%s', fPtr = %p and fSize = %u bytes."
4499 " Problem: The trigger decision %d in block %d and entry"
4500 " %d in block %d have the same data."
4501 " The data may have been duplicated.",
4503 DataType2Text(pairDecisionBlocks[bi]->fDataType).c_str(),
4504 pairDecisionBlocks[bi]->fPtr,
4505 pairDecisionBlocks[bi]->fSize,
4507 DataType2Text(pairDecisionBlocks[bj]->fDataType).c_str(),
4508 pairDecisionBlocks[bj]->fPtr,
4509 pairDecisionBlocks[bj]->fSize,
4513 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bi]);
4514 MarkBlock(blocks, blockOk, blockCount, pairDecisionBlocks[bj]);