]>
Commit | Line | Data |
---|---|---|
ce6fd1b1 | 1 | // $Id$ |
2 | //************************************************************************** | |
3 | //* This file is property of and copyright by the ALICE HLT Project * | |
4 | //* ALICE Experiment at CERN, All rights reserved. * | |
5 | //* * | |
6 | //* * | |
7 | //* Permission to use, copy, modify and distribute this software and its * | |
8 | //* documentation strictly for non-commercial purposes is hereby granted * | |
9 | //* without fee, provided that the above copyright notice appears in all * | |
10 | //* copies and that both the copyright notice and this permission notice * | |
11 | //* appear in the supporting documentation. The authors make no claims * | |
12 | //* about the suitability of this software for any purpose. It is * | |
13 | //* provided "as is" without express or implied warranty. * | |
14 | //************************************************************************** | |
15 | ||
16 | /// @file AliHLTTRDMonitorComponent.cxx | |
17 | /// @author Felix Rettig, Stefan Kirsch | |
18 | /// @date 2011-08-02 | |
19 | /// @brief A processing component for TRD tracking/trigger data on FEP-level | |
20 | /// @ingroup alihlt_trd_components | |
21 | ||
22 | #include "AliHLTTRDMonitorComponent.h" | |
23 | #include "AliLog.h" | |
24 | #include "AliHLTDataTypes.h" | |
25 | #include "AliRawReaderMemory.h" | |
26 | #include "AliHLTTRDDefinitions.h" | |
27 | ||
28 | #include "AliTRDdigitsManager.h" | |
29 | #include "AliTRDrawStream.h" | |
30 | #include "AliTRDtrackletWord.h" | |
31 | #include "AliESDTrdTracklet.h" | |
32 | #include "AliESDTrdTrack.h" | |
33 | ||
34 | #include "TH1I.h" | |
35 | #include "TH2I.h" | |
36 | #include "TH1F.h" | |
37 | ||
38 | ||
39 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
40 | ClassImp(AliHLTTRDMonitorComponent) | |
41 | ||
42 | AliHLTTRDMonitorComponent::AliHLTTRDMonitorComponent() | |
43 | : AliHLTProcessor() | |
44 | , fTrackletArray(NULL) | |
45 | , fGtuTrackArray(NULL) | |
46 | , fRawReaderMem(NULL) | |
47 | , fDigitsManagerTrd(NULL) | |
48 | , fRawReaderTrd(NULL) | |
49 | , fHistArray(NULL) | |
50 | , fHistTrackletY(NULL) | |
51 | , fHistTrackletDy(NULL) | |
52 | , fHistTrackletZ(NULL) | |
53 | , fHistTrackletPID(NULL) | |
54 | , fHistTrackletYDy(NULL) | |
55 | , fHistTrackletHC(NULL) | |
56 | , fHistTrackletBadY(NULL) | |
57 | , fHistTrackletBadPID(NULL) | |
58 | , fHistFirstTrackletTime(NULL) | |
59 | , fHistLastTrackletTime(NULL) | |
60 | , fHistTmuTime(NULL) | |
61 | , fHistSmuTime(NULL) | |
62 | , fHistTrackPt(NULL) | |
63 | , fHistTrackStack(NULL) | |
64 | , fHistTrackletsTrack(NULL) | |
65 | , fHistTrackletsTrackHpt(NULL) | |
66 | , fHistTrackPID(NULL) | |
67 | , fHistTriggerContribs(NULL) | |
68 | { | |
69 | // constructor | |
70 | } | |
71 | ||
72 | AliHLTTRDMonitorComponent::~AliHLTTRDMonitorComponent() | |
73 | { | |
74 | // destructor | |
75 | } | |
76 | ||
77 | const char* AliHLTTRDMonitorComponent::GetComponentID() | |
78 | { | |
79 | // component property: id | |
80 | return "TRDMonitorComponent"; | |
81 | } | |
82 | ||
83 | void AliHLTTRDMonitorComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) | |
84 | { | |
85 | // component property: list of input data types | |
86 | list.push_back(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD); | |
87 | } | |
88 | ||
89 | AliHLTComponentDataType AliHLTTRDMonitorComponent::GetOutputDataType() | |
90 | { | |
91 | // component property: output data type | |
92 | return kAliHLTMultipleDataType; | |
93 | } | |
94 | ||
95 | int AliHLTTRDMonitorComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) | |
96 | ||
97 | { | |
98 | // see header file for class documentation | |
99 | tgtList.clear(); | |
100 | // tgtList.push_back(AliHLTTRDDefinitions::fgkSimpleIntegerDataType); | |
101 | tgtList.push_back(kAliHLTDataTypeTObject | kAliHLTDataOriginTRD); | |
102 | return tgtList.size(); | |
103 | } | |
104 | ||
105 | void AliHLTTRDMonitorComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) | |
106 | { | |
107 | // component property: output size estimator | |
108 | constBase = 5000000; | |
109 | inputMultiplier = 0; | |
110 | } | |
111 | ||
112 | void AliHLTTRDMonitorComponent::GetOCDBObjectDescription( TMap* const /*targetMap*/) | |
113 | { | |
114 | // Get a list of OCDB object description. | |
115 | // The list of objects is provided in a TMap | |
116 | // - key: complete OCDB path, e.g. GRP/GRP/Data | |
117 | // - value: short description why the object is needed | |
118 | // Key and value objects created inside this class go into ownership of | |
119 | // target TMap. | |
120 | //if (!targetMap) return; | |
121 | //targetMap->Add(new TObjString("HLT/ConfigSample/SampleRawAnalysis"), | |
122 | // new TObjString("configuration object")); | |
123 | } | |
124 | ||
125 | AliHLTComponent* AliHLTTRDMonitorComponent::Spawn() | |
126 | { | |
127 | // Spawn function, return new class instance | |
128 | return new AliHLTTRDMonitorComponent; | |
129 | } | |
130 | ||
131 | int AliHLTTRDMonitorComponent::DoInit( int /*argc*/, const char** /*argv*/ ) | |
132 | { | |
133 | ||
134 | int iResult=0; | |
135 | ||
136 | // init stage 1: default values for all data members | |
137 | ||
138 | // init stage 2: read configuration object | |
139 | // ScanConfigurationArgument() needs to be implemented | |
140 | // HLT component configuration objects are located in the HLT/ConfigDET | |
141 | // of the OCDB. TObjString configuration objects can be generated with | |
142 | // the macro HLT/exa/makeComponentConfigurationObject.C, e.g. | |
143 | // aliroot -b -q -l $ALICE_ROOT/HLT/exa/makeComponentConfigurationObject.C'("HLT/ConfigSample/SampleRawAnalysis", "")' | |
144 | //TString cdbPath="HLT/ConfigSample/"; | |
145 | //cdbPath+=GetComponentID(); | |
146 | //iResult=ConfigureFromCDBTObjString(cdbPath); | |
147 | ||
148 | // init stage 3: read the component arguments | |
149 | //if (iResult>=0) { | |
150 | // iResult=ConfigureFromArgumentString(argc, argv); | |
151 | //} | |
152 | ||
153 | // implement the component initialization | |
79f07cf4 | 154 | // Matthias 2011-08-24: this has to go into ScanConfigurationArgument |
ce6fd1b1 | 155 | do { |
ce6fd1b1 | 156 | |
157 | fRawReaderMem = new AliRawReaderMemory; | |
158 | if (!fRawReaderMem) { | |
159 | iResult=-ENOMEM; | |
160 | break; | |
161 | } | |
162 | ||
163 | fTrackletArray = new TClonesArray("AliTRDtrackletWord", 500); | |
164 | if (!fTrackletArray) { | |
165 | iResult=-ENOMEM; | |
166 | break; | |
167 | } | |
168 | ||
169 | fGtuTrackArray = new TClonesArray("AliESDTrdTrack", 50); | |
170 | if (!fGtuTrackArray){ | |
171 | iResult=-ENOMEM; | |
172 | break; | |
173 | } | |
174 | ||
175 | fDigitsManagerTrd = new AliTRDdigitsManager(); | |
176 | if (!fDigitsManagerTrd) { | |
177 | iResult=-ENOMEM; | |
178 | break; | |
179 | } | |
180 | fDigitsManagerTrd->CreateArrays(); | |
181 | ||
182 | fRawReaderTrd = new AliTRDrawStream(fRawReaderMem); | |
183 | if (!fRawReaderTrd) { | |
184 | iResult=-ENOMEM; | |
185 | break; | |
186 | } | |
187 | ||
188 | fRawReaderTrd->SetDigitsManager(fDigitsManagerTrd); | |
189 | // fRawReaderTrd->SetDigitsManager(NULL); // FIXME may be used to improve performance, needs a fix to be committed by TRD | |
190 | fRawReaderTrd->SetTrackletArray(fTrackletArray); | |
191 | fRawReaderTrd->SetTrackArray(fGtuTrackArray); | |
192 | ||
193 | // Disable raw reader error messages that could flood HLT logbook | |
194 | fRawReaderTrd->SetErrorDebugLevel( AliTRDrawStream::kLinkMonitor, 1 ); | |
195 | ||
196 | fHistArray = new TObjArray(25); | |
197 | if(!fHistArray){ | |
198 | return -ENOMEM; | |
199 | break; | |
200 | } | |
201 | fHistArray->SetOwner(kTRUE); | |
202 | ||
203 | fHistTrackletY = new TH1I("hist_tracklets_y", "Y-Position of online tracklets", 256, -4096, 4096); | |
204 | if (!fHistTrackletY){ | |
205 | return -ENOMEM; | |
206 | break; | |
207 | } | |
208 | fHistArray->AddLast(fHistTrackletY); | |
209 | ||
210 | fHistTrackletDy = new TH1I("hist_tracklets_dy", "Deflection of online tracklets", 128, -64, 64); | |
211 | if (!fHistTrackletDy){ | |
212 | return -ENOMEM; | |
213 | break; | |
214 | } | |
215 | fHistArray->AddLast(fHistTrackletDy); | |
216 | ||
217 | fHistTrackletZ = new TH1I("hist_tracklets_z", "Z-Position of online tracklets", 12, 0, 12); | |
218 | if (!fHistTrackletZ){ | |
219 | return -ENOMEM; | |
220 | break; | |
221 | } | |
222 | fHistArray->AddLast(fHistTrackletZ); | |
223 | ||
224 | fHistTrackletPID = new TH1I("hist_tracklets_pid", "PID of online tracklets", 256, 0, 256); | |
225 | if (!fHistTrackletPID){ | |
226 | return -ENOMEM; | |
227 | break; | |
228 | } | |
229 | fHistArray->AddLast(fHistTrackletPID); | |
230 | ||
231 | fHistTrackletYDy = new TH2I("hist_tracklets_y_dy", "Tracklet deflection vs. tracklet position", 256, -4096, 4096, 64, -64, 64); | |
232 | if (!fHistTrackletYDy){ | |
233 | return -ENOMEM; | |
234 | break; | |
235 | } | |
236 | fHistArray->AddLast(fHistTrackletYDy); | |
237 | ||
238 | fHistTrackletHC = new TH2I("hist_tracklets_hc", "Number of online tracklets by HC", 18, 0, 18, 60, 0, 60); | |
239 | if (!fHistTrackletHC){ | |
240 | return -ENOMEM; | |
241 | break; | |
242 | } | |
243 | fHistArray->AddLast(fHistTrackletHC); | |
244 | ||
245 | fHistTrackletBadY = new TH2I("hist_tracklets_bad_y", "Number of online tracklets with bad y-position by HC", 18, 0, 18, 5, 0, 5); | |
246 | if (!fHistTrackletBadY){ | |
247 | return -ENOMEM; | |
248 | break; | |
249 | } | |
250 | fHistArray->AddLast(fHistTrackletBadY); | |
251 | ||
252 | fHistTrackletBadPID = new TH2I("hist_tracklets_bad_pid", "Number of online tracklets with bad y-position by HC", 18, 0, 18, 5, 0, 5); | |
253 | if (!fHistTrackletBadPID){ | |
254 | return -ENOMEM; | |
255 | break; | |
256 | } | |
257 | fHistArray->AddLast(fHistTrackletBadPID); | |
258 | ||
259 | fHistFirstTrackletTime = new TH1F("hist_first_tracklet_time", "Arrival time of first tracklet", 160, 0., 8.); | |
260 | if (!fHistFirstTrackletTime){ | |
261 | return -ENOMEM; | |
262 | break; | |
263 | } | |
264 | fHistArray->AddLast(fHistFirstTrackletTime); | |
265 | ||
266 | fHistLastTrackletTime = new TH1F("hist_last_tracklet_time", "Arrival time of last tracklet", 160, 0., 8.); | |
267 | if (!fHistLastTrackletTime){ | |
268 | return -ENOMEM; | |
269 | break; | |
270 | } | |
271 | fHistArray->AddLast(fHistLastTrackletTime); | |
272 | ||
273 | fHistTmuTime = new TH1F("hist_tmu_time", "Tracking done time at TMU-level", 160, 0., 8.); | |
274 | if (!fHistTmuTime){ | |
275 | return -ENOMEM; | |
276 | break; | |
277 | } | |
278 | fHistArray->AddLast(fHistTmuTime); | |
279 | ||
280 | fHistSmuTime = new TH1F("hist_smu_time", "Tracking done time at SMU-level", 160, 0., 8.); | |
281 | if (!fHistSmuTime){ | |
282 | return -ENOMEM; | |
283 | break; | |
284 | } | |
285 | fHistArray->AddLast(fHistSmuTime); | |
286 | ||
287 | fHistTrackPt = new TH1F("hist_tracks_pt", "Transverse momentum of GTU tracks", 100, 0., 20.); | |
288 | if (!fHistTrackPt){ | |
289 | return -ENOMEM; | |
290 | break; | |
291 | } | |
292 | fHistArray->AddLast(fHistTrackPt); | |
293 | ||
294 | fHistTrackPID = new TH1I("hist_tracks_pid", "PID of online tracks", 256, 0, 256); | |
295 | if (!fHistTrackPID){ | |
296 | return -ENOMEM; | |
297 | break; | |
298 | } | |
299 | fHistArray->AddLast(fHistTrackPID); | |
300 | ||
301 | fHistTrackStack = new TH2I("hist_tracks_stack", "Number of GTU tracks by stack", 18, 0, 18, 5, 0, 5); | |
302 | if (!fHistTrackStack){ | |
303 | return -ENOMEM; | |
304 | break; | |
305 | } | |
306 | fHistArray->AddLast(fHistTrackStack); | |
307 | ||
308 | fHistTrackletsTrack = new TH1I("hist_tracklets_track", "Tracklets per GTU track", 7, 0, 7); | |
309 | if (!fHistTrackletsTrack){ | |
310 | return -ENOMEM; | |
311 | break; | |
312 | } | |
313 | fHistArray->AddLast(fHistTrackletsTrack); | |
314 | ||
315 | fHistTrackletsTrackHpt = new TH1I("hist_tracklets_track_hpt", "Tracklets per high-pt GTU track", 7, 0, 7); | |
316 | if (!fHistTrackletsTrackHpt){ | |
317 | return -ENOMEM; | |
318 | break; | |
319 | } | |
320 | fHistArray->AddLast(fHistTrackletsTrackHpt); | |
321 | ||
322 | fHistTriggerContribs = new TH2I("hist_trigger_contribs", "Trigger contributions by segment", 18, 0, 18, 12, 0, 12); | |
323 | if (!fHistTriggerContribs){ | |
324 | return -ENOMEM; | |
325 | break; | |
326 | } | |
327 | fHistArray->AddLast(fHistTriggerContribs); | |
328 | ||
329 | } while (0); | |
330 | ||
331 | if (iResult<0) { | |
332 | // implement cleanup | |
333 | if (fRawReaderMem) delete fRawReaderMem; | |
334 | fRawReaderMem=NULL; | |
335 | ||
336 | if (fRawReaderTrd) delete fRawReaderTrd; | |
337 | fRawReaderTrd=NULL; | |
338 | ||
339 | if (fTrackletArray) delete fTrackletArray; | |
340 | fTrackletArray = NULL; | |
341 | ||
342 | if (fGtuTrackArray) delete fGtuTrackArray; | |
343 | fGtuTrackArray = NULL; | |
344 | ||
345 | if (fHistArray) delete fHistArray; | |
346 | fHistArray = NULL; | |
347 | ||
348 | fHistTrackletY = NULL; | |
349 | fHistTrackletDy = NULL; | |
350 | fHistTrackletZ = NULL; | |
351 | fHistTrackletPID = NULL; | |
352 | fHistTrackletYDy = NULL; | |
353 | fHistTrackletHC = NULL; | |
354 | fHistTrackletBadY = NULL; | |
355 | fHistTrackletBadPID = NULL; | |
356 | fHistTrackPt = NULL; | |
357 | fHistTrackStack = NULL; | |
358 | fHistFirstTrackletTime = NULL; | |
359 | fHistLastTrackletTime = NULL; | |
360 | fHistTmuTime = NULL; | |
361 | fHistSmuTime = NULL; | |
362 | fHistTrackPt = NULL; | |
363 | fHistTrackStack = NULL; | |
364 | fHistTrackletsTrack = NULL; | |
365 | fHistTrackletsTrackHpt = NULL; | |
366 | fHistTrackPID = NULL; | |
367 | fHistTriggerContribs = NULL; | |
368 | } | |
369 | ||
370 | return iResult; | |
371 | } | |
372 | ||
373 | int AliHLTTRDMonitorComponent::ScanConfigurationArgument(int /*argc*/, const char** /*argv*/) | |
374 | { | |
375 | // Scan configuration arguments | |
376 | // Return the number of processed arguments | |
377 | // -EPROTO if argument format error (e.g. number expected but not found) | |
378 | // | |
379 | // The AliHLTComponent base class implements a parsing loop for argument strings and | |
380 | // arrays of strings which is invoked by ConfigureFromArgumentString/ConfigureFromCDBTObjString | |
381 | // The component needs to implement ScanConfigurationArgument in order to decode the arguments. | |
382 | ||
383 | /* | |
384 | int i=0; | |
385 | TString argument=argv[i]; | |
386 | ||
387 | if (argument.IsNull()) return 0; | |
388 | ||
389 | // -mandatory1 arg | |
390 | if (argument.CompareTo("-mandatory1")==0) { | |
391 | if (++i>=argc) return -EINVAL; | |
392 | HLTInfo("got \'-mandatory1\' argument: %s", argv[i]); | |
393 | return 2; // keyword + 1 argument | |
394 | } | |
395 | ||
396 | // -optional1 arg | |
397 | if (argument.CompareTo("-optional1")==0) { | |
398 | if (++i>=argc) return -EINVAL; | |
399 | HLTInfo("got \'-optional1\' argument: %s", argv[i]); | |
400 | return 2; // keyword + 1 argument | |
401 | } | |
402 | ||
403 | // -verbose | |
404 | if (argument.CompareTo("-verbose")==0) { | |
405 | fVerbosity=1; | |
406 | return 1; // only keyword | |
407 | } | |
408 | */ | |
409 | return 0; | |
410 | } | |
411 | ||
412 | int AliHLTTRDMonitorComponent::DoDeinit() | |
413 | { | |
414 | // component cleanup, delete all instances of helper classes here | |
415 | if (fRawReaderMem) delete fRawReaderMem; | |
416 | fRawReaderMem=NULL; | |
417 | ||
418 | if (fRawReaderTrd) delete fRawReaderTrd; | |
419 | fRawReaderTrd=NULL; | |
420 | ||
421 | if (fTrackletArray) delete fTrackletArray; | |
422 | fTrackletArray = NULL; | |
423 | ||
424 | if (fGtuTrackArray) delete fGtuTrackArray; | |
425 | fGtuTrackArray = NULL; | |
426 | ||
427 | if (fHistArray) delete fHistArray; | |
428 | fHistArray = NULL; | |
429 | ||
430 | fHistTrackletY = NULL; | |
431 | fHistTrackletDy = NULL; | |
432 | fHistTrackletY = NULL; | |
433 | fHistTrackletDy = NULL; | |
434 | fHistTrackletZ = NULL; | |
435 | fHistTrackletPID = NULL; | |
436 | fHistTrackletHC = NULL; | |
437 | fHistTrackletBadY = NULL; | |
438 | fHistTrackletBadPID = NULL; | |
439 | fHistFirstTrackletTime = NULL; | |
440 | fHistLastTrackletTime = NULL; | |
441 | fHistTmuTime = NULL; | |
442 | fHistSmuTime = NULL; | |
443 | fHistTrackPt = NULL; | |
444 | fHistTrackStack = NULL; | |
445 | fHistTrackletsTrack = NULL; | |
446 | fHistTrackletsTrackHpt = NULL; | |
447 | fHistTrackPID = NULL; | |
448 | fHistTriggerContribs = NULL; | |
449 | ||
450 | return 0; | |
451 | } | |
452 | ||
453 | int AliHLTTRDMonitorComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, | |
454 | AliHLTComponentTriggerData& /*trigData*/) | |
455 | { | |
456 | // event processing function | |
457 | int iResult=0; | |
458 | ||
459 | // check if this is a data event, there are a couple of special events | |
460 | // which should be ignored for normal processing | |
461 | if (!IsDataEvent()) return 0; | |
462 | ||
463 | // #FIXME: Also take care of SOR, EOR, etc... | |
464 | ||
465 | // loop over the raw input data blocks and set up the rawreader | |
466 | for (const AliHLTComponentBlockData* pBlock = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD); | |
467 | pBlock!=NULL && iResult>=0; | |
468 | pBlock=GetNextInputBlock()) { | |
469 | // extract DDL id from specification | |
470 | int ddlnum=-1; | |
471 | for (unsigned pos=0; pos<8*sizeof(AliHLTUInt32_t); pos++) { | |
472 | if (pBlock->fSpecification & (0x1<<pos)) { | |
473 | if (ddlnum>=0) { | |
474 | // this is just an example, please avoid warnings in every event since those will | |
475 | // saturate the logging system. Consider AliHLTErrorGuard for such cases, e.g. | |
476 | // ALIHLTERRORGUARD(5, "nasty error, first occurence in event %d", event); | |
477 | // this will show the error 5 times and then a summary at the end | |
478 | HLTWarning("Can not uniquely identify DDL number from specification, skipping data block %s 0x%08x", | |
479 | DataType2Text(pBlock->fDataType).c_str(), | |
480 | pBlock->fSpecification); | |
481 | ddlnum=-1; | |
482 | break; | |
483 | } | |
484 | ddlnum=pos; | |
485 | } | |
486 | } | |
487 | if (ddlnum<0) continue; | |
488 | ddlnum += 1024; | |
489 | ||
490 | // add data block to rawreader | |
491 | if(!fRawReaderMem->AddBuffer((UChar_t*) pBlock->fPtr, pBlock->fSize, ddlnum)){ | |
492 | HLTError("Could not add buffer of data block %s, 0x%08x to rawreader", | |
493 | DataType2Text(pBlock->fDataType).c_str(), | |
494 | pBlock->fSpecification); | |
495 | continue; | |
496 | } | |
497 | ||
498 | // read and process TRD tracklet and GTU tracks from event | |
499 | fTrackletArray->Clear(); | |
500 | fGtuTrackArray->Clear(); | |
501 | fRawReaderTrd->ReadEvent(); | |
502 | ||
503 | // read and process tracking/trigger flags | |
504 | UInt_t iSector = ddlnum-1024; | |
505 | UInt_t trgflags = fRawReaderTrd->GetTriggerFlags(iSector); | |
506 | //UInt_t done_tmu = (trgflags >> 27) & 0x1f; | |
507 | //UInt_t done_smu = (trgflags >> 22) & 0x1f; | |
508 | Float_t smu_timing = ((trgflags >> 12) & 0x3ff) * 0.0083333; // tracking finished after L0, in us | |
509 | UInt_t ctb_fired = trgflags & 0xfff; | |
510 | ||
511 | /* | |
512 | printf("Trigger flags sector %02d: 0x%08x - ctb=0x%03x tmu-done=0x%x smu-done=0x%x smu-time: %.2fus\n", | |
513 | iSector, trgflags, | |
514 | ctb_fired, | |
515 | done_tmu, | |
516 | done_smu, | |
517 | smu_timing | |
518 | ); | |
519 | */ | |
520 | fHistSmuTime->Fill(smu_timing); | |
521 | ||
522 | for (int iCtb=0; iCtb<12; iCtb++){ | |
523 | if ((ctb_fired >> iCtb) & 1) | |
524 | fHistTriggerContribs->Fill(iSector, iCtb, 1); | |
525 | } | |
526 | ||
527 | Float_t first_tracklet_timing[5]={0}; | |
528 | Float_t last_tracklet_timing[5]={0}; | |
529 | Float_t tmu_timing[5]={0}; | |
530 | ULong64_t trkflags; | |
531 | ||
532 | for (int iStack=0; iStack<5; iStack++){ | |
533 | trkflags = fRawReaderTrd->GetTrkFlags(iSector, iStack); | |
534 | tmu_timing[iStack]=(trkflags & 0x3ff) * 0.02; | |
535 | first_tracklet_timing[iStack]=((trkflags >> 20) & 0x3ff) * 0.008; | |
536 | last_tracklet_timing[iStack]=((trkflags >> 10) & 0x3ff) * 0.008; | |
537 | /* | |
538 | printf(" Stack %02d_%d: 0x%016llx - first tracklet: %.2fus last tracklet: %.2fus tmu timing: %.2fus\n", | |
539 | iSector, iStack, trkflags, | |
540 | first_tracklet_timing[iStack], last_tracklet_timing[iStack], tmu_timing[iStack] | |
541 | ); | |
542 | */ | |
543 | fHistFirstTrackletTime->Fill(first_tracklet_timing[iStack]); | |
544 | fHistLastTrackletTime->Fill(last_tracklet_timing[iStack]); | |
545 | fHistTmuTime->Fill(tmu_timing[iStack]); | |
546 | } | |
547 | ||
548 | for (int iTracklet = 0; iTracklet < fTrackletArray->GetEntriesFast(); iTracklet++) { | |
549 | AliTRDtrackletWord *trackletWord = (AliTRDtrackletWord*) ((*fTrackletArray)[iTracklet]); | |
550 | AliESDTrdTracklet *tracklet = new AliESDTrdTracklet(trackletWord->GetTrackletWord(), trackletWord->GetHCId()); | |
551 | /* | |
552 | printf("TRDMSG: TRD tracklet found: 0x%08x - y=%+5d dy=%+3d pid=%3d\n", | |
553 | tracklet->GetTrackletWord(), | |
554 | tracklet->GetBinY(), | |
555 | tracklet->GetBinDy(), | |
556 | tracklet->GetPID()); | |
557 | */ | |
558 | // fill some basic histograms right here | |
559 | fHistTrackletY->Fill(tracklet->GetBinY()); | |
560 | fHistTrackletDy->Fill(tracklet->GetBinDy()); | |
561 | fHistTrackletZ->Fill(tracklet->GetBinZ()); | |
562 | fHistTrackletPID->Fill(tracklet->GetPID()); | |
563 | fHistTrackletYDy->Fill(tracklet->GetBinY(), tracklet->GetBinDy()); | |
564 | fHistTrackletHC->Fill(tracklet->GetHCId()/60, tracklet->GetHCId()%60); | |
565 | ||
566 | if (TMath::Abs(tracklet->GetBinY()) >= 3682) | |
567 | fHistTrackletBadY->Fill(tracklet->GetHCId()/60, (tracklet->GetHCId()%60)/12); | |
568 | ||
569 | if (tracklet->GetPID() < 40) | |
570 | fHistTrackletBadPID->Fill(tracklet->GetHCId()/60, (tracklet->GetHCId()%60)/12); | |
571 | ||
572 | } | |
573 | ||
574 | for (int iTrack = 0; iTrack < fGtuTrackArray->GetEntriesFast(); iTrack++) { | |
575 | AliESDTrdTrack *trdTrack = (AliESDTrdTrack*) ((*fGtuTrackArray)[iTrack]); | |
576 | /* | |
577 | printf("TRDMSG: GTU track found: 0x%016llx - Stack %02d_%d pt=%.3fGeV/c\n", | |
578 | trdTrack->GetTrackWord(0), | |
579 | trdTrack->GetSector(), trdTrack->GetStack(), | |
580 | trdTrack->Pt()); | |
581 | */ | |
582 | fHistTrackPt->Fill(trdTrack->Pt()); | |
583 | fHistTrackStack->Fill(trdTrack->GetSector(), trdTrack->GetStack()); | |
584 | fHistTrackPID->Fill(trdTrack->GetPID()); | |
585 | ||
586 | Int_t layers=0; | |
587 | Int_t layer_mask = trdTrack->GetLayerMask(); | |
588 | for (Int_t iLayer=0; iLayer<6; iLayer++) | |
589 | if ((layer_mask >> iLayer) & 1) | |
590 | layers++; | |
591 | fHistTrackletsTrack->Fill(layers); | |
592 | if (TMath::Abs(trdTrack->Pt()) >= 3.) | |
593 | fHistTrackletsTrackHpt->Fill(layers); | |
594 | } | |
595 | ||
596 | // do more complex processing here, preferably in a dedicated class | |
597 | ||
598 | // push TObject-based data to output | |
599 | iResult = PushBack(fHistArray, | |
600 | (kAliHLTDataTypeTObject | kAliHLTDataOriginTRD), | |
601 | pBlock->fSpecification); | |
602 | ||
79f07cf4 | 603 | if (iResult < 0) |
604 | break; | |
ce6fd1b1 | 605 | |
606 | // clear the rawreader | |
607 | fRawReaderMem->ClearBuffers(); | |
ce6fd1b1 | 608 | } |
609 | ||
610 | return iResult; | |
611 | } | |
612 | ||
613 | int AliHLTTRDMonitorComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) | |
614 | { | |
615 | // reconfigure the component from the specified CDB entry, or default CDB entry | |
616 | // function is invoked by the framework if a reconfigure command was received. | |
617 | // | |
618 | int iResult=0; | |
619 | /* | |
620 | TString cdbPath; | |
621 | if (cdbEntry) { | |
622 | cdbPath=cdbEntry; | |
623 | } else { | |
624 | cdbPath="HLT/ConfigSample/"; | |
625 | cdbPath+=GetComponentID(); | |
626 | } | |
627 | AliInfoClass(Form("reconfigure '%s' from entry %s%s", chainId, cdbPath.Data(), cdbEntry?"":" (default)")); | |
628 | iResult=ConfigureFromCDBTObjString(cdbPath); | |
629 | */ | |
630 | return iResult; | |
631 | } | |
632 | ||
633 | int AliHLTTRDMonitorComponent::ReadPreprocessorValues(const char* /*modules*/) | |
634 | { | |
635 | // read the preprocessor values for the detectors in the modules list | |
636 | // function is invoked by the framework if the pendolino indivates an update | |
637 | // of online calibration objects, e.g temperature and pressure measurements. | |
638 | int iResult=0; | |
639 | /* | |
640 | TString detectors(modules!=NULL?modules:""); | |
641 | AliInfoClass(Form("read preprocessor values for detector(s): %s", detectors.IsNull()?"none":detectors.Data())); | |
642 | */ | |
643 | return iResult; | |
644 | } |