]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OfflineInterface/AliHLTMUONTriggerRecordsSource.cxx
Filling out AliHLTMUONDigitPublisherComponent code to generate dimuon raw data on...
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONTriggerRecordsSource.cxx
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        *
3  * All rights reserved.                                                   *
4  *                                                                        *
5  * Primary Authors:                                                       *
6  *   Artur Szostak <artursz@iafrica.com>                                  *
7  *                                                                        *
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  **************************************************************************/
16
17 /* $Id$ */
18
19 /**
20  * @file   AliHLTMUONTriggerRecordsSource.cxx
21  * @author Artur Szostak <artursz@iafrica.com>
22  * @date   
23  * @brief  Implementation of the AliHLTMUONTriggerRecordsSource component.
24  */
25
26 #include "AliHLTMUONTriggerRecordsSource.h"
27 #include "AliHLTMUONConstants.h"
28 #include "AliHLTMUONUtils.h"
29 #include "AliHLTMUONDataBlockWriter.h"
30 #include "AliHLTMUONCalculations.h"
31 #include "AliMUONMCDataInterface.h"
32 #include "AliMUONDataInterface.h"
33 #include "AliMUONHit.h"
34 #include "AliMUONRawCluster.h"
35 #include "AliMUONConstants.h"
36 #include "AliMUONVClusterStore.h"
37 #include "AliMUONVHitStore.h"
38 #include "mapping/AliMpCDB.h"
39 #include "mapping/AliMpDDLStore.h"
40 #include "mapping/AliMpLocalBoard.h"
41 #include "mapping/AliMpTriggerCrate.h"
42 #include "mapping/AliMpDEManager.h"
43 #include "mapping/AliMpDetElement.h"
44 #include "AliLog.h"
45 #include "TClonesArray.h"
46 #include <cstdlib>
47 #include <cstdio>
48 #include <cerrno>
49 #include <cassert>
50 #include <new>
51
52 namespace
53 {
54         
55         //TODO: The following method should be in MUON/mapping
56         Int_t FindDDLOfDetElement(Int_t detElemId)
57         {
58                 // Find what the DDL ID number is for a detector element from
59                 // trigger chambers 11 to 14. We first have to find the local
60                 // board associated with the detector element and then we can
61                 // associate that local board to the trigger crate which has
62                 // the DDL number specified.
63                 AliMpDDLStore* ddlStore = AliMpDDLStore::Instance();
64                 if (ddlStore == NULL) return -1;
65                 Int_t ddl = -1, boardIndex = 1;
66                 do
67                 {
68                         AliMpLocalBoard* board = ddlStore->GetLocalBoard(boardIndex++);
69                         if (board == NULL) break;
70                         if (board->HasDEId(detElemId))
71                         {
72                                 AliMpTriggerCrate* crate = ddlStore->GetTriggerCrate(board->GetCrate());
73                                 if (crate == NULL) continue;
74                                 ddl = crate->GetDdlId();
75                                 break;
76                         }
77                 }
78                 while (ddl == -1);
79                 return ddl;
80         }
81
82 }
83
84
85 ClassImp(AliHLTMUONTriggerRecordsSource);
86
87
88 AliHLTMUONTriggerRecordsSource::AliHLTMUONTriggerRecordsSource() :
89         AliHLTOfflineDataSource(),
90         fMCDataInterface(NULL),
91         fDataInterface(NULL),
92         fBuildFromHits(false),
93         fSelection(kWholePlane),
94         fCurrentEventIndex(0)
95 {
96         ///
97         /// Default constructor.
98         ///
99 }
100
101
102 AliHLTMUONTriggerRecordsSource::~AliHLTMUONTriggerRecordsSource()
103 {
104         ///
105         /// Default destructor.
106         ///
107         
108         if (fMCDataInterface != NULL) delete fMCDataInterface;
109         if (fDataInterface != NULL) delete fDataInterface;
110 }
111
112
113 int AliHLTMUONTriggerRecordsSource::DoInit(int argc, const char** argv)
114 {
115         ///
116         /// Inherited from AliHLTComponent.
117         /// Parses the command line parameters and initialises the component.
118         ///
119         
120         HLTInfo("Initialising dHLT trigger record source component.");
121         
122         if (fMCDataInterface != NULL)
123         {
124                 delete fMCDataInterface;
125                 fMCDataInterface = NULL;
126         }
127         if (fDataInterface != NULL)
128         {
129                 delete fDataInterface;
130                 fDataInterface = NULL;
131         }
132         
133         // Parse the command line arguments:
134         bool hitdata = false;
135         bool simdata = false;
136         bool recdata = false;
137         fCurrentEventIndex = 0;
138         bool firstEventSet = false;
139         bool eventNumLitSet = false;
140         
141         for (int i = 0; i < argc; i++)
142         {
143                 if (strcmp(argv[i], "-hitdata") == 0)
144                 {
145                         hitdata = true;
146                 }
147                 else if (strcmp(argv[i], "-simdata") == 0)
148                 {
149                         simdata = true;
150                 }
151                 else if (strcmp(argv[i], "-recdata") == 0)
152                 {
153                         recdata = true;
154                 }
155                 else if (strcmp(argv[i], "-plane") == 0)
156                 {
157                         i++;
158                         if (i >= argc)
159                         {
160                                 Logging(kHLTLogError,
161                                         "AliHLTMUONTriggerRecordsSource::DoInit",
162                                         "Missing parameter",
163                                         "Expected one of 'left', 'right' or 'all' after '-plane'."
164                                 );
165                                 return -EINVAL;
166                         }
167                         if (strcmp(argv[i], "left") == 0)
168                                 fSelection = kLeftPlane;
169                         else if (strcmp(argv[i], "right") == 0)
170                                 fSelection = kRightPlane;
171                         else if (strcmp(argv[i], "all") == 0)
172                                 fSelection = kWholePlane;
173                         else
174                         {
175                                 Logging(kHLTLogError,
176                                         "AliHLTMUONTriggerRecordsSource::DoInit",
177                                         "Invalid parameter",
178                                         "The parameter '%s' is invalid and must be one of 'left',"
179                                           " 'right' or 'all'.",
180                                         argv[i]
181                                 );
182                                 return -EINVAL;
183                         }
184                 }
185                 else if (strcmp(argv[i], "-firstevent") == 0)
186                 {
187                         if (eventNumLitSet)
188                         {
189                                 HLTWarning("The -firstevent flag is overridden by a"
190                                         " previous use of -event_number_literal."
191                                 );
192                         }
193                         i++;
194                         if (i >= argc)
195                         {
196                                 HLTError("Expected a positive number after -firstevent.");
197                                 return -EINVAL;
198                         }
199                         char* end = "";
200                         long num = strtol(argv[i], &end, 0);
201                         if (*end != '\0' or num < 0) // Check if the conversion is OK.
202                         {
203                                 HLTError(Form(
204                                         "Expected a positive number after -firstevent"
205                                         " but got: %s", argv[i]
206                                 ));
207                                 return -EINVAL;
208                         }
209                         fCurrentEventIndex = Int_t(num);
210                         firstEventSet = true;
211                 }
212                 else if (strcmp(argv[i], "-event_number_literal") == 0)
213                 {
214                         if (firstEventSet)
215                         {
216                                 HLTWarning("The -event_number_literal option will"
217                                         " override -firstevent."
218                                 );
219                         }
220                         fCurrentEventIndex = -1;
221                         eventNumLitSet = true;
222                 }
223                 else
224                 {
225                         Logging(kHLTLogError,
226                                 "AliHLTMUONTriggerRecordsSource::DoInit",
227                                 "Unknown argument",
228                                 "The argument '%s' is invalid.",
229                                 argv[i]
230                         );
231                         return -EINVAL;
232                 }
233         }
234
235         // Check that one and only one of the the -hitdata, -simdata or
236         // -recdata parameters was specified on the command line.
237         if ((not hitdata and not simdata and not recdata) or
238             (not hitdata and simdata and recdata) or
239             (hitdata and not simdata and recdata) or
240             (hitdata and simdata and not recdata) or
241             (hitdata and simdata and recdata)
242            )
243         {
244                 Logging(kHLTLogError,
245                         "AliHLTMUONTriggerRecordsSource::DoInit",
246                         "Missing arguments",
247                         "Must have one and only one of -hitdata, -simdata or -recdata specified."
248                 );
249                 return -EINVAL;
250         }
251         
252         // Must load the mapping data for AliMpTriggerCrate::GetDdlId()  //TODO AliMpTriggerCrate => AliMpDetElement
253         // to return useful information later on.
254         AliMpCDB::LoadDDLStore();
255         
256         // Now we can initialise the data interface objects and loaders.
257         fBuildFromHits = hitdata;
258         if (hitdata or simdata)
259         {
260                 const char* message = fBuildFromHits ?
261                         "Loading simulated GEANT hits with AliMUONMCDataInterface."
262                         : "Loading simulated local trigger objects with AliMUONMCDataInterface.";
263                                 
264                 Logging(kHLTLogDebug, "AliHLTMUONTriggerRecordsSource::DoInit",
265                         "Data interface", message
266                 );
267                 
268                 try
269                 {
270                         fMCDataInterface = new AliMUONMCDataInterface("galice.root");
271                 }
272                 catch (const std::bad_alloc&)
273                 {
274                         Logging(kHLTLogError,
275                                 "AliHLTMUONTriggerRecordsSource::DoInit",
276                                 "Out of memory",
277                                 "Not enough memory to allocate AliMUONMCDataInterface."
278                         );
279                         return -ENOMEM;
280                 }
281         }
282         else if (recdata)
283         {
284                 Logging(kHLTLogDebug,
285                         "AliHLTMUONTriggerRecordsSource::DoInit",
286                         "Data interface",
287                         "Loading reconstructed local trigger objects with AliMUONDataInterface."
288                 );
289                 
290                 try
291                 {
292                         fDataInterface = new AliMUONDataInterface("galice.root");
293                 }
294                 catch (const std::bad_alloc&)
295                 {
296                         Logging(kHLTLogError,
297                                 "AliHLTMUONTriggerRecordsSource::DoInit",
298                                 "Out of memory",
299                                 "Not enough memory to allocate AliMUONDataInterface."
300                         );
301                         return -ENOMEM;
302                 }
303         }
304         
305         // Check that the fCurrentEventIndex number falls within the correct range.
306         UInt_t maxevent = 0;
307         if (fMCDataInterface != NULL)
308                 maxevent = UInt_t(fMCDataInterface->NumberOfEvents());
309         else if (fDataInterface != NULL)
310                 maxevent = UInt_t(fDataInterface->NumberOfEvents());
311         if (fCurrentEventIndex != -1 and UInt_t(fCurrentEventIndex) >= maxevent and maxevent != 0)
312         {
313                 fCurrentEventIndex = 0;
314                 HLTWarning(Form("The selected first event number (%d) was larger than"
315                         " the available number of events (%d). Resetting the event"
316                         " counter to zero.", fCurrentEventIndex, maxevent
317                 ));
318         }
319         
320         return 0;
321 }
322
323
324 int AliHLTMUONTriggerRecordsSource::DoDeinit()
325 {
326         ///
327         /// Inherited from AliHLTComponent. Performs a cleanup of the component.
328         ///
329         
330         HLTInfo("Deinitialising dHLT trigger record source component.");
331         
332         if (fMCDataInterface != NULL)
333         {
334                 delete fMCDataInterface;
335                 fMCDataInterface = NULL;
336         }
337         if (fDataInterface != NULL)
338         {
339                 delete fDataInterface;
340                 fDataInterface = NULL;
341         }
342         return 0;
343 }
344
345
346 const char* AliHLTMUONTriggerRecordsSource::GetComponentID()
347 {
348         ///
349         /// Inherited from AliHLTComponent. Returns the component ID.
350         ///
351         
352         return AliHLTMUONConstants::TriggerRecordsSourceId();
353 }
354
355
356 AliHLTComponentDataType AliHLTMUONTriggerRecordsSource::GetOutputDataType()
357 {
358         ///
359         /// Inherited from AliHLTComponent. Returns the output data type.
360         ///
361         
362         return AliHLTMUONConstants::TriggerRecordsBlockDataType();
363 }
364
365
366 void AliHLTMUONTriggerRecordsSource::GetOutputDataSize(
367                 unsigned long& constBase, double& inputMultiplier
368         )
369 {
370         ///
371         /// Inherited from AliHLTComponent. Returns an estimate of the expected output data size.
372         ///
373         
374         constBase = sizeof(AliHLTMUONTriggerRecordsBlockStruct) +
375                 sizeof(AliHLTMUONTriggerRecordStruct) * AliMUONConstants::NTriggerCircuit();
376         inputMultiplier = 0;
377 }
378
379
380 AliHLTComponent* AliHLTMUONTriggerRecordsSource::Spawn()
381 {
382         ///
383         /// Inherited from AliHLTComponent. Creates a new object instance.
384         ///
385         
386         return new AliHLTMUONTriggerRecordsSource();
387 }
388
389
390 int AliHLTMUONTriggerRecordsSource::GetEvent(
391                 const AliHLTComponentEventData& evtData,
392                 AliHLTComponentTriggerData& /*trigData*/,
393                 AliHLTUInt8_t* outputPtr, 
394                 AliHLTUInt32_t& size,
395                 vector<AliHLTComponentBlockData>& outputBlocks
396         )
397 {
398         ///
399         /// Inherited from AliHLTOfflineDataSource. Creates new event data blocks.
400         ///
401         
402         assert( fMCDataInterface != NULL or fDataInterface != NULL );
403
404         AliHLTInt32_t trigRecId = 0;
405
406         // Check the size of the event descriptor structure.
407         if (evtData.fStructSize < sizeof(AliHLTComponentEventData))
408         {
409                 Logging(kHLTLogError,
410                         "AliHLTMUONTriggerRecordsSource::GetEvent",
411                         "Invalid event descriptor",
412                         "The event descriptor (AliHLTComponentEventData) size is"
413                           " smaller than expected. It claims to be %d bytes, but"
414                           " we expect it to be %d bytes.",
415                         evtData.fStructSize,
416                         sizeof(AliHLTComponentEventData)
417                 );
418                 size = 0; // Important to tell framework that nothing was generated.
419                 return -EINVAL;
420         }
421         
422         // Use the fEventID as the event number to load if fCurrentEventIndex == -1,
423         // check it and load that event with the runloader.
424         // If fCurrentEventIndex is a positive number then use it instead and
425         // increment it.
426         UInt_t eventnumber = UInt_t(evtData.fEventID);
427         UInt_t maxevent = 0;
428         if (fMCDataInterface != NULL)
429                 maxevent = UInt_t(fMCDataInterface->NumberOfEvents());
430         else if (fDataInterface != NULL)
431                 maxevent = UInt_t(fDataInterface->NumberOfEvents());
432         if (fCurrentEventIndex != -1)
433         {
434                 eventnumber = UInt_t(fCurrentEventIndex);
435                 fCurrentEventIndex++;
436                 if (UInt_t(fCurrentEventIndex) >= maxevent)
437                         fCurrentEventIndex = 0;
438         }
439         if ( eventnumber >= maxevent )
440         {
441                 Logging(kHLTLogError,
442                         "AliHLTMUONTriggerRecordsSource::GetEvent",
443                         "Bad event ID",
444                         "The event number (%d) is larger than the available number"
445                           " of events on file (%d).",
446                         eventnumber,
447                         maxevent
448                 );
449                 size = 0; // Important to tell framework that nothing was generated.
450                 return -EINVAL;
451         }
452         
453         // Create and initialise a new data block.
454         AliHLTMUONTriggerRecordsBlockWriter block(outputPtr, size);
455         if (not block.InitCommonHeader())
456         {
457                 Logging(kHLTLogError,
458                         "AliHLTMUONTriggerRecordsSource::GetEvent",
459                         "Buffer too small",
460                         "There is not enough buffer space to create a new data block."
461                           " We require at least %d bytes but the buffer is only %d bytes.",
462                         sizeof(AliHLTMUONTriggerRecordsBlockWriter::HeaderType),
463                         block.BufferSize()
464                 );
465                 size = 0; // Important to tell framework that nothing was generated.
466                 return -ENOBUFS;
467         }
468         
469         // Initialise the DDL list containing the DDLs which contributed to the
470         // data block. These are required to create the specification word later.
471         bool ddlList[22];
472         for (Int_t i = 0; i < 22; i++)
473                 ddlList[i] = false;
474         
475         if (fMCDataInterface != NULL and fBuildFromHits)
476         {
477                 Logging(kHLTLogDebug,
478                         "AliHLTMUONTriggerRecordsSource::GetEvent",
479                         "Filling triggers",
480                         "Filling data block with trigger records from GEANT hits for event %d.",
481                         eventnumber
482                 );
483                 
484                 // Loop over all tracks, extract the hits from chambers 11 to 14 and
485                 // create trigger records from them to write to the data block.
486                 Int_t ntracks = fMCDataInterface->NumberOfTracks(eventnumber);
487                 for (Int_t i = 0; i < ntracks; ++i)
488                 {
489                         AliMUONHit* hit11 = NULL;
490                         AliMUONHit* hit12 = NULL;
491                         AliMUONHit* hit13 = NULL;
492                         AliMUONHit* hit14 = NULL;
493                         Int_t ddl11 = -1;
494                         Int_t ddl12 = -1;
495                         Int_t ddl13 = -1;
496                         Int_t ddl14 = -1;
497                         
498                         AliMUONVHitStore* hitStore = fMCDataInterface->HitStore(eventnumber,i);
499                         AliMUONHit* hit;
500                         TIter next(hitStore->CreateIterator());
501                         while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
502                         {
503                                 // Select only hits on trigger chambers.
504                                 if (hit->Chamber() <= AliMUONConstants::NTrackingCh()) continue;
505                                 
506                                 // Only select hits from the given part of the plane
507                                 if (fSelection == kLeftPlane and not (hit->Xref() < 0)) continue;
508                                 if (fSelection == kRightPlane and not (hit->Xref() >= 0)) continue;
509                                 
510                                 // Workout which DDL this hit should be readout of.
511                                 Int_t ddl = FindDDLOfDetElement(hit->DetElemId());
512                                 if (not (0 <= ddl and ddl < 22))
513                                 {
514                                         ddl = -1;
515                                         Logging(kHLTLogError,
516                                                 "AliHLTMUONTriggerRecordsSource::GetEvent",
517                                                 "No DDL ID",
518                                                 "Could not find the DDL ID from which readout would take place."
519                                         );
520                                 }
521                                 
522                                 switch (hit->Chamber())
523                                 {
524                                 case 11: hit11 = hit; ddl11 = ddl; break;
525                                 case 12: hit12 = hit; ddl12 = ddl; break;
526                                 case 13: hit13 = hit; ddl13 = ddl; break;
527                                 case 14: hit14 = hit; ddl14 = ddl; break;
528                                 default: break;
529                                 }
530                         }
531                         
532                         // Check that there are at least 3 of 4 hits on the trigger chambers.
533                         Int_t hitCount = 0;
534                         if (hit11 != NULL) hitCount++;
535                         if (hit12 != NULL) hitCount++;
536                         if (hit13 != NULL) hitCount++;
537                         if (hit14 != NULL) hitCount++;
538                         if (hitCount < 3) continue;
539                                 
540                         AliHLTMUONTriggerRecordStruct* trigRec = block.AddEntry();
541                         if (trigRec == NULL)
542                         {
543                                 Logging(kHLTLogError,
544                                         "AliHLTMUONTriggerRecordsSource::GetEvent",
545                                         "Buffer overflow",
546                                         "There is not enough buffer space to add more trigger records."
547                                           " We overflowed the buffer which is only %d bytes.",
548                                         block.BufferSize()
549                                 );
550                                 size = 0; // Important to tell framework that nothing was generated.
551                                 return -ENOBUFS;
552                         }
553                         
554                         // Fill the new trigger record with the hit information.
555                         bool hitset[4] = {false, false, false, false};
556                         AliHLTFloat32_t x1 = 0, y1 = 0, y2 = 0, z1 = 0, z2 = 0;
557                         if (hit11 != NULL)
558                         {
559                                 trigRec->fHit[0].fX = hit11->Xref();
560                                 trigRec->fHit[0].fY = hit11->Yref();
561                                 trigRec->fHit[0].fZ = hit11->Zref();
562                                 hitset[0] = true;
563                                 x1 = hit11->Xref();
564                                 y1 = hit11->Yref();
565                                 z1 = hit11->Zref();
566                         }
567                         if (hit12 != NULL)
568                         {
569                                 trigRec->fHit[1].fX = hit12->Xref();
570                                 trigRec->fHit[1].fY = hit12->Yref();
571                                 trigRec->fHit[1].fZ = hit12->Zref();
572                                 hitset[1] = true;
573                                 x1 = hit12->Xref();
574                                 y1 = hit12->Yref();
575                                 z1 = hit12->Zref();
576                         }
577                         if (hit13 != NULL)
578                         {
579                                 trigRec->fHit[2].fX = hit13->Xref();
580                                 trigRec->fHit[2].fY = hit13->Yref();
581                                 trigRec->fHit[2].fZ = hit13->Zref();
582                                 hitset[2] = true;
583                                 y2 = hit13->Yref();
584                                 z2 = hit13->Zref();
585                         }
586                         if (hit14 != NULL)
587                         {
588                                 trigRec->fHit[3].fX = hit14->Xref();
589                                 trigRec->fHit[3].fY = hit14->Yref();
590                                 trigRec->fHit[3].fZ = hit14->Zref();
591                                 hitset[3] = true;
592                                 y2 = hit14->Yref();
593                                 z2 = hit14->Zref();
594                         }
595                         
596                         bool calculated = AliHLTMUONCalculations::ComputeMomentum(x1, y1, y2, z1, z2);
597                         if (not calculated)
598                                 Logging(kHLTLogDebug,
599                                         "AliHLTMUONTriggerRecordsSource::GetEvent",
600                                         "Calculation failure",
601                                         "Something went wrong when calculating the momentum from"
602                                           " x1 = %f, y1 = %f, y2 = %f, z1 = %f, z2 = %f.",
603                                         x1, y1, y2, z1, z2
604                                 );
605                         
606                         trigRec->fId = trigRecId++;
607                         trigRec->fFlags = AliHLTMUONUtils::PackTriggerRecordFlags(
608                                         AliHLTMUONCalculations::Sign(), hitset
609                                 );
610                         trigRec->fPx = AliHLTMUONCalculations::Px();
611                         trigRec->fPy = AliHLTMUONCalculations::Py();
612                         trigRec->fPz = AliHLTMUONCalculations::Pz();
613                         
614                         // Mark the DDLs over which this trigger record would be readout.
615                         if (ddl11 != -1) ddlList[ddl11] = true;
616                         if (ddl12 != -1) ddlList[ddl12] = true;
617                         if (ddl13 != -1) ddlList[ddl13] = true;
618                         if (ddl14 != -1) ddlList[ddl14] = true;
619                 }
620         }
621         else if (fMCDataInterface != NULL and not fBuildFromHits)
622         {
623                 Logging(kHLTLogDebug,
624                         "AliHLTMUONTriggerRecordsSource::GetEvent",
625                         "Filling triggers",
626                         "Filling data block with simulated local triggers for event %d.",
627                         eventnumber
628                 );
629                 
630                 AliFatal("Sorry, -simdata option not yet implemented!");
631                 // TODO
632         }
633         else if (fDataInterface != NULL)
634         {
635                 Logging(kHLTLogDebug,
636                         "AliHLTMUONTriggerRecordsSource::GetEvent",
637                         "Filling triggers",
638                         "Filling data block with reconstructed local triggers for event %d.",
639                         eventnumber
640                 );
641                 // TODO
642                 AliFatal("Sorry, -recdata option not yet implemented!");
643         }
644         else
645         {
646                 Logging(kHLTLogError,
647                         "AliHLTMUONTriggerRecordsSource::GetEvent",
648                         "Missing data interface",
649                         "Neither AliMUONDataInterface nor AliMUONMCDataInterface were created."
650                 );
651                 size = 0; // Important to tell framework that nothing was generated.
652                 return -EFAULT;
653         }
654         
655         AliHLTComponentBlockData bd;
656         FillBlockData(bd);
657         bd.fPtr = outputPtr;
658         bd.fOffset = 0;
659         bd.fSize = block.BytesUsed();
660         bd.fDataType = AliHLTMUONConstants::TriggerRecordsBlockDataType();
661         bd.fSpecification = AliHLTMUONUtils::PackSpecBits(ddlList);
662         outputBlocks.push_back(bd);
663         size = block.BytesUsed();
664
665         return 0;
666 }