Do not make event-path absolute unless it is specifying a local file/directory.
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveEventManager.cxx
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
5a5a1232 3
d810d0de 4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
9
10#include "AliEveEventManager.h"
84aff7a4 11#include <TEveManager.h>
5a5a1232 12
13#include <AliRunLoader.h>
93845f6c 14#include <AliRun.h>
af885e0f 15#include <AliESDEvent.h>
3aecaefc 16#include <AliESDfriend.h>
c2c4b7a2 17#include <AliRawReaderRoot.h>
18#include <AliRawReaderFile.h>
19#include <AliRawReaderDate.h>
93845f6c 20#include <AliMagFMaps.h>
632d2b03 21#include <AliCDBManager.h>
22#include <AliHeader.h>
23#include <AliGeomManager.h>
5a5a1232 24
25#include <TFile.h>
26#include <TTree.h>
fbc350a3 27#include <TGeoManager.h>
5a5a1232 28#include <TSystem.h>
d810d0de 29
a15e6d7d 30//==============================================================================
31//==============================================================================
32// AliEveEventManager
33//==============================================================================
5a5a1232 34
57ffa5fb 35//______________________________________________________________________________
5a5a1232 36//
4852ff6f 37// Provide interface for loading and navigating standard AliRoot data
38// (AliRunLoader) and ESDs.
39//
40// Missing support for raw-data. For now this is handled individually
41// by each sub-detector.
51346b82 42//
a15e6d7d 43// Also provides interface to magnetic-field and geometry. Mostly
44// intended as wrappers over standard AliRoot functionality for
45// convenient use from visualizateion macros.
5a5a1232 46
d810d0de 47ClassImp(AliEveEventManager)
5a5a1232 48
a15e6d7d 49AliEveEventManager* gAliEveEvent = 0;
5a5a1232 50
d810d0de 51Bool_t AliEveEventManager::fgAssertRunLoader = kFALSE;
c76ea574 52Bool_t AliEveEventManager::fgAssertESD = kFALSE;
c2c4b7a2 53Bool_t AliEveEventManager::fgAssertRaw = kFALSE;
5a5a1232 54
c2c4b7a2 55TString AliEveEventManager::fgESDFileName("AliESDs.root");
56TString AliEveEventManager::fgRawFileName("raw.root");
d810d0de 57TString AliEveEventManager::fgCdbUri("local://$ALICE_ROOT");
632d2b03 58
d810d0de 59AliMagF* AliEveEventManager::fgMagField = 0;
93845f6c 60
61
d810d0de 62AliEveEventManager::AliEveEventManager() :
84aff7a4 63 TEveEventManager(),
265ecb21 64
c2c4b7a2 65 fPath ( ), fEventId (-1),
265ecb21 66 fRunLoader (0),
90fa773e 67 fESDFile (0), fESDTree (0), fESD (0),
c2c4b7a2 68 fESDfriend (0), fESDfriendExists(kFALSE),
319f3084 69 fRawReader (0),
70 fAutoLoad(kFALSE),
71 fAutoLoadTime(5.),
72 fAutoLoadTimer(0),
73 fIsOnline(kFALSE)
c76ea574 74{
75 // Default constructor.
76}
5a5a1232 77
d810d0de 78AliEveEventManager::AliEveEventManager(TString path, Int_t ev) :
79 TEveEventManager("AliEVE AliEveEventManager"),
265ecb21 80
c76ea574 81 fPath (path), fEventId(-1),
265ecb21 82 fRunLoader (0),
90fa773e 83 fESDFile (0), fESDTree (0), fESD (0),
c2c4b7a2 84 fESDfriend (0), fESDfriendExists(kFALSE),
319f3084 85 fRawReader (0),
86 fAutoLoad(kFALSE),
87 fAutoLoadTime(5.),
88 fAutoLoadTimer(0),
89 fIsOnline(kFALSE)
5a5a1232 90{
c76ea574 91 // Constructor with event-directory URL and event-id.
92
5a5a1232 93 Open();
90fa773e 94 if (ev >= 0) GotoEvent(ev);
5a5a1232 95}
96
a15e6d7d 97AliEveEventManager::~AliEveEventManager()
98{
99 // Destructor.
100
319f3084 101 if (fAutoLoadTimer) delete fAutoLoadTimer;
a15e6d7d 102 // Somewhat unclear what to do here.
103 // In principle should close all data sources and deregister from
104 // TEveManager.
105}
106
57ffa5fb 107/******************************************************************************/
5a5a1232 108
c2c4b7a2 109void AliEveEventManager::SetESDFileName(const Text_t* esd)
110{
111 // Set file-name for opening ESD, default "AliESDs.root".
112
113 if (esd) fgESDFileName = esd;
114}
115
116void AliEveEventManager::SetRawFileName(const Text_t* raw)
117{
118 // Set file-name for opening of raw-data, default "raw.root"
119 if (raw) fgRawFileName = raw;
120}
121
122void AliEveEventManager::SetCdbUri(const Text_t* cdb)
123{
124 // Set path to CDB, default "local://$ALICE_ROOT".
125
126 if (cdb) fgCdbUri = cdb;
127}
128
129void AliEveEventManager::SetAssertElements(Bool_t assertRunloader,
130 Bool_t assertEsd,
131 Bool_t assertRaw)
132{
133 // Set global flags that detrmine which parts of the event-data must
134 // be present when the event is opened.
135
136 fgAssertRunLoader = assertRunloader;
137 fgAssertESD = assertEsd;
138 fgAssertRaw = assertRaw;
139}
140
141/******************************************************************************/
142
d810d0de 143void AliEveEventManager::Open()
5a5a1232 144{
c76ea574 145 // Open event-data from URL specified in fPath.
146 // Attempts to create AliRunLoader() and to open ESD with ESDfriends.
147 // Warning is reported if run-loader or ESD is not found.
148 // Global data-members fgAssertRunLoader and fgAssertESD can be set
149 // to throw exceptions instead.
150
a15e6d7d 151 static const TEveException kEH("AliEveEventManager::Open ");
5a5a1232 152
153 gSystem->ExpandPathName(fPath);
5a58dc18 154 // The following magick is required for ESDriends to be loaded properly
155 // from non-current directory.
156 if (fPath.IsNull() || fPath == ".")
157 {
158 fPath = gSystem->WorkingDirectory();
159 }
160 else if ( ! fPath.BeginsWith("file:/"))
161 {
162 TUrl url(fPath, kTRUE);
163 TString protocol(url.GetProtocol());
164 if (protocol == "file" && fPath[0] != '/')
165 fPath = Form("%s/%s", gSystem->WorkingDirectory(), fPath.Data());
166 }
5a5a1232 167
632d2b03 168 Int_t runNo = -1;
169
a15e6d7d 170 TString gaPath(Form("%s/galice.root", fPath.Data()));
c2c4b7a2 171 // If i use open directly, we get fatal.
172 // Is this (AccessPathName check) ok for xrootd / alien?
a15e6d7d 173 if (gSystem->AccessPathName(gaPath, kReadPermission) == kFALSE)
90fa773e 174 {
a15e6d7d 175 fRunLoader = AliRunLoader::Open(gaPath);
a1896a82 176 if (fRunLoader)
5a5a1232 177 {
a15e6d7d 178 TString alicePath = fPath + "/";
179 fRunLoader->SetDirName(alicePath);
a1896a82 180
181 if (fRunLoader->LoadgAlice() != 0)
c2c4b7a2 182 Warning(kEH, "failed loading gAlice via run-loader.");
a1896a82 183
184 if (fRunLoader->LoadHeader() == 0)
185 {
c2c4b7a2 186 runNo = fRunLoader->GetHeader()->GetRun();
a1896a82 187 }
188 else
189 {
c2c4b7a2 190 Warning(kEH, "failed loading run-loader's header.");
191 delete fRunLoader;
192 fRunLoader = 0;
a1896a82 193 }
194 }
195 else // run-loader open failed
196 {
a15e6d7d 197 Warning(kEH, "failed opening ALICE run-loader from '%s'.", gaPath.Data());
5a5a1232 198 }
5a5a1232 199 }
a1896a82 200 else // galice not readable
201 {
a15e6d7d 202 Warning(kEH, "can not read '%s'.", gaPath.Data());
a1896a82 203 }
204 if (fRunLoader == 0)
205 {
84aff7a4 206 if (fgAssertRunLoader)
c2c4b7a2 207 throw (kEH + "Bootstraping of run-loader failed. Its precence was requested.");
a1896a82 208 else
a15e6d7d 209 Warning(kEH, "Bootstraping of run-loader failed.");
a1896a82 210 }
51346b82 211
5a5a1232 212
c2c4b7a2 213 TString esdPath(Form("%s/%s", fPath.Data(), fgESDFileName.Data()));
214 if ((fESDFile = TFile::Open(esdPath)))
90fa773e 215 {
c2c4b7a2 216 fESD = new AliESDEvent();
217 fESDTree = (TTree*) fESDFile->Get("esdTree");
218 if (fESDTree != 0)
90fa773e 219 {
c2c4b7a2 220 fESD->ReadFromTree(fESDTree);
e8974bc9 221 fESDTree->GetEntry(0);
c2c4b7a2 222 runNo = fESD->GetESDRun()->GetRunNumber();
223
224 // Check if ESDfriends exists and attach the branch
5a58dc18 225 TString p(Form("%s/AliESDfriends.root", fPath.Data()));
c2c4b7a2 226 if (gSystem->AccessPathName(p, kReadPermission) == kFALSE)
a1896a82 227 {
c2c4b7a2 228 fESDfriendExists = kTRUE;
229 fESDTree->SetBranchStatus ("ESDfriend*", 1);
230 fESDTree->SetBranchAddress("ESDfriend.", &fESDfriend);
753fdd1e 231 }
232 }
c2c4b7a2 233 else // esdtree == 0
a1896a82 234 {
5a5a1232 235 delete fESDFile; fESDFile = 0;
c2c4b7a2 236 Warning(kEH, "failed getting the esdTree.");
5a5a1232 237 }
a1896a82 238 }
239 else // esd not readable
240 {
a15e6d7d 241 Warning(kEH, "can not read ESD file '%s'.", esdPath.Data());
a1896a82 242 }
243 if (fESDTree == 0)
244 {
c76ea574 245 if (fgAssertESD)
90fa773e 246 {
c2c4b7a2 247 throw (kEH + "ESD not initialized. Its precence was requested.");
51346b82 248 } else {
a15e6d7d 249 Warning(kEH, "ESD not initialized.");
3aecaefc 250 }
5a5a1232 251 }
252
c2c4b7a2 253 TString rawPath(Form("%s/%s", fPath.Data(), fgRawFileName.Data()));
254 // If i use open directly, raw-reader reports an error but i have
255 // no way to detect it.
256 // Is this (AccessPathName check) ok for xrootd / alien?
257 if (gSystem->AccessPathName(rawPath, kReadPermission) == kFALSE)
258 {
259 if (fgRawFileName.EndsWith("/"))
260 {
261 fRawReader = new AliRawReaderFile(rawPath);
262 }
263 else if (fgRawFileName.EndsWith(".root"))
264 {
265 fRawReader = new AliRawReaderRoot(rawPath);
266 }
267 else if (!fgRawFileName.IsNull())
268 {
269 fRawReader = new AliRawReaderDate(rawPath);
270 }
271 }
272
273 if (fRawReader == 0)
274 {
275 if (fgAssertRaw)
276 {
277 throw (kEH + "raw-data not initialized. Its precence was requested.");
278 } else {
279 Warning(kEH, "raw-data not initialized.");
280 }
281 }
282
632d2b03 283 if (runNo < 0)
c2c4b7a2 284 {
285 if (fRawReader)
286 {
287 fRawReader->NextEvent();
288 runNo = fRawReader->GetRunNumber();
289 printf("Determining run-no from raw ... run=%d\n", runNo);
290 fRawReader->RewindEvents();
291 } else {
292 throw (kEH + "unknown run number.");
293 }
294 }
632d2b03 295
296 {
297 AliCDBManager* cdb = AliCDBManager::Instance();
298 cdb->SetDefaultStorage(fgCdbUri);
299 if (cdb->IsDefaultStorageSet() == kFALSE)
c2c4b7a2 300 throw (kEH + "CDB initialization failed.");
632d2b03 301 cdb->SetRun(runNo);
302 }
303
73c1c0ec 304 SetName(Form("Event %d", fEventId));
5a5a1232 305 SetTitle(fPath);
306}
307
319f3084 308void AliEveEventManager::SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd)
309{
310 // Set an event from an external source
311 // The method is used in the online visualisation
312 fRunLoader = runLoader;
313 fRawReader = rawReader;
314 fESD = esd;
315 fIsOnline = kTRUE;
316 SetTitle("Online event in memory");
317 SetName("Online Event");
318
319 ElementChanged();
320 AfterNewEventLoaded();
321}
322
d810d0de 323void AliEveEventManager::GotoEvent(Int_t event)
1eaa5849 324{
73c1c0ec 325 // Load data for specified event.
326 // If event is out of range an exception is thrown and old state
327 // is preserved.
328 // After successful loading of event, the virtual function
329 // AfterNewEventLoaded() is called. This executes commands that
330 // were registered via TEveEventManager::AddNewEventCommand().
331
a15e6d7d 332 static const TEveException kEH("AliEveEventManager::GotoEvent ");
1eaa5849 333
c2c4b7a2 334 if (event < 0) {
335 Error(kEH, "event must be non-negative.");
336 return;
337 }
338
1eaa5849 339 Int_t maxEvent = 0;
c2c4b7a2 340 if (fRunLoader) {
1eaa5849 341 maxEvent = fRunLoader->GetNumberOfEvents() - 1;
c2c4b7a2 342 } else if (fESDTree) {
1eaa5849 343 maxEvent = fESDTree->GetEntries() - 1;
c2c4b7a2 344 } else if (fRawReader) {
345 maxEvent = 10000000;
346 Info(kEH, "number of events unknown for raw-data, setting max-event id to 10M.");
347 } else {
348 throw (kEH + "neither RunLoader, ESD nor Raw loaded.");
349 }
84aff7a4 350 if (event < 0 || event > maxEvent)
c2c4b7a2 351 throw (kEH + Form("event %d not present, available range [%d, %d].",
352 event, 0, maxEvent));
1eaa5849 353
84aff7a4 354 TEveManager::TRedrawDisabler rd(gEve);
355 gEve->Redraw3D(kFALSE, kTRUE); // Enforce drop of all logicals.
d9e0d6c5 356
32e219c2 357 // !!! MT this is somewhat brutal; at least optionally, one could be
358 // a bit gentler, checking for objs owning their external refs and having
359 // additinal parents.
1eaa5849 360 DestroyElements();
1eaa5849 361
84aff7a4 362 if (fRunLoader) {
c2c4b7a2 363 if (fRunLoader->GetEvent(event) != 0)
364 throw (kEH + "failed getting required event.");
1eaa5849 365 }
366
84aff7a4 367 if (fESDTree) {
c2c4b7a2 368 if (fESDTree->GetEntry(event) <= 0)
369 throw (kEH + "failed getting required event from ESD.");
1eaa5849 370
2cea771a 371 if (fESDfriendExists)
1eaa5849 372 fESD->SetESDfriend(fESDfriend);
1eaa5849 373 }
90fa773e 374
c2c4b7a2 375 if (fRawReader)
376 {
377 Int_t rawEv = fEventId;
378 if (event < rawEv)
379 {
380 fRawReader->RewindEvents();
381 rawEv = -1;
382 }
383
384 while (rawEv < event)
385 {
386 if ( ! fRawReader->NextEvent())
387 {
388 fRawReader->RewindEvents();
389 fEventId = -1;
390 throw (kEH + Form("Error going to next raw-event from event %d.", rawEv));
391 }
392 ++rawEv;
393 }
394
395 printf ("Loaded raw-event %d.\n", rawEv);
396 }
397
398 fEventId = event;
399 SetName(Form("Event %d", fEventId));
319f3084 400 ElementChanged();
c2c4b7a2 401
90fa773e 402 AfterNewEventLoaded();
1eaa5849 403}
404
d810d0de 405void AliEveEventManager::Close()
5a5a1232 406{
73c1c0ec 407 // Close the event files.
408 // For the moment only ESD is closed. Needs to be investigated for
409 // AliRunLoader and Raw.
410
2cea771a 411 if (fESDTree) {
412 delete fESD; fESD = 0;
413 delete fESDfriend; fESDfriend = 0;
414
415 delete fESDTree; fESDTree = 0;
416 delete fESDFile; fESDFile = 0;
417 }
5a5a1232 418}
419
90fa773e 420
57ffa5fb 421/******************************************************************************/
c76ea574 422// Static convenience functions, mainly used from macros.
57ffa5fb 423/******************************************************************************/
5a5a1232 424
d810d0de 425AliRunLoader* AliEveEventManager::AssertRunLoader()
5a5a1232 426{
73c1c0ec 427 // Make sure AliRunLoader is initialized and return it.
428 // Throws exception in case run-loader is not available.
429 // Static utility for macros.
430
a15e6d7d 431 static const TEveException kEH("AliEveEventManager::AssertRunLoader ");
5a5a1232 432
a15e6d7d 433 if (gAliEveEvent == 0)
c2c4b7a2 434 throw (kEH + "ALICE event not ready.");
a15e6d7d 435 if (gAliEveEvent->fRunLoader == 0)
c2c4b7a2 436 throw (kEH + "AliRunLoader not initialised.");
a15e6d7d 437 return gAliEveEvent->fRunLoader;
5a5a1232 438}
439
d810d0de 440AliESDEvent* AliEveEventManager::AssertESD()
5a5a1232 441{
73c1c0ec 442 // Make sure AliESDEvent is initialized and return it.
443 // Throws exception in case ESD is not available.
444 // Static utility for macros.
445
a15e6d7d 446 static const TEveException kEH("AliEveEventManager::AssertESD ");
5a5a1232 447
a15e6d7d 448 if (gAliEveEvent == 0)
c2c4b7a2 449 throw (kEH + "ALICE event not ready.");
a15e6d7d 450 if (gAliEveEvent->fESD == 0)
c2c4b7a2 451 throw (kEH + "AliESD not initialised.");
a15e6d7d 452 return gAliEveEvent->fESD;
5a5a1232 453}
3aecaefc 454
d810d0de 455AliESDfriend* AliEveEventManager::AssertESDfriend()
3aecaefc 456{
73c1c0ec 457 // Make sure AliESDfriend is initialized and return it.
458 // Throws exception in case ESDfriend-loader is not available.
459 // Static utility for macros.
460
a15e6d7d 461 static const TEveException kEH("AliEveEventManager::AssertESDfriend ");
3aecaefc 462
a15e6d7d 463 if (gAliEveEvent == 0)
c2c4b7a2 464 throw (kEH + "ALICE event not ready.");
a15e6d7d 465 if (gAliEveEvent->fESDfriend == 0)
c2c4b7a2 466 throw (kEH + "AliESDfriend not initialised.");
a15e6d7d 467 return gAliEveEvent->fESDfriend;
3aecaefc 468}
93845f6c 469
c2c4b7a2 470AliRawReader* AliEveEventManager::AssertRawReader()
471{
472 // Make sure raw-reader is initialized and return it.
473
474 static const TEveException kEH("AliEveEventManager::AssertRawReader ");
475
476 if (gAliEveEvent == 0)
477 throw (kEH + "ALICE event not ready.");
478 if (gAliEveEvent->fRawReader == 0)
479 throw (kEH + "RawReader not ready.");
480
481 return gAliEveEvent->fRawReader;
482}
483
d810d0de 484AliMagF* AliEveEventManager::AssertMagField()
93845f6c 485{
73c1c0ec 486 // Make sure AliMagF is initialized and return it.
487 // Throws exception in case magnetic field is not available.
488 // Static utility for macros.
489
93845f6c 490 if (fgMagField == 0)
491 {
a15e6d7d 492 if (gAliEveEvent && gAliEveEvent->fRunLoader && gAliEveEvent->fRunLoader->GetAliRun())
493 fgMagField = gAliEveEvent->fRunLoader->GetAliRun()->Field();
93845f6c 494 else
495 fgMagField = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
496 }
497 return fgMagField;
498}
632d2b03 499
d810d0de 500TGeoManager* AliEveEventManager::AssertGeometry()
632d2b03 501{
73c1c0ec 502 // Make sure AliGeomManager is initialized and returns the
503 // corresponding TGeoManger.
647814a2 504 // gGeoManager is set to the return value.
505 // Throws exception if geometry can not be loaded or if it is not
506 // available and the TGeoManager is locked.
73c1c0ec 507 // Static utility for macros.
508
a15e6d7d 509 static const TEveException kEH("AliEveEventManager::AssertGeometry ");
632d2b03 510
511 if (AliGeomManager::GetGeometry() == 0)
512 {
647814a2 513 if (TGeoManager::IsLocked())
514 throw (kEH + "geometry is not loaded but TGeoManager is locked.");
515
af2e4ef5 516 gGeoManager = 0;
632d2b03 517 AliGeomManager::LoadGeometry();
518 if ( ! AliGeomManager::GetGeometry())
519 {
c2c4b7a2 520 throw (kEH + "can not load geometry.");
632d2b03 521 }
522 if ( ! AliGeomManager::ApplyAlignObjsFromCDB("ITS TPC TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO ACORDE"))
523 {
a15e6d7d 524 ::Warning(kEH, "mismatch of alignable volumes. Proceeding.");
c2c4b7a2 525 // throw (kEH + "could not apply align objs.");
632d2b03 526 }
81515106 527 AliGeomManager::GetGeometry()->DefaultColors();
632d2b03 528 }
529
647814a2 530 gGeoManager = AliGeomManager::GetGeometry();
531 return gGeoManager;
632d2b03 532}
319f3084 533
534void AliEveEventManager::SetAutoLoad(Bool_t autoLoad)
535{
536 // Set the automatic event loading mode
537 fAutoLoad = autoLoad;
538 StartStopAutoLoadTimer();
539}
540
541void AliEveEventManager::SetAutoLoadTime(Double_t time)
542{
543 // Set the auto-load time in seconds
544 fAutoLoadTime = time;
545 StartStopAutoLoadTimer();
546}
547
548void AliEveEventManager::StartStopAutoLoadTimer()
549{
550 // Create if needed and start
551 // the automatic event loading timer
552 if (fAutoLoad) {
553 if (!fAutoLoadTimer) {
554 fAutoLoadTimer = new TTimer;
555 fAutoLoadTimer->Connect("Timeout()","AliEveEventManager",this,"NextEvent()");
556 }
557 fAutoLoadTimer->Start((Long_t)fAutoLoadTime*1000,kTRUE);
558 }
559 else {
560 if (fAutoLoadTimer) fAutoLoadTimer->Stop();
561 }
562}
563
564void AliEveEventManager::PrevEvent()
565{
566 // Loads previous event
567 // only in case of manual mode
568 if (!fIsOnline) {
569 GotoEvent(fEventId - 1);
570 StartStopAutoLoadTimer();
571 }
572}
573
574void AliEveEventManager::NextEvent()
575{
576 // Loads next event
577 // either in automatic (online) or
578 // manual mode
579
580 if (fIsOnline) {
581 if (fAutoLoadTimer) fAutoLoadTimer->Stop();
582
583 DestroyElements();
584
585 gSystem->ExitLoop();
586 }
587 else {
588 GotoEvent(fEventId + 1);
589 StartStopAutoLoadTimer();
590 }
591}
592
593const char* AliEveEventManager::GetEventInfo() const
594{
595 // Dumps the event-header contents
596
597 static TString eventInfo;
598
599 if (!fRawReader) return "No event information is available";
600
601 const UInt_t* id = fRawReader->GetEventId();
602 const UInt_t* pattern = fRawReader->GetTriggerPattern();
603 const UInt_t* attr = fRawReader->GetAttributes();
604 eventInfo.Form("Run#: %d\nEvent type: %d\nPeriod: %x\nOrbit: %x\nBC: %x\nTrigger: %x-%x\nDetectors: %x\nAttributes:%x-%x-%x",
605 fRawReader->GetRunNumber(),fRawReader->GetType(),
606 (((id)[0]>>4)&0x0fffffff),((((id)[0]<<20)&0xf00000)|(((id)[1]>>12)&0xfffff)),((id)[1]&0x00000fff),
607 pattern[0],pattern[1],
608 *fRawReader->GetDetectorPattern(),
609 attr[0],attr[1],attr[2]);
610
611 return eventInfo.Data();
612}
613