#include <AliRun.h>
#include <AliESDEvent.h>
#include <AliESDfriend.h>
+#include <AliRawReaderRoot.h>
+#include <AliRawReaderFile.h>
+#include <AliRawReaderDate.h>
#include <AliMagFMaps.h>
#include <AliCDBManager.h>
#include <AliHeader.h>
Bool_t AliEveEventManager::fgAssertRunLoader = kFALSE;
Bool_t AliEveEventManager::fgAssertESD = kFALSE;
+Bool_t AliEveEventManager::fgAssertRaw = kFALSE;
+TString AliEveEventManager::fgESDFileName("AliESDs.root");
+TString AliEveEventManager::fgRawFileName("raw.root");
TString AliEveEventManager::fgCdbUri("local://$ALICE_ROOT");
AliMagF* AliEveEventManager::fgMagField = 0;
AliEveEventManager::AliEveEventManager() :
TEveEventManager(),
- fPath (), fEventId (0),
+ fPath ( ), fEventId (-1),
fRunLoader (0),
fESDFile (0), fESDTree (0), fESD (0),
- fESDfriend (0), fESDfriendExists(kFALSE)
+ fESDfriend (0), fESDfriendExists(kFALSE),
+ fRawReader (0)
{
// Default constructor.
}
fPath (path), fEventId(-1),
fRunLoader (0),
fESDFile (0), fESDTree (0), fESD (0),
- fESDfriend (0), fESDfriendExists(kFALSE)
+ fESDfriend (0), fESDfriendExists(kFALSE),
+ fRawReader (0)
{
// Constructor with event-directory URL and event-id.
/******************************************************************************/
+void AliEveEventManager::SetESDFileName(const Text_t* esd)
+{
+ // Set file-name for opening ESD, default "AliESDs.root".
+
+ if (esd) fgESDFileName = esd;
+}
+
+void AliEveEventManager::SetRawFileName(const Text_t* raw)
+{
+ // Set file-name for opening of raw-data, default "raw.root"
+ if (raw) fgRawFileName = raw;
+}
+
+void AliEveEventManager::SetCdbUri(const Text_t* cdb)
+{
+ // Set path to CDB, default "local://$ALICE_ROOT".
+
+ if (cdb) fgCdbUri = cdb;
+}
+
+void AliEveEventManager::SetAssertElements(Bool_t assertRunloader,
+ Bool_t assertEsd,
+ Bool_t assertRaw)
+{
+ // Set global flags that detrmine which parts of the event-data must
+ // be present when the event is opened.
+
+ fgAssertRunLoader = assertRunloader;
+ fgAssertESD = assertEsd;
+ fgAssertRaw = assertRaw;
+}
+
+/******************************************************************************/
+
void AliEveEventManager::Open()
{
// Open event-data from URL specified in fPath.
Int_t runNo = -1;
TString gaPath(Form("%s/galice.root", fPath.Data()));
+ // If i use open directly, we get fatal.
+ // Is this (AccessPathName check) ok for xrootd / alien?
if (gSystem->AccessPathName(gaPath, kReadPermission) == kFALSE)
{
fRunLoader = AliRunLoader::Open(gaPath);
fRunLoader->SetDirName(alicePath);
if (fRunLoader->LoadgAlice() != 0)
- Warning(kEH, "failed loading gAlice via run-loader.");
+ Warning(kEH, "failed loading gAlice via run-loader.");
if (fRunLoader->LoadHeader() == 0)
{
- runNo = fRunLoader->GetHeader()->GetRun();
+ runNo = fRunLoader->GetHeader()->GetRun();
}
else
{
- Warning(kEH, "failed loading run-loader's header.");
- delete fRunLoader;
- fRunLoader = 0;
+ Warning(kEH, "failed loading run-loader's header.");
+ delete fRunLoader;
+ fRunLoader = 0;
}
}
else // run-loader open failed
if (fRunLoader == 0)
{
if (fgAssertRunLoader)
- throw(kEH + "Bootstraping of run-loader failed. Its precence was requested.");
+ throw (kEH + "Bootstraping of run-loader failed. Its precence was requested.");
else
Warning(kEH, "Bootstraping of run-loader failed.");
}
- TString esdPath(Form("%s/AliESDs.root", fPath.Data()));
- if (gSystem->AccessPathName(esdPath, kReadPermission) == kFALSE)
+ TString esdPath(Form("%s/%s", fPath.Data(), fgESDFileName.Data()));
+ if ((fESDFile = TFile::Open(esdPath)))
{
- fESDFile = new TFile(esdPath);
- if (fESDFile->IsZombie() == kFALSE)
+ fESD = new AliESDEvent();
+ fESDTree = (TTree*) fESDFile->Get("esdTree");
+ if (fESDTree != 0)
{
- fESD = new AliESDEvent();
- fESDTree = (TTree*) fESDFile->Get("esdTree");
- if (fESDTree != 0)
- {
- fESD->ReadFromTree(fESDTree);
- runNo = fESD->GetESDRun()->GetRunNumber();
-
- // Check if ESDfriends exists and attach the branch
- TString p = Form("%s/AliESDfriends.root", fPath.Data());
- if (gSystem->AccessPathName(p, kReadPermission) == kFALSE)
- {
- fESDfriendExists = kTRUE;
- fESDTree->SetBranchStatus ("ESDfriend*", 1);
- fESDTree->SetBranchAddress("ESDfriend.", &fESDfriend);
- }
- }
- else // esdtree == 0
+ fESD->ReadFromTree(fESDTree);
+ runNo = fESD->GetESDRun()->GetRunNumber();
+
+ // Check if ESDfriends exists and attach the branch
+ TString p = Form("%s/AliESDfriends.root", fPath.Data());
+ if (gSystem->AccessPathName(p, kReadPermission) == kFALSE)
{
- delete fESDFile; fESDFile = 0;
- Warning(kEH, "failed getting the esdTree.");
+ fESDfriendExists = kTRUE;
+ fESDTree->SetBranchStatus ("ESDfriend*", 1);
+ fESDTree->SetBranchAddress("ESDfriend.", &fESDfriend);
}
}
- else // esd tfile is zombie
+ else // esdtree == 0
{
delete fESDFile; fESDFile = 0;
- Warning(kEH, "failed opening ESD from '%s'.", esdPath.Data());
+ Warning(kEH, "failed getting the esdTree.");
}
}
else // esd not readable
{
if (fgAssertESD)
{
- throw(kEH + "ESD not initialized. Its precence was requested.");
+ throw (kEH + "ESD not initialized. Its precence was requested.");
} else {
Warning(kEH, "ESD not initialized.");
}
}
+ TString rawPath(Form("%s/%s", fPath.Data(), fgRawFileName.Data()));
+ // If i use open directly, raw-reader reports an error but i have
+ // no way to detect it.
+ // Is this (AccessPathName check) ok for xrootd / alien?
+ if (gSystem->AccessPathName(rawPath, kReadPermission) == kFALSE)
+ {
+ if (fgRawFileName.EndsWith("/"))
+ {
+ fRawReader = new AliRawReaderFile(rawPath);
+ }
+ else if (fgRawFileName.EndsWith(".root"))
+ {
+ fRawReader = new AliRawReaderRoot(rawPath);
+ }
+ else if (!fgRawFileName.IsNull())
+ {
+ fRawReader = new AliRawReaderDate(rawPath);
+ }
+ }
+
+ if (fRawReader == 0)
+ {
+ if (fgAssertRaw)
+ {
+ throw (kEH + "raw-data not initialized. Its precence was requested.");
+ } else {
+ Warning(kEH, "raw-data not initialized.");
+ }
+ }
+
if (runNo < 0)
- throw(kEH + "invalid run number.");
+ {
+ if (fRawReader)
+ {
+ fRawReader->NextEvent();
+ runNo = fRawReader->GetRunNumber();
+ printf("Determining run-no from raw ... run=%d\n", runNo);
+ fRawReader->RewindEvents();
+ } else {
+ throw (kEH + "unknown run number.");
+ }
+ }
{
AliCDBManager* cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(fgCdbUri);
if (cdb->IsDefaultStorageSet() == kFALSE)
- throw(kEH + "CDB initialization failed.");
+ throw (kEH + "CDB initialization failed.");
cdb->SetRun(runNo);
}
static const TEveException kEH("AliEveEventManager::GotoEvent ");
+ if (event < 0) {
+ Error(kEH, "event must be non-negative.");
+ return;
+ }
+
Int_t maxEvent = 0;
- if (fRunLoader)
+ if (fRunLoader) {
maxEvent = fRunLoader->GetNumberOfEvents() - 1;
- else if (fESDTree)
+ } else if (fESDTree) {
maxEvent = fESDTree->GetEntries() - 1;
- else
- throw(kEH + "neither RunLoader nor ESD loaded.");
-
+ } else if (fRawReader) {
+ maxEvent = 10000000;
+ Info(kEH, "number of events unknown for raw-data, setting max-event id to 10M.");
+ } else {
+ throw (kEH + "neither RunLoader, ESD nor Raw loaded.");
+ }
if (event < 0 || event > maxEvent)
- throw(kEH + Form("event %d not present, available range [%d, %d].",
- event, 0, maxEvent));
+ throw (kEH + Form("event %d not present, available range [%d, %d].",
+ event, 0, maxEvent));
TEveManager::TRedrawDisabler rd(gEve);
gEve->Redraw3D(kFALSE, kTRUE); // Enforce drop of all logicals.
// a bit gentler, checking for objs owning their external refs and having
// additinal parents.
DestroyElements();
- fEventId = event;
- SetName(Form("Event %d", fEventId));
- UpdateItems();
if (fRunLoader) {
- if (fRunLoader->GetEvent(fEventId) != 0)
- throw(kEH + "failed getting required event.");
+ if (fRunLoader->GetEvent(event) != 0)
+ throw (kEH + "failed getting required event.");
}
if (fESDTree) {
- if (fESDTree->GetEntry(fEventId) <= 0)
- throw(kEH + "failed getting required event from ESD.");
+ if (fESDTree->GetEntry(event) <= 0)
+ throw (kEH + "failed getting required event from ESD.");
if (fESDfriendExists)
fESD->SetESDfriend(fESDfriend);
}
+ if (fRawReader)
+ {
+ Int_t rawEv = fEventId;
+ if (event < rawEv)
+ {
+ fRawReader->RewindEvents();
+ rawEv = -1;
+ }
+
+ while (rawEv < event)
+ {
+ if ( ! fRawReader->NextEvent())
+ {
+ fRawReader->RewindEvents();
+ fEventId = -1;
+ throw (kEH + Form("Error going to next raw-event from event %d.", rawEv));
+ }
+ ++rawEv;
+ }
+
+ printf ("Loaded raw-event %d.\n", rawEv);
+ }
+
+ fEventId = event;
+ SetName(Form("Event %d", fEventId));
+ UpdateItems();
+
AfterNewEventLoaded();
}
static const TEveException kEH("AliEveEventManager::AssertRunLoader ");
if (gAliEveEvent == 0)
- throw(kEH + "ALICE event not ready.");
+ throw (kEH + "ALICE event not ready.");
if (gAliEveEvent->fRunLoader == 0)
- throw(kEH + "AliRunLoader not initialised.");
+ throw (kEH + "AliRunLoader not initialised.");
return gAliEveEvent->fRunLoader;
}
static const TEveException kEH("AliEveEventManager::AssertESD ");
if (gAliEveEvent == 0)
- throw(kEH + "ALICE event not ready.");
+ throw (kEH + "ALICE event not ready.");
if (gAliEveEvent->fESD == 0)
- throw(kEH + "AliESD not initialised.");
+ throw (kEH + "AliESD not initialised.");
return gAliEveEvent->fESD;
}
static const TEveException kEH("AliEveEventManager::AssertESDfriend ");
if (gAliEveEvent == 0)
- throw(kEH + "ALICE event not ready.");
+ throw (kEH + "ALICE event not ready.");
if (gAliEveEvent->fESDfriend == 0)
- throw(kEH + "AliESDfriend not initialised.");
+ throw (kEH + "AliESDfriend not initialised.");
return gAliEveEvent->fESDfriend;
}
+AliRawReader* AliEveEventManager::AssertRawReader()
+{
+ // Make sure raw-reader is initialized and return it.
+
+ static const TEveException kEH("AliEveEventManager::AssertRawReader ");
+
+ if (gAliEveEvent == 0)
+ throw (kEH + "ALICE event not ready.");
+ if (gAliEveEvent->fRawReader == 0)
+ throw (kEH + "RawReader not ready.");
+
+ return gAliEveEvent->fRawReader;
+}
+
AliMagF* AliEveEventManager::AssertMagField()
{
// Make sure AliMagF is initialized and return it.
AliGeomManager::LoadGeometry();
if ( ! AliGeomManager::GetGeometry())
{
- throw(kEH + "can not load geometry.");
+ throw (kEH + "can not load geometry.");
}
if ( ! AliGeomManager::ApplyAlignObjsFromCDB("ITS TPC TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO ACORDE"))
{
::Warning(kEH, "mismatch of alignable volumes. Proceeding.");
- // throw(kEH + "could not apply align objs.");
+ // throw (kEH + "could not apply align objs.");
}
+
+ // Temporary fix.
+ // In AliEve several simplified geometries can be loaded at a later stage.
+ // Should handle this inTEveManager::GetGeometry() by properly
+ // unlocking and re-locking the geo-manager.
+ TGeoManager::UnlockGeometry();
}
return AliGeomManager::GetGeometry();
class AliRunLoader;
class AliESDEvent;
class AliESDfriend;
+class AliRawReader;
class AliMagF;
class AliEveEventManager : public TEveEventManager
{
public:
- static void SetCdbUri(const Text_t* cdb) { if (cdb) fgCdbUri = cdb; }
- static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd)
- { fgAssertRunLoader = assertRunloader; fgAssertESD = assertEsd; }
+ static void SetESDFileName(const Text_t* esd);
+ static void SetRawFileName(const Text_t* raw);
+ static void SetCdbUri(const Text_t* cdb);
+ static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, Bool_t assertRaw);
AliEveEventManager();
AliEveEventManager(TString path, Int_t ev=0);
static AliRunLoader* AssertRunLoader();
static AliESDEvent* AssertESD();
static AliESDfriend* AssertESDfriend();
+ static AliRawReader* AssertRawReader();
static AliMagF* AssertMagField();
AliESDfriend* fESDfriend; // ESDfriend object.
Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data.
+ AliRawReader* fRawReader; // Raw-adata reader.
+
+ static TString fgESDFileName; // Name by which to open ESD.
+ static TString fgRawFileName; // Name by which to open raw-data file.
static TString fgCdbUri; // Global URI to CDB.
static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data.
static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data.
+ static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data.
static AliMagF* fgMagField; // Global pointer to magneti field.
--- /dev/null
+// $Id: geom_acorde.C 23412 2008-01-18 21:04:54Z mtadel $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+TString acorde_module_path(Int_t module);
+
+
+void acorde_raw()
+{
+ AliRawReader * reader = AliEveEventManager::AssertRawReader();
+ AliACORDERawStream * stream = new AliACORDERawStream(reader);
+
+ stream->Reset();
+ stream->Next();
+
+ UInt_t dy[4];
+ dy[0] = stream->GetWord(0);
+ dy[1] = stream->GetWord(1);
+ dy[2] = stream->GetWord(2);
+ dy[3] = stream->GetWord(3);
+
+ printf ("ACORDE event 0x%08x 0x%08x 0x%08x 0x%08x\n", dy[0], dy[1], dy[2], dy[3]);
+
+ gGeoManager = gEve->GetGeometry("geometry.root");
+
+ TEveElementList* acorde = new TEveElementList("ACORDE Raw");
+
+ gEve->AddElement(acorde);
+
+ Int_t shape_offset = TEveGeoShape::Class()->GetDataMemberOffset("fShape");
+
+ for (Int_t module=0; module < 60; ++module)
+ {
+ TString path = acorde_module_path(module);
+ // printf("%2d - %s\n", i, path.Data());
+
+ if ( ! gGeoManager->cd(path))
+ {
+ Warning("acorde_raw", "Module id=%d, path='%s' not found.\n", module, path.Data());
+ continue;
+ }
+
+ TEveGeoShape* eg_shape = new TEveGeoShape(Form("Module %d", module));
+
+ eg_shape->RefMainTrans().SetFrom(* gGeoManager->GetCurrentMatrix());
+
+ // Hack to set shape pointer, no interface available in TEveGeoShape.
+ * (TGeoShape**) (((char*)eg_shape) + shape_offset) = gGeoManager->GetCurrentVolume()->GetShape();
+
+ // From Matevz:
+ // Here check ctate and assign color, I do it partially for now.
+ Int_t word_idx = module / 30;
+ Int_t bit_idx = module % 30;
+ Bool_t val = (dy[word_idx] & (1 << bit_idx)) != 0;
+ //printf("Module %2d: word_idx = %d, bit_idx = %2d => val = %d\n",
+ // module, word_idx, bit_idx, val);
+ if (val)
+ eg_shape->SetMainColor((Color_t) 2);
+ else
+ eg_shape->SetMainColor((Color_t) 4);
+ eg_shape->StampColorSelection();
+
+ acorde->AddElement(eg_shape);
+ }
+
+ gEve->Redraw3D();
+}
+
+//==============================================================================
+//==============================================================================
+
+TString acorde_module_path(Int_t module)
+{
+ Int_t i, j;
+
+ if (module < 0 || module > 59)
+ {
+ Error("acorde_module_path", "module %d out of range.", module);
+ return "";
+ }
+
+ if (module == 0) i = 5, j = 71;
+ else if (module == 9) i = 5, j = 72;
+ else if (module == 50) i = 5, j = 73;
+ else if (module == 59) i = 5, j = 74;
+ else i = module / 20 + 4, j = module;
+
+ return Form("/ACORDE_1/ACORDE_%d_%d/ACORDE_MODULE_%d/ACORDE2_5", i, i, j);
+}
{
gGeoManager = gEve->GetGeometry("geometry.root");
+ TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("ACORDE_1");
+ if (!node) {
+ Warning("geom_acorde()", "Node ACORDE_1 not found,");
+ }
+
TEveElementList* list = new TEveElementList("ACORDE");
gEve->AddGlobalElement(list);
- for (Int_t i=1; i<61; ++i)
- {
- char form[1000];
- sprintf(form, "ACORDE1_%d", i);
- TGeoNode* node = gGeoManager->GetTopVolume()->FindNode(form);
- TEveGeoTopNode* re = new TEveGeoTopNode(gGeoManager, node);
- re->UseNodeTrans();
- gEve->AddGlobalElement(re, list);
- }
+ TEveGeoTopNode* re = new TEveGeoTopNode(gGeoManager, node);
+ re->UseNodeTrans();
+ gEve->AddGlobalElement(re, list);
gEve->Redraw3D();
}
--- /dev/null
+// $Id: its_raw.C 24929 2008-04-04 13:51:43Z mtadel $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+void its_common_foos()
+{}
+
+void its_display_raw_digits(AliEveITSDigitsInfo* di, Int_t mode)
+{
+ TString sSector;
+ TString bsSector="Sector";
+ TString sStave;
+ TString bsStave="Stave";
+ TString sLadder;
+ TString bsLadder="Ladder";
+
+ Int_t i=0;
+ Int_t nsec, nstave, nlad, nMod;
+
+ gEve->DisableRedraw();
+
+ if (mode & 1) {
+ TEveElementList* l = new TEveElementList("SPD0");
+ l->SetTitle("SPDs' first layer");
+ l->SetMainColor((Color_t)2);
+ gEve->AddElement(l);
+ for (nsec=0; nsec<10; nsec++) {
+ sSector = bsSector;
+ sSector += nsec;
+ TEveElementList* relSector = new TEveElementList(sSector.Data());
+ relSector->SetMainColor((Color_t)2);
+ gEve->AddElement(relSector, l);
+ for (nstave=0; nstave<2; nstave++){
+ sStave = bsStave;
+ sStave += nstave;
+ TEveElementList* relStave = new TEveElementList(sStave.Data());
+ relStave->SetMainColor((Color_t)2);
+ gEve->AddElement(relStave, relSector);
+ for (nMod=0; nMod<4; nMod++)
+ {
+ if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
+ {
+ AliEveITSModule* m = new AliEveITSModule(i, di);
+ gEve->AddElement(m, relStave);
+ }
+ ++i;
+ }
+ }
+ }
+ } else {
+ i += 10*2*4;
+ }
+
+ if (mode & 2) {
+ TEveElementList* l = new TEveElementList("SPD1");
+ l->SetTitle("SPDs' second layer");
+ l->SetMainColor((Color_t)2);
+ gEve->AddElement(l);
+
+ for (nsec=0; nsec<10; nsec++) {
+ sSector = bsSector;
+ sSector += nsec;
+ TEveElementList* relSector = new TEveElementList(sSector.Data());
+ relSector->SetMainColor((Color_t)2);
+ gEve->AddElement(relSector, l);
+ for (nstave=0; nstave<4; nstave++){
+ sStave = bsStave;
+ sStave += nstave;
+ TEveElementList* relStave = new TEveElementList(sStave.Data());
+ relStave->SetMainColor((Color_t)2);
+ gEve->AddElement(relStave, relSector);
+ for (nMod=0; nMod<4; nMod++)
+ {
+ if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
+ {
+ AliEveITSModule* m = new AliEveITSModule(i, di);
+ gEve->AddElement(m, relStave);
+ }
+ ++i;
+ }
+ }
+ }
+ } else {
+ i += 10*4*4;
+ }
+
+ if (mode & 4) {
+ TEveElementList* l = new TEveElementList("SDD2");
+ l->SetTitle("SDDs' first layer");
+ l->SetMainColor((Color_t)3);
+ gEve->AddElement(l);
+
+ for (nlad=0; nlad<14; nlad++) {
+ sLadder = bsLadder;
+ sLadder += nlad;
+ TEveElementList* relLadder = new TEveElementList(sLadder.Data());
+ relLadder->SetMainColor((Color_t)3);
+ gEve->AddElement(relLadder, l);
+ for (nMod=0; nMod<6; nMod++) {
+ AliEveITSModule* m = new AliEveITSModule(i++, di);
+ gEve->AddElement(m, relLadder);
+ }
+ }
+ } else {
+ i += 14*6;
+ }
+
+ if (mode & 8) {
+ TEveElementList* l = new TEveElementList("SDD3");
+ l->SetTitle("SDDs' second layer");
+ l->SetMainColor((Color_t)3);
+ gEve->AddElement(l);
+ for (nlad=0; nlad<22; nlad++) {
+ sLadder = bsLadder;
+ sLadder += nlad;
+ TEveElementList* relLadder = new TEveElementList(sLadder.Data());
+ relLadder->SetMainColor((Color_t)3);
+ gEve->AddElement(relLadder, l);
+ for (nMod=0; nMod<8; nMod++) {
+ AliEveITSModule* m = new AliEveITSModule(i++, di);
+ gEve->AddElement(m, relLadder);
+ }
+ }
+ } else {
+ i += 22*8;
+ }
+
+ if (mode & 16) {
+ TEveElementList* l = new TEveElementList("SSD4");
+ l->SetTitle("SSDs' first layer");
+ l->SetMainColor((Color_t)4);
+ gEve->AddElement(l);
+ for (nlad=0; nlad<34; nlad++) {
+ sLadder = bsLadder;
+ sLadder += nlad;
+ TEveElementList* relLadder = new TEveElementList(sLadder.Data());
+ relLadder->SetMainColor((Color_t)4);
+ gEve->AddElement(relLadder, l);
+ for (nMod=0; nMod<22; nMod++) {
+ AliEveITSModule* m = new AliEveITSModule(i++, di);
+ gEve->AddElement(m, relLadder);
+ }
+ }
+ } else {
+ i += 34*22;
+ }
+
+ if (mode & 32) {
+ TEveElementList* l = new TEveElementList("SSD5");
+ l->SetTitle("SSDs' second layer");
+ l->SetMainColor((Color_t)4);
+ gEve->AddElement(l);
+ for (nlad=0; nlad<38; nlad++) {
+ sLadder = bsLadder;
+ sLadder += nlad;
+ TEveElementList* relLadder = new TEveElementList(sLadder.Data());
+ relLadder->SetMainColor((Color_t)4);
+ gEve->AddElement(relLadder, l);
+ for (nMod=0; nMod<25; nMod++) {
+ AliEveITSModule* m = new AliEveITSModule(i++, di);
+ gEve->AddElement(m, relLadder);
+ }
+ }
+ } else {
+ i += 38*25;
+ }
+
+ gEve->EnableRedraw();
+}
// 16, 32 : SSD
// By default import all layers.
-void its_digits(Int_t mode=63)
+void its_digits(Int_t mode = 63)
{
AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
rl->LoadDigits("ITS");
TTree* dt = rl->GetTreeD("ITS", false);
+ TEveUtil::LoadMacro("its_common_foos.C");
+
AliEveITSDigitsInfo* di = new AliEveITSDigitsInfo();
di->SetTree(dt);
- di->Dump();
+ // di->Dump();
gStyle->SetPalette(1, 0);
- gEve->DisableRedraw();
-
- TString sSector;
- TString bsSector="Sector";
- TString sStave;
- TString bsStave="Stave";
- TString sLadder;
- TString bsLadder="Ladder";
-
- Int_t i=0;
- Int_t nsec, nstave, nlad, nMod;
-
- if (mode & 1) {
- TEveElementList* l = new TEveElementList("SPD0");
- l->SetTitle("SPDs' first layer");
- l->SetMainColor((Color_t)2);
- gEve->AddElement(l);
- for (nsec=0; nsec<10; nsec++) {
- sSector = bsSector;
- sSector += nsec;
- TEveElementList* relSector = new TEveElementList(sSector.Data());
- relSector->SetMainColor((Color_t)2);
- gEve->AddElement(relSector, l);
- for (nstave=0; nstave<2; nstave++){
- sStave = bsStave;
- sStave += nstave;
- TEveElementList* relStave = new TEveElementList(sStave.Data());
- relStave->SetMainColor((Color_t)2);
- gEve->AddElement(relStave, relSector);
- for (nMod=0; nMod<4; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relStave);
- }
- }
- }
- } else {
- i += 10*2*4;
- }
-
- if (mode & 2) {
- TEveElementList* l = new TEveElementList("SPD1");
- l->SetTitle("SPDs' second layer");
- l->SetMainColor((Color_t)2);
- gEve->AddElement(l);
-
- for (nsec=0; nsec<10; nsec++) {
- sSector = bsSector;
- sSector += nsec;
- TEveElementList* relSector = new TEveElementList(sSector.Data());
- relSector->SetMainColor((Color_t)2);
- gEve->AddElement(relSector, l);
- for (nstave=0; nstave<4; nstave++){
- sStave = bsStave;
- sStave += nstave;
- TEveElementList* relStave = new TEveElementList(sStave.Data());
- relStave->SetMainColor((Color_t)2);
- gEve->AddElement(relStave, relSector);
- for (nMod=0; nMod<4; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relStave);
- }
- }
- }
- } else {
- i += 10*4*4;
- }
-
- if (mode & 4) {
- TEveElementList* l = new TEveElementList("SDD2");
- l->SetTitle("SDDs' first layer");
- l->SetMainColor((Color_t)3);
- gEve->AddElement(l);
-
- for (nlad=0; nlad<14; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)3);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<6; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 14*6;
- }
-
- if (mode & 8) {
- TEveElementList* l = new TEveElementList("SDD3");
- l->SetTitle("SDDs' second layer");
- l->SetMainColor((Color_t)3);
- gEve->AddElement(l);
- for (nlad=0; nlad<22; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)3);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<8; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 22*8;
- }
-
- if (mode & 16) {
- TEveElementList* l = new TEveElementList("SSD4");
- l->SetTitle("SSDs' first layer");
- l->SetMainColor((Color_t)4);
- gEve->AddElement(l);
- for (nlad=0; nlad<34; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)4);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<22; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 34*22;
- }
-
- if (mode & 32) {
- TEveElementList* l = new TEveElementList("SSD5");
- l->SetTitle("SSDs' second layer");
- l->SetMainColor((Color_t)4);
- gEve->AddElement(l);
- for (nlad=0; nlad<38; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)4);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<25; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 38*25;
- }
-
- gEve->EnableRedraw();
+ its_display_raw_digits(di, mode);
}
* full copyright notice. *
**************************************************************************/
-void its_raw(const char *input = "rawdata.root",
- Int_t mode = 63,
- Int_t nrun = 0,
- Int_t event = 0,
- Bool_t accumulate = kFALSE)
+// Load ITS raw-data.
+// Argument mode is a bitwise or determining which layers to import:
+// 1, 2 : SPD
+// 4, 8 : SDD
+// 16, 32 : SSD
+// By default import all layers.
+
+void its_raw(Int_t mode = 63)
{
- if (gSystem->AccessPathName(input, kReadPermission))
- {
- Error("its_raw", "file '%s' not found.", input);
- return;
- }
+ AliRawReader *rawReader = AliEveEventManager::AssertRawReader();
- AliCDBManager::Instance()->SetRun(nrun);
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
-
- AliRawReader *rawReader = NULL;
- TString fileName(input);
- if (fileName.EndsWith("/")) {
- rawReader = new AliRawReaderFile(fileName);
- } else if (fileName.EndsWith(".root")) {
- rawReader = new AliRawReaderRoot(fileName);
- } else if (!fileName.IsNull()) {
- rawReader = new AliRawReaderDate(fileName);
- }
+ TEveUtil::LoadMacro("its_common_foos.C");
AliEveITSDigitsInfo* di = new AliEveITSDigitsInfo();
-
- if (accumulate) AliLog::SetGlobalLogLevel(AliLog::kError);
- Int_t ev = 0;
- do {
- if (ev % 100 == 0) printf("AliEveEventManager: %d\n", ev);
- if (rawReader->NextEvent() == kFALSE)
- {
- Error("its_raw", "Reading event %d failed (requested event %d).", ev, event);
- if (accumulate)
- break;
- else
- return;
- }
- if (accumulate) di->ReadRaw(rawReader,mode);
- } while (++ev < event);
-
- if ( ! accumulate) di->ReadRaw(rawReader,mode);
-
- di->Dump();
-
- delete rawReader;
+ di->ReadRaw(rawReader,mode);
+ // di->Dump();
gStyle->SetPalette(1, 0);
- gEve->DisableRedraw();
-
- TString sSector;
- TString bsSector="Sector";
- TString sStave;
- TString bsStave="Stave";
- TString sLadder;
- TString bsLadder="Ladder";
-
- Int_t i=0;
- Int_t nsec, nstave, nlad, nMod;
-
- if (mode & 1) {
- TEveElementList* l = new TEveElementList("SPD0");
- l->SetTitle("SPDs' first layer");
- l->SetMainColor((Color_t)2);
- gEve->AddElement(l);
- for (nsec=0; nsec<10; nsec++) {
- sSector = bsSector;
- sSector += nsec;
- TEveElementList* relSector = new TEveElementList(sSector.Data());
- relSector->SetMainColor((Color_t)2);
- gEve->AddElement(relSector, l);
- for (nstave=0; nstave<2; nstave++){
- sStave = bsStave;
- sStave += nstave;
- TEveElementList* relStave = new TEveElementList(sStave.Data());
- relStave->SetMainColor((Color_t)2);
- gEve->AddElement(relStave, relSector);
- for (nMod=0; nMod<4; nMod++)
- {
- if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
- {
- AliEveITSModule* m = new AliEveITSModule(i, di);
- gEve->AddElement(m, relStave);
- }
- ++i;
- }
- }
- }
- } else {
- i += 10*2*4;
- }
-
- if (mode & 2) {
- TEveElementList* l = new TEveElementList("SPD1");
- l->SetTitle("SPDs' second layer");
- l->SetMainColor((Color_t)2);
- gEve->AddElement(l);
-
- for (nsec=0; nsec<10; nsec++) {
- sSector = bsSector;
- sSector += nsec;
- TEveElementList* relSector = new TEveElementList(sSector.Data());
- relSector->SetMainColor((Color_t)2);
- gEve->AddElement(relSector, l);
- for (nstave=0; nstave<4; nstave++){
- sStave = bsStave;
- sStave += nstave;
- TEveElementList* relStave = new TEveElementList(sStave.Data());
- relStave->SetMainColor((Color_t)2);
- gEve->AddElement(relStave, relSector);
- for (nMod=0; nMod<4; nMod++)
- {
- if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
- {
- AliEveITSModule* m = new AliEveITSModule(i, di);
- gEve->AddElement(m, relStave);
- }
- ++i;
- }
- }
- }
- } else {
- i += 10*4*4;
- }
-
- if (mode & 4) {
- TEveElementList* l = new TEveElementList("SDD2");
- l->SetTitle("SDDs' first layer");
- l->SetMainColor((Color_t)3);
- gEve->AddElement(l);
-
- for (nlad=0; nlad<14; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)3);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<6; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 14*6;
- }
-
- if (mode & 8) {
- TEveElementList* l = new TEveElementList("SDD3");
- l->SetTitle("SDDs' second layer");
- l->SetMainColor((Color_t)3);
- gEve->AddElement(l);
- for (nlad=0; nlad<22; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)3);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<8; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 22*8;
- }
-
- if (mode & 16) {
- TEveElementList* l = new TEveElementList("SSD4");
- l->SetTitle("SSDs' first layer");
- l->SetMainColor((Color_t)4);
- gEve->AddElement(l);
- for (nlad=0; nlad<34; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)4);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<22; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 34*22;
- }
-
- if (mode & 32) {
- TEveElementList* l = new TEveElementList("SSD5");
- l->SetTitle("SSDs' second layer");
- l->SetMainColor((Color_t)4);
- gEve->AddElement(l);
- for (nlad=0; nlad<38; nlad++) {
- sLadder = bsLadder;
- sLadder += nlad;
- TEveElementList* relLadder = new TEveElementList(sLadder.Data());
- relLadder->SetMainColor((Color_t)4);
- gEve->AddElement(relLadder, l);
- for (nMod=0; nMod<25; nMod++) {
- AliEveITSModule* m = new AliEveITSModule(i++, di);
- gEve->AddElement(m, relLadder);
- }
- }
- } else {
- i += 38*25;
- }
-
- gEve->EnableRedraw();
+ its_display_raw_digits(di, mode);
}
#include <TSystem.h>
#include <TError.h>
+#include <AliLog.h>
+
#include <TEveUtil.h>
#include <TEveManager.h>
}
gROOT->SetMacroPath(macPath);
+ AliLog* log = new AliLog;
+
TRint app("App", &argc, argv);
TEveManager::Create();
DHDR := EveBase/LinkDef.h
-EINCLUDE := ITS TPC
+EINCLUDE := RAW ITS TPC
#include <string>
#endif
-// !!!!! Need initialization that will also work for raw.
-// Path and event-id are usually not needed.
-// const Text_t* raw_file = 0,
-
void alieve_init(const Text_t* path = ".", Int_t event=0,
- const Text_t* cdburi = 0,
- Bool_t assert_runloader=kFALSE, Bool_t assert_esd=kFALSE)
+ const Text_t* esdfile = 0,
+ const Text_t* rawfile = 0,
+ const Text_t* cdburi = 0,
+ Bool_t assert_runloader = kFALSE,
+ Bool_t assert_esd = kFALSE,
+ Bool_t assert_raw = kFALSE)
{
Info("alieve_init", "Adding standard macros.");
TString hack = gSystem->pwd(); // Problem with TGFileBrowser cding
gSystem->ProcessEvents();
+ AliEveEventManager::SetESDFileName(esdfile);
+ AliEveEventManager::SetRawFileName(rawfile);
+ AliEveEventManager::SetAssertElements(assert_runloader, assert_esd, assert_raw);
+ AliEveEventManager::SetCdbUri(cdburi);
+
// Open event
- if(path != 0) {
- AliEveEventManager::SetCdbUri(cdburi);
- AliEveEventManager::SetAssertElements(assert_runloader, assert_esd);
+ if(path != 0)
+ {
printf("Opening event %d from '%s' ...", event, path); fflush(stdout);
gAliEveEvent = new AliEveEventManager(path, event);
printf(" done.\n");